PageSourceSearch

https://www.deribit.com/assets/index-CghNCkJm.js

js deribit.com collected 2026-09-24 09:24:01 UTC 2,406,668 bytes, 2,107 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ScreenJumioVerification-yNbo1xNR.js","assets/rolldown-runtime-Dm_dodAQ.js","assets/dist-kP4lwCLB.js","assets/formatInstrumentName-BdL2ER9e.js","assets/settings-TfkyLzTl.js","assets/language-ktSrA6bV.js","assets/Dialog-D2e7T0j5.js","assets/toPropertyKey-DNtqID5a.js","assets/LayoutWithHeader-Di_FGUDL.js","assets/CustomPageDialog-_e116eQ5.js","assets/CurrencySearch-Cjm0Ht2t.js","assets/Autocomplete-BPZFKHlc.js","assets/kb-C43rgmoy.js","assets/useCurrency-C8kZJM0Z.js","assets/useInterfaceSettings-B5PSGmjP.js","assets/Alert-QMlVVaLv.js","assets/lib-BxRhgZ-z.js","assets/securityKeyWrapper-CoTpwXzT.js","assets/purify.es-BXpDQPfJ.js","assets/CurrencyFiltersContainer-D2vXJW72.js","assets/useUserLegalInfo-Ciai6lnJ.js","assets/VerificationNotAvailable-DfrTE0XE.js","assets/ScreenTrading-qRYbXHSf.js","assets/GridLayout-7Tq47ZWH.js","assets/makeCancelable-C8bAPW8g.js","assets/NumberInput-Czt-ZkMV.js","assets/rgb-Bi07fZ0b.js","assets/utils-BRkeb-tG.js","assets/useComponentSettings-CBWp4PH1.js","assets/getPriceColumn-CdEWyMn4.js","assets/TradingModal-C0moZ_o4.js","assets/getCurrencyDecimals-BA-quMDV.js","assets/getExtractedOrderstate-DlhjBXhP.js","assets/Overlays-M-2jz6Yx.js","assets/withStyles-DHmX0L0V.js","assets/Autocomplete-ByLQoC1k.js","assets/isOrderDeepIntoMarket-p6YvgmWm.js","assets/dataSource-BsJ_ikD6.js","assets/usePrice-0bMZ7g06.js","assets/AccountIdTag-BY0b5kLK.js","assets/uniq-BaYZmi0o.js","assets/OptionWizard-BIkrrAiR.js","assets/highcharts-react.min-CMWkZjZU.js","assets/calculationsCore-hr38g8Vz.js","assets/highcharts-DX1hRlHA.js","assets/PriceLadderSelect-CuGYLQ6d.js","assets/DeribitHighcharts-h4VRqQhx.js","assets/OptionsChart-CWyvGUFl.js","assets/EconomicCalendar-Dnoa02h3.js","assets/Liquidations-BJRnlsVJ.js","assets/GridLayout-Bsd3LWeE.css","assets/ScreenAccount-sK-sE7Xm.js","assets/useAffiliateProgram-u6jFFjlw.js","assets/CurrencyTag-BBbBTil0.js","assets/ToggleButton-C9eBzhvR.js","assets/ScreenStatistics-B2R6BjXv.js","assets/ScreenKnowledgeBase-impQV_mo.js","assets/ScreenOptionWizard-CGiOdvPv.js","assets/ScreenDashboard-CFXsSF41.js","assets/ScreenFuturesSpreadsMatrix-M7YnLl9t.js","assets/ScreenOptionsChart-BiSRL_1n.js","assets/ScreenBlockRfqs-DzyjOEAR.js","assets/ScreenBrokerage-anjzrQt6.js"])))=>i.map(i=>d[i]);
2(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`3dcc281a8e79fff17adf3e75579634b27b7debb6`}}catch{}})();try{(function(){var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`063fd662-a2c4-45b4-ac1d-09a5cd0a0673`,e._sentryDebugIdIdentifier=`sentry-dbid-063fd662-a2c4-45b4-ac1d-09a5cd0a0673`)})()}catch{}import{i as e,r as t,s as n,t as r}from"./rolldown-runtime-Dm_dodAQ.js";import{$ as i,$t as o,A as s,At as c,Bt as p,Cn as m,Ct as h,Dn as g,Dt as _,En as v,Et as y,F as b,Ft as x,G as S,Gt as C,Ht as w,I as T,It as E,Jt as D,K as O,Kt as k,L as ee,Lt as te,M as A,Mt as j,N as ne,Nt as M,Ot as re,Pt as ie,Qt as ae,R as oe,Rt as se,Sn as ce,St as le,Tn as ue,Tt as de,Ut as fe,Vt as pe,Wt as me,Xt as he,Yt as ge,Zt as _e,_n as ve,_t as ye,an as be,bn as xe,bt as Se,cn as Ce,dn as we,dt as Te,en as Ee,fn as De,ft as Oe,gn as ke,gt as Ae,hn as je,ht as Me,in as Ne,it as Pe,j as Fe,jt as Ie,kt as Le,l as Re,ln as ze,mn as Be,mt as Ve,nn as He,nt as Ue,on as We,ot as Ge,pn as Ke,pt as qe,qt as Je,rn as Ye,rt as Xe,sn as Ze,tn as Qe,u as $e,un as et,vn as tt,vt as nt,wn as rt,wt as it,xn as at,xt as ot,yn as st,yt as ct,z as ut,zt as dt}from"./CustomPageDialog-_e116eQ5.js";import{A as ft,D as pt,E as mt,T as ht,c as _t,g as vt,h as yt,k as bt,n as N,o as xt,p as St,t as Ct,v as wt}from"./dist-kP4lwCLB.js";import{$ as Tt,$a as Et,$i as Dt,$o as Ot,$r as kt,$u as At,A as jt,Ad as Mt,Al as Nt,B as Pt,Ba as Ft,Bi as It,Bl as Lt,Bs as Rt,Bt as zt,Cc as Bt,Cr as Vt,Dd as Ht,Dl as Ut,Dn as Wt,E as Gt,Ec as Kt,Ed as qt,El as Jt,Es as Yt,Fl as Xt,Fr as Zt,Fu as Qt,Gl as $t,Gs as en,Gt as tn,Ha as nn,Ht as rn,I as an,Ir as on,It as sn,Iu as cn,Jn as ln,Ju as un,Ki as dn,Kl as fn,Kn as pn,Ks as mn,Kt as hn,Ku as gn,L as _n,La as vn,Ll as yn,Ln as bn,Lt as xn,M as Sn,Ml as Cn,Mn as P,Mt as wn,N as Tn,Nl as En,Nn as Dn,Nr as On,Ns as kn,Nt as An,O as jn,Od as Mn,Ol as Nn,On as Pn,Os as Fn,Pl as In,Ps as Ln,Pu as Rn,Qa as zn,Qi as Bn,Qn as Vn,Qo as Hn,Qr as Un,Qu as Wn,Ri as Gn,Rl as Kn,Rn as qn,Rt as Jn,Sa as Yn,Sd as Xn,St as Zn,Ta as Qn,Td as $n,Ts as er,Tt as tr,Un as nr,Ut as rr,Vi as F,Vr as I,Vt as ir,Vu as ar,Wi as sr,Wl as cr,Wn as lr,Wt as ur,Xc as dr,Xi as fr,Xl as pr,Xn as mr,Yi as hr,Yn as gr,Zi as _r,Zo as vr,Zs as yr,Zt as br,_c as xr,_d as Sr,_n as Cr,_o as wr,a as Tr,ai as L,as as Er,au as Dr,b as Or,br as kr,bt as Ar,bu as jr,cn as Mr,cu as Nr,da as Pr,di as Fr,dn as Ir,do as Lr,ds as R,ec as Rr,ei as zr,eo as Br,es as z,et as Vr,fi as Hr,fo as Ur,ft as Wr,gc as Gr,gn as Kr,go as qr,gs as Jr,gt as Yr,hd as Xr,hn as Zr,ho as Qr,ht as $r,hu as ei,i as ti,id as ni,is as ri,jl as ii,jn as ai,jr as oi,k as si,kd as ci,kn as B,lc as li,m as ui,ma as di,ms as fi,mt as pi,n as mi,nn as hi,nr as gi,od as _i,oi as vi,os as yi,ou as bi,pa as xi,pn as Si,ps as Ci,pt as wi,ql as Ti,qn as Ei,qs as Di,qt as Oi,r as ki,ra as Ai,rc as ji,rn as Mi,rs as Ni,si as Pi,so as Fi,sr as Ii,su as Li,t as Ri,ta as zi,tc as Bi,ti as Vi,to as Hi,tr as Ui,ts as V,ua as Wi,uo as Gi,vc as Ki,vd as qi,vo as Ji,w as Yi,wa as Xi,wl as Zi,wo as Qi,wr as $i,xa as ea,xd as ta,xr as na,xt as ra,ys as ia,yt as aa,zi as oa,zl as sa,zr as H,zt as ca}from"./formatInstrumentName-BdL2ER9e.js";import{$ as la,$i as ua,$n as da,$r as fa,$t as pa,A as ma,Ai as ha,An as ga,Ar as _a,At as va,B as ya,Bi as ba,Bn as xa,Br as Sa,Bt as Ca,C as wa,Ci as Ta,Cn as Ea,
2Cr as Da,Ct as Oa,D as ka,Di as Aa,Dn as ja,Dr as Ma,Dt as Na,E as Pa,Ei as Fa,En as Ia,Er as La,Et as Ra,F as za,Fi as Ba,Fn as Va,Fr as Ha,Ft as Ua,G as Wa,Gi as Ga,Gn as Ka,Gr as qa,Gt as Ja,H as Ya,Hi as Xa,Hn as Za,Hr as Qa,Ht as $a,I as eo,Ii as to,In as no,Ir as ro,It as io,J as U,Ji as ao,Jn as oo,Jr as so,Jt as co,K as lo,Ki as uo,Kn as fo,Kr as po,Kt as mo,L as ho,Li as go,Ln as _o,Lr as vo,Lt as yo,M as bo,Mi as xo,Mn as So,Mr as Co,Mt as wo,N as To,Ni as Eo,Nn as Do,Nr as Oo,Nt as ko,O as Ao,Oi as jo,On as Mo,Or as No,Ot as Po,P as Fo,Pi as Io,Pn as Lo,Pr as Ro,Pt as zo,Q as Bo,Qi as Vo,Qn as Ho,Qr as Uo,Qt as Wo,R as Go,Ri as Ko,Rn as qo,Rr as Jo,Rt as Yo,S as Xo,Si as Zo,Sn as Qo,Sr as $o,St as es,T as ts,Ti as ns,Tn as rs,Tr as as,Tt as os,U as ss,Ui as cs,Un as ls,Ur as us,Ut as ds,V as fs,Vi as ps,Vn as ms,Vr as hs,Vt as gs,W as _s,Wi as vs,Wn as ys,Wr as bs,Wt as xs,X as Ss,Xi as Cs,Xn as ws,Xr as Ts,Xt as Es,Y as Ds,Yi as W,Yn as Os,Yr as ks,Yt as As,Z as js,Zi as Ms,Zn as Ns,Zr as Ps,Zt as Fs,_ as Is,_a as Ls,_i as Rs,_n as zs,_r as Bs,_t as Vs,aa as Hs,ai as Us,an as Ws,ar as Gs,at as Ks,b as qs,ba as Js,bi as Ys,bn as Xs,br as Zs,bt as G,ca as Qs,ci as $s,cn as ec,cr as tc,ct as nc,da as rc,di as ic,dn as ac,dr as oc,dt as sc,ea as cc,ei as lc,en as uc,er as dc,et as fc,fa as pc,fi as mc,fn as hc,fr as gc,ft as _c,g as vc,ga as yc,gi as bc,gn as xc,gr as Sc,gt as Cc,h as wc,ha as Tc,hi as Ec,hn as Dc,hr as Oc,ht as kc,ia as Ac,ii as jc,in as Mc,ir as Nc,it as Pc,j as Fc,ji as Ic,jn as Lc,jr as Rc,jt as zc,k as Bc,ki as Vc,kn as Hc,kr as Uc,kt as Wc,la as Gc,li as Kc,ln as qc,lr as Jc,lt as Yc,ma as Xc,mi as Zc,mn as Qc,mr as $c,mt as el,na as tl,ni as nl,nn as rl,nr as il,nt as K,oa as al,oi as ol,on as sl,or as cl,ot as ll,pa as ul,pi as dl,pn as fl,pr as pl,pt as ml,q as hl,qi as gl,qn as _l,qr as vl,qt as yl,ra as bl,ri as xl,rn as Sl,rr as Cl,rt as wl,s as Tl,sa as q,si as El,sn as Dl,sr as Ol,st as kl,ta as Al,ti as jl,tn as Ml,tr as Nl,tt as Pl,u as Fl,ua as Il,ui as Ll,un as J,ur as Rl,ut as zl,va as Bl,vi as Vl,vn as Hl,vr as Ul,vt as Wl,w as Gl,wi as Kl,wn as ql,wr as Jl,wt as Yl,xi as Xl,xn as Zl,xr as Ql,xt as $l,ya as eu,yi as tu,yn as nu,yr as ru,yt as iu,z as au,zi as ou,zn as su,zr as cu,zt as lu}from"./CurrencySearch-Cjm0Ht2t.js";import{a as uu,i as du,n as fu,o as pu,r as mu,t as hu}from"./useCurrency-C8kZJM0Z.js";import{A as gu,An as _u,Cn as vu,Dn as yu,En as bu,H as xu,K as Su,Kt as Cu,Lt as wu,Q as Tu,S as Eu,Tn as Du,V as Ou,Z as ku,_n as Au,at as ju,b as Mu,d as Nu,et as Pu,f as Fu,gn as Iu,i as Lu,j as Ru,m as zu,n as Bu,o as Vu,p as Hu,qt as Uu,r as Wu,s as Gu,t as Ku,tt as qu,u as Ju,v as Yu,vn as Xu,w as Zu,x as Qu,y as $u,yn as ed}from"./settings-TfkyLzTl.js";import{t as td}from"./useInterfaceSettings-B5PSGmjP.js";import{A as nd,G as rd,H as id,J as ad,K as od,L as sd,M as cd,O as ld,R as ud,U as dd,V as fd,W as pd,Y as md,a as hd,b as gd,c as _d,f as vd,h as yd,i as bd,j as xd,n as Y,o as Sd,p as Cd,q as wd,r as Td,t as Ed,u as Dd,z as Od}from"./Dialog-D2e7T0j5.js";import{c as kd,d as Ad,f as jd,h as Md,i as Nd,m as Pd,s as Fd,t as Id,u as Ld}from"./NumberInput-Czt-ZkMV.js";import{$ as Rd,A as zd,B as Bd,D as Vd,Ft as Hd,H as Ud,I as Wd,Kt as Gd,P as Kd,Q as qd,R as Jd,Rt as Yd,U as Xd,V as Zd,W as Qd,Zt as $d,an as ef,cn as tf,dn as nf,in as rf,j as af,on as of,pn as sf,rn as cf,sn as lf,t as uf,un as df,z as ff,zt as pf}from"./LayoutWithHeader-Di_FGUDL.js";import{$ as mf,At as hf,E as gf,Et as _f,Ft as vf,G as yf,Gt as bf,H as xf,Ht as Sf,It as Cf,K as wf,Mt as Tf,Nt as Ef,Ot as Df,Pt as Of,Q as kf,T as Af,Tt as jf,U as Mf,Ut as Nf,Vt as Pf,Wt as Ff,X as If,Y as Lf,Z as Rf,_ as zf,a as Bf,at as Vf,c as Hf,ct as Uf,d as Wf,dt as Gf,et as Kf,f as qf,g as Jf,h as Yf,l as Xf,m as Zf,n as Qf,o as $f,ot as ep,p as tp,q as np,r as rp,s as ip,st as ap,t as op,tt as sp,u as cp,w as lp}from"./getExtractedOrderstate-DlhjBXhP.js";import{a as up,f as dp,i as fp,u as pp}from"./Overlays-M-2jz6Yx.js";import{A as mp,D as hp,E as gp,O as _p,S as vp,T as yp,l as bp,o as xp,t as Sp,w as Cp,x as wp}from"./Autocomplete-BPZFKHlc.js";import{t as Tp}from"./Alert-QMlVVaLv.js";import{i as Ep,n as Dp,t as Op}from"./language-ktSrA6bV.js";import{t as kp}from"./withStyles-DHmX0L0V.js";import"./Autocomplete-ByLQoC1k.js";import{r as Ap,t as jp}from"./kb-C43rgmoy.js";import{n as Mp}from"./lib-BxRhgZ-z.js";import{t as Np}from"./securityKeyWrapper-CoTpwXzT.js";import{t as Pp}from"./purify.es-BXpDQPfJ.js";
2import{a as Fp,c as Ip,o as Lp,r as Rp}from"./CurrencyFiltersContainer-D2vXJW72.js";import{i as zp,n as Bp,s as Vp,t as Hp}from"./isOrderDeepIntoMarket-p6YvgmWm.js";import{t as Up}from"./useUserLegalInfo-Ciai6lnJ.js";import{t as Wp}from"./useComponentSettings-CBWp4PH1.js";(function polyfill(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))processPreload(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&processPreload(e)}).observe(document,{childList:!0,subtree:!0});function getFetchOpts(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function processPreload(e){if(e.ep)return;e.ep=!0;let t=getFetchOpts(e);fetch(e.href,t)}})();var Gp=n(g());globalThis.Buffer=Gp.Buffer;var X=ft(),MD5=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility=this.md5(`hello`)!=`5d41402abc4b2a76b9719d911017c592`}md5cycle(e,t){let n=e[0],r=e[1],i=e[2],o=e[3];n=this.ff(n,r,i,o,t[0],7,-680876936),o=this.ff(o,n,r,i,t[1],12,-389564586),i=this.ff(i,o,n,r,t[2],17,606105819),r=this.ff(r,i,o,n,t[3],22,-1044525330),n=this.ff(n,r,i,o,t[4],7,-176418897),o=this.ff(o,n,r,i,t[5],12,1200080426),i=this.ff(i,o,n,r,t[6],17,-1473231341),r=this.ff(r,i,o,n,t[7],22,-45705983),n=this.ff(n,r,i,o,t[8],7,1770035416),o=this.ff(o,n,r,i,t[9],12,-1958414417),i=this.ff(i,o,n,r,t[10],17,-42063),r=this.ff(r,i,o,n,t[11],22,-1990404162),n=this.ff(n,r,i,o,t[12],7,1804603682),o=this.ff(o,n,r,i,t[13],12,-40341101),i=this.ff(i,o,n,r,t[14],17,-1502002290),r=this.ff(r,i,o,n,t[15],22,1236535329),n=this.gg(n,r,i,o,t[1],5,-165796510),o=this.gg(o,n,r,i,t[6],9,-1069501632),i=this.gg(i,o,n,r,t[11],14,643717713),r=this.gg(r,i,o,n,t[0],20,-373897302),n=this.gg(n,r,i,o,t[5],5,-701558691),o=this.gg(o,n,r,i,t[10],9,38016083),i=this.gg(i,o,n,r,t[15],14,-660478335),r=this.gg(r,i,o,n,t[4],20,-405537848),n=this.gg(n,r,i,o,t[9],5,568446438),o=this.gg(o,n,r,i,t[14],9,-1019803690),i=this.gg(i,o,n,r,t[3],14,-187363961),r=this.gg(r,i,o,n,t[8],20,1163531501),n=this.gg(n,r,i,o,t[13],5,-1444681467),o=this.gg(o,n,r,i,t[2],9,-51403784),i=this.gg(i,o,n,r,t[7],14,1735328473),r=this.gg(r,i,o,n,t[12],20,-1926607734),n=this.hh(n,r,i,o,t[5],4,-378558),o=this.hh(o,n,r,i,t[8],11,-2022574463),i=this.hh(i,o,n,r,t[11],16,1839030562),r=this.hh(r,i,o,n,t[14],23,-35309556),n=this.hh(n,r,i,o,t[1],4,-1530992060),o=this.hh(o,n,r,i,t[4],11,1272893353),i=this.hh(i,o,n,r,t[7],16,-155497632),r=this.hh(r,i,o,n,t[10],23,-1094730640),n=this.hh(n,r,i,o,t[13],4,681279174),o=this.hh(o,n,r,i,t[0],11,-358537222),i=this.hh(i,o,n,r,t[3],16,-722521979),r=this.hh(r,i,o,n,t[6],23,76029189),n=this.hh(n,r,i,o,t[9],4,-640364487),o=this.hh(o,n,r,i,t[12],11,-421815835),i=this.hh(i,o,n,r,t[15],16,530742520),r=this.hh(r,i,o,n,t[2],23,-995338651),n=this.ii(n,r,i,o,t[0],6,-198630844),o=this.ii(o,n,r,i,t[7],10,1126891415),i=this.ii(i,o,n,r,t[14],15,-1416354905),r=this.ii(r,i,o,n,t[5],21,-57434055),n=this.ii(n,r,i,o,t[12],6,1700485571),o=this.ii(o,n,r,i,t[3],10,-1894986606),i=this.ii(i,o,n,r,t[10],15,-1051523),r=this.ii(r,i,o,n,t[1],21,-2054922799),n=this.ii(n,r,i,o,t[8],6,1873313359),o=this.ii(o,n,r,i,t[15],10,-30611744),i=this.ii(i,o,n,r,t[6],15,-1560198380),r=this.ii(r,i,o,n,t[13],21,1309151649),n=this.ii(n,r,i,o,t[4],6,-145523070),o=this.ii(o,n,r,i,t[11],10,-1120210379),i=this.ii(i,o,n,r,t[2],15,718787259),r=this.ii(r,i,o,n,t[9],21,-343485551),e[0]=this.add32(n,e[0]),e[1]=this.add32(r,e[1]),e[2]=this.add32(i,e[2]),e[3]=this.add32(o,e[3])}cmn(e,t,n,r,i,o){return t=this.add32(this.add32(t,e),this.add32(r,o)),this.add32(t<<i|t>>>32-i,n)}ff(e,t,n,r,i,o,s){return this.cmn(t&n|~t&r,e,t,i,o,s)}gg(e,t,n,r,i,o,s){return this.cmn(t&r|n&~r,e,t,i,o,s)}hh(e,t,n,r,i,o,s){return this.cmn(t^n^r,e,t,i,o,s)}ii(e,t,n,r,i,o,s){return this.cmn(n^(t|~r),e,t,i,o,s)}md51(e){let t=e.length,n=[1732584193,-271733879,-1732584194,271733878],r;for(r=64;r<=e.length;r+=64)this.md5cycle(n,this.md5blk(e.substring(r-64,r)));e=e.substring(r-64);let i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(r=0;r<e.length;r++)i[r>>2]|=e.charCodeAt(r)<<(r%4<<3);if(i[r>>2]|=128<<(r%4<<3),r>
255)for(this.md5cycle(n,i),r=0;r<16;r++)i[r]=0;return i[14]=t*8,this.md5cycle(n,i),n}md5blk(e){let t=[];for(let n=0;n<64;n+=4)t[n>>2]=e.charCodeAt(n)+(e.charCodeAt(n+1)<<8)+(e.charCodeAt(n+2)<<16)+(e.charCodeAt(n+3)<<24);return t}rhex(e){let t=`0123456789abcdef`.split(``),n=``,r=0;for(;r<4;r++)n+=t[e>>r*8+4&15]+t[e>>r*8&15];return n}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){let n=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(n>>16)<<16|n&65535}},Kp={"01":`GRID`,"02":`CHARTS`,"0102":`BOTH`},qp=`https://www.ag-grid.com/licensing/`,Jp=class _LicenseManager{constructor(e){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=e,this.md5=new MD5,this.md5.init()}validateLicense(){let e=this.getLicenseDetails(_LicenseManager.licenseKey),t=`AG Grid ${e.currentLicenseType===`BOTH`?`and AG Charts `:``}Enterprise`,n=e.suppliedLicenseType===void 0?``:`AG ${e.suppliedLicenseType===`BOTH`?`Grid and AG Charts`:e.suppliedLicenseType===`GRID`?`Grid`:`Charts`} Enterprise`;if(e.missing)(!this.isWebsiteUrl()||this.isForceWatermark())&&this.outputMissingLicenseKey(t);else if(e.expired){let r=_LicenseManager.getGridReleaseDate(),i=_LicenseManager.formatDate(r);this.outputExpiredKey(e.expiry,i,t,n)}else e.valid?e.isTrial&&e.trialExpired&&this.outputExpiredTrialKey(e.expiry,t,n):this.outputInvalidLicenseKey(!!e.incorrectLicenseType,t,n)}static extractExpiry(e){let t=e.substring(e.lastIndexOf(`_`)+1,e.length);return new Date(parseInt(_LicenseManager.decode(t),10))}static extractLicenseComponents(e){let t=e.replace(/[\u200B-\u200D\uFEFF]/g,``);if(t=t.replace(/\r?\n|\r/g,``),e.length<=32)return{md5:null,license:e,version:null,isTrial:null};let n=t.length-32,r=t.substring(n),i=t.substring(0,n),[o,s,c]=_LicenseManager.extractBracketedInformation(t);return{md5:r,license:i,version:o,isTrial:s,type:c}}getLicenseDetails(e){let t=_LicenseManager.chartsLicenseManager?`BOTH`:`GRID`;if(!e?.length)return{licenseKey:e,valid:!1,missing:!0,currentLicenseType:t};let n=_LicenseManager.getGridReleaseDate(),{md5:r,license:i,version:o,isTrial:s,type:c}=_LicenseManager.extractLicenseComponents(e),p=r===this.md5.md5(i)&&!e.includes(`For_Trialing_ag-Grid_Only`),m,h,g=null,_=!1,v;function handleTrial(){m=g<new Date,h=void 0}if(p&&(g=_LicenseManager.extractExpiry(i),p=!isNaN(g.getTime()),p))switch(h=n>g,o){case`legacy`:case`2`:s&&handleTrial();break;case`3`:c?.length?(v=c,c!==Kp[`01`]&&c!==Kp[`0102`]||t===`BOTH`&&v!==`BOTH`?(p=!1,_=!0):s&&handleTrial()):p=!1}return p?{licenseKey:e,valid:p,expiry:_LicenseManager.formatDate(g),expired:h,version:o,isTrial:s,trialExpired:m,incorrectLicenseType:_,currentLicenseType:t,suppliedLicenseType:v}:{licenseKey:e,valid:p,incorrectLicenseType:_,currentLicenseType:t,suppliedLicenseType:v}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!!this.watermarkMessage?.length}getWatermarkMessage(){return this.watermarkMessage||``}getHostname(){let{hostname:e=``}=(this.document.defaultView||window).location;return e}isForceWatermark(){let{pathname:e}=(this.document.defaultView||window).location;return e?e.includes(`forceWatermark`):!1}isWebsiteUrl(){return this.getHostname().match(/^((?:[\w-]+\.)?ag-grid\.com)$/)!==null}isLocalhost(){return this.getHostname().match(/^(?:127\.0\.0\.1|localhost)$/)!==null}static formatDate(e){let t=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],n=e.getDate(),r=e.getMonth(),i=e.getFullYear();return n+` `+t[r]+` `+i}static getGridReleaseDate(){return new Date(parseInt(_LicenseManager.decode(_LicenseManager.RELEASE_INFORMATION),10))}static decode(e){let t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`,n=``,r,i,o,s,c,p,m,h=0,g=e.replace(/[^A-Za-z0-9+/=]/g,``);for(;h<g.length;)s=t.indexOf(g.charAt(h++)),c=t.indexOf(g.charAt(h++)),p=t.indexOf(g.charAt(h++)),m=t.indexOf(g.charAt(h++)),r=s<<2|c>>4,i=(c&15)<<4|p>
2>2,o=(p&3)<<6|m,n+=String.fromCharCode(r),p!=64&&(n+=String.fromCharCode(i)),m!=64&&(n+=String.fromCharCode(o));return n=_LicenseManager.utf8_decode(n),n}static utf8_decode(e){e=e.replace(/rn/g,`n`);let t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r<128?t+=String.fromCharCode(r):r>127&&r<2048?(t+=String.fromCharCode(r>>6|192),t+=String.fromCharCode(r&63|128)):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128),t+=String.fromCharCode(r&63|128))}return t}static setChartsLicenseManager(e){this.chartsLicenseManager=e,this.chartsLicenseManager?.setLicenseKey(this.licenseKey,!0)}static setLicenseKey(e){Xs(this.licenseKey)&&this.licenseKey!==e&&Ll(291,void 0,`AG Grid: License Key being set multiple times with different values. This can result in an incorrect license key being used.`),this.licenseKey=e,this.chartsLicenseManager?.setLicenseKey(e,!0)}static extractBracketedInformation(e){if(!e.includes(`[`))return[`legacy`,!1,void 0];let t=e.match(/\[(.*?)\]/g).map(e=>e.replace(`[`,``).replace(`]`,``));if(!t||t.length===0)return[`legacy`,!1,void 0];let n=t.filter(e=>e===`TRIAL`).length===1,r=t.filter(e=>e.indexOf(`v`)===0)[0];return[r?r.replace(`v`,``):`legacy`,n,Kp[t.filter(e=>Kp[e])[0]]]}centerPadAndOutput(e){let t=this.totalMessageLength-e.length;console.error(e.padStart(t/2+e.length,`*`).padEnd(this.totalMessageLength,`*`))}padAndOutput(e,t=`*`,n=``){console.error(e.padEnd(this.totalMessageLength-n.length,t)+n)}outputInvalidLicenseKey(e,t,n){e?(this.centerPadAndOutput(``),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(` Incompatible License Key `),this.padAndOutput(`* Your license key is for ${n} only and does not cover you for ${t}.`,` `,`*`),this.padAndOutput(`* To troubleshoot your license key visit ${qp}.`,` `,`*`),this.centerPadAndOutput(``),this.centerPadAndOutput(``)):(this.centerPadAndOutput(``),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(` Invalid License Key `),this.padAndOutput(`* Your license key is not valid.`,` `,`*`),this.padAndOutput(`* To troubleshoot your license key visit ${qp}.`,` `,`*`),this.centerPadAndOutput(``),this.centerPadAndOutput(``)),this.watermarkMessage=`Invalid License`}outputExpiredTrialKey(e,t,n){this.centerPadAndOutput(``),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(` Trial Period Expired. `),this.padAndOutput(`* Your trial only license for ${n} expired on ${e}.`,` `,`*`),this.padAndOutput(`* Please email [email protected] 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 [email protected] for a trial license key.`,` `,`*`),this.centerPadAndOutput(``),this.centerPadAndOutput(``),this.watermarkMessage=`For Trial Use Only`}outputExpiredKey(e,t,n,r){this.centerPadAndOutput(``),this.centerPadAndOutput(` ${n} License `),this.centerPadAndOutput(` Incompatible Software Version `),this.padAndOutput(`* Your license key works with versions${r==``?``:` of ${r}`} released before ${e}.`,` `,`*`),this.padAndOutput(`* The version you are trying to use was released on ${t}.`,` `,`*`),this.padAndOutput(`* Please contact [email protected] to renew your license key.`,` `,`*`),this.centerPadAndOutput(``),this.centerPadAndOutput(``),this.watermarkMessage=`License Expired`}};Jp.RELEASE_INFORMATION=`MTc2MTIyODQxNDc2OA==`;var Yp=Jp,Xp=`.ag-watermark{bottom:20px;color:#9b9b9b;opacity:.7;position:absolute;transition:opacity 1s ease-out 3s;&:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDkiIGhlaWdodD0iMzYiIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyMDkgMzYiPjxwYXRoIGZpbGw9IiM5YjliOWIiIGQ9Ik0xOTIuOTkzIDIzLjY1OHYtNy45NDZoLTEzLjU0MWwtNy45NDcgNy45NDZ6TTIwOC4yNSAzLjk1aC0xNi45NzRsLTguMDEgNy45NDdoMjQuOTg0ek0xNjMu
2NjIyIDMxLjYwNWw0LjA2OS00LjA2OWgxMy43MzJ2Ny45NDdoLTE3LjgwMXoiLz48cGF0aCBmaWxsPSIjOWI5YjliIiBkPSJNMTY2LjYxIDE5Ljc4aDguNzczbDguMDEtNy45NDZIMTY2LjYxek0xNTcuMDExIDMxLjYwNWg2LjYxMWw3Ljg4My03Ljk0N2gtMTQuNDk0ek0xOTEuMjc2IDMuOTVsLTQuMDY4IDQuMDdIMTYxLjI3Vi4wNzJoMzAuMDA2ek0yMC44NCAzMC4yMDZIOC4zNzhsLTIuMTYyIDUuMzRILjc1TDEyLjI1NyA4LjU5Mmg0Ljc2OEwyOC41MyAzNS41NDZoLTUuNTN6bS0xLjcxNy00LjI2TDE0LjYwOSAxNC45NWwtNC41MTQgMTAuOTk4ek0xMDQuNDM3IDE4LjUwOWMxLjU4OS0yLjM1MiA1LjU5NC0yLjYwNyA3LjI0Ny0yLjYwN3Y0LjU3OGMtMi4wMzQgMC00LjA2OS4wNjMtNS4yNzcuOTUzLTEuMjA3Ljg5LTEuODQzIDIuMDk4LTEuODQzIDMuNTZ2MTAuNTUzaC00Ljk1OVYxNS45MDJoNC43Njh6TTExOS4zNzYgMTUuOTAyaC00Ljk1OHYxOS42NDRoNC45NTh6TTExOS4zNzYgNy4xM2gtNC45NTh2NS44NDhoNC45NTh6TTE0My45NzkgNy4xM3YyOC40MTZoLTQuNzY4bC0uMTI3LTIuOTg4YTguMyA4LjMgMCAwIDEtMi42NyAyLjQ4Yy0xLjA4MS41NzItMi40MTYuODktMy45NDIuODktMS4zMzUgMC0yLjYwNi0uMjU1LTMuNjg3LS43LTEuMTQ0LS41MDgtMi4xNjItMS4xNDQtMi45ODgtMi4wMzRhOS42IDkuNiAwIDAgMS0xLjk3MS0zLjE3OWMtLjUwOC0xLjIwNy0uNjk5LTIuNjA2LS42OTktNC4xMzJzLjI1NC0yLjkyNC42OTktNC4xOTZjLjUwOS0xLjI3MSAxLjE0NS0yLjM1MiAxLjk3MS0zLjI0MnMxLjg0NC0xLjU4OSAyLjk4OC0yLjA5OCAyLjM1Mi0uNzYzIDMuNjg3LS43NjNjMS41MjYgMCAyLjc5Ny4yNTUgMy44NzguODI3czEuOTcxIDEuMzM1IDIuNjcgMi40MTZWNy4xOTNoNC45NTl6bS0xMC40MjYgMjQuNTM4YzEuNjUzIDAgMi45MjQtLjU3MiAzLjk0MS0xLjY1M3MxLjUyNi0yLjU0MyAxLjUyNi00LjMyMy0uNTA5LTMuMTc4LTEuNTI2LTQuMzIyYy0xLjAxNy0xLjA4MS0yLjI4OC0xLjY1My0zLjk0MS0xLjY1My0xLjU5IDAtMi45MjUuNTcyLTMuODc4IDEuNjUzLTEuMDE3IDEuMDgtMS41MjYgMi41NDMtMS41MjYgNC4zMjIgMCAxLjc4LjUwOSAzLjE4IDEuNTI2IDQuMjYgMS4wMTcgMS4xNDQgMi4yODggMS43MTYgMy44NzggMS43MTZNNTcuMjAyIDIwLjM1M0g0NC45MzN2NC4yNTloNi45OTNjLS4xOSAyLjE2MS0xLjAxNyAzLjgxNC0yLjQxNiA1LjE1LTEuMzk4IDEuMjctMy4xNzggMS45MDYtNS40NjcgMS45MDYtMS4yNzEgMC0yLjQ4LS4yNTQtMy40OTYtLjY5OWE3IDcgMCAwIDEtMi43MzQtMS45N2MtLjc2My0uODI3LTEuMzM1LTEuODQ0LTEuNzgtMy4wNTJzLS42MzYtMi40OC0uNjM2LTMuOTQyLjE5LTIuNzMzLjYzNi0zLjk0MWMuMzgxLTEuMjA4IDEuMDE3LTIuMTYyIDEuNzgtMy4wNTIuNzYzLS44MjYgMS42NTMtMS40NjIgMi43MzMtMS45N2E5LjEgOS4xIDAgMCAxIDMuNTYtLjdxNC4wMDUgMCA2LjEwMyAxLjkwN2wzLjMwNi0zLjMwNWMtMi40OC0xLjkwNy01LjY1OC0yLjkyNS05LjQwOS0yLjkyNS0yLjA5NyAwLTQuMDA0LjMxOC01LjcyMSAxLjAxOC0xLjcxNi42OTktMy4xNzkgMS41ODktNC4zODYgMi43OTdBMTIuMSAxMi4xIDAgMCAwIDMxLjIgMTYuMjJjLS42MzUgMS43MTctLjk1MyAzLjYyNC0uOTUzIDUuNjU4cy4zMTggMy45NDIgMS4wMTcgNS42NThjLjcgMS43MTcgMS41OSAzLjE3OSAyLjc5NyA0LjM4N2ExMi4xIDEyLjEgMCAwIDAgNC4zODcgMi43OTdjMS43MTYuNyAzLjYyMyAxLjAxNyA1LjY1NyAxLjAxNyAyLjAzNSAwIDMuODc4LS4zMTggNS41MzEtMS4wMTcgMS42NTMtLjcgMy4wNTItMS41OSA0LjE5Ni0yLjc5N3ExLjcxNi0xLjgxMiAyLjY3LTQuMzg3Yy42MzYtMS43MTYuOTU0LTMuNjIzLjk1NC01LjY1OHYtLjgyNmMtLjE5MS0uMTI3LS4yNTUtLjQ0NS0uMjU1LS43TTk1Ljk4MiAyMC4zNTNoLTEyLjI3djQuMjU5aDYuOTkzYy0uMTkgMi4xNjEtMS4wMTcgMy44MTQtMi40MTYgNS4xNS0xLjM5OCAxLjI3LTMuMTc4IDEuOTA2LTUuNDY3IDEuOTA2LTEuMjcxIDAtMi40OC0uMjU0LTMuNDk2LS42OTlhNyA3IDAgMCAxLTIuNzM0LTEuOTdjLS43NjMtLjgyNy0xLjMzNS0xLjg0NC0xLjc4LTMuMDUycy0uNjM2LTIuNDgtLjYzNi0zLjk0Mi4xOS0yLjczMy42MzYtMy45NDFjLjM4MS0xLjIwOCAxLjAxNy0yLjE2MiAxLjc4LTMuMDUyLjc2My0uODI2IDEuNjUzLTEuNDYyIDIuNzM0LTEuOTdhOS4xIDkuMSAwIDAgMSAzLjU2LS43cTQuMDA1IDAgNi4xMDMgMS45MDdsMy4zMDUtMy4zMDVjLTIuNDc5LTEuOTA3LTUuNjU4LTIuOTI1LTkuNDA4LTIuOTI1LTIuMDk4IDAtNC4wMDUuMzE4LTUuNzIyIDEuMDE4LTEuNzE2LjY5OS0zLjE3OCAxLjU4OS00LjM4NiAyLjc5N2ExMi4xIDEyLjEgMCAwIDAtMi43OTcgNC4zODZjLS42MzYgMS43MTctLjk1NCAzLjYyNC0uOTU0IDUuNjU4cy4zMTggMy45NDIgMS4wMTcgNS42NThjLjcgMS43MTcgMS41OSAzLjE3OSAyLjc5NyA0LjM4N2ExMi4xIDEyLjEgMCAwIDAgNC4zODcgMi43OTdjMS43MTYuNyAzLjYyMyAxLjAxNyA1LjY1OCAxLjAxNyAyLjAzNCAwIDMuODc4LS4zMTggNS41My0xLjAxNyAxLjY1My0uNyAzLjA1Mi0xLjU5IDQuMTk2LTIuNzk3cTEuNzE4LTEuODEyIDIuNjctNC4zODdjLjYzNi0xLjcxNi45NTQtMy42MjMuOTU0LTUuNjU4di0uODI2Yy0uMTktLjEyNy0uMjU1LS40NDUtLjI1NS0uNyIvPjwvc3ZnPg==");background-repeat:no-repeat;background-size:170px 40px;content:"";display:block;height:40px;width:170px}}:where(.ag-ltr) .ag-watermark{right:25px}:where(.ag-rtl) .ag-watermark{left:25px}.ag-watermark-text{font-family:Impact,sans-serif;font-size:19px;font-weight:700;opacity:.5}:where(.ag-ltr) .ag-watermark-text{padding-left:.7rem}:where(.ag-rtl) .ag-watermark-text{padding-right:.7rem}`,Zp={tag:`div`,cls:`ag-watermark`,children:[{tag:`div`,ref:`eLicenseTextRef`,cls:`ag-watermark-text`}]},AgWatermark=class extends K{constructor(){super(Zp),this.eLicenseTextRef=null,this.registerCSS(Xp)}wireBeans(e){this.licenseManager=e.licenseManager}postConstruct(){let e=this.shouldDisplayWatermark();this.setDisplayed(e),e&&(this.eLicenseTextRef.textContent=this.licenseManager.getWatermarkMessage(),window.setTimeout(()=>this.addCss(`ag-opacity-zero`),0),window.setTimeout(()=>this.setDisplayed(!1),5e3))}shouldDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}},Qp={selector:`AG-WATERMARK`,component:AgWatermark},GridLicenseManager=class extends U{constructor(){super(...arguments),this.beanName=`licenseManager`}postConstruct(){this.validateLicense()}validateLicense(){this.licenseManager=new Yp(_l(this.beans)),this.licenseManager.validateLicense()}static getLicenseDetails(e){return new Yp(null).getLicenseDetails(e)}getWatermarkSelector(){return Qp}isDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}getWatermarkMessage(){return this.licenseManager.getWatermarkMessage()}static setLicenseKey(e){Yp.setLicenseKey(e)}static setChartsLicenseManager(e){Yp.setChartsLicenseManager(e)}},$p=9525,em={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},tm=`\r
3`;function returnAttributeIfPopulated(e,t,n){if(!t&&t!==``&&t!==0)return``;let r=t;return typeof t==`boolean`&&n&&(r=n(t)),` ${e}="${r}"`}function createXmlHeader(e={}){let t=[`version`];return e.version||=`1.0`,e.encoding&&t.push(`encoding`),e.standalone&&t.push(`standalone`),`<?xml ${t.map(t=>`${t}="${e[t]}"`).join(` `)} ?>`}function createXml(e,t){let n=``;if(e.properties&&(e.properties.prefixedAttributes&&e.properties.prefixedAttributes.forEac
3h(e=>{for(let r of Object.keys(e.map))n+=returnAttributeIfPopulated(e.prefix+r,e.map[r],t)}),e.properties.rawMap))for(let r of Object.keys(e.properties.rawMap))n+=returnAttributeIfPopulated(r,e.properties.rawMap[r],t);let r=`<`+e.name+n;if(!e.children&&e.textNode==null)return r+`/>`+tm;if(e.textNode!=null)return r+`>`+e.textNode+`</`+e.name+`>`+tm;if(r+=`>`+tm,e.children)for(let n of e.children)r+=createXml(n,t);return r+`</`+e.name+`>`+tm}var pointsToPixel=e=>Math.round(e*96/72),pixelsToEMU=e=>Math.ceil(e*$p),getFontFamilyId=e=>{if(e===void 0)return;let t=[`Automatic`,`Roman`,`Swiss`,`Modern`,`Script`,`Decorative`].indexOf(e||`Automatic`);return Math.max(t,0)},getHeightFromProperty=(e,t)=>{if(!t)return;let n;return n=typeof t==`number`?t:t({rowIndex:e}),n},setExcelImageTotalWidth=(e,t)=>{let{colSpan:n,column:r}=e.position;if(e.width){if(n){let i=t.slice(r-1,r+n-1),o=0;for(let t=0;t<i.length;t++){let n=i[t].getActualWidth();if(e.width<o+n){e.position.colSpan=t+1,e.totalWidth=e.width,e.width=e.totalWidth-o;break}o+=n}}else e.totalWidth=e.width}},setExcelImageTotalHeight=(e,t)=>{let{rowSpan:n,row:r}=e.position;if(e.height){if(n){let i=0,o=0;for(let s=r;s<r+n;s++){let n=pointsToPixel(getHeightFromProperty(s,t)||20);if(e.height<i+n){e.position.rowSpan=o+1,e.totalHeight=e.height,e.height=e.totalHeight-i;break}i+=n,o++}}else e.totalHeight=e.height}},createXmlPart=(e,t)=>{let n=createXmlHeader({encoding:`UTF-8`,standalone:`yes`}),r=createXml(e);return t?r:`${n}${r}`},getExcelColumnName=e=>{let t=String.fromCharCode,n=Math.floor(e/26),r=e%26;return!n||e===26?t(65+e-1):r?n<26?t(65+n-1)+t(65+r-1):getExcelColumnName(n)+t(65+r-1):getExcelColumnName(n-1)+`Z`},sanitizeTableName=e=>e.replaceAll(`
4`,`_x000a_`),replaceInvisibleCharacters=e=>{if(e==null)return null;let t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r>=0&&r<=31&&r!==10){let e=`_x${r.toString(16).toUpperCase().padStart(4,`0`)}_`;t+=e}else t+=e[n]}return t},buildSharedString=e=>{let t=[];for(let n of e.keys()){let e=n.toString(),r={name:`t`,textNode:nu(replaceInvisibleCharacters(e))};e.trim().length!==e.length&&(r.properties={rawMap:{"xml:space":`preserve`}}),t.push({name:`si`,children:[r]})}return t},nm={getTemplate(e){let{name:t,ContentType:n,Extension:r,PartName:i}=e;return{name:t,properties:{rawMap:{Extension:r,PartName:i,ContentType:n}}}}},_normaliseImageExtension=e=>e===`jpg`?`jpeg`:e,rm={getTemplate(e){let t=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`})),n=ih.size,r=ah.size,i={};oh.forEach(e=>{i[_normaliseImageExtension(e.type)]=!0});let o=Array(n).fill(void 0).map((e,t)=>({name:`Override`,ContentType:`application/vnd.openxmlformats-officedocument.drawing+xml`,PartName:`/xl/drawings/drawing${t+1}.xml`})),s=[];
4ch.forEach(({name:e})=>{s.push({name:`Override`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml`,PartName:`/xl/tables/${e}.xml`})});let c=Object.keys(i).map(e=>({name:`Default`,ContentType:`image/${e}`,Extension:e}));return r&&c.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:[...c,{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,...s,{name:`Override`,ContentType:`application/vnd.openxmlformats-package.core-properties+xml`,PartName:`/docProps/core.xml`}].map(e=>nm.getTemplate(e))}}},im={getTemplate(e){let 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}]}}},getAnchor=(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()}]}),getExt=e=>{let 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?.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}},getNvPicPr=(e,t)=>({name:`xdr:nvPicPr`,children:[{name:`xdr:cNvPr`,properties:{rawMap:{id:t,name:e.id,descr:e.altText==null?void 0:e.altText}},children:[getExt(e)]},{name:`xdr:cNvPicPr`,properties:{rawMap:{preferRelativeResize:`0`}},children:[{name:`a:picLocks`}]}]}),getColorDetails=e=>{if(!e.saturation&&!e.tint)return;let t=[];return e.saturation&&t.push({name:`a:satMod`,properties:{rawMap:{val:e.saturation*1e3}}}),e.tint&&t.push({name:`a:tint`,properties:{rawMap:{val:e.tint*1e3}}}),t},getDuoTone=(e,t)=>({name:`a:duotone`,children:[{name:`a:prstClr`,properties:{rawMap:{val:e.color}},children:getColorDetails(e)},{name:`a:srgbClr`,properties:{rawMap:{val:t.color}},children:getColorDetails(t)}]}),getBlipFill=(e,t)=>{let n;if(e.transparency){let t=Math.min(Math.max(e.transparency,0),100);n=[{name:`a:alphaModFix`,properties:{rawMap:{amt:1e5-Math.round(t*1e3)}}}]}if(e.recolor)switch(n||=[],e.recolor.toLocaleLowerCase()){case`grayscale`:n.push({name:`a:grayscl`});break;case`sepia`:n.push(getDuoTone({color:`black`},{color:`D9C3A5`,tint:50,saturation:180}));break;case`washout`:n.push({name:`a:lum`,properties:{rawMap:{bright:`70000`,contrast:`-70000`}}})}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:n},{name:`a:stretch`,children:[{name:`a:fillRect`}]}]}},getSpPr=(e,t)=>{let n={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){let t=e.rotation;n.properties={rawMap:{rot:Math.min(Math.max(t,0),360)*6e4}}}return{name:`xdr:spPr`,children:[n,{name:`a:prstGeom`,properties:{rawMap:{prst:`rect`}},children:[{name:`a:avLst`}]}]}},getImageBoxSize=e=>{e.fitCell=!!e.fitCell||!e.width||!e.height;let{position:t={},fitCell:n,width:r=0,height:i=0,totalHeight:o,totalWidth:s}=e,{offsetX:c=0,offsetY:p=0,row:m=1,rowSpan:h=1,column:g=1,colSpan:_=1}=t;return{from:{row:m-1,col:g-1,offsetX:pixelsToEMU(c),offsetY:pixelsToEMU(p)},to:{row:m-1+(n?1:h-1),col:g-1+(n?1:_-1),offsetX:pixelsToEMU(r+c),offsetY:pixelsToEMU(i+p)},height:pixelsToEMU(o||i),width:pixelsToEMU(s||r)}},getPicture=(e,t,n,r)=>({name:`xdr:pic`,children:[getNvPicPr(e,t+1),getBlipFill(e,n+1),getSpPr(e,r)]}),am={getTemplate(e){let{sheetIndex:t}=e,n=ih.get(t),r=sh.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:n.map((e,t)=>{let n=getImageBoxSize(e);return{name:`xdr:twoCellAnchor`,properties:{rawMap:{editAs:`absolute`}},children:[getAnchor(`from`,n.from),getAnchor(`to`,n.to),getPicture
4(e,t,r.get(e.id).index,n),{name:`xdr:clientData`}]}})}}},om={getTemplate(e){let{Id:t,Type:n,Target:r}=e;return{name:`Relationship`,properties:{rawMap:{Id:t,Type:n,Target:r}}}}},sm={getTemplate(e){return{name:`Relationships`,properties:{rawMap:{xmlns:`http://schemas.openxmlformats.org/package/2006/relationships`}},children:e.map(e=>om.getTemplate(e))}}},cm={getTemplate(e){return{name:`sst`,properties:{rawMap:{xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,count:e.size,uniqueCount:e.size}},children:buildSharedString(e)}}},getWeightName=e=>{switch(e){case 1:return`thin`;case 2:return`medium`;case 3:return`thick`;default:return`hair`}},lm={None:`None`,Dot:`Dotted`,Dash:`Dashed`,Double:`Double`,DashDot:`DashDot`,DashDotDot:`DashDotDot`,SlantDashDot:`SlantDashDot`,Continuous:`Continuous`},um=[`Dashed`,`DashDot`,`DashDotDot`],dm={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`},fm={Automatic:`general`,Left:`left`,Center:`center`,Right:`right`,Fill:`fill`,Justify:`justify`,CenterAcrossSelection:`centerContinuous`,Distributed:`distributed`,JustifyDistributed:`justify`},pm={Automatic:void 0,Top:`top`,Bottom:`bottom`,Center:`center`,Justify:`justify`,Distributed:`distributed`,JustifyDistributed:`justify`},convertLegacyPattern=e=>e?dm[e]||e:`none`,convertLegacyColor=e=>e==null?e:(e.charAt(0)===`#`&&(e=e.substring(1)),e.length===6?`FF`+e:e),convertLegacyBorder=(e,t)=>{if(!e)return`thin`;let n=getWeightName(t);if(e===`Continuous`)return n;let r=lm[e];return n===`medium`&&um.some(e=>e===r)?`medium${r}`:`${r.charAt(0).toLowerCase()}${r.substring(1)}`},convertLegacyHorizontalAlignment=e=>fm[e]||`general`,convertLegacyVerticalAlignment=e=>pm[e]||void 0,getBorderColor=e=>({name:`color`,properties:{rawMap:{rgb:convertLegacyColor(e||`#000000`)}}}),mm={getTemplate(e){let{left:t,right:n,top:r,bottom:i,diagonal:o}=e,s=t?[getBorderColor(t.color)]:void 0,c=n?[getBorderColor(n.color)]:void 0,p=r?[getBorderColor(r.color)]:void 0,m=i?[getBorderColor(i.color)]:void 0,h=o?[getBorderColor(o.color)]:void 0;return{name:`border`,children:[{name:`left`,properties:{rawMap:{style:t?.style}},children:s},{name:`right`,properties:{rawMap:{style:n?.style}},children:c},{name:`top`,properties:{rawMap:{style:r?.style}},children:p},{name:`bottom`,properties:{rawMap:{style:i?.style}},children:m},{name:`diagonal`,properties:{rawMap:{style:o?.style}},children:h}]}}},hm={getTemplate(e){return{name:`borders`,properties:{rawMap:{count:e.length}},children:e.map(e=>mm.getTemplate(e))}}},getReadingOrderId=e=>{let t=[`Context`,`LeftToRight`,`RightToLeft`].indexOf(e);return Math.max(t,0)},gm={getTemplate(e){let{horizontal:t,indent:n,readingOrder:r,rotate:i,shrinkToFit:o,vertical:s,wrapText:c}=e;return{name:`alignment`,properties:{rawMap:{horizontal:t&&convertLegacyHorizontalAlignment(t),indent:n,readingOrder:r&&getReadingOrderId(r),textRotation:i,shrinkToFit:o,vertical:s&&convertLegacyVerticalAlignment(s),wrapText:c}}}}},_m={getTemplate(e){let t=e.protected===!1?0:1;return{name:`protection`,properties:{rawMap:{hidden:+(e.hideFormula===!0),locked:t}}}}},vm={getTemplate(e){let{alignment:t,borderId:n,fillId:r,fontId:i,numFmtId:o,protection:s,quotePrefix:c,xfId:p}=e,m=[];return t&&m.push(gm.getTemplate(t)),s&&m.push(_m.getTemplate(s)),{name:`xf`,properties:{rawMap:{applyAlignment:t?1:void 0,applyProtection:s?1:void 0,applyBorder:n?1:void 0,applyFill:r?1:void 0,borderId:n,fillId:r,a
4pplyFont:i?1:void 0,fontId:i,applyNumberFormat:o?1:void 0,numFmtId:o,quotePrefix:c?1:void 0,xfId:p}},children:m.length?m:void 0}}},ym={getTemplate(e){return{name:`cellStyleXfs`,properties:{rawMap:{count:e.length}},children:e.map(e=>vm.getTemplate(e))}}},bm={getTemplate(e){let{builtinId:t,name:n,xfId:r}=e;return{name:`cellStyle`,properties:{rawMap:{builtinId:t,name:n,xfId:r}}}}},xm={getTemplate(e){return{name:`cellStyles`,properties:{rawMap:{count:e.length}},children:e.map(e=>bm.getTemplate(e))}}},Sm={getTemplate(e){return{name:`cellXfs`,properties:{rawMap:{count:e.length}},children:e.map(e=>vm.getTemplate(e))}}},Cm={getTemplate(e){let{patternType:t,fgTheme:n,fgTint:r,fgRgb:i,bgRgb:o,bgIndexed:s}=e,c={name:`patternFill`,properties:{rawMap:{patternType:t}}};return(n||r||i)&&(c.children=[{name:`fgColor`,properties:{rawMap:{theme:n,tint:r,rgb:i}}}]),(s||o)&&(c.children||=[],c.children.push({name:`bgColor`,properties:{rawMap:{indexed:s,rgb:o}}})),{name:`fill`,children:[c]}}},wm={getTemplate(e){return{name:`fills`,properties:{rawMap:{count:e.length}},children:e.map(e=>Cm.getTemplate(e))}}},Tm={getTemplate(e){let{size:t,colorTheme:n,color:r=`FF000000`,fontName:i=`Calibri`,family:o,scheme:s,italic:c,bold:p,strikeThrough:m,outline:h,shadow:g,underline:_,verticalAlign:v}=e,y=[{name:`sz`,properties:{rawMap:{val:t}}},{name:`color`,properties:{rawMap:{theme:n,rgb:r}}},{name:`name`,properties:{rawMap:{val:i}}}];return o&&y.push({name:`family`,properties:{rawMap:{val:o}}}),s&&y.push({name:`scheme`,properties:{rawMap:{val:s}}}),c&&y.push({name:`i`}),p&&y.push({name:`b`}),m&&y.push({name:`strike`}),h&&y.push({name:`outline`}),g&&y.push({name:`shadow`}),_&&y.push({name:`u`,properties:{rawMap:{val:_}}}),v&&y.push({name:`vertAlign`,properties:{rawMap:{val:v}}}),{name:`font`,children:y}}},Em={getTemplate(e){return{name:`fonts`,properties:{rawMap:{count:e.length}},children:e.map(e=>Tm.getTemplate(e))}}};function prepareString(e){let t=e.split(/(\[[^\]]*\])/);for(let e=0;e<t.length;e++){let n=t[e];n.length&&(n.startsWith(`[`)||(n=n.replace(/\$/g,`"$"`)),t[e]=nu(n))}return t.join(``)}var Dm={getTemplate(e){let{formatCode:t,numFmtId:n}=e;return t.length&&(t=prepareString(t)),{name:`numFmt`,properties:{rawMap:{formatCode:t,numFmtId:n}}}}},Om={getTemplate(e){return{name:`numFmts`,properties:{rawMap:{count:e.length}},children:e.map(e=>Dm.getTemplate(e))}}},km,Am,jm,Mm,Nm,Pm,Fm,Im,Lm,getStyleName=(e,t)=>(e.includes(`mixedStyle`)&&t>1&&(e+=`_${t}`),e),resetStylesheetValues=()=>{km={base:0},Am=[],jm=[{fontName:`Calibri`,colorTheme:`1`,family:`2`,scheme:`minor`}],Mm=[{patternType:`none`},{patternType:`gray125`}],Nm=[{left:void 0,right:void 0,top:void 0,bottom:void 0,diagonal:void 0}],Pm=[{borderId:0,fillId:0,fontId:0,numFmtId:0}],Fm=[{borderId:0,fillId:0,fontId:0,numFmtId:0,xfId:0}],Im=[{builtinId:0,name:`Normal`,xfId:0}]},registerFill=e=>{let t=convertLegacyPattern(e.pattern),n=convertLegacyColor(e.color),r=convertLegacyColor(e.patternColor),i=Mm.findIndex(e=>{let{patternType:i,fgRgb:o,bgRgb:s}=e;return i==t&&o==n&&s==r});return i===-1&&(i=Mm.length,Mm.push({patternType:t,fgRgb:n,bgRgb:r})),i},registerNumberFmt=e=>{if(em[e])return em[e];let t=Am.findIndex(t=>t.formatCode===e);return t===-1?(t=Am.length+164,Am.push({formatCode:e,numFmtId:t})):t=Am[t].numFmtId,t},registerBorders=e=>{let{borderBottom:t,borderTop:n,borderLeft:r,borderRight:i}=e,o,s,c,p,m,h,g,_;r&&(c=convertLegacyBorder(r.lineStyle,r.weight),g=convertLegacyColor(r.color)),i&&(p=convertLegacyBorder(i.lineStyle,i.weight),_=convertLegacyColor(i.color)),t&&(o=convertLegacyBorder(t.lineStyle,t.weight),m=convertLegacyColor(t.color)),n&&(s=convertLegacyBorder(n.lineStyle,n.weight),h=convertLegacyColor(n.color));let v=Nm.findIndex(e=>{let{left:t,right:n,top:r,bottom:i}=e;if(!t&&(c||g)||!n&&(p||_)||!r&&(s||h)||!i&&(o||m))return!1;let{style:v,color:y}=t||{},{style:b,color:x}=n||{},{style:S,color:C}=r||{},{style:w,color:T}=i||{};return v==c&&y==g&&b==p&&x==_&&S==s&&C==h&&w==o&&T==m});return v===-1&&(v=Nm.length,Nm.push({left:{style:c,color:g},right:{style:p,color:_},top:{style:s,color:h},bottom:{style:o,color:m},diagonal:{style:void 0,color:void 0}})),v},registerFont=e=>{let{fontName:t=`Calibri`,color:n,size:r,bold:i,italic:o,outline:s,shadow:c,strikeThrough:p,underline:m,family:h,verticalAlign:g}=e,_=convertLegacyColor(n),v=getFontFamilyId(h),y=m?m.toLocaleLowerCase():void 0,b=g?g.toLocaleLowerCase():void 0,x=jm.findIndex(e=>e.fontName==t&&e.color==_&&e.size==r&&e.bold==i&&e.italic==o&&e.outline==s&&e.shadow==c&&e.strikeThrough==p&&e.underline==y&&e.verticalAlign==b&&e.family==v);return x===-1&&(x=jm.length,jm.push({fontName:t,color:_,size:r,bold:i,italic:o,outline:s,shadow:c,strikeThrough:p,underline:y,verticalAlign:b,family:v?.toString()})),x},registerStyle=e=>{let{alignment:t,borders:n,font:r,interior:i,numberFormat:o,protection:s,quotePrefix:c}=e,{id:p}=e,m=0,h=0,g=0,_=0;p&&(p=getStyleName(p,Lm),km[p]??(i&&(m=registerFill(i)),n&&(h=registerBorders(n)),r&&(g=registerFont(r)),o&&(_=registerNumberFmt(o.format)),km[p]=Fm.length,Fm.push({alignment:t,borderId:h||0,fillId:m||0,fontId:g||0,numFmtId:_||0,protection:s,quotePrefix:c,xfId:0})))},Rm={getTemplate(e){let t=Om.getTemplate(Am),n=Em.getTemplate(jm.map(t=>({...t,size:t.size==null?e:t.size}
4))),r=wm.getTemplate(Mm),i=hm.getTemplate(Nm),o=ym.getTemplate(Pm),s=Sm.getTemplate(Fm),c=xm.getTemplate(Im);return resetStylesheetValues(),{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,n,r,i,o,s,c,{name:`tableStyles`,properties:{rawMap:{count:0,defaultPivotStyle:`PivotStyleLight16`,defaultTableStyle:`TableStyleMedium2`}}}]}}},getStyleId=(e,t)=>km[getStyleName(e,t)]||0,registerStyles=(e,t)=>{Lm=t,Lm===1&&resetStylesheetValues(),e.forEach(registerStyle)},zm=Rm,Bm={getTemplate(e,t){let{name:n,columns:r,rowRange:i,displayName:o,showRowStripes:s,showColumnStripes:c,showFilterButtons:p,highlightFirstColumn:m,highlightLastColumn:h}=e||{},g=!i||i[0]-i[1]===0;if(!e||!n||!Array.isArray(r)||!r.length||g)return{name:`table`};let _=r.map((e,t)=>({name:`filterColumn`,properties:{rawMap:{colId:t.toString(),hiddenButton:+!p[t]}}})),v=`${`A${i[0]}`}:${`${getExcelColumnName(r.length)}${i[1]}`}`,y=`${t+1}`,b=t?`${o}_${y}`:o;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:b,displayName:b,ref:v,totalsRowShown:0,id:y}},children:[{name:`autoFilter`,properties:{rawMap:{ref:v}},children:_},{name:`tableColumns`,properties:{rawMap:{count:r.length}},children:r.map((e,t)=>({name:`tableColumn`,properties:{rawMap:{id:(t+1).toString(),name:nu(sanitizeTableName(e)),dataCellStyle:`Normal`}}}))},{name:`tableStyleInfo`,properties:{rawMap:{name:`TableStyleLight1`,showFirstColumn:+!!m,showLastColumn:+!!h,showRowStripes:+!!s,showColumnStripes:+!!c}}}]}}},getColorChildren=e=>{let[t,n,r,i]=e;return{name:`a:${t}`,children:[{name:`a:${n}`,properties:{rawMap:{val:r,lastClr:i}}}]}},Vm={getTemplate(){return{name:`a:clrScheme`,properties:{rawMap:{name:`Office`}},children:[getColorChildren([`dk1`,`sysClr`,`windowText`,`000000`]),getColorChildren([`lt1`,`sysClr`,`window`,`FFFFFF`]),getColorChildren([`dk2`,`srgbClr`,`44546A`]),getColorChildren([`lt2`,`srgbClr`,`E7E6E6`]),getColorChildren([`accent1`,`srgbClr`,`4472C4`]),getColorChildren([`accent2`,`srgbClr`,`ED7D31`]),getColorChildren([`accent3`,`srgbClr`,`A5A5A5`]),getColorChildren([`accent4`,`srgbClr`,`FFC000`]),getColorChildren([`accent5`,`srgbClr`,`5B9BD5`]),getColorChildren([`accent6`,`srgbClr`,`70AD47`]),getColorChildren([`hlink`,`srgbClr`,`0563C1`]),getColorChildren([`folHlink`,`srgbClr`,`954F72`])]}}},getFont=e=>{let[t,n,r,i]=e;return{name:`a:${t}`,properties:{rawMap:{script:r,typeface:n,panose:i}}}},Hm={getTemplate(){return{name:`a:fontScheme`,properties:{rawMap:{name:`Office`}},children:[{name:`a:majorFont`,children:[getFont([`latin`,`Calibri Light`,void 0,`020F0302020204030204`]),getFont([`ea`,``]),getFont([`cs`,``]),getFont([`font`,`游ゴシック Light`,`Jpan`]),getFont([`font`,`맑은 고딕`,`Hang`]),getFont([`font`,`等线 Light`,`Hans`]),getFont([`font`,`新細明體`,`Hant`]),getFont([`font`,`Times New Roman`,`Arab`]),getFont([`font`,`Times New Roman`,`Hebr`]),getFont([`font`,`Tahoma`,`Thai`]),getFont([`font`,`Nyala`,`Ethi`]),getFont([`font`,`Vrinda`,`Beng`]),getFont([`font`,`Shruti`,`Gujr`]),getFont([`font`,`MoolBoran`,`Khmr`]),getFont([`font`,`Tunga`,`Knda`]),getFont([`font`,`Raavi`,`Guru`]),getFont([`font`,`Euphemia`,`Cans`]),getFont([`font`,`Plantagenet Cherokee`,`Cher`]),getFont([`font`,`Microsoft Yi Baiti`,`Yiii`]),getFont([`font`,`Microsoft Himalaya`,`Tibt`]),getFont([`font`,`MV Boli`,`Thaa`]),getFont([`font`,`Mangal`,`Deva`]),getFont([`font`,`Gautami`,`Telu`]),getFont([`font`,`Latha`,`Taml`]),getFont([`font`,`Estrangelo Edessa`,`Syrc`]),getFont([`font`,`Kalinga`,`Orya`]),getFont([`font`,`Kartika`,`Mlym`]),getFont([`font`,`DokChampa`,`Laoo`]),getFont([`font`,`Iskoola Pota`,`Sinh`]),getFont([`font`,`Mongolian Baiti`,`Mong`]),getFont([`font`,`Times New Roman`,`Viet`]),getFont([`font`,`Microsoft Uighur`,`Uigh`]),getFont([`font`,`Sylfaen`,`Geor`]),getFont([`font`,`Arial`,`Armn`]),getFont([`font`,`Leelawadee UI`,`Bugi`]),getFont([`font`,`Microsoft JhengHei`,`Bopo`]),getFont([`font`,`Javanese Text`,`Java`]),getFont([`font`,`Segoe UI`,`Lisu`]),getFont([`font`,`Myanmar Text`,`Mymr`]),getFont([`font`,`Ebrima`,`Nkoo`]),getFont([`font`,`Nirmala UI`,`Olck`]),getFont([`font`,`Ebrima`,`Osma`]),getFont([`font`,`Phagspa`,`Phag`]),getFont([`font`,`Estrangelo Edessa`,`Syrn`]),getFont([`font`,`Estrangelo Edessa`,`Syrj`]),getFont([`font`,`Estrangelo Edessa`,`Syre`]),getFont([`font`,`Nirmala UI`,`Sora`]),getFont([`font`,`Microsoft Tai Le`,`Tale`]),getFont([`font`,`Microsoft New Tai Lue`,`Talu`]),getFont([`font`,`Ebrima`,`Tfng`])]},{name:`a:minorFont`,children:[getFont([`latin`,`Calibri`,void 0,`020F0502020204030204`]),getFont([`ea`,``]),getFont([`cs`,``]),getFont([`font`,`游ゴシック`,`Jpan`]),getFont([`font`,`맑은 고딕`,`Hang`]),getFont([`font`,`等线`,`Hans`]),getFont([`font`,`新細明體`,`Hant`]),getFont([`font`,`Arial`,`Arab`]),getFont([`font`,`Arial`,`Hebr`]),getFont([`font`,`Tahoma`,`Thai`]),getFont([`font`,`Nyala`,`Ethi`]),getFont([`font`,`Vrinda`,`Beng`]),getFont([`font`,`Shruti`,`Gujr`]),getFont([`font`,`DaunPenh`,`Khmr`]),getFont([`font`,`Tunga`,`Knda`]),getFont([`font`,`Raavi`,`Guru`]),getFont([`font`,`Euphemia`,`Cans`]),getFont([`font`,`Plantagenet Cherokee`,`Cher`]),getFont([`font`,`Microsoft Yi Baiti`,`Yiii`]),getFont([`font`,`Microsoft Himalaya`,`Tibt`]),getFont([`font`,`MV Boli`,`Thaa`]),getFont([`font`,`Mangal`,`Deva`]),getFont([`font`,`Gautami`,`Telu`]),getFont([`font`,`Latha`,`Taml`]),getFont([`font`,`Estrangelo Edessa`,`Syrc`]),getFont([`font`,`Kalinga`,`Orya`]),getFont([`font`,`Kartika`,`Mlym`]),getFont([`font`,`DokChampa`,`Laoo`]),getFont([`font`,`Iskoola Pota`,`Sinh`]),getFont([`font`,`Mongolian Baiti`,`Mong`]),getFont([`font`,`Arial`,`Viet`]),getFont([`font`,`Microsoft Uighur`,`Uigh`]),getFont([`font`,`Sylfaen`,`Geor`]),getFont([`font`,`Arial`,`Armn`]),getFont([`font`,`Leelawadee UI`,`Bugi`]),getFont([`font`,`Microsoft JhengHei`,`Bopo`]),getFont([`font`,`Javanese Text`,`Java`]),getFont([`font`,`Segoe UI`,`Lisu`]),getFont([`font`,`Myanmar Text`,`Mymr`]),getFont([`font`,`Ebrima`,`Nkoo`]),getFont([`font`,`Nirmala UI`,`Olck`]),getFont([`font`,`Ebrima`,`Osma`]),getFont([`font`,`Phagspa`,`Phag`]),getFont([`font`,`Estrangelo Edessa`,`Syrn`]),getFont([`font`,`Estrangelo Edessa`,`Syrj`]),getFont([`font`,`Estrangelo Edessa`,`Syre`]),getFont([`font`,`Nirmala UI`,`Sora`]),getFont([`font`,`Microsoft Tai Le`,`Tale`]),getFont([`font`,`Microsoft New Tai Lue`,`Talu`]),getFont([`font`,`Ebrima`,`Tfng`])]}]}}},getPropertyVal=(e,t,n)=>({name:`a:${e}`,properties:{rawMap:{val:t}},children:n}
vendor: 4,289 bytes, line 4
4),getGs=e=>{let[t,n,r,i,o,s]=e,c=[];return c.push(getPropertyVal(`satMod`,r)),i&&c.push(getPropertyVal(`lumMod`,i)),o&&c.push(getPropertyVal(`tint`,o)),s&&c.push(getPropertyVal(`shade`,s)),{name:`a:gs`,properties:{rawMap:{pos:t}},children:[{name:`a:schemeClr`,properties:{rawMap:{val:n}},children:c}]}},getSolidFill=(e,t)=>({name:`a:solidFill`,children:[getPropertyVal(`schemeClr`,e,t)]}),getGradFill=e=>{let[t,n,r,i,o]=e,[s,c]=o;return{name:`a:gradFill`,properties:{rawMap:{rotWithShape:t}},children:[{name:`a:gsLst`,children:[getGs(n),getGs(r),getGs(i)]},{name:`a:lin`,properties:{rawMap:{ang:s,scaled:c}}}]}},getLine=e=>{let[t,n,r,i]=e;return{name:`a:ln`,properties:{rawMap:{w:t,cap:n,cmpd:r,algn:i}},children:[getSolidFill(`phClr`),getPropertyVal(`prstDash`,`solid`),{name:`a:miter`,properties:{rawMap:{lim:`800000`}}}]}},getEffectStyle=e=>{let t=[];if(e){let[n,r,i,o,s]=e;t.push({name:`a:outerShdw`,properties:{rawMap:{blurRad:n,dist:r,dir:i,algn:o,rotWithShape:s}},children:[getPropertyVal(`srgbClr`,`000000`,[getPropertyVal(`alpha`,`63000`)])]})}return{name:`a:effectStyle`,children:[Object.assign({},{name:`a:effectLst`},t.length?{children:t}:{})]}},getFillStyleList=()=>({name:`a:fillStyleLst`,children:[getSolidFill(`phClr`),getGradFill([`1`,[`0`,`phClr`,`105000`,`110000`,`67000`],[`50000`,`phClr`,`103000`,`105000`,`73000`],[`100000`,`phClr`,`109000`,`105000`,`81000`],[`5400000`,`0`]]),getGradFill([`1`,[`0`,`phClr`,`103000`,`102000`,`94000`],[`50000`,`phClr`,`110000`,`100000`,void 0,`100000`],[`100000`,`phClr`,`120000`,`99000`,void 0,`78000`],[`5400000`,`0`]])]}),getLineStyleList=()=>({name:`a:lnStyleLst`,children:[getLine([`6350`,`flat`,`sng`,`ctr`]),getLine([`12700`,`flat`,`sng`,`ctr`]),getLine([`19050`,`flat`,`sng`,`ctr`])]}),getEffectStyleList=()=>({name:`a:effectStyleLst`,children:[getEffectStyle(),getEffectStyle(),getEffectStyle([`57150`,`19050`,`5400000`,`ctr`,`0`])]}),getBgFillStyleList=()=>({name:`a:bgFillStyleLst`,children:[getSolidFill(`phClr`),getSolidFill(`phClr`,[getPropertyVal(`tint`,`95000`),getPropertyVal(`satMod`,`170000`)]),getGradFill([`1`,[`0`,`phClr`,`150000`,`102000`,`93000`,`98000`],[`50000`,`phClr`,`130000`,`103000`,`98000`,`90000`],[`100000`,`phClr`,`120000`,void 0,void 0,`63000`],[`5400000`,`0`]])]}),Um={getTemplate(){return{name:`a:fmtScheme`,properties:{rawMap:{name:`Office`}},children:[getFillStyleList(),getLineStyleList(),getEffectStyleList(),getBgFillStyleList()]}}},Wm={getTemplate(){return{name:`a:themeElements`,children:[Vm.getTemplate(),Hm.getTemplate(),Um.getTemplate()]}}},Gm={getTemplate(){return{name:`a:theme`,properties:{prefixedAttributes:[{prefix:`xmlns:`,map:{a:`http://schemas.openxmlformats.org/drawingml/2006/main`}}],rawMap:{name:`Office Theme`}},children:[Wm.getTemplate(),{name:`a:objectDefaults`},{name:`a:extraClrSchemeLst`}]}}},getShapeLayout=()=>({name:`o:shapelayout`,properties:{prefixedAttributes:[{prefix:`v:`,map:{ext:`edit`}}]},children:[{name:`o:idmap`,properties:{prefixedAttributes:[{prefix:`v:`,map:{ext:`edit`}}],rawMap:{data:`1`}}}]}),getStroke=()=>({name:`v:stroke`,properties:{rawMap:{joinstyle:`miter`}}}),getFormulas=e=>({name:`v:formulas`,children:e.map(e=>({name:`v:f`,properties:{rawMap:{eqn:e}}}))}),getPath=()=>({name:`v:path`,properties:{prefixedAttributes:[{prefix:`o:`,map:{connecttype:`rect`,extrusionok:`f`}}],rawMap:{gradientshapeok:`t`}}}),getLock=e=>{let{aspectratio:t,rotation:n}=e||{},r={};return t&&(r.aspectratio=`t`),n&&(r.rotation=`t`),{name:`o:lock`,properties:{prefixedAttributes:[{prefix:`v:`,map:{ext:`edit`}}],rawMap:r}}};function mapNumber(e,t,n,r,i){return(e-t)/(n-t)*(i-r)+r}var getImageData=(e,t)=>{let n,{recolor:r,brightness:i,contrast:o,id:s}=e;if(r&&(n={},(r===`Washout`||r===`Grayscale`)&&(n.gain=`19661f`,n.blacklevel=`22938f`),(r===`Black & White`||r===`Grayscale`)&&(n.grayscale=`t`,r===`Black & White`&&(n.bilevel=`t`))),!r||r===`Grayscale`){if(n||={},o!=null&&o!==50){let e=`1`;o>=0&&(o<50?e=String(o/50):o<100?e=String(50/(100-o)):o===100&&(e=`2147483647f`)),n.gain=e}i!=null&&i!==50&&(n.blacklevel=mapNumber(i,0,100,-.5,.5).toString())}return{name:`v:imagedata`,properties:{prefixedAttributes:[{prefix:`o:`,map:{relid:`rId${t}`,title:s}}],rawMap:n}}},getShapeType=()=>({name:`v:shapetype`,properties:{prefixedAttributes:[{prefix:`o:`,map:{spt:`7
45`,preferrelative:`t`}}],rawMap:{coordsize:`21600,21600`,filled:`f`,id:`_x0000_t75`,path:`m@4@5l@4@11@9@11@9@5xe`,stroked:`f`}},children:[getStroke(),getFormulas([`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`]),getPath(),getLock({aspectratio:!0})]}),pixelToPoint=e=>Math.floor((e??0)*.74999943307122),getShape=(e,t)=>{let{width:n=0,height:r=0,altText:i}=e,o=pixelToPoint(n),s=pixelToPoint(r);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: ${o}pt; height: ${s}pt; z-index: ${t+1}`,type:`#_x0000_t75`,alt:i}},children:[getImageData(e,t+1),getLock({rotation:!0})]}},Km={getTemplate(e){let t=ah.get(e.sheetIndex)||[];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:[getShapeLayout(),getShapeType(),...t.map((e,t)=>getShape(e,t))]}}},qm={getTemplate(e,t){let n=(t+1).toString();return{name:`sheet`,properties:{rawMap:{name:e,sheetId:n,"r:id":`rId${n}`}}}}},Jm={getTemplate(e){return{name:`sheets`,children:e.map((e,t)=>qm.getTemplate(e,t))}}},Ym={getTemplate(e,t){return{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:[{name:`bookViews`,children:[{name:`workbookView`,properties:{rawMap:{activeTab:t}}}]},Jm.getTemplate(e)]}}},getExcelCellWidth=e=>Math.ceil((e-12)/7+1),Xm={getTemplate(e){let{min:t,max:n,outlineLevel:r,s:i,width:o,hidden:s,bestFit:c}=e,p=1,m=`0`;return o>1&&(p=getExcelCellWidth(o),m=`1`),{name:`col`,properties:{rawMap:{min:t,max:n,outlineLevel:r??void 0,width:p,style:i,hidden:s?`1`:`0`,bestFit:c?`1`:`0`,customWidth:m}}}}},Zm={getTemplate(e){return{name:`mergeCell`,properties:{rawMap:{ref:e}}}}},convertLegacyType=e=>{let t=e.charAt(0).toLowerCase();return t===`s`?`inlineStr`:t},Qm={getTemplate(e,t,n){let{ref:r,data:i,styleId:o}=e,{type:s,value:c}=i||{type:`empty`,value:null},p=s;s===`f`?p=`str`:s.charAt(0)===s.charAt(0).toUpperCase()&&(p=convertLegacyType(s));let m={name:`c`,properties:{rawMap:{r,t:p===`empty`?void 0:p,s:o?getStyleId(o,n):void 0}}};if(p===`empty`)return m;let h;return h=p===`str`&&s===`f`?[{name:`f`,textNode:nu(replaceInvisibleCharacters(c))}]:p===`inlineStr`?[{name:`is`,children:[{name:`t`,textNode:nu(replaceInvisibleCharacters(c))}]}]:[{name:`v`,textNode:c}],Object.assign({},m,{children:h})}},addEmptyCells=(e,t)=>{let n=[],r=0;for(let t=0;t<e.length;t++){let i=e[t];i.mergeAcross&&(n.push({pos:t,excelPos:r}),r+=i.mergeAcross),r++}if(n.length)for(let r=n.length-1;r>=0;r--){let i=[],o=e[n[r].pos];for(let e=1;e<=o.mergeAcross;e++)i.push({ref:`${getExcelColumnName(n[r].excelPos+1+e)}${t+1}`,styleId:o.styleId,data:{type:`empty`,value:null}});i.length&&e.splice(n[r].pos+1,0,...i)}},shouldDisplayCell=e=>e.data?.value!==``||e.styleId!==void 0,$m={getTemplate(e,t,n){let{collapsed:r,hidden:i,height:o,outlineLevel:s,cells:c=[]}=e;addEmptyCells(c,t);let p=c.filter(shouldDisplayCell).map((e,t)=>Qm.getTemplate(e,t,n));return{name:`row`,properties:{rawMap:{r:t+1,collapsed:r?`1`:`0`,hidden:i?`1`:`0`,ht:o,customHeight:o==null?`0`:`1`,spans:`1:1`,outlineLevel:s||void 0}},children:p}}},getMergedCellsAndAddColumnGroups=(e,t,n)=>{let r=[],i=[];e.forEach((e,n)=>{let o=e.cells,s=0,c;o.forEach((e,o)=>{let p=o+s+1,m=getExcelColumnName(p),h=n+1;if(e.mergeAcross){s+=e.mergeAcross;let t=getExcelColumnName(o+s+1);r.push(`${m}${h}:${t}${h}`)}t[p-1]||(t[p-1]={});let{collapsibleRanges:g}=e;g&&g.forEach(e=>{i.push([p+e[0],p+e[1]])}),c=t[p-1],c.min=p,c.max=p,e.ref=`${m}${h}`})}),i.sort((e,t)=>e[0]===t[0]?t[1]-e[1]:e[0]-t[0]);let o=new Map,s=new Map;return i.filter(e=>{let t=e.toString();return!o.get(t)&&(o.set(t,!0),!0)}
4).forEach(e=>{let r=t.find(t=>t.min==e[0]&&t.max==e[1]),i=s.get(e[0]);t.push({min:e[0],max:e[1],outlineLevel:n?void 0:i||1,width:(r||{width:100}).width}),s.set(e[0],(i||0)+1)}),r},getPageOrientation=e=>!e||e!==`Portrait`&&e!==`Landscape`?`portrait`:e.toLocaleLowerCase(),getPageSize=e=>{if(e==null)return 1;let 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 t===-1?1:t+1},replaceHeaderFooterTokens=e=>{let t={"&[Page]":`&P`,"&[Pages]":`&N`,"&[Date]":`&D`,"&[Time]":`&T`,"&[Tab]":`&A`,"&[Path]":`&Z`,"&[File]":`&F`,"&[Picture]":`&G`};for(let n of Object.keys(t))e=e.replace(n,t[n]);return e},getHeaderPosition=e=>e===`Center`?`C`:e===`Right`?`R`:`L`,applyHeaderFontStyle=(e,t)=>t?(e+=`&amp;&quot;`,e+=t.fontName||`Calibri`,t.bold===t.italic?t.bold?e+=`,Bold Italic`:e+=`,Regular`:e+=t.bold?`,Bold`:`,Italic`,e+=`&quot;`,t.size&&(e+=`&amp;${t.size}`),t.strikeThrough&&(e+=`&amp;S`),t.underline&&(e+=`&amp;${t.underline===`Double`?`E`:`U`}`),t.color&&(e+=`&amp;K${t.color.replace(`#`,``).toUpperCase()}`),e):e,processHeaderFooterContent=(e,t,n)=>e.reduce((e,r,i)=>{let o=getHeaderPosition(r.position),s=applyHeaderFontStyle(`${e}&amp;${o}`,r.font);r.position||=[`Left`,`Center`,`Right`][i];let{image:c}=r;return r.value===`&[Picture]`&&c&&addXlsxHeaderFooterImageToMap(c,`${o}${t}${n}`),`${s}${nu(replaceHeaderFooterTokens(r.value))}`},``),buildHeaderFooter=e=>{let t=[`all`,`first`,`even`],n=[];return t.forEach(t=>{let r=e[t],i=t===`all`?`odd`:t;if(r)for(let e of Object.keys(r)){let o=r[e],s=`${e.charAt(0).toUpperCase()}${e.slice(1)}`,c=e[0].toUpperCase();if(o){let e=t===`all`?``:t.toUpperCase();n.push({name:`${i}${s}`,properties:{rawMap:{"xml:space":`preserve`}},textNode:processHeaderFooterContent(o,c,e)})}}}),n},addColumns=e=>t=>(e.length&&t.children.push({name:`cols`,children:e.map(e=>Xm.getTemplate(e))}),t),addSheetData=(e,t)=>n=>(e.length&&n.children.push({name:`sheetData`,children:e.map((e,n)=>$m.getTemplate(e,n,t))}),n),addMergeCells=e=>t=>(e.length&&t.children.push({name:`mergeCells`,properties:{rawMap:{count:e.length}},children:e.map(e=>Zm.getTemplate(e))}),t),addPageMargins=e=>t=>{let{top:n=.75,right:r=.7,bottom:i=.75,left:o=.7,header:s=.3,footer:c=.3}=e;return t.children.push({name:`pageMargins`,properties:{rawMap:{bottom:i,footer:c,header:s,left:o,right:r,top:n}}}),t},addPageSetup=e=>t=>(e&&t.children.push({name:`pageSetup`,properties:{rawMap:{horizontalDpi:0,verticalDpi:0,orientation:getPageOrientation(e.orientation),paperSize:getPageSize(e.pageSize)}}}),t),addHeaderFooter=e=>t=>{if(!e)return t;let n=e.first==null?0:1,r=e.even==null?0:1;return t.children.push({name:`headerFooter`,properties:{rawMap:{differentFirst:n,differentOddEven:r}},children:buildHeaderFooter(e)}),t},addExcelTableRel=e=>t=>(e&&t.children.push({name:`tableParts`,properties:{rawMap:{count:`1`}},children:[{name:`tablePart`,properties:{rawMap:{"r:id":`rId${++t.rIdCounter}`}}}]}),t),addDrawingRel=e=>t=>(ih.get(e)?.length&&t.children.push({name:`drawing`,properties:{rawMap:{"r:id":`rId${++t.rIdCounter}`}}}),t),addVmlDrawingRel=e=>t=>(ah.get(e)&&t.children.push({name:`legacyDrawingHF`,properties:{rawMap:{"r:id":`rId${++t.rIdCounter}`}}}
4),t),getPane=(e=0,t=0)=>{let n=e>0||t>0;return n?[{name:`pane`,properties:{rawMap:{state:n?`frozen`:void 0,topLeftCell:n?`${getExcelColumnName(e+1)}${t+1}`:void 0,xSplit:e===0?void 0:e,ySplit:t===0?void 0:t}}}]:void 0},addSheetViews=(e=!1,t,n)=>r=>(r.children.push({name:`sheetViews`,children:[{name:`sheetView`,properties:{rawMap:{rightToLeft:e===!0?`1`:`0`,workbookViewId:`0`}},children:getPane(t,n)}]}),r),addSheetPr=()=>e=>(e.children.push({name:`sheetPr`,children:[{name:`outlinePr`,properties:{rawMap:{summaryBelow:0}}}]}),e),addSheetFormatPr=e=>t=>{let n=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:n||void 0}}}),t},eh={getTemplate(e){let{worksheet:t,currentSheet:n,config:r}=e,{margins:i={},pageSetup:o,headerFooterConfig:s,suppressColumnOutline:c,rightToLeft:p,frozenRowCount:m,frozenColumnCount:h}=r,{table:g}=t,{rows:_,columns:v}=g,y=v?.length?getMergedCellsAndAddColumnGroups(_,v,!!c):[],b=ch.get(n),{children:x}=[addSheetPr(),addSheetViews(p,h,m),addSheetFormatPr(_),addColumns(v),addSheetData(_,n+1),addMergeCells(y),addPageMargins(i),addPageSetup(o),addHeaderFooter(s),addDrawingRel(n),addVmlDrawingRel(n),addExcelTableRel(b)].reduce((e,t)=>t(e),{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:x}}},th=new Map,nh=[],rh=new Map,ih=new Map,ah=new Map,oh=new Map,sh=new Map,ch=new Map,lh=`AG-GRID-TABLE`,uh=`SINGLE_SHEET`;function getXlsxFactoryMode(){return uh}function setXlsxFactoryMode(e){uh=e}function createXlsxExcel(e,t,n){addSheetName(t),registerStyles(e,nh.length);let r=Object.assign({},n);return n.exportAsExcelTable&&n.colModel.isPivotActive()&&(q(163,{featureName:`pivot mode`}),r.exportAsExcelTable=!1),processTableConfig(t,r),createWorksheet(t,r)}function getXlsxSanitizedTableName(e){return e.replace(/^[^a-zA-Z_]+/,`_`).replace(/\s/g,`_`).replace(/[^a-zA-Z0-9_]/g,`_`)}function addXlsxTableToSheet(e,t){if(ch.has(e)){q(164);return}ch.set(e,t)}function processTableConfig(e,t){let{exportAsExcelTable:n,prependContent:r,appendContent:i,colModel:o}=t;if(!n)return;let{name:s,showColumnStripes:c,showRowStripes:p,showFilterButton:m,highlightFirstColumn:h,highlightLastColumn:g}=typeof n==`boolean`?{}:n,_=getXlsxSanitizedTableName(s||lh),v=nh.length-1,{table:y}=e,{rows:b,columns:x}=y,S=rc(o),C=r?r.length:0,w=i?i.length:0,T=b.length,E=x.length,D=[],O=[];for(let e=0;e<E;e++){let t=x[e];D.push(t.displayName||``),O.push(m===`match`||m===void 0?t.filterAllowed??!1:m)}if(!D?.length||!T||!_){q(165);return}addXlsxTableToSheet(v,{name:`table${ch.size+1}`,displayName:_,columns:D,showFilterButtons:O,rowRange:[S+C,S+(T-S)-w],showRowStripes:p??!0,showColumnStripes:c??!1,highlightFirstColumn:h??!1,highlightLastColumn:g??!1})}function addXlsxHeaderFooterImageToMap(e,t){let n=nh.length-1,r=e;r.headerFooterPosition=t,buildImageMap({imageToAdd:r,idx:n});let i=ah.get(n);i||(i=[],ah.set(n,i)),i.find(t=>t.id===e.id)||i.push(e)}function addXlsxBodyImageToMap(e,t,n,r,i){let o=nh.length,{row:s,column:c}=e.position||{},p=e;r&&(t!=null&&n!=null&&(!s||!c)&&(e.position||={},e.position=Object.assign({},e.position,{row:t,column:r.indexOf(n)+1})),setExcelImageTotalWidth(p,r),setExcelImageTotalHeight(p,i)),buildImageMap({imageToAdd:p,idx:o});let m=sh.get(o);m||(m=new Map,sh.set(o,m));let h=ih.get(o);h?h.push(p):ih.set(o,[p]),m.get(e.id)||m.set(e.id,{index:m.size,type:e.imageType})}function buildImageMap(e){let{imageToAdd:t,idx:n}=e,r=rh.get(t.id);if(r){let e=r.find(e=>e.sheetId===n);e?e.image.push(t):r.push({sheetId:n,image:[t]})}else rh.set(t.id,[{sheetId:n,image:[t]}]),oh.set(t.id,{type:t.imageType,index:oh.size})}function addSheetName(e){let t=nu(e.name)||``,n=``;for(;nh.indexOf(`${t}${n}`)!==-1;)n=n===``?`_1`:`_${parseInt(n.slice(1),10)+1}`;e.name=`${t}${n}`,nh.push(e.name)}function getXlsxStringPosition(e){return th.has(e)?th.get(e):(th.set(e,th.size),th.size-1)}function resetXlsxFactory(){th.clear(),rh.clear(),ih.clear(),ah.clear(),oh.clear(),sh.clear(),ch.clear(),nh=[],uh=`SINGLE_SHEET`}function createXlsxWorkbook(e){return createXmlPart(Ym.getTemplate(nh,e))}function createXlsxStylesheet(e){return createXmlPart(zm.getTemplate(e))}function createXlsxSharedStrings(){return createXmlPart(cm.getTemplate(th))}function createXlsxCore(e){return createXmlPart(im.getTemplate(e))}function createXlsxContentTypes(e){return createXmlPart(rm.getTemplate(e))}function createXlsxRels(){return createXmlPart(sm.getTemplate([{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`}]))}function createXlsxTheme(){return createXmlPart(Gm.getTemplate())}function createXlsxTable(e,t){return createXmlPart(Bm.getTemplate(e,t))}function createXlsxWorkbookRels(e){let t=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`}));return createXmlPart(sm.getTemplate([...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`}]))}function createXlsxDrawing(e){return createXmlPart(am.getTemplate({sheetIndex:e}))}function createXlsxDrawingRel(e){let t=sh.get(e)||[],n=[];for(let[e,r]of t){let{index:t,type:i}=r;n.push({Id:`rId${t+1}`,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,Target:`../media/image${oh.get(e).index+1}.${_normaliseImageExtension(i)}`})}return createXmlPart(sm.getTemplate(n))}function createXlsxVmlDrawing(e){return createXmlPart(Km.getTemplate({sheetIndex:e}),!0)}function createXlsxVmlDrawingRel(e){let t=ah.get(e)||[],n=[];for(let e=0;e<t.length;e++){let r=t[e],i=oh.get(r.id);if(!i)continue;let{index:o,type:s}=i;n.push({Id:`rId${e+1}`,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,Target:`../media/image${o+1}.${_normaliseImageExtension(s)}`})}return createXmlPart(sm.getTemplate(n))}function createXlsxRelationships({drawingIndex:e,vmlDrawingIndex:t,tableName:n}={}){if(e===void 0&&t===void 0&&n===void 0)return``;let r=[];return e!=null&&r.push({Id:`rId${r.length+1}`,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing`,Target:`../drawings/drawing${e+1}.xml`}),t!=null&&r.push({Id:`rId${r.length+1}`,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing`,Target:`../drawings/vmlDrawing${t+1}.vml`}),n!=null&&r.push({Id:`rId${r.length+1}`,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/table`,Target:`../tables/${n}.xml`}),createXmlPart(sm.getTemplate(r))}function createWorksheet(e,t){return createXmlPart(eh.getTemplate({worksheet:e,currentSheet:nh.length-1,config:t}))}var ExcelSerializingSession=class extends lo{constructor(e){super(e),this.mixedStyles={},this.mixedStyleCounter=0,this.rows=[],this.frozenRowCount=0,this.skipFrozenRows=!1,this.frozenColumnCount=0,this.skipFrozenColumns=!1,this.config=Object.assign({},e),this.stylesByIds={};for(let e of this.config.baseExcelStyles)this.stylesByIds[e.id]=e;this.excelStyles=[...this.config.baseExcelStyles,{id:`_quotePrefix`,quotePrefix:1}]}addCustomContent(e){for(let t of e){let e=this.rows.length+1,n;!this.config.suppressRowOutline&&t.outlineLevel!=null&&(n=t.outlineLevel);let r={height:getHeightFromProperty(e,t.height||this.config.rowHeight),cells:(t.cells||[]).map((t,n)=>{let r=this.addImage(e,this.columnsToExport[n],t.data?.value),i=null;t.styleId&&(i=typeof t.styleId==`string`?[t.styleId]:t.styleId);let o=this.getStyleId(i);if(r)return this.createCell(o,this.getDataTypeForValue(r.value),r.value==null?``:r.value);let s=t.data?.value??``,c=this.getDataTypeForValue(s);return t.mergeAcross?this.createMergedCell(o,c,s,t.mergeAcross):this.createCell(o,c,s)}),outlineLevel:n};t.collapsed!=null&&(r.collapsed=t.collapsed),t.hidden!=null&&(r.hidden=t.hidden),this.rows.push(r)}}onNewHeaderGroupingRow(){let e=[],{freezeRows:t,headerRowHeight:n}=this.config;return this.rows.push({cells:e,height:getHeightFromProperty(this.rows.length+1,n)}),t&&this.frozenRowCount++,{onColumn:(t,n,r,i,o)=>{let s=this.config.styleLinker({rowType:`HEADER_GROUPING`,rowIndex:1,value:`grouping-${n}`,columnGroup:t});e.push({...this.createMergedCell(this.getStyleId(s),this.getDataTypeForValue(`string`),n,i),collapsibleRanges:o})}}}onNewHeaderRow(){let{freezeRows:e,headerRowHeight:t}=this.config;return e&&this.frozenRowCount++,this.onNewRow(this.onNewHeaderColumn,t)}onNewBodyRow(e){let{freezeRows:t,rowHeight:n}=this.config;this.skipFrozenRows||(t===`headersAndPinnedRows`&&e?.rowPinned===`top`||typeof t==`function`&&t(co(this.gos,{node:e}))?this.frozenRowCount++:this.skipFrozenRows=!0);let r=this.onNewRow(this.onNewBodyColumn,n);return e&&this.addRowOutlineIfNecessary(e),r}prepare(e){super.prepare(e),this.columnsToExport=[...e],this.cols=e.map((e,t)=>this.convertColumnToExcel(e,t))}parse(){let e=this.rows.reduce((e,t)=>
4Math.max(e,t.cells.length),0);for(;this.cols.length<e;)this.cols.push(this.convertColumnToExcel(null,this.cols.length+1));let{config:t}=this,n;if(t.sheetName!=null){let{sheetName:e}=t,r=typeof e==`function`?e(co(this.gos,{})):e;n=String(r).substring(0,31)}else n=`ag-grid`;let r={name:n,table:{columns:this.cols,rows:this.rows}};return this.createExcel(r)}addRowOutlineIfNecessary(e){let{gos:t,suppressRowOutline:n,rowGroupExpandState:r=`expanded`}=this.config;if(t.get(`groupHideOpenParents`)||n||e.level==null)return;let i=+!!e.footer,o=Kc(this.rows);if((e.uiLevel==null||e.level===e.uiLevel)&&(o.outlineLevel=Math.min(e.level+i,7)),r===`expanded`)return;let s=r===`collapsed`;e.isExpandable()&&(o.collapsed=!(!s&&e.expanded)),o.hidden=!!e.parent&&e.parent.level!==-1&&(s||this.isAnyParentCollapsed(e.parent))}isAnyParentCollapsed(e){for(;e&&e.level!==-1;){if(!e.expanded)return!0;e=e.parent}return!1}convertColumnToExcel(e,t){let n=this.config.columnWidth,r=(e?this.extractHeaderValue(e):void 0)??``,i=e?e.isFilterAllowed():!1;
4return n?typeof n==`number`?{width:n,displayName:r,filterAllowed:i}:{width:n({column:e,index:t}),displayName:r,filterAllowed:i}:e?{width:Math.max(e.getActualWidth(),75),displayName:r,filterAllowed:i}:{displayName:r,filterAllowed:i}}onNewHeaderColumn(e,t){return n=>{let r=this.extractHeaderValue(n),i=this.config.styleLinker({rowType:`HEADER`,rowIndex:e,value:r,column:n});t.push(this.createCell(this.getStyleId(i),this.getDataTypeForValue(`string`),r))}}onNewBodyColumn(e,t){let n=0,{freezeColumns:r,rightToLeft:i}=this.config;return(o,s,c)=>{if(n>0){--n;return}if(!this.skipFrozenColumns){let e=o.getPinned();r===`pinned`&&e&&(e===!0||e===`left`)!==i||typeof r==`function`&&r(co(this.gos,{column:o}))?this.frozenColumnCount++:this.skipFrozenColumns=!0}let{value:p,valueFormatted:m}=this.extractRowCellValue(o,s,e,`excel`,c),h=this.config.styleLinker({rowType:`BODY`,rowIndex:e,value:p,column:o,node:c}),g=this.getStyleId(h),_=o.getColSpan(c),v=this.addImage(e,o,p);v?t.push(this.createCell(g,this.getDataTypeForValue(v.value),v.value==null?``:v.value)):_>1?(n=_-1,t.push(this.createMergedCell(g,this.getDataTypeForValue(p),p,_-1))):t.push(this.createCell(g,this.getDataTypeForValue(p),p,m))}}onNewRow(e,t){let n=[];return this.rows.push({cells:n,height:getHeightFromProperty(this.rows.length+1,t)}),{onColumn:e.bind(this,this.rows.length,n)()}}createExcel(e){let{excelStyles:t,config:n}=this;return this.frozenColumnCount&&(n.frozenColumnCount=this.frozenColumnCount),this.frozenRowCount&&(n.frozenRowCount=this.frozenRowCount),createXlsxExcel(t,e,n)}getDataTypeForValue(e){if(e===void 0)return`empty`;let t=`s`;try{this.isNumerical(e)&&(t=`n`)}catch{}return t}getTypeFromStyle(e,t){if(this.isFormula(t))return`f`;if(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:q(162,{id:e.id,dataType:e.dataType})}return null}addImage(e,t,n){if(!this.config.addImageToCell)return;let r=this.config.addImageToCell(e,t,n);if(r)return addXlsxBodyImageToMap(r.image,e,t,this.columnsToExport,this.config.rowHeight),r}createCell(e,t,n,r){let i=this.getStyleById(e);!i?.dataType&&t===`s`&&r!=null&&(n=r);let o=this.getTypeFromStyle(i,n)||t,{value:s,escaped:c}=this.getCellValue(o,n),p=[];return i&&p.push(e),c&&p.push(`_quotePrefix`),e=this.getStyleId(p)||void 0,{styleId:e,data:{type:o,value:s}}}createMergedCell(e,t,n,r){let i=n??``;return{styleId:this.getStyleById(e)?e:void 0,data:{type:t,value:t===`s`?getXlsxStringPosition(i).toString():n},mergeAcross:r}}getCellValue(e,t){let n=!1;if(t==null||e===`s`&&t===``)return{value:``,escaped:!1};if(e===`s`)t&&t[0]===`'`&&(n=!0,t=t.slice(1)),t=getXlsxStringPosition(t).toString();else if(e===`f`)t=t.slice(1);else if(e===`n`){let e=Number(t);isNaN(e)?t=``:t!==``&&(t=e.toString())}return{value:t,escaped:n}}getStyleId(e){if(!e?.length)return null;if(e.length===1)return e[0];let 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;let t=`mixedStyle${this.mixedStyleCounter}`,n={};for(let t of e)for(let e of this.excelStyles)e.id===t&&mc(n,this.deepCloneObject(e));n.id=t;let r=e.join(`-`);this.mixedStyles[r]={excelID:t,key:r,result:n},this.excelStyles.push(n),this.stylesByIds[t]=n}isFormula(e){return e!=null&&this.config.autoConvertFormulas&&e.toString().startsWith(`=`)}isNumerical(e){return typeof e==`bigint`||isFinite(e)&&e!==``&&!isNaN(parseFloat(e))}getStyleById(e){return e==null?null:this.stylesByIds[e]||null}},compressBlob=async e=>{let t=0,n=[],r=new WritableStream({write:e=>{n.push(e),t+=e.length}}),i=new ReadableStream({start:t=>{let n=new FileReader;n.onload=e=>{e.target?.result&&t.enqueue(e.target.result),t.close()},n.readAsArrayBuffer(e)}}),o=new window.CompressionStream(`deflate-raw`);return await i.pipeThrough(o).pipeTo(r),{size:t,content:new Blob(n)}},deflateLocalFile=async e=>{let{size:t,content:n}=await compressBlob(new Blob([e]));return{size:t,content:new Uint8Array(await n.arrayBuffer())}},convertTime=e=>{let t=e.getHours();return t<<=6,t|=e.getMinutes(),t<<=5,t|=e.getSeconds()/2,t},convertDate=e=>{let t=e.getFullYear()-1980;return t<<=4,t|=e.getMonth()+1,t<<=5,t|=e.getDate(),t};function convertDecToHex(e,t){let n=``;for(let r=0;r<t;r++)n+=String.fromCharCode(e&255),e>>>=8;return n}var getCrcFromCrc32TableAndByteArray=e=>{if(!e.length)return 0;let t=-1,n=0,r=0,i=0;for(let o=0;o<e.length;o++)n=e[o],r=(t^n)&255,i=dh[r],t=t>>>8^i;return t^-1},getCrcFromCrc32Table=e=>e.length?getCrcFromCrc32TableAndByteArray(typeof e==`string`?new TextEncoder().encode(e):e):0,dh=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,39
404427059,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]);function _utf8_encode(e){let t=String.fromCharCode;function ucs2decode(e){let t=[];if(!e)return[];let n=e.length,r=0,i,o;for(;r<n;)i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<n?(o=e.charCodeAt(r++),(o&64512)==56320?t.push(((i&1023)<<10)+(o&1023)+65536):(t.push(i),r--)):t.push(i);return t}function checkScalarValue(e){if(e>=55296&&e<=57343)throw Error(zs(255,{point:e}))}function createByte(e,n){return t(e>>n&63|128)}function encodeCodePoint(e){if(!(e&4294967168))return t(e);let n=``;return e&4294965248?e&4294901760?e&4292870144||(n=t(e>>18&7|240),n+=createByte(e,12),n+=createByte(e,6)):(checkScalarValue(e),n=t(e>>12&15|224),n+=createByte(e,6)):n=t(e>>6&31|192),n+=t(e&63|128),n}let n=ucs2decode(e),r=n.length,i=-1,o,s=``;for(;++i<r;)o=n[i],s+=encodeCodePoint(o);return s}var getHeaders=(e,t,n,r,i,o)=>{let{content:s,path:c,created:p}=e,m=convertTime(p),h=convertDate(p),g=getCrcFromCrc32Table(i),_=o===void 0?r:o,v=_utf8_encode(c),y=v!==c,b=``;if(y){let e=convertDecToHex(1,1)+convertDecToHex(getCrcFromCrc32Table(v),4)+v;b=`up`+convertDecToHex(e.length,2)+e}let x=`�\0`+(y?`\0\b`:`\0\0`)+convertDecToHex(t?8:0,2)+convertDecToHex(m,2)+convertDecToHex(h,2)+convertDecToHex(_?g:0,4)+convertDecToHex(o??r,4)+convertDecToHex(r,4)+convertDecToHex(v.length,2)+convertDecToHex(b.length,2),S=`PK��`+x+v+b,C=`PK���\0`+x+`\0\0\0\0\0\0`+(s?`\0\0\0\0`:`�\0\0\0`)+convertDecToHex(n,4)+v+b;return{localFileHeader:Uint8Array.from(S,e=>e.charCodeAt(0)),centralDirectoryHeader:Uint8Array.from(C,e=>e.charCodeAt(0))}},getDecodedContent=e=>{let t;if(typeof e==`string`){let n=atob(e.split(`;base64,`)[1]);t=Uint8Array.from(n,e=>e.charCodeAt(0))}else t=e;return{size:t.length,content:t}},getDeflatedHeaderAndContent=async(e,t)=>{let{content:n}=e,{size:r,content:i}=n?getDecodedContent(n):{size:0,content:Uint8Array.from([])},o,s,c=!1;if(e.type===`file`&&i&&r>0){let e=await deflateLocalFile(i);o=e.content,s=e.size,c=!0}return{...getHeaders(e,c,t,r,i,s),content:o||i,isCompressed:c}},getHeaderAndContent=(e,t)=>{let{content:n}=e,{content:r}=n?getDecodedContent(n):{content:Uint8Array.from([])};return{...getHeaders(e,!1,t,r.length,r,void 0),content:r,isCompressed:!1}},buildCentralDirectoryEnd=(e,t,n)=>{let r=`PK��\0\0\0\0`+convertDecToHex(e,2)+convertDecToHex(e,2)+convertDecToHex(t,4)+convertDecToHex(n,4)+`\0\0`;return Uint8Array.from(r,e=>e.charCodeAt(0))},ZipContainer=class{constructor(){this.folders=[],this.files=[]}addFolders(e){e.forEach(this.addFolder.bind(this))}addFolder(e){this.folders.push({path:e,created:new Date,isBase64:!1,type:`folder`})}addFile(e,t,n=!1){this.files.push({path:e,created:new Date,content:n?t:new TextEncoder().encode(t),isBase64:n,type:`file`})}async getZipFile(e=`application/zip`){let t=await this.buildCompressedFileStream();return this.clearStream(),new Blob([t],{type:e})}getUncompressedZipFile(e=`application/zip`){let t=this.buildFileStream();return this.clearStream(),new Blob([t],{type:e})}clearStream(){this.folders=[],this.files=[]}packageFiles(e){let t=0,n=0;for(let r of e){let{localFileHeader:e,centralDirectoryHeader:i,content:o}=r;t+=e.length+o.length,n+=i.length}let r=new Uint8Array(t),i=new Uint8Array(n),o=0,s=0;for(let t of e){let{localFileHeader:e,centralDirectoryHeader:n,content:c}=t;r.set(e,o),o+=e.length,r.set(c,o),o+=c.length,i.set(n,s),s+=n.length}let c=buildCentralDirectoryEnd(e.length,n,t),p=new Uint8Array(r.length+i.length+c.length);return p.set(r),p.set(i,r.length),p.set(c,r.length+i.length),p}async buildCompressedFileStream(){let e=[...this.folders,...this.files],t=[],n=0;
4for(let r of e){let e=await getDeflatedHeaderAndContent(r,n),{localFileHeader:i,content:o}=e;t.push(e),n+=i.length+o.length}return this.packageFiles(t)}buildFileStream(){let e=[...this.folders,...this.files],t=[],n=0;for(let r of e){let e=getHeaderAndContent(r,n),{localFileHeader:i,content:o}=e;t.push(e),n+=i.length+o.length}return this.packageFiles(t)}},createExcelXMLCoreFolderStructure=e=>{if(e.addFolders([`_rels/`,`docProps/`,`xl/`,`xl/theme/`,`xl/_rels/`,`xl/worksheets/`]),!rh.size)return;e.addFolders([`xl/worksheets/_rels`,`xl/drawings/`,`xl/drawings/_rels`,`xl/media/`]);let t=0;rh.forEach(n=>{let{base64:r,imageType:i}=n[0].image[0];e.addFile(`xl/media/image${++t}.${_normaliseImageExtension(i)}`,r,!0)})},createExcelXmlWorksheets=(e,t)=>{let n=0,r=0;for(let i=0;i<t.length;i++){let o=t[i];e.addFile(`xl/worksheets/sheet${i+1}.xml`,o,!1);let s=rh.size>0&&ih.has(i),c=ch.size>0&&ch.get(i),p=rh.size&&ah.has(i);if(!s&&!c&&!p)continue;let m,h,g;s&&(createExcelXmlDrawings(e,i,n),h=n,n++),p&&(createExcelVmlDrawings(e,i,r),g=r,r++),c&&(m=c.name);let _=`xl/worksheets/_rels/sheet${i+1}.xml.rels`;e.addFile(_,createXlsxRelationships({tableName:m,drawingIndex:h,vmlDrawingIndex:g}))}},createExcelXmlDrawings=(e,t,n)=>{let r=`xl/drawings`,i=`${r}/drawing${n+1}.xml`,o=`${r}/_rels/drawing${n+1}.xml.rels`;e.addFile(o,createXlsxDrawingRel(t)),e.addFile(i,createXlsxDrawing(t))},createExcelVmlDrawings=(e,t,n)=>{let r=`xl/drawings`,i=`${r}/vmlDrawing${n+1}.vml`,o=`${r}/_rels/vmlDrawing${n+1}.vml.rels`;e.addFile(i,createXlsxVmlDrawing(t)),e.addFile(o,createXlsxVmlDrawingRel(t))},createExcelXmlTables=e=>{let t=ch,n=Array.from(t.keys());for(let r=0;r<n.length;r++){let i=n[r],o=t.get(i);o&&e.addFile(`xl/tables/${o.name}.xml`,createXlsxTable(o,r))}},createExcelXmlCoreSheets=(e,t,n,r,i)=>{e.addFile(`xl/workbook.xml`,createXlsxWorkbook(i)),e.addFile(`xl/styles.xml`,createXlsxStylesheet(t)),e.addFile(`xl/sharedStrings.xml`,createXlsxSharedStrings()),e.addFile(`xl/theme/theme1.xml`,createXlsxTheme()),e.addFile(`xl/_rels/workbook.xml.rels`,createXlsxWorkbookRels(r)),e.addFile(`docProps/core.xml`,createXlsxCore(n)),e.addFile(`[Content_Types].xml`,createXlsxContentTypes(r)),e.addFile(`_rels/.rels`,createXlsxRels())},createExcelFileForExcel=(e,t,n={})=>{if(!t||t.length===0)return q(159),resetXlsxFactory(),!1;let{fontSize:r=11,author:i=`AG Grid`,activeTab:o=0}=n,s=t.length,c=Math.max(Math.min(o,s-1),0);return createExcelXMLCoreFolderStructure(e),createExcelXmlTables(e),createExcelXmlWorksheets(e,t),createExcelXmlCoreSheets(e,r,i,s,c),resetXlsxFactory(),!0},getMultipleSheetsAsExcelCompressed=e=>{let{data:t,fontSize:n,author:r,activeSheetIndex:i}=e,o=e.mimeType||`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,s=new ZipContainer;return createExcelFileForExcel(s,t,{author:r,fontSize:n,activeTab:i})?s.getZipFile(o):Promise.resolve(void 0)},getMultipleSheetsAsExcel=e=>{let{data:t,fontSize:n,author:r,activeSheetIndex:i}=e,o=e.mimeType||`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,s=new ZipContainer;if(createExcelFileForExcel(s,t,{author:r,fontSize:n,activeTab:i}))return s.getUncompressedZipFile(o)},exportMultipleSheetsAsExcel=e=>{let{fileName:t=`export.xlsx`}=e;getMultipleSheetsAsExcelCompressed(e).then(e=>{if(e){let n=typeof t==`function`?t():t;xc(n,e)}})},ExcelCreator=class extends Wa{constructor(){super(...arguments),this.beanName=`excelCreator`}getMergedParams(e){let t=this.gos.get(`defaultExcelExportParams`);return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){q(160);return}let t=this.getMergedParams(e),n={data:[this.getData(t)],fontSize:t.fontSize,author:t.author,mimeType:t.mimeType};this.packageCompressedFile(n).then(e=>{if(e){let{fileName:n}=t,r=typeof n==`function`?n(co(this.gos,{})):n;xc(this.getFileName(r),e)}})}exportDataAsExcel(e){this.export(e)}getDataAsExcel(e){let t=this.getMergedParams(e),n={data:[this.getData(t)],fontSize:t.fontSize,author:t.author,mimeType:t.mimeType};return this.packageFile(n)}setFactoryMode(e){setXlsxFactoryMode(e)}getFactoryMode(){return getXlsxFactoryMode()}getSheetDataForExcel(e){let t=this.getMergedParams(e);return this.getData(t)}
4getMultipleSheetsAsExcel(e){return getMultipleSheetsAsExcel(e)}exportMultipleSheetsAsExcel(e){exportMultipleSheetsAsExcel(e)}getDefaultFileExtension(){return`xlsx`}createSerializingSession(e){let{colModel:t,colNames:n,rowGroupColsSvc:r,valueSvc:i,gos:o}=this.beans;return new ExcelSerializingSession({...e,colModel:t,colNames:n,rowGroupColsSvc:r,valueSvc:i,gos:o,suppressRowOutline:e.suppressRowOutline||e.skipRowGroups,headerRowHeight:e.headerRowHeight||e.rowHeight,baseExcelStyles:o.get(`excelStyles`)||[],rightToLeft:e.rightToLeft??o.get(`enableRtl`),styleLinker:this.styleLinker.bind(this)})}styleLinker(e){let{rowType:t,rowIndex:n,value:r,column:i,columnGroup:o,node:s}=e,c=t===`HEADER`,p=t===`HEADER_GROUPING`,m=c?i:o,h=[],{gos:g,cellStyles:_}=this.beans;if(c||p)return h.push(`header`),p&&h.push(`headerGroup`),m&&(h=h.concat(cl(m.getDefinition(),g,i||null,o||null))),h;let v=g.get(`excelStyles`),y=[`cell`];if(!v?.length)return y;let b=v.map(e=>e.id),x=i.getDefinition();return _?.processAllCellClasses(x,co(g,{value:r,data:s.data,node:s,colDef:x,column:i,rowIndex:n}),e=>{b.indexOf(e)>-1&&y.push(e)}),y.sort((e,t)=>b.indexOf(e)<b.indexOf(t)?-1:1)}isExportSuppressed(){return this.gos.get(`suppressExcelExport`)}packageCompressedFile(e){return getMultipleSheetsAsExcelCompressed(e)}packageFile(e){return getMultipleSheetsAsExcel(e)}},Z=`34.3.1`,fh={moduleName:`EnterpriseCore`,version:Z,beans:[GridLicenseManager],icons:{accordionOpen:`tree-open`,accordionClosed:`tree-closed`,accordionIndeterminate:`tree-indeterminate`,close:`cross`,cancel:`cancel`,maximize:`maximize`,minimize:`minimize`,columnDrag:`grip`},dependsOn:[]},ph=`.ag-advanced-filter-header{align-items:center;background-color:var(--ag-header-background-color);border-bottom:var(--ag-header-row-border);display:flex;position:relative}.ag-advanced-filter{align-items:center;display:flex;width:100%}.ag-advanced-filter-buttons{display:contents}.ag-advanced-filter-header-cell{height:100%;padding-left:var(--ag-cell-horizontal-padding);padding-right:var(--ag-cell-horizontal-padding)}.ag-advanced-filter-apply-button,.ag-advanced-filter-builder-button{align-items:center;background-color:unset;border:0;display:flex;font-size:var(--ag-font-size);font-weight:600;line-height:normal;padding:var(--ag-spacing);white-space:nowrap;&:where(:not(:disabled)){cursor:pointer;&:hover{background-color:var(--ag-row-hover-color)}}}:where(.ag-ltr) .ag-advanced-filter-apply-button,:where(.ag-ltr) .ag-advanced-filter-builder-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-advanced-filter-apply-button,:where(.ag-rtl) .ag-advanced-filter-builder-button{margin-right:calc(var(--ag-spacing)*2)}:where(.ag-ltr) .ag-advanced-filter-builder-button-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) .ag-advanced-filter-builder-button-label{margin-right:var(--ag-spacing)}.ag-advanced-filter-builder{display:flex;flex-direction:column;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.ag-advanced-filter-builder-list{flex:1;overflow:auto}.ag-advanced-filter-builder-button-panel{border-top:var(--ag-advanced-filter-builder-button-bar-border);display:flex;justify-content:flex-end;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-advanced-filter-builder-apply-button,:where(.ag-ltr) .ag-advanced-filter-builder-cancel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-advanced-filter-builder-apply-button,:where(.ag-rtl) .ag-advanced-filter-builder-cancel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-advanced-filter-builder-item-wrapper{align-items:center;display:flex;flex:1 1 auto;justify-content:space-between;overflow:hidden}:where(.ag-ltr) .ag-advanced-filter-builder-item-wrapper{padding-left:calc(var(--ag-icon-size)/2);padding-right:var(--ag-icon-size)}:where(.ag-rtl) .ag-advanced-filter-builder-item-wrapper{padding-left:var(--ag-icon-size);padding-right:calc(var(--ag-icon-size)/2)}:where(.ag-virtual-list-viewport .ag-advanced-filter-builder-item-wrapper) .ag-tab-guard{position:absolute}
4.ag-advanced-filter-builder-item-tree-lines>*{width:var(--ag-advanced-filter-builder-indent-size)}.ag-advanced-filter-builder-item-tree-line-root{width:var(--ag-icon-size);&:before{height:50%;top:50%}}.ag-advanced-filter-builder-item-tree-line-horizontal,.ag-advanced-filter-builder-item-tree-line-vertical,.ag-advanced-filter-builder-item-tree-line-vertical-bottom,.ag-advanced-filter-builder-item-tree-line-vertical-top{align-items:center;display:flex;height:100%;position:relative;&:after,&:before{content:"";height:100%;position:absolute}}.ag-advanced-filter-builder-item-tree-line-horizontal:after{border-bottom:var(--ag-border-width) solid var(--ag-border-color);height:50%;top:0;width:calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size))}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-horizontal:after{left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-horizontal:after{right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-tree-line-vertical:before{top:0;width:calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size)/2)}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-vertical:before{border-left:var(--ag-border-width) solid var(--ag-border-color);left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-vertical:before{border-right:var(--ag-border-width) solid var(--ag-border-color);right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-tree-line-vertical-top:before{height:50%;top:0;width:calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size)/2)}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-vertical-top:before{border-left:var(--ag-border-width) solid var(--ag-border-color);left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-vertical-top:before{border-right:var(--ag-border-width) solid var(--ag-border-color);right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-tree-line-vertical-bottom:before{height:calc(50% - var(--ag-icon-size)*1.5/2);top:calc(50% + var(--ag-icon-size)*1.5/2);width:calc(var(--ag-icon-size)/2)}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-vertical-bottom:before{border-left:var(--ag-border-width) solid var(--ag-border-color);left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-vertical-bottom:before{border-right:var(--ag-border-width) solid var(--ag-border-color);right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-condition{padding-bottom:var(--ag-spacing);padding-top:var(--ag-spacing)}.ag-advanced-filter-builder-item,.ag-advanced-filter-builder-item-buttons,.ag-advanced-filter-builder-item-condition,.ag-advanced-filter-builder-item-tree-lines,.ag-advanced-filter-builder-pill,.ag-advanced-filter-builder-pill-wrapper{align-items:center;display:flex;height:100%}.ag-advanced-filter-builder-pill-wrapper{margin:0 var(--ag-spacing)}.ag-advanced-filter-builder-pill{border-radius:var(--ag-border-radius);min-height:calc(100% - var(--ag-spacing)*3);min-width:calc(var(--ag-spacing)*2);padding:var(--ag-spacing) calc(var(--ag-spacing)*2);position:relative}:where(.ag-advanced-filter-builder-pill){.ag-advanced-filter-builder-value-number{font-family:monospace;font-weight:700}.ag-advanced-filter-builder-value-empty{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-advanced-filter-builder-pill){.ag-picker-field-display{margin-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-advanced-filter-builder-pill){.ag-picker-field-display{margin-left:var(--ag-spacing)}}.ag-advanced-filter-builder-pill-display{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-advanced-filter-builder-join-pill{background-color:var(--ag-advanced-filter-builder-join-pill-color);cursor:pointer}.ag-advanced-filter-builder-column-pill{background-color:var(--ag-advanced-filter-builder-column-pill-color);cursor:pointer}.ag-advanced-filter-builder-option-pill{background-color:var(--ag-advanced-filter-builder-option-pill-color);cursor:pointer}
4.ag-advanced-filter-builder-value-pill{background-color:var(--ag-advanced-filter-builder-value-pill-color);cursor:text;max-width:140px;:where(.ag-advanced-filter-builder-pill-display){display:block}}.ag-advanced-filter-builder-item-buttons>*{margin:0 calc(var(--ag-spacing)*.5)}.ag-advanced-filter-builder-item-button{color:var(--ag-subtle-text-color);cursor:pointer;position:relative}.ag-advanced-filter-builder-item-button,.ag-advanced-filter-builder-pill{&:focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-advanced-filter-builder-item-button-disabled{cursor:default;opacity:.5}.ag-advanced-filter-builder-virtual-list-container{top:var(--ag-spacing)}.ag-advanced-filter-builder-virtual-list-item{cursor:default;display:flex;height:var(--ag-list-item-height);&:hover{background-color:var(--ag-row-hover-color);:where(.ag-advanced-filter-builder-item-button){opacity:1}}}.ag-advanced-filter-builder-invalid{color:var(--ag-subtle-text-color);cursor:default;margin:0 var(--ag-spacing)}:where(.ag-advanced-filter-builder-validation) .ag-advanced-filter-builder-invalid{color:var(--ag-invalid-color)}:where(.ag-advanced-filter-builder-virtual-list-item-highlight) .ag-advanced-filter-builder-item-button:focus-visible{opacity:1}`;function getAdvancedFilterModel(e){return e.filterManager?.getAdvFilterModel()??null}function setAdvancedFilterModel(e,t){e.filterManager?.setAdvFilterModel(t)}function showAdvancedFilterBuilder(e){e.filterManager?.toggleAdvFilterBuilder(!0,`api`)}function hideAdvancedFilterBuilder(e){e.filterManager?.toggleAdvFilterBuilder(!1,`api`)}var mh={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`,advancedFilterReset:`Reset`,advancedFilterCancel:`Cancel`,advancedFilterClear:`Clear`,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`,advancedFilterBuilderClear:`Clear`,advancedFilterBuilderReset:`Reset`,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 c
4onditions are complete.`,advancedFilterBuilderValidationSelectColumn:`Must select a column.`,advancedFilterBuilderValidationSelectOption:`Must select an option.`,advancedFilterBuilderValidationEnterValue:`Must enter a value.`};function getSearchString(e,t,n){if(!e)return``;let r=n-t;return r?e.slice(0,e.length-r):e}function updateExpression(e,t,n,r,i,o,s){let c=n+(!e.length||s?0:1),p=0;return i&&(e[c]===` `?p=1:(r+=` `,o&&(r+=`"`))),{updatedValue:e.slice(0,t)+r+e.slice(c),updatedPosition:t+r.length+p}}function findStartPosition(e,t,n){let r=t;for(;r<n&&e[r]===` `;)r++;return r}function findEndPosition(e,t,n,r){let i=t,o=!1;for(;i<e.length;){let t=e[i];if(t===`(`){r&&e[i-1]===` `?o=!0:--i;break}if(t===` `||n&&t===`)`){--i;break}i++}return{endPosition:i,isEmpty:o}}function checkAndUpdateExpression(e,t,n,r){n!==t&&(e.expression=updateExpression(e.expression,r-t.length+1,r,n).updatedValue)}var ColumnParser=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===hh&&!this.colName)this.hasStartChar=!0;else if(e===gh&&this.hasStartChar){if(this.parseColumn(!1,t))return this.hasEndChar=!0,!1;this.colName+=e}else this.colName+=e}getDisplayValue(){return(this.hasStartChar?hh:``)+this.colName+(this.hasEndChar?gh:``)}getColId(){return this.colId}complete(e){this.parseColumn(!0,e)}getValidationError(){return this.valid?null:{message:this.params.advFilterExpSvc.translate(`advancedFilterValidationInvalidColumn`),startPosition:this.startPosition,endPosition:this.endPosition??this.params.expression.length-1}}parseColumn(e,t){this.endPosition=t;let n=this.params.advFilterExpSvc.getColId(this.colName);return n&&this.hasStartChar&&(this.colId=n.colId,checkAndUpdateExpression(this.params,this.colName,n.columnName,t-1),this.colName=n.columnName,this.column=this.params.colModel.getColDefCol(this.colId),this.column)?(this.baseCellDataType=this.params.dataTypeSvc?.getBaseDataType(this.column)??`text`,!0):(e&&(this.valid=!1),this.baseCellDataType=`text`,!1)}},OperatorParser=class{constructor(e,t,n){this.params=e,this.startPosition=t,this.baseCellDataType=n,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(){return this.valid?null:{message:this.params.advFilterExpSvc.translate(`advancedFilterValidationInvalidOption`),startPosition:this.startPosition,endPosition:this.endPosition??this.params.expression.length-1}}getDisplayValue(){return this.operator}getOperatorKey(){return this.parsedOperator}parseOperator(e,t){let n=this.params.advFilterExpSvc.getDataTypeExpressionOperator(this.baseCellDataType),r=n.findOperator(this.operator);if(this.endPosition=t,r){this.parsedOperator=r;let e=n.operators[r];this.expectedNumOperands=e.numOperands;let i=e.displayValue;return checkAndUpdateExpression(this.params,this.operator,i,t),this.operator=i,!0}return(e||r!==null)&&(this.valid=!1),!1}},OperandParser=class{constructor(e,t,n,r){this.params=e,this.startPosition=t,this.baseCellDataType=n,this.column=r,this.type=`operand`,this.valid=!0,this.operand=``,this.validationMessage=null,this.filterValidationSetters={number:()=>{(this.quotes||isNaN(this.modelValue))&&(this.valid=!1,this.validationMessage=this.params.advFilterExpSvc.translate(`advancedFilterValidationNotANumber`))},date:e=>{e??(this.valid=!1,this.validationMessage=this.params.advFilterExpSvc.translate(`advancedFilterValidationInvalidDate`))},dateString:(...e)=>this.filterValidationSetters.date(...e),dateTime:(...e)=>this.filterValidationSetters.date(...e),dateTimeString:(...e)=>this.filterValidationSetters.date(...e),boolean(){},object(){},text(){}}}parse(e,t){if(e===` `){if(this.quotes)this.operand+=e;else return this.parseOperand(!1,t),!0}else if(e===`)`){if(this.baseCellDataType===`number`||!this.quotes)return this.parseOperand(!1,t-1),!0;this.operand+=e}else if(!this.operand&&!this.quotes&&(e===`'`||e===`"`))this.quotes=e;else if(this.quotes&&e===this.quotes)return this.parseOperand(!1,t),!1;else this.operand+=e}complete(e){this.parseOperand(!0,e)}getValidationError(){return this.validationMessage?{message:this.validationMessage,startPosition:this.startPosition,endPosition:this.endPosition??this.params.expression.length-1}:null}getRawValue(){return this.operand}getModelValue(){return this.modelValue}parseOperand(e,t){let{advFilterExpSvc:n}=this.params;if(this.endPosition=t,this.modelValue=this.operand,e&&this.quotes)this.valid=!1,this.validationMessage=n.translate(`advancedFilterValidationMissingQuote`);else if(this.modelValue===``)this.valid=!1,this.validationMessage=n.translate(`advancedFilterValidationMissingValue`);else{let e=n.getOperandModelValue(this.operand,this.baseCellDataType,this.column);e!=null&&(this.modelValue=e),this.filterValidationSetters[this.baseCellDataType](e)}}},hh=`[`,gh=`]`,ColFilterExpressionParser=class{constructor(e,t){this.params=e,this.startPosition=t,this.isAwaiting=!0,this.operandValueGetters={number:Number,date:e=>this.params.valueSvc.parseValue(this.columnParser.column,null,e,void 0),dateString:(...e)=>this.operandValueGetters.date(...e),dateTime:(...e)=>this.operandValueGetters.date(...e),dateTimeString:(...e)=>this.operandValueGetters.date(...e),boolean:e=>e,object:e=>e,text:e=>e}}parseExpression(){let e=this.startPosition,{expression:t}=this.params;for(;e<t.length;){let n=t[e];if(!(n===` `&&this.isAwaiting)){if(this.isAwaiting=!1,!this.parser){let t;this.columnParser?this.operatorParser?(this.operandParser=new OperandParser(this.params,e,this.columnParser.baseCellDataType,this.columnParser.column),t=this.operandParser):(this.operatorParser=new OperatorParser(this.params,e,this.columnParser.baseCellDataType),t=this.operatorParser):(this.columnParser=new ColumnParser(this.params,e),t=this.columnParser),this.parser=t}let t=this.parser.parse(n,e);if(t!=null){if(this.isComplete())return this.returnEndPosition(t?e-1:e,!0);this.parser=void 0,this.isAwaiting=!0}}e++}return this.parser?.complete?.(e-1),this.returnEndPosition(e)}isValid(){return this.isComplete()&&this.columnParser.valid&&this.operatorParser.valid&&(!this.operandParser||this.operandParser.valid)}getValidationError(){let e=this.columnParser?.getValidationError()??this.operatorParser?.getValidationError()??this.operandParser?.getValidationError();if(e)return e;let t=this.params.expression.length,n;return this.columnParser?this.operatorParser?this.operatorParser.expectedNumOperands&&!this.operandParser&&(n=`advancedFilterValidationMissingValue`):n=`advancedFilterValidationMissingOption`:n=`advancedFilterValidationMissingColumn`,n?{message:this.params.advFilterExpSvc.translate(n),startPosition:t,endPosition:t}:null}getFunction(e){return this.getFunctionCommon(e,(e,t,n,r)=>(i,o,s)=>s.operators[t].evaluator(i.getValue(n,o),o,s.evaluatorParams[r],e==null?void 0:s.operands[e]))}getAutocompleteListParams(e){if(this.isColumnPosition(e))return this.getColumnAutocompleteListParams(e);if(this.isOperatorPosition(e))return this.getOperatorAutocompleteListParams(e);if(!this.isBeyondEndPosition(e))return{enabled:!1}}updateExpression(e,t,n){let{expression:r}=this.params;if(this.isColumnPosition(e))return updateExpression(this.params.expression,this.startPosition,this.columnParser?.getColId()?this.columnParser.endPosition:findEndPosition(r,e).endPosition,this.params.advFilterExpSvc.getColumnValue(t),!0);if(this.isOperatorPosition(e)){let i=this.getBaseCellDataTypeFromOperatorAutocompleteType(n),o=this.hasOperand(i,t.key),s=o&&this.doesOperandNeedQuotes(i),c;if(this.operatorParser?.startPosition!=null&&e<this.operatorParser.startPosition)c=updateExpression(r,e,e,t.displayValue??t.key,o,s);else{let n,i=!1;if(this.operatorParser?.getOperatorKey())n=this.operatorParser.endPosition;else{let{endPosition:t,isEmpty:o}=findEndPosition(r,e,!0,!0);n=t,i=o}c=updateExpression(r,findStartPosition(r,this.columnParser.endPosition+1,n),n,t.displayValue??t.key,o,s,i)}return{...c,hideAutocomplete:!o}}return null}getModel(){let 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){let n=this.columnParser.getColId(),r=this.operatorParser?.getOperatorKey(),{operators:i,evaluatorParams:o,operands:s}=e,c=this.params.advFilterExpSvc.getExpressionOperator(this.columnParser.baseCellDataType,r),p=this.addToListAndGetIndex(i,c),m=this.params.advFilterExpSvc.getExpressionEvaluatorParams(n),h=this.addToListAndGetIndex(o,m);return t(this.operatorParser?.expectedNumOperands===0?void 0:this.addToListAndGetIndex(s,this.getOperandValue()),p,n,h)}getOperandValue(){let{baseCellDataType:e,column:t}=this.columnParser,n=this.operandValueGetters[e](this.operandParser.getRawValue());return e===`dateString`||e===`dateTimeString`?this.params.dataTypeSvc?.getDateParserFunction(t)(n)??n:n}isComplete(){return!!(this.operatorParser&&(!this.operatorParser.expectedNumOperands||this.operatorParser.expectedNumOperands&&this.operandParser))}isColumnPosition(e){return this.columnParser?.endPosition==null||e<=this.columnParser.endPosition+1}isOperatorPosition(e){return this.operatorParser?.endPosition==null||e<=this.operatorParser.endPosition+1}isBeyondEndPosition(e){return this.isComplete()&&this.endPosition!=null&&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.advFilterExpSvc.generateAutocompleteListParams(this.params.advFilterExpSvc.getColumnAutocompleteEntries(),`column`,this.getColumnSearchString(e))}getColumnSearchString(e){let t=this.columnParser?.getDisplayValue()??``,n=getSearchString(t,e,this.columnParser?.endPosition==null?this.params.expression.length:this.columnParser.endPosition+1),r=this.columnParser?.hasStartChar&&n.length>0,i=this.columnParser?.hasEndChar&&n.length===t.length+2;return r?n.slice(1,i?-1:void 0):n}getOperatorAutocompleteListParams(e){let t=this.columnParser?.column;if(!t)return{enabled:!1};let n=this.columnParser.baseCellDataType,r=this.operatorParser?.startPosition!=null&&e<this.operatorParser.startPosition?``:getSearchString(this.operatorParser?.getDisplayValue()??``,e,this.operatorParser?.endPosition==null?this.params.expression.length:this.operatorParser.endPosition+1);return this.params.advFilterExpSvc.generateAutocompleteListParams(this.params.advFilterExpSvc.getOperatorAutocompleteEntries(t,n),`operator-${n}`,r)}getBaseCellDataTypeFromOperatorAutocompleteType(e){return e?.replace(`operator-`,``)}hasOperand(e,t){return!e||!t||(this.params.advFilterExpSvc.getExpressionOperator(e,t)?.numOperands??0)>0}doesOperandNeedQuotes(e){return e!==`number`}addToListAndGetIndex(e,t){let n=e.length;return e.push(t),n}};
4function findMatch(e,t,n){let r=!1,i=e.toLocaleLowerCase(),o=i+` `,s=Object.keys(t).find(e=>{let s=t[e],c=n(s).toLocaleLowerCase();return c.startsWith(o)&&(r=!0),c===i});if(s)return s;if(r)return null}function getEntries(e,t){return(t??Object.keys(e)).map(t=>({key:t,displayValue:e[t].displayValue}))}var TextFilterExpressionOperators=class{constructor(e){this.params=e,this.initOperators()}getEntries(e){return getEntries(this.operators,e)}findOperator(e){return findMatch(e,this.operators,({displayValue:e})=>e)}initOperators(){let{translate:e}=this.params;this.operators={contains:{displayValue:e(`advancedFilterContains`),evaluator:(e,t,n,r)=>this.evaluateExpression(e,t,n,r,!1,(e,t)=>e.includes(t)),numOperands:1},notContains:{displayValue:e(`advancedFilterNotContains`),evaluator:(e,t,n,r)=>this.evaluateExpression(e,t,n,r,!0,(e,t)=>!e.includes(t)),numOperands:1},equals:{displayValue:e(`advancedFilterTextEquals`),evaluator:(e,t,n,r)=>this.evaluateExpression(e,t,n,r,!1,(e,t)=>e===t),numOperands:1},notEqual:{displayValue:e(`advancedFilterTextNotEqual`),evaluator:(e,t,n,r)=>this.evaluateExpression(e,t,n,r,!0,(e,t)=>e!=t),numOperands:1},startsWith:{displayValue:e(`advancedFilterStartsWith`),evaluator:(e,t,n,r)=>this.evaluateExpression(e,t,n,r,!1,(e,t)=>e.startsWith(t)),numOperands:1},endsWith:{displayValue:e(`advancedFilterEndsWith`),evaluator:(e,t,n,r)=>this.evaluateExpression(e,t,n,r,!1,(e,t)=>e.endsWith(t)),numOperands:1},blank:{displayValue:e(`advancedFilterBlank`),evaluator:e=>e==null||typeof e==`string`&&e.trim().length===0,numOperands:0},notBlank:{displayValue:e(`advancedFilterNotBlank`),evaluator:e=>e!=null&&(typeof e!=`string`||e.trim().length>0),numOperands:0}}}evaluateExpression(e,t,n,r,i,o){return e==null?i:n.caseSensitive?o(n.valueConverter(e,t),r):o(n.valueConverter(e,t).toLocaleLowerCase(),r.toLocaleLowerCase())}},ScalarFilterExpressionOperators=class{constructor(e){this.params=e,this.initOperators()}getEntries(e){return getEntries(this.operators,e)}findOperator(e){return findMatch(e,this.operators,({displayValue:e})=>e)}initOperators(){let{translate:e,equals:t}=this.params;this.operators={equals:{displayValue:e(`advancedFilterEquals`),evaluator:(e,n,r,i)=>this.evaluateSingleOperandExpression(e,n,r,i,!!r.includeBlanksInEquals,t),numOperands:1},notEqual:{displayValue:e(`advancedFilterNotEqual`),evaluator:(e,n,r,i)=>this.evaluateSingleOperandExpression(e,n,r,i,!!r.includeBlanksInEquals,(e,n)=>!t(e,n)),numOperands:1},greaterThan:{displayValue:e(`advancedFilterGreaterThan`),evaluator:(e,t,n,r)=>this.evaluateSingleOperandExpression(e,t,n,r,!!n.includeBlanksInGreaterThan,(e,t)=>e>t),numOperands:1},greaterThanOrEqual:{displayValue:e(`advancedFilterGreaterThanOrEqual`),evaluator:(e,t,n,r)=>this.evaluateSingleOperandExpression(e,t,n,r,!!n.includeBlanksInGreaterThan,(e,t)=>e>=t),numOperands:1},lessThan:{displayValue:e(`advancedFilterLessThan`),evaluator:(e,t,n,r)=>this.evaluateSingleOperandExpression(e,t,n,r,!!n.includeBlanksInLessThan,(e,t)=>e<t),numOperands:1},lessThanOrEqual:{displayValue:e(`advancedFilterLessThanOrEqual`),evaluator:(e,t,n,r)=>this.evaluateSingleOperandExpression(e,t,n,r,!!n.includeBlanksInLessThan,(e,t)=>e<=t),numOperands:1},blank:{displayValue:e(`advancedFilterBlank`),evaluator:e=>e==null,numOperands:0},notBlank:{displayValue:e(`advancedFilterNotBlank`),evaluator:e=>e!=null,numOperands:0}}}evaluateSingleOperandExpression(e,t,n,r,i,o){return e==null?i:o(n.valueConverter(e,t),r)}},BooleanFilterExpressionOperators=class{constructor(e){this.params=e,this.initOperators()}getEntries(e){return getEntries(this.operators,e)}findOperator(e){return findMatch(e,this.operators,({displayValue:e})=>e)}initOperators(){let{translate:e}=this.params;this.operators={true:{displayValue:e(`advancedFilterTrue`),evaluator:e=>!!e,numOperands:0},false:{displayValue:e(`advancedFilterFalse`),evaluator:e=>e===!1,numOperands:0},blank:{displayValue:e(`advancedFilterBlank`),evaluator:e=>e==null,numOperands:0},notBlank:{displayValue:e(`advancedFilterNotBlank`),evaluator:e=>e!=null,numOperands:0}}}},AdvancedFilterExpressionService=class extends U{constructor(){super(...arguments),this.beanName=`advFilterExpSvc`,this.filterOperandGetters={number:e=>Al(e.filter)??``,date:e=>{let t=this.colModel.getColDefCol(e.colId);return t?this.valueSvc.formatValue(t,null,Ec(e.filter)):null},dateTime:e=>this.filterOperandGetters.date(e),dateString:e=>{let t=this.colModel.getColDefCol(e.colId);if(!t)return null;let{filter:n}=e,r=this.dataTypeSvc?.getDateFormatterFunction(t),i=r?.(Ec(n)??void 0)??n;return this.valueSvc.formatValue(t,null,i)},dateTimeString:e=>this.filterOperandGetters.dateString(e),boolean:()=>null,object:()=>null,text:()=>null},this.operandModelValueGetters={number:e=>
4Xs(e)?Number(e):null,date:(e,t,n)=>Aa(this.valueSvc.parseValue(t,null,e,void 0),!!this.dataTypeSvc?.getDateIncludesTimeFlag(n)),dateTime:(...e)=>this.operandModelValueGetters.date(...e),dateString:(e,t,n)=>{let r=this.valueSvc.parseValue(t,null,e,void 0);return this.dataTypeSvc?Aa(this.dataTypeSvc.getDateParserFunction(t)(r)??null,this.dataTypeSvc.getDateIncludesTimeFlag(n)):r},dateTimeString:(...e)=>this.operandModelValueGetters.dateString(...e),boolean:e=>e,object:e=>e,text:e=>e},this.columnNameToIdMap={},this.columnAutocompleteEntries=null,this.expressionEvaluatorParams={}}wireBeans(e){this.valueSvc=e.valueSvc,this.colModel=e.colModel,this.colNames=e.colNames,this.dataTypeSvc=e.dataTypeSvc}postConstruct(){this.expressionJoinOperators=this.generateExpressionJoinOperators(),this.expressionOperators=this.generateExpressionOperators()}parseJoinOperator(e){let{type:t}=e;return this.expressionJoinOperators[t]??t}getColumnDisplayValue(e){let{colId:t}=e,n=this.getColumnAutocompleteEntries().find(({key:e})=>e===t),r;return n?(r=n.displayValue,this.columnNameToIdMap[r.toLocaleUpperCase()]={colId:t,columnName:r}):r=t,r}getOperatorDisplayValue(e){return this.getExpressionOperator(e.filterType,e.type)?.displayValue??e.type}getOperandModelValue(e,t,n){return this.operandModelValueGetters[t](e,n,t)}getOperandDisplayValue(e,t){let{filter:n}=e;if(n==null)return``;let r=this.filterOperandGetters[e.filterType](e);return e.filterType!==`number`&&(r??=Al(n)??``,t||(r=`"${r}"`)),t?r:` ${r}`}parseColumnFilterModel(e){return`[${this.getColumnDisplayValue(e)??``}] ${this.getOperatorDisplayValue(e)??``}${this.getOperandDisplayValue(e)}`}updateAutocompleteCache(e,t){if(t===`column`){let{key:t,displayValue:n}=e;this.columnNameToIdMap[e.displayValue.toLocaleUpperCase()]={colId:t,columnName:n}}}translate(e,t){let n=mh[e];return typeof n==`function`&&(n=n(t)),this.getLocaleTextFunc()(e,n,t)}generateAutocompleteListParams(e,t,n){return{enabled:!0,type:t,searchString:n,entries:e}}getColumnAutocompleteEntries(){if(this.columnAutocompleteEntries)return this.columnAutocompleteEntries;let e=this.colModel.getColDefCols()??[],t=[],n=this.gos.get(`includeHiddenColumnsInAdvancedFilter`);for(let r of e)r.getColDef().filter&&(n||r.isVisible()||r.isRowGroupActive())&&t.push({key:r.getColId(),displayValue:this.colNames.getDisplayNameForColumn(r,`advancedFilter`)});return t.sort((e,t)=>{let n=e.displayValue??``,r=t.displayValue??``;return n<r?-1:+(r>n)}),t}getOperatorAutocompleteEntries(e,t){let n=this.getActiveOperators(e);return this.getDataTypeExpressionOperator(t).getEntries(n)}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){return this.getDataTypeExpressionOperator(e)?.operators?.[t]}getExpressionJoinOperators(){return this.expressionJoinOperators}getColId(e){let t=e.toLocaleUpperCase(),n=this.columnNameToIdMap[t];if(n)return n;let r=this.getColumnAutocompleteEntries().find(({displayValue:e})=>e.toLocaleUpperCase()===t);if(r){let{key:e,displayValue:n}=r,i={colId:e,columnName:n};return this.columnNameToIdMap[t]=i,i}return null}getExpressionEvaluatorParams(e){let t=this.expressionEvaluatorParams[e];if(t)return t;let n=this.colModel.getColDefCol(e);if(!n)return{valueConverter:e=>e};switch(this.dataTypeSvc?.getBaseDataType(n)){case`dateTimeString`:case`dateString`:t={valueConverter:this.dataTypeSvc?.getDateParserFunction(n)??(e=>e)};break;case`object`:t=n.getColDef().filterValueGetter?{valueConverter:e=>e}:{valueConverter:(e,t)=>this.valueSvc.formatValue(n,t,e)??(typeof e.toString==`function`?e.toString():``)};break;case`text`:case void 0:t={valueConverter:e=>Al(e)};break;default:t={valueConverter:e=>e}}let{filterParams:r}=n.getColDef();return r&&[`caseSensitive`,`includeBlanksInEquals`,`includeBlanksInLessThan`,`includeBlanksInGreaterThan`].forEach(e=>{let n=r[e];n&&(t[e]=n)}),this.expressionEvaluatorParams[e]=t,t}getColumnDetails(e){let t=this.colModel.getColDefCol(e)??void 0;return{column:t,baseCellDataType:(t?this.dataTypeSvc?.getBaseDataType(t):void 0)??`text`}}generateExpressionOperators(){let translate=(e,t)=>
4this.translate(e,t),e={translate,equals:(e,t)=>e.getTime()===t.getTime()};return{text:new TextFilterExpressionOperators({translate}),boolean:new BooleanFilterExpressionOperators({translate}),object:new TextFilterExpressionOperators({translate}),number:new ScalarFilterExpressionOperators({translate,equals:(e,t)=>e===t}),date:new ScalarFilterExpressionOperators(e),dateString:new ScalarFilterExpressionOperators(e),dateTime:new ScalarFilterExpressionOperators(e),dateTimeString:new ScalarFilterExpressionOperators(e)}}getColumnValue({displayValue:e}){return`${hh}${e}${gh}`}generateExpressionJoinOperators(){return{AND:this.translate(`advancedFilterAnd`),OR:this.translate(`advancedFilterOr`)}}getActiveOperators(e){let t=e.getColDef().filterParams?.filterOptions;if(t)return t.every(e=>typeof e==`string`)?t:void 0}resetColumnCaches(){this.columnAutocompleteEntries=null,this.columnNameToIdMap={},this.expressionEvaluatorParams={}}},_h=`.ag-panel{background-color:var(--ag-panel-background-color);display:flex;flex-direction:column;overflow:hidden;position:relative}.ag-dialog{border:var(--ag-dialog-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dialog-shadow);position:absolute}.ag-panel-title-bar{align-items:center;background-color:var(--ag-panel-title-bar-background-color);border-bottom:var(--ag-panel-title-bar-border);color:var(--ag-panel-title-bar-text-color);cursor:default;display:flex;flex:none;font-weight:var(--ag-panel-title-bar-font-weight);height:var(--ag-panel-title-bar-height);padding:var(--ag-spacing) var(--ag-cell-horizontal-padding)}.ag-panel-title-bar-button{cursor:pointer;:where(.ag-icon){color:var(--ag-panel-title-bar-icon-color)}}:where(.ag-ltr) .ag-panel-title-bar-button{margin-left:calc(var(--ag-spacing)*2);margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-panel-title-bar-button{margin-left:var(--ag-spacing);margin-right:calc(var(--ag-spacing)*2)}.ag-panel-title-bar-title{flex:1 1 auto}.ag-panel-title-bar-buttons{display:flex}.ag-panel-content-wrapper{display:flex;flex:1 1 auto;overflow:hidden;position:relative}:where(.ag-dragging-fill-handle) .ag-dialog,:where(.ag-dragging-range-handle) .ag-dialog{opacity:.7;pointer-events:none}`;function getTemplate(e){let t=e.cssIdentifier||`default`;return{tag:`div`,cls:`ag-panel ag-${t}-panel`,attrs:{tabindex:`-1`},children:[{tag:`div`,ref:`eTitleBar`,cls:`ag-panel-title-bar ag-${t}-panel-title-bar ag-unselectable`,children:[{tag:`span`,ref:`eTitle`,cls:`ag-panel-title-bar-title ag-${t}-panel-title-bar-title`},{tag:`div`,ref:`eTitleBarButtons`,cls:`ag-panel-title-bar-buttons ag-${t}-panel-title-bar-buttons`}]},{tag:`div`,ref:`eContentWrapper`,cls:`ag-panel-content-wrapper ag-${t}-panel-content-wrapper`}]}}var AgPanel=class extends K{constructor(e){super(getTemplate(e)),this.config=e,this.closable=!0,this.eContentWrapper=null,this.eTitleBar=null,this.eTitleBarButtons=null,this.eTitle=null,this.registerCSS(_h)}postConstruct(){let{component:e,closable:t,hideTitleBar:n,title:r,minWidth:i=250,width:o,minHeight:s=250,height:c,centered:p,popup:m,x:h,y:g,postProcessPopupParams:_}=this.config,v=this.beans,y=this.createManagedBean(new Na(this.getGui(),{minWidth:i,width:o,minHeight:s,height:c,centered:p,x:h,y:g,popup:m,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}));this.positionableFeature=y;let b=this.getGui();if(e&&this.setBodyComponent(e),n?W(this.eTitleBar,!1):(r&&this.setTitle(r),this.setClosable(t??this.closable)),this.addManagedElementListeners(this.eTitleBar,{mousedown:e=>{if(b.contains(e.relatedTarget)||b.contains(Lo(v))||this.eTitleBarButtons.contains(e.target)){e.preventDefault();return}let t=this.eContentWrapper.querySelector(`button, [href], input, select, textarea, [tabindex]`);t&&t.focus()}}),m&&y.isPositioned())return;this.renderComponent&&this.renderComponent();let postProcessCallback;if(_){let{type:e,eventSource:t,mouseEvent:n}=_;postProcessCallback=()=>v.popupSvc?.callPostProcessPopup(_,e,b,t,n)}y.initialisePosition(postProcessCallback),this.eContentWrapper.style.height=`0`}renderComponent(){let e=this.getGui();e.focus(),this.close=()=>{e.remove(),this.destroy()}}getHeight(){return this.positionableFeature.getHeight()}setHeight(e){this.positionableFeature.setHeight(e)}getWidth(){return this.positionableFeature.getWidth()}setWidth(e){this.positionableFeature.setWidth(e)}setClosable(e){if(e!==this.closable&&(this.closable=e),e){let e=this.closeButtonComp=new K({tag:`div`,cls:`ag-button`});this.createBean(e);let t=e.getGui(),n=J(`close`,this.beans);n.classList.add(`ag-panel-title-bar-button-icon`),t.appendChild(n),this.addTitleBarButton(e),e.addManagedElementListeners(t,{click:this.onBtClose.bind(this)})}else this.closeButtonComp&&=(this.closeButtonComp.getGui().remove(),this.destroyBean(this.closeButtonComp))}setBodyComponent(e){e.setParentComponent(this),this.eContentWrapper.appendChild(e.getGui())}addTitleBarButton(e,t){let n=this.eTitleBarButtons,r=n.children,i=r.length;t??=i,t=Math.max(0,Math.min(t,i)),e.addCss(`ag-panel-title-bar-button`);let o=e.getGui();t===0?n.insertAdjacentElement(`afterbegin`,o):t===i?n.insertAdjacentElement(`beforeend`,o):r[t-1].insertAdjacentElement(`afterend`,o),e.setParentComponent(this)}getBodyHeight(){return tc(this.eContentWrapper)}getBodyWidth(){return Jc(this.eContentWrapper)}setTitle(e){this.eTitle.innerText=e}onBtClose(){this.close()}destroy(){this.closeButtonComp&&=this.destroyBean(this.closeButtonComp);let e=this.getGui();e&&El(e)&&this.close(),super.destroy()}},AgDialog=class extends AgPanel{constructor(e){super({...e,popup:!0}),this.isMaximizable=!1,this.isMaximized=!1,this.maximizeListeners=[],this.resizeListenerDestroy=null,this.lastPosition={x:0,y:0,width:0,height:0}}wireBeans(e){this.popupSvc=e.popupSvc}postConstruct(){let e=this.getGui(),{movable:t,resizable:n,maximizable:r,modal:i}=this.config;if(this.addCss(`ag-dialog`),super.postConstruct(),this.tabGuardFeature=this.createManagedBean(new $a(this)),this.tabGuardFeature.initialiseTabGuard({isFocusableContainer:!0,onFocusIn:()=>{this.popupSvc?.bringPopupToFront(e)},onTabKeyDown:t=>{if(i)return;let n=t.shiftKey,r=Qo(this.beans,e,!1,n);(!r||this.tabGuardFeature.getTabGuardCtrl().isTabGuard(r))&&Mo(this.beans,n)&&t.preventDefault()}}),t&&this.setMovable(t),r&&this.setMaximizable(r),n&&this.setResizable(n),!this.config.modal){let e=this.beans.ctrlsSvc.get(`gridCtrl`);e.addFocusableContainer(this),this.addDestroyFunc(()=>e.removeFocusableContainer(this))}}setAllowFocus(e){this.tabGuardFeature.getTabGuardCtrl().setAllowFocus(e)}renderComponent(){let e=this.getGui(),{alwaysOnTop:t,modal:n,title:r,afterGuiAttached:i}=this.config,o=this.getLocaleTextFunc(),s=this.popupSvc?.addPopup({modal:n,eChild:e,closeOnEsc:!0,closedCallback:this.onClosed.bind(this),alwaysOnTop:t,ariaLabel:r||o(`ariaLabelDialog`,`Dialog`),afterGuiAttached:i});s&&(this.close=s.hideFunc)}onClosed(e){this.destroy(),this.config.closedCallback?.(e)}setMaximized(e){this.isMaximizable&&e!==this.isMaximized&&this.toggleMaximize()}toggleMaximize(){let e=this.positionableFeature.getPosition();if(this.isMaximized){let{x:e,y:t,width:n,height:r}=this.lastPosition;this.setWidth(n),this.setHeight(r),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(){W(this.maximizeIcon,!this.isMaximized),W(this.minimizeIcon,this.isMaximized)}clearMaximizebleListeners(){if(this.maximizeListeners.length){for(let e of this.maximizeListeners)e();this.maximizeListeners.length=0}this.resizeListenerDestroy&&=(this.resizeListenerDestroy(),null)}destroy(){this.maximizeButtonComp=this.destroyBean(this.maximizeButtonComp),this.clearMaximizebleListeners(),super.destroy()}
4setResizable(e){this.positionableFeature.setResizable(e)}setMovable(e){this.positionableFeature.setMovable(e,this.eTitleBar)}setMaximizable(e){if(!e){this.clearMaximizebleListeners(),this.maximizeButtonComp&&=(this.destroyBean(this.maximizeButtonComp),this.maximizeIcon=this.minimizeIcon=void 0);return}let t=this.eTitleBar;if(!t||e===this.isMaximizable)return;this.isMaximizable=e;let n=this.buildMaximizeAndMinimizeElements();this.refreshMaximizeIcon(),n.addManagedElementListeners(n.getGui(),{click:this.toggleMaximize.bind(this)}),this.addTitleBarButton(n,0),this.maximizeListeners.push(...this.addManagedElementListeners(t,{dblclick:this.toggleMaximize.bind(this)})),[this.resizeListenerDestroy]=this.addManagedListeners(this.positionableFeature,{resize:()=>{this.isMaximized=!1,this.refreshMaximizeIcon()}})}buildMaximizeAndMinimizeElements(){let e=this.maximizeButtonComp=this.createBean(new K({tag:`div`,cls:`ag-dialog-button`})),t=e.getGui();return this.maximizeIcon=J(`maximize`,this.beans),t.appendChild(this.maximizeIcon),this.maximizeIcon.classList.add(`ag-panel-title-bar-button-icon`),this.minimizeIcon=J(`minimize`,this.beans),t.appendChild(this.minimizeIcon),this.minimizeIcon.classList.add(`ag-panel-title-bar-button-icon`),e}},vh=`.ag-autocomplete{align-items:center;display:flex;width:100%;>*{flex:1 1 auto}}.ag-autocomplete-list-popup{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-autocomplete-list{height:calc(var(--ag-row-height)*6.5);
4min-width:200px;position:relative;width:100%}.ag-autocomplete-virtual-list-item{cursor:default;display:flex;height:var(--ag-list-item-height);&:focus-visible:after{content:none}&:hover{background-color:var(--ag-row-hover-color)}}.ag-autocomplete-row{align-items:center;display:flex;flex:1 1 auto;overflow:hidden}.ag-autocomplete-row-label{margin:0 var(--ag-widget-container-horizontal-padding);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-autocomplete-row-selected{background-color:var(--ag-selected-row-background-color)}`;function getVirtualListTemplate(e){return{tag:`div`,cls:`ag-virtual-list-viewport ag-${e}-virtual-list-viewport`,role:`presentation`,children:[{tag:`div`,ref:`eContainer`,cls:`ag-virtual-list-container ag-${e}-virtual-list-container`}]}}var VirtualList=class extends gs{constructor(e){super(getVirtualListTemplate(e?.cssIdentifier||`default`)),this.renderedRows=new Map,this.rowHeight=20,this.pageSize=-1,this.isScrolling=!1,this.isHeightFromTheme=!0,this.eContainer=null,this.awaitStableCallbacks=[];let{cssIdentifier:t=`default`,ariaRole:n=`listbox`,listName:r,moveItemCallback:i}=e||{};this.cssIdentifier=t,this.ariaRole=n,this.listName=r,this.moveItemCallback=i}wireBeans(e){this.environment=e.environment}postConstruct(){this.addScrollListener(),this.rowHeight=this.getItemHeight(),this.addResizeObserver(),this.initialiseTabGuard({onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e),focusInnerElement:e=>this.focusInnerElement(e),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)}),this.refreshAriaProperties(),this.addManagedEventListeners({gridStylesChanged:this.onGridStylesChanged.bind(this)})}onGridStylesChanged(e){e.listItemHeightChanged&&(this.rowHeight=this.getItemHeight(),this.refresh())}refreshAriaProperties(){let e=this.getLocaleTextFunc()(`ariaDefaultListName`,this.listName||`List`),t=this.eContainer;cs(t,this.model?.getRowCount()>0?this.ariaRole:`presentation`),ou(t,e)}addResizeObserver(){let listener=()=>Kl(this.beans,()=>this.drawVirtualRows()),e=Zc(this.beans,this.getGui(),listener);this.addDestroyFunc(e)}focusInnerElement(e){return this.focusRow(e?this.model.getRowCount()-1:0),!0}onFocusIn(e){let t=e.target;t.classList.contains(`ag-virtual-list-item`)&&(this.lastFocusedRowIndex=Va(t)-1)}onFocusOut(e){this.getFocusableElement().contains(e.relatedTarget)||(this.lastFocusedRowIndex=null)}handleKeyDown(e){let{key:t,shiftKey:n}=e;switch(t){case G.UP:case G.DOWN:{let r=t===G.UP;e.preventDefault(),n?this.moveItem(r):this.navigate(r)}break;case G.PAGE_HOME:case G.PAGE_END:case G.PAGE_UP:case G.PAGE_DOWN:this.navigateToPage(t)!==null&&e.preventDefault()}}onTabKeyDown(e){ua(e),this.forceFocusOutOfContainer(e.shiftKey)}getNextRow(e){if(this.lastFocusedRowIndex==null)return;let t=this.lastFocusedRowIndex+(e?-1:1);if(!(t<0||t>=this.model.getRowCount()))return t}moveItem(e){if(!this.moveItemCallback)return;let t=this.getComponentAt(this.lastFocusedRowIndex);t&&this.moveItemCallback(t,e)}navigate(e){let t=this.getNextRow(e);t!==void 0&&this.focusRow(t)}navigateToPage(e,t=`focused`){let n=!1;t===`focused`&&(t=this.getLastFocusedRow(),n=!0);let r=this.model.getRowCount()-1,i=-1;return e===G.PAGE_HOME?i=0:e===G.PAGE_END?i=r:e===G.PAGE_DOWN?i=Math.min(t+this.pageSize,r):e===G.PAGE_UP&&(i=Math.max(t-this.pageSize,0)),i===-1?null:(n?this.focusRow(i):this.ensureIndexVisible(i),i)}getLastFocusedRow(){return this.lastFocusedRowIndex}focusRow(e){this.isScrolling||(this.isScrolling=!0,this.ensureIndexVisible(e),Kl(this.beans,()=>{if(this.isScrolling=!1,!this.isAlive())return;let t=this.renderedRows.get(e);t&&t.eDiv.focus()}))}getComponentAt(e){let t=this.renderedRows.get(e);return t&&t.rowComponent}forEachRenderedRow(e){this.renderedRows.forEach((t,n)=>e(t.rowComponent,n))}getItemHeight(){return this.isHeightFromTheme?this.environment.getDefaultListItemHeight():this.rowHeight}ensureIndexVisible(e,t=!0){let n=this.model.getRowCount();if(typeof e!=`number`||e<0||e>=n)return q(229,{index:e}),!1;let r=e*this.rowHeight,i=r+this.rowHeight,o=this.getGui(),s=o.scrollTop,c=o.offsetHeight,p=s+c,m=t?0:this.rowHeight,h=s>r+m,g=p<i-m;return h?(o.scrollTop=r,!0):g?(o.scrollTop=i-c,!0):!1}setComponentCreator(e){this.componentCreator=e}setComponentUpdater(e){this.componentUpdater=e}getRowHeight(){return this.rowHeight}getScrollTop(){return this.getGui().scrollTop}setRowHeight(e){this.isHeightFromTheme=!1,this.rowHeight=e,this.refresh()}refresh(e){if(this.model==null||!this.isAlive())return;let t=this.model.getRowCount();this.eContainer.style.height=`${t*this.rowHeight}px`,this.refreshAriaProperties(),this.awaitStable(()=>{this.isAlive()&&(this.canSoftRefresh(e)?this.drawVirtualRows(!0):(this.clearVirtualRows(),this.drawVirtualRows()))})}awaitStable(e){if(this.awaitStableCallbacks.push(e),this.awaitStableCallbacks.length>1)return;let t=this.model.getRowCount();al(this,()=>this.eContainer.clientHeight>=t*this.rowHeight,()=>{if(!this.isAlive())return;let e=this.awaitStableCallbacks;this.awaitStableCallbacks=[];for(let t of e)t()})}canSoftRefresh(e){return!!(e&&this.renderedRows.size&&typeof this.model.areRowsEqual==`function`&&this.componentUpdater)}clearVirtualRows(){this.renderedRows.forEach((e,t)=>this.removeRow(t))}drawVirtualRows(e){if(!this.isAlive()||!this.model)return;
4let t=this.getGui(),n=t.scrollTop,r=n+t.offsetHeight;if(n===r)this.clearVirtualRows();else{let t=Math.floor(n/this.rowHeight),i=Math.floor(r/this.rowHeight);this.pageSize=Math.floor((r-n)/this.rowHeight),this.ensureRowsRendered(t,i,e)}}ensureRowsRendered(e,t,n){this.renderedRows.forEach((n,r)=>{(r<e||r>t)&&r!==this.lastFocusedRowIndex&&this.removeRow(r)}),n&&this.refreshRows();for(let n=e;n<=t;n++)this.renderedRows.has(n)||n<this.model.getRowCount()&&this.insertRow(n)}insertRow(e){let t=this.model.getRow(e),n=this.ariaRole===`tree`?`treeitem`:`option`,r=Dl({tag:`div`,cls:`ag-virtual-list-item ag-${this.cssIdentifier}-virtual-list-item`,role:n,attrs:{tabindex:`-1`}});uo(r,this.model.getRowCount()),Xa(r,e+1),r.style.height=`${this.rowHeight}px`,r.style.top=`${this.rowHeight*e}px`;let i=this.componentCreator(t,r);i.addGuiEventListener(`focusin`,()=>this.lastFocusedRowIndex=e),r.appendChild(i.getGui()),this.renderedRows.has(e-1)?this.renderedRows.get(e-1).eDiv.insertAdjacentElement(`afterend`,r):this.renderedRows.has(e+1)?this.renderedRows.get(e+1).eDiv.insertAdjacentElement(`beforebegin`,r):this.eContainer.appendChild(r),this.renderedRows.set(e,{rowComponent:i,eDiv:r,value:t})}removeRow(e){let t=this.renderedRows.get(e);t.eDiv.remove(),this.destroyBean(t.rowComponent),this.renderedRows.delete(e)}refreshRows(){let e=this.model.getRowCount();this.renderedRows.forEach((t,n)=>{if(n>=e)this.removeRow(n);else{let e=this.model.getRow(n);this.model.areRowsEqual?.(t.value,e)?this.componentUpdater(e,t.rowComponent):this.removeRow(n)}})}addScrollListener(){this.addGuiEventListener(`scroll`,()=>this.drawVirtualRows(),{passive:!0})}setModel(e){this.model=e}getAriaElement(){return this.eContainer}destroy(){this.isAlive()&&(this.clearVirtualRows(),this.awaitStableCallbacks.length=0,super.destroy())}},yh={tag:`div`,cls:`ag-autocomplete-row`,role:`presentation`,children:[{tag:`div`,cls:`ag-autocomplete-row-label`}]},AgAutocompleteRow=class extends K{constructor(){super(yh),this.hasHighlighting=!1}setState(e,t){this.value=e,this.render(),this.updateSelected(t)}updateSelected(e){this.toggleCss(`ag-autocomplete-row-selected`,e)}setSearchString(e){let t=!1,{value:n}=this;if(n&&Xs(e)){let r=n.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(r>=0){t=!0,this.hasHighlighting=!0;let i=r+e.length,o=this.getGui().lastElementChild;Ml(o),o.append(n.slice(0,r),Dl({tag:`b`,children:n.slice(r,i)}),n.slice(i))}}!t&&this.hasHighlighting&&(this.hasHighlighting=!1,this.render())}render(){this.getGui().lastElementChild.textContent=this.value??`\xA0`}},bh={tag:`div`,cls:`ag-autocomplete-list-popup`,children:[{tag:`div`,ref:`eList`,cls:`ag-autocomplete-list`}]},AgAutocompleteList=class extends za{constructor(e){super(bh),this.params=e,this.eList=null,this.searchString=``}postConstruct(){this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList=this.createManagedBean(new VirtualList({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]});let e=this.virtualList.getGui();this.addManagedListeners(e,{click:()=>this.params.onConfirmed(),mousemove:this.onMouseMove.bind(this),mousedown:e=>e.preventDefault()}),this.setSelectedValue(0)}onNavigationKeyDown(e,t){e.preventDefault();let n=this.autocompleteEntries.indexOf(this.selectedValue),r=t===G.UP?n-1:n+1;this.checkSetSelectedValue(r)}setSearch(e){this.searchString=e,Xs(e)?this.runSearch():(this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList.refresh(),this.checkSetSelectedValue(0)),this.updateSearchInList()}runContainsSearch(e,t){let n,r=!1,i=e.toLocaleLowerCase(),o=t.filter(e=>{let t=e.toLocaleLowerCase().indexOf(i),o=t===0,s=t>=0;return s&&(!n||!r&&o||r===o&&e.length<n.length)&&(n=e,r=o),s});return!n&&o.length&&(n=o[0]),{topMatch:n,allMatches:o}}runSearch(){let{autocompleteEntries:e,useFuzzySearch:t,forceLastSelection:n}=this.params,r=e.map(e=>e.displayValue??e.key),i,o;if(t)i=ga({inputValue:this.searchString,allSuggestions:r,hideIrrelevant:!0}).values,o=i.length?i[0]:void 0;else{let e=this.runContainsSearch(this.searchString,r);i=e.allMatches,o=e.topMatch}
4let s=e.filter(({key:e,displayValue:t})=>i.includes(t??e));if(!s.length&&this.selectedValue&&n?.(this.selectedValue,this.searchString)&&(s=[this.selectedValue]),this.autocompleteEntries=s,this.virtualList.refresh(),!o)return;let c=i.indexOf(o);this.checkSetSelectedValue(c)}updateSearchInList(){this.virtualList.forEachRenderedRow(e=>e.setSearchString(this.searchString))}checkSetSelectedValue(e){e>=0&&e<this.autocompleteEntries.length&&this.setSelectedValue(e)}setSelectedValue(e){let t=this.autocompleteEntries[e];this.selectedValue!==t&&(this.selectedValue=t,this.virtualList.ensureIndexVisible(e),this.virtualList.forEachRenderedRow((t,n)=>{t.updateSelected(e===n)}))}createRowComponent(e){let t=new AgAutocompleteRow;return this.createBean(t),t.setState(e.displayValue??e.key,e===this.selectedValue),t}onMouseMove(e){let t=this.virtualList,n=t.getGui().getBoundingClientRect(),r=t.getScrollTop(),i=e.clientY-n.top+r,o=Math.floor(i/t.getRowHeight());this.checkSetSelectedValue(o)}afterGuiAttached(){this.virtualList.refresh()}getSelectedValue(){return this.autocompleteEntries.length?this.selectedValue??null:null}},xh={tag:`div`,cls:`ag-autocomplete`,role:`presentation`,children:[{tag:`ag-input-text-field`,ref:`eAutocompleteInput`}]},AgAutocomplete=class extends K{constructor(){super(xh,[To]),this.eAutocompleteInput=null,this.isListOpen=!1,this.lastPosition=0,this.valid=!0,this.registerCSS(vh)}wireBeans(e){this.popupSvc=e.popupSvc}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){let t=ic(e);this.updateValue(t),this.updateAutocompleteList(t)}updateValue(e){this.updateLastPosition(),this.dispatchLocalEvent({type:`eventValueChanged`,value:e}),this.validate(e)}updateAutocompleteList(e){let t=this.listGenerator?.(e,this.lastPosition)??{enabled:!1};(!t.type||t.type!==this.autocompleteListParams?.type)&&this.isListOpen&&this.closeList();let n=this.isListOpen;if(this.autocompleteListParams=t,t?.enabled){n||this.openList();let{searchString:e}=t;this.autocompleteList.setSearch(e??``)}else n&&this.closeList()}onKeyDown(e){let t=e.key;switch(this.updateLastPosition(),t){case G.ENTER:this.onEnterKeyDown(e);break;case G.TAB:this.onTabKeyDown(e);break;case G.DOWN:case G.UP:this.onUpDownKeyDown(e,t);break;case G.LEFT:case G.RIGHT:case G.PAGE_HOME:case G.PAGE_END:setTimeout(()=>{this.updatePositionAndList()});break;case G.ESCAPE:this.onEscapeKeyDown(e);break;case G.SPACE:e.ctrlKey&&!this.isListOpen&&(e.preventDefault(),this.forceOpenList())}}confirmSelection(){let e=this.autocompleteList?.getSelectedValue();e&&(this.closeList(),this.dispatchLocalEvent({type:`eventOptionSelected`,value:this.getValue(),position:this.lastPosition,updateEntry:e,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){e.preventDefault(),this.isListOpen?this.autocompleteList?.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(){this.updateLastPosition(),this.updateAutocompleteList(this.eAutocompleteInput.getValue()??null)}setCaret(e,t){(t||ks(this.beans))&&this.eAutocompleteInput.getFocusableElement().focus();let n=this.eAutocompleteInput.getInputElement();n.setSelectionRange(e,e),e===n.value.length&&(n.scrollLeft=n.scrollWidth)}forceOpenList(){this.onValueChanged(this.eAutocompleteInput.getValue())}updateLastPosition(){this.lastPosition=this.eAutocompleteInput.getInputElement().selectionStart??0}validate(e){if(!this.validator)return;let t=this.validationMessage=this.validator(e);this.eAutocompleteInput.getInputElement().setCustomValidity(t??``),this.valid=!t,this.dispatchLocalEvent({type:`eventValidChanged`,isValid:this.valid,val
vendor: 4,482 bytes, line 4
4idationMessage:t})}openList(){this.isListOpen=!0,this.autocompleteList=this.createBean(new AgAutocompleteList({autocompleteEntries:this.autocompleteListParams.entries,onConfirmed:()=>this.confirmSelection(),forceLastSelection:this.forceLastSelection}));let e=this.autocompleteList.getGui(),t={ePopup:e,type:`autocomplete`,eventSource:this.getGui(),position:`under`,alignSide:this.gos.get(`enableRtl`)?`right`:`left`,keepWithinBounds:!0},n=this.popupSvc.addPopup({eChild:e,anchorToElement:this.getGui(),positionCallback:()=>this.popupSvc.positionPopupByComponent(t),ariaLabel:this.listAriaLabel});this.hidePopup=n.hideFunc,this.autocompleteList.afterGuiAttached()}closeList(){this.isListOpen=!1,this.hidePopup(),this.destroyBean(this.autocompleteList),this.autocompleteList=null}onCompleted(){this.isListOpen&&this.closeList(),this.dispatchLocalEvent({type:`eventValueConfirmed`,value:this.getValue(),isValid:this.isValid()})}getValue(){return ic(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){let{value:t,position:n,silent:r,updateListOnlyIfOpen:i,restoreFocus:o}=e;this.eAutocompleteInput.setValue(t,!0),this.setCaret(n??this.lastPosition,o),r||this.updateValue(t),(!i||this.isListOpen)&&this.updateAutocompleteList(t)}setForceLastSelection(e){return this.forceLastSelection=e,this}setInputDisabled(e){return this.eAutocompleteInput.setDisabled(e),this}},Sh={selector:`AG-AUTOCOMPLETE`,component:AgAutocomplete},Ch={buttons:[`apply`],suppressBuilderButton:!1},wh={apply:`advancedFilterApply`,clear:`advancedFilterClear`,cancel:`advancedFilterCancel`,reset:`advancedFilterReset`},Th={tag:`div`,cls:`ag-advanced-filter`,role:`presentation`,attrs:{tabindex:`-1`},children:[{tag:`ag-autocomplete`,ref:`eAutocomplete`},{tag:`ag-filter-button`,ref:`eButtons`,cls:`ag-advanced-filter-buttons`},{tag:`button`,ref:`eBuilderFilterButton`,cls:`ag-button ag-advanced-filter-builder-button`,children:[{tag:`span`,ref:`eBuilderFilterButtonIcon`,attrs:{"aria-hidden":`true`}},{tag:`span`,ref:`eBuilderFilterButtonLabel`,cls:`ag-advanced-filter-builder-button-label`}]}]},AdvancedFilterComp=class extends K{constructor(){super(Th,[Sh,Ao]),this.eAutocomplete=null,this.eButtons=null,this.eBuilderFilterButton=null,this.eBuilderFilterButtonIcon=null,this.eBuilderFilterButtonLabel=null,this.expressionParser=null,this.isApplyDisabled=!0,this.builderOpen=!1}wireBeans(e){this.advFilterExpSvc=e.advFilterExpSvc,this.advancedFilter=e.advancedFilter,this.filterManager=e.filterManager,this.registry=e.registry}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean(`tooltipFeature`,!1,{getGui:()=>this.getGui(),getTooltipShowDelayOverride:()=>1e3,getLocation:()=>`advancedFilter`})),this.eAutocomplete.setListGenerator((e,t)=>this.generateAutocompleteListParams(t)).setValidator(()=>this.validateValue()).setForceLastSelection((e,t)=>this.forceLastSelection(e,t)).setInputAriaLabel(this.advFilterExpSvc.translate(`ariaAdvancedFilterInput`)).setListAriaLabel(this.advFilterExpSvc.translate(`ariaLabelAdvancedFilterAutocomplete`)),this.refresh(),this.addManagedListeners(this.eAutocomplete,{eventValueChanged:({value:e})=>this.onValueChanged(e),eventValueConfirmed:({isValid:e})=>this.onValueConfirmed(e),eventOptionSelected:({position:e,updateEntry:t,autocompleteType:n})=>this.onOptionSelected(e,t,n),eventValidChanged:({isValid:e,validationMessage:t})=>this.onValidChanged(e,t)});let{buttons:e,suppressBuilderButton:t}={...Ch,...this.gos.get(`advancedFilterParams`)};this.setupButtons(e),this.setupBuilderButton(t),this.beans.gos.addManagedPropertyListener(`advancedFilterParams`,e=>{let t={...Ch,...e.currentValue},n={...Ch,...e.previousValue};if(t.buttons!==n.buttons){let e=t.buttons.map(e=>({type:e,label:this.advFilterExpSvc.translate(wh[e])}));this.eButtons.updateButtons(e)}t.suppressBuilderButton!==n.suppressBuilderButton&&W(this.eBuilderFilterButton,!t.suppressBuilderButton)})}refresh(){let e=this.advancedFilter.getExpressionDisplayValue();this.eAutocomplete.setValue({value:e??``,position:e?.length,updateListOnlyIfOpen:!0})}setInputDisabled(e){this.eAutocomplete.setInputDisabled(e),this.eButtons.updateV
4alidity(!e&&!this.isApplyDisabled&&!this.advancedFilter.isCurrentExpressionApplied())}setupButtons(e){let t=e.map(e=>({type:e,label:this.advFilterExpSvc.translate(wh[e])})),getListener=e=>()=>{this.updateModel(e)};this.eButtons.addManagedListeners(this.eButtons,{apply:getListener(`apply`),clear:getListener(`clear`),reset:getListener(`reset`),cancel:getListener(`cancel`)}),this.eButtons.updateButtons(t)}updateModel(e){switch(e){case`apply`:this.onValueConfirmed(this.eAutocomplete.isValid());break;case`reset`:this.advancedFilter.setModel(null),this.filterManager?.onFilterChanged({source:`advancedFilter`});break;case`cancel`:this.advancedFilter.setModel(this.advancedFilter.getModel()),this.filterManager?.onFilterChanged({source:`advancedFilter`});break;case`clear`:this.eAutocomplete.setValue({value:``,restoreFocus:!0})}}setupBuilderButton(e){this.eBuilderFilterButtonIcon.appendChild(J(`advancedFilterBuilder`,this.beans)),this.eBuilderFilterButtonLabel.textContent=this.advFilterExpSvc.translate(`advancedFilterBuilder`),this.activateTabIndex([this.eBuilderFilterButton]),this.addManagedElementListeners(this.eBuilderFilterButton,{click:()=>this.openBuilder()}),this.addManagedListeners(this.advancedFilter.getCtrl(),{advancedFilterBuilderClosed:()=>this.closeBuilder()}),W(this.eBuilderFilterButton,!e)}onValueChanged(e){e=ic(e),this.advancedFilter.setExpressionDisplayValue(e),this.expressionParser=this.advancedFilter.createExpressionParser(e);let t=this.expressionParser?.parseExpression();t&&t!==e&&this.eAutocomplete.setValue({value:t,silent:!0,restoreFocus:!0})}onValueConfirmed(e){!e||this.isApplyDisabled||(this.eButtons?.updateValidity(!1),this.advancedFilter.applyExpression(),this.filterManager?.onFilterChanged({source:`advancedFilter`}))}onOptionSelected(e,t,n){let{updatedValue:r,updatedPosition:i,hideAutocomplete:o}=this.updateExpression(e,t,n);this.eAutocomplete.setValue({value:r,position:i,updateListOnlyIfOpen:o,restoreFocus:!0})}validateValue(){return this.expressionParser?.isValid()?null:this.expressionParser?.getValidationMessage()??null}onValidChanged(e,t){this.isApplyDisabled=!e||this.advancedFilter.isCurrentExpressionApplied(),this.eButtons.updateValidity(!this.isApplyDisabled),this.tooltipFeature?.setTooltipAndRefresh(t)}generateAutocompleteListParams(e){return this.expressionParser?this.expressionParser.getAutocompleteListParams(e):this.advFilterExpSvc.getDefaultAutocompleteListParams(``)}updateExpression(e,t,n){return this.advFilterExpSvc.updateAutocompleteCache(t,n),this.expressionParser?.updateExpression(e,t,n)??this.advancedFilter.getDefaultExpression(t)}forceLastSelection({key:e,displayValue:t},n){return!!n.toLocaleLowerCase().match(`^${(t??e).toLocaleLowerCase()}\\s*$`)}openBuilder(){this.builderOpen||(this.builderOpen=!0,ao(this.eBuilderFilterButton,!0),this.advancedFilter.getCtrl().toggleFilterBuilder({source:`ui`,eventSource:this.eBuilderFilterButton}))}closeBuilder(){this.builderOpen&&(this.builderOpen=!1,ao(this.eBuilderFilterButton,!1),this.eBuilderFilterButton.focus())}},Eh={tag:`div`,cls:`ag-advanced-filter-header`,role:`row`},AdvancedFilterHeaderComp=class extends K{constructor(e){super(Eh),this.enabled=e}wireBeans(e){this.colModel=e.colModel,this.focusSvc=e.focusSvc,this.ctrlsSvc=e.ctrlsSvc}postConstruct(){this.setupAdvancedFilter(this.enabled),this.addDestroyFunc(()=>this.destroyBean(this.eAdvancedFilter));let heightListener=()=>{this.enabled&&this.setEnabledHeight()};this.addManagedEventListeners({gridColumnsChanged:()=>this.onGridColumnsChanged(),columnHeaderHeightChanged:heightListener,gridStylesChanged:heightListener}),this.addManagedPropertyListener(`headerHeight`,heightListener),this.addManagedPropertyListener(`floatingFiltersHeight`,heightListener),this.addGuiEventListener(`keydown`,e=>this.onKeyDown(e)),this.addGuiEventListener(`focusout`,e=>{this.getFocusableElement().contains(e.relatedTarget)||this.focusSvc.clearAdvancedFilterColumn()})}getFocusableElement(){return this.eAdvancedFilter?.getGui()??this.getGui()}setEnabled(e){e!==this.enabled&&this.setupAdvancedFilter(e)}refresh(){this.eAdvancedFilter?.refresh()}getHeight(){return this.height}setInputDisabled(e){this.eAdvancedFilter?.setInputDisabled(e)}setupAdvancedFilter(e){let t=this.getGui();if(e){this.eAdvancedFilter=this.createBean(new AdvancedFilterComp);let e=this.eAdvancedFilter.getGui();this.eAdvancedFilter.addCss(`ag-advanced-filter-header-cell`),this.setEnabledHeight(),this.setAriaRowIndex(),cs(e,`gridcell`),ha(e,1),this.setAriaColumnCount(e),t.appendChild(e)}else Ml(t),this.destroyBean(this.eAdvancedFilter),this.height=0;W(t,e),this.enabled=e}setEnabledHeight(){let e=this.getGui();this.height=Il(this.beans);let t=`${this.height}px`;e.style.height=t,e.style.minHeight=t}setAriaColumnCount(e){Ic(e,this.colModel.getCols().length)}setAriaRowIndex(){vs(this.getGui(),this.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)}onGridColumnsChanged(){this.eAdvancedFilter&&(this.setAriaColumnCount(this.eAdvancedFilter.getGui()),this.setAriaRowIndex())}onKeyDown(e){switch(e.key){case G.ENTER:this.hasFocus()&&ja(this.getFocusableElement())&&e.preventDefault();break;case G.ESCAPE:this.hasFocus()||this.getFocusableElement().focus();break;case G.UP:this.navigateUpDown(!0,e);break;case G.DOWN:this.navigateUpDown(!1,e);break;case G.TAB:if(this.hasFocus())this.navigateLeftRight(e);else{let t=Qo(this.beans,this.getFocusableElement(),null,e.shiftKey);t?(e.preventDefault(),t.focus()):this.navigateLeftRight(e)}}}navigateUpDown(e,t){this.hasFocus()&&this.focusSvc.focusNextFromAdvancedFilter(e)&&t.preventDefault()}navigateLeftRight(e){(e.shiftKey?this.focusSvc.focusLastHeader():this.focusSvc.focusNextFromAdvancedFilter(!1,!0))&&e.preventDefault()}hasFocus(){return Lo(this.beans)===this.getFocusableElement()}},Dh=`ag-list-item-hovered`,VirtualListDragFeature=class extends U{constructor(e,t,n){super(),this.comp=e,this.virtualList=t,this.params=n,this.currentDragValue=null,this.lastHoveredListItem=null}wireBeans(e){this.dragAndDrop=e.dragAndDrop}postConstruct(){this.addManagedListeners(this.params.eventSource,{[this.params.listItemDragStartEvent]:this.listItemDragStart.bind(this),[this.params.listItemDragEndEvent]:this.listItemDragEnd.bind(this)}),this.createDropTarget(),this.createAutoScrollService()}listItemDragStart(e){this.currentDragValue=this.params.getCurrentDragValue(e),this.moveBlocked=this.params.isMoveBlocked(this.currentDragValue)}listItemDragEnd(){window.setTimeout(()=>{this.currentDragValue=null,this.moveBlocked=!1},10)}createDropTarget(){this.dragAndDrop?.addDropTarget({isInterestedIn:e=>e===this.params.dragSourceType,getIconName:()=>this.moveBlocked?`pinned`:`move`,getContainer:()=>this.comp.getGui(),onDragging:e=>this.onDragging(e),onDragStop:()=>this.onDragStop(),onDragLeave:()=>this.onDragLeave(),onDragCancel:()=>this.onDragCancel()})}createAutoScrollService(){let e=this.virtualList.getGui();
4this.autoScrollService=new ss({scrollContainer:e,scrollAxis:`y`,getVerticalPosition:()=>e.scrollTop,setVerticalPosition:t=>e.scrollTop=t})}onDragging(e){if(!this.currentDragValue||this.moveBlocked)return;let t=this.getListDragItem(e),n=this.virtualList.getComponentAt(t.rowIndex);if(!n)return;let r=n.getGui().parentElement;this.lastHoveredListItem&&this.lastHoveredListItem.rowIndex===t.rowIndex&&this.lastHoveredListItem.position===t.position||(this.autoScrollService.check(e.event),this.clearHoveredItems(),this.lastHoveredListItem=t,Rs(r,Dh),Rs(r,`ag-item-highlight-${t.position}`))}getListDragItem(e){let t=this.virtualList.getGui(),n=parseFloat(window.getComputedStyle(t).paddingTop),r=this.virtualList.getRowHeight(),i=this.virtualList.getScrollTop(),o=Math.max(0,(e.y-n+i)/r),s=this.params.getNumRows(this.comp)-1,c=Math.min(s,o)|0;return{rowIndex:c,position:Math.round(o)>o||o>s?`bottom`:`top`,component:this.virtualList.getComponentAt(c)}}onDragStop(){this.moveBlocked||(this.params.moveItem(this.currentDragValue,this.lastHoveredListItem),this.clearDragProperties())}onDragCancel(){this.clearDragProperties()}onDragLeave(){this.clearDragProperties()}clearDragProperties(){this.clearHoveredItems(),this.autoScrollService.ensureCleared()}clearHoveredItems(){let e=this.virtualList.getGui();for(let t of e.querySelectorAll(`.${Dh}`))for(let e of[Dh,`ag-item-highlight-top`,`ag-item-highlight-bottom`])t.classList.remove(e);this.lastHoveredListItem=null}},AdvancedFilterBuilderDragFeature=class extends U{constructor(e,t){super(),this.comp=e,this.virtualList=t}postConstruct(){this.createManagedBean(new VirtualListDragFeature(this.comp,this.virtualList,{dragSourceType:kl.AdvancedFilterBuilder,listItemDragStartEvent:`advancedFilterBuilderDragStarted`,listItemDragEndEvent:`advancedFilterBuilderDragEnded`,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)}},Oh={tag:`div`,cls:`ag-pill`,role:`option`,children:[{tag:`span`,ref:`eText`,cls:`ag-pill-text`},{tag:`span`,ref:`eButton`,cls:`ag-button ag-pill-button`,role:`presentation`}]},AgPill=class extends K{constructor(e){super(Oh),this.config=e,this.eText=null,this.eButton=null}postConstruct(){let{config:e,eButton:t}=this,{onKeyDown:n,onButtonClick:r}=e;this.getGui().setAttribute(`tabindex`,String(this.gos.get(`tabIndex`))),this.addGuiEventListener(`focus`,()=>{this.eButton.focus()}),n&&this.addGuiEventListener(`keydown`,n),r&&this.addManagedElementListeners(t,{click:r})}toggleCloseButtonClass(e,t){this.eButton.classList.toggle(e,t)}setText(e){this.eText.textContent=e}getText(){return this.eText.textContent}},kh={tag:`div`,cls:`ag-pill-container`},AgPillContainer=class extends K{constructor(){super(kh),this.pills=[]}init(e){this.params=e,this.refresh()}refresh(){this.clearPills();let{params:e,onPillKeyDown:t}=this,n=e.getValue();if(!Array.isArray(n)){if(n==null)return;n=[n]}let r=e.valueFormatter??(e=>String(e)),i=n.length;cs(this.getGui(),i===0?`presentation`:`listbox`);for(let o=0;o<i;o++){let s=n[o],c=this.createBean(new AgPill({onButtonClick:()=>this.onPillButtonClick(c),onKeyDown:t.bind(this)})),p=c.getGui();Xa(p,o+1),uo(p,i),e.onPillMouseDown&&c.addGuiEventListener(`mousedown`,e.onPillMouseDown),e.announceItemFocus&&c.addGuiEventListener(`focus`,e.announceItemFocus),c.setText(r(s)??``),c.toggleCloseButtonClass(`ag-icon-cancel`,!0),this.appendChild(p),this.pills.push(c)}}onNavigationKeyDown(e){let{key:t}=e;if(!this.pills.length||t!==G.LEFT&&t!==G.RIGHT)return;e.preventDefault();let{params:n,beans:r}=this,i=Lo(r),o=this.getGui();if(o.contains(i)){let e=Qo(r,o,!1,t===G.LEFT);e?e.focus():n.eWrapper&&n.eWrapper.focus()}else{let e=Zl(o);e.length>0&&e[t===G.RIGHT?0:e.length-1].focus()}}clearPills(){let e=this.getGui();e.contains(Lo(this.beans))&&this.params.eWrapper&&this.params.eWrapper.focus(),Ml(e),this.destroyBeans(this.pills),this.pills=[]}onPillButtonClick(e){this.deletePill(e)}onPillKeyDown(e){let t=e.key;if(t!==G.DELETE&&t!==G.BACKSPACE)return;e.preventDefault();let n=_l(this.beans),r=this.pills.findIndex(e=>e.getGui().contains(n.activeElement));if(r===-1)return;let i=this.pills[r];i&&this.deletePill(i,r)}deletePill(e,t){let n=e.getText(),r=(this.params.getValue()||[]).filter(e=>e!==n);if(this.params.setValue(r),!r.length&&this.params.eWrapper)this.params.eWrapper.focu
4s();else if(t!=null){let e=this.pills[Math.min(t,this.pills.length-1)];e&&e.getFocusableElement().focus()}}destroy(){this.clearPills(),super.destroy()}},Ah=`.ag-rich-select{cursor:default;height:100%}.ag-rich-select-value{align-items:center;background-color:var(--ag-picker-button-background-color);display:flex;height:100%;padding:var(--ag-spacing);:where(.ag-picker-field-display){overflow:hidden;text-overflow:ellipsis;&:where(.ag-display-as-placeholder){opacity:.5}}}.ag-rich-select-list{background-color:var(--ag-picker-list-background-color);border:var(--ag-picker-list-border);border-radius:var(--ag-input-border-radius);box-shadow:var(--ag-dropdown-shadow);height:auto;position:relative;width:100%;:where(.ag-loading-text){padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}}.ag-rich-select-row{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;padding:0 var(--ag-spacing);white-space:nowrap}.ag-rich-select-row-selected{background-color:var(--ag-selected-row-background-color)}.ag-rich-select-row-highlighted,.ag-rich-select-row:hover{background-image:linear-gradient(var(--ag-row-hover-color),var(--ag-row-hover-color))}.ag-rich-select-row-text-highlight{font-weight:700}.ag-rich-select-field-input{flex:1 1 auto;:where(.ag-input-field-input){border:none!important;box-shadow:none!important;padding:0!important;text-overflow:ellipsis;&::-moz-placeholder{opacity:.8}&::placeholder{opacity:.8}}}:where(.ag-ltr) .ag-rich-select-field-input{left:var(--ag-spacing)}:where(.ag-rtl) .ag-rich-select-field-input{right:var(--ag-spacing)}:where(.ag-popup-editor) .ag-rich-select-value{height:var(--ag-row-height);
4min-width:200px}.ag-rich-select-virtual-list-item{cursor:default;height:var(--ag-list-item-height)}.ag-pill-container{display:flex;flex-wrap:nowrap;gap:.25rem}.ag-pill{align-items:center;background:var(--ag-select-cell-background-color);border:var(--ag-select-cell-border);border-radius:var(--ag-border-radius);display:flex;padding:0 .25rem;white-space:nowrap}.ag-pill-button{border:none;padding:0;&:hover{color:var(--ag-accent-color);cursor:pointer}}:where(.ag-ltr) .ag-pill-button{margin-left:var(--ag-spacing)}:where(.ag-rtl) .ag-pill-button{margin-right:var(--ag-spacing)}`,jh={tag:`div`,cls:`ag-rich-select-row`,role:`presentation`},RichSelectRow=class extends K{constructor(e){super(jh),this.params=e}wireBeans(e){this.userCompFactory=e.userCompFactory,this.registry=e.registry}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean(`highlightTooltipFeature`,!1,{getGui:()=>this.getGui(),shouldDisplayTooltip:()=>this.shouldDisplayTooltip?.()??!0},this))}setState(e){let{params:t}=this,n=t.valueFormatter?.(e)??``;this.populateWithRenderer(e,n)||this.populateWithoutRenderer(e,n),this.value=e}highlightString(e){let{parsedValue:t,params:n}=this;if(n.cellRenderer||!Xs(t))return;let r=Xs(e);if(r){let n=t?.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(n>=0){let r=n+e.length,i=this.getGui().querySelector(`span`);i&&(Ml(i),i.append(t.slice(0,n),Dl({tag:`span`,cls:`ag-rich-select-row-text-highlight`,children:t.slice(n,r)}),t.slice(r)))}else r=!1}r||this.renderValueWithoutRenderer(t)}updateSelected(e){let t=this.getGui();Ga(t.parentElement,e),this.toggleCss(`ag-rich-select-row-selected`,e)}getValue(){return this.value}toggleHighlighted(e){this.toggleCss(`ag-rich-select-row-highlighted`,e),this.dispatchLocalEvent({type:`itemHighlighted`,highlighted:e})}populateWithoutRenderer(e,t){let n=this.getGui(),r=Dl({tag:`span`});r.style.overflow=`hidden`,r.style.textOverflow=`ellipsis`;let i=cc(Xs(t)?t:e);this.parsedValue=Xs(i)?i:null,n.appendChild(r),this.renderValueWithoutRenderer(i),this.shouldDisplayTooltip=vo(()=>r),this.tooltipFeature?.setTooltipAndRefresh(this.parsedValue)}renderValueWithoutRenderer(e){let t=this.getGui().querySelector(`span`);t&&(t.textContent=Xs(e)?e:`\xA0`)}populateWithRenderer(e,t){let n,r,{cellRenderer:i,cellRendererParams:o}=this.params;if(i){let n=this.getParentComponent()?.getParentComponent();r=oo(this.userCompFactory,this.params,co(this.gos,{value:e,valueFormatted:t,cellRendererParams:o,getValue:()=>n?.getValue(),setValue:e=>{n?.setValue(e,!0)},setTooltip:(e,t)=>{this.gos.assertModuleRegistered(`Tooltip`,3),this.shouldDisplayTooltip=t,this.tooltipFeature?.setTooltipAndRefresh(e)}}))}return r&&(n=r.newAgStackInstance()),n&&_bindCellRendererToHtmlElement(n,this.getGui()),n?(n.then(e=>{this.addDestroyFunc(()=>{this.destroyBean(e)})}),!0):!1}},Mh=`ag-rich-select-list`,Nh=`ag-rich-select-row`,AgRichSelectList=class extends VirtualList{constructor(e,t,n){super({cssIdentifier:`rich-select`}),this.params=e,this.richSelectWrapper=t,this.getSearchString=n,this.lastRowHovered=-1,this.selectedItems=new Set,this.params=e,this.setComponentCreator(this.createRowComponent.bind(this)),this.setComponentUpdater(()=>{})}postConstruct(){super.postConstruct(),this.eLoading=Dl({tag:`div`,cls:`ag-loading-text`,children:this.getLocaleTextFunc()(`loadingOoo`,`Loading...`)});let{cellRowHeight:e,pickerAriaLabelKey:t,pickerAriaLabelValue:n}=this.params;e&&this.setRowHeight(e);let r=this.getGui(),i=this.getAriaElement();this.addManagedListeners(r,{mousemove:this.onMouseMove.bind(this),mouseout:this.onMouseOut.bind(this),mousedown:this.onMouseDown.bind(this),click:this.onClick.bind(this)}),r.classList.add(Mh);let o=`${Mh}-${this.getCompId()}`;i.setAttribute(`id`,o);let s=this.getLocaleTextFunc()(t,n);ou(i,s),Eo(this.richSelectWrapper,i)}navigateToPage(e){let t=super.navigateToPage(e,this.lastRowHovered);return t!=null&&Kl(this.beans,()=>{if(!this.isAlive())return null;this.highlightIndex(t)}),t}drawVirtualRows(e){super.drawVirtualRows(e),this.refreshSelectedItems()}highlightFilterMatch(e){this.forEachRenderedRow(t=>{t.highlightString(e)})}onNavigationKeyDown(e,t){Kl(this.beans,()=>{if(!this.currentList||!this.isAlive())return;let n=this.currentList.length,r=this.lastRowHovered,i=e===G.DOWN?1:-1,o=Math.min(Math.max(r===-1?0:r+i,0),n-1);this.highlightIndex(o),t()})}selectValue(e){if(!this.currentList)return this.eLoading&&this.appendChild(this.eLoading),!1;if(this.eLoading?.offsetParent&&this.eLoading?.remove(),e==null)return!1;let t=this.getIndicesForValues(e),n=t.length>0;return n&&(this.refresh(),this.ensureIndexVisible(t[0]),this.refresh(!0)),this.selectListItems(Array.isArray(e)?e:[e]),n}selectListItems(e,t=!1){t||this.selectedItems.clear();for(let t=0;t<e.length;t++){let n=e[t];this.findItemInSelected(n)===void 0&&this.selectedItems.add(n)}this.refreshSelectedItems()}getCurrentList(){return this.currentList}setCurrentList(e){this.currentList=e,this.setModel({getRowCount:()=>e.length,getRow:t=>e[t],areRowsEqual:(e,t)=>e===t})}getSelectedItems(){return this.selectedItems}getLastItemHovered(){return this.currentList?.[this.lastRowHovered]}highlightIndex(e,t){this.currentList&&(e<0||e>=this.currentList.length?this.lastRowHovered=-1:(this.lastRowHovered=e,this.ensureIndexVisible(e,!t)&&!t&&this.refresh(!0)),this.forEachRenderedRow((t,n)=>{let r=e===n;if(t.toggleHighlighted(r),r){let e=`${Nh}-${t.getCompId()}`;jo(this.richSelectWrapper,e),this.richSelectWrapper.setAttribute(`data-active-option`,e)}}))}getIndicesForValues(e){let{currentList:t}=this;if(!t||t.length===0||e==null||(Array.isArray(e)||(e=[e]),e.length===0))return[];let{valueFormatter:n}=this.params,r=[],i=typeof e[0]==`object`,o=t.map(n);for(let s of e){let e=-1;e=i?o.indexOf(n(s)):t.indexOf(s),e>=0&&r.push(e)}return r}toggleListItemSelection(e){let t=this.findItemInSelected(e);t===void 0?this.selectedItems.add(e):this.selectedItems.delete(t),this.refreshSelectedItems(),this.dispatchValueSelected()}refreshSelectedItems(){this.forEachRenderedRow(e=>{let t=this.findItemInSelected(e.getValue())!==void 0;e.updateSelected(t)})}findItemInSelected(e){if(typeof e==`object`){let t=this.params.valueFormatter,n=t(e);for(let e of this.selectedItems)if(t(e)===n)return e}else return this.selectedItems.has(e)?e:void 0}createRowComponent(e,t){let n=new RichSelectRow(this.params);t.setAttribute(`id`,`${Nh}-${n.getCompId()}`),n.setParentComponent(this),this.createBean(n),n.setState(e);let{highlightMatch:r,searchType:i=`fuzzy`}=this.params;return r&&i!==`fuzzy`&&n.highlightString(this.getSearchString()),n}getRowForMouseEvent(e){if(!this.model)return-1;let t=this.getGui().getBoundingClientRect(),n=this.getScrollTop(),r=e.clientY-t.top+n;return Math.min(Math.floor(r/this.getRowHeight()),this.model.getRowCount()-1)}onMouseMove(e){let t=this.getRowForMouseEvent(e);t!==-1&&t!=this.lastRowHovered&&(this.lastRowHovered=t,this.highlightIndex(t,!0))}onMouseDown(e){e.preventDefault()}onMouseOut(e){this.getGui().contains(e.relatedTarget)||this.highlightIndex(-1)}onClick(e){let{multiSelect:t}=this.params;if(!this.currentList)return;let n=this.getRowForMouseEvent(e),r=this.currentList[n];t?this.toggleListItemSelection(r):(this.selectListItems([r]),this.dispatchValueSelected())}dispatchValueSelected(){this.dispatchLocalEvent({type:`richSelectListRowSelected`,fromEnterKey:!1,value:this.selectedItems})}destroy(){super.destroy(),this.eLoading=void 0}},Ph={tag:`div`,cls:`ag-picker-field`,role:`presentation`,children:[{tag:`div`,ref:`eLabel`},{tag:`div`,ref:`eWrapper`,cls:`ag-wrapper ag-picker-field-wrapper ag-rich-select-value ag-picker-collapsed`,children:[{tag:`span`,ref:`eDisplayField`,cls:`ag-picker-field-display`},{tag:`ag-input-text-field`,ref:`eInput`,cls:`ag-rich-select-field-input`},{tag:`span`,ref:`eDeselect`,cls:`ag-rich-select-deselect-button ag-picker-field-icon`,role:`presentation`},{tag:`span`,ref:`eIcon`,cls:`ag-picker-field-icon`,attrs:{"aria-hidden":`true`}}]}]},AgRichSelect=class extends Fo{constructor(e){super({pickerAriaLabelKey:`ariaLabelRichSelectField`,pickerAriaLabelValue:`Rich Select Field`,pickerType:`ag-list`,className:`ag-rich-select`,pickerIcon:`richSelectOpen`,ariaRole:`combobox`,template:e?.template??Ph,agComponents:[To],modalPicker:!1,...e,maxPickerHeight:e?.maxPickerHeight??`calc(var(--ag-row-height) * 6.5)`}),this.searchString=``,this.searchStringCreator=null,this.eInput=null,this.eDeselect=null,this.skipWrapperAnnouncement=!1;let{value:t,valueList:n,searchStringCreator:r}=e||{};t!==void 0&&(this.value=t),r&&(this.searchStringCreator=r),n!=null&&this.setValues(n),this.registerCSS(Ah)}wireBeans(e){this.userCompFactory=e.userCompFactory,this.ariaAnnounce
4=e.ariaAnnounce,this.registry=e.registry}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean(`tooltipFeature`,!1,{getGui:()=>this.getGui(),shouldDisplayTooltip:()=>this.shouldDisplayTooltip?.()??!0})),super.postConstruct(),this.createListComponent(),this.eDeselect.appendChild(J(`richSelectRemove`,this.beans));let{allowTyping:e,placeholder:t,suppressDeselectAll:n}=this.config;this.eDeselect.classList.add(`ag-hidden`),e?(this.eInput.setAutoComplete(!1).setInputPlaceholder(t),this.eDisplayField.classList.add(`ag-hidden`)):this.eInput.setDisplayed(!1),this.setupAriaProperties();let{searchDebounceDelay:r=300}=this.config;this.clearSearchString=hc(this,this.clearSearchString.bind(this),r),this.renderSelectedValue(),e&&this.eInput.onValueChange(e=>this.searchTextFromString(e)),this.addManagedElementListeners(this.eWrapper,{focus:this.onWrapperFocus.bind(this)}),this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)}),n||this.addManagedElementListeners(this.eDeselect,{mousedown:this.onDeselectAllMouseDown.bind(this),click:this.onDeselectAllClick.bind(this)})}setupAriaProperties(){let{eWrapper:e,gos:t}=this;e.tabIndex=t.get(`tabIndex`);let n=this.getLocaleTextFunc();this.ariaDeleteSelection=n(`ariaLabelRichSelectDeleteSelection`,`Press DELETE to deselect item`),this.ariaDeselectAllItems=n(`ariaLabelRichSelectDeselectAllItems`,`Press DELETE to deselect all items`),this.ariaToggleSelection=n(`ariaLabelRichSelectToggleSelection`,`Press SPACE to toggle selection`)}createListComponent(){this.listComponent=this.createBean(new AgRichSelectList(this.config,this.getFocusableElement(),()=>this.searchString)),this.listComponent.setParentComponent(this),this.addManagedListeners(this.listComponent,{richSelectListRowSelected:e=>{this.onListValueSelected(e.value,e.fromEnterKey)}})}renderSelectedValue(){let{value:e,eDisplayField:t,config:n,gos:r}=this,{allowTyping:i,cellRenderer:o,cellRendererParams:s,initialInputValue:c,multiSelect:p,suppressDeselectAll:m,suppressMultiSelectPillRenderer:h,valueFormatter:g}=n,_=formatValueFn(e,g);if(i){this.eInput.setValue(c??_);return}if(p&&!m){let t=e==null||Array.isArray(e)&&e.length===0;this.eDeselect.classList.toggle(`ag-hidden`,t)}let v;if(p&&!h){this.createOrUpdatePillContainer(t);return}o&&(v=oo(this.userCompFactory,n,co(this.gos,{value:e,valueFormatted:_,cellRendererParams:s,getValue:()=>this.getValue(),setValue:e=>{this.setValue(e,!0)},setTooltip:(e,t)=>{r.assertModuleRegistered(`Tooltip`,3),this.shouldDisplayTooltip=t,this.tooltipFeature?.setTooltipAndRefresh(e)}})));let y;if(v&&(y=v.newAgStackInstance()),y)Ml(t),_bindCellRendererToHtmlElement(y,t),y.then(e=>{this.addDestroyFunc(()=>this.destroyBean(e))});else{if(Xs(this.value))t.innerText=_,t.classList.remove(`ag-display-as-placeholder`);else{let{placeholder:e}=n;Xs(e)?(t.textContent=e,t.classList.add(`ag-display-as-placeholder`)):Ml(t)}this.shouldDisplayTooltip=vo(()=>this.eDisplayField),this.tooltipFeature?.setTooltipAndRefresh(_??null)}}createPickerComponent(){let{values:e}=this;return e&&this.setValueList({valueList:e}),this.listComponent}setSearchStringCreator(e){this.searchStringCreator=e}setValueList(e){let{valueList:t,refresh:n}=e;!this.listComponent||this.listComponent.getCurrentList()===t||(this.listComponent.setCurrentList(t),n&&(this.values?this.listComponent.refresh(!0):(this.setValues(t),this.isPickerDisplayed&&(this.listComponent.selectValue(this.value)||this.listComponent.refresh())),this.alignPickerToComponent()))}setValues(e){this.values=e,this.searchStrings=this.getSearchStringsFromValues(e)}showPicker(){super.showPicker();let{listComponent:e,value:t}=this;if(!e)return;let n=null,r=t;t===void 0&&(r=null),e.selectValue(r),n=e.getIndicesForValues(Array.isArray(r)?r:[r])[0],n==null?e.refresh():(this.tooltipFeature?.attemptToHideTooltip(),e.highlightIndex(n)),this.displayOrHidePicker()}createOrUpdatePillContainer(e){if(!this.pillContainer){let t=this.pillContainer=this.createBean(new AgPillContainer);this.addDestroyFunc(()=>{this.destroyBean(this.pillContainer),this.pillContainer=null}),Ml(e),e.appendChild(t.getGui());let{config:n,eWrapper:r,ariaDeleteSelection:i}=this,{valueFormatter:o}=n;t.init({eWrapper:r,valueFormatter:o,onPillMouseDown:e=>{e.stopImmediatePropagation()},announceItemFocus:()=>{this.announceAriaValue(i)},getValue:()=>this.getValue(),setValue:e=>this.setValue(e,!0)})}this.doWhileBlockingAnnouncement(()=>this.pillContainer?.refresh())}doWhileBlockingAnnouncement(e){this.skipWrapperAnnouncement=!0,e(),this.skipWrapperAnnouncement=!1}onWrapperFocus(){let{eInput:e,config:t}=this,{allowTyping:n,multiSelect:r,suppressDeselectAll:i}=t;if(n){let t=e.getFocusableElement();t.focus(),t.select()}else r&&!i&&!this.skipWrapperAnnouncement&&this.announceAriaValue(this.ariaDeselectAllItems)}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}onDeselectAllMouseDown(e){e.stopImmediatePropagation()}onDeselectAllClick(){this.setValue([],!0)}buildSearchStringFromKeyboardEvent(e){let{key:t}=e;if(t===G.BACKSPACE)this.searchString=this.searchString.slice(0,-1),t=``;else if(!Jo(e))return;e.preventDefault(),this.searchTextFromCharacter(t)}searchTextFromCharacter(e){this.searchString+=e,this.runSearch(),this.clearSearchString()}searchTextFromString(e){e??=``,this.searchString=e,this.runSearch()}
4getSearchStringsFromValues(e){let{config:{valueFormatter:t}}=this;return typeof e[0]==`object`&&this.searchStringCreator?this.searchStringCreator(e):e.map(e=>formatValueFn(e,t))}filterListModel(e){let{filterList:t}=this.config;t&&this.setValueList({valueList:e,refresh:!0})}runSearch(){if(!this.listComponent)return;let{values:e}=this,t=this.searchStrings;if(!t){this.listComponent.highlightIndex(-1);return}let{suggestions:n,filteredValues:r}=this.getSuggestionsAndFilteredValues(this.searchString,t),{filterList:i,highlightMatch:o,searchType:s=`fuzzy`}=this.config,c=!!(i&&this.searchString!==``);this.filterListModel(c?r:e),this.highlightEmptyValue()||this.highlightListValue(n,r,c),o&&s!==`fuzzy`&&this.listComponent?.highlightFilterMatch(this.searchString),this.displayOrHidePicker()}highlightEmptyValue(){if(this.searchString===``){let e=this.searchStrings?.indexOf(``);if(e!==void 0&&e!==-1)return this.listComponent?.highlightIndex(e),!0}return!1}highlightListValue(e,t,n){if(e.length){let t=n?0:this.searchStrings?.indexOf(e[0]);t!==void 0&&this.listComponent?.highlightIndex(t)}else if(this.listComponent?.highlightIndex(-1),!n||t.length)this.listComponent?.ensureIndexVisible(0);else if(n){this.getAriaElement().removeAttribute(`data-active-option`);let e=this.listComponent?.getAriaElement();e&&jo(e,null)}}getSuggestionsAndFilteredValues(e,t){let n=[],r=[];if(!e.length)return{suggestions:n,filteredValues:r};let{searchType:i=`fuzzy`,filterList:o}=this.config;if(i===`fuzzy`){let i=ga({inputValue:e,allSuggestions:t,hideIrrelevant:!0});n=i.values;let s=i.indices;if(o&&s.length)for(let e=0;e<s.length;e++)r.push(this.values[s[e]])}else n=t.filter((e,t)=>{let n=e.toLocaleLowerCase(),s=this.searchString.toLocaleLowerCase(),c=i===`match`?n.startsWith(s):n.includes(s);return o&&c&&r.push(this.values[t]),c});return{suggestions:n,filteredValues:r}}displayOrHidePicker(){if(!this.listComponent)return;let e=this.listComponent.getGui(),t=this.listComponent.getCurrentList(),n=t?t.length===0:!1;e.classList.toggle(`ag-hidden`,n)}clearSearchString(){this.searchString=``}setValue(e,t,n,r){if(this.value===e)return this;let i=Array.isArray(e);if(e!=null){if(!i){let t=this.listComponent?.getCurrentList();if((t?t.indexOf(e):-1)===-1)return this}n||this.listComponent?.selectValue(e)}return super.setValue(e,t),r||this.renderSelectedValue(),this}onNavigationKeyDown(e,t,n){e.preventDefault();let r=t===G.DOWN;if(!this.isPickerDisplayed&&r){this.showPicker();return}this.listComponent?.onNavigationKeyDown(t,n)}onEnterKeyDown(e){if(this.isPickerDisplayed&&(e.preventDefault(),this.listComponent?.getCurrentList())){let e=this.listComponent.getLastItemHovered();this.config.multiSelect||e===void 0?this.dispatchPickerEventAndHidePicker(this.value,!0):this.onListValueSelected(new Set([e]),!0)}}onDeleteKeyDown(e){let{eWrapper:t,beans:n}=this;Lo(n)===t&&(e.preventDefault(),this.setValue([],!0))}onTabKeyDown(){let{config:e,isPickerDisplayed:t,listComponent:n}=this,{multiSelect:r}=e;if(!(!t||!n)){if(r){let e=this.getValueFromSet(n.getSelectedItems());e&&this.setValue(e,!1,!0,!0)}else{let e=n.getLastItemHovered();e!==void 0&&this.setValue(e,!1,!0)}this.hidePicker()}}getValueFromSet(e){let{multiSelect:t}=this.config,n=null;for(let r of e){if(e.size===1&&!t){n=r;break}n||=[],n.push(r)}return Array.isArray(n)&&n.sort(),n}onListValueSelected(e,t){let n=this.getValueFromSet(e);this.setValue(n,!1,!0),this.config.multiSelect||this.dispatchPickerEventAndHidePicker(n,t)}dispatchPickerEventAndHidePicker(e,t){let n={type:`fieldPickerValueSelected`,fromEnterKey:t,value:e};this.dispatchLocalEvent(n),this.hidePicker()}getFocusableElement(){let{allowTyping:e}=this.config;return e?this.eInput.getFocusableElement():super.getFocusableElement()}onKeyDown(e){let{key:t,isComposing:n}=e,{isPickerDisplayed:r,config:{allowTyping:i,multiSelect:o,suppressDeselectAll:s},listComponent:c,pickerComponent:p}=this;switch(t){case G.LEFT:case G.RIGHT:(!i||this.pillContainer)&&(e.preventDefault(),this.pillContainer&&(this.listComponent?.highlightIndex(-1),this.pillContainer.onNavigationKeyDown(e)));break;case G.PAGE_HOME:case G.PAGE_END:if(i){e.preventDefault();let n=this.eInput.getInputElement(),r=t===G.PAGE_HOME?0:n.value.length;n.setSelectionRange(r,r);break}case G.PAGE_UP:case G.PAGE_DOWN:e.preventDefault(),p&&c?.navigateToPage(t);break;case G.DOWN:case G.UP:n||this.onNavigationKeyDown(e,t,()=>{o&&(this.doWhileBlockingAnnouncement(()=>
4this.eWrapper.focus()),this.announceAriaValue(this.ariaToggleSelection))});break;case G.ESCAPE:r&&(El(this.listComponent.getGui())&&(e.preventDefault(),ua(e)),this.hidePicker());break;case G.ENTER:n?e.preventDefault():this.onEnterKeyDown(e);break;case G.SPACE:if((!i||n)&&e.preventDefault(),!n&&r&&o&&c){let e=c.getLastItemHovered();e!==void 0&&c.toggleListItemSelection(e)}break;case G.TAB:this.onTabKeyDown();break;case G.DELETE:o&&!s&&this.onDeleteKeyDown(e);break;default:i||this.buildSearchStringFromKeyboardEvent(e)}}announceAriaValue(e){this.ariaAnnounce?.announceValue(e,`richSelect`)}destroy(){this.listComponent&&=this.destroyBean(this.listComponent),this.searchStrings=void 0,super.destroy()}},formatValueFn=(e,t)=>t?.(e)??String(e??``);function _bindCellRendererToHtmlElement(e,t){e.then(e=>{let n=e.getGui();n!=null&&t.appendChild(n)})}var Fh={tag:`div`,cls:`ag-picker-field`,role:`presentation`,children:[{tag:`div`,ref:`eLabel`},{tag:`div`,ref:`eWrapper`,cls:`ag-wrapper ag-picker-collapsed`,children:[{tag:`div`,ref:`eDisplayField`,cls:`ag-picker-field-display`},{tag:`ag-input-text-field`,ref:`eInput`,cls:`ag-rich-select-field-input`},{tag:`span`,ref:`eDeselect`,cls:`ag-rich-select-deselect-button ag-picker-field-icon`,role:`presentation`},{tag:`div`,ref:`eIcon`,cls:`ag-picker-field-icon`,attrs:{"aria-hidden":`true`}}]}]},AddDropdownComp=class extends AgRichSelect{constructor(e){super({...e,template:Fh,agComponents:[To]}),this.params=e}showPicker(){setTimeout(()=>super.showPicker())}hidePicker(){setTimeout(()=>super.hidePicker())}postConstruct(){super.postConstruct();let{wrapperClassName:e,ariaLabel:t}=this.params;W(this.eDisplayField,!1),e&&this.eWrapper.classList.add(e),ba(this.eWrapper,``),ou(this.eWrapper,t)}onEnterKeyDown(e){ua(e),this.isPickerDisplayed?super.onEnterKeyDown(e):(e.preventDefault(),this.showPicker())}},AdvancedFilterBuilderItemNavigationFeature=class extends U{constructor(e,t,n){super(),this.eGui=e,this.focusWrapper=t,this.eFocusableComp=n}postConstruct(){this.addManagedElementListeners(this.eGui,{keydown:e=>{switch(e.key){case G.TAB:e.defaultPrevented||ua(e);break;case G.UP:case G.DOWN:ua(e);break;case G.ESCAPE:if(xl(e))return;this.eGui.contains(Lo(this.beans))&&(e.preventDefault(),ua(e),this.focusWrapper.focus())}}});let e=`ag-advanced-filter-builder-virtual-list-item-highlight`;this.addManagedListeners(this.focusWrapper,{keydown:e=>{if(e.key===G.ENTER){if(xl(e))return;Lo(this.beans)===this.focusWrapper&&(e.preventDefault(),ua(e),this.eFocusableComp.getFocusableElement().focus())}},focusin:()=>{this.focusWrapper.classList.add(e)},focusout:t=>{this.focusWrapper.contains(t.relatedTarget)||this.focusWrapper.classList.remove(e)}})}};function getAdvancedFilterBuilderAddButtonParams(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=>e==null?``:e.displayValue??e.key,pickerIcon:`advancedFilterBuilderAdd`,maxPickerWidth:`${t??120}px`,wrapperClassName:`ag-advanced-filter-builder-item-button`,ariaLabel:e(`advancedFilterBuilderAddButtonTooltip`)}}var Ih={tag:`div`,cls:`ag-advanced-filter-builder-item-wrapper`,role:`presentation`,children:[{tag:`div`,ref:`eItem`,cls:`ag-advanced-filter-builder-item`,role:`presentation`,children:[{tag:`div`,cls:`ag-advanced-filter-builder-item-tree-lines`,attrs:{"aria-hidden":`true`},children:[{tag:`div`,cls:`ag-advanced-filter-builder-item-tree-line-vertical-top ag-advanced-filter-builder-item-tree-line-horizontal`}]}]}]},AdvancedFilterBuilderItemAddComp=class extends K{constructor(e,t){super(Ih),this.item=e,this.focusWrapper=t,this.eItem=null}wireBeans(e){this.advFilterExpSvc=e.advFilterExpSvc,this.registry=e.registry}postConstruct(){ps(this.focusWrapper,2);let e=getAdvancedFilterBuilderAddButtonParams(e=>this.advFilterExpSvc.translate(e),this.gos.get(`advancedFilterBuilderParams`)?.addSelectWidth),t=this.createManagedBean(new AddDropdownComp(e));this.addManagedListeners(t,{fieldPickerValueSelected:({value:e})=>{this.dispatchLocalEvent({type:`advancedFilterBuilderAdded`,item:this.item,isJoin:e.ke
4y===`join`})}}),this.eItem.appendChild(t.getGui()),this.createOptionalManagedBean(this.registry.createDynamicBean(`tooltipFeature`,!1,{getGui:()=>t.getGui(),getLocation:()=>`advancedFilter`,getTooltipValue:()=>this.advFilterExpSvc.translate(`advancedFilterBuilderAddButtonTooltip`)})),this.createManagedBean(new AdvancedFilterBuilderItemNavigationFeature(this.getGui(),this.focusWrapper,t)),ou(this.focusWrapper,this.advFilterExpSvc.translate(`ariaAdvancedFilterBuilderItem`,[this.advFilterExpSvc.translate(`advancedFilterBuilderAddButtonTooltip`),`${this.item.level+1}`]))}afterAdd(){}},ConditionPillWrapperComp=class extends K{constructor(){super({tag:`div`,cls:`ag-advanced-filter-builder-item-condition`,role:`presentation`}),this.validationMessage=null}wireBeans(e){this.advFilterExpSvc=e.advFilterExpSvc}init(e){let{item:t,createPill:n}=e;this.item=t,this.createPill=n,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.advFilterExpSvc.parseColumnFilterModel(this.filterModel):this.getDefaultColumnDisplayValue()}getAriaLabel(){return`${this.advFilterExpSvc.translate(`ariaAdvancedFilterBuilderFilterItem`)} ${this.getDragName()}`}getValidationMessage(){return this.validationMessage}getFocusableElement(){return this.eColumnPill.getFocusableElement()}setupColumnCondition(e){let t=this.advFilterExpSvc.getColumnDetails(e.colId);this.baseCellDataType=t.baseCellDataType,this.column=t.column,this.numOperands=this.getNumOperands(this.getOperatorKey()),this.eColumnPill=this.createPill({key:this.getColumnKey(),displayValue:this.getColumnDisplayValue()??this.getDefaultColumnDisplayValue(),cssClass:`ag-advanced-filter-builder-column-pill`,isSelect:!0,getEditorParams:()=>({values:this.advFilterExpSvc.getColumnAutocompleteEntries()}),update:e=>this.setColumnKey(e),pickerAriaLabelKey:`ariaLabelAdvancedFilterBuilderColumnSelectField`,pickerAriaLabelValue:`Advanced Filter Builder Column Select Field`,ariaLabel:this.advFilterExpSvc.translate(`ariaAdvancedFilterBuilderColumn`)}),this.getGui().appendChild(this.eColumnPill.getGui()),Xs(this.getColumnKey())&&(this.createOperatorPill(),this.hasOperand()&&this.createOperandPill())}createOperatorPill(){this.eOperatorPill=this.createPill({key:this.getOperatorKey(),displayValue:this.getOperatorDisplayValue()??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.advFilterExpSvc.translate(`ariaAdvancedFilterBuilderOption`)}),this.eColumnPill.getGui().insertAdjacentElement(`afterend`,this.eOperatorPill.getGui())}createOperandPill(){let{filter:e}=this.filterModel,t=(typeof e==`number`?Al(e):e)??``;this.eOperandPill=this.createPill({key:t,valueFormatter:e=>this.advFilterExpSvc.getOperandDisplayValue({...this.filterModel,filter:e},!0),baseCellDataType:this.baseCellDataType,cssClass:`ag-advanced-filter-builder-value-pill`,isSelect:!1,update:e=>this.setOperand(e),ariaLabel:this.advFilterExpSvc.translate(`ariaAdvancedFilterBuilderValue`)}),this.getGui().appendChild(this.eOperandPill.getGui())}getColumnKey(){return this.filterModel.colId}getColumnDisplayValue(){return this.advFilterExpSvc.getColumnDisplayValue(this.filterModel)}getOperatorKey(){return this.filterModel.type}getOperatorDisplayValue(){return this.advFilterExpSvc.getOperatorDisplayValue(this.filterModel)}getOperandDisplayValue(){return this.advFilterExpSvc.getOperandDisplayValue(this.filterModel,!0)}hasOperand(){return this.numOperands>0}getOperatorAutocompleteEntries(){return this.column?this.advFilterExpSvc.getOperatorAutocompleteEntries(this.column,this.baseCellDataType):[]}setColumnKey(e){this.eOperatorPill||this.createOperatorPill();let t=this.advFilterExpSvc.getColumnDetails(e);this.column=t.column;let n=t.baseCellDataType;this.baseCellDataType!==n&&(this.baseCellDataType=n,this.setOperatorKey(void 0),this.eOperatorPill&&(Ta(this.eOperatorPill.getGui()),this.destroyBean(this.eOperatorPill),this.createOperatorPill()),this.validate()),this.filterModel.colId=e,this.filterModel.filterType=this.baseCellDataType}setOperatorKey(e){let t=this.getNumOperands(e);t!==this.numOperands&&(this.numOperands=t,t===0?this.destroyOperandPill():(this.createOperandPill(),this.baseCellDataType!==`number`&&this.setOperand(``))),this.filterModel.type=e,this.validate()}setOperand(e){let t=e;this.baseCellDataType===`number`&&(t=Xs(e)?Number(e):``),this.filterModel.filter=t,this.validate()}getNumOperands(e){return this.advFilterExpSvc.getExpressionOperator(this.baseCellDataType,e)?.numOperands??0}destroyOperandPill(){delete this.filterModel.filter,this.eOperandPill?.getGui().remove(),this.destroyBean(this.eOperandPill),this.eOperandPill=void 0}validate(){let e=null;Xs(this.getColumnKey())?Xs(this.getOperatorKey())?this.numOperands>
40&&!Xs(this.getOperandDisplayValue())&&(e=this.advFilterExpSvc.translate(`advancedFilterBuilderValidationEnterValue`)):e=this.advFilterExpSvc.translate(`advancedFilterBuilderValidationSelectOption`):e=this.advFilterExpSvc.translate(`advancedFilterBuilderValidationSelectColumn`),this.item.valid=!e,e!==this.validationMessage&&(this.validationMessage=e,this.dispatchLocalEvent({type:`advancedFilterBuilderValidChanged`}))}getDefaultColumnDisplayValue(){return this.advFilterExpSvc.translate(`advancedFilterBuilderSelectColumn`)}getDefaultOptionSelectValue(){return this.advFilterExpSvc.translate(`advancedFilterBuilderSelectOption`)}},Lh={number:[ma],boolean:[bo],object:[bo],text:[bo],date:[Bc],dateString:[Bc],dateTime:[Bc,e=>e.setIncludeTime(!0)],dateTimeString:[Bc,e=>e.setIncludeTime(!0)]},Rh={tag:`div`,cls:`ag-advanced-filter-builder-pill-wrapper`,role:`presentation`,children:[{tag:`div`,ref:`ePill`,cls:`ag-advanced-filter-builder-pill`,role:`button`,children:[{tag:`span`,ref:`eLabel`,cls:`ag-advanced-filter-builder-pill-display`}]}]},InputPillComp=class extends K{constructor(e){super(Rh),this.params=e,this.ePill=null,this.eLabel=null;let{value:t,valueFormatter:n}=e;this.value=t,this.displayValue=n(t)}wireBeans(e){this.advFilterExpSvc=e.advFilterExpSvc}postConstruct(){let{cssClass:e,ariaLabel:t}=this.params;this.ePill.classList.add(e),this.activateTabIndex([this.ePill]),this.eLabel.id=`${this.getCompId()}`,Io(this.ePill,this.eLabel.id),ou(this.ePill,t),this.renderValue(),this.addManagedListeners(this.ePill,{click:e=>{e.preventDefault(),this.showEditor()},keydown:e=>{e.key===G.ENTER&&(e.preventDefault(),ua(e),this.showEditor())}}),this.addDestroyFunc(()=>this.destroyBean(this.eEditor))}getFocusableElement(){return this.ePill}showEditor(){if(this.eEditor)return;W(this.ePill,!1),this.eEditor=this.createEditorComp(this.params.type),this.eEditor.setValue(this.value);let e=this.eEditor.getGui();this.eEditor.addManagedElementListeners(e,{keydown:e=>{switch(e.key){case G.ENTER:e.preventDefault(),ua(e),this.updateValue(!0);break;case G.ESCAPE:e.preventDefault(),ua(e),this.hideEditor(!0)}},focusout:()=>this.updateValue(!1)}),this.getGui().appendChild(e),this.eEditor.getFocusableElement().focus()}createEditorComp(e){let[t,n]=Lh[e],r=this.createBean(new t);return n?.(r),r}hideEditor(e){let{eEditor:t}=this;t&&(this.eEditor=void 0,t.getGui().remove(),this.destroyBean(t),W(this.ePill,!0),e&&this.ePill.focus())}renderValue(){let e,{displayValue:t,eLabel:n}=this,{classList:r}=n;r.remove(`ag-advanced-filter-builder-value-empty`,`ag-advanced-filter-builder-value-number`,`ag-advanced-filter-builder-value-text`),Xs(t)?this.params.type===`number`?(e=t,r.add(`ag-advanced-filter-builder-value-number`)):(e=`"${t}"`,r.add(`ag-advanced-filter-builder-value-text`)):(e=this.advFilterExpSvc.translate(`advancedFilterBuilderEnterValue`),r.add(`ag-advanced-filter-builder-value-empty`)),n.textContent=e}updateValue(e){if(!this.eEditor)return;let t=this.eEditor.getValue()??``;this.dispatchLocalEvent({type:`fieldValueChanged`,value:t}),this.value=t,this.displayValue=this.params.valueFormatter(t),this.renderValue(),this.hideEditor(e)}},JoinPillWrapperComp=class extends K{wireBeans(e){this.advFilterExpSvc=e.advFilterExpSvc}constructor(){super({tag:`div`,cls:`ag-advanced-filter-builder-item-condition`,role:`presentation`})}init(e){let{item:t,createPill:n}=e,r=t.filterModel;this.filterModel=r,this.ePill=n({key:r.type,displayValue:this.advFilterExpSvc.parseJoinOperator(r),cssClass:`ag-advanced-filter-builder-join-pill`,isSelect:!0,getEditorParams:()=>({values:this.advFilterExpSvc.getJoinOperatorAutocompleteEntries()}),update:e=>r.type=e,pickerAriaLabelKey:`ariaLabelAdvancedFilterBuilderJoinSelectField`,pickerAriaLabelValue:`Advanced Filter Builder Join Operator Select Field`,ariaLabel:this.advFilterExpSvc.translate(`ariaAdvancedFilterBuilderJoinOperator`)}),this.getGui().appendChild(this.ePill.getGui()),this.addDestroyFunc(()=>this.destroyBean(this.ePill))}getDragName(){return this.advFilterExpSvc.parseJoinOperator(this.filterModel)}getAriaLabel(){return`${this.advFilterExpSvc.translate(`ariaAdvancedFilterBuilderGroupItem`)} ${this.getDragName()}`}getValidationMessage(){return null}getFocusableElement(){return this.ePill.getFocusableElement()}}
4,zh={tag:`div`,cls:`ag-picker-field ag-advanced-filter-builder-pill-wrapper`,role:`presentation`,children:[{tag:`div`,ref:`eLabel`},{tag:`div`,ref:`eWrapper`,cls:`ag-wrapper ag-advanced-filter-builder-pill ag-picker-collapsed`,children:[{tag:`div`,ref:`eDisplayField`,cls:`ag-picker-field-display ag-advanced-filter-builder-pill-display`},{tag:`ag-input-text-field`,ref:`eInput`,cls:`ag-rich-select-field-input`},{tag:`span`,ref:`eDeselect`,cls:`ag-rich-select-deselect-button ag-picker-field-icon`,role:`presentation`},{tag:`div`,ref:`eIcon`,cls:`ag-picker-field-icon`,attrs:{"aria-hidden":`true`}}]}]},SelectPillComp=class extends AgRichSelect{constructor(e){super({...e,template:zh,agComponents:[To]}),this.params=e}getFocusableElement(){return this.eWrapper}showPicker(){setTimeout(()=>super.showPicker())}hidePicker(){setTimeout(()=>super.hidePicker())}postConstruct(){super.postConstruct();let{wrapperClassName:e,ariaLabel:t}=this.params;this.eWrapper.classList.add(e),ba(this.eWrapper,``),ou(this.eWrapper,t)}createPickerComponent(){if(!this.values){let{values:e}=this.params.getEditorParams();this.values=e;let t=this.value.key,n=e.find(e=>e.key===t)??{key:t,displayValue:this.value.displayValue};this.value=n}return super.createPickerComponent()}onEnterKeyDown(e){ua(e),this.isPickerDisplayed?super.onEnterKeyDown(e):(e.preventDefault(),this.showPicker())}},Bh={tag:`div`,cls:`ag-advanced-filter-builder-item-wrapper`,role:`presentation`,children:[{tag:`div`,cls:`ag-advanced-filter-builder-item`,role:`presentation`,children:[{tag:`div`,ref:`eTreeLines`,cls:`ag-advanced-filter-builder-item-tree-lines`,attrs:{"aria-hidden":`true`}},{tag:`span`,ref:`eDragHandle`,cls:`ag-drag-handle`,attrs:{"aria-hidden":`true`}},{tag:`span`,ref:`eValidation`,cls:`ag-advanced-filter-builder-item-button ag-advanced-filter-builder-invalid`,attrs:{"aria-hidden":`true`}}]},{tag:`div`,ref:`eButtons`,cls:`ag-advanced-filter-builder-item-buttons`,children:[{tag:`span`,ref:`eMoveUpButton`,cls:`ag-advanced-filter-builder-item-button`,role:`button`},{tag:`span`,ref:`eMoveDownButton`,cls:`ag-advanced-filter-builder-item-button`,role:`button`},{tag:`div`,ref:`eAddButton`,role:`presentation`},{tag:`span`,ref:`eRemoveButton`,cls:`ag-advanced-filter-builder-item-button`,role:`button`}]}]},AdvancedFilterBuilderItemComp=class extends gs{constructor(e,t,n){super(Bh),this.item=e,this.dragFeature=t,this.focusWrapper=n,this.eTreeLines=null,this.eDragHandle=null,this.eButtons=null,this.eValidation=null,this.eMoveUpButton=null,this.eMoveDownButton=null,this.eAddButton=null,this.eRemoveButton=null,this.moveUpDisabled=!1,this.moveDownDisabled=!1}wireBeans(e){this.dragAndDrop=e.dragAndDrop,this.advFilterExpSvc=e.advFilterExpSvc,this.registry=e.registry}postConstruct(){let{filterModel:e,level:t,showMove:n}=this.item,r=e.filterType===`join`;if(this.ePillWrapper=this.createManagedBean(r?new JoinPillWrapperComp:new ConditionPillWrapperComp),this.ePillWrapper.init({item:this.item,createPill:e=>this.createPill(e)}),this.eDragHandle.insertAdjacentElement(`afterend`,this.ePillWrapper.getGui()),t===0){let e=Dl({tag:`div`,cls:`ag-advanced-filter-builder-item-tree-line-vertical-bottom ag-advanced-filter-builder-item-tree-line-root`});this.eTreeLines.appendChild(e),W(this.eDragHandle,!1),W(this.eButtons,!1),to(this.focusWrapper,!0)}else this.setupTreeLines(t),this.eDragHandle.appendChild(J(`advancedFilterBuilderDrag`,this.beans)),this.setupValidation(),this.setupMoveButtons(n),this.setupAddButton(),this.setupRemoveButton(),this.setupDragging(),this.updateAriaExpanded();ps(this.focusWrapper,t+1),this.initialiseTabGuard({}),this.createManagedBean(new AdvancedFilterBuilderItemNavigationFeature(this.getGui(),this.focusWrapper,this.ePillWrapper)),this.updateAriaLabel(),this.addManagedListeners(this.ePillWrapper,{advancedFilterBuilderValueChanged:()=>this.dispatchLocalEvent({type:`advancedFilterBuilderValueChanged`}),advancedFilterBuilderValidChanged:()=>this.updateValidity()})}setState(e){let{level:t}=this.item;if(t===0)return;let{showMove:n}=this.item,{disableMoveUp:r,disableMoveDown:i,treeLines:o,showStartTreeLine:s}=e;this.updateTreeLines(o,s),this.updateAriaExpanded(),n&&(this.moveUpDisabled=!!r,this.moveDownDisabled=!!i,this.eMoveUpButton.classList.toggle(`ag-advanced-filter-builder
4-item-button-disabled`,r),this.eMoveDownButton.classList.toggle(`ag-advanced-filter-builder-item-button-disabled`,i),Ba(this.eMoveUpButton,!!r),Ba(this.eMoveDownButton,!!i),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++)this.eTreeLines.appendChild(Dl({tag:`div`}))}updateTreeLines(e,t){let n=e.length-1,{children:r}=this.eTreeLines;for(let t=0;t<n;t++){let n=r.item(t);n&&n.classList.toggle(`ag-advanced-filter-builder-item-tree-line-vertical`,!e[t])}let i=r.item(n);if(i){i.classList.add(`ag-advanced-filter-builder-item-tree-line-horizontal`);let t=e[n];i.classList.toggle(`ag-advanced-filter-builder-item-tree-line-vertical-top`,t),i.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(J(`advancedFilterBuilderInvalid`,this.beans)),this.validationTooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean(`tooltipFeature`,!1,{getGui:()=>this.eValidation,getLocation:()=>`advancedFilter`,getTooltipValue:()=>this.ePillWrapper.getValidationMessage(),getTooltipShowDelayOverride:()=>1e3})),this.updateValidity()}setupAddButton(){let e=getAdvancedFilterBuilderAddButtonParams(e=>this.advFilterExpSvc.translate(e),this.gos.get(`advancedFilterBuilderParams`)?.addSelectWidth),t=this.createManagedBean(new AddDropdownComp(e));this.addManagedListeners(t,{fieldPickerValueSelected:({value:e})=>this.dispatchLocalEvent({type:`advancedFilterBuilderAdded`,item:this.item,isJoin:e.key===`join`})}),this.eAddButton.appendChild(t.getGui()),this.createOptionalManagedBean(this.registry.createDynamicBean(`tooltipFeature`,!1,{getGui:()=>this.eAddButton,getLocation:()=>`advancedFilter`,getTooltipValue:()=>this.advFilterExpSvc.translate(`advancedFilterBuilderAddButtonTooltip`)}))}setupRemoveButton(){this.eRemoveButton.appendChild(J(`advancedFilterBuilderRemove`,this.beans)),this.addManagedListeners(this.eRemoveButton,{click:()=>this.removeItem(),keydown:e=>{e.key===G.ENTER&&(e.preventDefault(),ua(e),this.removeItem())}}),this.createOptionalManagedBean(this.registry.createDynamicBean(`tooltipFeature`,!1,{getGui:()=>this.eRemoveButton,getLocation:()=>`advancedFilter`,getTooltipValue:()=>this.advFilterExpSvc.translate(`advancedFilterBuilderRemoveButtonTooltip`)})),ou(this.eRemoveButton,this.advFilterExpSvc.translate(`advancedFilterBuilderRemoveButtonTooltip`)),this.activateTabIndex([this.eRemoveButton])}setupMoveButtons(e){e?(this.eMoveUpButton.appendChild(J(`advancedFilterBuilderMoveUp`,this.beans)),this.addManagedListeners(this.eMoveUpButton,{click:()=>this.moveItem(!0),keydown:e=>{e.key===G.ENTER&&(e.preventDefault(),ua(e),this.moveItem(!0))}}),this.moveUpTooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean(`tooltipFeature`,!1,{getGui:()=>this.eMoveUpButton,getLocation:()=>`advancedFilter`,getTooltipValue:()=>this.moveUpDisabled?null:this.advFilterExpSvc.translate(`advancedFilterBuilderMoveUpButtonTooltip`)})),ou(this.eMoveUpButton,this.advFilterExpSvc.translate(`advancedFilterBuilderMoveUpButtonTooltip`)),this.eMoveDownButton.appendChild(J(`advancedFilterBuilderMoveDown`,this.beans)),this.addManagedListeners(this.eMoveDownButton,{click:()=>this.moveItem(!1),keydown:e=>{e.key===G.ENTER&&(e.preventDefault(),ua(e),this.moveItem(!1))}}),this.moveDownTooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean(`tooltipFeature`,!1,{getGui:()=>this.eMoveDownButton,getLocation:()=>`advancedFilter`,getTooltipValue:()=>this.moveDownDisabled?null:this.advFilterExpSvc.translate(`advancedFilterBuilderMoveDownButtonTooltip`)})),ou(this.eMoveDownButton,this.advFilterExpSvc.translate(`advancedFilterBuilderMoveDownButtonTooltip`)),this.activateTabIndex([this.eMoveUpButton,this.eMoveDownButton])):(W(this.eMoveUpButton,!1),W(this.eMoveDownButton,!1))}
4updateValidity(){Ms(this.eValidation,!this.item.valid),this.validationTooltipFeature?.refreshTooltip(),this.updateAriaLabel()}createPill(e){let{key:t,cssClass:n,update:r,ariaLabel:i}=e,onUpdated=e=>{e!=null&&(r(e),this.dispatchLocalEvent({type:`advancedFilterBuilderValueChanged`}))};if(e.isSelect){let{getEditorParams:r,pickerAriaLabelKey:o,pickerAriaLabelValue:s,displayValue:c}=e,p=this.gos.get(`advancedFilterBuilderParams`),m=`${p?.pillSelectMinWidth??140}px`,h=`${p?.pillSelectMaxWidth??200}px`,g=this.createBean(new SelectPillComp({pickerAriaLabelKey:o,pickerAriaLabelValue:s,pickerType:`ag-list`,value:{key:t,displayValue:c},valueFormatter:e=>e==null?``:e.displayValue??e.key,variableWidth:!0,minPickerWidth:m,maxPickerWidth:h,getEditorParams:r,wrapperClassName:n,ariaLabel:i,pickerIcon:`advancedFilterBuilderSelectOpen`}));return this.addManagedListeners(g,{fieldPickerValueSelected:({value:e})=>onUpdated(e?.key)}),g}{let{baseCellDataType:r,valueFormatter:o}=e,s=this.createBean(new InputPillComp({value:t,valueFormatter:o,cssClass:n,type:r,ariaLabel:i}));return this.addManagedListeners(s,{fieldValueChanged:({value:e})=>onUpdated(e)}),s}}setupDragging(){let e={type:kl.AdvancedFilterBuilder,eElement:this.eDragHandle,dragItemName:()=>this.ePillWrapper.getDragName(),getDefaultIconName:()=>`notAllowed`,getDragItem:()=>({}),onDragStarted:()=>this.dragFeature.dispatchLocalEvent({type:`advancedFilterBuilderDragStarted`,item:this.item}),onDragStopped:()=>this.dragFeature.dispatchLocalEvent({type:`advancedFilterBuilderDragEnded`})};this.dragAndDrop.addDragSource(e,!0),this.addDestroyFunc(()=>this.dragAndDrop.removeDragSource(e))}updateAriaLabel(){let e=this.ePillWrapper.getAriaLabel(),t=`${this.item.level+1}`,n=this.ePillWrapper.getValidationMessage(),r;r=n?this.advFilterExpSvc.translate(`ariaAdvancedFilterBuilderItemValidation`,[e,t,n]):this.advFilterExpSvc.translate(`ariaAdvancedFilterBuilderItem`,[e,t]),ou(this.focusWrapper,r)}updateAriaExpanded(){Xl(this.focusWrapper);let{filterModel:e}=this.item;e?.filterType===`join`&&e.conditions.length&&to(this.focusWrapper,!0)}removeItem(){this.dispatchLocalEvent({type:`advancedFilterBuilderRemoved`,item:this.item})}moveItem(e){this.dispatchLocalEvent({type:`advancedFilterBuilderMoved`,item:this.item,backwards:e})}},Vh={apply:`advancedFilterBuilderApply`,clear:`advancedFilterBuilderClear`,cancel:`advancedFilterBuilderCancel`,reset:`advancedFilterBuilderReset`},Hh={tag:`div`,cls:`ag-advanced-filter-builder`,role:`presentation`,attrs:{tabindex:`-1`},children:[{tag:`div`,ref:`eList`,cls:`ag-advanced-filter-builder-list`,role:`presentation`}]},AdvancedFilterBuilderComp=class extends K{constructor(){super(Hh),this.eList=null}wireBeans(e){this.filterManager=e.filterManager,this.advancedFilter=e.advancedFilter,this.advFilterExpSvc=e.advFilterExpSvc}postConstruct(){let e=this.gos.get(`advancedFilterBuilderParams`);this.params={buttons:[`apply`,`cancel`],...e},this.addManagedPropertyListener(`advancedFilterBuilderParams`,({currentValue:e})=>{this.params.showMoveButtons=!!e?.showMoveButtons,this.params.buttons=e?.buttons??[`apply`,`cancel`],this.refreshList(!1)}),this.filterModel=this.setupFilterModel(),this.setupVirtualList(),this.dragFeature=this.createManagedBean(new AdvancedFilterBuilderDragFeature(this,this.virtualList)),this.resetButtonsPanel(this.params.buttons)}refresh(){let e=this.virtualList,t=e.getLastFocusedRow();this.setupFilterModel(),this.validateItems(),this.refreshList(!1),t!=null&&(e.getComponentAt(t)||(t=0),e.focusRow(t))}getNumItems(){return this.items.length}moveItem(e,t){!t||!e||this.moveItemToIndex(e,t.rowIndex,t.position)}afterGuiAttached(){this.virtualList.awaitStable(()=>this.virtualList.focusRow(0))}setupVirtualList(){let e=this.virtualList=this.createManagedBean(new VirtualList({cssIdentifier:`advanced-filter-builder`,ariaRole:`tree`,listName:this.advFilterExpSvc.translate(`ariaAdvancedFilterBuilderList`),moveItemCallback:this.virtualListMoveItemCallback.bind(this)}));e.setComponentCreator(this.createItemComponent.bind(this)),e.setComponentUpdater(this.updateItemComponent.bind(this)),e.setRowHeight(40),this.eList.appendChild(e.getGui()),e.setModel({getRowCount:()=>this.items?.length||0,getRow:e=>this.items[e],areRowsEqual:(e,t)=>e===t}),this.buildList(),e.refresh()}resetButtonsPanel(e){let t=e&&e.length>0,n=this.eButtons;if(t){let t=e.map(e=>({type:e,label:this.advFilterExpSvc.translate(Vh[e])}));if(!n){n=this.createBean(new sc),this.appendChild(n.getGui());let getListener=e=>({event:t})=>{this.updateModel(e),this.afterAction(e,t)};n.addManagedListeners(n,{apply:getListener(`apply`),clear:getListener(`clear`),reset:getListener(`reset`),cancel:getListener(`cancel`)}),this.eButtons=n}n.updateButtons(t);let r=n.getApplyButton();
4if(r){let mouseListener=e=>this.toggleCss(`ag-advanced-filter-builder-validation`,e);this.addManagedElementListeners(r,{mouseenter:()=>mouseListener(!0),mouseleave:()=>mouseListener(!1)})}}else n&&(Ta(n.getGui()),this.eButtons=this.destroyBean(n))}updateModel(e){switch(e){case`apply`:this.advancedFilter.setModel(this.filterModel),this.filterManager?.onFilterChanged({source:`advancedFilter`});break;case`reset`:this.advancedFilter.setModel(null),this.filterManager?.onFilterChanged({source:`advancedFilter`});break;case`cancel`:break;case`clear`:this.filterModel=this.formatFilterModel(null),this.refreshList(!1)}}afterAction(e,t){switch(e){case`apply`:t?.preventDefault(),this.close();break;case`reset`:this.close();break;case`cancel`:this.close()}}removeItemFromParent(e){let t=e.parent.conditions.indexOf(e.filterModel);return e.parent.conditions.splice(t,1),t}moveItemToIndex(e,t,n){let r=this.items[t],i=r.filterModel?.filterType===`join`&&n===`bottom`,o=i?r.filterModel:r.parent;if(!o||this.isChildOrSelf(o,e.filterModel)||r===e)return;this.removeItemFromParent(e);let s;i?s=0:(s=o.conditions.indexOf(r.filterModel),s===-1?s=o.conditions.length:n===`bottom`&&(s+=1)),o.conditions.splice(s,0,e.filterModel),this.refreshList(!1)}isChildOrSelf(e,t){return e===t||t.filterType===`join`&&t.conditions.some(t=>this.isChildOrSelf(e,t))}setupFilterModel(){let e=this.formatFilterModel(this.advancedFilter.getModel());return this.stringifiedModel=JSON.stringify(e),e}formatFilterModel(e){return e??={filterType:`join`,type:`AND`,conditions:[]},e.filterType!==`join`&&(e={filterType:`join`,type:`AND`,conditions:[e]}),e}buildList(){let parseFilterModel=(e,t,n,r)=>{if(t.push({filterModel:e,level:n,parent:r,valid:!0,showMove:this.params.showMoveButtons}),e.filterType===`join`){for(let r of e.conditions)parseFilterModel(r,t,n+1,e);n===0&&t.push({filterModel:null,level:n+1,parent:e,valid:!0})}};this.items=[],parseFilterModel(this.filterModel,this.items,0)}refreshList(e){if(!e){let e=[];for(let t of this.items)t.valid||e.push(t.filterModel);if(this.buildList(),e.length)for(let t of this.items)t.filterModel&&e.includes(t.filterModel)&&(t.valid=!1)}this.virtualList.refresh(e),this.validate()}updateItemComponent(e,t){let n=this.items.indexOf(e),populateTreeLines=(e,t)=>{let n=this.items.find(t=>t.filterModel===e)?.parent;if(n){let{conditions:r}=n;populateTreeLines(n,t),t.push(r[r.length-1]===e)}},r=[],{filterModel:i}=e;i&&(populateTreeLines(i,r),r[0]=!1);let o=i?.filterType===`join`&&!!i.conditions.length;t.setState({disableMoveUp:n===1,disableMoveDown:!this.canMoveDown(e,n),treeLines:r,showStartTreeLine:o})}createItemComponent(e,t){let n=this.createBean(e.filterModel?new AdvancedFilterBuilderItemComp(e,this.dragFeature,t):new AdvancedFilterBuilderItemAddComp(e,t));return n.addManagedListeners(n,{advancedFilterBuilderRemoved:({item:e})=>this.removeItem(e),advancedFilterBuilderValueChanged:()=>this.validate(),advancedFilterBuilderAdded:({item:e,isJoin:t})=>this.addItem(e,t),advancedFilterBuilderMoved:({item:e,backwards:t})=>this.moveItemUpDown(e,t)}),n instanceof AdvancedFilterBuilderItemComp&&this.updateItemComponent(e,n),n}addItem(e,t){let{parent:n,level:r,filterModel:i}=e,o=i?.filterType===`join`,s=t?{filterType:`join`,type:`AND`,conditions:[]}:{},c=o?i:n,p=o?0:c.conditions.indexOf(i);p>=0?(o||(p+=1),c.conditions.splice(p,0,s)):c.conditions.push(s);let m=this.items.indexOf(e),h=m>=0;if(h){e.filterModel&&m++;let n=[{filterModel:s,level:o?r+1:r,parent:c,valid:t,showMove:this.params.showMoveButtons}];this.items.splice(m,0,...n)}this.refreshList(h),h&&this.virtualList.getComponentAt(m)?.afterAdd()}removeItem(e){let t=e.parent,{filterModel:n}=e,r=t.conditions.indexOf(n);t.conditions.splice(r,1);let i=e.filterModel?.filterType===`join`,o=this.items.indexOf(e),s=!i&&o>=0;s&&this.items.splice(o,1),this.refreshList(s),o>=0&&this.virtualList.focusRow(o)}moveItemUpDown(e,t,n){let r=this.items.indexOf(e),i=t?r-1:r+1;if(i===0||!t&&!this.canMoveDown(e,r))return;let o=this.items[i],s=this.removeItemFromParent(e),{level:c,filterModel:p,parent:m}=e,{level:h,filterModel:g,parent:_}=o;if(t){if(h===c&&g.filterType===`join`)g.conditions.push(p);else if(h<=c){let e=_.conditions.indexOf(g);_.conditions.splice(e,0,p)}else m.conditions[s-1].conditions.push(p)}else if(h===c){if(g.filterType===`join`)g.conditions.splice(0,0,p);else{let e=_.conditions.indexOf(g);_.conditions.splice(e+1,0,p)}}else if(s<m.conditions.length)m.conditions.splice(s+1,0,p);else{let e=this.items.find(e=>e.filterModel===m),t=e.parent.conditions.indexOf(e.filterModel)+1;e.parent.conditions.splice(t,0,p)}this.refreshList(!1);let v=this.items.findIndex(({filterModel:e})=>e===p);if(v<0)return;let y=this.virtualList.getComponentAt(v);y instanceof AdvancedFilterBuilderItemComp&&(n||y.focusMoveButton(t))}
4virtualListMoveItemCallback(e,t){let n=e.item,r=this.items.indexOf(n);r<=0||r===this.items.length-1||t&&r===1||!t&&!this.canMoveDown(n,r)||(this.moveItemUpDown(n,t,!0),this.virtualList.focusRow(r+(t?-1:1)))}canMoveDown(e,t){return!(e.level===1&&t===this.items.length-2||e.level===1&&e.parent.conditions[e.parent.conditions.length-1]===e.filterModel)}close(){this.advancedFilter.getCtrl().toggleFilterBuilder({source:`ui`})}validate(){let e=this.items.every(({valid:e})=>e),t=null;e?(e=JSON.stringify(this.filterModel)!==this.stringifiedModel,e||(t=this.advFilterExpSvc.translate(`advancedFilterBuilderValidationAlreadyApplied`))):t=this.advFilterExpSvc.translate(`advancedFilterBuilderValidationIncomplete`),this.eButtons?.updateValidity(e,t)}validateItems(){let clearOperator=e=>{e.type=void 0},clearOperand=e=>{delete e.filter};for(let e of this.items){if(!e.valid||!e.filterModel||e.filterModel.filterType===`join`)continue;let{filterModel:t}=e,{colId:n}=t,r=this.advFilterExpSvc.getColumnAutocompleteEntries().find(({key:e})=>e===n),i=this.advFilterExpSvc.getColumnDetails(t.colId);if(!r||!i.column){e.valid=!1,t.colId=void 0,clearOperator(t),clearOperand(t);continue}let o=this.advFilterExpSvc.getDataTypeExpressionOperator(i.baseCellDataType).operators[t.type];if(!o){e.valid=!1,clearOperator(t),clearOperand(t);continue}o.numOperands>0&&!Xs(t.filter)&&(e.valid=!1)}}},AdvancedFilterCtrl=class extends U{constructor(e){super(),this.enabled=e}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.popupSvc=e.popupSvc,this.advFilterExpSvc=e.advFilterExpSvc,this.environment=e.environment}postConstruct(){this.hasAdvancedFilterParent=!!this.gos.get(`advancedFilterParent`),this.ctrlsSvc.whenReady(this,()=>this.setAdvancedFilterComp()),this.addManagedEventListeners({advancedFilterEnabledChanged:({enabled:e})=>this.onEnabledChanged(e)}),this.addManagedPropertyListener(`advancedFilterParent`,()=>this.updateComps()),this.addManagedPropertyListener(`advancedFilterBuilderParams`,e=>{e.currentValue?.suppressFullScreenButton!==e.previousValue?.suppressFullScreenButton&&this.eBuilderDialog?.setMaximizable(e.currentValue?.suppressFullScreenButton??!0)}),this.addDestroyFunc(()=>{this.destroyAdvancedFilterComp(),this.destroyBean(this.eBuilderComp),this.eBuilderDialog?.isAlive()&&this.destroyBean(this.eBuilderDialog)})}setupHeaderComp(e){this.eHeaderComp&&(this.eHeaderComp?.getGui().remove(),this.destroyBean(this.eHeaderComp)),this.eHeaderComp=this.createManagedBean(new AdvancedFilterHeaderComp(this.enabled&&!this.hasAdvancedFilterParent)),e.insertAdjacentElement(`beforebegin`,this.eHeaderComp.getGui())}focusHeaderComp(){return this.eHeaderComp?(this.eHeaderComp.getFocusableElement().focus(),!0):!1}refreshComp(){this.eFilterComp?.refresh(),this.eHeaderComp?.refresh()}refreshBuilderComp(){this.eBuilderComp?.refresh()}getHeaderHeight(){return this.eHeaderComp?.getHeight()??0}setInputDisabled(e){this.eFilterComp?.setInputDisabled(e),this.eHeaderComp?.setInputDisabled(e)}toggleFilterBuilder(e){let{source:t,force:n,eventSource:r}=e;if(n&&this.eBuilderDialog||n===!1&&!this.eBuilderDialog)return;if(this.eBuilderDialog){this.builderDestroySource=t,this.destroyBean(this.eBuilderDialog);return}this.setInputDisabled(!0);let{width:i,height:o,minWidth:s}=this.getBuilderDialogSize(),{suppressFullScreenButton:c}={suppressFullScreenButton:!1,...this.gos.get(`advancedFilterBuilderParams`)};this.eBuilderComp=this.createBean(new AdvancedFilterBuilderComp),this.eBuilderDialog=this.createBean(new AgDialog({title:this.advFilterExpSvc.translate(`advancedFilterBuilderTitle`),component:this.eBuilderComp,width:i,height:o,resizable:!0,movable:!0,maximizable:!c,centered:!0,closable:!0,minWidth:s,afterGuiAttached:()=>this.eBuilderComp?.afterGuiAttached(),postProcessPopupParams:{type:`advancedFilterBuilder`,eventSource:r}})),this.dispatchFilterBuilderVisibleChangedEvent(t,!0),this.eBuilderDialog.addEventListener(`destroyed`,()=>{this.destroyBean(this.eBuilderComp),this.eBuilderComp=void 0,this.eBuilderDialog=void 0,this.setInputDisabled(!1),this.dispatchLocalEvent({type:`advancedFilterBuilderClosed`}),this.dispatchFilterBuilderVisibleChangedEvent(this.builderDestroySource??`ui`,!1),this.builderDestroySource=void 0})}dispatchFilterBuilderVisibleChangedEvent(e,t){this.eventSvc.dispatchEvent({type:`advancedFilterBuilderVisibleChanged`,source:e,visible:t})}getBuilderDialogSize(){let e=this.gos.get(`advancedFilterBuilderParams`)?.minWidth??500,t=this.popupSvc.getPopupParent(),n=Math.round(Do(t))-2,r=Math.round(Lc(t)*.75)-2;return{width:Math.min(Math.max(700,e),n),height:Math.min(600,r),minWidth:e}}onEnabledChanged(e){this.enabled=e,this.updateComps()}updateComps(){this.setAdvancedFilterComp(),this.setHeaderCompEnabled(),this.eventSvc.dispatchEvent({type:`headerHeight
4Changed`})}setAdvancedFilterComp(){if(this.destroyAdvancedFilterComp(),!this.enabled)return;let e=this.gos.get(`advancedFilterParent`);if(this.hasAdvancedFilterParent=!!e,e){let t=this.createBean(new AdvancedFilterComp),n=t.getGui();this.environment.applyThemeClasses(n),n.classList.add(this.gos.get(`enableRtl`)?`ag-rtl`:`ag-ltr`),e.appendChild(n),this.eFilterComp=t}}setHeaderCompEnabled(){this.eHeaderComp?.setEnabled(this.enabled&&!this.hasAdvancedFilterParent)}destroyAdvancedFilterComp(){this.eFilterComp&&(Ta(this.eFilterComp.getGui()),this.destroyBean(this.eFilterComp))}},OperatorParser2=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);let{expression:t}=this.params;for(;e<t.length;){let n=t[e];if(n===` `){if(this.parseOperator(e-1))return this.activeOperator++,e-1;this.operators[this.activeOperator]+=n}else this.operators[this.activeOperator]+=n;e++}return this.parseOperator(e-1),e}isValid(){return!this.validationError&&(!this.operators.length||!!this.parsedOperator)}getValidationError(){return this.validationError}getFunction(){return this.parsedOperator===`OR`?`||`:`&&`}getModel(){return this.parsedOperator===`OR`?`OR`:`AND`}getAutocompleteListParams(e,t){let n;if(t==null)n=``;else{let r=this.operators[t],i=this.operatorEndPositions[t];n=getSearchString(r,e,i==null?this.params.expression.length:i+1)}let r=this.params.advFilterExpSvc.getJoinOperatorAutocompleteEntries();return(t||t==null&&this.activeOperator)&&(r=r.filter(({key:e})=>e===this.parsedOperator)),this.params.advFilterExpSvc.generateAutocompleteListParams(r,`join`,n)}updateExpression(e,t,n){let{expression:r}=this.params,i=t.displayValue??t.key;if(n===0)for(let e=this.operatorEndPositions.length-1;e>0;e--){let t=this.operatorEndPositions[e];t!=null&&(r=updateExpression(r,this.operatorStartPositions[e],t,i).updatedValue)}let o=this.operatorStartPositions.length>n?this.operatorStartPositions[n]:e,s=(this.operatorEndPositions.length>n?this.operatorEndPositions[n]:void 0)??findEndPosition(r,e,!0).endPosition;return updateExpression(r,o,s,i,!0)}getNumOperators(){return this.operators.length}getLastOperatorEndPosition(){return this.operatorEndPositions[this.operatorEndPositions.length-1]}parseOperator(e){let t=this.operators.length>this.activeOperator?this.operators[this.activeOperator]:``,n=this.params.advFilterExpSvc.getExpressionJoinOperators(),r=findMatch(t,n,e=>e);if(r){this.operatorEndPositions[this.activeOperator]=e;let i=n[r];if(this.activeOperator){if(r!==this.parsedOperator)return this.validationError||={message:this.params.advFilterExpSvc.translate(`advancedFilterValidationJoinOperatorMismatch`),startPosition:e-t.length+1,endPosition:e},!1}else this.parsedOperator=r;return t!==i&&(checkAndUpdateExpression(this.params,t,i,e),this.operators[this.activeOperator]=i),!0}return r!==null&&(this.validationError||={message:this.params.advFilterExpSvc.translate(`advancedFilterValidationInvalidJoinOperator`),startPosition:e-t.length+1,endPosition:e},!0)}},Uh=class _JoinFilterExpressionParser{constructor(e,t){this.params=e,this.startPosition=t,this.expectingExpression=!0,this.expectingOperator=!1,this.expressionParsers=[],this.operatorParser=new OperatorParser2(this.params),this.missingEndBracket=!1,this.extraEndBracket=!1}parseExpression(){let e=this.startPosition,{expression:t}=this.params;for(;e<t.length;){let n=t[e];if(n===`(`&&!this.expectingOperator){let t=new _JoinFilterExpressionParser(this.params,e+1);e=t.parseExpression(),this.expressionParsers.push(t),this.expectingExpression=!1,this.expectingOperator=!0}else if(n===`)`)return this.endPosition=e-1,this.startPosition===0&&(this.extraEndBracket=!0),e;else if(n!==` `){if(this.expectingExpression){let t=new ColFilterExpressionParser(this.params,e);e=t.parseExpression(),this.expressionParsers.push(t),this.expectingExpression=!1,this.expectingOperator=!0}else this.expectingOperator&&(e=this.operatorParser.parseExpression(e),this.expectingOperator=!1,this.expectingExpression=!0)}e++}return this.startPosition>0&&(this.missingEndBracket=!0),e}isValid(){return!this.missingEndBracket&&!this.extraEndBracket&&this.expressionParsers.length===this.operatorParser.getNumOperators()+1&&this.operatorParser.isValid()&&this.expressionParsers.every(e=>e.isValid())}getValidationError(){let e=this.operatorParser.getValidationError();for(let t=0;t<this.expressionParsers.length;t++){let n=this.expressionParsers[t].getValidationError();if(n)return e&&e.startPosition<n.startPosition?e:n}if(e)return e;if(this.extraEndBracket)return{message:this.params.advFilterExpSvc.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.advFilterExpSvc.translate(t),startPosition:this.params.expression.length,endPosition:this.params.expression.length}:null}getFunction(e){let t=this.operatorParser.getFunction(),n=this.expressionParsers.map(t=>t.getFunction(e)),r=t===`&&`?`every`:`some`;return(e,t,i)=>n[r](n=>n(e,t,i))}getAutocompleteListParams(e){if(this.endPosition!=null&&e>this.endPosition+1)return;if(!this.expressionParsers.length)return this.getColumnAutocompleteListParams();let t=this.getExpressionParserIndex(e);if(t==null)return this.params.expression[e]===`(`?{enabled:!1}:this.getColumnAutocompleteListParams();let n=this.expressionParsers[t].getAutocompleteListParams(e);
4if(!n){if(t<this.expressionParsers.length-1)return this.operatorParser.getAutocompleteListParams(e,t);if(this.expressionParsers.length===this.operatorParser.getNumOperators()){let t=this.operatorParser.getLastOperatorEndPosition();return t==null||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 n}updateExpression(e,t,n){let r=this.params.expression,i=this.getExpressionParserIndex(e);if(i==null){let e=n===`column`?this.params.advFilterExpSvc.getColumnValue(t):t.displayValue??t.key;return updateExpression(r,this.startPosition,this.startPosition,e,!0)}return this.expressionParsers[i].updateExpression(e,t,n)??(n===`column`?updateExpression(r,e,r.length-1,this.params.advFilterExpSvc.getColumnValue(t),!0):this.endPosition!=null&&e>this.endPosition+1?null:this.operatorParser.updateExpression(e,t,i))}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.advFilterExpSvc.generateAutocompleteListParams(this.params.advFilterExpSvc.getColumnAutocompleteEntries(),`column`,``)}getExpressionParserIndex(e){let t;for(let n=0;n<this.expressionParsers.length&&!(this.expressionParsers[n].startPosition>e);n++)t=n;return t}},FilterExpressionParser=class{constructor(e){this.params=e,this.valid=!1}parseExpression(){this.joinExpressionParser=new Uh(this.params,0);let e=this.joinExpressionParser.parseExpression();return this.valid=e>=this.params.expression.length-1&&this.joinExpressionParser.isValid(),this.params.expression}isValid(){return this.valid}getValidationMessage(){let e=this.joinExpressionParser.getValidationError();if(!e)return null;let{message:t,startPosition:n,endPosition:r}=e;return n<this.params.expression.length?this.params.advFilterExpSvc.translate(`advancedFilterValidationMessage`,[t,this.params.expression.slice(n,r+1).trim()]):this.params.advFilterExpSvc.translate(`advancedFilterValidationMessageAtEnd`,[t])}getFunction(){let e=this.createFunctionParams();return{expressionFunction:this.joinExpressionParser.getFunction(e),params:e}}getAutocompleteListParams(e){return this.joinExpressionParser.getAutocompleteListParams(e)??{enabled:!1}}updateExpression(e,t,n){return this.joinExpressionParser.updateExpression(e,t,n)}getModel(){return this.isValid()?this.joinExpressionParser.getModel():null}createFunctionParams(){return{operands:[],operators:[],evaluatorParams:[]}}},AdvancedFilterService=class extends U{constructor(){super(...arguments),this.beanName=`advancedFilter`,this.appliedExpression=null,this.expression=null,this.isValid=!0}wireBeans(e){this.valueSvc=e.valueSvc,this.colModel=e.colModel,this.dataTypeSvc=e.dataTypeSvc,this.advFilterExpSvc=e.advFilterExpSvc,this.filterValueSvc=e.filterValueSvc,this.filterManager=e.filterManager}postConstruct(){this.setEnabled(this.gos.get(`enableAdvancedFilter`),!0),this.ctrl=this.createManagedBean(new AdvancedFilterCtrl(this.enabled)),this.expressionProxy={getValue:(e,t)=>{let n=this.colModel.getColDefCol(e);return n?this.filterValueSvc.getValue(n,t):void 0}},this.addManagedPropertyListener(`enableAdvancedFilter`,e=>this.setEnabled(!!e.currentValue)),this.addManagedEventListeners({newColumnsLoaded:e=>this.onNewColumnsLoaded(e)}),this.addManagedPropertyListener(`includeHiddenColumnsInAdvancedFilter`,()=>{this.updateValidity()&&this.filterManager?.onFilterChanged({source:`advancedFilter`})})}isEnabled(){return this.enabled}isFilterPresent(){return!!this.expressionFunction}doesFilterPass(e){return this.expressionFunction(this.expressionProxy,e,this.expressionParams)}getModel(){let e=this.createExpressionParser(this.appliedExpression);return e?.parseExpression(),e?.getModel()??null}setModel(e){let parseModel=(e,t)=>{if(e.filterType===`join`){let n=this.advFilterExpSvc.parseJoinOperator(e),r=e.conditions.map(e=>parseModel(e)).filter(e=>Xs(e)).join(` ${n} `);return t||e.conditions.length<=1?r:`(${r})`}return this.advFilterExpSvc.parseColumnFilterModel(e)},t=e?parseModel(e,!0):null;this.setExpressionDisplayValue(t),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 FilterExpressionParser({expression:e,colModel:this.colModel,dataTypeSvc:this.dataTypeSvc,valueSvc:this.valueSvc,advFilterExpSvc:this.advFilterExpSvc}):null}getDefaultExpression(e){let t=this.advFilterExpSvc.getColumnValue(e)+` `;return{updatedValue:t,updatedPosition:t.length}}isHeaderActive(){return!this.gos.get(`advancedFilterParent`)}getCtrl(){return this.ctrl}
4setEnabled(e,t){let n=this.enabled,r=Rc(this.gos)||lc(this.gos);e&&!r&&q(123),this.enabled=e&&r,!t&&this.enabled!==n&&this.eventSvc.dispatchEvent({type:`advancedFilterEnabledChanged`,enabled:this.enabled})}applyExpression(){let e=this.createExpressionParser(this.expression);e?.parseExpression(),this.applyExpressionFromParser(e)}getAppliedExpressionDisplayValue(){return this.appliedExpression}applyExpressionFromParser(e){if(this.isValid=!e||e.isValid(),!e||!this.isValid){this.expressionFunction=null,this.expressionParams=null,this.appliedExpression=null;return}let{expressionFunction:t,params:n}=e.getFunction();this.expressionFunction=t,this.expressionParams=n,this.appliedExpression=this.expression}updateValidity(){this.advFilterExpSvc.resetColumnCaches();let e=this.createExpressionParser(this.expression);e?.parseExpression();let t=(!e||e.isValid())!==this.isValid;return this.applyExpressionFromParser(e),this.ctrl.refreshComp(),this.ctrl.refreshBuilderComp(),t}onNewColumnsLoaded(e){if(e.source!==`gridInitializing`||!this.dataTypeSvc?.isPendingInference)return;this.ctrl.setInputDisabled(!0);let[t]=this.addManagedEventListeners({dataTypesInferred:()=>{t?.(),this.ctrl.setInputDisabled(!1)}})}},Wh={moduleName:`AdvancedFilter`,version:Z,beans:[AdvancedFilterService,AdvancedFilterExpressionService],icons:{advancedFilterBuilder:`group`,advancedFilterBuilderDrag:`grip`,advancedFilterBuilderInvalid:`not-allowed`,advancedFilterBuilderMoveUp:`up`,advancedFilterBuilderMoveDown:`down`,advancedFilterBuilderAdd:`plus`,advancedFilterBuilderRemove:`minus`,advancedFilterBuilderSelectOpen:`small-down`,richSelectRemove:`cancel`},apiFunctions:{getAdvancedFilterModel,setAdvancedFilterModel,showAdvancedFilterBuilder,hideAdvancedFilterBuilder},dependsOn:[fh,ml,zo,Ra,el,ds],css:[ph]},BaseSchemaBuilder=class{constructor(e){this._defs={},this._nullable=!1,this.description=e}_collectNestedDefs(e){let t={...this._defs};for(let n of e)n&&typeof n==`object`&&`$defs`in n&&(Object.assign(t,n.$defs),delete n.$defs);return t}_toJSON(e={}){let t={type:this._nullable?[this.type,`null`]:this.type,description:this.description,...e};return Object.keys(this._defs).length>0&&(t.$defs=this._defs),t}nullable(){return this._nullable=!0,this}define(e,t){return this._defs[e]=t,this}},StringSchemaBuilder=class extends BaseSchemaBuilder{constructor(e){super(typeof e==`string`?e:e?.description),this.type=`string`,typeof e==`object`&&e&&(this._pattern=e.pattern,this._format=e.format)}pattern(e){return this._pattern=e,this}format(e){return this._format=e,this}toJSON(){return this._toJSON({pattern:this._pattern,format:this._format})}},NumberSchemaBuilder=class extends BaseSchemaBuilder{constructor(e){super(typeof e==`string`?e:e?.description),this.type=`number`,typeof e==`object`&&e&&(this._minimum=e.minimum,this._maximum=e.maximum,this._exclusiveMinimum=e.exclusiveMinimum,this._exclusiveMaximum=e.exclusiveMaximum,this._multipleOf=e.multipleOf)}minimum(e){return this._minimum=e,this}exclusiveMinimum(e){return this._exclusiveMinimum=e,this}maximum(e){return this._maximum=e,this}exclusiveMaximum(e){return this._exclusiveMaximum=e,this}multipleOf(e){return this._multipleOf=e,this}toJSON(){return this._toJSON({minimum:this._minimum,exclusiveMinimum:this._exclusiveMinimum,maximum:this._maximum,exclusiveMaximum:this._exclusiveMaximum,multipleOf:this._multipleOf})}},EnumSchemaBuilder=class extends BaseSchemaBuilder{constructor(e,t){super(t),this._enum=e,this.type=`string`}toJSON(){return this._toJSON({enum:this._enum})}},LiteralSchemaBuilder=class extends EnumSchemaBuilder{constructor(e,t){super([e],t)}},BooleanSchemaBuilder=class extends BaseSchemaBuilder{constructor(e){super(e),this.type=`boolean`}toJSON(){return this._toJSON()}},ArraySchemaBuilder=class extends BaseSchemaBuilder{constructor(e,t){super(typeof t==`string`?t:t?.description),this.items=e,this.type=`array`,typeof t==`object`&&t&&(this._minItems=t.minItems,this._maxItems=t.maxItems)}minItems(e){return this._minItems=e,this}maxItems(e){return this._maxItems=e,this}toJSON(){let e=this.items.toJSON(),t=this._collectNestedDefs([e]);return this._defs=t,this._toJSON({items:e,minItems:this._minItems,maxItems:this._maxItems})}},ObjectSchemaBuilder=class extends BaseSchemaBuilder{constructor(e,t){super(t),this.properties=e,this.type=`object`}toJSON(){let e=Object.fromEntries(Object.keys(this.properties).map(e=>[e,this.properties[e].toJSON()])),t=this._collectNestedDefs(Object.values(e));return this._defs=t,this._toJSON({required:Object.keys(this.properties),additionalProperties:!1,properties:e})}},UnionSchemaBuilder=class{constructor(e,t){this.schemas=e,this._nullable=!1,this._defs={},this.description=t}nullable(){return this._nullable=!0,this}define(e,t){return this._defs[e]=t,this}_collectNestedDefs(e){let t=this._defs;for(let n of e)n&&typeof n==`object`&&`$defs`in n&&(Object.assign(t,n.$defs),delete n.$defs);return t}toJSON(){let e=this.schemas.map(e=>e.toJSON()),t=this._collectNestedDefs(e),n={anyOf:this._nullable?[...e,{type:`null`}]:e};return this.description&&(n.description=this.description),Object.keys(t).length>0&&(n.$defs=t),n}},ReferenceSchemaBuilder=class{constructor(e){this.id=e}nullable(){return this}toJSON(){return{$ref:`#/$defs/${this.id}`}}},Q={string:e=>new StringSchemaBuilder(e),number:e=>new NumberSchemaBuilder(e),enum:(e,t)=>
4new EnumSchemaBuilder(e,t),boolean:e=>new BooleanSchemaBuilder(e),array:(e,t)=>new ArraySchemaBuilder(e,t),object:(e,t)=>new ObjectSchemaBuilder(e,t),union:(e,t)=>new UnionSchemaBuilder(e,t),literal:(e,t)=>new LiteralSchemaBuilder(e,t),ref:e=>new ReferenceSchemaBuilder(e)},buildAggregationFeatureSchema=e=>{let{aggFuncSvc:t}=e;if(!t)return;let n=e.colModel.getCols().filter(e=>e.isAllowValue()&&t.getFuncNames(e).length>0);if(n.length!==0)return Q.object({aggregationModel:Q.array(Q.union(n.map(t=>Q.object({colId:Q.literal(t.getColId(),`Column identifier`),aggFunc:Q.enum(e.aggFuncSvc?.getFuncNames(t)||[],`Aggregation function`)}))),`Array of column aggregations`)},`Aggregation configuration for the grid`).nullable()},buildColumnSizingFeatureSchema=e=>{let t=e.colModel.getCols().filter(e=>e.isResizable());if(t.length===0)return;let n=t.map(e=>e.getColId());return Q.object({columnSizingModel:Q.array(Q.union([Q.object({colId:Q.ref(`resizableColumnId`),width:Q.number(`Fixed width in pixels`).minimum(20)}),Q.object({colId:Q.ref(`resizableColumnId`),flex:Q.number(`Flex sizing ratio`).minimum(0)})]),`Array of column sizing configurations`)},`Column sizing configuration for the grid`).define(`resizableColumnId`,Q.enum(n,`Column ID that supports resizing`))},buildColumnVisibilityFeatureSchema=()=>Q.object({hiddenColIds:Q.array(Q.ref(`allColumnIds`),`Array of column IDs to hide`)},`Column visibility configuration for the grid`).nullable(),buildAdvancedFilterFeatureSchema=({colModel:e,dataTypeSvc:t})=>{if(!t)return;let n=e.getCols(),r={boolean:[],object:[],date:[],dateString:[],dateTime:[],dateTimeString:[],number:[],text:[]};for(let e of n){let n=t.getBaseDataType(e);n&&r[n].push(e.colId)}let i=[],o={};for(let e of Object.keys(r))if(r[e].length>0){let t=`${e}AdvancedFilterModel`,n=Gh[e];o[t]=n(r[e]),i.push({$ref:`#/$defs/${t}`})}return o.joinAdvancedFilterModel=Q.object({filterType:Q.literal(`join`,`Filter type identifier for joining multiple advanced filter conditions`),type:Q.enum([`AND`,`OR`],`Logical operator to combine multiple advanced filter conditions`),conditions:Q.array(Q.ref(`advancedFilterModel`),`Array of advanced filter conditions to be combined`)}),o.advancedFilterModel={anyOf:[...i,{$ref:`#/$defs/joinAdvancedFilterModel`}]},Q.object({advancedFilterModel:Q.ref(`advancedFilterModel`)},`Advanced filter configuration for the grid`).nullable()},buildBooleanFilterSchema=e=>Q.object({filterType:Q.literal(`boolean`,`Filter type identifier for boolean column filters`),colId:Q.enum(e,`Column identifier for the boolean column to filter`),type:Q.enum([`true`,`false`],`Boolean value to filter by`)}),buildObjectFilterSchema=e=>Q.object({filterType:Q.literal(`object`,`Filter type identifier for object column filters`),colId:Q.enum(e,`Column identifier for the object column to filter`),filter:Q.string(`Filter value to compare against object column values`).nullable(),type:Q.enum([`equals`,`notEqual`,`contains`,`notContains`,`startsWith`,`endsWith`,`blank`,`notBlank`],`Object filter operation type`)}),buildDateFilterSchema=e=>Q.object({filterType:Q.literal(`date`,`Filter type identifier for date column filters`),colId:Q.enum(e,`Column identifier for the date column to filter`),filter:Q.string({pattern:`^\\d{4}-\\d{2}-\\d{2}$`,description:`Date value in YYYY-MM-DD format`}).nullable(),type:Q.enum([`equals`,`notEqual`,`lessThan`,`lessThanOrEqual`,`greaterThan`,`greaterThanOrEqual`,`blank`,`notBlank`],`Date filter operation type`)}),buildDateStringFilterSchema=e=>Q.object({filterType:Q.literal(`date`,`Filter type identifier for date string column filters`),colId:Q.enum(e,`Column identifier for the date string column to filter`),filter:Q.string({pattern:`^\\d{4}-\\d{2}-\\d{2}$`,description:`Date value in YYYY-MM-DD format`}).nullable(),type:Q.enum([`equals`,`notEqual`,`lessThan`,`lessThanOrEqual`,`greaterThan`,`greaterThanOrEqual`,`blank`,`notBlank`],`Date string filter operation type`)}),buildDateTimeFilterSchema=e=>Q.object({filterType:Q.literal(`dateTime`,`Filter type identifier for datetime column filters`),colId:Q.enum(e,`Column identifier for the datetime column to filter`),filter:Q.string({pattern:`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}
4$`,description:`DateTime value in YYYY-MM-DDTHH:mm:ss format`}).nullable(),type:Q.enum([`equals`,`notEqual`,`lessThan`,`lessThanOrEqual`,`greaterThan`,`greaterThanOrEqual`,`blank`,`notBlank`],`DateTime filter operation type`)}),buildDateTimeStringFilterSchema=e=>Q.object({filterType:Q.literal(`dateTimeString`,`Filter type identifier for datetime string column filters`),colId:Q.enum(e,`Column identifier for the datetime string column to filter`),filter:Q.string({pattern:`^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$`,description:`DateTime value in YYYY-MM-DD HH:mm:ss format`}).nullable(),type:Q.enum([`equals`,`notEqual`,`lessThan`,`lessThanOrEqual`,`greaterThan`,`greaterThanOrEqual`,`blank`,`notBlank`],`DateTime string filter operation type`)}),buildNumberFilterSchema=e=>Q.object({filterType:Q.literal(`number`,`Filter type identifier for number column filters`),colId:Q.enum(e,`Column identifier for the number column to filter`),filter:Q.number(`Numeric value to filter by`).nullable(),type:Q.enum([`equals`,`notEqual`,`lessThan`,`lessThanOrEqual`,`greaterThan`,`greaterThanOrEqual`,`blank`,`notBlank`],`Number filter operation type`)}),buildTextFilterSchema=e=>Q.object({filterType:Q.literal(`text`,`Filter type identifier for text column filters`),colId:Q.enum(e,`Column identifier for the text column to filter`),filter:Q.string(`Text value to filter by`).nullable(),type:Q.enum([`equals`,`notEqual`,`contains`,`notContains`,`startsWith`,`endsWith`,`blank`,`notBlank`],`Text filter operation type`)}),Gh={boolean:buildBooleanFilterSchema,object:buildObjectFilterSchema,date:buildDateFilterSchema,dateString:buildDateStringFilterSchema,dateTime:buildDateTimeFilterSchema,dateTimeString:buildDateTimeStringFilterSchema,number:buildNumberFilterSchema,text:buildTextFilterSchema},Kh=`agTextColumnFilter`,qh=`agNumberColumnFilter`,Jh=`agDateColumnFilter`,Yh=`agSetColumnFilter`,Xh=`agMultiColumnFilter`,Zh=[Kh,qh,Jh],buildFilterFeatureSchema=(e,t)=>{let{advancedFilter:n}=e;return n?.isEnabled()?buildAdvancedFilterFeatureSchema(e):buildColumnFilterFeatureSchema(e,t)},buildColumnFilterFeatureSchema=(e,t)=>{let{gos:n,colFilter:r,colModel:i}=e;if(!r)return;let o=i.getCols().filter(e=>e.isFilterAllowed());if(o.length===0)return;let s={},c=n.get(`enableFilterHandlers`);for(let e of o){let n=t?.columns?t.columns[e.getColId()]:void 0,i=e.getColDef(),o=r.getDefaultFilter(e),p=n?.includeSetValues??!1,m=buildColumnFilterSchema(i.filter,i.filterParams,o,(t=!1,n=0)=>{if(!p)return[];let i;return t?c&&(i=r.getHandler(e,!0).getHandler(n)):i=r.getHandler(e,!0),i?i.getFilterKeys():[]});m&&(s[e.colId]=m.nullable())}return Q.object({filterModel:Q.object(s)}).nullable()};function buildColumnFilterSchema(e,t,n,r){let i;if(typeof e==`string`?i=e:typeof e==`object`&&typeof e.component==`string`?i=e.component:(e===!0||typeof e==`object`&&e.component===!0)&&(i=n),!i)return null;if(Zh.includes(i)){let e=t?.maxNumConditions,n=t?.filterOptions?t.filterOptions.map(e=>typeof e==`string`?e:typeof e==`object`&&e.displayKey?e.displayKey:null).filter(Boolean):void 0,r=t?.useIsoSeparator||!1;return buildSimpleFilterSchema(i,{maxConditions:e,filterOptions:n,useIsoSeparator:r})}return i===Yh?buildSetFilterSchema(r):i===Xh?buildMultiFilterSchema(t.filters,n,r):null}var buildSimpleFilterSchema=(e,t)=>e===Jh?buildDateFilterSchema2(t):e===qh?buildNumberFilterSchema2(t):buildTextFilterSchema2(t),buildJoinSchema=(e,t,n=2)=>n===1?e:Q.object({filterType:Q.literal(t,`Filter type identifier for ${t} filters with multiple conditions`),operator:Q.enum([`AND`,`OR`],`Logical operator to combine multiple filter conditions. Must be included even with a single filter to adhere to the API.`),conditions:Q.array(e,`Array of filter conditions to be combined`).minItems(2).maxItems(n)}),buildTextFilterSchema2=e=>{let t=e.filterOptions??[`contains`,`notContains`,`equals`,`notEqual`,`startsWith`,`endsWith`,`blank`,`notBlank`];return buildJoinSchema(Q.object({filterType:Q.literal(`text`,`Filter type identifier for text filters`),type:Q.enum(t,`Text filter operation type`),filter:Q.string(`Primary filter value`).nullable(),filterTo:Q.string(`Secondary filter value for range operations`).nullable()}),`text`,e.maxConditions)},buildNumberFilterSchema2=e=>{let t=e.filterOptions??[`equals`,`notEqual`,`greaterThan`,`greaterThanOrEqual`,`lessThan`,`lessThanOrEqual`,`inRange`,`blank`,`notBlank`];return buildJoinSchema(Q.object({filterType:Q.literal(`number`,`Filter type identifier for number filters`),type:Q.enum(t,`Number filter operation type`),filter:Q.number(`Primary filter value`).nullable(),filterTo:Q.number(`Secondary filter value for range operations`).nullable()}),`number`,e.maxConditions)},buildDateFilterSchema2=e=>{let t=e.filterOptions??[`equals`,`notEqual`,`lessThan`,`greaterThan`,`inRange`,`blank`,`notBlank`],n=e.useIsoSeparator?`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$`:`^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$`;return buildJoinSchema(Q.object({filterType:Q.literal(`date`,`Filter type identifier for date filters`),type:Q.enum(t,`Date filter operation type`),dateFrom:Q.string({pattern:n,description:`Primary date filter value in YYYY-MM-DD HH:mm:ss format`}).nullable(),dateTo:Q.string({pattern:n,description:`Secondary date filter value for range operations in YYYY-MM-DD HH:mm:ss format`}).nullable()}),`date`,e.maxConditions)},buildSetFilterSchema=e=>
4{let t=e?e().filter(Boolean):[];return Q.object({filterType:Q.literal(`set`,`Filter type identifier for set filters`),values:Q.array(t.length>0?Q.enum(t,`Available values to filter by`):Q.string(`Filter values`),`Array of values to include in the filter`)})},buildMultiFilterSchema=(e,t,n=()=>[])=>Q.object({filterType:Q.literal(`multi`,`Filter type identifier for multi-condition filters`),filterModels:Q.array(Q.union(e.map((e,r)=>buildColumnFilterSchema(e.filter,e.filterParams,t,()=>n(!0,r))),`Union of different filter types that can be combined`).nullable(),`Array of filter conditions to be combined with AND/OR logic`)}),buildPivotFeatureSchema=e=>{let t=e.colModel.getCols().filter(e=>e.isAllowPivot()).map(e=>e.getColId());if(t.length!==0)return Q.object({pivotMode:Q.boolean(`Whether pivot mode is enabled`),pivotColIds:Q.array(Q.enum(t,`Column ID that supports pivoting`),`Array of column IDs to use as pivot columns`)},`Pivot configuration for the grid`).nullable()},buildRowGroupFeatureSchema=e=>{let t=e.colModel.getCols().filter(e=>e.isAllowRowGroup());if(t.length===0)return;let n=t.map(e=>e.getColId());return Q.object({groupColIds:Q.array(Q.enum(n,`Column ID that supports row grouping`),`Array of column IDs to group by`)},`Row grouping configuration for the grid`)},buildSortFeatureSchema=e=>{let{sortSvc:t}=e;if(!t)return;let n=e.colModel.getCols().filter(e=>e.isSortable());if(n.length===0)return;let r=n.map(e=>e.getColId());return Q.object({sortModel:Q.array(Q.object({colId:Q.enum(r,`Column ID that supports sorting`),sort:Q.enum([`asc`,`desc`],`Sort direction: ascending or descending`)}),`Array of sort configurations`)},`Sort configuration for the grid`).nullable()},Qh={aggregation:buildAggregationFeatureSchema,filter:buildFilterFeatureSchema,sort:buildSortFeatureSchema,pivot:buildPivotFeatureSchema,columnVisibility:buildColumnVisibilityFeatureSchema,columnSizing:buildColumnSizingFeatureSchema,rowGroup:buildRowGroupFeatureSchema};function getStructuredSchema(e,t){let n=e.colModel.getCols().map(e=>e.getColId()),r={};for(let n of wo){if(t?.exclude?.includes(n))continue;let i=Qh[n],o=i(e,t);o&&(r[n]=o.nullable())}let i=t?.columns??{},o=n.map(e=>i[e]?.description?`${e}: ${i[e].description}
4`:e).filter(Boolean).join(`
5`);return Q.object(r).define(`allColumnIds`,Q.enum(n,o)).toJSON()}var $h={moduleName:`AiToolkit`,version:Z,beans:[],dependsOn:[Bo],apiFunctions:{getStructuredSchema}};function isSideBarVisible(e){return e.sideBar?.comp.isDisplayed()??!1}function setSideBarVisible(e,t){e.sideBar?.comp.setDisplayed(t)}function setSideBarPosition(e,t){e.sideBar?.comp.setSideBarPosition(t)}function openToolPanel(e,t,n){e.sideBar?.comp.openToolPanel(t,`api`,n)}function closeToolPanel(e){e.sideBar?.comp.close(`api`)}function getOpenedToolPanel(e){return e.sideBar?.comp.openedItem()??null}function refreshToolPanel(e){e.sideBar?.comp.refresh()}function isToolPanelShowing(e){return e.sideBar?.comp.isToolPanelShowing()??!1}function getToolPanelInstance(e,t){let n=e.sideBar?.comp.getToolPanelInstance(t);return bl(n)}function getSideBar(e){return e.sideBar?.comp.getDef()}function findFocusableElementBeforeTabGuard(e,t){if(!t)return null;let n=Zl(e),r=n.indexOf(t);if(r===-1)return null;let i=-1;for(let e=r-1;e>=0;e--)if(n[e].classList.contains(Ca.TAB_GUARD_TOP)){i=e;break}return i<=0?null:n[i-1]}function isTargetUnderManagedComponent(e,t){if(!t)return!1;let n=e.querySelectorAll(`.${zl}`);if(!n.length)return!1;for(let e=0;e<n.length;e++)if(n[e].contains(t))return!0;return!1}var eg=`.ag-tool-panel-wrapper{display:flex;overflow:hidden auto;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-side-bar-panel-width)}.ag-tool-panel-external{display:flex;flex-direction:row}:where(.ag-tool-panel-external) .ag-tool-panel-wrapper{flex-grow:1}.ag-select-agg-func-item{align-items:center;display:flex;flex:1 1 auto;flex-flow:row nowrap;height:100%;overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap;>*{flex:none}}.ag-tool-panel-horizontal-resize{cursor:ew-resize;height:100%;position:absolute;top:0;width:5px;z-index:1}.ag-side-bar{background-color:var(--ag-side-bar-background-color);display:flex;flex-direction:row-reverse;position:relative}:where(.ag-ltr) :where(.ag-side-bar-left) .ag-tool-panel-horizontal-resize{right:-3px}:where(.ag-rtl) :where(.ag-side-bar-left) .ag-tool-panel-horizontal-resize{left:-3px}:where(.ag-ltr) :where(.ag-side-bar-right) .ag-tool-panel-horizontal-resize{left:-3px}:where(.ag-rtl) :where(.ag-side-bar-right) .ag-tool-panel-horizontal-resize{right:-3px}.ag-side-bar-left{flex-direction:row;order:-1}.ag-side-buttons{background-color:var(--ag-side-button-bar-background-color);padding-top:var(--ag-side-button-bar-top-padding);position:relative}.ag-side-button{background-color:var(--ag-side-button-background-color);border-bottom:var(--ag-side-button-border);border-top:var(--ag-side-button-border);color:var(--ag-side-button-text-color);margin-top:-1px;position:relative;&:before{background-color:transparent;bottom:0;content:"";display:block;position:absolute;top:0;transition:background-color var(--ag-side-button-selected-underline-transition-duration);width:var(--ag-side-button-selected-underline-width)}&:hover{background-color:var(--ag-side-button-hover-background-color);color:var(--ag-side-button-hover-text-color)}&.ag-selected{background-color:var(--ag-side-button-selected-background-color);border-bottom:var(--ag-side-button-selected-border);border-top:var(--ag-side-button-selected-border);color:var(--ag-side-button-selected-text-color);&:before{background-color:var(--ag-side-button-selected-underline-color)}}}:where(.ag-ltr) .ag-side-button{&:before{left:0}}:where(.ag-rtl) .ag-side-button{&:before{right:0}}.ag-side-button-button{align-items:center;display:flex;flex-direction:column;gap:var(--ag-spacing);position:relative;white-space:nowrap;width:100%;&:focus{box-shadow:none}}:where(.ag-ltr) .ag-side-button-button{padding:var(--ag-side-button-vertical-padding) var(--ag-side-button-right-padding) var(--ag-side-button-vertical-padding) var(--ag-side-button-left-padding)}:where(.ag-rtl) .ag-side-button-button{padding:var(--ag-side-button-vertical-padding) var(--ag-side-button-left-padding) var(--ag-side-button-vertical-padding) var(--ag-side-button-right-padding)}.ag-side-button-button:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-side-button-label{writing-mode:vertical-lr}@media (resolution <= 1.5x){.ag-side-button-label{font-family:"Segoe UI",var(--ag-font-family)}:where(.ag-ltr) .ag-side-button-label{transform:rotate(.05deg)}:where(.ag-rtl) .ag-side-button-label{transform:rotate(-.05deg)}}:where(.ag-ltr) .ag-side-bar-left,:where(.ag-rtl) .ag-side-bar-right{border-right:var(--ag-side-panel-border);:where(.ag-tool-panel-wrapper){border-left:var(--ag-side-panel-border)}}:where(.ag-ltr) .ag-side-bar-right,:where(.ag-rtl) .ag-side-bar-left{border-left:var(--ag-side-panel-border);:where(.ag-tool-panel-wrapper){border-right:var(--ag-side-panel-border)}}
5`,tg={tag:`div`,cls:`ag-side-button`,role:`presentation`,children:[{tag:`button`,ref:`eToggleButton`,cls:`ag-button ag-side-button-button`,role:`tab`,attrs:{type:`button`,tabindex:`-1`,"aria-expanded":`false`},children:[{tag:`div`,ref:`eIconWrapper`,cls:`ag-side-button-icon-wrapper`,attrs:{"aria-hidden":`true`}},{tag:`span`,ref:`eLabel`,cls:`ag-side-button-label`}]}]},SideBarButtonComp=class extends K{constructor(e){super(),this.toolPanelDef=e,this.eToggleButton=null,this.eIconWrapper=null,this.eLabel=null}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){this.setTemplate(tg,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute(`id`,`ag-${this.getCompId()}-button`)}setLabel(){let e=this.toolPanelDef,t=this.getLocaleTextFunc()(e.labelKey,e.labelDefault);this.eLabel.textContent=t}setIcon(){this.eIconWrapper.insertAdjacentElement(`afterbegin`,J(this.toolPanelDef.iconKey,this.beans))}onButtonPressed(){this.dispatchLocalEvent({type:`toggleButtonClicked`})}setSelected(e){this.toggleCss(`ag-selected`,e),to(this.eToggleButton,e)}},ng={tag:`div`,cls:`ag-side-buttons`,role:`tablist`},AgSideBarButtons=class extends K{constructor(){super(ng),this.buttonComps=[]}postConstruct(){this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)})}handleKeyDown(e){if(!(e.key!==G.TAB||!e.shiftKey)){if(Mo(this.beans,!0)){e.preventDefault();return}ua(e)}}setActiveButton(e){for(let t of this.buttonComps)t.setSelected(e===t.getToolPanelId())}addButtonComp(e){let t=this.createBean(new SideBarButtonComp(e));return this.buttonComps.push(t),this.appendChild(t),t.addEventListener(`toggleButtonClicked`,()=>{this.dispatchLocalEvent({type:`sideBarButtonClicked`,toolPanelId:e.id})}),t}clearButtons(){this.buttonComps=this.destroyBeans(this.buttonComps),Ml(this.getGui())}destroy(){this.clearButtons(),super.destroy()}},rg={selector:`AG-SIDE-BAR-BUTTONS`,component:AgSideBarButtons},ig={id:`columns`,labelDefault:`Columns`,labelKey:`columns`,iconKey:`columnsToolPanel`,toolPanel:`agColumnsToolPanel`},ag={id:`filters`,labelDefault:`Filters`,labelKey:`filters`,iconKey:`filtersToolPanel`,toolPanel:`agFiltersToolPanel`},og={columns:ig,filters:ag,"filters-new":{id:`filters-new`,labelDefault:`Filters`,labelKey:`filters`,iconKey:`filtersToolPanel`,toolPanel:`agNewFiltersToolPanel`}};function parseSideBarDef(e){if(e){if(e===!0)return{toolPanels:[ig,ag],defaultToolPanel:`columns`};if(typeof e==`string`)return parseSideBarDef([e]);if(Array.isArray(e)){let t=[];for(let n of e){let e=og[n];if(!e){q(215,{key:n,defaultByKey:og});continue}t.push(e)}return t.length===0?void 0:{toolPanels:t,defaultToolPanel:t[0].id}}return{toolPanels:parseComponents(e.toolPanels),defaultToolPanel:e.defaultToolPanel,hiddenByDefault:e.hiddenByDefault,position:e.position,hideButtons:e.hideButtons}}}function parseComponents(e){let t=[];return e&&e.forEach(e=>{let n=parseOneComponent(e);n&&t.push(n)}),t}function parseOneComponent(e){return typeof e==`string`?og[e]?og[e]:(q(215,{key:e,defaultByKey:og}),null):e}var AgHorizontalResize=class extends K{constructor(){super({tag:`div`,cls:`ag-tool-panel-horizontal-resize`}),this.minWidth=100,this.maxWidth=null}postConstruct(){let e=this.beans.horizontalResizeSvc.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.inverted=this.gos.get(`enableRtl`)}dispatchResizeEvent(e,t,n){this.eventSvc.dispatchEvent({type:`toolPanelSizeChanged`,width:n,started:e,ended:t})}onResizeStart(){this.startingWidth=this.elementToResize.offsetWidth,this.dispatchResizeEvent(!0,!1,this.startingWidth)}onResizeEnd(e){return this.onResizing(e,!0)}onResizing(e,t=!1){let n=this.inverted?-1:1,r=Math.max(this.minWidth,Math.floor(this.startingWidth-e*n));this.maxWidth!=null&&(r=Math.min(this.maxWidth,r)),this.elementToResize.style.width=`${r}px`,this.dispatchResizeEvent(!1,t,r)}};
5function getToolPanelCompDetails(e,t,n){return e.getCompDetails(t,sg,void 0,n,!0)}var sg={name:`toolPanel`,optionalMethods:[`refresh`,`getState`]},cg={tag:`div`,cls:`ag-tool-panel-wrapper`,role:`tabpanel`},ToolPanelWrapper=class extends K{constructor(){super(cg)}postConstruct(){let e=this.getGui(),t=this.resizeBar=this.createManagedBean(new AgHorizontalResize);e.setAttribute(`id`,`ag-${this.getCompId()}`),t.elementToResize=e,this.appendChild(t)}getToolPanelId(){return this.toolPanelId}setToolPanelDef(e,t){let{id:n,minWidth:r,maxWidth:i,width:o}=e;this.toolPanelId=n,this.width=o;let s=getToolPanelCompDetails(this.beans.userCompFactory,e,t);if(s==null)return!1;let c=s.newAgStackInstance();this.params=s.params,c.then(this.setToolPanelComponent.bind(this));let p=this.resizeBar;return r!=null&&(p.minWidth=r),i!=null&&(p.maxWidth=i),!0}setToolPanelComponent(e){this.toolPanelCompInstance=e,this.appendChild(e.getGui()),this.addDestroyFunc(()=>{this.destroyBean(e)});let t=this.width;t&&(this.getGui().style.width=`${t}px`)}getToolPanelInstance(){return this.toolPanelCompInstance}setResizerSizerSide(e){let t=this.gos.get(`enableRtl`),n=e===`left`,r=t?n:!n;this.resizeBar.inverted=r}refresh(){this.toolPanelCompInstance?.refresh(this.params)}},lg={tag:`div`,cls:`ag-side-bar ag-unselectable`,children:[{tag:`ag-side-bar-buttons`,ref:`sideBarButtons`}]},AgSideBar=class extends K{constructor(){super(lg,[rg]),this.sideBarButtons=null,this.toolPanelWrappers=[],this.registerCSS(eg)}postConstruct(){this.sideBarButtons.addEventListener(`sideBarButtonClicked`,this.onToolPanelButtonClicked.bind(this));let{beans:e,gos:t}=this,{sideBar:n}=t.get(`initialState`)??{};this.setSideBarDef({sideBarDef:parseSideBarDef(t.get(`sideBar`)),sideBarState:n}),this.addManagedPropertyListener(`sideBar`,()=>this.setState()),e.sideBar.comp=this;let r=this.getFocusableElement();this.createManagedBean(new Yl(r,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),yl(e,this,r),this.addManagedPropertyListener(`enableAdvancedFilter`,this.onAdvancedFilterChanged.bind(this))}onTabKeyDown(e){if(e.defaultPrevented)return;let{beans:t,sideBarButtons:n}=this,r=this.getGui(),i=n.getGui(),o=Lo(t),s=r.querySelector(`.ag-tool-panel-wrapper:not(.ag-hidden)`),c=e.target,p=e.shiftKey;if(!s)return Mo(t,p)?(e.preventDefault(),!0):Mo(t,p,!0);if(i.contains(o)){ja(s,p)&&e.preventDefault();return}if(!p)return;let m=null;s.contains(o)?m=Qo(t,s,void 0,!0):isTargetUnderManagedComponent(s,c)&&(m=findFocusableElementBeforeTabGuard(s,c)),m||=(m=i.querySelector(`.ag-selected button`),El(m)?m:null),m&&m!==e.target&&(e.preventDefault(),m.focus())}handleKeyDown(e){let t=Lo(this.beans),n=this.sideBarButtons;if(!n.getGui().contains(t))return;let r=n.getGui(),i=Array.prototype.slice.call(r.querySelectorAll(`.ag-side-button`)),o=i.findIndex(e=>e.contains(t)),s=null;switch(e.key){case G.LEFT:case G.UP:s=Math.max(0,o-1);break;case G.RIGHT:case G.DOWN:s=Math.min(o+1,i.length-1)}if(s===null)return;let c=i[s].querySelector(`button`);c&&(c.focus(),e.preventDefault())}onToolPanelButtonClicked(e){let t=e.toolPanelId;this.openedItem()===t?this.openToolPanel(void 0,`sideBarButtonClicked`):this.openToolPanel(t,`sideBarButtonClicked`)}clearDownUi(){this.sideBarButtons.clearButtons(),this.destroyToolPanelWrappers()}setSideBarDef({sideBarDef:e,sideBarState:t,existingToolPanelWrappers:n}){if(this.setDisplayed(!1),this.sideBar=e,e&&this.sideBarButtons.setDisplayed(!e.hideButtons),e?.toolPanels){let r=e.toolPanels;if(this.createToolPanelsAndSideButtons(r,t,n),!this.toolPanelWrappers.length)return;let i=t?t.visible:!e.hiddenByDefault;if(this.setDisplayed(i),this.setSideBarPosition(t?t.position:e.position),i){if(t){let{openToolPanel:e}=t;e&&this.openToolPanel(e,`sideBarInitializing`)}else this.openToolPanel(e.defaultToolPanel,`sideBarInitializing`)}}}getDef(){return this.sideBar}setSideBarPosition(e){e||=`right`,this.position=e;let t=e===`left`,n=t?`right`:`left`;this.toggleCss(`ag-side-bar-left`,t),this.toggleCss(`ag-side-bar-right`,!t);for(let e of this.toolPanelWrappers)e.setResizerSizerSide(n);return this.dispatchSideBarUpdated(),this}setDisplayed(e,t){super.setDisplayed(e,t),this.dispatchSideBarUpdated()}getState(){let e={};for(let t of this.toolPanelWrappers)e[t.getToolPanelId()]=t.getToolPanelInstance()?.getState?.();return{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:e}}createToolPanelsAndSideButtons(e,t,n){for(let r of e)this.createToolPanelAndSideButton(r,t?.toolPanels?.[r.id],n?.[r.id])}validateDef(e){let{id:t,toolPanel:n}=e;return t==null?(q(212),!1):isFilterPanel(n)&&this.beans.filterManager?.isAdvFilterEnabled()?(q(213),!1):!0}createToolPanelAndSideButton(e,t,n){if(!this.validateDef(e))return;let r;if(n)r=n;else if(r=this.createBean(new ToolPanelWrapper),!r.setToolPanelDef(e,co(this.gos,{initialState:t,onStateUpdated:()=>this.dispatchSideBarUpdated()})))return;r.setDisplayed(!1);let i=r.getGui(),o=e.parent instanceof HTMLElement?e.parent:this;o===e.parent&&(this.beans.environment.applyThemeClasses(o,[`ag-external`,`ag-tool-panel-external`]),i.classList.add(this.gos.get(`enableRtl`)?`ag-rtl`:`ag-ltr`)),o.appendChild(i),this.toolPanelWrappers.push(r);let s=this.sideBarButtons.addButtonComp(e);Eo(s.eToggleButton,i)}refresh(){for(let e of this.toolPanelWrappers)e.refresh()}renderToolPanelUnderParent(e,t){let n=this.sideBar?.toolPanels?.find(t=>(typeof t==`string`?t:t.id)===e);if(n){let r=parseOneComponent(n);if(r){let n=this.gos.get(`initialState`)?.sideBar?.toolPanels?.[r.id];r.parent=t;let i=this.toolPanelWrappers.find(t=>t.getToolPanelId()===e);this.createToolPanelAndSideButton(r,n,i)}}}
5openToolPanel(e,t=`api`,n){n&&e&&this.renderToolPanelUnderParent(e,n);let r=this.openedItem();if(r!==e){for(let t of this.toolPanelWrappers){let n=e===t.getToolPanelId();t.setDisplayed(n)}r!==this.openedItem()&&(this.sideBarButtons.setActiveButton(e),this.raiseToolPanelVisibleEvent(e,r??void 0,t))}}getToolPanelInstance(e){let t=this.toolPanelWrappers.filter(t=>t.getToolPanelId()===e)[0];if(!t){q(214,{key:e});return}return t.getToolPanelInstance()}raiseToolPanelVisibleEvent(e,t,n){let r=!!e&&!!t,i=this.eventSvc;t&&i.dispatchEvent({type:`toolPanelVisibleChanged`,source:n,key:t,visible:!1,switchingToolPanel:r}),e&&i.dispatchEvent({type:`toolPanelVisibleChanged`,source:n,key:e,visible:!0,switchingToolPanel:r})}close(e=`api`){this.openToolPanel(void 0,e)}isToolPanelShowing(){return!!this.openedItem()}openedItem(){let e=null;for(let t of this.toolPanelWrappers)t.isDisplayed()&&(e=t.getToolPanelId());return e}setState(e){let t=parseSideBarDef(this.gos.get(`sideBar`)),n={};t&&this.sideBar&&t.toolPanels?.forEach(t=>{let{id:r}=t;if(!r)return;let i=this.sideBar.toolPanels?.find(e=>e.id===r);if(!i||t.toolPanel!==i.toolPanel)return;let o=this.toolPanelWrappers.find(e=>e.getToolPanelId()===r);if(!o)return;let s=co(this.gos,{...t.toolPanelParams??{},initialState:e?.toolPanels?.[r],onStateUpdated:()=>this.dispatchSideBarUpdated()});o.getToolPanelInstance()?.refresh(s)===!0&&(this.toolPanelWrappers=this.toolPanelWrappers.filter(e=>e!==o),Ta(o.getGui()),n[r]=o)}),this.clearDownUi(),this.setSideBarDef({sideBarDef:t,sideBarState:e,existingToolPanelWrappers:n})}dispatchSideBarUpdated(){this.eventSvc.dispatchEvent({type:`sideBarUpdated`})}destroyToolPanelWrappers(){for(let e of this.toolPanelWrappers)Ta(e.getGui()),this.destroyBean(e);this.toolPanelWrappers.length=0}onAdvancedFilterChanged(){this.sideBar?.toolPanels?.some(e=>isFilterPanel(typeof e==`string`?e:e.toolPanel))&&this.setState()}destroy(){this.destroyToolPanelWrappers(),super.destroy()}};function isFilterPanel(e){return e===`agFiltersToolPanel`||e===`agNewFiltersToolPanel`}var ug={selector:`AG-SIDE-BAR`,component:AgSideBar},SideBarService=class extends U{constructor(){super(...arguments),this.beanName=`sideBar`}getSelector(){return ug}},dg={moduleName:`SideBar`,version:Z,beans:[SideBarService],apiFunctions:{isSideBarVisible,setSideBarVisible,setSideBarPosition,openToolPanel,closeToolPanel,getOpenedToolPanel,refreshToolPanel,isToolPanelShowing,getToolPanelInstance,getSideBar},dependsOn:[fh,iu]},fg={tag:`div`},AgMenuItemRenderer=class extends K{constructor(){super(fg)}init(e){this.params=e,this.cssClassPrefix=this.params.cssClassPrefix??`ag-menu-option`,this.addAriaAttributes(),this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu()}configureDefaults(){return!0}addAriaAttributes(){let{checked:e,subMenu:t}=this.params,n=this.getGui();e&&Vc(n,e),t&&to(n,!1)}addIcon(){if(this.params.isCompact)return;let e=Dl({tag:`span`,ref:`eIcon`,cls:`${this.getClassName(`part`)} ${this.getClassName(`icon`)}`,role:`presentation`}),{checked:t,icon:n}=this.params;t?e.appendChild(J(`check`,this.beans)):n&&(so(n)?e.appendChild(n):typeof n==`string`?e.innerHTML=n:q(227)),this.getGui().appendChild(e)}addName(){let e=Dl({tag:`span`,ref:`eName`,cls:`${this.getClassName(`part`)} ${this.getClassName(`text`)}`,children:this.params.name||``});this.getGui().appendChild(e)}addShortcut(){if(this.params.isCompact)return;let e=Dl({tag:`span`,ref:`eShortcut`,cls:`${this.getClassName(`part`)} ${this.getClassName(`shortcut`)}`,children:this.params.shortcut||``});this.getGui().appendChild(e)}addSubMenu(){let e=Dl({tag:`span`,ref:`ePopupPointer`,cls:`${this.getClassName(`part`)} ${this.getClassName(`popup-pointer`)}`}),t=this.getGui();if(this.params.subMenu){let t=this.gos.get(`enableRtl`)?`subMenuOpenRtl`:`subMenuOpen`;e.appendChild(J(t,this.beans))}t.appendChild(e)}getClassName(e){return`${this.cssClassPrefix}-${e}`}},pg={moduleName:`MenuItem`,version:Z,userComponents:{agMenuItem:AgMenuItemRenderer},icons:{check:`tick`,subMenuOpen:`small-right`,subMenuOpenRtl:`small-left`},css:[`.ag-menu-list{cursor:default;display:table;padding:var(--ag-spacing) 0;width:100%}.ag-menu-option,.ag-menu-separator{display:table-row}.ag-menu-option-part,.ag-menu-separator-part{display:table-cell;vertical-align:middle}.ag-menu-option{cursor:pointer;font-weight:500}:where(.ag-ltr) :where(.ag-menu-option-popup-pointer) .ag-icon{text-align:right}:where(.ag-rtl) :where(.ag-menu-option-popup-pointer) .ag-icon{text-align:left}.ag-menu-option-text{white-space:nowrap}.ag-menu-option-custom{display:contents}
5.ag-compact-menu-option{display:flex;flex-wrap:nowrap;width:100%}.ag-compact-menu-option-text{flex:1 1 auto;white-space:nowrap}.ag-menu-separator{height:calc(var(--ag-spacing)*2 + 1px)}.ag-menu-separator-part:after{border-top:solid var(--ag-border-width) var(--ag-menu-separator-color);content:"";display:block}.ag-compact-menu-option-active,.ag-menu-option-active{background-color:var(--ag-row-hover-color)}.ag-compact-menu-option-part,.ag-menu-option-part{line-height:var(--ag-icon-size);padding:calc(var(--ag-spacing) + 2px) 0}.ag-compact-menu-option-disabled,.ag-menu-option-disabled{cursor:not-allowed;opacity:.5}.ag-compact-menu-option-icon,.ag-menu-option-icon{width:var(--ag-icon-size)}:where(.ag-ltr) .ag-compact-menu-option-icon,:where(.ag-ltr) .ag-menu-option-icon{padding-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-compact-menu-option-icon,:where(.ag-rtl) .ag-menu-option-icon{padding-right:calc(var(--ag-spacing)*2)}.ag-compact-menu-option-text,.ag-menu-option-text{padding-left:calc(var(--ag-spacing)*2);padding-right:calc(var(--ag-spacing)*2)}:where(.ag-ltr) .ag-compact-menu-option-shortcut,:where(.ag-ltr) .ag-menu-option-shortcut{padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-compact-menu-option-shortcut,:where(.ag-rtl) .ag-menu-option-shortcut{padding-left:var(--ag-spacing)}:where(.ag-ltr) .ag-compact-menu-option-popup-pointer,:where(.ag-ltr) .ag-menu-option-popup-pointer{padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-compact-menu-option-popup-pointer,:where(.ag-rtl) .ag-menu-option-popup-pointer{padding-left:var(--ag-spacing)}.ag-menu-column-select-wrapper{height:265px;overflow:auto;:where(.ag-column-select){height:100%}}.ag-menu:where(.ag-tabs){min-width:290px}.ag-context-menu-loading-icon{pointer-events:none;position:absolute}`]},mg=`.ag-column-select{display:flex;flex:3 1 0px;flex-direction:column;overflow:hidden;position:relative}.ag-column-select-header{align-items:center;display:flex;flex:none;gap:var(--ag-widget-horizontal-spacing);height:var(--ag-header-height);padding-left:var(--ag-widget-container-horizontal-padding);padding-right:var(--ag-widget-container-horizontal-padding);position:relative}.ag-column-select-column,.ag-column-select-column-group{align-items:center;display:flex;gap:var(--ag-widget-horizontal-spacing);height:100%;position:relative;&:where(:not(:last-child)){margin-bottom:var(--ag-widget-vertical-spacing)}}:where(.ag-ltr) .ag-column-select-column,:where(.ag-ltr) .ag-column-select-column-group{padding-left:calc(var(--ag-indentation-level)*var(--ag-column-select-indent-size))}:where(.ag-rtl) .ag-column-select-column,:where(.ag-rtl) .ag-column-select-column-group{padding-right:calc(var(--ag-indentation-level)*var(--ag-column-select-indent-size))}.ag-column-select-header-icon{border-radius:var(--ag-border-radius);cursor:pointer;height:var(--ag-icon-size);position:relative;width:var(--ag-icon-size);&:focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-column-select-header-filter-wrapper{flex:1 1 auto}.ag-column-select-header-filter{width:100%}.ag-column-select-list{flex:1 1 0px;overflow:hidden}:where(.ag-ltr) .ag-column-select-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-spacing)*1.5)}:where(.ag-rtl) .ag-column-select-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-spacing)*1.5)}.ag-column-select-column-group-readonly,.ag-column-select-column-readonly{opacity:.5;pointer-events:none;.ag-icon{opacity:.5}&.ag-icon-grip{opacity:.35}}.ag-column-select-column-readonly{&.ag-icon-grip,.ag-icon-grip{opacity:.35}}.ag-column-select-virtual-list-viewport{padding:calc(var(--ag-widget-container-vertical-padding)*.5) 0}.ag-column-select-virtual-list-item{padding:0 var(--ag-widget-container-horizontal-padding)}.ag-column-select-column-label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-column-select-checkbox{display:flex}`,hg=300,gg={tag:`div`,cls:`ag-column-select-header`,role:`presentation`,children:[{tag:`div`,ref:`eExpand`,cls:`ag-column-select-header-icon`},{tag:`ag-checkbox`,ref:`eSelect`,cls:`ag-column-select-header-checkbox`},{tag:`ag-input-text-field`,ref:`eFilterTextField`,cls:`ag-column-select-header-filter-wrapper`}]},AgPrimaryColsHeader=class extends K{constructor(){super(gg,[Pa,To]
5),this.eExpand=null,this.eSelect=null,this.eFilterTextField=null}postConstruct(){this.createExpandIcons(),this.addManagedListeners(this.eExpand,{click:this.onExpandClicked.bind(this),keydown:e=>{e.key===G.SPACE&&(e.preventDefault(),this.onExpandClicked())}}),this.addManagedElementListeners(this.eSelect.getInputElement(),{click:this.onSelectClicked.bind(this)}),this.addManagedPropertyListener(`functionsReadOnly`,()=>this.onFunctionsReadOnlyPropChanged()),this.eFilterTextField.setAutoComplete(!1).onValueChange(()=>this.onFilterTextChanged()),this.addManagedEventListeners({newColumnsLoaded:this.showOrHideOptions.bind(this)});let e=this.getLocaleTextFunc();this.eSelect.setInputAriaLabel(e(`ariaColumnSelectAll`,`Toggle All Columns Visibility`)),this.eFilterTextField.setInputAriaLabel(e(`ariaFilterColumnsInput`,`Filter Columns Input`)),this.activateTabIndex([this.eExpand])}onFunctionsReadOnlyPropChanged(){let e=this.gos.get(`functionsReadOnly`);this.eSelect.setReadOnly(e),this.eSelect.toggleCss(`ag-column-select-column-readonly`,e)}init(e){this.params=e;let t=this.gos.get(`functionsReadOnly`);this.eSelect.setReadOnly(t),this.eSelect.toggleCss(`ag-column-select-column-readonly`,t),this.beans.colModel.ready&&this.showOrHideOptions()}createExpandIcons(){let e=this.beans;this.eExpand.appendChild(this.eExpandChecked=J(`columnSelectOpen`,e)),this.eExpand.appendChild(this.eExpandUnchecked=J(`columnSelectClosed`,e)),this.eExpand.appendChild(this.eExpandIndeterminate=J(`columnSelectIndeterminate`,e)),this.setExpandState(0)}showOrHideOptions(){let e=this.params,t=!e.suppressColumnFilter,n=!e.suppressColumnSelectAll,r=!e.suppressColumnExpandAll,i=!!this.beans.colModel.colDefCols?.treeDepth,o=this.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(o(`searchOoo`,`Search...`)),W(this.eFilterTextField.getGui(),t),W(this.eSelect.getGui(),n),W(this.eExpand,r&&i)}onFilterTextChanged(){this.onFilterTextChangedDebounced||=hc(this,()=>{let e=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:`filterChanged`,filterText:e})},hg),this.onFilterTextChangedDebounced()}onSelectClicked(){this.dispatchLocalEvent({type:this.selectState?`unselectAll`:`selectAll`})}onExpandClicked(){this.dispatchLocalEvent({type:this.expandState===0?`collapseAll`:`expandAll`})}setExpandState(e){this.expandState=e,W(this.eExpandChecked,e===0),W(this.eExpandUnchecked,e===1),W(this.eExpandIndeterminate,e===2)}setSelectionState(e){this.selectState=e,this.eSelect.setValue(this.selectState)}},_g={selector:`AG-PRIMARY-COLS-HEADER`,component:AgPrimaryColsHeader};function isColGroupDef(e){return!!e&&e.children!==void 0}function getId(e){return isColGroupDef(e)?e.groupId:e.colId}function addChildrenToGroup(e,t,n){let subGroupIsSplit=(e,t)=>{let n=e.children.map(getId).includes(getId(t)),r=Kc(e.children),i=r&&getId(r)!==getId(t);return n&&i};if(!isColGroupDef(e))return!0;let r=e,i=n;if(subGroupIsSplit(r,i)||r.groupId===t&&!r.children.map(getId).includes(getId(i)))return r.children.push(i),!0;for(let e=r.children.length-1;e>=0&&!addChildrenToGroup(r.children[e],t,n);e--);return!1}function mergeLeafPathTrees(e){let matchingRootGroupIds=(e,t)=>isColGroupDef(e)&&isColGroupDef(t)&&getId(e)===getId(t),mergeTrees=(e,t)=>{if(!isColGroupDef(t))return e;let n=e,r=t;if(r.children&&r.groupId&&addChildrenToGroup(n,r.groupId,r.children[0]))return n;for(let e of r.children)mergeTrees(n,e);return n},t=[];for(let n=1;n<=e.length;n++){let r=e[n-1],i=e[n];matchingRootGroupIds(r,i)?e[n]=mergeTrees(r,i):t.push(r)}return t}function toolPanelCreateColumnTree(e,t){let n=[],createDummyColGroup=(t,r)=>{if(isColGroupDef(t)){let e=t,n=e.groupId===void 0?e.headerName:e.groupId,i=new ho(e,n,!1,r),o=[];for(let t of e.children){let e=createDummyColGroup(t,r+1);e&&o.push(e)}return i.setChildren(o),i}{let r=t,i=r.colId?r.colId:r.field,o=e.getColDefCol(i);return o||n.push(r),o}},r=[];for(let e of t){let t=createDummyColGroup(e,0);t&&r.push(t)}return n.length>0&&q(217,{invalidColIds:n}),r}function syncLayoutWithGrid(e,t){t(mergeLeafPathTrees(getLeafPathTrees(e)))}function getLeafPathTrees(e){let getLeafPathTree=(e,t)=>
5{let n;if(Tc(e)){if(e.isPadding())n=t;else{let r=Object.assign({},e.getColGroupDef());r.groupId=e.getGroupId(),r.children=[t],n=r}}else{let t=Object.assign({},e.getColDef());t.colId=e.getColId(),n=t}let r=e.getOriginalParent();return r?getLeafPathTree(r,n):n};return e.getCols().filter(e=>{let t=e.getColDef();return e.isPrimary()&&!t.showRowGroup}).map(e=>getLeafPathTree(e,e.getColDef()))}var ColumnModelItem=class{constructor(e,t,n,r=!1,i){this.displayName=e,this.depth=n,this.group=r,this.localEventService=new es,r?(this.columnGroup=t,this._expanded=i,this.children=[]):this.column=t}get expanded(){return!!this._expanded}set expanded(e){e!==this._expanded&&(this._expanded=e,this.localEventService.dispatchEvent({type:`expandedChanged`}))}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}};function selectAllChildren(e,t,n,r){setAllColumns(e,extractAllLeafColumns(t),n,r)}function setAllColumns(e,t,n,r){e.colModel.isPivotMode()?setAllPivot(e,t,n,r):setAllVisible(e,t,n,r)}function extractAllLeafColumns(e){let t=[],recursiveFunc=e=>{for(let n of e)n.passesFilter&&(n.group?recursiveFunc(n.children):t.push(n.column))};return recursiveFunc(e),t}function setAllVisible(e,t,n,r){let i=[];for(let e of t)e.getColDef().lockVisible||e.isVisible()!=n&&i.push({colId:e.getId(),hide:!n});i.length>0&&Es(e,{state:i},r)}function setAllPivot(e,t,n,r){setAllPivotActive(e,t,n,r)}function setAllPivotActive(e,t,n,r){let i=[],turnOnAction=t=>{if(!t.isAnyFunctionActive()){if(t.isAllowValue()){let n=typeof t.getAggFunc()==`string`?t.getAggFunc():e.aggFuncSvc?.getDefaultAggFunc(t);i.push({colId:t.getId(),aggFunc:n})}else t.isAllowRowGroup()?i.push({colId:t.getId(),rowGroup:!0}):t.isAllowPivot()&&i.push({colId:t.getId(),pivot:!0})}},turnOffAction=e=>{(e.isPivotActive()||e.isRowGroupActive()||e.isValueActive())&&i.push({colId:e.getId(),pivot:!1,rowGroup:!1,aggFunc:null})},o=n?turnOnAction:turnOffAction;t.forEach(o),i.length>0&&Es(e,{state:i},r)}function updateColumns(e,t){let{columns:n,visibleState:r,pivotState:i,eventType:o}=t,s=n.map(t=>{let n=t.getColId();if(e.colModel.isPivotMode()){let e=i?.[n];return{colId:n,pivot:e?.pivot,rowGroup:e?.rowGroup,aggFunc:e?.aggFunc}}return{colId:n,hide:!r?.[n]}});Es(e,{state:s},o)}function createPivotState(e){return{pivot:e.isPivotActive(),rowGroup:e.isRowGroupActive(),aggFunc:e.isValueActive()?e.getAggFunc():void 0}}function setRowNodeGroupValue(e,t,n,r){let i=t.getCol(n);e.groupData||={};let o=i.getColId(),s=e.groupData[o];s!==r&&(e.groupData[o]=r,e.dispatchCellChangedEvent(i,r,s))}function setRowNodeGroup(e,t,n){e.group!==n&&(e.group&&!n&&(e.expanded=!1),e.group=n,e.updateHasChildren(),t.selectionSvc?.updateRowSelectable(e),e.dispatchRowEvent(`groupChanged`))}function isRowGroupColLocked(e,t){let{gos:n,rowGroupColsSvc:r}=t;if(!r||!e)return!1;let i=n.get(`groupLockGroupColumns`);return!e.isRowGroupActive()||i===0?!1:i===-1||i>r.columns.findIndex(t=>t.getColId()===e.getColId())}function _getTextSelectionRanges(e){let t=$c(e),n=`getSelection`in t?t.getSelection():null,r=[];for(let e=0;e<(n?.rangeCount??0);e++){let t=n?.getRangeAt(e);t&&r.push(t)}return{selection:n,ranges:r}}function _preserveRangesWhile(e,t){if(!e.gos.get(`enableCellTextSelection`)||!No()&&!Uc())return t();let{selection:n,ranges:r}=_getTextSelectionRanges(e);t(),n?.removeAllRanges();for(let e of r)n?.addRange(e)}var AgMenuPanel=class extends gs{constructor(e){super(),this.setTemplateFromElement(e.getGui(),void 0,void 0,!0)}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)})}handleKeyDown(e){e.key===G.ESCAPE&&this.closePanel()}onTabKeyDown(e){e.defaultPrevented||(this.closePanel(),e.preventDefault())}closePanel(){let e=this.parentComponent;e.closeSubMenu(),setTimeout(()=>e.getGui().focus(),0)}};function getMenuItemCompDetails(e,t,n){return e.getCompDetails(t,vg,`agMenuItem`,n,!0)}var vg={name:`menuItem`,optionalMethods:[`setActive`,`select`,`setExpanded`,`configureDefaults`]},yg={tag:`div`,cls:`ag-menu`,role:`presentation`},AgMenuItemComponent=class extends U{constructor(){super(...arguments),this.ACTIVATION_DELAY=80,this.isActive=!1,this.subMenuIsOpen=!1,this.subMenuIsOpening=!1,this.suppressRootStyles=!0,this.suppressAria=!0,this.suppressFocus=!0}wireBeans(e){this.popupSvc=e.popupSvc,this.userCompFactory=e.userCompFactory,this.registry=e.registry}init(e){let{menuItemDef:t,isAnotherSubMenuOpen:n,level:r,childComponent:i,contextParams:o}=e;return this.params=e.menuItemDef,this.level=r,this.isAnotherSubMenuOpen=n,this.childComponent=i,this.contextParams=o,this.cssClassPrefix=this.params.menuItemParams?.cssClassPrefix??`ag-menu-option`,getMenuItemCompDetail
5s(this.userCompFactory,this.params,co(this.gos,{...t,level:r,isAnotherSubMenuOpen:n,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=>{this.menuItemComp=e;let t=e.configureDefaults?.();t&&this.configureDefaults(t===!0?void 0:t)})??eo.resolve()}addListeners(e,t){t?.suppressClick||this.addManagedElementListeners(e,{click:e=>this.onItemSelected(e)}),t?.suppressKeyboardSelect||this.addManagedElementListeners(e,{keydown:e=>{(e.key===G.ENTER||e.key===G.SPACE)&&(e.preventDefault(),this.onItemSelected(e))}}),t?.suppressMouseDown||this.addManagedElementListeners(e,{mousedown:e=>{e.stopPropagation(),e.preventDefault()}}),t?.suppressMouseOver||this.addManagedElementListeners(e,{mouseenter:()=>this.onMouseEnter(),mouseleave:()=>this.onMouseLeave()})}isDisabled(){return!!this.params.disabled}openSubMenu(e=!1,t){if(this.closeSubMenu(),!this.params.subMenu)return;this.subMenuIsOpening=!0;let n=Dl(yg);this.eSubMenuGui=n;let destroySubMenu,afterGuiAttached=()=>{this.subMenuIsOpening=!1};if(this.childComponent){let e=this.createBean(new AgMenuPanel(this.childComponent));e.setParentComponent(this);let t=e.getGui(),r=`mouseenter`,mouseEnterListener=()=>this.cancelDeactivate();t.addEventListener(r,mouseEnterListener),destroySubMenu=()=>{t.removeEventListener(r,mouseEnterListener),this.destroyBean(e)},n.appendChild(t),this.childComponent.afterGuiAttached&&(afterGuiAttached=()=>{this.childComponent.afterGuiAttached(),this.subMenuIsOpening=!1})}else if(this.params.subMenu){let t=this.createBean(new AgMenuList(this.level+1,this.contextParams));t.setParentComponent(this),t.addMenuItems(this.params.subMenu),n.appendChild(t.getGui()),this.addManagedListeners(t,{closeMenu:e=>this.dispatchLocalEvent(e)}),t.addGuiEventListener(`mouseenter`,()=>this.cancelDeactivate()),destroySubMenu=()=>this.destroyBean(t),e&&(afterGuiAttached=()=>{t.activateFirstItem(),this.subMenuIsOpening=!1})}let{popupSvc:r}=this,positionCallback=()=>{let e=this.eGui,{column:i,node:o}=this.contextParams;r?.positionPopupForMenu({eventSource:e,ePopup:n,event:t instanceof MouseEvent?t:void 0,column:i,rowNode:o})},i=this.getLocaleTextFunc(),o=r?.addPopup({modal:!0,eChild:n,positionCallback,anchorToElement:this.eGui,ariaLabel:i(`ariaLabelSubMenu`,`SubMenu`),afterGuiAttached});this.subMenuIsOpen=!0,this.setAriaExpanded(!0),this.hideSubMenu=()=>{o&&o.hideFunc(),this.subMenuIsOpen=!1,this.setAriaExpanded(!1),destroySubMenu(),this.menuItemComp.setExpanded?.(!1),this.eSubMenuGui=void 0},this.menuItemComp.setExpanded?.(!0)}setAriaExpanded(e){this.suppressAria||to(this.eGui,e)}closeSubMenu(){this.hideSubMenu&&(this.hideSubMenu(),this.hideSubMenu=null,this.setAriaExpanded(!1))}isSubMenuOpen(){return this.subMenuIsOpen}isSubMenuOpening(){return this.subMenuIsOpening}activate(e,t){this.cancelActivate(),!(this.params.disabled&&!t)&&(this.isActive=!0,this.suppressRootStyles||this.eGui.classList.add(`${this.cssClassPrefix}-active`),this.menuItemComp.setActive?.(!0),this.suppressFocus||_preserveRangesWhile(this.beans,()=>this.eGui.focus({preventScroll:!t})),e&&this.params.subMenu&&window.setTimeout(()=>{this.isAlive()&&this.isActive&&this.openSubMenu()},300),this.onItemActivated())}deactivate(){this.cancelDeactivate(),this.suppressRootStyles||this.eGui.classList.remove(`${this.cssClassPrefix}-active`),this.menuItemComp.setActive?.(!1),this.isActive=!1,this.subMenuIsOpen&&this.closeSubMenu()}getGui(){return this.menuItemComp.getGui()}getParentComponent(){return this.parentComponent}setParentComponent(e){this.parentComponent=e}getSubMenuGui(){return this.eSubMenuGui}onItemSelected(e){this.menuItemComp.select?.(),this.params.action?this.beans.frameworkOverrides.wrapOutgoing(()=>this.params.action(co(this.gos,{...this.contextParams}))):this.openSubMenu(e&&e.type===`keydown`,e),!(this.params.subMenu&&!this.params.action||this.params.suppressCloseOnSelect)&&this.closeMenu(e)}closeMenu(e){let t={type:`closeMenu`};e&&(e instanceof MouseEvent?t.mouseEvent=e:t.keyboardEvent=e),this.dispatchLocalEvent(t)}onItemActivated(){let e={type:`menuItemActivated`,menuItem:this};this.dispatchLocalEvent(e)}cancelActivate(){this.activateTimeoutId&&=(window.clearTimeout(this.activateTimeoutId),0)}cancelDeactivate(){this.deactivateTimeoutId&&=(window.clearTimeout(this.deactivateTimeoutId),0)}onMouseEnter(){this.cancelDeactivate(),this.isAnotherSubMenuOpen()?this.activateTimeoutId=window.setTimeout(()=>this.activate(!0),this.ACTIVATION_DELAY):this.activate(!0)}onMouseLeave(){this.cancelActivate(),this.isSubMenuOpen()?this.deactivateTimeoutId=window.setTimeout(()=>this.deactivate(),this.ACTIVATION_DELAY):this.deactivate()}
5refreshRootElementGui(e){let t=this.menuItemComp.getGui(),{cssClassPrefix:n,params:{cssClasses:r,disabled:i}}=this,o=this.menuItemComp.getRootElement?.();if(o&&(e||t.classList.add(`ag-menu-option-custom`),t=o),this.suppressRootStyles=!!e,!this.suppressRootStyles){t.classList.add(n);for(let e of r??[])t.classList.add(e);i&&t.classList.add(`${n}-disabled`)}return t}applyAriaProperties(e){let{params:{checked:t,subMenu:n,subMenuRole:r,disabled:i}}=this;cs(e,t==null?`menuitem`:`menuitemcheckbox`),n&&go(e,r??`menu`),i&&Ba(e,!0)}configureDefaults(e){if(!this.menuItemComp){setTimeout(()=>this.configureDefaults(e));return}let{suppressRootStyles:t,suppressTooltip:n,suppressAria:r,suppressTabIndex:i,suppressFocus:o}=e||{},{params:{tooltip:s,disabled:c}}=this,p=this.eGui=this.refreshRootElementGui(!!t);this.suppressAria=!!r,r||this.applyAriaProperties(p),i||p.setAttribute(`tabindex`,`-1`),n||this.refreshTooltip(s),c||this.addListeners(p,e),this.suppressFocus=!!o}refreshTooltip(e,t){if(this.tooltip=e,this.tooltipFeature=this.destroyBean(this.tooltipFeature),!e||!this.menuItemComp)return;let n=this.registry.createDynamicBean(`tooltipFeature`,!1,{getGui:()=>this.getGui(),getTooltipValue:()=>this.tooltip,getLocation:()=>`menu`,shouldDisplayTooltip:t});n&&(this.tooltipFeature=this.createBean(n))}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),this.menuItemComp?.destroy?.(),super.destroy()}},AgMenuList=class extends gs{constructor(e=0,t){super({tag:`div`,cls:`ag-menu-list`,role:`menu`}),this.level=e,this.menuItems=[],this.params=t??{column:null,node:null,value:null}}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>_preserveRangesWhile(this.beans,()=>this.handleKeyDown(e)),onFocusIn:e=>this.handleFocusIn(e),onFocusOut:e=>this.handleFocusOut(e)})}onTabKeyDown(e){this.getParentComponent()?.getGui()?.classList.contains(`ag-focus-managed`)||e.preventDefault(),e.shiftKey&&this.closeIfIsChild(e)}handleKeyDown(e){switch(e.key){case G.UP:case G.RIGHT:case G.DOWN:case G.LEFT:e.preventDefault(),this.handleNavKey(e.key);break;case G.ESCAPE:this.closeIfIsChild()&&ua(e)}}handleFocusIn(e){let t=e.relatedTarget;!this.tabGuardFeature.getTabGuardCtrl().isTabGuard(t)&&(this.getGui().contains(t)||this.activeMenuItem?.getSubMenuGui()?.contains(t))||(this.activeMenuItem?this.activeMenuItem.activate():this.activateFirstItem())}handleFocusOut(e){let t=e.relatedTarget;!this.activeMenuItem||this.getGui().contains(t)||this.activeMenuItem.getSubMenuGui()?.contains(t)||this.activeMenuItem.isSubMenuOpening()||this.activeMenuItem.deactivate()}clearActiveItem(){this.activeMenuItem&&=(this.activeMenuItem.deactivate(),null)}addMenuItems(e){e!=null&&eo.all(e.map(e=>e===`separator`?eo.resolve({eGui:this.createSeparator()}):typeof e==`string`?(q(228,{menuItemOrString:e}),eo.resolve({eGui:null})):this.addItem(e))).then(e=>{for(let t of e??[])t?.eGui&&(this.appendChild(t.eGui),t.comp&&this.menuItems.push(t.comp))})}addItem(e){let t=this.createManagedBean(new AgMenuItemComponent);return t.init({menuItemDef:e,isAnotherSubMenuOpen:()=>this.menuItems.some(e=>e.isSubMenuOpen()),level:this.level,contextParams:this.params}).then(()=>(t.setParentComponent(this),this.addManagedListeners(t,{closeMenu:e=>{this.dispatchLocalEvent(e)},menuItemActivated:e=>{this.activeMenuItem&&this.activeMenuItem!==e.menuItem&&this.activeMenuItem.deactivate(),this.activeMenuItem=e.menuItem}}),{comp:t,eGui:t.getGui()}))}activateFirstItem(){let e=this.menuItems.filter(e=>!e.isDisabled())[0];e&&e.activate()}createSeparator(){let e={tag:`div`,cls:`ag-menu-separator-part`};return Dl({tag:`div`,cls:`ag-menu-separator`,attrs:{"aria-hidden":`true`},children:[e,e,e,e]})}handleNavKey(e){switch(e){case G.UP:case G.DOWN:{let t=this.findNextItem(e===G.UP);t&&t!==this.activeMenuItem&&t.activate(!1,!0);return}}e===(this.gos.get(`enableRtl`)?G.RIGHT:G.LEFT)?this.closeIfIsChild():this.openChild()}closeIfIsChild(e){let t=this.getParentComponent();return t&&t instanceof AgMenuItemComponent?(e&&e.preventDefault(),t.closeSubMenu(),t.getGui().focus(),!0):!1}openChild(){this.activeMenuItem&&this.activeMenuItem.openSubMenu(!0)}findNextItem(e){let t=[...this.menuItems];if(!t.length)return;if(!this.activeMenuItem)return e?Kc(t):t[0];e&&t.reverse();let n,r=!1;for(let e of t){if(!r){e===this.activeMenuItem&&(r=!0);continue}n=e;break}return r&&!n?t[0]:n||this.activeMenuItem}destroy(){this.clearActiveItem(),super.destroy()}},ToolPanelContextMenu=class extends K{constructor(e,t,n){super({tag:`div`,cls:`ag-menu`}),this.column=e,this.mouseEventOrTouch=t,this.parentEl=n,this.displayName=null}postConstruct(){let{column:e,beans:{colNames:t}}=this;this.initializeProperties(e);let n;if(n=pc(e)?t.getDisplayNameForColumn(e,`columnToolPanel`):t.getDisplayNameForProvidedColumnGroup(null,e,`columnToolPanel`),this.displayName=n,this.buildMenuItemMap(),this.isActive()){let e=this.mouseEventOrTouch;`preventDefault`in e&&e.preventDefault();let t=this.getMappedMenuItems();if(t.length===0)return;this.displayContextMenu(t)}}initializeProperties(e){let t;t=Tc(e)?e.getLeafColumns():[e],this.columns=t;let n=this.beans.colModel.isPivotMode();this.allowScrollIntoView=!n&&t.some(this.isColumnValidForScrollIntoView),this.allowGrouping=t.some(e=>e.isPrimary()&&e.isAllowRowGroup()),this.allowValues=t.some(e=>e.isPrimary()&&e.isAllowValue()),this.allowPivoting=n&&t.some(e=>e.isPrimary()&&e.isAllowPivot())}buildMenuItemMap(){let e=this.getLocaleTextFunc(),{beans:t,displayName:n}=this,{rowGroupColsSvc:r,valueColsSvc:i,pivotColsSvc:o,colModel:s}=t,c=new Map;this.menuItemMap=c;let p=s.isPivotMode();c.set(`scrollIntoView`,{allowedFunction:e=>!e.isPinned()&&!p&&this.isColumnValidForScrollIntoView(e),activeFunction:()=>!1,activateLabel:()=>
5e(`scrollColumnIntoView`,`Scroll ${n} into View`,[n]),activateFunction:()=>{let e=this.columns.find(this.isColumnValidForScrollIntoView);e&&this.beans.ctrlsSvc.getScrollFeature().ensureColumnVisible(e)},deActivateFunction:()=>{},addIcon:`ensureColumnVisible`});let rowGroupAllowed=e=>e.isPrimary()&&e.isAllowRowGroup()&&!isRowGroupColLocked(e,t);c.set(`rowGroup`,{allowedFunction:rowGroupAllowed,activeFunction:e=>e.isRowGroupActive(),activateLabel:()=>`${e(`groupBy`,`Group by`)} ${n}`,deactivateLabel:()=>`${e(`ungroupBy`,`Un-Group by`)} ${n}`,activateFunction:()=>r?.setColumns(this.addColumnsToList(r.columns,rowGroupAllowed),`toolPanelUi`),deActivateFunction:()=>r?.setColumns(this.removeColumnsFromList(r.columns,rowGroupAllowed),`toolPanelUi`),addIcon:`menuAddRowGroup`,removeIcon:`menuRemoveRowGroup`});let valueAllowed=e=>e.isPrimary()&&e.isAllowValue();c.set(`value`,{allowedFunction:valueAllowed,activeFunction:e=>e.isValueActive(),activateLabel:()=>e(`addToValues`,`Add ${n} to values`,[n]),deactivateLabel:()=>e(`removeFromValues`,`Remove ${n} from values`,[n]),activateFunction:()=>i?.setColumns(this.addColumnsToList(i.columns,valueAllowed),`toolPanelUi`),deActivateFunction:()=>i?.setColumns(this.removeColumnsFromList(i.columns,valueAllowed),`toolPanelUi`),addIcon:`valuePanel`,removeIcon:`valuePanel`});let pivotAllowed=e=>p&&e.isPrimary()&&e.isAllowPivot();c.set(`pivot`,{allowedFunction:pivotAllowed,activeFunction:e=>e.isPivotActive(),activateLabel:()=>e(`addToLabels`,`Add ${n} to labels`,[n]),deactivateLabel:()=>e(`removeFromLabels`,`Remove ${n} from labels`,[n]),activateFunction:()=>o?.setColumns(this.addColumnsToList(o.columns,pivotAllowed),`toolPanelUi`),deActivateFunction:()=>o?.setColumns(this.removeColumnsFromList(o.columns,pivotAllowed),`toolPanelUi`),addIcon:`pivotPanel`,removeIcon:`pivotPanel`})}isColumnValidForScrollIntoView(e){if(!e.isVisible())return!1;let t=e.getParent();return t?t.getDisplayedChildren()?.includes(e)??!0:!0}addColumnsToList(e,t){return[...e].concat(this.columns.filter(n=>t(n)&&!e.includes(n)))}removeColumnsFromList(e,t){return e.filter(e=>t(e)&&this.columns.includes(e))}displayContextMenu(e){let t=this.getGui(),n=this.createBean(new AgMenuList),r=this.getLocaleTextFunc(),hideFunc=()=>{};t.appendChild(n.getGui()),n.addMenuItems(e),n.addManagedListeners(n,{closeMenu:()=>{this.parentEl.focus(),hideFunc()}});let i=this.beans.popupSvc,o=i.addPopup({modal:!0,eChild:t,closeOnEsc:!0,afterGuiAttached:()=>ja(n.getGui()),ariaLabel:r(`ariaLabelContextMenu`,`Context Menu`),closedCallback:e=>{e instanceof KeyboardEvent&&this.parentEl.focus(),this.destroyBean(n)}});o&&(hideFunc=o.hideFunc),i.positionPopupUnderMouseEvent({type:`columnContextMenu`,mouseEvent:this.mouseEventOrTouch,ePopup:t})}isActive(){return this.allowScrollIntoView||this.allowGrouping||this.allowValues||this.allowPivoting}getMappedMenuItems(){let e=[],{menuItemMap:t,columns:n,displayName:r,beans:i}=this;for(let o of t.values()){let t=n.some(e=>o.allowedFunction(e)&&!o.activeFunction(e)),s=n.some(e=>o.allowedFunction(e)&&o.activeFunction(e));t&&e.push({name:o.activateLabel(r),icon:J(o.addIcon,i,null),action:()=>o.activateFunction()}),s&&o.removeIcon&&o.deactivateLabel&&e.push({name:o.deactivateLabel(r),icon:J(o.removeIcon,i,null),action:()=>o.deActivateFunction?.()})}return e}},bg={tag:`div`,cls:`ag-column-select-column-group`,children:[{tag:`span`,ref:`eColumnGroupIcons`,cls:`ag-column-group-icons`,children:[{tag:`span`,ref:`eGroupClosedIcon`,cls:`ag-column-group-closed-icon`},{tag:`span`,ref:`eGroupOpenedIcon`,cls:`ag-column-group-opened-icon`}]},{tag:`ag-checkbox`,ref:`cbSelect`,cls:`ag-column-select-checkbox`},{tag:`span`,ref:`eLabel`,cls:`ag-column-select-column-label`}]},ToolPanelColumnGroupComp=class extends K{constructor(e,t,n,r){super(),this.modelItem=e,this.allowDragging=t,this.eventType=n,this.focusWrapper=r,this.cbSelect=null,this.eLabel=null,this.eGroupOpenedIcon=null,this.eGroupClosedIcon=null,this.eColumnGroupIcons=null,this.processingColumnStateChange=!1;let{columnGroup:i,depth:o,displayName:s}=e;this.columnGroup=i,this.columnDepth=o,this.displayName=s}postConstruct(){this.setTemplate(bg,[Pa]);let{beans:e,cbSelect:t,eLabel:n,displayName:r,columnDepth:i,modelItem:o,focusWrapper:s,columnGroup:c}=this,{registry:p,gos:m}=e,h=J(`columnDrag`,e);this.eDragHandle=h,h.classList.add(`ag-drag-handle`,`ag-column-select-column-group-drag-handle`);
5let g=t.getGui(),_=t.getInputElement();g.after(h),_.setAttribute(`tabindex`,`-1`),n.textContent=r??``,this.setupExpandContract(),this.addCss(`ag-column-select-indent-`+i),this.getGui().style.setProperty(`--ag-indentation-level`,String(i)),this.tooltipFeature=this.createOptionalManagedBean(p.createDynamicBean(`tooltipFeature`,!1,{getGui:()=>this.focusWrapper,getLocation:()=>`columnToolPanelColumnGroup`,shouldDisplayTooltip:Jl(m,()=>n)})),this.addManagedEventListeners({columnPivotModeChanged:this.onColumnStateChanged.bind(this)}),this.addManagedElementListeners(n,{click:this.onLabelClicked.bind(this)}),this.addManagedListeners(t,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedListeners(o,{expandedChanged:this.onExpandChanged.bind(this)});let v=new xs(this.getGui(),!1);this.addManagedListeners(v,{longTap:e=>this.onContextMenu(e.touchStart)}),this.addDestroyFunc(v.destroy.bind(v)),this.addManagedListeners(s,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip();let y=La(c.getColGroupDef(),m,null,c);for(let e of y)this.toggleCss(e,!0)}getColumns(){return this.columnGroup.getLeafColumns()}setupTooltip(){let e=this.columnGroup.getColGroupDef();if(!e)return;let refresh=()=>this.tooltipFeature?.setTooltipAndRefresh(e.headerTooltip);refresh(),this.addManagedEventListeners({newColumnsLoaded:refresh})}handleKeyDown(e){switch(e.key){case G.LEFT:e.preventDefault(),this.modelItem.expanded=!1;break;case G.RIGHT:e.preventDefault(),this.modelItem.expanded=!0;break;case G.SPACE:e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected())}}onContextMenu(e){let{columnGroup:t,gos:n}=this;if(n.get(`functionsReadOnly`))return;let r=this.createBean(new ToolPanelContextMenu(t,e,this.focusWrapper));this.addDestroyFunc(()=>{r.isAlive()&&this.destroyBean(r)})}addVisibilityListenersToAllChildren(){let e=this.onColumnStateChanged.bind(this);for(let t of this.columnGroup.getLeafColumns())this.addManagedListeners(t,{visibleChanged:e,columnValueChanged:e,columnPivotChanged:e,columnRowGroupChanged:e})}setupDragging(){if(!this.allowDragging){W(this.eDragHandle,!1);return}let e=this.beans,{gos:t,eventSvc:n,dragAndDrop:r}=e,i=!t.get(`suppressDragLeaveHidesColumns`),o={type:kl.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>i?`hide`:`notAllowed`,getDragItem:()=>this.createDragItem(),onDragStarted:()=>{i=!t.get(`suppressDragLeaveHidesColumns`),n.dispatchEvent({type:`columnPanelItemDragStart`,column:this.columnGroup})},onDragStopped:()=>{n.dispatchEvent({type:`columnPanelItemDragEnd`})},onGridEnter:t=>{i&&updateColumns(e,{columns:this.columnGroup.getLeafColumns(),visibleState:t?.visibleState,pivotState:t?.pivotState,eventType:this.eventType})},onGridExit:()=>{i&&this.onChangeCommon(!1)}};r.addDragSource(o,!0),this.addDestroyFunc(()=>r.removeDragSource(o))}createDragItem(){let e=this.columnGroup.getLeafColumns(),t={},n={};for(let r of e){let e=r.getId();t[e]=r.isVisible(),n[e]=createPivotState(r)}return{columns:e,visibleState:t,pivotState:n}}setupExpandContract(){let{beans:e,eGroupClosedIcon:t,eGroupOpenedIcon:n,eColumnGroupIcons:r}=this;t.appendChild(qc(`columnSelectClosed`,e,null)),n.appendChild(qc(`columnSelectOpen`,e,null));let i=this.onExpandOrContractClicked.bind(this);this.addManagedElementListeners(t,{click:i}),this.addManagedElementListeners(n,{click:i});let o=new xs(r,!0);this.addManagedListeners(o,{tap:i}),this.addDestroyFunc(o.destroy.bind(o))}onLabelClicked(){let e=!this.cbSelect.getValue();this.onChangeCommon(e)}onCheckboxChanged(e){this.onChangeCommon(e.selected)}getVisibleLeafColumns(){let e=[],extractCols=t=>{for(let n of t)n.passesFilter&&(n.group?extractCols(n.children):e.push(n.column))};return extractCols(this.modelItem.children),e}onChangeCommon(e){this.refreshAriaLabel(),!this.processingColumnStateChange&&selectAllChildren(this.beans,this.modelItem.children,e,this.eventType)}refreshAriaLabel(){let{cbSelect:e,focusWrapper:t,displayName:n}=this,r=this.getLocaleTextFunc(),i=r(`ariaColumnGroup`,`Column Group`),o=e.getValue(),s=o===void 0?r(`ariaIndeterminate`,`indeterminate`):o?r(`ariaVisible`,`visible`):r(`ariaHidden`,`hidden`),c=r(`ariaToggleVisibility`,`Press SPACE to toggle visibility`);ou(t,`${n} ${i}`),e.setInputAriaLabel(`${c} (${s}
5)`),Io(t,e.getInputElement().id)}onColumnStateChanged(){let e=this.workOutSelectedValue(),t=this.workOutReadOnlyValue();this.processingColumnStateChange=!0;let n=this.cbSelect;n.setValue(e),n.setReadOnly(t),this.toggleCss(`ag-column-select-column-group-readonly`,t),this.processingColumnStateChange=!1}workOutSelectedValue(){let e=this.beans.colModel.isPivotMode(),t=this.getVisibleLeafColumns(),n=0,r=0;for(let i of t)(e||!i.getColDef().lockVisible)&&(this.isColumnChecked(i,e)?n++:r++);if(!(n>0&&r>0))return n>0}workOutReadOnlyValue(){let e=this.beans.colModel.isPivotMode(),t=0;for(let n of this.columnGroup.getLeafColumns())e?n.isAnyFunctionAllowed()&&t++:n.getColDef().lockVisible||t++;return t===0}isColumnChecked(e,t){if(t){let t=e.isPivotActive(),n=e.isRowGroupActive(),r=e.isValueActive();return t||n||r}return e.isVisible()}onExpandOrContractClicked(){let e=this.modelItem;e.expanded=!e.expanded}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){let e=this.modelItem.expanded;W(this.eGroupClosedIcon,!e),W(this.eGroupOpenedIcon,e)}refreshAriaExpanded(){to(this.focusWrapper,this.modelItem.expanded)}getDisplayName(){return this.displayName}onSelectAllChanged(e){let t=this.cbSelect,n=t.getValue();!t.isReadOnly()&&(e&&!n||!e&&n)&&t.toggle()}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}setSelected(e){this.cbSelect.setValue(e,!0)}},getCurrentColumnsBeingMoved=e=>Tc(e)?e.getLeafColumns():e?[e]:[],getMoveTargetIndex=(e,t,n,r)=>{if(!n||!t)return null;let i=e.colModel.getCols(),o=i.indexOf(n),s=r?o:o+1;return s-getMoveDiff(i,t,s)},getMoveDiff=(e,t,n)=>{if(!t)return 0;let r=t[0],i=t.length;return e.indexOf(r)<n?i:0},isMoveBlocked=(e,t,n)=>e.get(`suppressMovableColumns`)||t.colModel.isPivotMode()?!0:!!n.find(({colDef:e})=>!!e.suppressMovable||!!e.lockPosition),moveItem=(e,t,n)=>{if(!n)return;let{component:r}=n,i=null,o=n.position===`top`;if(r instanceof ToolPanelColumnGroupComp?(i=r.getColumns()[0],o=!0):r&&(i=r.column),!i)return;let s=getMoveTargetIndex(e,t,i,o);s!=null&&e.colMoves?.moveColumns(t,s,`toolPanelUi`)},getCurrentDragValue=e=>e.column,xg={tag:`div`,cls:`ag-column-select-column`,children:[{tag:`ag-checkbox`,ref:`cbSelect`,cls:`ag-column-select-checkbox`},{tag:`span`,ref:`eLabel`,cls:`ag-column-select-column-label`}]},ToolPanelColumnComp=class extends K{constructor(e,t,n,r){super(),this.modelItem=e,this.allowDragging=t,this.groupsExist=n,this.focusWrapper=r,this.eLabel=null,this.cbSelect=null,this.processingColumnStateChange=!1;let{column:i,depth:o,displayName:s}=e;this.column=i,this.columnDepth=o,this.displayName=s}postConstruct(){this.setTemplate(xg,[Pa]);let{beans:e,cbSelect:t,displayName:n,eLabel:r,columnDepth:i,groupsExist:o,column:s,gos:c,focusWrapper:p}=this,m=J(`columnDrag`,e);this.eDragHandle=m,m.classList.add(`ag-drag-handle`,`ag-column-select-column-drag-handle`);let h=t.getGui(),g=t.getInputElement();h.after(m),g.setAttribute(`tabindex`,`-1`),r.textContent=n,o&&this.addCss(`ag-column-select-add-group-indent`),this.addCss(`ag-column-select-indent-${i}`),this.getGui().style.setProperty(`--ag-indentation-level`,String(i)),this.tooltipFeature=this.createOptionalManagedBean(e.registry.createDynamicBean(`tooltipFeature`,!1,{getGui:()=>this.focusWrapper,getLocation:()=>`columnToolPanelColumn`,shouldDisplayTooltip:Jl(c,()=>r),getAdditionalParams:()=>({colDef:s.getColDef()})})),this.setupDragging();let _=this.onColumnStateChanged.bind(this);this.addManagedEventListeners({columnPivotModeChanged:_}),this.addManagedListeners(s,{columnValueChanged:_,columnPivotChanged:_,columnRowGroupChanged:_,visibleChanged:_}),this.addManagedListeners(p,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)});let v=new xs(p);this.addManagedListeners(v,{longTap:e=>this.onContextMenu(e.touchStart)}),this.addDestroyFunc(v.destroy.bind(v)),this.addManagedPropertyListener(`functionsReadOnly`,this.onColumnStateChanged.bind(this)),this.addManagedListeners(t,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedElementListeners(r,{click:this.onLabelClicked.bind(this)}),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip();let y=La(s.getColDef(),c,s,null);for(let e of y)this.toggleCss(e,!0)}getColumn(){return this.column}setupTooltip(){let refresh=()=>this.tooltipFeature?.setTooltipAndRefresh(this.column.getColDef().headerTooltip);refresh(),this.addManagedEventListeners({newColumnsLoaded:refresh})}
5onContextMenu(e){let{column:t,gos:n}=this;if(n.get(`functionsReadOnly`))return;let r=this.createBean(new ToolPanelContextMenu(t,e,this.focusWrapper));this.addDestroyFunc(()=>{r.isAlive()&&this.destroyBean(r)})}handleKeyDown(e){e.key===G.SPACE&&(e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected()))}onLabelClicked(){if(this.gos.get(`functionsReadOnly`))return;let e=!this.cbSelect.getValue();this.onChangeCommon(e)}onCheckboxChanged(e){this.onChangeCommon(e.selected)}onChangeCommon(e){this.cbSelect.isReadOnly()||(this.refreshAriaLabel(),!this.processingColumnStateChange&&setAllColumns(this.beans,[this.column],e,`toolPanelUi`))}refreshAriaLabel(){let{cbSelect:e,focusWrapper:t,displayName:n}=this,r=this.getLocaleTextFunc(),i=r(`ariaColumn`,`Column`),o=e.getValue()?r(`ariaVisible`,`visible`):r(`ariaHidden`,`hidden`),s=r(`ariaToggleVisibility`,`Press SPACE to toggle visibility`);ou(t,`${n} ${i}`),this.cbSelect.setInputAriaLabel(`${s} (${o})`),Io(t,e.getInputElement().id)}setupDragging(){let e=this.eDragHandle;if(!this.allowDragging){W(e,!1);return}let t=this.beans,{gos:n,eventSvc:r,dragAndDrop:i}=t,o=!n.get(`suppressDragLeaveHidesColumns`),s={type:kl.ToolPanel,eElement:e,dragItemName:this.displayName,getDefaultIconName:()=>o?`hide`:`notAllowed`,getDragItem:()=>this.createDragItem(),onDragStarted:()=>{o=!n.get(`suppressDragLeaveHidesColumns`),r.dispatchEvent({type:`columnPanelItemDragStart`,column:this.column})},onDragStopped:()=>{r.dispatchEvent({type:`columnPanelItemDragEnd`})},onGridEnter:e=>{o&&updateColumns(t,{columns:[this.column],visibleState:e?.visibleState,pivotState:e?.pivotState,eventType:`toolPanelUi`})},onGridExit:()=>{o&&this.onChangeCommon(!1)}};i.addDragSource(s,!0),this.addDestroyFunc(()=>i.removeDragSource(s))}createDragItem(){let e=this.column.getColId(),t={[e]:this.column.isVisible()},n={[e]:createPivotState(this.column)};return{columns:[this.column],visibleState:t,pivotState:n}}onColumnStateChanged(){this.processingColumnStateChange=!0;let e=this.beans.colModel.isPivotMode();if(e){let e=this.column.isAnyFunctionActive();this.cbSelect.setValue(e)}else this.cbSelect.setValue(this.column.isVisible());let t=!0,n=!0;if(e){let e=this.gos.get(`functionsReadOnly`),r=!this.column.isAnyFunctionAllowed();t=!e&&!r,n=t}else{let{enableRowGroup:e,enableValue:r,lockPosition:i,suppressMovable:o,lockVisible:s}=this.column.getColDef(),c=!!e||!!r,p=!!i||!!o;t=!s,n=c||!p}this.cbSelect.setReadOnly(!t),this.eDragHandle.classList.toggle(`ag-column-select-column-readonly`,!n),this.toggleCss(`ag-column-select-column-readonly`,!n&&!t),this.cbSelect.setPassive(!1),this.processingColumnStateChange=!1}getDisplayName(){return this.displayName}onSelectAllChanged(e){let t=this.cbSelect;e!==t.getValue()&&(t.isReadOnly()||t.toggle())}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}isExpandable(){return!1}setExpanded(e){q(158)}},UIColumnModel=class{constructor(e){this.items=e}getRowCount(){return this.items.length}getRow(e){return this.items[e]}},Sg=`ag-column-select-list`,AgPrimaryColsList=class extends K{constructor(){super({tag:`div`,cls:Sg,role:`presentation`}),this.destroyColumnItemFuncs=[],this.hasLoadedInitialState=!1,this.isInitialState=!1,this.skipRefocus=!1}wireBeans(e){this.colModel=e.colModel}destroy(){this.destroyColumnTree(),super.destroy()}destroyColumnTree(){this.allColsTree=[];for(let e of this.destroyColumnItemFuncs)e();this.destroyColumnItemFuncs=[]}init(e,t,n){this.params=e;let{suppressSyncLayoutWithGrid:r,contractColumnSelection:i,suppressColumnMove:o}=e;this.allowDragging=t,this.eventType=n,r||this.addManagedEventListeners({columnMoved:this.onColumnsChanged.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.onColumnsChanged.bind(this)});let s=this.fireSelectionChangedEvent.bind(this);this.addManagedEventListeners({columnPivotChanged:s,columnPivotModeChanged:s,columnRowGroupChanged:s,columnValueChanged:s,columnVisible:s,newColumnsLoaded:s}),this.expandGroupsByDefault=!i;let c=o||r,p=this.createManagedBean(new VirtualList({cssIdentifier:`column-select`,ariaRole:`tree`,moveItemCallback:(e,t)=>{c||this.moveItems(e,t)}}));this.virtualList=p,this.appendChild(p.getGui()),p.setComponentCreator((e,t)=>(ps(t,e.depth+1),this.createComponentFromItem(e,t))),this.colModel.ready&&this.onColumnsChanged(),!c&&this.createItemDragFeature
5()}createItemDragFeature(){let{gos:e,beans:t,eventSvc:n,virtualList:r}=this;this.createManagedBean(new VirtualListDragFeature(this,r,{dragSourceType:kl.ToolPanel,listItemDragStartEvent:`columnPanelItemDragStart`,listItemDragEndEvent:`columnPanelItemDragEnd`,eventSource:n,getCurrentDragValue:e=>getCurrentDragValue(e),isMoveBlocked:n=>isMoveBlocked(e,t,getCurrentColumnsBeingMoved(n)),getNumRows:e=>e.getDisplayedColsList().length,moveItem:(e,n)=>moveItem(t,getCurrentColumnsBeingMoved(e),n)}))}moveItems(e,t){let{gos:n,beans:r}=this,{modelItem:i}=e,{group:o,columnGroup:s,column:c,expanded:p}=i,m=getCurrentColumnsBeingMoved(o?s:c);if(isMoveBlocked(n,r,m))return;let h=this.displayedColsList.indexOf(i),g=t?-1:1,_=0;if(t){let t=e.columnDepth>0?c.getParent()?.getChildren():null;t?.length&&c===t[0]&&(_=-1)}else o&&(_=p?i.children.length:0);let v=Math.min(Math.max(h+_+g,0),this.displayedColsList.length-1);this.skipRefocus=!0,moveItem(r,m,{rowIndex:v,position:t?`top`:`bottom`,component:this.virtualList.getComponentAt(v)}),this.focusRowIfAlive(v-_).then(()=>{this.skipRefocus=!1})}createComponentFromItem(e,t){let n=this.allowDragging;if(e.group){let r=new ToolPanelColumnGroupComp(e,n,this.eventType,t);return this.createBean(r),r}let r=new ToolPanelColumnComp(e,n,this.groupsExist,t);return this.createBean(r),r}onColumnsChanged(){let e=this.params;this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!e.initialState);let t=this.getExpandedStates(),n=this.colModel.isPivotMode();!e.suppressSyncLayoutWithGrid&&!n?this.buildTreeFromWhatGridIsDisplaying():this.buildTreeFromProvidedColumnDefs(),this.setExpandedStates(t),this.markFilteredColumns(),this.flattenAndFilterModel(),this.isInitialState=!1}getDisplayedColsList(){return this.displayedColsList}getExpandedStates(){let e={};if(this.isInitialState){let{expandedGroupIds:t}=this.params.initialState;for(let n of t)e[n]=!0;return e}return this.allColsTree?(this.forEachItem(t=>{if(!t.group)return;let n=t.columnGroup;n&&(e[n.getId()]=t.expanded)}),e):{}}setExpandedStates(e){if(!this.allColsTree)return;let{isInitialState:t}=this;this.forEachItem(n=>{if(!n.group)return;let r=n.columnGroup;if(r){let i=e[r.getId()];(i!=null||t)&&(n.expanded=!!i)}})}buildTreeFromWhatGridIsDisplaying(){syncLayoutWithGrid(this.colModel,this.setColumnLayout.bind(this))}setColumnLayout(e){let t=toolPanelCreateColumnTree(this.colModel,e);this.buildListModel(t),this.groupsExist=e.some(e=>e&&e.children!==void 0),this.markFilteredColumns(),this.flattenAndFilterModel()}buildTreeFromProvidedColumnDefs(){let e=this.colModel;this.buildListModel(e.getColDefColTree()),this.groupsExist=!!e.colDefCols?.treeDepth}buildListModel(e){let t=this.onColumnExpanded.bind(this),addListeners=e=>{e.addEventListener(`expandedChanged`,t);let n=e.removeEventListener.bind(e,`expandedChanged`,t);this.destroyColumnItemFuncs.push(n)},n=this.beans.colNames,recursivelyBuild=(e,t,n)=>{for(let r of e)Tc(r)?createGroupItem(r,t,n):createColumnItem(r,t,n)},createGroupItem=(e,t,r)=>{if(e.getColGroupDef()?.suppressColumnsToolPanel)return;if(e.isPadding()){recursivelyBuild(e.getChildren(),t,r);return}let i=new ColumnModelItem(n.getDisplayNameForProvidedColumnGroup(null,e,`columnToolPanel`),e,t,!0,this.expandGroupsByDefault);r.push(i),addListeners(i),recursivelyBuild(e.getChildren(),t+1,i.children)},createColumnItem=(e,t,r)=>{if(e.getColDef()?.suppressColumnsToolPanel)return;let i=n.getDisplayNameForColumn(e,`columnToolPanel`);r.push(new ColumnModelItem(i,e,t))};this.destroyColumnTree(),recursivelyBuild(e,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];let recursiveFunc=e=>{e.passesFilter&&(this.displayedColsList.push(e),e.group&&e.expanded&&e.children.forEach(recursiveFunc))},e=this.virtualList;this.allColsTree.forEach(recursiveFunc),e.setModel(new UIColumnModel(this.displayedColsList));let t=null;this.skipRefocus||(t=e.getLastFocusedRow()),e.refresh(),t!=null&&this.focusRowIfAlive(t),this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){let e=this.getLocaleTextFunc(),t=e(`ariaColumnPanelList`,`Column List`),n=e(`columns`,`Columns`),r=this.displayedColsList.length;ou(this.virtualList.getAriaElement(),`${t} ${r} ${n}`)}focusRowIfAlive(e){return e===-1?Promise.resolve():new Promise(t=>{window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(e),t()},0)})}forEachItem(e){let recursiveFunc=t=>{for(let n of t)e(n),n.group&&recursiveFunc(n.children)},t=this.allColsTree;t&&recursiveFunc(t)}doSetExpandedAll(e){this.forEachItem(t=>{t.group&&(t.expanded=e)})}setGroupsExpanded(e,t){if(!t){this.doSetExpandedAll(e);return}let n=[];this.forEachItem(r=>{if(!r.group)return;let i=r.columnGroup.getId();t.indexOf(i)>=0&&(r.expanded=e,n.push(i))});let r=t.filter(e=>!n.includes(e));r.length>0&&q(157,{unrecognisedGroupIds:r})}getExpandState(){let e=0,t=0;return this.forEachItem(n=>{n.group&&(n.expanded?e++:t++)}),e>0&&t>0?2:+(t>0)}doSetSelectedAll(e){selectAllChildren(this.beans,this.allColsTree,e,this.eventType)}getSelectionState(){let e=0,t=0,n=this.colModel.isPivotMode();if(this.forEachItem(r=>{if(r.group||!r.passesFilter)return;let i=r.column,o=i.getColDef(),s;
5if(n){if(!i.isAllowPivot()&&!i.isAllowRowGroup()&&!i.isAllowValue())return;s=i.isValueActive()||i.isPivotActive()||i.isRowGroupActive()}else{if(o.lockVisible)return;s=i.isVisible()}s?e++:t++}),!(e>0&&t>0))return!(e===0||t>0)}setFilterText(e){this.filterText=Xs(e)?e.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){let passesFilter=e=>{if(!Xs(this.filterText))return!0;let t=e.displayName;return t==null||t.toLowerCase().indexOf(this.filterText)!==-1},recursivelyCheckFilter=(e,t)=>{let n=!1;if(e.group){let r=passesFilter(e);for(let i of e.children){let e=recursivelyCheckFilter(i,r||t);e&&(n=e)}}let r=t||n?!0:passesFilter(e);return e.passesFilter=r,r};for(let e of this.allColsTree)recursivelyCheckFilter(e,!1)}notifyListeners(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()}fireGroupExpandedEvent(){let e=this.getExpandState();this.dispatchLocalEvent({type:`groupExpanded`,state:e})}fireSelectionChangedEvent(){if(!this.allColsTree)return;let e=this.getSelectionState();this.dispatchLocalEvent({type:`selectionChanged`,state:e})}getExpandedGroups(){let e=[];return this.allColsTree&&this.forEachItem(t=>{t.group&&t.expanded&&e.push(t.columnGroup.getId())}),e}},Cg={selector:`AG-PRIMARY-COLS-LIST`,component:AgPrimaryColsList},wg={tag:`div`,cls:`ag-column-select`,children:[{tag:`ag-primary-cols-header`,ref:`primaryColsHeaderPanel`},{tag:`ag-primary-cols-list`,ref:`primaryColsListPanel`}]},AgPrimaryCols=class extends K{constructor(){super(wg,[_g,Cg]),this.primaryColsHeaderPanel=null,this.primaryColsListPanel=null,this.registerCSS(mg)}init(e,t,n){let{primaryColsHeaderPanel:r,primaryColsListPanel:i}=this;r.init(t);let o=t.suppressColumnFilter,s=t.suppressColumnSelectAll;t.suppressColumnExpandAll&&o&&s&&r.setDisplayed(!1),this.addManagedListeners(i,{groupExpanded:e=>{r.setExpandState(e.state),t.onStateUpdated()},selectionChanged:e=>r.setSelectionState(e.state)}),i.init(t,e,n),this.addManagedListeners(r,{expandAll:i.doSetExpandedAll.bind(i,!0),collapseAll:i.doSetExpandedAll.bind(i,!1),selectAll:i.doSetSelectedAll.bind(i,!0),unselectAll:i.doSetSelectedAll.bind(i,!1),filterChanged:e=>i.setFilterText(e.filterText)}),this.positionableFeature=this.createManagedBean(new Na(this.getGui(),{minHeight:100}))}toggleResizable(e){this.positionableFeature.setResizable(e?{bottom:!0}:!1)}expandGroups(e){this.primaryColsListPanel.setGroupsExpanded(!0,e)}collapseGroups(e){this.primaryColsListPanel.setGroupsExpanded(!1,e)}setColumnLayout(e){this.primaryColsListPanel.setColumnLayout(e)}syncLayoutWithGrid(){this.primaryColsListPanel.onColumnsChanged()}getExpandedGroups(){return this.primaryColsListPanel.getExpandedGroups()}},Tg=`.ag-column-panel{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.ag-pivot-mode-panel{display:flex;height:var(--ag-header-height)}.ag-pivot-mode-select{align-items:center;display:flex}:where(.ag-ltr) .ag-pivot-mode-select{margin-left:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-pivot-mode-select{margin-right:var(--ag-widget-container-horizontal-padding)}.ag-column-panel-column-select{border-bottom:var(--ag-tool-panel-separator-border)}.ag-column-panel-column-select:where(:nth-child(n+2 of :not(.ag-hidden))){border-top:var(--ag-tool-panel-separator-border)}:where(.ag-column-panel) .ag-column-drop-vertical{flex:1 1 0px;min-height:50px;&:where(:not(.ag-last-column-drop)){border-bottom:var(--ag-tool-panel-separator-border)}}`,ColumnToolPanel=class extends K{constructor(){super({tag:`div`,cls:`ag-column-panel`}),this.initialised=!1,this.childDestroyFuncs=[],this.registerCSS(Tg)}wireBeans(e){this.colToolPanelFactory=e.colToolPanelFactory}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}init(e){let t={...co(this.gos,{suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1}),...e};this.params=t;let{childDestroyFuncs:n,colToolPanelFactory:r,gos:i}=this,o=i.isModuleRegistered(`SharedPivot`),s=o||i.isModuleRegistered(`SharedRowGrouping`);!t.suppressPivotMode&&r&&o&&(this.pivotModePanel=r.createPivotModePanel(this,n));let c=this.createBean(new AgPrimaryCols);if(this.primaryColsPanel=c,n.push(()=>this.destroyBean(this.primaryColsPanel)),c.init(!0,t,`toolPanelUi`),c.addCss(`ag-column-p
5anel-column-select`),this.appendChild(c),r){!t.suppressRowGroups&&s&&(this.rowGroupDropZonePanel=r.createRowGroupPanel(this,n)),!t.suppressValues&&s&&(this.valuesDropZonePanel=r.createValuesPanel(this,n)),!t.suppressPivots&&o&&(this.pivotDropZonePanel=r.createPivotPanel(this,n)),this.setLastVisible();let[e]=this.addManagedEventListeners({columnPivotModeChanged:()=>{this.resetChildrenHeight(),this.setLastVisible()}});n.push(()=>e())}this.initialised=!0}setPivotModeSectionVisible(e){let t=this.colToolPanelFactory;t&&(this.pivotModePanel=t.setPanelVisible(this.pivotModePanel,e,t.createPivotModePanel.bind(t,this,this.childDestroyFuncs,!0)),this.setLastVisible())}setRowGroupsSectionVisible(e){let t=this.colToolPanelFactory;t&&(this.rowGroupDropZonePanel=t.setPanelVisible(this.rowGroupDropZonePanel,e,t.createRowGroupPanel.bind(t,this,this.childDestroyFuncs)),this.setLastVisible())}setValuesSectionVisible(e){let t=this.colToolPanelFactory;t&&(this.valuesDropZonePanel=t.setPanelVisible(this.valuesDropZonePanel,e,t.createValuesPanel.bind(t,this,this.childDestroyFuncs)),this.setLastVisible())}setPivotSectionVisible(e){let t=this.colToolPanelFactory;t&&(this.pivotDropZonePanel=t.setPanelVisible(this.pivotDropZonePanel,e,t.createPivotPanel.bind(t,this,this.childDestroyFuncs)),this.pivotDropZonePanel?.setDisplayed(e),this.setLastVisible())}setResizers(){for(let e of[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel]){if(!e)continue;let t=e.getGui();e.toggleResizable(!t.classList.contains(`ag-last-column-drop`)&&!t.classList.contains(`ag-hidden`))}}setLastVisible(){let e=this.getGui(),t=Array.prototype.slice.call(e.querySelectorAll(`.ag-column-drop`));for(let e of t)e.classList.remove(`ag-last-column-drop`);let n=e.querySelectorAll(`.ag-column-drop:not(.ag-hidden)`),r=Kc(n);r&&r.classList.add(`ag-last-column-drop`),this.setResizers()}resetChildrenHeight(){let e=this.getGui().children;for(let t=0;t<e.length;t++){let{style:n}=e[t];n.removeProperty(`height`),n.removeProperty(`flex`)}}expandColumnGroups(e){this.primaryColsPanel.expandGroups(e)}collapseColumnGroups(e){this.primaryColsPanel.collapseGroups(e)}setColumnLayout(e){this.primaryColsPanel.setColumnLayout(e)}syncLayoutWithGrid(){this.primaryColsPanel.syncLayoutWithGrid()}destroyChildren(){let e=this.childDestroyFuncs;for(let t of e)t();e.length=0,Ml(this.getGui())}refresh(e){return this.destroyChildren(),this.init(e),!0}getState(){return{expandedGroupIds:this.primaryColsPanel.getExpandedGroups()}}destroy(){this.destroyChildren(),super.destroy()}},Eg=`.ag-column-drop{align-items:center;display:inline-flex;overflow:auto;position:relative;width:100%}.ag-column-drop-list{align-items:center;display:flex}.ag-column-drop-cell{align-items:center;background-color:var(--ag-column-drop-cell-background-color);border:var(--ag-column-drop-cell-border);border-radius:500px;color:var(--ag-column-drop-cell-text-color);display:flex;padding:calc(var(--ag-spacing)*.25);position:relative;&:focus-visible{box-shadow:var(--ag-focus-shadow)}:where(.ag-drag-handle){color:var(--ag-column-drop-cell-drag-handle-color)}}:where(.ag-ltr) .ag-column-drop-cell{padding-left:calc(var(--ag-spacing)*.75)}:where(.ag-rtl) .ag-column-drop-cell{padding-right:calc(var(--ag-spacing)*.75)}.ag-column-drop-cell-text{flex:1 1 auto;margin:0 var(--ag-spacing);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-column-drop-vertical{align-items:stretch;display:flex;flex-direction:column;min-height:75px;overflow:hidden}.ag-column-drop-vertical-title-bar{align-items:center;display:flex;flex:none;padding:var(--ag-widget-container-vertical-padding) calc(var(--ag-spacing)*2) 0}.ag-column-drop-vertical-list{align-items:stretch;flex-direction:column;flex-grow:1;overflow-x:auto;padding-bottom:var(--ag-spacing);padding-left:var(--ag-spacing);padding-right:var(--ag-spacing);position:relative;>*{flex:none}}:where(.ag-column-drop-empty) .ag-column-drop-vertical-list{overflow:hidden}.ag-column-drop-cell-button{cursor:pointer;min-width:0;opacity:.75;&:hover{opacity:1}}:where(.ag-ltr) .ag-column-drop-cell-button{margin-right:calc(var(--ag-spacing)/4)}:where(.ag-rtl) .ag-column-drop-cell-button{margin-left:calc(var(--ag-spacing)/4)}:where(.ag-ltr) .ag-column-drop-cell-drag-handle{margin-left:calc(var(--ag-spacing)/4)}:where(.ag-rtl) .ag-column-drop-cell-drag-handle{margin-right:calc(var(--ag-spacing)/4)}.ag-column-drop-wrapper{display:flex}.ag-column-drop-horizontal-half-width{width:50%!important}.ag-column-drop-cell-ghost{opacity:.5}.ag-column-drop-horizontal{background-color:var(--ag-header-background-color);border-bottom:var(--ag-header-row-border);gap:var(--ag-cell-widget-spacing);height:var(--ag-header-height);overflow:hidden;white-space:nowrap}:where(.ag-ltr) .ag-column-drop-horizontal{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-column-drop-horizontal{padding-right:var(--ag-cell-horizontal-padding)}.ag-column-drop-horizontal-list{gap:var(--ag-cell-widget-spacing)}.ag-column-drop-vertical-cell{margin-top:var(--ag-spacing)}:where(.ag-ltr) .ag-column-drop-vertical-icon{margin-right:var(--ag-widget-horizontal-spacing)}:where(.ag-rtl) .ag-column-drop-vertical-icon{margin-left:var(--ag-widget-horizontal-spacing)}.ag-select-agg-func-popup{background:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);
5height:calc(var(--ag-spacing)*5*3.5);padding:0;position:absolute}.ag-select-agg-func-virtual-list-item{cursor:default;&:hover{background-color:var(--ag-selected-row-background-color)}}:where(.ag-ltr) .ag-select-agg-func-virtual-list-item{padding-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-select-agg-func-virtual-list-item{padding-right:calc(var(--ag-spacing)*2)}:where(.ag-ltr) .ag-column-drop-horizontal-half-width:where(:not(:last-child)){border-right:solid var(--ag-border-width) var(--ag-border-color)}:where(.ag-rtl) .ag-column-drop-horizontal-half-width:where(:not(:last-child)){border-left:solid var(--ag-border-width) var(--ag-border-color)}`;function _insertArrayIntoArray(e,t,n){e!=null&&t!=null&&e.splice(n,0,...t)}var Dg={tag:`div`,cls:`ag-unselectable`,role:`presentation`},PillDropZonePanel=class extends K{constructor(e){super(Dg),this.horizontal=e,this.state=`notDragging`,this.guiDestroyFunctions=[],this.childPillComponents=[],this.resizeEnabled=!1,this.addElementClasses(this.getGui()),this.ePillDropList=Dl({tag:`div`}),this.addElementClasses(this.ePillDropList,`list`),this.registerCSS(Eg)}toggleResizable(e){this.positionableFeature.setResizable(e?{bottom:!0}:!1),this.resizeEnabled=e}isSourceEventFromTarget(e){let{dropZoneTarget:t,dragSource:n}=e;return t.contains(n.eElement)}destroy(){this.destroyGui(),super.destroy()}destroyGui(){for(let e of this.guiDestroyFunctions)e();this.guiDestroyFunctions.length=0,this.childPillComponents.length=0,Ml(this.getGui()),Ml(this.ePillDropList)}init(e){this.params=e??{},this.createManagedBean(new Yl(this.getFocusableElement(),{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.onKeyDown.bind(this)})),this.setupDropTarget(),this.positionableFeature=new Na(this.getGui()),this.createManagedBean(this.positionableFeature),this.refreshGui(),ou(this.ePillDropList,this.getAriaLabel())}onTabKeyDown(e){let t=Zl(this.getFocusableElement(),null,!0),n=t.length;if(n===0)return;let{shiftKey:r}=e,i=Lo(this.beans),o=i===t[0],s=i===Kc(t);n===1||o&&r||s&&!r||t[r?0:n-1].focus()}onKeyDown(e){let{key:t}=e,n=!this.horizontal,r=t===G.DOWN,i=t===G.UP;if(!n){let e=this.gos.get(`enableRtl`);r=!e&&t===G.RIGHT||e&&t===G.LEFT,i=!e&&t===G.LEFT||e&&t===G.RIGHT}if(!(!r&&!i)){if(e.preventDefault(),e.shiftKey)this.moveFocusedItem(i);else{let e=Qo(this.beans,this.getFocusableElement(),!1,i);e&&e.focus()}}}moveFocusedItem(e){let t=this.getFocusedItem();if(t===-1)return;let n=e?-1:1;if(!this.normalizeAndUpdateInsertIndex(t,t+n))return;let r=this.childPillComponents[t];if(!r.isMovable())return;let i=r.getItem();this.focusItemAtIndex(this.insertIndex),this.rearrangeItems([i],!0)}addElementClasses(e,t){t=t?`-${t}`:``;let n=this.horizontal?`horizontal`:`vertical`;e.classList.add(`ag-column-drop${t}`,`ag-column-drop-${n}${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),onDragCancel:this.onDragCancel.bind(this),isInterestedIn:this.isInterestedIn.bind(this)},this.beans.dragAndDrop?.addDropTarget(this.dropTarget)}minimumAllowedNewInsertIndex(){return 0}checkInsertIndex(e){let t=this.getNewInsertIndex(e);return t<0?!1:this.normalizeAndUpdateInsertIndex(this.insertIndex,t)}normalizeAndUpdateInsertIndex(e,t){let n=this.minimumAllowedNewInsertIndex(),r=Math.max(n,t),i=r!==e;return i&&(this.insertIndex=r),i}getNewInsertIndex(e){let t=e.event,n=this.horizontal?t.clientX:t.clientY,r=this.childPillComponents.map(e=>e.getGui().getBoundingClientRect()),i=r.findIndex(e=>this.horizontal?e.right>n&&e.left<n:e.top<n&&e.bottom>n);if(i===-1){let e=this.gos.get(`enableRtl`);return r.every(e=>n>(this.horizontal?e.right:e.bottom))?e&&this.horizontal?0:this.childPillComponents.length:r.every(e=>n<(this.horizontal?e.left:e.top))?e&&this.horizontal?this.childPillComponents.length:0:this.insertIndex}return this.insertIndex<=i?i+1:i}checkDragStartedBySelf(e){this.state===`notDragging`&&(this.state=`rearrangeItems`,this.potentialDndItems=this.getItems(e.dragSource.getDragItem()),this.refreshGui(),this.checkInsertIndex(e),this.refreshGui())}onDragging(e){this.checkDragStartedBySelf(e),this.checkInsertIndex(e)&&this.refreshGui()}handleDragEnterEnd(e){}onDragEnter(e){let t=this.getItems(e.dragSource.getDragItem());this.state=`newItemsIn`;let n=t.filter(t=>this.isItemDroppable(t,e)),r=n.every(e=>this.childPillComponents.map(e=>e.getItem()).indexOf(e)!==-1);if(n.length!==0){if(this.potentialDndItems=n,r){this.state=`notDragging`;return}this.handleDragEnterEnd(e),this.checkInsertIndex(e),this.refreshGui()}}isPotentialDndItems(){return!!this.potentialDndItems?.length}handleDragLeaveEnd(e){}onDragLeave(e){if(this.state===`rearrangeItems`){let t=this.getItems(e.dragSource.getDragItem());this.removeItems(t)}this.isPotentialDndItems()&&(this.handleDragLeaveEnd(e),this.potentialDndItems=[],this.refreshGui()),this.state=`notDragging`}
5onDragCancel(e){this.isPotentialDndItems()&&(this.state===`newItemsIn`&&this.handleDragLeaveEnd(e),this.potentialDndItems=[],this.refreshGui()),this.state=`notDragging`}onDragStop(){this.isPotentialDndItems()&&(this.state===`newItemsIn`?this.addItems(this.potentialDndItems):this.rearrangeItems(this.potentialDndItems),this.potentialDndItems=[],this.refreshGui()),this.state=`notDragging`}removeItems(e){let t=this.getExistingItems().filter(t=>!e.includes(t));this.updateItems(t)}addItems(e){if(!e)return;let t=this.getExistingItems().slice();_insertArrayIntoArray(t,e.filter(e=>t.indexOf(e)<0),this.insertIndex),this.updateItems(t)}addItem(e){this.insertIndex=this.getExistingItems().length,this.addItems([e]),this.refreshGui()}rearrangeItems(e,t){let n;return n=t?this.getExistingItems().filter(t=>e.indexOf(t)===-1):this.getNonGhostItems().slice(),_insertArrayIntoArray(n,e,this.insertIndex),!pa(n,this.getExistingItems())&&(this.updateItems(n),!0)}refreshGui(){let e=0;this.horizontal||(e=this.ePillDropList.scrollTop);let t=this.resizeEnabled,n=this.getFocusedItem(),{eGridDiv:r}=this.beans,i=qa(),o=null;i&&(o=Qo(this.beans,r)??Qo(this.beans,r,!1,!0)),this.toggleResizable(!1),this.destroyGui(),this.addIconAndTitleToGui(),this.addEmptyMessageToGui(),this.addItemsToGui(),e!==0&&(this.ePillDropList.scrollTop=e),t&&this.toggleResizable(t),i&&this.restoreFocus(n,o)}getFocusedItem(){let e=this.getGui(),t=Lo(this.beans);return e.contains(t)?Array.from(e.querySelectorAll(`.ag-column-drop-cell`)).indexOf(t):-1}focusItemAtIndex(e){let t=this.getGui(),n=Array.from(t.querySelectorAll(`.ag-column-drop-cell`))[e];n&&n.focus({preventScroll:!0})}restoreFocus(e,t){let n=this.getGui(),r=Array.from(n.querySelectorAll(`.ag-column-drop-cell`));if(e===-1)return;r.length===0&&t.focus();let i=r[Math.min(r.length-1,e)];i&&i.focus()}focusList(e){let t=e?this.childPillComponents.length-1:0;this.restoreFocus(t,this.getFocusableElement())}getNonGhostItems(){let e=this.getExistingItems();return this.isPotentialDndItems()?e.filter(e=>!this.potentialDndItems.includes(e)):e}addItemsToGui(){let e=this.getNonGhostItems().map(e=>this.createItemComponent(e,!1));if(this.isPotentialDndItems()){let 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(){let{childPillComponents:e,ePillDropList:t}=this,n=e.length;cs(t,n===0?`presentation`:`listbox`);for(let t=0;t<n;t++){let r=e[t].getGui();Xa(r,t+1),uo(r,n)}}createItemComponent(e,t){let n=this.createPillComponent(e,this.dropTarget,t,this.horizontal);return n.addEventListener(`columnRemove`,this.removeItems.bind(this,[e])),this.createBean(n),this.guiDestroyFunctions.push(()=>this.destroyBean(n)),t||this.childPillComponents.push(n),n}addIconAndTitleToGui(){let{title:e,icon:t}=this.params;if(!e||!t)return;let n=Dl({tag:`div`});if(Ko(n,!0),this.addElementClasses(n,`title-bar`),this.addElementClasses(t,`icon`),this.toggleCss(`ag-column-drop-empty`,this.isExistingItemsEmpty()),n.appendChild(t),!this.horizontal){let t=Dl({tag:`span`});this.addElementClasses(t,`title`),t.textContent=e,n.appendChild(t)}this.appendChild(n)}isExistingItemsEmpty(){return this.getExistingItems().length===0}addEmptyMessageToGui(){let{emptyMessage:e}=this.params;if(!e||!this.isExistingItemsEmpty()||this.isPotentialDndItems())return;let t=Dl({tag:`span`});t.textContent=e,this.addElementClasses(t,`empty-message`),this.ePillDropList.appendChild(t)}addArrow(e){if(this.horizontal){let t=this.gos.get(`enableRtl`),n=J(t?`panelDelimiterRtl`:`panelDelimiter`,this.beans);this.addElementClasses(n,`cell-separator`),e.appendChild(n)}}},Og={tag:`span`,role:`option`,children:[{tag:`span`,ref:`eDragHandle`,cls:`ag-drag-handle ag-column-drop-cell-drag-handle`,role:`presentation`},{tag:`span`,ref:`eText`,cls:`ag-column-drop-cell-text`,attrs:{"aria-hidden":`true`}},{tag:`span`,ref:`eButton`,cls:`ag-column-drop-cell-button`,role:`presentation`}]},PillDragComp=class extends K{constructor(e,t,n,r,i){super(),this.dragSourceDropTarget=e,this.ghost=t,this.horizontal=n,this.template=r,this.agComponents=i,this.eText=null,this.eDragHandle=null,this.eButton=null}postConstruct(){this.setTemplate(this.template??Og,this.agComponents);let e=this.getGui(),{beans:t,eDragHandle:n,eText:r,eButton:i}=this;this.addElementClasses(e),this.addElementClasses(n,`drag-handle`),this.addElementClasses(r,`text`),this.addElementClasses(i,`button`),n.appendChild(J(`columnDrag`,t)),i.appendChild(J(`cancel`,t)),this.tooltipFeature=this.createOptionalManagedBean(t.registry.createDynamicBean(`tooltipFeature`,!1,{getGui:()=>this.getGui()})),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(){let e=this.getLocaleTextFunc(),t=[this.getAriaDisplayName()];this.addAdditionalAriaInstructions(t,e),ou(this.getGui(),t.join(`. `))}addAdditionalAriaInstructions(e,t){if(this.isRemovable()){let n=t(`ariaDropZoneColumnComponentDescription`,`Press DELETE to remove`);e.push(n)}}setupTooltip(){let refresh=()=>this.tooltipFeature?.setTooltipAndRefresh(this.getTooltip());refresh(),this.addManagedEventListeners({newColumnsLoaded:refresh})}getDragSourceId(){}getDefaultIconName(){return`notAllowed`}addDragSource(){let{beans:{dragAndDrop:e},eDragHandle:t}=this,n=this.createGetDragItem(),r=this.getDefaultIconName(),i={type:this.getDragSourceType(),sourceId:this.getDragSourceId(),eElement:t,getDefaultIconName:()=>r,getDragItem:n,dragItemName:this.getDisplayName()};e?.addDragSource(i,!0),this.addDestroyFunc(()=>e?.removeDragSource(i))}setupComponents(){this.eText.textContent=this.getDisplayValue(),this.setupRemove(),this.ghost&&this.addCss(`ag-column-drop-cell-ghost`)}isRemovable(){return!0}refreshRemove(){W(this.eButton,this.isRemovable())}setupRemove(){this.refreshRemove();let e={type:`columnRemove`};
5this.addGuiEventListener(`keydown`,e=>this.onKeyDown(e)),this.addManagedElementListeners(this.eButton,{click:t=>{this.dispatchLocalEvent(e),t.stopPropagation()}});let t=new xs(this.eButton);this.addManagedListeners(t,{tap:()=>this.dispatchLocalEvent(e)}),this.addDestroyFunc(t.destroy.bind(t))}onKeyDown(e){e.key===G.DELETE&&this.isRemovable()&&(e.preventDefault(),this.dispatchLocalEvent({type:`columnRemove`}))}getDisplayValue(){return this.getDisplayName()}addElementClasses(e,t){t=t?`-${t}`:``;let n=this.horizontal?`horizontal`:`vertical`;e.classList.add(`ag-column-drop-cell${t}`,`ag-column-drop-${n}-cell${t}`)}destroy(){super.destroy(),this.dragSourceDropTarget=null}},DropZoneColumnComp=class extends PillDragComp{constructor(e,t,n,r,i){super(t,n,i),this.column=e,this.dropZonePurpose=r,this.eSortIndicator=null,this.popupShowing=!1}postConstruct(){let{sortSvc:e,colNames:t}=this.beans;this.template={tag:`span`,role:`option`,children:[{tag:`span`,ref:`eDragHandle`,cls:`ag-drag-handle ag-column-drop-cell-drag-handle`,role:`presentation`},{tag:`span`,ref:`eText`,cls:`ag-column-drop-cell-text`,attrs:{"aria-hidden":`true`}},e?{tag:`ag-sort-indicator`,ref:`eSortIndicator`}:void 0,{tag:`span`,ref:`eButton`,cls:`ag-column-drop-cell-button`,role:`presentation`}]},e&&(this.agComponents=[e.getSortIndicatorSelector()]),this.displayName=t.getDisplayNameForColumn(this.column,`columnDrop`),super.postConstruct(),e&&(this.setupSort(),this.addManagedEventListeners({sortChanged:()=>{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){let n=this.gos.get(`rowGroupPanelSuppressSort`),r=this.gos.get(`functionsReadOnly`);if(this.isAggregationZone()&&!r){let n=t(`ariaDropZoneColumnValueItemDescription`,`Press ENTER to change the aggregation type`);e.push(n)}if(this.isGroupingZone()&&this.column.isSortable()&&!n){let n=t(`ariaDropZoneColumnGroupItemDescription`,`Press ENTER to sort`);e.push(n)}super.addAdditionalAriaInstructions(e,t)}isMovable(){return this.isDraggable()}isDraggable(){return this.isReadOnly()}isRemovable(){return this.isReadOnly()}isReadOnly(){return!this.isGroupingAndLocked()&&!this.gos.get(`functionsReadOnly`)}getAriaDisplayName(){let e=this.getLocaleTextFunc(),{name:t,aggFuncName:n}=this.getColumnAndAggFuncName(),r=e(`ariaDropZoneColumnComponentAggFuncSeparator`,` of `),i={asc:e(`ariaDropZoneColumnComponentSortAscending`,`ascending`),desc:e(`ariaDropZoneColumnComponentSortDescending`,`descending`)},o=this.column.getSort(),s=this.gos.get(`rowGroupPanelSuppressSort`);return[n&&`${n}${r}`,t,this.isGroupingZone()&&!s&&o&&`, ${i[o]}`].filter(e=>!!e).join(``)}getColumnAndAggFuncName(){let e=this.displayName,t=``;if(this.isAggregationZone()){let e=this.column.getAggFunc(),n=typeof e==`string`?e:`agg`;t=this.getLocaleTextFunc()(n,n)}return{name:e,aggFuncName:t}}setupSort(){if(!(!this.column.isSortable()||!this.isGroupingZone())&&!this.gos.get(`rowGroupPanelSuppressSort`)){this.eSortIndicator.setupSort(this.column,!0);let performSort=e=>{e.preventDefault(),this.beans.sortSvc.progressSortFromEvent(this.column,e)};this.addGuiEventListener(`click`,performSort),this.addGuiEventListener(`keydown`,e=>{e.key===G.ENTER&&this.isGroupingZone()&&performSort(e)})}}getDefaultIconName(){return`hide`}createGetDragItem(){let{column:e}=this;return()=>{let 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===G.ENTER&&this.isAggregationZone()&&!this.gos.get(`functionsReadOnly`)&&(e.preventDefault(),this.onShowAggFuncSelection())}getDisplayValue(){let{name:e,aggFuncName:t}=this.getColumnAndAggFuncName();return this.isAggregationZone()?`${t}(${e})`:e}
5onShowAggFuncSelection(){if(this.popupShowing)return;this.popupShowing=!0;let{aggFuncSvc:e,popupSvc:t}=this.beans,n=new VirtualList({cssIdentifier:`select-agg-func`}),r=e.getFuncNames(this.column),i=this.getGui(),o=n.getGui();n.setModel({getRow:function(e){return r[e]},getRowCount:function(){return r.length}}),this.createBean(n);let s=Dl({tag:`div`,cls:`ag-select-agg-func-popup`});s.style.top=`0px`,s.style.left=`0px`,s.appendChild(o),s.style.width=`${i.clientWidth}px`;let[c]=this.addManagedElementListeners(s,{focusout:e=>{!s.contains(e.relatedTarget)&&m&&m.hideFunc()}}),popupHiddenFunc=e=>{this.destroyBean(n),this.popupShowing=!1,e?.key===`Escape`&&i.focus(),c&&c()},p=this.getLocaleTextFunc(),m=t.addPopup({modal:!0,eChild:s,closeOnEsc:!0,closedCallback:popupHiddenFunc,ariaLabel:p(`ariaLabelAggregationFunction`,`Aggregation Function`)});m&&n.setComponentCreator(this.createAggSelect.bind(this,m.hideFunc)),n.addGuiEventListener(`keydown`,e=>{if(e.key===G.ENTER||e.key===G.SPACE){let e=n.getLastFocusedRow();if(e==null)return;let t=n.getComponentAt(e);t&&t.selectItem()}}),t.positionPopupByComponent({type:`aggFuncSelect`,eventSource:i,ePopup:s,keepWithinBounds:!0,column:this.column,position:`under`}),n.refresh();let h=r.findIndex(e=>e===this.column.getAggFunc());h===-1&&(h=0),n.focusRow(h)}createAggSelect(e,t){let itemSelected=()=>{e(),this.getGui().focus(),this.beans.valueColsSvc?.setColumnAggFunc?.(this.column,t,`toolPanelDragAndDrop`)},n=this.getLocaleTextFunc(),r=t.toString();return new AggItemComp(itemSelected,n(r,r))}isGroupingAndLocked(){return this.isGroupingZone()&&isRowGroupColLocked(this.column,this.beans)}isAggregationZone(){return this.dropZonePurpose===`aggregation`}isGroupingZone(){return this.dropZonePurpose===`rowGroup`}getDragSourceType(){return kl.ToolPanel}destroy(){super.destroy(),this.column=null}},AggItemComp=class extends K{constructor(e,t){super({tag:`div`,cls:`ag-select-agg-func-item`,children:t}),this.selectItem=e,this.addGuiEventListener(`click`,this.selectItem)}},BaseDropZonePanel=class extends PillDropZonePanel{constructor(e,t){super(e),this.dropZonePurpose=t,this.addElementClasses(this.getGui(),this.dropZonePurpose.toLowerCase())}init(e){super.init(e),this.addManagedEventListeners({newColumnsLoaded:this.refreshGui.bind(this)}),this.addManagedPropertyListeners([`functionsReadOnly`,`rowGroupPanelSuppressSort`,`groupLockGroupColumns`],this.refreshGui.bind(this))}getItems(e){return e.columns??[]}isInterestedIn(e){return e===kl.HeaderCell||e===kl.ToolPanel}minimumAllowedNewInsertIndex(){let{gos:e,rowGroupColsSvc:t}=this.beans,n=e.get(`groupLockGroupColumns`),r=t?.columns.length??0;return n===-1?r:Math.min(n,r)}showOrHideColumnOnExit(e){return this.isRowGroupPanel()&&Vo(this.gos,!0)&&!e.fromNudge}handleDragEnterEnd(e){if(this.showOrHideColumnOnExit(e)){let t=e.dragSource.getDragItem().columns;this.setColumnsVisible(t,!1,`uiColumnDragged`)}}handleDragLeaveEnd(e){if(this.showOrHideColumnOnExit(e)){let t=e.dragSource.getDragItem();this.setColumnsVisible(t.columns,!0,`uiColumnDragged`)}}setColumnsVisible(e,t,n){if(e){let r=e.filter(e=>!e.getColDef().lockVisible);this.beans.colModel.setColsVisible(r,t,n)}}isRowGroupPanel(){return this.dropZonePurpose===`rowGroup`}createPillComponent(e,t,n,r){return new DropZoneColumnComp(e,t,n,this.dropZonePurpose,r)}},PivotDropZonePanel=class extends BaseDropZonePanel{constructor(e){super(e,`pivot`)}postConstruct(){let e=this.getLocaleTextFunc(),t=e(`pivotColumnsEmptyMessage`,`Drag here to set column labels`),n=e(`pivots`,`Column Labels`);super.init({icon:J(`pivotPanel`,this.beans,null),emptyMessage:t,title:n}),this.addManagedEventListeners({newColumnsLoaded:this.refresh.bind(this),columnPivotChanged:this.refresh.bind(this),columnPivotModeChanged:this.checkVisibility.bind(this)}),this.refresh()}getAriaLabel(){return this.getLocaleTextFunc()(`ariaPivotDropZonePanelLabel`,`Column Labels`)}refresh(){this.checkVisibility(),this.refreshGui()}checkVisibility(){let e=this.beans.colModel,t=e.isPivotMode();if(this.horizontal)switch(this.gos.get(`pivotPanelShow`)){case`always`:this.setDisplayed(t);break;case`onlyWhenPivoting`:{let n=e.isPivotActive();this.setDisplayed(t&&n);break}default:this.setDisplayed(!1)}else this.setDisplayed(t)}isItemDroppable(e,t){return this.gos.get(`functionsReadOnly`)||!e.isPrimary()?!1:e.isAllowPivot()&&(!e.isPivotActive()||this.isSourceEventFromTarget(t))}updateItems(e){this.beans.pivotColsSvc?.setColumns(e,`toolPanelUi`)}getIconName(){return this.isPotentialDndItems()?`pivot`:`notAllowed`}getExistingItems(){return this.beans.pivotColsSvc?.columns??[]}},RowGroupDropZonePanel=class extends BaseDropZonePanel{constructor(e){super(e,`rowGroup`)}postConstruct(){let e=this.getLocaleTextFunc(),t=e(`rowGroupColumnsEmptyMessage`,`Drag here to set row groups`),n=e(`groups`,`Row Groups`);super.init({icon:J(`rowGroupPanel`,this.beans,null),emptyMessage:t,title:n}),this.addManagedEventListeners({columnRowGroupChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.getLocaleTextFunc()(`ariaRowGroupDropZonePanelLabel`,`Row Groups`)}isItemDroppable(e,t){return this.gos.get(`functionsReadOnly`)||!e.isPrimary()||e.colDef.showRowGroup?!1:e.isAllowRowGroup()&&(!e.isRowGroupActive()||this.isSourceEventFromTarget(t))}updateItems(e){this.beans.rowGroupColsSvc?.setColumns(e,`toolPanelUi`)}getIconName(){return this.isPotentialDndItems()?`group`:`notAllowed`}getExistingItems(){return this.beans.rowGroupColsSvc?.columns??[]}},ValuesDropZonePanel=class extends BaseDropZonePanel{constructor(e){super(e,`aggregation`)}postConstruct(){let e=this.getLocaleTextFunc(),t=e(`valueColumnsEmptyMessage`,`Drag here to aggregate`),n=e(`values`,`Values`);super.init({icon:J(`valuePanel`,this.beans,null),emptyMessage:t,title:n}),this.addManagedEventListeners({columnValueChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.getLocaleTextFunc()(`ariaValuesDropZonePanelLabel`,`Values`)}getIconName(){return this.isPotentialDndItems()?`aggregate`:`notAllowed`}isItemDroppable(e,t){return this.gos.get(`functionsReadOnly`)||!e.isPrimary()?!1:e.isAllowValue()&&(!e.isValueActive()||this.isSourceEventFromTarget(t))}updateItems(e){this.beans.valueColsSvc?.setColumns(e,`toolPanelUi`)}getExistingItems(){return this.beans.valueColsSvc?.columns??[]}},kg={tag:`div`,cls:`ag-pivot-mode-panel`,children:[{tag:`ag-toggle-button`,ref:`cbPivotMode`,cls:`ag-pivot-mode-select`}]},PivotModePanel=class extends K{constructor(){super(...arguments),this.cbPivotMode=null}postConstruct(){this.setTemplate(kg,[fs]);let e=this.cbPivotMode,{colModel:t,ctrlsSvc:n,gos:r}=this.beans;e.setValue(t.isPivotMode());let i=this.getLocaleTextFunc();e.setLabel(i(`pivotMode`,`Pivot Mode`));let onBtPivotMode=()=>{let i=!!e.getValue();if(i!==t.isPivotMode()){r.updateGridOptions({options:{pivotMode:i},source:`toolPanelUi`});for(let e of n.getHeaderRowContainerCtrls())e.refresh()}},onPivotModeChanged=()=>{let n=t.isPivotMode();e.setValue(n)};this.addManagedListeners(e,{fieldValueChanged:onBtPivotMode}),this.addManagedEventListeners({newColumnsLoaded:onPivotModeChanged,columnPivotModeChanged:onPivotModeChanged})}},ColumnToolPanelFactory=class extends U{constructor(){super(...arguments),this.beanName=`colToolPanelFactory`}setPanelVisible(e,t,n){return e?e.setDisplayed(t):t&&(e=n()),e}createRowGroupPanel(e,t){return this.createPanel(e,t,new RowGroupDropZonePanel(!1))}createValuesPanel(e,t){return this.createPanel(e,t,new ValuesDropZonePanel(!1))}createPivotPanel(e,t){return this.createPanel(e,t,new PivotDropZonePanel(!1))}createPivotModePanel(e,t,n){return this.createPanel(e,t,new PivotModePanel,n)}createPanel(e,t,n,r){return n=e.createBean(n),t.push(()=>e.destroyBean(n)),r?e.prependChild(n):e.appendChild(n),n}},Ag={moduleName:`ColumnsToolPanel`,version:Z,beans:[ColumnToolPanelFactory],userComponents:{agColumnsToolPanel:ColumnToolPanel},icons:{ensureColumnVisible:`column-arrow`,columnsToolPanel:`columns`,menuAddRowGroup:`group`,menuRemoveRowGroup:`group`,pivotPanel:`pivot`,rowGroupPanel:`group`,valuePanel:`aggregation`,columnSelectClosed:`tree-closed`,columnSelectOpen:`tree-open`,columnSelectIndeterminate:`tree-indeterminate`},dependsOn:[fh,dg,Pl,zo,Ra,pg]},ChartMenuItemMapper=class extends U{constructor(){super(...arguments),this.beanName=`chartMenuItemMapper`}getChartItems(e){let t=this.beans,n=t.chartSvc,r=e===`pivotChart`;if(!n)return null;let i=this.getLocaleTextFunc.bind(this),o=r?new PivotMenuItemMapper(t,n,i):new RangeMenuItemMapper(t,n,i),s=n.isEnterprise(),c=o.getMenuItem();if(c?.subMenu&&!s){let filterEnterpriseItems=e=>({...e,subMenu:e.subMenu?.filter(e=>!e._enterprise).map(e=>filterEnterpriseItems(e))});c=filterEnterpriseItems(c)}let p=this.gos.get(`chartToolPanelsDef`)?.settingsPanel?.chartGroupsDef;return p&&(c=this.filterAndOrderChartMenu(c,p,o.getConfigLookup())),this.cleanInternals(c)}cleanInternals(e){if(!e)return e;let removeKeys=e=>{delete e?._key,delete e?._enterprise;for(let t of e?.subMenu??[])removeKeys(t);return e};return removeKeys(e)}buildLookup(e){let t={},addItem=e=>{if(t[e._key]=e,e.subMenu)for(let t of e.subMenu)addItem(t)};return addItem(e),t}filterAndOrderChartMenu(e,t,n){let r=this.buildLookup(e),i={...e,subMenu:[]};for(let e of Object.keys(t)){let o=t[e],s=n[e];if(s===null)continue;if(s==null){q(173,{group:e});continue}let c=r[s._key];if(c){if(c.subMenu){let t=o.map(t=>{let n=s[t];if(n==null){q(174,{group:e,chartType:t});return}return r[n]}).filter(e=>e!==void 0);t.length>0&&(c.subMenu=t,i.subMenu?.push(c))}else i.subMenu?.push(c)}}return i.subMenu?.length==0?null:i}},PivotMenuItemMapper=class{constructor(e,t,n){this.beans=e,this.chartSvc=t,this.getLocaleTextFunc=n}
vendor: 4,389 bytes, line 5
5getMenuItem(){let e=this.getLocaleTextFunc(),getMenuItem=(t,n,r,i,o=!1)=>({name:e(t,n+`‎`),action:()=>this.chartSvc.createPivotChart({chartType:r}),_key:i,_enterprise:o});return{name:e(`pivotChart`,`Pivot Chart`),_key:`pivotChart`,subMenu:[{_key:`pivotColumnChart`,name:e(`columnChart`,`Column`),subMenu:[getMenuItem(`groupedColumn`,`Grouped`,`groupedColumn`,`pivotGroupedColumn`),getMenuItem(`stackedColumn`,`Stacked`,`stackedColumn`,`pivotStackedColumn`),getMenuItem(`normalizedColumn`,`100% Stacked`,`normalizedColumn`,`pivotNormalizedColumn`)]},{_key:`pivotBarChart`,name:e(`barChart`,`Bar`),subMenu:[getMenuItem(`groupedBar`,`Grouped`,`groupedBar`,`pivotGroupedBar`),getMenuItem(`stackedBar`,`Stacked`,`stackedBar`,`pivotStackedBar`),getMenuItem(`normalizedBar`,`100% Stacked`,`normalizedBar`,`pivotNormalizedBar`)]},{_key:`pivotPieChart`,name:e(`pieChart`,`Pie`),subMenu:[getMenuItem(`pie`,`Pie`,`pie`,`pivotPie`),getMenuItem(`donut`,`Donut`,`donut`,`pivotDonut`)]},{_key:`pivotLineChart`,name:e(`lineChart`,`Line`),subMenu:[getMenuItem(`lineChart`,`Line`,`line`,`pivotLineChart`),getMenuItem(`stackedLine`,`Stacked`,`stackedLine`,`pivotStackedLine`),getMenuItem(`normalizedLine`,`100% Stacked`,`normalizedLine`,`pivotNormalizedLine`)]},{_key:`pivotAreaChart`,name:e(`areaChart`,`Area`),subMenu:[getMenuItem(`areaChart`,`Area`,`area`,`pivotArea`),getMenuItem(`stackedArea`,`Stacked`,`stackedArea`,`pivotStackedArea`),getMenuItem(`normalizedArea`,`100% Stacked`,`normalizedArea`,`pivotNormalizedArea`)]},{_key:`pivotXYChart`,name:e(`xyChart`,`X Y (Scatter)`),subMenu:[getMenuItem(`scatter`,`Scatter`,`scatter`,`pivotScatter`),getMenuItem(`bubble`,`Bubble`,`bubble`,`pivotBubble`)]},{_key:`pivotStatisticalChart`,_enterprise:!1,name:e(`statisticalChart`,`Statistical`),subMenu:[getMenuItem(`histogramChart`,`Histogram`,`histogram`,`pivotHistogram`,!1)]},{_key:`pivotHierarchicalChart`,_enterprise:!0,name:e(`hierarchicalChart`,`Hierarchical`),subMenu:[getMenuItem(`treemapChart`,`Treemap`,`treemap`,`pivotTreemap`,!0),getMenuItem(`sunburstChart`,`Sunburst`,`sunburst`,`pivotSunburst`,!0)]},{_key:`pivotFunnel`,name:e(`funnel`,`Funnel`),subMenu:[getMenuItem(`funnel`,`Funnel`,`funnel`,`pivotFunnel`),getMenuItem(`coneFunnel`,`Cone Funnel`,`coneFunnel`,`pivotConeFunnel`),getMenuItem(`pyramid`,`Pyramid`,`pyramid`,`pivotPyramid`)]},{_key:`pivotCombinationChart`,name:e(`combinationChart`,`Combination`),subMenu:[getMenuItem(`columnLineCombo`,`Column & Line`,`columnLineCombo`,`pivotColumnLineCombo`),getMenuItem(`AreaColumnCombo`,`Area & Column`,`areaColumnCombo`,`pivotAreaColumnCombo`)]}],icon:J(`chart`,this.beans,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`,stackedLine:`pivotStackedLine`,normalizedLine:`pivotNormalizedLine`},areaGroup:{_key:`pivotAreaChart`,area:`pivotArea`,stackedArea:`pivotStackedArea`,normalizedArea:`pivotNormalizedArea`},scatterGroup:{_key:`pivotXYChart`,bubble:`pivotBubble`,scatter:`pivotScatter`},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},funnelGroup:{_key:`pivotFunnel`,funnel:`pivotFunnel`,coneFunnel:`pivotConeFunnel`,pyramid:`pivotPyramid`},polarGroup:null,specializedGroup:null}}},RangeMenuItemMapper=class{constructor(e,t,n){this.beans=e,this.chartSvc=t,this.getLocaleTextFunc=n}getMenuItem(){let e=this.getLocaleTextFunc(),getMenuItem=(t,n,r,i,o=!1)=>({name:e(t,n),action:()=>this.chartSvc.createChartFromCurrentRange(r),_key:i,_enterprise:o});return{name:e(`chartRange`,`Chart Range`),_key:`chartRange`,subMenu:[{name:e(`columnChart`,`Column`),subMenu:[getMenuItem(`groupedColumn`,`Grouped`,`groupedColumn`,`rangeGroupedColumn`),getMenuItem(`stackedColumn`,`Stacked`,`stackedColumn`,`rangeStackedColumn`),getMenuItem(`normalizedColumn`,`
5100% Stacked`,`normalizedColumn`,`rangeNormalizedColumn`)],_key:`rangeColumnChart`},{name:e(`barChart`,`Bar`),subMenu:[getMenuItem(`groupedBar`,`Grouped`,`groupedBar`,`rangeGroupedBar`),getMenuItem(`stackedBar`,`Stacked`,`stackedBar`,`rangeStackedBar`),getMenuItem(`normalizedBar`,`100% Stacked`,`normalizedBar`,`rangeNormalizedBar`)],_key:`rangeBarChart`},{name:e(`pieChart`,`Pie`),subMenu:[getMenuItem(`pie`,`Pie`,`pie`,`rangePie`),getMenuItem(`donut`,`Donut`,`donut`,`rangeDonut`)],_key:`rangePieChart`},{name:e(`lineChart`,`Line`),subMenu:[getMenuItem(`lineChart`,`Line`,`line`,`rangeLineChart`),getMenuItem(`stackedLine`,`Stacked`,`stackedLine`,`rangeStackedLine`),getMenuItem(`normalizedLine`,`100% Stacked`,`normalizedLine`,`rangeNormalizedLine`)],_key:`rangeLineChart`},{name:e(`areaChart`,`Area`),subMenu:[getMenuItem(`areaChart`,`Area`,`area`,`rangeArea`),getMenuItem(`stackedArea`,`Stacked`,`stackedArea`,`rangeStackedArea`),getMenuItem(`normalizedArea`,`100% Stacked`,`normalizedArea`,`rangeNormalizedArea`)],_key:`rangeAreaChart`},{name:e(`xyChart`,`X Y (Scatter)`),subMenu:[getMenuItem(`scatter`,`Scatter`,`scatter`,`rangeScatter`),getMenuItem(`bubble`,`Bubble`,`bubble`,`rangeBubble`)],_key:`rangeXYChart`},{name:e(`polarChart`,`Polar`),subMenu:[getMenuItem(`radarLine`,`Radar Line`,`radarLine`,`rangeRadarLine`),getMenuItem(`radarArea`,`Radar Area`,`radarArea`,`rangeRadarArea`),getMenuItem(`nightingale`,`Nightingale`,`nightingale`,`rangeNightingale`),getMenuItem(`radialColumn`,`Radial Column`,`radialColumn`,`rangeRadialColumn`),getMenuItem(`radialBar`,`Radial Bar`,`radialBar`,`rangeRadialBar`)],_key:`rangePolarChart`,_enterprise:!0},{name:e(`statisticalChart`,`Statistical`),subMenu:[getMenuItem(`boxPlot`,`Box Plot`,`boxPlot`,`rangeBoxPlot`,!0),getMenuItem(`histogramChart`,`Histogram`,`histogram`,`rangeHistogram`,!1),getMenuItem(`rangeBar`,`Range Bar`,`rangeBar`,`rangeRangeBar`,!0),getMenuItem(`rangeArea`,`Range Area`,`rangeArea`,`rangeRangeArea`,!0)],_key:`rangeStatisticalChart`,_enterprise:!1},{name:e(`hierarchicalChart`,`Hierarchical`),subMenu:[getMenuItem(`treemap`,`Treemap`,`treemap`,`rangeTreemap`),getMenuItem(`sunburst`,`Sunburst`,`sunburst`,`rangeSunburst`)],_key:`rangeHierarchicalChart`,_enterprise:!0},{name:e(`specializedChart`,`Specialized`),subMenu:[getMenuItem(`heatmap`,`Heatmap`,`heatmap`,`rangeHeatmap`),getMenuItem(`waterfall`,`Waterfall`,`waterfall`,`rangeWaterfall`)],_key:`rangeSpecializedChart`,_enterprise:!0},{name:e(`funnel`,`Funnel`),subMenu:[getMenuItem(`funnel`,`Funnel`,`funnel`,`rangeFunnel`),getMenuItem(`coneFunnel`,`Cone Funnel`,`coneFunnel`,`rangeConeFunnel`),getMenuItem(`pyramid`,`Pyramid`,`pyramid`,`rangePyramid`)],_key:`rangeFunnel`,_enterprise:!0},{name:e(`combinationChart`,`Combination`),subMenu:[getMenuItem(`columnLineCombo`,`Column & Line`,`columnLineCombo`,`rangeColumnLineCombo`),getMenuItem(`AreaColumnCombo`,`Area & Column`,`areaColumnCombo`,`rangeAreaColumnCombo`)],_key:`rangeCombinationChart`}],icon:J(`chart`,this.beans,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`,stackedLine:`rangeStackedLine`,normalizedLine:`rangeNormalizedLine`},areaGroup:{_key:`rangeAreaChart`,area:`rangeArea`,stackedArea:`rangeStackedArea`,normalizedArea:`rangeNormalizedArea`},scatterGroup:{_key:`rangeXYChart`,bubble:`rangeBubble`,scatter:`rangeScatter`},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`},funnelGroup:{_key:`rangeFunnel`,funnel:`rangeFunnel`,coneFunnel:`rangeConeFunnel`,pyramid:`rangePyramid`},combinationGroup:{_key:`rangeCombinationChart`,columnLineCombo:`rangeColumnLineCombo`,areaColumnCombo:`rangeAreaColumnCombo`,customCombo:null}}}},ColumnChooserFactory=class extends U{constructor(){super(...arguments),this.beanName=`colChooserFactory`}createColumnSelectPanel(e,t,n,r){let i=e.createManagedBean(new AgPrimaryCols),{contractColumnSelection:o,suppressColumnExpandAll:s,suppressColumnFilter:c,suppressColumnSelectAll:p,suppressSyncLayoutWithGri
5d:m,columnLayout:h}=r??t?.getColDef().columnChooserParams??{};return i.init(!!n,co(this.gos,{suppressColumnMove:!1,suppressValues:!1,suppressPivots:!1,suppressRowGroups:!1,suppressPivotMode:!1,contractColumnSelection:!!o,suppressColumnExpandAll:!!s,suppressColumnFilter:!!c,suppressColumnSelectAll:!!p,suppressSyncLayoutWithGrid:!!h||!!m,onStateUpdated:()=>{}}),`columnMenu`),h&&i.setColumnLayout(h),i}showColumnChooser({column:e,chooserParams:t,eventSource:n,headerPosition:r}){this.hideActiveColumnChooser();let i=this.createColumnSelectPanel(this,e,!0,t),o=this.getLocaleTextFunc(),s=this.beans,{visibleCols:c,focusSvc:p,menuUtils:m}=s,h=c.allCols.indexOf(e),g=e?p.focusedHeader??r??null:null;this.activeColumnChooserDialog=this.createBean(new AgDialog({title:o(`chooseColumns`,`Choose Columns`),component:i,width:300,height:300,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{Qo(s,i.getGui())?.focus({preventScroll:!0}),this.dispatchVisibleChangedEvent(!0,e)},closedCallback:t=>{let r=this.activeColumnChooser.getGui();this.destroyBean(this.activeColumnChooser),this.activeColumnChooser=void 0,this.activeColumnChooserDialog=void 0,this.dispatchVisibleChangedEvent(!1,e),e&&m.restoreFocusOnClose({column:e,headerPosition:g,columnIndex:h,eventSource:n},r,t,!0)},postProcessPopupParams:{type:`columnChooser`,column:e,eventSource:n}})),this.activeColumnChooser=i}hideActiveColumnChooser(){this.destroyBean(this.activeColumnChooserDialog)}dispatchVisibleChangedEvent(e,t){this.eventSvc.dispatchEvent({type:`columnMenuVisibleChanged`,visible:e,switchingTab:!1,key:`columnChooser`,column:t??null})}},jg={pinSubMenu:`PinnedColumn`,pinLeft:`PinnedColumn`,pinRight:`PinnedColumn`,clearPinned:`PinnedColumn`,pinRowSubMenu:`PinnedRow`,pinBottom:`PinnedRow`,pinTop:`PinnedRow`,unpinRow:`PinnedRow`,valueAggSubMenu:`SharedAggregation`,autoSizeThis:`ColumnAutoSize`,autoSizeAll:`ColumnAutoSize`,rowGroup:`SharedRowGrouping`,rowUnGroup:`SharedRowGrouping`,resetColumns:`CommunityCore`,expandAll:[`ClientSideRowModelHierarchy`,`ServerSideRowModel`],contractAll:[`ClientSideRowModelHierarchy`,`ServerSideRowModel`],copy:`Clipboard`,copyWithHeaders:`Clipboard`,copyWithGroupHeaders:`Clipboard`,cut:`Clipboard`,paste:`Clipboard`,export:[`CsvExport`,`ExcelExport`],csvExport:`CsvExport`,excelExport:`ExcelExport`,separator:`CommunityCore`,pivotChart:`IntegratedCharts`,chartRange:`IntegratedCharts`,columnFilter:`ColumnFilter`,columnChooser:`ColumnMenu`,sortAscending:`Sort`,sortDescending:`Sort`,sortUnSort:`Sort`};function validateMenuItem(e,t){let n=jg[t];n&&e.assertModuleRegistered(n,`menu item '${t}'`)}var Mg=`separator`;function _removeRepeatsFromArray(e,t){if(e)for(let n=e.length-2;n>=0;n--){let r=e[n]===t,i=e[n+1]===t;r&&i&&e.splice(n+1,1)}}var MenuItemMapper=class extends U{constructor(){super(...arguments),this.beanName=`menuItemMapper`}mapWithStockItems(e,t,n,r,i){if(!e)return[];let o=[],s=this.getLocaleTextFunc(),{beans:c,gos:p}=this,{pinnedCols:m,colAutosize:h,aggFuncSvc:g,rowGroupColsSvc:_,colNames:v,colModel:y,clipboardSvc:b,expansionSvc:x,focusSvc:S,csvCreator:C,excelCreator:w,menuSvc:T,colChooserFactory:E,sortSvc:D,chartMenuItemMapper:O,valueColsSvc:k,pinnedRowModel:ee}=c,getStockMenuItem=(e,t,r,i)=>{switch(validateMenuItem(p,e),e){case`pinSubMenu`:return m&&t?{name:s(`pinColumn`,`Pin Column`),icon:J(`menuPin`,c,null),subMenu:[`clearPinned`,`pinLeft`,`pinRight`]}:null;case`pinLeft`:return m&&t?{name:s(`pinLeft`,`Pin Left`),action:()=>m.setColsPinned([t],`left`,i),checked:!!t&&t.isPinnedLeft()}:null;case`pinRight`:return m&&t?{name:s(`pinRight`,`Pin Right`),action:()=>m.setColsPinned([t],`right`,i),checked:!!t&&t.isPinnedRight()}:null;case`clearPinned`:return m&&t?{name:s(`noPin`,`No Pin`),action:()=>m.setColsPinned([t],null,i),checked:!!t&&!t.isPinned()}:null;case`pinRowSubMenu`:{let e=p.get(`enableRowPinning`),r=[],i=n?.rowPinned??n?.pinnedSibling?.rowPinned;return i&&r.push(`unpinRow`),e&&e!==`bottom`&&i!=`top`&&r.push(`pinTop`),e&&e!==`top`&&i!=`bottom`&&r.push(`pinBottom`),ee?.isManual()?{name:s(`pinRow`,`Pin Row`),icon:J(`rowPin`,c,t),subMenu:r}:null}case`pinTop`:return ee?.isManual()?{name:s(`pinTop`,`Pin to Top`),icon:J(`rowPinTop`,c,t),action:({node:e,column:t})=>e&&ee.pinRow(e,`top`,t)}:null;case`pinBottom`:return ee?.isManual()?{name:s(`pinBottom`,`Pin to Bottom`),icon:J(`rowPinBottom`,c,t),action:({node:e,column:t})=>e&&ee.pinRow(e,`bottom`,t)}:null;case`unpinRow`:return ee?.isManual()?{name:s(`unpinRow`,`Unpin Row`),icon:J(`rowUnpin`,c,t),action:({node:e,column:t})=>e&&ee.pinRow(e,null,t)}:null;case`valueAggSubMenu`:return g&&k&&(t?.isPrimary()||t?.getColDef().pivotValueColumn)?{name:s(`valueAggregation`,`Value Aggregation`),icon:J(`menuValue`,c,null),subMenu:createAggregationSubMenu(t,g,k,s),disabled:p.get(`functionsReadOnly`)}:null;case`autoSizeThis`:return h?{name:s(`autosizeThisColumn`,`Autosize This Column`),action:()=>t&&h.autoSizeColumn(t,i,p.get(`skipHeaderOnAutoSize`))}:null;case`autoSizeAll`:return h?{name:s(`autosizeAllColumns`,`Autosize All Columns`),action:()=>h.autoSizeAllColumns({source:i,skipHeader:p.get(`skipHeaderOnAutoSize`)})}:null;case`rowGroup`:return _?{name:s(`groupBy`,`Group by`)+` `+v.getDisplayNameForColumn(t,`header`),disabled:p.get(`functionsReadOnly`)||t?.isRowGroupActive()||!t?.getColDef().enableRowGroup,action:()=>_.addColumns([t],i),icon:J(`menuAddRowGroup`,c,null)}:null;case`rowUnGroup`:if(_&&p.isModuleRegistered(`SharedRowGrouping`)){let e=t?.getColDef().showRowGroup,n=p.get(`groupLockGroupColumns`),r,o,action;if(e===!0)r=s(`ungroupAll`,`Un-Group All`),o=p.get(`functionsReadOnly`)||n===-1||n>=(_.columns.length??0),action=()=>_.setColumns(_.columns.slice(0,n),i);else if(typeof e==`string`){let t=y.getColDefCol(e),n=t==null?e:v.getDisplayNameForColumn(t,`header`);r=s(`ungroupBy`,`Un-Group by`)+` `+n,o=p.get(`functionsReadOnly`)||isRowGroupColLocked(t,c),action=()=>{_.removeColumns([e],i)}}else r=s(`ungroupBy`,`Un-Group by`)+` `+v.getDisplayNameForColumn(t,`header`),o=p.get(`functionsReadOnly`)||!t?.isRowGroupActive()||!t?.getColDef().enableRowGroup||isRowGroupColLocked(t,c),action=()=>_.removeColumns([t],i);return{name:r,disabled:o,action,icon:J(`menuRemoveRowGroup`,c,null)}}return null;case`resetColumns`:return{name:s(`resetColumns`,`Reset Columns`),action:()=>ns(c,i)};case`expandAll`:return x?{name:s(`expandAll`,`Expand All Row Groups`),action:()=>x.expandAll(!0)}:null;case`contractAll`:return x?{name:s(`collapseAll`,`Collapse All Row Groups`),action:()=>x.expandAll(!1)}:null;case`copy`:return b?{name:s(`copy`,`Copy`),shortcut:s(`ctrlC`,`Ctrl+C`),icon:J(`clipboardCopy`,c,null),action:()=>b.copyToClipboard()}:null;case`copyWithHeaders`:return b?{name:s(`copyWithHeaders`,`Copy with Headers`),icon:J(`clipboardCopy`,c,null),action:()=>b.copyToClipboard({includeHeaders:!0})}:null;case`copyWithGroupHeaders`:return b?{name:s(`copyWithGroupHeaders`,`Copy with Group Headers`),icon:J(`clipboardCopy`,c,null),action:()=>b.copyToClipboard({includeHeaders:!0,includeGroupHeaders:!0})}:null;case`cut`:if(b){let e=S.getFocusedCell(),t=e?Ql(c,e):null,n=t?e?.column.isCellEditable(t):!1;return{name:s(`cut`,`Cut`),shortcut:s(`ctrlX`,`Ctrl+X`),icon:J(`clipboardCut`,c,null),disabled:!n||p.get(`suppressCutToClipboard`),action:()=>b.cutToClipboard(void 0,`contextMenu`)}}return null;case`paste`:if(b){let e=p.get(`suppressClipboardApi`)||p.get(`suppressClipboardPaste`)||!t||!n||!t.isCellEditable(n)||t.isSuppressPaste(n);return{name:s(`paste`,`Paste`),shortcut:s(`ctrlV`,`Ctrl+V`),icon:J(`clipboardPaste`,c,null),disabled:e,action:()=>b.pasteFromClipboard()}}return null;case`export`:{let e=[];return!p.get(`suppressCsvExport`)&&C&&e.push(`csvExport`),!p.get(`suppressExcelExport`)&&w&&e.push(`excelExport`),e.length?{name:s(`export`,`Export`),subMenu:e,icon:J(`save`,c,null)}:null}
5case`csvExport`:return C?{name:s(`csvExport`,`CSV Export`),icon:J(`csvExport`,c,null),action:()=>C.exportDataAsCsv()}:null;case`excelExport`:return w?{name:s(`excelExport`,`Excel Export`),icon:J(`excelExport`,c,null),action:()=>w.exportDataAsExcel()}:null;case`separator`:return e;case`pivotChart`:case`chartRange`:return O.getChartItems(e);case`columnFilter`:return T&&t?{name:s(`columnFilter`,`Column Filter`),icon:J(`filter`,c,null),action:()=>T.showFilterMenu({column:t,buttonElement:r(),containerType:`columnFilter`,positionBy:`button`})}:null;case`columnChooser`:{let e=S.focusedHeader;return E?{name:s(`columnChooser`,`Choose Columns`),icon:J(`columns`,c,null),action:()=>E.showColumnChooser({column:t,eventSource:r(),headerPosition:e})}:null}case`sortAscending`:return D?{name:s(`sortAscending`,`Sort Ascending`),icon:J(`sortAscending`,c,null),action:()=>D.setSortForColumn(t,`asc`,!1,i)}:null;case`sortDescending`:return D?{name:s(`sortDescending`,`Sort Descending`),icon:J(`sortDescending`,c,null),action:()=>D.setSortForColumn(t,`desc`,!1,i)}:null;case`sortUnSort`:return D?{name:s(`sortUnSort`,`Clear Sort`),icon:J(`sortUnSort`,c,null),action:()=>D.setSortForColumn(t,null,!1,i)}:null;default:return q(176,{key:e}),null}};for(let s of e){let e;if(e=typeof s==`string`?getStockMenuItem(s,t,r,i):{...s},!e)continue;let c=e,{subMenu:p}=c;p&&p instanceof Array&&(c.subMenu=this.mapWithStockItems(p,t,n,r,i)),e!=null&&o.push(e)}return _removeRepeatsFromArray(o,Mg),o}};function createAggregationSubMenu(e,t,n,r){let i;if(e.isPrimary())i=e;else{let t=e.getColDef().pivotValueColumn;i=Xs(t)?t:void 0}let o=[];if(i){let e=i.isValueActive(),s=t.getFuncNames(i);o.push({name:r(`noAggregation`,`None`),action:()=>{n.removeColumns([i],`contextMenu`),n.setColumnAggFunc(i,void 0,`contextMenu`)},checked:!e});for(let c of s)o.push({name:r(c,t.getDefaultFuncLabel(c)),action:()=>{n.setColumnAggFunc(i,c,`contextMenu`),n.addColumns([i],`contextMenu`)},checked:e&&i.getAggFunc()===c})}return o}var ColumnMenuFactory=class extends U{constructor(){super(...arguments),this.beanName=`colMenuFactory`}createMenu(e,t,n,r){let i=e.createManagedBean(new AgMenuList(0,{column:n??null,node:null,value:null})),o=this.beans.menuItemMapper.mapWithStockItems(t,n??null,null,r,`columnMenu`);return i.addMenuItems(o),i}getMenuItems(e=null,t=null){let n=this.getDefaultMenuOptions(e),r,i=(e?.getColDef()??t?.getColGroupDef())?.mainMenuItems;if(Array.isArray(i))r=i;else if(typeof i==`function`)r=i(co(this.gos,{column:e,columnGroup:t,defaultItems:n}));else{let i=this.gos.getCallback(`getMainMenuItems`);r=i?i({column:e,columnGroup:t,defaultItems:n}):n}return _removeRepeatsFromArray(r,Mg),r}getDefaultMenuOptions(e){let t=[],{beans:n,gos:r}=this,{colChooserFactory:i,rowGroupColsSvc:o,colModel:s,expansionSvc:c,sortSvc:p,menuSvc:m,pinnedCols:h,aggFuncSvc:g,colAutosize:_}=n,v=po(r),addColumnItems=()=>{!v&&i&&t.push(`columnChooser`),t.push(`resetColumns`)};if(!e)return addColumnItems(),t;let{colDef:y}=e,b=h&&!y.lockPinned,x=o?.columns.length??0,S=x>0,C=Nl(r),w=r.get(`treeData`),T=e.isPrimary(),E=!T||g&&e.isAllowValue()&&(S||C||w);if(p&&!v&&e.isSortable()){let n=e.getSort();n!==`asc`&&t.push(`sortAscending`),n!==`desc`&&t.push(`sortDescending`),n&&t.push(`sortUnSort`),t.push(Mg)}if(m?.isFilterMenuItemEnabled(e)&&(t.push(`columnFilter`),t.push(Mg)),b&&t.push(`pinSubMenu`),E&&t.push(`valueAggSubMenu`),(b||E)&&t.push(Mg),_&&(t.push(`autoSizeThis`),t.push(`autoSizeAll`),t.push(Mg)),o&&r.isModuleRegistered(`SharedRowGrouping`)){let r=t.length;y.showRowGroup?t.push(`rowUnGroup`):e.isAllowRowGroup()&&T&&(e.isRowGroupActive()?isRowGroupColLocked(e,n)||t.push(`rowUnGroup`):t.push(`rowGroup`)),t.length>r&&t.push(Mg)}return addColumnItems(),c&&(Rc(r)||r.get(`ssrmExpandAllAffectsAllRows`))&&(w||x>+!!s.isPivotMode())&&(t.push(`expandAll`),t.push(`contractAll`)),t}},Ng=`ag-menu`,Pg=`ag-context-menu-open`,Fg=`ag-context-menu-loading-icon`,ContextMenuService=class extends U{constructor(){super(...arguments),this.beanName=`contextMenuSvc`,this.destroyLoadingSpinner=null,this.lastPromise=0}hideActiveMenu(){this.destroyBean(this.activeMenu)}getMenuItems(e,t,n,r){let i=[],{clipboardSvc:o,chartSvc:s,csvCreator:c,excelCreator:p,colModel:m,rangeSvc:h,gos:g}=this.beans;if(Xs(e)&&o&&t&&(g.get(`suppressCutToClipboard`)||i.push(`cut`),i.push(`copy`,`copyWithHeaders`,`copyWithGroupHeaders`,`paste`,`separator`)),g.get(`enableCharts`)&&s&&(m.isPivotMode()&&i.push(`pivotChart`),h&&!h.isEmpty()&&i.push(`chartRange`)),Xs(e)){let t=g.get(`enableRowPinning`),n=g.get(`isRowPinnable`);
5if(t){let t=e.level>-1&&e.footer,r=e.level===-1&&e.footer,o=Nl(g);(r&&o!==`pinnedBottom`&&o!==`pinnedTop`||!r&&!t)&&(n?.(e)??!0)&&i.push(`pinRowSubMenu`)}let r=g.get(`suppressExcelExport`)||!p,o=g.get(`suppressCsvExport`)||!c;!bs()&&(!r||!o)&&i.push(`export`)}let _=i.length?i:void 0,v=t?.getColDef().contextMenuItems;return Array.isArray(v)?v:typeof v==`function`?v(co(g,{column:t,node:e,value:n,defaultItems:_,event:r})):g.getCallback(`getContextMenuItems`)?.({column:t,node:e,value:n,defaultItems:_,event:r})??i}getContextMenuPosition(e,t){let n=this.getRowCtrl(e),r=this.getCellGui(n,t);if(!r)return{x:0,y:n?.getRowYPosition()??0};let i=r.getBoundingClientRect();return{x:i.x+i.width/2,y:i.y+i.height/2}}showContextMenu(e){let t=e.rowNode??null,n=e.column??null,{anchorToElement:r,value:i,source:o}=e;t&&n&&i==null&&(i=this.beans.valueSvc.getValueForDisplay(n,t).value),r??=this.getContextMenuAnchorElement(t,n),this.beans.menuUtils.onContextMenu({mouseEvent:e.mouseEvent??null,touchEvent:e.touchEvent??null,showMenuCallback:e=>this.showMenu(t,n,i,e,r),source:o})}handleContextMenuMouseEvent(e,t,n,r){let i=r?.rowNode??n?.rowNode??null,o=r?.column??n?.findFullWidthInfoForEvent(e||t)?.column??null,{valueSvc:s,ctrlsSvc:c}=this.beans,p=o?s.getValue(o,i):null,m=c.getGridBodyCtrl(),h=r?r.eGui:m.eGridBody;this.showContextMenu({mouseEvent:e,touchEvent:t,rowNode:i,column:o,value:p,anchorToElement:h,source:`ui`})}showMenu(e,t,n,r,i){let o=this.getMenuItems(e,t,n,r);if(Ts(o)){let s=this.lastPromise+1;return this.lastPromise=s,this.destroyLoadingSpinner||this.createLoadingIcon(r),o.then(o=>{if(this.lastPromise!==s)return;let{target:c}=r,p=!c;o?.length&&(p||El(c))&&!this.beans.overlays?.isExclusive()&&this.createContextMenu({menuItems:o,node:e,column:t,value:n,mouseEvent:r,anchorToElement:i}),this.destroyLoadingSpinner?.()}),!0}return o?.length?(this.createContextMenu({menuItems:o,node:e,column:t,value:n,mouseEvent:r,anchorToElement:i}),!0):!1}createLoadingIcon(e){let{beans:t}=this,n=this.getLocaleTextFunc(),r=J(`loadingMenuItems`,t),i=Dl({tag:`div`,cls:Fg});i.appendChild(r);let o=$c(t),s=pl(t);if(!s){q(54);return}s.appendChild(i),t.ariaAnnounce?.announceValue(n(`ariaLabelLoadingContextMenu`,`Loading Context Menu`),`contextmenu`),t.environment.applyThemeClasses(i),As(i,e,t);
5let mouseMoveCallback=e=>{As(i,e,t)};o.addEventListener(`mousemove`,mouseMoveCallback),this.destroyLoadingSpinner=()=>{o.removeEventListener(`mousemove`,mouseMoveCallback),i.remove(),this.destroyLoadingSpinner=null}}createContextMenu(e){let{menuItems:t,node:n,column:r,value:i,mouseEvent:o,anchorToElement:s}=e,{ctrlsSvc:c,focusSvc:p,popupSvc:m}=this.beans,h=c.getGridBodyCtrl().eGridBody,g=new ContextMenu(t,r,n,i);this.createBean(g);let _=g.getGui();r||p.clearFocusedCell();let v={column:r,rowNode:n,type:`contextMenu`,mouseEvent:o,ePopup:_,nudgeY:1},y=this.getLocaleTextFunc(),b=m?.addPopup({modal:!0,eChild:_,closeOnEsc:!0,closedCallback:e=>{_preserveRangesWhile(this.beans,()=>{h.classList.remove(Pg),this.destroyBean(g),this.dispatchVisibleChangedEvent(!1,e===void 0?`api`:`ui`)})},click:o,positionCallback:()=>{let e=this.gos.get(`enableRtl`);m?.positionPopupUnderMouseEvent({...v,nudgeX:e?(_.offsetWidth+1)*-1:1})},anchorToElement:s,ariaLabel:y(`ariaLabelContextMenu`,`Context Menu`)});b&&(h.classList.add(Pg),g.afterGuiAttached({container:`contextMenu`,hidePopup:b.hideFunc})),this.activeMenu&&this.hideActiveMenu(),this.activeMenu=g,g.addEventListener(`destroyed`,()=>{this.activeMenu===g&&(this.activeMenu=null)}),b&&g.addEventListener(`closeMenu`,e=>b.hideFunc({mouseEvent:e.mouseEvent??void 0,keyboardEvent:e.keyboardEvent??void 0,forceHide:!0}));let x=o&&o instanceof MouseEvent&&o.type===`mousedown`;this.dispatchVisibleChangedEvent(!0,x?`api`:`ui`)}dispatchVisibleChangedEvent(e,t=`ui`){this.eventSvc.dispatchEvent({type:`contextMenuVisibleChanged`,visible:e,source:t})}getRowCtrl(e){let{rowIndex:t,rowPinned:n}=e||{};if(t!=null)return this.beans.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:n})||void 0}getCellGui(e,t){if(!(!e||!t))return e.getCellCtrl(t)?.eGui||void 0}getContextMenuAnchorElement(e,t){let n=this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody,r=this.getRowCtrl(e);return r?this.getCellGui(r,t)||(r.isFullWidth()?r.getFullWidthElement():n):n}destroy(){this.destroyLoadingSpinner?.(),super.destroy()}},ContextMenu=class extends K{constructor(e,t,n,r){super({tag:`div`,cls:Ng,role:`presentation`}),this.menuItems=e,this.column=t,this.node=n,this.value=r,this.menuList=null,this.focusedCell=null}postConstruct(){let e=this.createManagedBean(new AgMenuList(0,{column:this.column,node:this.node,value:this.value})),t=this.beans.menuItemMapper.mapWithStockItems(this.menuItems,this.column,this.node,()=>this.getGui(),`contextMenu`);e.addMenuItems(t),this.appendChild(e),this.menuList=e,e.addEventListener(`closeMenu`,e=>this.dispatchLocalEvent(e))}afterGuiAttached({hidePopup:e}){e&&this.addDestroyFunc(e),this.focusedCell=this.beans.focusSvc.getFocusedCell();let t=this.menuList;t&&_preserveRangesWhile(this.beans,()=>ja(t.getGui()))}restoreFocusedCell(){let{beans:e,focusedCell:t}=this,n=e.focusSvc,r=n.getFocusedCell();if(r&&t&&Fs(r,t)){let{rowIndex:r,rowPinned:i,column:o}=t;ks(e)&&n.setFocusedCell({rowIndex:r,column:o,rowPinned:i,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!qa()})}}destroy(){super.destroy(),this.restoreFocusedCell()}};function getTabbedLayoutTemplate(e){return{tag:`div`,cls:`ag-tabs ${e}`,children:[{tag:`div`,ref:`eHeader`},{tag:`div`,ref:`eBody`,role:`presentation`,cls:`ag-tabs-body`+e?` ${e}-body`:``}]}}var TabbedLayout=class extends gs{constructor(e){super(getTabbedLayoutTemplate(e.cssClass)),this.eHeader=null,this.eBody=null,this.items=[],this.tabbedItemScrollMap=new Map,this.params=e}postConstruct(){if(this.setupHeader(),this.params.items)for(let e of this.params.items)this.addItem(e);this.initialiseTabGuard({onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),focusInnerElement:this.focusInnerElement.bind(this),focusTrapActive:!0}),this.addDestroyFunc(()=>this.activeItem?.tabbedItem?.afterDetachedCallback?.())}setupHeader(){let{enableCloseButton:e,cssClass:t}=this.params,addCssClasses=(e,n)=>{e.classList.add(`ag-tabs-${n}`),t&&e.classList.add(`${t}-${n}`)};e?(this.setupCloseButton(addCssClasses),this.eTabHeader=Dl({tag:`div`,role:`presentation`}),addCssClasses(this.eHeader,`header-wrapper`),this.eHeader.appendChild(this.eTabHeader)):this.eTabHeader=this.eHeader,cs(this.eTabHeader,`tablist`),addCssClasse
5s(this.eTabHeader,`header`)}setupCloseButton(e){let t=Dl({tag:`button`});e(t,`close-button`);let n=J(`close`,this.beans);ou(t,this.params.closeButtonAriaLabel),t.appendChild(n),this.addManagedElementListeners(t,{click:()=>this.params.onCloseClicked?.()});let r=Dl({tag:`div`,role:`presentation`});e(r,`close-button-wrapper`),r.appendChild(t),this.eHeader.appendChild(r),this.eCloseButton=t}handleKeyDown(e){switch(e.key){case G.RIGHT:case G.LEFT:{if(!this.eTabHeader.contains(Lo(this.beans)))return;let t=e.key===G.RIGHT,n=this.gos.get(`enableRtl`),r=this.items.indexOf(this.activeItem),i=t===n?Math.max(r-1,0):Math.min(r+1,this.items.length-1);if(r===i)return;e.preventDefault();let o=this.items[i];this.showItemWrapper(o),o.eHeaderButton.focus();break}case G.UP:case G.DOWN:e.stopPropagation()}}onTabKeyDown(e){if(e.defaultPrevented)return;let{beans:t,eHeader:n,eBody:r,activeItem:i,params:o}=this,{suppressTrapFocus:s,enableCloseButton:c}=o,p=Lo(t),m=e.target,h=e.shiftKey;if(n.contains(p)){e.preventDefault(),c&&h&&!this.eCloseButton?.contains(p)?this.eCloseButton?.focus():s&&h?findFocusableElementBeforeTabGuard(_l(t).body,m)?.focus():this.focusBody(e.shiftKey);return}let g=null;if(isTargetUnderManagedComponent(r,m)&&(h&&(g=findFocusableElementBeforeTabGuard(r,m)),!g&&!s&&(g=i.eHeaderButton)),!g&&r.contains(p)&&(g=Qo(t,r,!1,h),!g)){s&&!h?this.forceFocusOutOfContainer(h):c&&!h?(e.preventDefault(),this.eCloseButton?.focus()):(e.preventDefault(),this.focusHeader());return}g&&(e.preventDefault(),g.focus())}focusInnerElement(e){return e?this.focusBody(!0):(this.focusHeader(),!0)}focusHeader(e){this.activeItem.eHeaderButton.focus({preventScroll:e})}focusBody(e){return ja(this.eBody,e)}setAfterAttachedParams(e){this.afterAttachedParams=e}showFirstItem(){this.items.length>0&&this.showItemWrapper(this.items[0])}addItem(e){let t=Dl({tag:`span`,cls:`ag-tab`,role:`tab`,attrs:{tabindex:`-1`}});t.appendChild(e.title),this.eTabHeader.appendChild(t),ou(t,e.titleLabel);let n={tabbedItem:e,eHeaderButton:t};this.items.push(n),t.addEventListener(`click`,this.showItemWrapper.bind(this,n))}showItem(e){let t=this.items.find(t=>t.tabbedItem===e);t&&this.showItemWrapper(t)}showItemWrapper(e){let{tabbedItem:t,eHeaderButton:n}=e;if(this.params.onItemClicked?.({item:t}),this.activeItem===e){this.params.onActiveItemClicked?.();return}this.lastScrollListener&&=this.lastScrollListener(),Ml(this.eBody),t.bodyPromise.then(e=>{this.eBody.appendChild(e);let n=!qa();if(this.params.suppressFocusBodyOnOpen||ja(this.eBody,!1,n),t.afterAttachedCallback&&t.afterAttachedCallback(this.afterAttachedParams),this.params.keepScrollPosition){let n=t.getScrollableContainer?.()||e;[this.lastScrollListener]=this.addManagedElementListeners(n,{scroll:()=>{this.tabbedItemScrollMap.set(t.name,n.scrollTop)}});let r=this.tabbedItemScrollMap.get(t.name);r!==void 0&&setTimeout(()=>{n.scrollTop=r},0)}}),this.activeItem&&(this.activeItem.eHeaderButton.classList.remove(`ag-tab-selected`),this.activeItem.tabbedItem.afterDetachedCallback?.()),n.classList.add(`ag-tab-selected`),this.activeItem=e}},Ig=`filterMenuTab`,Lg=`generalMenuTab`,Rg=`columnsMenuTab`,zg=[Lg,Ig,Rg],EnterpriseMenuFactory=class extends U{constructor(){super(...arguments),this.beanName=`enterpriseMenuFactory`}hideActiveMenu(){this.destroyBean(this.activeMenu)}showMenuAfterMouseEvent(e,t,n,r,i){let{column:o,columnGroup:s}=this.splitColumnOrGroup(e),c=i?`filterMenuTab`:void 0;this.showMenu(o,s,e=>{let r=e.getGui();this.beans.popupSvc.positionPopupUnderMouseEvent({type:n,column:o,mouseEvent:t,ePopup:r}),c&&e.showTab?.(c),this.dispatchVisibleChangedEvent(!0,!1,o,s,c)},n,c,void 0,t.target,r)}splitColumnOrGroup(e){let t=e&&pc(e);return{column:t?e:void 0,columnGroup:t?void 0:e}}showMenuAfterButtonClick(e,t,n,r,i){let o=-1,s=`left`;this.gos.get(`enableRtl`)&&(o=1,s=`right`);let c=i?`filterMenuTab`:void 0,p=c?[c]:void 0,m=po(this.gos),h=(m?9:4)*o,g=m?-23:4,{column:_,columnGroup:v}=this.splitColumnOrGroup(e);this.showMenu(_,v,e=>{let r=e.getGui();this.beans.popupSvc.positionPopupByComponent({type:n,column:_,eventSource:t,ePopup:r,alignSide:s,nudgeX:h,nudgeY:g,position:`under`,keepWithinBounds:!0}),c&&e.showTab?.(c),this.dispatchVisibleChangedEvent(!0,!1,_,v,c)},n,c,p,t,r)}showMenu(e,t,n,r,i,o,s,c){let p=this.getMenuParams(e,t,o,s);if(!p)return;let{menu:m,eMenuGui:h,anchorToElement:g,restoreFocusParams:_}=p,v=[],{menuUtils:y,popupSvc:b}=this.beans;v.push(t=>{let n=m.getGui();this.destroyBean(m),e&&(gl(e,!1,`contextMenu`),y.restoreFocusOnClose(_,n,t)),c?.()});let x=this.getLocaleTextFunc();
5if(b.addPopup({modal:!0,eChild:h,closeOnEsc:!0,closedCallback:n=>{for(let e of v)e(n);this.dispatchVisibleChangedEvent(!1,!1,e,t,i)},afterGuiAttached:e=>m.afterGuiAttached(Object.assign({},{container:r},e)),positionCallback:i?()=>n(m):void 0,ariaLabel:x(`ariaLabelColumnMenu`,`Column Menu`)}),i||(m.showTabBasedOnPreviousSelection?.(),n(m)),Co(this.gos)){let t=b.setPopupPositionRelatedToElement(h,g);t&&e&&this.addStopAnchoring(t,e,v)}m.addEventListener(`tabSelected`,t=>{this.dispatchVisibleChangedEvent(!1,!0,e),this.lastSelectedTab=t.key,this.dispatchVisibleChangedEvent(!0,!0,e)}),e&&gl(e,!0,`contextMenu`),this.activeMenu=m,m.addEventListener(`destroyed`,()=>{this.activeMenu===m&&(this.activeMenu=null)})}addStopAnchoring(e,t,n){e.then(e=>{t.__addEventListener(`leftChanged`,e),t.__addEventListener(`visibleChanged`,e),n.push(()=>{t.__removeEventListener(`leftChanged`,e),t.__removeEventListener(`visibleChanged`,e)})})}getMenuParams(e,t,n,r){let{focusSvc:i,visibleCols:o,ctrlsSvc:s}=this.beans,c={column:e,headerPosition:i.focusedHeader,columnIndex:o.allCols.indexOf(e),eventSource:r},p=this.createMenu(e,t,c,n,r);return p?{menu:p,eMenuGui:p.getGui(),anchorToElement:r||s.getGridBodyCtrl().eGridBody,restoreFocusParams:c}:void 0}createMenu(e,t,n,r,i){if(po(this.gos))return this.createBean(new TabbedColumnMenu(e,n,this.lastSelectedTab,r,i));{let r=this.beans.colMenuFactory.getMenuItems(e,t);return r.length?this.createBean(new ColumnContextMenu(r,e,n,i)):void 0}}dispatchVisibleChangedEvent(e,t,n,r,i){this.eventSvc.dispatchEvent({type:`columnMenuVisibleChanged`,visible:e,switchingTab:t,key:this.lastSelectedTab??i??(po(this.gos)?Lg:`columnMenu`),column:n??null,columnGroup:r??null})}isMenuEnabled(e){if(!po(this.gos))return!0;let t=!this.beans.filterManager?.isFilterAllowed(e),n=e.getColDef().menuTabs??zg;return(t&&n.includes(Ig)?n.length-1:n.length)>0}showMenuAfterContextMenuEvent(e,t,n){this.beans.menuUtils.onContextMenu({mouseEvent:t,touchEvent:n,source:`ui`,showMenuCallback:t=>(this.showMenuAfterMouseEvent(e,t,`columnMenu`),!0)})}},TabbedColumnMenu=class extends U{constructor(e,t,n,r,i){super(),this.column=e,this.restoreFocusParams=t,this.initialSelection=n,this.restrictTo=r,this.sourceElement=i,this.tabFactories={},this.includeChecks={};let{tabFactories:o,includeChecks:s}=this;o[Lg]=this.createMainPanel.bind(this),o[Ig]=this.createFilterPanel.bind(this),o[Rg]=this.createColumnsPanel.bind(this),s[Lg]=()=>!0,s[Ig]=()=>e?!!this.beans.filterManager?.isFilterAllowed(e):!1,s[Rg]=()=>!0}postConstruct(){let e=new TabbedLayout({items:this.getTabsToCreate().map(e=>this.createTab(e)),cssClass:`ag-menu`,onActiveItemClicked:this.onHidePopup.bind(this),onItemClicked:this.onTabItemClicked.bind(this)});this.tabbedLayout=this.createBean(e),this.mainMenuList?.setParentComponent(e),this.addDestroyFunc(()=>this.destroyBean(e))}getTabsToCreate(){return this.restrictTo?this.restrictTo:(this.column?.getColDef().menuTabs??zg).filter(e=>this.isValidMenuTabItem(e)&&this.isNotSuppressed(e))}isValidMenuTabItem(e){let t=!0,n=zg;return this.restrictTo!=null&&(t=this.restrictTo.indexOf(e)>-1,n=this.restrictTo),t&&=zg.indexOf(e)>-1,t||q(175,{menuTabName:e,itemsToConsider:n}),t}isNotSuppressed(e){return this.includeChecks[e]()}createTab(e){return this.tabFactories[e]()}showTabBasedOnPreviousSelection(){this.showTab(this.initialSelection)}showTab(e){let{tabItemColumns:t,tabbedLayout:n,tabItemFilter:r,tabItemGeneral:i}=this;t&&e===Rg?n.showItem(t):r&&e===Ig?n.showItem(r):i&&e===Lg?n.showItem(i):n.showFirstItem()}onTabItemClicked(e){let t=null;switch(e.item){case this.tabItemColumns:t=Rg;break;case this.tabItemFilter:t=Ig;break;case this.tabItemGeneral:t=Lg}t&&this.activateTab(t)}activateTab(e){let t={type:`tabSelected`,key:e};this.dispatchLocalEvent(t)}createMainPanel(){let{beans:e,column:t}=this,n=e.colMenuFactory,r=n.createMenu(this,n.getMenuItems(t),this.column,()=>this.sourceElement??this.getGui());this.mainMenuList=r,r.addEventListener(`closeMenu`,this.onHidePopup.bind(this));let i={title:J(`legacyMenu`,e,t),titleLabel:Lg.replace(`MenuTab`,``),bodyPromise:eo.resolve(r.getGui()),name:Lg};return this.tabItemGeneral=i,i}onHidePopup(e){this.beans.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,e)}createFilterPanel(){let e=this.column?this.createBean(new _c(this.column,`COLUMN_MENU`)):null;this.filterComp=e,e?.hasFilter()||Hl(119);let afterAttachedCallback=t=>e?.afterGuiAttached(t),afterDetachedCallback=()=>e?.afterGuiDetached();return this.tabItemFilter={title:J(`filterTab`,this.beans,this.column),titleLabel:Ig.replace(`MenuTab`,``),bodyPromise:eo.resolve(e?.getGui()),afterAttachedCallback,afterDetachedCallback,name:Ig},this.tabItemFilter}createColumnsPanel(){let e=Dl({tag:`div`,cls:`ag-menu-column-select-wrapper`}),{beans:t,column:n}=this,r=t.colChooserFactory.createColumnSelectPanel(this,n).getGui();r.classList.add(`ag-menu-column-select`),e.appendChild(r);let i={title:J(`columns`,t,n),titleLabel:Rg.replace(`MenuTab`,``),bodyPromise:eo.resolve(e),name:Rg};return this.tabItemColumns=i,i}
5afterGuiAttached(e){let{container:t,hidePopup:n}=e;this.tabbedLayout.setAfterAttachedParams({container:t,hidePopup:n}),n&&(this.hidePopupFunc=n,this.addDestroyFunc(n))}getGui(){return this.tabbedLayout.getGui()}destroy(){super.destroy(),this.destroyBean(this.filterComp)}},ColumnContextMenu=class extends K{constructor(e,t,n,r){super({tag:`div`,ref:`eColumnMenu`,cls:`ag-menu ag-column-menu`,role:`presentation`}),this.menuItems=e,this.column=t,this.restoreFocusParams=n,this.sourceElement=r,this.eColumnMenu=null}postConstruct(){let e=this.beans.colMenuFactory.createMenu(this,this.menuItems,this.column,()=>this.sourceElement??this.getGui());this.mainMenuList=e,e.addEventListener(`closeMenu`,this.onHidePopup.bind(this)),this.eColumnMenu.appendChild(e.getGui())}onHidePopup(e){this.beans.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,e)}afterGuiAttached({hidePopup:e}){e&&(this.hidePopupFunc=e,this.addDestroyFunc(e)),ja(this.mainMenuList.getGui())}};function showContextMenu(e,t){let{contextMenuSvc:n}=e;if(!n)return;let{rowNode:r,column:i,value:o,x:s,y:c}=t||{},{x:p,y:m}=n.getContextMenuPosition(r,i);s!=null&&(p=s),c!=null&&(m=c),n.showContextMenu({mouseEvent:new MouseEvent(`mousedown`,{clientX:p,clientY:m}),rowNode:r,column:i,value:o,source:`api`})}function showColumnChooser(e,t){e.colChooserFactory?.showColumnChooser({chooserParams:t})}function hideColumnChooser(e){e.colChooserFactory?.hideActiveColumnChooser()}var MenuUtils=class extends U{constructor(){super(...arguments),this.beanName=`menuUtils`}restoreFocusOnClose(e,t,n,r){let{eventSource:i}=e,o=n instanceof KeyboardEvent;if(!r&&!o||!i)return;let s=Lo(this.beans);!t.contains(s)&&!ks(this.beans)||this.focusHeaderCell(e)}closePopupAndRestoreFocusOnSelect(e,t,n){let r;n?.keyboardEvent&&(r=n.keyboardEvent),e(r&&{keyboardEvent:r});let i=this.beans,o=i.focusSvc,s=o.getFocusedCell();if(ks(i)){if(s){let{rowIndex:e,rowPinned:t,column:n}=s;o.setFocusedCell({rowIndex:e,column:n,rowPinned:t,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}else this.focusHeaderCell(t)}}onContextMenu(e){let{mouseEvent:t,touchEvent:n,showMenuCallback:r,source:i}=e;if(!(!this.gos.get(`allowContextMenuWithControlKey`)&&t&&(t.ctrlKey||t.metaKey))&&(t&&this.blockMiddleClickScrollsIfNeeded(t),!(i===`ui`&&this.gos.get(`suppressContextMenu`))&&r(t??n.touches[0]))){let e=t??n;e?.cancelable&&e.preventDefault()}}async focusHeaderCell(e){let{column:t,columnIndex:n,headerPosition:r,eventSource:i}=e,{visibleCols:o,headerNavigation:s,focusSvc:c}=this.beans,p=await o.allCols.some(e=>e===t);if(this.isAlive()){if(t?.isAlive()&&p&&i&&El(i)){let e=Ea(i);e&&(s?.scrollToColumn(t),e.focus())}else if(r&&n!==-1){let e=o.allCols,t=e[n]||Kc(e);t&&c.focusHeaderPosition({headerPosition:{headerRowIndex:r.headerRowIndex,column:t}})}}}blockMiddleClickScrollsIfNeeded(e){this.gos.get(`suppressMiddleClickScrolls`)&&e.which===2&&e.preventDefault()}},Bg={moduleName:`MenuCore`,version:Z,beans:[MenuItemMapper,ChartMenuItemMapper,MenuUtils],icons:{chart:`chart`,columns:`columns`,loadingMenuItems:`loading`,menuPin:`pin`,menuValue:`aggregation`,menuAddRowGroup:`group`,menuRemoveRowGroup:`group`,clipboardCopy:`copy`,clipboardCut:`cut`,clipboardPaste:`paste`,save:`save`,csvExport:`csv`,excelExport:`excel`,sortAscending:`asc`,sortDescending:`desc`,sortUnSort:`none`},dependsOn:[fh,Ra,io,pg]},Vg={moduleName:`ColumnMenu`,version:Z,beans:[EnterpriseMenuFactory,ColumnMenuFactory,ColumnChooserFactory],icons:{ensureColumnVisible:`column-arrow`,legacyMenu:`menu`,filterTab:`filter`,columnSelectClosed:`tree-closed`,columnSelectOpen:`tree-open`,columnSelectIndeterminate:`tree-indeterminate`},apiFunctions:{showColumnChooser,hideColumnChooser},dependsOn:[Bg,zo,Pl]},Hg={moduleName:`ContextMenu`,version:Z,beans:[ContextMenuService],apiFunctions:{showContextMenu},dependsOn:[Bg]},RichSelectCellEditor=class extends Xo{constructor(){super({tag:`div`,cls:`ag-cell-edit-wrapper`}),this.isAsync=!1}initialiseEditor(e){let{cellStartedEdit:t,values:n,eventKey:r}=this.params;dl(n)&&q(180);let{params:i,valuesPromise:o}=this.buildRichSelectParams(),s=this.createManagedBean(new AgRichSelect(i));this.eEditor=s,s.addCss(`ag-cell-editor`),this.appendChild(s),o&&(this.isAsync=!0,o.then(e=>{s.setValueList({valueList:e,refresh:!0});let t=this.getSearchStringCallback(e);t&&s.setSearchStringCreator(t),this.processEventKey(r)})),this.addManagedListeners(s,{fieldPickerValueSelected:this.onEditorPickerValueSelected.bind(this)}),this.focusAfterAttached=t}onEditorPickerValueSelected(e){this.gos.get(`editType`)!==`fullRow`&&setTimeout(()=>this.params.stopEditing(!e.fromEnterKey))}buildRichSelectParams(){let e=this.params,{cellRenderer:t,cellRendererParams:n,cellHeight:r,value:i,values:o,formatValue:s,searchDebounceDelay:c,valueListGap:p,valueListMaxHeight:m,valueListMaxWidth:h,allowTyping:g,filterList:_,searchType:v,highlightMatch:y,valuePlaceholder:b,eventKe
5y:x,multiSelect:S,suppressDeselectAll:C,suppressMultiSelectPillRenderer:w}=e,T={value:i,cellRenderer:t,cellRendererParams:n,cellRowHeight:r,searchDebounceDelay:c,valueFormatter:s,pickerAriaLabelKey:`ariaLabelRichSelectField`,pickerAriaLabelValue:`Rich Select Field`,pickerType:`virtual-list`,pickerGap:p,allowTyping:g,filterList:_,searchType:v,highlightMatch:y,maxPickerHeight:m,maxPickerWidth:h,placeholder:b,initialInputValue:x?.length===1?x:x===G.BACKSPACE?``:void 0,multiSelect:S,suppressDeselectAll:C,suppressMultiSelectPillRenderer:w},E,D;return E=typeof o==`function`?o(e):o??[],Array.isArray(E)?(T.valueList=E,T.searchStringCreator=this.getSearchStringCallback(E)):D=E,S&&g&&(e.allowTyping=T.allowTyping=!1,q(181)),{params:T,valuesPromise:D}}getSearchStringCallback(e){if(typeof e[0]!=`object`)return;let t=this.params,{colDef:n,formatValue:r}=t;if(n.cellEditorParams?.formatValue)return e=>e.map(r);let{keyCreator:i}=n;if(i){q(266);let{column:e,node:r,data:o}=t;return t=>t.map(t=>{let s=co(this.gos,{value:t,colDef:n,column:e,node:r,data:o});return i(s)})}return e=>e.map(r)}afterGuiAttached(){let{focusAfterAttached:e,params:t}=this;setTimeout(()=>{if(!this.isAlive())return;let n=this.eEditor,{allowTyping:r,eventKey:i,cellStartedEdit:o}=t;if(e){let e=n.getFocusableElement();e.focus(),r&&(!i||i.length!==1)&&e.select()}o&&n.showPicker(),this.isAsync||this.processEventKey(i)})}processEventKey(e){e&&(e===G.BACKSPACE?this.eEditor.searchTextFromString(null):e?.length===1&&this.eEditor.searchTextFromString(e))}focusIn(){this.eEditor.getFocusableElement().focus()}getValue(){let{params:e}=this,t=this.eEditor.getValue();return e.parseValue?.(t)??t}isPopup(){return!1}getValidationElement(){return this.eEditor.getAriaElement()}getValidationErrors(){let{params:e}=this,{getValidationErrors:t}=e;return t?t({value:this.getValue(),internalErrors:null,cellEditorParams:e}):null}},Ug={moduleName:`RichSelect`,version:Z,beans:[],userComponents:{agRichSelect:RichSelectCellEditor,agRichSelectCellEditor:RichSelectCellEditor},icons:{richSelectOpen:`small-down`,richSelectRemove:`cancel`},dependsOn:[fh,nc]},Wg=`__AG_SELECT_ALL__`,Gg=`__AG_ADD_SELECTION_TO_FILTER__`,FlatSetDisplayValueModel=class{constructor(e,t,n,r){this.valueSvc=e,this.getValueFormatter=t,this.formatter=n,this.column=r,this.displayedKeys=[]}updateDisplayedValuesToAllAvailable(e,t,n){this.displayedKeys=Array.from(n)}updateDisplayedValuesToMatchMiniFilter(e,t,n,r,i){this.displayedKeys=[];let o=this.getValueFormatter();for(let t of n)if(t==null)i&&this.displayedKeys.push(t);else{let n=e(t),i=this.valueSvc.formatValue(this.column,null,n,o,!1);r(this.formatter(i))&&this.displayedKeys.push(t)}}getDisplayedValueCount(){return this.displayedKeys.length}getDisplayedItem(e){return this.displayedKeys[e]}getSelectAllItem(){return Wg}getAddSelectionToFilterItem(){return Gg}getDisplayedKeys(){return this.displayedKeys}forEachDisplayedKey(e){this.displayedKeys.forEach(e)}someDisplayedKey(e){return this.displayedKeys.some(e)}hasGroups(){return!1}refresh(){}},Kg={tag:`div`,cls:`ag-set-filter-item`,attrs:{"aria-hidden":`true`},children:[{tag:`span`,cls:`ag-set-filter-group-icons`,children:[{tag:`span`,ref:`eGroupClosedIcon`,cls:`ag-set-filter-group-closed-icon`},{tag:`span`,ref:`eGroupOpenedIcon`,cls:`ag-set-filter-group-opened-icon`},{tag:`span`,ref:`eGroupIndeterminateIcon`,cls:`ag-set-filter-group-indeterminate-icon`}]},{tag:`ag-checkbox`,ref:`eCheckbox`,cls:`ag-set-filter-item-checkbox`}]},qg={tag:`div`,cls:`ag-set-filter-item`,children:[{tag:`ag-checkbox`,ref:`eCheckbox`,cls:`ag-set-filter-item-checkbox`}]},SetFilterListItem=class extends K{constructor(e){super(e.isGroup?Kg:qg,[Pa]),this.eCheckbox=null,this.eGroupOpenedIcon=null,this.eGroupClosedIcon=null,this.eGroupIndeterminateIcon=null,this.formattedValue=null,this.focusWrapper=e.focusWrapper,this.value=e.value,this.params=e.params,this.translate=e.translate,this.valueFormatter=e.valueFormatter,this.item=e.item,this.isSelected=e.isSelected,this.isTree=e.isTree,this.depth=e.depth??0,this.isGroup=e.isGroup,this.groupsExist=e.groupsExist,this.isExpanded=e.isExpanded,this.hasIndeterminateExpandState=e.hasIndeterminateExpandState}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean(`tooltipFeature`,!1,{getGui:()=>this.focusWrapper,getLocation:()=>`setFilterValue`,shouldDisplayTooltip:()=>this.shouldDisplayTooltip?.()??!0,getAdditionalParams:()=>{let{colDef:e,column:t}=this.params,n={colDef:e,column:t,valueFormatted:this.formattedValue??void 0};return this.isTree&&(n.level=this.depth),n}})),this.addDestroyFunc(()=>this.destroyCellRendererComponent?.()),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.addCss(`ag-set-filter-indent-`+this.depth),this.getGui().style.setProperty(`--ag-indentation-level`,String(this.depth))),this.isGroup?this.setupExpansion():this.groupsExist&&this.addCss(`ag-set-filter-add-group-indent`),ps(this.getAriaElement(),this.depth+1)),this.refreshAriaChecked(),!this.params.readOnly&&this.eCheckbox.onValueChange(e=>this.onCheckboxChanged(!!e))}getFocusableElement(){return this.focusWrapper}setupExpansion(){let{eGroupClosedIcon:e,eGroupOpenedIcon:t,eGroupIndeterminateIcon:n,hasIndeterminateExpandState:r,beans:i}=this;e.appendChild(qc(`setFilterGroupClosed`,i,null)),t.appendChild(qc(`setFilterGroupOpen`,i,null));let o=this.onExpandOrContractClicked.bind(this);this.addManagedElementListeners(e,{click:o}),this.addManagedElementListeners(t,{click:o}),r&&(n.appendChild(qc(`setFilterGroupIndeterminate`,i,null)),this.addManagedElementListeners(n,{click:o})),this.setExpandedIcons(),this.refreshAriaExpanded()}onExpandOrContractClicked(){this.setExpanded(!this.isExpanded)}setExpanded(e,t){if(this.isGroup&&e!==this.isExpanded){this.isExpanded=e;let n={type:`expandedChanged`,isExpanded:!!e,item:this.item};t||this.dispatchLocalEvent(n),this.setExpandedIcons(),this.refreshAriaExpanded()}}setExpandedIcons(){let{isExpanded:e,hasIndeterminateExpandState:t,eGroupClosedIcon:n,eGroupOpenedIcon:r,eGroupIndeterminateIcon:i}=this;W(n,t?e===!1:!e),W(r,e===!0),t&&W(i,e===void 0)}onCheckboxChanged(e){this.isSelected=e;let t={type:`selectionChanged`,isSelected:e,item:this.item};this.dispatchLocalEvent(t),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;let e=this.getLocaleTextFunc(),t=this.eCheckbox.getValue(),n=t===void 0?e(`ariaIndeterminate`,`indeterminate`):t?e(`ariaVisible`,`visible`):e(`ariaHidden`,`hidden`),r=e(`ariaToggleVisibility`,`Press SPACE to toggle visibility`);ba(this.eCheckbox.getInputElement(),void 0),this.eCheckbox.setInputAriaLabel(`${r} (${n})`)}setupFixedAriaLabels(e){if(!this.isTree)return;let t=this.getLocaleTextFunc()(`ariaFilterValue`,`Filter Value`),n=this.getAriaElement();ou(n,`${e} ${t}`),Io(n,this.eCheckbox.getInputElement().id)}refreshAriaChecked(){let e=this.getAriaElement();Vc(e,this.eCheckbox.getValue())}refreshAriaExpanded(){to(this.getAriaElement(),!!this.isExpanded)}
5refresh(e,t,n){this.item=e,t!==this.isSelected&&this.setSelected(t,!0),this.setExpanded(n,!0);let{cellRendererComponent:r,cellRendererParams:i,beans:o,params:s}=this;if(this.valueFunction){let e=this.valueFunction();this.setTooltipAndCellRendererParams(e,e),r||this.renderCellWithoutCellRenderer()}if(r){let e=su(o.userCompFactory,s,i);if(!r.refresh?.(e?.params??i)){let e=r;this.renderCell(),this.destroyBean(e)}}}render(){let{params:{column:e}}=this,{value:t}=this,n=null;typeof t==`function`?(this.valueFunction=t,n=this.valueFunction(),t=n):n=this.isTree?Al(t):this.getFormattedValue(e,t),this.formattedValue=n,this.setTooltipAndCellRendererParams(t,n),this.renderCell()}setTooltipAndCellRendererParams(e,t){let n=this.gos;if(this.params.showTooltips&&(!nl(n)||!this.params.cellRenderer)){let r=t??Al(e);this.shouldDisplayTooltip=Jl(n,()=>this.eCheckbox.getGui().querySelector(`.ag-label`)),this.tooltipFeature?.setTooltipAndRefresh(r)}this.cellRendererParams=co(n,{value:e,valueFormatted:t,colDef:this.params.colDef,column:this.params.column,setTooltip:(e,t)=>{n.assertModuleRegistered(`Tooltip`,3),this.shouldDisplayTooltip=t,this.tooltipFeature?.setTooltipAndRefresh(e)}})}getFormattedValue(e,t){return this.beans.valueSvc.formatValue(e,null,t,this.valueFormatter,!1)}renderCell(){let e=su(this.beans.userCompFactory,this.params,this.cellRendererParams)?.newAgStackInstance();if(e==null){this.renderCellWithoutCellRenderer();return}e.then(e=>{e&&(this.cellRendererComponent=e,this.eCheckbox.setLabel(e.getGui()),this.destroyCellRendererComponent=()=>this.destroyBean(e))})}renderCellWithoutCellRenderer(){let{valueFormatted:e,value:t}=this.cellRendererParams,n=e??t??this.translate(`blanks`);typeof n!=`string`&&(q(208),n=``),this.eCheckbox.setLabel(n),this.setupFixedAriaLabels(n)}getComponentHolder(){return this.params.column.getColDef()}},Jg={loadingOoo:`Loading...`,blanks:`(Blanks)`,searchOoo:`Search...`,selectAll:`(Select All)`,selectAllSearchResults:`(Select All Search Results)`,addCurrentSelectionToFilter:`Add current selection to filter`,noMatches:`No matches.`,ariaSearchFilterValues:`Search filter values`,ariaFilterList:`Filter List`,filterSummaryListInactive:`is (All)`,filterSummaryListSeparator:`, `,filterSummaryListShort:e=>`is (${e[0]})`,filterSummaryListLong:e=>`is (${e[0]}) and ${e[1]} more`};function processDataPath(e,t,n){let r=e;return r?(r=r.map(e=>Al(ic(e))),!t&&n&&r.some(e=>e==null)?Kc(r)==null?null:r.filter(e=>e!=null):r):null}function translateForSetFilter(e,t,n){return tl(e,Jg,t,n)}function applyExcelModeOptions(e){e.excelMode===`windows`?(e.buttons||=[`apply`,`cancel`],e.closeOnApply??=!0):e.excelMode===`mac`&&(e.buttons||=[`reset`],e.applyMiniFilterWhileTyping??=!0,e.debounceMs??=500),e.excelMode&&e.defaultToNothingSelected&&(e.defaultToNothingSelected=!1,q(207))}function createTreeDataOrGroupingComparator(){return([e,t],[n,r])=>{if(t==null)return r==null?0:-1;if(r==null)return 1;for(let e=0;e<t.length;e++){if(e>=r.length)return 1;let n=fl(t[e],r[e]);if(n!==0)return n}return 0}}var TreeSetDisplayValueModel=class{constructor(e,t,n,r){this.formatter=e,this.treeListPathGetter=t,this.treeListFormatter=n,this.treeDataOrGrouping=r,this.allDisplayedItemsTree=new Map,this.activeDisplayedItemsFlat=[],this.selectAllItem={depth:0,filterPasses:!0,available:!0,treeKey:Wg,children:this.allDisplayedItemsTree,expanded:!0,key:Wg,parentTreeKeys:[]},this.addSelectionToFilterItem={depth:0,filterPasses:!0,available:!0,treeKey:Gg,expanded:!0,key:Gg,parentTreeKeys:[]}}updateParams(e,t){this.treeListPathGetter=e,this.treeListFormatter=t}updateDisplayedValuesToAllAvailable(e,t,n,r){r===`reload`?this.generateItemTree(e,t,n):r===`otherFilter`?(this.updateAvailable(n),this.updateExpandAll()):r===`miniFilter`&&(this.resetFilter(),this.updateExpandAll()),this.flattenItems()}updateDisplayedValuesToMatchMiniFilter(e,t,n,r,i,o){o===`reload`?this.generateItemTree(e,t,n):o===`otherFilter`&&this.updateAvailable(n),this.updateFilter(r,i),this.updateExpandAll(),this.flattenItems()}generateItemTree(e,t,n){let r=new Map;this.allDisplayedItemsTree=r;let i=!1,o=this.getTreeListPathGetter(e,n);for(let s of t){let t=o(e(s))??[null],c=t.length;c>1&&(i=!0);let p=n.has(s),m=r,h,g=[];for(let e=0;e<c;e++){let n=t[e];m||(m=new Map,h.children=m);let r=n?.toUpperCase()??null;
5h=m.get(r),h||(h={treeKey:n,depth:e,filterPasses:!0,expanded:!1,available:p,parentTreeKeys:g},e===t.length-1&&(h.key=s),m.set(r,h)),m=h.children,g=[...g,n]}}this.groupsExist=i,this.updateAvailable(n),this.selectAllItem.children=r,this.selectAllItem.expanded=!1}getTreeListPathGetter(e,t){if(this.treeListPathGetter)return this.treeListPathGetter;if(this.treeDataOrGrouping)return e=>e;let n=!1;for(let r of t){let t=e(r);if(t instanceof Date){n=!0;break}if(t!=null)break}return n?e=>ys(e,!1):(q(211),e=>[String(e)])}flattenItems(){this.activeDisplayedItemsFlat=[];let recursivelyFlattenDisplayedItems=e=>{for(let t of e.values())!t.filterPasses||!t.available||(this.activeDisplayedItemsFlat.push(t),t.children&&t.expanded&&recursivelyFlattenDisplayedItems(t.children))};recursivelyFlattenDisplayedItems(this.allDisplayedItemsTree)}resetFilter(){let recursiveFilterReset=e=>{let t=e.children;if(t)for(let e of t.values())recursiveFilterReset(e);e.filterPasses=!0};for(let e of this.allDisplayedItemsTree.values())recursiveFilterReset(e)}updateFilter(e,t){let passesFilter=n=>n.available?n.treeKey==null?t:e(this.formatter(this.treeListFormatter?this.treeListFormatter(n.treeKey,n.depth,n.parentTreeKeys):n.treeKey)):!1;for(let e of this.allDisplayedItemsTree.values())this.recursiveItemCheck(e,!1,passesFilter,`filterPasses`)}getDisplayedValueCount(){return this.activeDisplayedItemsFlat.length}getDisplayedItem(e){return this.activeDisplayedItemsFlat[e]}getSelectAllItem(){return this.selectAllItem}getAddSelectionToFilterItem(){return this.addSelectionToFilterItem}getDisplayedKeys(){let e=[];return this.forEachDisplayedKey(t=>e.push(t)),e}forEachDisplayedKey(e){let recursiveForEachItem=(t,n)=>{let r=t.children;if(r){if(!t.expanded||!n)for(let e of r.values())e.filterPasses&&recursiveForEachItem(e,!1)}else e(t.key)};for(let e of this.activeDisplayedItemsFlat)recursiveForEachItem(e,!0)}someDisplayedKey(e){let recursiveSomeItem=(t,n)=>{let r=t.children;if(r){if(!t.expanded||!n){for(let e of r.values())if(e.filterPasses&&recursiveSomeItem(e,!1))return!0;return!1}}else return e(t.key);return!1};return this.activeDisplayedItemsFlat.some(e=>recursiveSomeItem(e,!0))}hasGroups(){return this.groupsExist}refresh(){this.updateExpandAll(),this.flattenItems()}updateExpandAll(){let recursiveExpansionCheck=(e,t,n)=>{for(let r of e.values()){if(!r.filterPasses||!r.available||!r.children)continue;if(t||=!!r.expanded,n||=!r.expanded,t&&n)return;let e=recursiveExpansionCheck(r.children,t,n);if(e===void 0)return;e?t=!0:n=!0}return t&&n?void 0:t},e=this.getSelectAllItem();e.expanded=recursiveExpansionCheck(e.children,!1,!1)}recursiveItemCheck(e,t,n,r){let i=!1,o=e.children;if(o)for(let s of o.values()){let o=this.recursiveItemCheck(s,t||n(e),n,r);i||=o}let s=t||i||n(e);return e[r]=s,s}updateAvailable(e){let isAvailable=t=>e.has(t.key);for(let e of this.allDisplayedItemsTree.values())this.recursiveItemCheck(e,!1,isAvailable,`available`)}},SetFilter=class extends Po{constructor(){super(`setFilter`,`set-filter`),this.filterType=`set`,this.eMiniFilter=null,this.eFilterLoading=null,this.eFilterLoadingIcon=null,this.eSetFilterList=null,this.eFilterNoMatches=null,this.hardRefreshVirtualList=!1,this.miniFilterText=null,this.addCurrentSelectionToFilter=!1,this.selectedKeys=new Set}setParams(e){super.setParams(e);let t=this.updateHandler(e.getHandler()),{column:n,textFormatter:r,treeList:i,treeListPathGetter:o,treeListFormatter:s}=e;this.formatter=r??(e=>e??null),this.displayValueModel=i?new TreeSetDisplayValueModel(this.formatter,o,s,t.isTreeDataOrGrouping()):new FlatSetDisplayValueModel(this.beans.valueSvc,()=>this.handler.valueFormatter,this.formatter,n),t.valueModel.allKeys.then(e=>{this.isAlive()&&(this.updateDisplayedValues(`reload`,e??[]),this.resetSelectionState(e??[]))}),t.valueModel.isLoading()&&this.setIsLoading(!0),this.initialiseFilterBodyUi()}refresh(e){return this.params.treeList===e.treeList&&(this.updateHandler(e.getHandler()),super.refresh(e))}updateParams(e,t){super.updateParams(e,t),this.updateMiniFilter(),e.suppressSelectAll!==t.suppressSelectAll&&this.createVirtualListModel(e);let{textFormatter:n,treeListPathGetter:r,treeListFormatter:i}=e;this.formatter=n??(e=>e??null),this.displayValueModel instanceof TreeSetDisplayValueModel&&this.displayValueModel.updateParams(r,i),this.handler.refreshFilterValues(!0)}updateHandler(e){if(this.handler!==e){for(let e of this.handlerDestroyFuncs??[])e();this.handlerDestroyFuncs=[...this.addManagedListeners(e,{anyFilterChanged:t=>{e.valueModel.allKeys.then(e=>{this.isAlive()&&(this.updateDisplayedValues(`otherFilter`,e??[]),t.updated&&(this.checkAndRefreshVirtualList(),this.showOrHideResults()))})},dataChanged:({hardRefresh:t})=>{e.valueModel.allKeys.then(e=>{this.isAlive()&&(this.updateDisplayedValues(`reload`,e??[]),this.setSelectedModel(this.state.model?.values??null),t&&(this.hardRefreshVirtualList=!0),this.checkAndRefreshVirtualList())})}}),...this.addManagedListeners(e.valueModel,{loadingStart:()=>this.setIsLoading(!0),loadingEnd:()=>this.setIsLoading(!1)})],this.handler=e}return e}updateUiVisibility(){}createBodyTemplate(){return{tag:`div`,cls:`ag-set-filter`,children:[{tag:`div`,ref:`eFilterLoading`,cls:`ag-filter-loading ag-loading ag-hidden`,children:[{tag:`span`,ref:`eFilterLoadingIcon`,cls:`ag-loading-icon`},{tag:`span`,cls:`ag-loading-text`,children:translateForSetFilter(this,`loadingOoo`)}]},{tag:`ag-input-text-field`,ref:`eMiniFilter`,cls:`ag-mini-filter`},{tag:`div`,ref:`eFilterNoMatches`,cls:`ag-filter-no-matches ag-hidden`,children:translateForSetFilter(this,`noMatches`)},{tag:`div`,ref:`eSetFilterList`,cls:`ag-set-filter-list`,role:`presentation`}]}}getAgComponents(){return[To]}handleKeyDown(e){if(super.handleKeyDown(e),e.defaultPrevented)return;let getComponentForKeyEvent=()=>{if(!this.eSetFilterList.contains(Lo(this.beans)))return;let t=this.virtualList.getLastFocusedRow();if(t==null)return;let n=this.virtualList.getComponentAt(t);if(n==null)return;e.preventDefault();let{readOnly:r}=this.params;if(!r)return n};switch(e.key){case G.SPACE:getComponentForKeyEvent()?.toggleSelected();break;case G.ENTER:this.handleKeyEnter(e);break;case G.LEFT:getComponentForKeyEvent()?.setExpanded(!1);break;case G.RIGHT:getComponentForKeyEvent()?.setExpanded(!0)}}handleKeyEnter(e){e.preventDefault();let{excelMode:t,readOnly:n}=this.params;!t||n||(this.params.onAction(`apply`,void 0,e),this.params.excelMode===`mac`&&this.eMiniFilter.getInputElement().select())}setModelAndRefresh(e){return this.setSelectedModel(e).then(()=>{this.isAlive()&&this.checkAndRefreshVirtualList()})}setModelIntoUi(e){this.setMiniFilter(this.params.state.state?.miniFilterValue??null,!0);let t=e==null?null:e.values;return this.setModelAndRefresh(t)}getModelFromUi(){let e=this.getSelectedModel();return e?{values:e,filterType:this.filterType}:null}areNonNullModelsEqual(e,t){return pa(e.values,t.values)}setIsLoading(e){W(this.eFilterLoading,e),e||(this.hardRefreshVirtualList=!0)}initialiseFilterBodyUi(){this.initVirtualList(),this.initMiniFilter(),this.initLoading()}initLoading(){let e=J(`setFilterLoading`,this.beans,this.params.column);e&&this.eFilterLoadingIcon.appendChild(e)}initVirtualList(){let e=translateForSetFilter(this,`ariaFilterList`),t=!!this.params.treeList,
5n=this.virtualList=this.createBean(new VirtualList({cssIdentifier:`filter`,ariaRole:t?`tree`:`listbox`,listName:e})),r=this.eSetFilterList;t&&r.classList.add(`ag-set-filter-tree-list`),r.appendChild(n.getGui());let{cellHeight:i}=this.params;i!=null&&n.setRowHeight(i);let componentCreator=(e,n)=>this.createSetListItem(e,t,n);n.setComponentCreator(componentCreator);let componentUpdater=(e,t)=>this.updateSetListItem(e,t);n.setComponentUpdater(componentUpdater),this.createVirtualListModel(this.params)}createVirtualListModel(e){let t;t=e.suppressSelectAll?new ModelWrapper(this.displayValueModel):new ModelWrapperWithSelectAll(this.displayValueModel,this.showAddCurrentSelectionToFilter.bind(this)),e.treeList&&(t=new TreeModelWrapper(t)),this.virtualList.setModel(t)}getSelectAllLabel(){let e=this.miniFilterText==null||!this.params.excelMode?`selectAll`:`selectAllSearchResults`;return translateForSetFilter(this,e)}getAddSelectionToFilterLabel(){return translateForSetFilter(this,`addCurrentSelectionToFilter`)}createSetListItem(e,t,n){let r=this.displayValueModel.hasGroups(),{isSelected:i,isExpanded:o}=this.isSelectedExpanded(e),{value:s,depth:c,isGroup:p,hasIndeterminateExpandState:m,selectedListener:h,expandedListener:g}=this.newSetListItemAttributes(e),_={focusWrapper:n,value:s,params:this.params,translate:e=>translateForSetFilter(this,e),valueFormatter:this.handler.valueFormatter,item:e,isSelected:i,isTree:t,depth:c,groupsExist:r,isGroup:p,isExpanded:o,hasIndeterminateExpandState:m},v=this.createBean(new SetFilterListItem(_));return v.addEventListener(`selectionChanged`,h),g&&v.addEventListener(`expandedChanged`,g),v}newSetTreeItemAttributes(e){let t=this.displayValueModel.hasGroups();return e.key===Wg?{value:()=>this.getSelectAllLabel(),isGroup:t,depth:e.depth,hasIndeterminateExpandState:!0,selectedListener:e=>this.onSelectAll(e.isSelected),expandedListener:e=>this.onExpandAll(e.item,e.isExpanded)}:e.key===Gg?{value:()=>this.getAddSelectionToFilterLabel(),depth:e.depth,isGroup:!1,hasIndeterminateExpandState:!1,selectedListener:e=>{this.addCurrentSelectionToFilter=e.isSelected,this.refreshAfterSelection()}}:e.children?{value:this.params.treeListFormatter?.(e.treeKey,e.depth,e.parentTreeKeys)??e.treeKey,depth:e.depth,isGroup:!0,selectedListener:e=>this.onGroupItemSelected(e.item,e.isSelected),expandedListener:e=>this.onExpandedChanged(e.item,e.isExpanded)}:{value:this.params.treeListFormatter?.(e.treeKey,e.depth,e.parentTreeKeys)??e.treeKey,depth:e.depth,selectedListener:e=>this.onItemSelected(e.item.key,e.isSelected)}}newSetListItemAttributes(e){return this.isSetFilterModelTreeItem(e)?this.newSetTreeItemAttributes(e):e===Wg?{value:()=>this.getSelectAllLabel(),selectedListener:e=>this.onSelectAll(e.isSelected)}:e===Gg?{value:()=>this.getAddSelectionToFilterLabel(),selectedListener:e=>{this.addCurrentSelectionToFilter=e.isSelected,this.refreshAfterSelection()}}:{value:this.handler.valueModel.allValues.get(e)??null,selectedListener:e=>this.onItemSelected(e.item,e.isSelected)}}updateSetListItem(e,t){let{isSelected:n,isExpanded:r}=this.isSelectedExpanded(e);t.refresh(e,n,r)}isSelectedExpanded(e){let t,n;return this.isSetFilterModelTreeItem(e)?(n=e.expanded,t=e.key===Wg?this.isSelectAllSelected():e.key===Gg?this.isAddCurrentSelectionToFilterChecked():e.children?this.areAllChildrenSelected(e):this.selectedKeys.has(e.key)):t=e===Wg?this.isSelectAllSelected():e===Gg?this.isAddCurrentSelectionToFilterChecked():this.selectedKeys.has(e),{isSelected:t,isExpanded:n}}isSetFilterModelTreeItem(e){return e?.treeKey!==void 0}initMiniFilter(){let{eMiniFilter:e}=this;this.updateMiniFilter(),e.onValueChange(()=>this.onMiniFilterInput()),e.setInputAriaLabel(translateForSetFilter(this,`ariaSearchFilterValues`)),this.addManagedElementListeners(e.getInputElement(),{keydown:e=>this.onMiniFilterKeyDown(e)})}updateMiniFilter(){let{eMiniFilter:e,miniFilterText:t,params:n}=this;e.setDisplayed(!n.suppressMiniFilter),e.setValue(t)}afterGuiAttached(e){super.afterGuiAttached(e),this.resetExpansion(),this.refreshVirtualList();let{eMiniFilter:t}=this;t.setInputPlaceholder(translateForSetFilter(this,`searchOoo`)),e?.suppressFocus||(t.isDisplayed()?t.getFocusableElement().focus():this.virtualList.awaitStable(()=>this.virtualList.focusRow(0)))}afterGuiDetached(){super.afterGuiDetached();
5let{column:e,excelMode:t,model:n,onStateChange:r}=this.params;this.beans.colFilter?.shouldKeepStateOnDetach(e)||(t&&this.resetMiniFilter(),(t||n!==this.state.model)&&(r({model:n,state:this.getState()}),this.showOrHideResults()))}canApply(e){return!this.params.excelMode||e==null||e.values.length>0}onNewRowsLoaded(){}setFilterValues(e){q(283),this.handler.setFilterValues(e)}resetFilterValues(){q(283),this.handler.resetFilterValues()}refreshFilterValues(){q(283),this.doRefreshFilterValues()}doRefreshFilterValues(){this.handler.refreshFilterValues()}onAnyFilterChanged(){}onMiniFilterInput(e){if(!this.doSetMiniFilter(this.eMiniFilter.getValue()))return;if(e){this.showOrHideResults();return}let{applyMiniFilterWhileTyping:t,readOnly:n,excelMode:r}=this.params,i=!n&&(t||!!r),o=t&&!n?`debounce`:void 0;this.updateUiAfterMiniFilterChange(i,o)}updateUiAfterMiniFilterChange(e,t){if(e){let{excelMode:e,readOnly:t,model:n}=this.params;e&&!t&&this.miniFilterText==null?this.setModelAndRefresh(n?.values??null):this.selectAllMatchingMiniFilter(!0)}this.checkAndRefreshVirtualList(),this.onUiChanged(e?t:`prevent`),this.showOrHideResults()}showOrHideResults(){let e=this.miniFilterText!=null&&this.displayValueModel.getDisplayedValueCount()<1;W(this.eFilterNoMatches,e),W(this.eSetFilterList,!e)}resetMiniFilter(){this.eMiniFilter.setValue(null,!0),this.doSetMiniFilter(null)}onMiniFilterKeyDown(e){let{excelMode:t,readOnly:n}=this.params;e.key===G.ENTER&&!t&&!n&&this.updateUiAfterMiniFilterChange(!0,`immediately`)}focusRowIfAlive(e){return e==null?Promise.resolve():new Promise(t=>{window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(e),t()},0)})}onSelectAll(e){e?this.selectAllMatchingMiniFilter():this.deselectAllMatchingMiniFilter(),this.refreshAfterSelection()}onGroupItemSelected(e,t){let recursiveGroupSelection=e=>{if(!e.filterPasses)return;let n=e.children;if(n)for(let e of n.values())recursiveGroupSelection(e);else this.setKeySelected(e.key,t)};recursiveGroupSelection(e),this.refreshAfterSelection()}onItemSelected(e,t){this.setKeySelected(e,t),this.refreshAfterSelection()}onExpandAll(e,t){let recursiveExpansion=e=>{if(e.filterPasses&&e.available&&e.children){for(let t of e.children.values())recursiveExpansion(t);e.expanded=t}};recursiveExpansion(e),this.refreshAfterExpansion()}onExpandedChanged(e,t){e.expanded=t,this.refreshAfterExpansion()}refreshAfterExpansion(){let e=this.virtualList.getLastFocusedRow();this.updateDisplayedValues(`expansion`),this.checkAndRefreshVirtualList(),this.focusRowIfAlive(e)}refreshAfterSelection(){let e=this.virtualList.getLastFocusedRow();this.checkAndRefreshVirtualList(),this.onUiChanged(),this.focusRowIfAlive(e)}setMiniFilter(e,t){this.eMiniFilter.setValue(e,t),this.onMiniFilterInput(t)}doSetMiniFilter(e){return e=ic(e),this.miniFilterText!==e&&(e===null&&(this.addCurrentSelectionToFilter=!1),this.miniFilterText=e,this.updateDisplayedValues(`miniFilter`),!0)}getMiniFilter(){return this.miniFilterText}getUiChangeEventParams(){return{miniFilterValue:this.miniFilterText}}getState(){let e=this.miniFilterText;return e?{miniFilterValue:e}:void 0}
5checkAndRefreshVirtualList(){this.virtualList.refresh(!this.hardRefreshVirtualList),this.hardRefreshVirtualList&&=!1}getFilterKeys(){return q(283),this.handler.getFilterKeys()}getFilterValues(){return q(283),this.handler.getFilterValues()}refreshVirtualList(){this.params.refreshValuesOnOpen?this.doRefreshFilterValues():this.checkAndRefreshVirtualList()}isSelectAllSelected(){if(this.params.defaultToNothingSelected){if(this.hasSelections()&&this.isEverythingVisibleSelected())return!0;if(this.isNothingVisibleSelected())return!1}else{if(this.hasSelections()&&this.isNothingVisibleSelected())return!1;if(this.isEverythingVisibleSelected())return!0}}areAllChildrenSelected(e){let recursiveChildSelectionCheck=e=>{if(e.children){let t=!1,n=!1;for(let r of e.children.values()){if(!r.filterPasses||!r.available)continue;let e=recursiveChildSelectionCheck(r);if(e===void 0||(e?t=!0:n=!0,t&&n))return}return t}return this.selectedKeys.has(e.key)};return this.params.defaultToNothingSelected?this.hasSelections()&&recursiveChildSelectionCheck(e):recursiveChildSelectionCheck(e)}resetExpansion(){if(!this.params.treeList)return;let e=this.displayValueModel.getSelectAllItem();if(this.isSetFilterModelTreeItem(e)){let recursiveCollapse=e=>{let t=e.children;if(t){for(let e of t.values())recursiveCollapse(e);e.expanded=!1}};recursiveCollapse(e),this.updateDisplayedValues(`expansion`)}}getModelAsString(e){return this.handler.getModelAsString(e)}getPositionableElement(){return this.eSetFilterList}updateDisplayedValues(e,t){if(e===`expansion`){this.displayValueModel.refresh();return}let n=this.handler,r=n.valueModel;if(this.miniFilterText==null){this.displayValueModel.updateDisplayedValuesToAllAvailable(e=>r.allValues.get(e)??null,t,r.availableKeys,e);return}let i=n.caseFormat(this.formatter(this.miniFilterText)||``),matchesFilter=e=>e!=null&&n.caseFormat(e).includes(i),o=!!this.params.excelMode&&matchesFilter(translateForSetFilter(this,`blanks`));this.displayValueModel.updateDisplayedValuesToMatchMiniFilter(e=>r.allValues.get(e)??null,t,r.availableKeys,matchesFilter,o,e)}hasSelections(){return this.params.defaultToNothingSelected?this.selectedKeys.size>0:this.handler.valueModel.allValues.size!==this.selectedKeys.size}isInWindowsExcelMode(){return this.params.excelMode===`windows`}isAddCurrentSelectionToFilterChecked(){return this.isInWindowsExcelMode()&&this.addCurrentSelectionToFilter}showAddCurrentSelectionToFilter(){return this.isInWindowsExcelMode()&&Xs(this.miniFilterText)&&this.miniFilterText.length>0}selectAllMatchingMiniFilter(e=!1){this.miniFilterText==null?this.selectedKeys=new Set(this.handler.valueModel.allValues.keys()):(e&&this.selectedKeys.clear(),this.displayValueModel.forEachDisplayedKey(e=>this.selectedKeys.add(e)))}deselectAllMatchingMiniFilter(){this.miniFilterText==null?this.selectedKeys.clear():this.displayValueModel.forEachDisplayedKey(e=>this.selectedKeys.delete(e))}setKeySelected(e,t){t?this.selectedKeys.add(e):(this.params.excelMode&&this.isEverythingVisibleSelected()&&this.resetSelectionState(this.displayValueModel.getDisplayedKeys()),this.selectedKeys.delete(e))}isEverythingVisibleSelected(){return!this.displayValueModel.someDisplayedKey(e=>!this.selectedKeys.has(e))}isNothingVisibleSelected(){return!this.displayValueModel.someDisplayedKey(e=>this.selectedKeys.has(e))}getSelectedModel(){if(!this.hasSelections())return null;let e=this.isAddCurrentSelectionToFilterChecked()?this.params.model?.values:void 0;if(e?.length){if(this.selectedKeys){let t=new Set([...e,...this.selectedKeys]);return Array.from(t)}return Array.from(e)}return Array.from(this.selectedKeys)}setSelectedModel(e){let t=this.handler,n=t.valueModel;return n.allKeys.then(r=>{if(e==null)this.resetSelectionState(r??[]);else{this.selectedKeys.clear();let r=new Map;n.allValues.forEach((e,n)=>{r.set(t.caseFormat(n),n)}),e.forEach(e=>{let n=t.caseFormat(ic(e)),i=r.get(n);i!==void 0&&this.selectedKeys.add(i)})}})}resetSelectionState(e){this.params.defaultToNothingSelected?this.selectedKeys.clear():this.selectedKeys=new Set(e)}getFilterHandler(){return this.handler}destroy(){this.virtualList=this.destroyBean(this.virtualList);for(let e of this.handlerDestroyFuncs??[])e();this.handler=void 0,this.displayValueModel=void 0,this.selectedKeys.clear(),super.destroy()}},ModelWrapper=class{constructor(e){this.model=e}getRowCount(){return this.model.getDisplayedValueCount()}getRow(e){return this.model.getDisplayedItem(e)}areRowsEqual(e,t){return e===t}},ModelWrapperWithSelectAll=class{constructor(e,t){this.model=e,this.showAddCurrentSelectionToFilter=t}getRowCount(){let e=this.showAddCurrentSelectionToFilter()?2:1;return this.model.getDisplayedValueCount()+e}getRow(e){if(e===0)return this.model.getSelectAllItem();let t=this.showAddCurrentSelectionToFilter(),n=t?2:1;return e===1&&t?this.model.getAddSelectionToFilterItem():this.model.getDisplayedItem(e-n)}areRowsEqual(e,t){return e===t}},TreeModelWrapper=class{constructor(e){this.model=e}getRowCount(){return this.model.getRowCount()}getRow(e){return this.model.getRow(e)}areRowsEqual(e,t){return e==null&&t==null||e!=null&&t!=null&&e.treeKey===t.treeKey&&e.depth===t.depth}},ClientSideValuesExtractor=class extends U{constructor(e,t,n,r,i){super(),this.createKey=e,this.caseFormat=t,this.getValue=n,this.isTreeDataOrGrouping=r,this.isTreeData=i}extractUniqueValuesAsync(e,t){return new eo(n=>{if(this.beans.rowModel.rowCountReady)n(this.extractUniqueValues(e,t));else{let[r]=this.addManagedEventListeners({rowCountReady:()=>{r?.(),n(this.extractUniqueValues(e,t))}})}})}extractUniqueValues(e,t){let n=new Map,r=this.extractExistingFormattedKeys(t),i=new Set,o=this.isTreeData(),s=this.isTreeDataOrGrouping(),c=this.beans.rowGroupColsSvc?.columns,p=this.gos.get(`groupAllowUnbalanced`),addValue=(e,o)=>{let s=this.caseFormat(e);if(!i.has(s)){i.add(s);let c=e,p=ic(o),m=r?.get(s);m!=null&&(c=m,p=t.get(m)),n.set(c,p)}};return this.beans.rowModel.forEachLeafNode(t=>{if(!t.data||!e(t))return;if(s){this.addValueForTreeDataOrGrouping(t,o,c,addValue,p);return}let n=this.getValue(t);if(n!=null&&Array.isArray(n)){for(let e of n)addValue(this.createKey(e,t),e);n.length===0&&addValue(null,null)}else addValue(this.createKey(n,t),n)}),n}addValueForTreeDataOrGrouping(e,t,n=[],r,i){let o;if(t){if(e.childrenAfterGroup?.length)return;o=e.getRoute()??[e.key??e.id]}else o=n.map(t=>this.beans.valueSvc.getKeyForNode(t,e)),o.push(this.getValue(e));let s=processDataPath(o,t,i);r(this.createKey(s),s)}extractExistingFormattedKeys(e){if(!e)return null;let t=new Map;return e.forEach((e,n)=>{t.set(this.caseFormat(n),n)}),t}},SetFilterAppliedModel=class{constructor(e){this.caseFormat=e,this.keys=null}isNull(){return this.keys==null}isEmpty(){return!this.keys?.size}update(e){let t=new Set;this.keys=t;let n=e?.values;if(n){let e=this.caseFormat;for(let r=0,i=n.length;r<i;r++)t.add(e(n[r]))}}has(e){return!!this.keys?.has(this.caseFormat(e))}destroy(){this.keys=null}},Yg=(e=>(e[e.PROVIDED_LIST=0]=`PROVIDED_LIST`,e[e.PROVIDED_CALLBACK=1]=`PRO
5VIDED_CALLBACK`,e[e.TAKEN_FROM_GRID_VALUES=2]=`TAKEN_FROM_GRID_VALUES`,e))(Yg||{}),Xg=Yg,SetValueModel=class extends U{constructor(e,t,n,r,i){super(),this.clientSideValuesExtractor=e,this.caseFormat=t,this.createKey=n,this.isTreeDataOrGrouping=r,this.params=i,this.allValues=new Map,this.availableKeys=new Set,this.providedValues=null,this.initialised=!1}postConstruct(){let e=this.params,t=e.handlerParams.filterParams.values;this.updateParams(e),t==null?this.valuesType=2:(this.valuesType=+!Array.isArray(t),this.providedValues=t),this.updateAllValues()}refresh(e){let t=e.handlerParams;if(t.source!==`colDef`)return;let{values:n,suppressSorting:r}=t.filterParams,i=this.providedValues,o=this.params.handlerParams.filterParams.suppressSorting;this.params=e,this.updateParams(e),this.providedValues=n??null,(this.providedValues!==i||r!==o)&&(!n||n.length===0?(this.valuesType=2,this.providedValues=null):this.valuesType=+!Array.isArray(n),this.updateAllValues())}updateParams(e){let{handlerParams:{colDef:t,filterParams:{comparator:n,treeList:r,treeListPathGetter:i}},usingComplexObjects:o}=e,s=n??t.comparator,c=this.isTreeDataOrGrouping(),p;p=c&&!s?createTreeDataOrGroupingComparator():r&&!i&&!s?([e,t],[n,r])=>fl(t,r):([e,t],[n,r])=>s(t,r),this.entryComparator=p,this.keyComparator=s??fl,this.compareByValue=!!(o&&s||c||r&&!i)}updateAllValues(){return this.allKeys=new eo(e=>{switch(this.valuesType){case 2:this.getValuesFromRowsAsync().then(t=>e(this.processAllValues(t)));break;case 0:e(this.processAllValues(this.uniqueValues(this.validateProvidedValues(this.providedValues))));break;case 1:{this.dispatchLocalEvent({type:`loadingStart`});let t=this.providedValues,{column:n,colDef:r}=this.params.handlerParams,i=co(this.gos,{success:t=>{this.dispatchLocalEvent({type:`loadingEnd`}),e(this.processAllValues(this.uniqueValues(this.validateProvidedValues(t))))},colDef:r,column:n});window.setTimeout(()=>t(i),0);break}}}),this.allKeys.then(e=>{this.updateAvailableKeys(e??[]),this.initialised=!0}),this.allKeys}getAvailableValues(e){return this.sortKeys(this.getValuesFromRows(e))}overrideValues(e){return this.allKeys.then(()=>{this.valuesType=0,this.providedValues=e})}refreshAvailable(){return new eo(e=>{if(this.showAvailableOnly()){this.allKeys.then(t=>{let n=t??[];this.updateAvailableKeys(n),e(!0)});return}e(!1)})}refreshAll(){return new eo(e=>{this.allKeys.then(()=>{this.updateAllValues().then(()=>{e()})})})}isLoading(){return!this.initialised&&this.valuesType===1}isInitialised(){return this.initialised}getValueForFormatter(e){return this.initialised?this.allValues.get(e):e}getAvailableKeys(e){return this.initialised?e.filter(e=>this.availableKeys.has(e)):e}getParamsForValuesFromRows(e){if(!this.clientSideValuesExtractor){Hl(113);return}return e&&!this.params.handlerParams.filterParams.caseSensitive?this.allValues:void 0}getValuesFromRows(e){let t=this.getParamsForValuesFromRows(!0);return this.clientSideValuesExtractor?.extractUniqueValues(e,t)??null}getValuesFromRowsAsync(){let e=this.getParamsForValuesFromRows(!1);return this.clientSideValuesExtractor?.extractUniqueValuesAsync(()=>!0,e)??eo.resolve(null)}processAllValues(e){let t=this.sortKeys(e);return this.allValues=e??new Map,t}uniqueValues(e){let t=new Map,n=new Set,{caseFormat:r,createKey:i}=this;for(let o of e??[]){let e=ic(o),s=i(e),c=r(s);n.has(c)||(n.add(c),t.set(s,e))}return t}validateProvidedValues(e){if(this.params.usingComplexObjects&&e?.length){let t=e[0];t&&typeof t!=`object`&&typeof t!=`function`&&(this.createKey(t)==null?q(209):q(210))}return e}sortKeys(e){let t=e??new Map,n=this.params.handlerParams.filterParams;if(n.suppressSorting)return Array.from(t.keys());let r;return r=this.compareByValue?Array.from(t.entries()).sort(this.entryComparator).map(([e])=>e):Array.from(t.keys()).sort(this.keyComparator),n.excelMode&&t.has(null)&&(r=r.filter(e=>e!=null),r.push(null)),r}showAvailableOnly(){return this.valuesType===2}updateAvailableKeys(e){let t=this.showAvailableOnly()?this.getAvailableValues(e=>this.params.handlerParams.doesRowPassOtherFilter(e)):e;this.availableKeys=new Set(t),this.dispatchLocalEvent({type:`availableValuesChanged`})}},SetFilterHandler=class extends U{constructor(){super(...arguments),this.filterType=`set`,this.treeDataTreeList=!1,this.groupingTreeList=!1,this.caseSensitive=!1,this.noValueFormatterSupplied=!1}init(e){this.updateParams(e);let t=this.isTreeDataOrGrouping.bind(this),isTreeData=()=>
5this.treeDataTreeList,n=this.createKey,r=this.caseFormat.bind(this),{gos:i,beans:o}=this,s=Rc(i,o.rowModel)?this.createManagedBean(new ClientSideValuesExtractor(n,r,e.getValue,t,isTreeData)):void 0;this.valueModel=this.createManagedBean(new SetValueModel(s,r,n,t,{handlerParams:e,usingComplexObjects:!!(e.filterParams.keyCreator??e.colDef.keyCreator)})),this.appliedModel=new SetFilterAppliedModel(this.caseFormat.bind(this)),this.appliedModel.update(e.model),this.validateModel(e),this.addEventListenersForDataChanges()}refresh(e){this.updateParams(e),this.valueModel.refresh({handlerParams:e,usingComplexObjects:!!(e.filterParams.keyCreator??e.colDef.keyCreator)}),this.appliedModel.update(e.model),this.validateModel(e)}updateParams(e){this.params=e;let{colDef:t,filterParams:{caseSensitive:n,treeList:r,keyCreator:i,valueFormatter:o}}=e;this.caseSensitive=!!n;let s=!!t.showRowGroup;this.treeDataTreeList=this.gos.get(`treeData`)&&!!r&&s,this.groupingTreeList=!!this.beans.rowGroupColsSvc?.columns.length&&!!r&&s;let c=i??t.keyCreator;this.createKey=this.generateCreateKey(c,this.isTreeDataOrGrouping()),this.setValueFormatter(o,c,!!r,!!t.refData)}doesFilterPass(e){let{appliedModel:t,treeDataTreeList:n,groupingTreeList:r}=this;if(t.isNull())return!0;if(t.isEmpty())return!1;let{node:i}=e;if(n)return this.doesFilterPassForTreeData(i);if(r)return this.doesFilterPassForGrouping(i);let o=this.params.getValue(i);return o!=null&&Array.isArray(o)?o.length===0?t.has(null):o.some(e=>t.has(this.createKey(e,i))):t.has(this.createKey(o,i))}getFormattedValue(e){let t=this.valueModel.getValueForFormatter(e);return this.noValueFormatterSupplied&&this.isTreeDataOrGrouping()&&Array.isArray(t)&&(t=Kc(t)),this.beans.valueSvc.formatValue(this.params.column,null,t,this.valueFormatter,!1)??Al(t)??translateForSetFilter(this,`blanks`)}getModelAsString(e,t){let{values:n}=e??{},r=t===`filterToolPanel`;if(n==null)return r?translateForSetFilter(this,`filterSummaryListInactive`):``;let i=this.valueModel.getAvailableKeys(n),o=i.length,s=r?3:10,c=i.slice(0,s).map(e=>this.getFormattedValue(e));if(r){let e=c.join(translateForSetFilter(this,`filterSummaryListSeparator`));return o>3?translateForSetFilter(this,`filterSummaryListLong`,[e,String(o-3)]):translateForSetFilter(this,`filterSummaryListShort`,[e])}return`(${o}) ${c.join(`,`)}${o>10?`,...`:``}`}onAnyFilterChanged(){window.setTimeout(()=>{this.isAlive()&&this.valueModel.refreshAvailable().then(e=>{this.dispatchLocalEvent({type:`anyFilterChanged`,updated:!!e})})})}onNewRowsLoaded(){this.syncAfterDataChange()}setFilterValues(e){this.valueModel.overrideValues(e).then(()=>{this.refreshFilterValues()})}resetFilterValues(){this.valueModel.valuesType=Xg.TAKEN_FROM_GRID_VALUES,this.syncAfterDataChange()}refreshFilterValues(e){this.valueModel.isInitialised()&&this.valueModel.refreshAll().then(()=>{this.dispatchLocalEvent({type:`dataChanged`,hardRefresh:!0}),this.validateModel(this.params,void 0,!e)})}getFilterKeys(){return Array.from(this.valueModel.allValues.keys())}getFilterValues(){return Array.from(this.valueModel.allValues.values())}isTreeDataOrGrouping(){return this.treeDataTreeList||this.groupingTreeList}caseFormat(e){return e==null||typeof e!=`string`||this.caseSensitive?e:e.toUpperCase()}addEventListenersForDataChanges(){this.addManagedPropertyListeners([`groupAllowUnbalanced`],()=>this.syncAfterDataChange());let e=hc(this,this.syncAfterDataChange.bind(this),0);this.addManagedEventListeners({cellValueChanged:t=>{t.column===this.params.column&&e()}})}syncAfterDataChange(){this.isValuesTakenFromGrid()&&this.valueModel.refreshAll().then(()=>{this.dispatchLocalEvent({type:`dataChanged`}),this.validateModel(this.params,{afterDataChange:!0})})}validateModel(e,t,n){let r=this.valueModel;r.allKeys.then(()=>{let i=e.model;if(i==null)return;let o=new Map,addKey=e=>o.set(this.caseFormat(e),e);if(n)for(let e of r.availableKeys)addKey(e);else r.allValues.forEach((e,t)=>addKey(t));let s=[],c=!1;for(let e of i.values){let t=this.caseFormat(ic(e)),n=o.get(t);n===void 0?c=!0:(s.push(n),n!==e&&(c=!0))}let p=s.length,m=e.filterParams;if(p===0&&m.excelMode){e.onModelChange(null,t);return}let h=!m.defaultToNothingSelected&&(this.valueModel.valuesType===Xg.TAKEN_FROM_GRID_VALUES||!m.suppressClearModelOnRefreshValues)&&p===o.size;if(c||!i.filterType||h){let n=h?null:{filterType:this.filterType,values:s};e.onModelChange(n,t)}})}isValuesTakenFromGrid(){return this.valueModel.valuesType===Xg.TAKEN_FROM_GRID_VALUES}doesFilterPassForTreeData(e){if(e.childrenAfterGroup?.length)return!1;let{gos:t,appliedModel:n}=this;return n.has(this.createKey(processDataPath(e.getRoute()??[e.key??e.id],!0,t.get(`groupAllowUnbalanced`))))}doesFilterPassForGrouping(e){let{appliedModel:t,params:n,gos:r,beans:{rowGroupColsSvc:i,valueSvc:o}}=this,s=(i?.columns??[]).map(t=>o.getKeyForNode(t,e));return s.push(n.getValue(e)),t.has(this.createKey(processDataPath(s,!1,r.get(`groupAllowUnbalanced`))))}generateCreateKey(e,t){return t&&!e?(Hl(250),()=>null):e?(t,n=null)=>{let r=this.getKeyCreatorParams(t,n);return ic(e(r))}:e=>ic(Al(e))}getKeyCreatorParams(e,t=null){let{colDef:n,column:r}=this.params;return co(this.gos,{value:e,colDef:n,column:r,node:t,data:t?.data})}setValueFormatter(e,t,n,r){let valueFormatter=e;if(!valueFormatter){if(t&&!n){Hl(249);return}this.noValueFormatterSupplied=!0,r||(valueFormatter=e=>Al(e.value))}this.valueFormatter=valueFormatter}getCrossFilterModel(e){let{createKey:t,valueModel:n,params:r}=this;return e(t,n.availableKeys,r.model?.values)}destroy(){this.appliedModel.destroy(),super.destroy(),this.valueModel=void 0}},Zg={tag:`div`,cls:`ag-floating-filter-input ag-set-floating-filter-input`,role:`presentation`,children:[{tag:`ag-input-text-field`,ref:`eFloatingFilterText`}]},SetFloatingFilterComp=class extends K{constructor(){super(Zg,[To]),this.eFloatingFilterText=null,this.listenerAdded=!1}init(e){this.params=e,this.eFloatingFilterText.setDisabled(!0).addGuiEventListener(`click`,()=>this.params.showParentFilter()),this.setParams(e)}setParams(e){let t=this.beans.colNames.getDisplayNameForColumn(e.column,`header`,!0),n=this.getLocaleTextFunc();if(this.eFloatingFilterText.setInputAriaLabel(`${t} ${n(`ariaFilterInput`,`Filter Input`)}`),this.gos.get(`enableFilterHandlers`)){let t=e;this.updateFloatingFilterText(t.model)}}refresh(e){this.params=e,this.setParams(e)}onParentModelChanged(e){this.updateFloatingFilterText(e)}parentSetFilterInstance(e){this.params.parentFilterInstance(t=>{if(!(t instanceof SetFilter)){Hl(248);return}e(t)})}addAvailableValuesListener(){let addListener=e=>{if(!e?.isAlive())return;let t=e.valueModel;this.destroyListeners=t.addManagedListeners(t,{availableValuesChanged:()=>this.updateFloatingFilterText(e.params.model),destroyed:()=>{this.listenerAdded=!1,this.destroyListeners=void 0}})};this.gos.get(`enableFilterHandlers`)?addListener(this.params.getHandler()):this.parentSetFilterInstance(e=>{addListener(e.handler)}),this.listenerAdded=!0}updateFloatingFilterText(e){e==null?this.eFloatingFilterText.setValue(``):(this.listenerAdded||this.addAvailableValuesListener(),this.gos.get(`enableFilterHandlers`)?this.eFloatingFilterText.setValue(this.params.getHandler().getModelAsString?.(e)??``):this.parentSetFilterInstance(t=>{this.eFloatingFilterText.setValue(t.getModelAsString(e))}))}destroy(){let e=this.destroyListeners;if(e){for(let t of e)t();e.length=0}super.destroy()}},Qg={moduleName:`SetFilter`,version:Z,userComponents:{agSetColumnFilter:{classImp:SetFilter,params:{useForm:!0},processParams:e=>(applyExcelModeOptions(e),e)},agSetColumnFloatingFilter:SetFloatingFilterComp},dynamicBeans:{agSetColumnFilterHandler:SetFilterHandler},icons:{setFilterGroupClosed:`tree-closed`,setFilterGroupOpen:`tree-open`,setFilterGroupIndeterminate:`tree-indeterminate`,setFilterLoading:`loading`},dependsOn:[fh,la]},$g=`.ag-status-bar{border-top:var(--ag-footer-row-border);display:flex;justify-content:space-between;line-height:1.5;overflow:hidden;padding-left:calc(var(--ag-spacing)*4);padding-right:calc(var(--ag-spacing)*4)}.ag-status-panel,:where(.ag-status-panel.ag-status-panel-aggregations .ag-status-name-value){display:inline-flex}.ag-status-name-value{color:var(--ag-status-bar-label-color);
5font-weight:var(--ag-status-bar-label-font-weight);margin-left:var(--ag-spacing);margin-right:var(--ag-spacing);padding-bottom:var(--ag-widget-container-vertical-padding);padding-top:var(--ag-widget-container-vertical-padding);white-space:nowrap}.ag-status-name-value-value{color:var(--ag-status-bar-value-color);font-weight:var(--ag-status-bar-value-font-weight)}.ag-status-bar-left{display:inline-flex}.ag-status-bar-center{display:inline-flex;text-align:center}.ag-status-bar-right{display:inline-flex}`;function getStatusPanelCompDetails(e,t,n){return e.getCompDetails(t,e_,void 0,n,!0)}var e_={name:`statusPanel`,optionalMethods:[`refresh`]},t_={agAggregationComponent:{rowModels:[`clientSide`,`serverSide`],warnArgs:[221]},agFilteredRowCountComponent:{rowModels:[`clientSide`],warnArgs:[222]},agSelectedRowCountComponent:{rowModels:[`clientSide`,`serverSide`],warnArgs:[223]},agTotalAndFilteredRowCountComponent:{rowModels:[`clientSide`],warnArgs:[224]},agTotalRowCountComponent:{rowModels:[`clientSide`],warnArgs:[225]}},n_={tag:`div`,cls:`ag-status-bar`,children:[{tag:`div`,ref:`eStatusBarLeft`,cls:`ag-status-bar-left`,role:`status`},{tag:`div`,ref:`eStatusBarCenter`,cls:`ag-status-bar-center`,role:`status`},{tag:`div`,ref:`eStatusBarRight`,cls:`ag-status-bar-right`,role:`status`}]},AgStatusBar=class extends K{constructor(){super(n_),this.updateQueued=!1,this.panelsPromise=eo.resolve(),this.eStatusBarLeft=null,this.eStatusBarCenter=null,this.eStatusBarRight=null,this.compDestroyFunctions={},this.registerCSS($g)}wireBeans(e){this.userCompFactory=e.userCompFactory,this.statusBarSvc=e.statusBarSvc}postConstruct(){this.processStatusPanels(new Map),this.addManagedPropertyListeners([`statusBar`],this.handleStatusBarChanged.bind(this))}getValidPanels(){let e=this.gos,t=e.get(`statusBar`)?.statusPanels;return t&&t.filter(t=>{let{rowModels:n,warnArgs:r}=t_[t.statusPanel]??{};return!n||n.includes(e.get(`rowModelType`))?!0:(q(...r),!1)})}processStatusPanels(e){let t=this.getValidPanels();if(t){let n=t.filter(e=>e.align===`left`),r=t.filter(e=>e.align===`center`),i=t.filter(e=>!e.align||e.align===`right`);this.panelsPromise=eo.all([this.createAndRenderComponents(n,this.eStatusBarLeft,e),this.createAndRenderComponents(r,this.eStatusBarCenter,e),this.createAndRenderComponents(i,this.eStatusBarRight,e)])}else this.setDisplayed(!1)}handleStatusBarChanged(){this.updateQueued||(this.updateQueued=!0,this.panelsPromise.then(()=>{this.updateStatusBar(),this.updateQueued=!1}))}updateStatusBar(){let e=this.getValidPanels(),t=Array.isArray(e)&&e.length>0;this.setDisplayed(t);let n=new Map;if(t)for(let t of e){let e=t.key??t.statusPanel,r=this.statusBarSvc.getStatusPanel(e);if(r?.refresh){let i=co(this.gos,{...t.statusPanelParams??{},key:e});r.refresh(i)&&(n.set(e,r),delete this.compDestroyFunctions[e],Ta(r.getGui()))}}this.resetStatusBar(),t&&this.processStatusPanels(n)}resetStatusBar(){Ml(this.eStatusBarLeft),Ml(this.eStatusBarCenter),Ml(this.eStatusBarRight),this.destroyComponents(),this.statusBarSvc.unregisterAllComponents()}destroy(){this.destroyComponents(),super.destroy()}destroyComponents(){for(let e of Object.values(this.compDestroyFunctions))e();this.compDestroyFunctions={}}createAndRenderComponents(e,t,n){let r=[];for(let t of e){let e=t.key||t.statusPanel,i=n.get(e),o;if(i)o=eo.resolve(i);else{let n=getStatusPanelCompDetails(this.userCompFactory,t,co(this.gos,{key:e}));if(n==null)continue;o=n.newAgStackInstance()}r.push({key:e,promise:o})}return eo.all(r.map(e=>e.promise)).then(()=>{for(let e of r)e.promise.then(n=>{let destroyFunc=()=>{this.destroyBean(n)};this.isAlive()?(this.statusBarSvc.registerStatusPanel(e.key,n),t.appendChild(n.getGui()),this.compDestroyFunctions[e.key]=destroyFunc):destroyFunc()})})}},r_={selector:`AG-STATUS-BAR`,component:AgStatusBar},i_={tag:`div`,cls:`ag-status-name-value`,children:[{tag:`span`,ref:`eLabel`},`:\xA0`,{tag:`span`,ref:`eValue`,cls:`ag-status-name-value-value`}]},AgNameValue=class extends K{constructor(){super(i_),this.eLabel=null,this.eValue=null}setLabel(e,t){this.setDisplayed(!1),this.eLabel.textContent=this.getLocaleTextFunc()(e,t)}setValue(e,t){this.eValue.textContent=this.valueFormatter(co(this.gos,{value:e,totalRows:t,key:this.key}))}},a_={selector:`AG-NAME-VALUE`,component:AgNameValue},_getFilteredRowCount=e=>{let t=0;return e.forEachNodeAfterFilter(e=>{e.data&&t++}),t},_getTotalRowCount=e=>{let t=0;return e.forEachNode(e=>{e.data&&t++}),t};function _formatNumberTwoDecimalPlacesAndCommas(e,t){return typeof e==`number`?Hc(Math.round(e*100)/100,t):``}var o_={tag:`div`,cls:`ag-status-panel ag-status-panel-aggregations`,children:[{tag:`ag-name-value`,ref:`avgAggregationComp`},{tag:`ag-name-value`,ref:`countAggregationComp`},{tag:`ag-name-value`,ref:`minAggregationComp`},{tag:`ag-name-value`,ref:`maxAggregationComp`},{tag:`ag-name-value`,ref:`sumAggregationComp`}]},AggregationComp=class extends K{constructor(){super(o_,[a_]),this.sumAggregationComp=null,this.countAggregationComp=null,this.minAggregationComp=null,this.maxAggregationComp=null,this.avgAggregationComp=null}postConstruct(){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.addManagedEventListeners({cellSelectionChanged:this.onCellSelectionChanged.bind(this),modelUpdated:this.onCellSelectionChanged.bind(this)})}init(e){this.refresh(e)}refresh(e){this.params=e;let t=e.valueFormatter??(({value:e})=>_formatNumberTwoDecimalPlacesAndCommas(e,this.getLocaleTextFunc.bind(this)));for(let e of[`avg`,`count`,`min`,`max`,`sum`]){let n=this.getAllowedAggregationValueComponent(e);n&&(n.key=e,n.valueFormatter=t.bind(this))}return this.onCellSelectionChanged(),!0}setAggregationComponentValue(e,t,n){let r=this.getAllowedAggregationValueComponent(e),i=_getTotalRowCount(this.beans.rowModel);Xs(r)&&r?(r.setValue(t,i),r.setDisplayed(n)):this.getAggregationValueComponent(e)?.setDisplayed(!1)}getAllowedAggregationValueComponent(e){let{aggFuncs:t}=this.params;return!t||t.includes(e)?this.getAggregationValueComponent(e):null}getAggregationValueComponent(e){let t=`${e}AggregationComp`;return this[t]}onCellSelectionChanged(){let e=this.beans,{rangeSvc:t,valueSvc:n}=e,r=t?.getCellRanges(),i=0,o=0,s=0,c=null,p=null,m={};if(r?.length&&t)for(let h=0;h<r.length;h++){let g=r[h],_=t.getRangeStartRow(g),v=t.getRangeEndRow(g);for(;!(dl(_)||!_||Ps(v,_)||!_||!g.columns);)g.columns.forEach(t=>{if(_===null)return;let r=Mc({rowPinned:_.rowPinned,column:t,rowIndex:_.rowIndex});if(m[r])return;m[r]=!0;let h=Ql(e,_);if(dl(h))return;let g=n.getValue(t,h);dl(g)||g===``||(o++,!(typeof g==`object`&&`value`in g&&(g=g.value,g===``))&&(typeof g==`string`&&(g=Number(g)),typeof g==`number`&&!isNaN(g)&&(i+=g,(p===null||g>p)&&(p=g),(c===null||g<c)&&(c=g),s++)))}),_=Sc(e,_)}let h=o>1,g=s>1;this.setAggregationComponentValue(`count`,o,h),this.setAggregationComponentValue(`sum`,i,g),this.setAggregationComponentValue(`min`,c,g),this.setAggregationComponentValue(`max`,p,g),this.setAggregationComponentValue(`avg`,i/s,g)}},FilteredRowsComp=class extends AgNameValue{postConstruct(){this.setLabel(`filteredRows`,`Filtered`),this.addCss(`ag-status-panel`),this.addCss(`ag-status-panel-filtered-row-count`),this.setDisplayed(!0);let e=this.onDataChanged.bind(this);this.addManagedEventListeners({modelUpdated:e})}onDataChanged(){let{rowModel:e}=this.beans,t=_getTotalRowCount(e),n=_getFilteredRowCount(e);this.setValue(n,t),this.setDisplayed(t!==n)}init(e){this.refresh(e),this.onDataChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:e})=>Hc(e,this.getLocaleTextFunc.bind(this)))}refresh(e){let{key:t,valueFormatter:n}=e;
5return this.key=t,this.updateValueFormatter(n),!0}},SelectedRowsComp=class extends AgNameValue{postConstruct(){this.setLabel(`selectedRows`,`Selected`),this.addCss(`ag-status-panel`),this.addCss(`ag-status-panel-selected-row-count`);let e=this.onRowSelectionChanged.bind(this);this.addManagedEventListeners({modelUpdated:e,selectionChanged:e})}onRowSelectionChanged(){let{selectionSvc:e,rowModel:t}=this.beans,n=e?.getSelectionCount()??0,r=_getTotalRowCount(t);if(this.setValue(n,r),n<0){this.setDisplayed(!0);return}this.setDisplayed(n>0)}init(e){this.refresh(e),this.onRowSelectionChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:e})=>e==null||e>=0?Hc(e,this.getLocaleTextFunc.bind(this)):this.getLocaleTextFunc()(`statusBarLastRowUnknown`,`?`))}refresh(e){let{key:t,valueFormatter:n}=e;return this.key=t,this.updateValueFormatter(n),!0}},TotalAndFilteredRowsComp=class extends AgNameValue{postConstruct(){this.setLabel(`totalAndFilteredRows`,`Rows`),this.addCss(`ag-status-panel`),this.addCss(`ag-status-panel-total-and-filtered-row-count`),this.setDisplayed(!0),this.addManagedEventListeners({modelUpdated:this.onDataChanged.bind(this)})}onDataChanged(){let{rowModel:e}=this.beans,t=_getFilteredRowCount(e),n=_getTotalRowCount(e);this.setValue(t,n)}init(e){this.refresh(e),this.onDataChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:e,totalRows:t})=>{let n=this.getLocaleTextFunc.bind(this),r=Hc(e,n),i=Hc(t??e,n);return e===t?r:`${r} ${n()(`of`,`of`)} ${i}`})}refresh(e){let{key:t,valueFormatter:n}=e;return this.key=t,this.updateValueFormatter(n),!0}},TotalRowsComp=class extends AgNameValue{postConstruct(){this.setLabel(`totalRows`,`Total Rows`),this.addCss(`ag-status-panel`),this.addCss(`ag-status-panel-total-row-count`),this.setDisplayed(!0),this.addManagedEventListeners({modelUpdated:this.onDataChanged.bind(this)})}onDataChanged(){let e=_getTotalRowCount(this.beans.rowModel);this.setValue(e,e)}init(e){this.refresh(e),this.onDataChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:e})=>Hc(e,this.getLocaleTextFunc.bind(this)))}refresh(e){let{key:t,valueFormatter:n}=e;return this.key=t,this.updateValueFormatter(n),!0}};function getStatusPanel(e,t){let n=e.statusBarSvc?.getStatusPanel(t);return bl(n)}var StatusBarService=class extends U{constructor(){super(),this.beanName=`statusBarSvc`,this.comps=new Map}registerStatusPanel(e,t){this.comps.set(e,t)}unregisterStatusPanel(e){this.comps.delete(e)}unregisterAllComponents(){this.comps.clear()}getStatusPanel(e){return this.comps.get(e)}destroy(){this.unregisterAllComponents(),super.destroy()}},s_={moduleName:`StatusBar`,version:Z,beans:[StatusBarService],userComponents:{agAggregationComponent:AggregationComp,agTotalRowCountComponent:TotalRowsComp,agFilteredRowCountComponent:FilteredRowsComp,agTotalAndFilteredRowCountComponent:TotalAndFilteredRowsComp,agSelectedRowCountComponent:SelectedRowsComp},selectors:[r_],apiFunctions:{getStatusPanel},dependsOn:[fh,$l]};function assertNotExcelMultiSheet(e){return e.excelCreator?.getFactoryMode()!==`MULTI_SHEET`||(q(161),!1)}function getDataAsExcel(e,t){if(assertNotExcelMultiSheet(e))return e.excelCreator?.getDataAsExcel(t)}function exportDataAsExcel(e,t){assertNotExcelMultiSheet(e)&&e.excelCreator?.exportDataAsExcel(t)}function getSheetDataForExcel(e,t){return e.excelCreator?.setFactoryMode(`MULTI_SHEET`),e.excelCreator?.getSheetDataForExcel(t)}function getMultipleSheetsAsExcel2(e,t){return e.excelCreator?.getMultipleSheetsAsExcel(t)}function exportMultipleSheetsAsExcel2(e,t){e.excelCreator?.exportMultipleSheetsAsExcel(t)}var c_={moduleName:`ExcelExport`,version:Z,beans:[ExcelCreator],apiFunctions:{getDataAsExcel,exportDataAsExcel,getSheetDataForExcel,getMultipleSheetsAsExcel:getMultipleSheetsAsExcel2,exportMultipleSheetsAsExcel:exportMultipleSheetsAsExcel2},dependsOn:[Ua,fh]};function getAgGroupComponentTemplate(e){let t=e.cssIdentifier||`default`,n=e.direction||`vertical`;return{tag:`div`,cls:`ag-group ag-${t}-group`,role:`presentation`,children:[{tag:`div`,ref:`eToolbar`,cls:`ag-group-toolbar ag-${t}-group-toolbar`,children:[{tag:`ag-checkbox`,ref:`cbGroupEnabled`}]},{tag:`div`,ref:`eContainer`,cls:`ag-group-container ag-group-container-${n} ag-${t}-group-container`}]}}var AgGroupComponent=class extends K{constructor(e={}){super(getAgGroupComponentTemplate(e),[Pa]),this.params=e,this.suppressEnabledCheckbox=!0,this.suppressToggleExpandOnEnableChange=!1,this.eToolbar=null,this.cbGroupEnabled=null,this.eContainer=null;let{enabled:t,items:n,suppressEnabledCheckbox:r,expanded:i,suppressToggleExpandOnEnableChange:o,useToggle:s}=e;this.cssIdentifier=e.cssIdentifier||`default`,this.enabled=t??!0,this.items=n||[],this.useToggle=s??!1,this.alignItems=e.alignItems||`center`,this.expanded=i??!0,r!=null&&(this.suppressEnabledCheckbox=r),o!=null&&(this.suppressToggleExpandOnEnableChange=o)}postConstruct(){if(this.setupTitleBar(),this.items.length){let e=this.items;this.items=[],this.addItems(e)}let e=this.getLocaleTextFunc();this.cbGroupEnabled.setLabel(e(`enabled`,`Enabled`)),this.enabled&&this.setEnabled(this.enabled,void 0,!0),this.setAlignItems(this.alignItems);let{onEnableChange:t,onExpandedChange:n,suppressOpenCloseIcons:r}=this.params;this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(r??!1),this.refreshChildDisplay(),W(this.eContainer,this.expanded),this.cbGroupEnabled.onValueChange(e=>{this.setEnabled(e,!0,this.suppressToggleExpandOnEnableChange),this.dispatchEnableChangeEvent(e)}),t!=null&&this.onEnableChange(t),n!=null&&this.onExpandedChange(n)}refreshChildDisplay(){W(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),this.eTitleBar?.refreshOnExpand(this.expanded)}isExpanded(){return this.expanded}setAlignItems(e){this.alignItems!==e&&this.removeCss(`ag-group-item-alignment-${this.alignItems}`),this.alignItems=e;let t=`ag-group-item-alignment-${this.alignItems}`;return this.addCss(t),this}toggleGroupExpand(e,t){if(this.eTitleBar?.isSuppressCollapse()&&!this.useToggle)e=!0,t=!0;else if(e??=!this.expanded,this.expanded===e)return this;return this.expanded=e,this.refreshChildDisplay(),W(this.eContainer,e),t||this.dispatchLocalEvent({type:e?`expanded`:`collapsed`}),this}addItems(e){for(let t of e)this.addItem(t)}prependItem(e){this.insertItem(e,!0)}addItem(e){this.insertItem(e,!1)}insertItem(e,t){let n=this.eContainer,r=Ro(e)?e.getGui():e;r.classList.add(`ag-group-item`,`ag-${this.cssIdentifier}-group-item`),t?(n.insertAdjacentElement(`afterbegin`,r),this.items.unshift(r)):(n.appendChild(r),this.items.push(r))}hideItem(e,t){let n=this.items[t];W(n,!e)}getItemIndex(e){let t=Ro(e)?e.getGui():e;return this.items.indexOf(t)}setTitle(e){return this.eTitleBar?.setTitle(e),this}addTitleBarWidget(e){return this.eTitleBar?.addWidget(e),this}addCssClassToTitleBar(e){this.eTitleBar?.addCss(e)}
5dispatchEnableChangeEvent(e){let t={type:`enableChange`,enabled:e};this.dispatchLocalEvent(t)}setEnabled(e,t,n){return this.enabled=e,this.refreshDisabledStyles(),n||this.toggleGroupExpand(e),t||(this.cbGroupEnabled.setValue(e),this.eToggle?.setValue(e)),this}isEnabled(){return this.enabled}onEnableChange(e){return this.addManagedListeners(this,{enableChange:t=>e(t.enabled)}),this}onExpandedChange(e){return this.addManagedListeners(this,{expanded:()=>e(!0),collapsed:()=>e(!1)}),this}hideEnabledCheckbox(e){return this.suppressEnabledCheckbox=e,this.refreshChildDisplay(),this.refreshDisabledStyles(),this}hideOpenCloseIcons(e){return this.eTitleBar?.hideOpenCloseIcons(e),this}refreshDisabledStyles(){let e=!this.enabled;this.eContainer.classList.toggle(`ag-disabled`,e),this.eTitleBar?.refreshDisabledStyles(this.suppressEnabledCheckbox&&e),this.eContainer.classList.toggle(`ag-disabled-group-container`,e)}setupTitleBar(){let e=this.useToggle?this.createToggleTitleBar():this.createDefaultTitleBar();this.eToolbar.insertAdjacentElement(`beforebegin`,e.getGui())}createDefaultTitleBar(){let e=this.createManagedBean(new DefaultTitleBar(this.params));return this.eTitleBar=e,e.refreshOnExpand(this.expanded),this.addManagedListeners(e,{expandedChanged:e=>this.toggleGroupExpand(e.expanded)}),e}createToggleTitleBar(){let e=this.createManagedBean(new ya({value:this.enabled,label:this.params.title,labelAlignment:`left`,labelWidth:`flex`,onValueChange:e=>{this.setEnabled(e,!0),this.dispatchEnableChangeEvent(e)}}));return e.addCss(`ag-group-title-bar`),e.addCss(`ag-${this.params.cssIdentifier??`default`}-group-title-bar ag-unselectable`),this.eToggle=e,this.toggleGroupExpand(this.enabled),e}},l_=`ag-disabled-group-title-bar`;function getDefaultTitleBarTemplate(e){let t=e.cssIdentifier??`default`;return{tag:`div`,cls:`ag-group-title-bar ag-${t}-group-title-bar ag-unselectable`,role:e.suppressKeyboardNavigation?`presentation`:`role`,children:[{tag:`span`,ref:`eGroupOpenedIcon`,cls:`ag-group-title-bar-icon ag-${t}-group-title-bar-icon`,role:`presentation`},{tag:`span`,ref:`eGroupClosedIcon`,cls:`ag-group-title-bar-icon ag-${t}-group-title-bar-icon`,role:`presentation`},{tag:`span`,ref:`eTitle`,cls:`ag-group-title ag-${t}-group-title`}]}}var DefaultTitleBar=class extends K{constructor(e={}){super(getDefaultTitleBarTemplate(e)),this.suppressOpenCloseIcons=!1,this.suppressKeyboardNavigation=!1,this.eGroupOpenedIcon=null,this.eGroupClosedIcon=null,this.eTitle=null;let{title:t,suppressOpenCloseIcons:n,suppressKeyboardNavigation:r}=e;t&&t.length>0&&(this.title=t),n!=null&&(this.suppressOpenCloseIcons=n),this.suppressKeyboardNavigation=r??!1}postConstruct(){this.setTitle(this.title),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract()}setupExpandContract(){this.eGroupClosedIcon.appendChild(qc(`accordionClosed`,this.beans,null)),this.eGroupOpenedIcon.appendChild(qc(`accordionOpen`,this.beans,null)),this.addManagedElementListeners(this.getGui(),{click:()=>this.dispatchExpandChanged(),keydown:e=>{switch(e.key){case G.ENTER:case G.SPACE:e.preventDefault(),this.dispatchExpandChanged();break;case G.RIGHT:case G.LEFT:e.preventDefault(),this.dispatchExpandChanged(e.key===G.RIGHT)}}})}refreshOnExpand(e){this.refreshAriaStatus(e),this.refreshOpenCloseIcons(e)}refreshAriaStatus(e){this.suppressOpenCloseIcons||to(this.getGui(),e)}refreshOpenCloseIcons(e){let t=!this.suppressOpenCloseIcons;W(this.eGroupOpenedIcon,t&&e),W(this.eGroupClosedIcon,t&&!e)}isSuppressCollapse(){return this.suppressOpenCloseIcons}dispatchExpandChanged(e){let t={type:`expandedChanged`,expanded:e};this.dispatchLocalEvent(t)}setTitle(e){let t=this.getGui(),n=!!e&&e.length>0;e=n?e:void 0,this.eTitle.textContent=e??``,W(t,n),e!==this.title&&(this.title=e);let r=t.classList.contains(l_);return this.refreshDisabledStyles(r),this}addWidget(e){return this.getGui().appendChild(e),this}hideOpenCloseIcons(e){return this.suppressOpenCloseIcons=e,e&&this.dispatchExpandChanged(!0),this}refreshDisabledStyles(e){let t=this.getGui();e?(t.classList.add(l_),t.removeAttribute(`tabindex`)):(t.classList.remove(l_),typeof this.title==`string`&&!this.suppressKeyboardNavigation?t.setAttribute(`tabindex`,`0`):t.removeAttribute(`tabindex`))}},u_={selector:`AG-GROUP-COMPONENT`,component:AgGroupComponent};
5function getMultiFilterDefs(e){let{filters:t}=e;return t&&t.length>0?t:[{filter:`agTextColumnFilter`},{filter:`agSetColumnFilter`}]}function forEachReverse(e,t){if(e!=null)for(let n=e.length-1;n>=0;n--)t(e[n],n)}function getFilterTitle(e,t){return t.title==null?e instanceof Po?e.getFilterTitle():`Filter`:t.title}function getUpdatedMultiFilterModel(e,t,n,r){let i=[],o=e?.filterModels;for(let e=0;e<t;e++)i[e]=(e===r?n:o?.[e])??null;return i.every(e=>e==null)?null:{filterType:`multi`,filterModels:i}}function getFilterModelForIndex(e,t){return e?.filterModels?.[t]??null}function updateGetValue(e,t,n,r){let i=n.filterValueGetter;return i?e.colFilter.createGetValue(t,i):r}var BaseMultiFilter=class extends gs{constructor(){super({tag:`div`,cls:`ag-multi-filter ag-menu-list-compact`}),this.filterDefs=[],this.guiDestroyFuncs=[],this.filterGuis=[],this.lastActivatedMenuItem=null}postConstruct(){this.initialiseTabGuard({onFocusIn:e=>this.onFocusIn(e)})}refreshGui(e){return e===this.lastOpenedInContainer?eo.resolve():(this.tabGuardFeature.removeAllChildrenExceptTabGuards(),this.destroyChildren(),eo.all(this.getFilterWrappers().map((t,n)=>{if(!t)return eo.resolve(null);let r=this.getFilterFromWrapper(t),i=this.getCompFromWrapper(t),o=this.filterDefs[n],s=getFilterTitle(r,o),c;if(o.display===`subMenu`&&e!==`toolPanel`)c=this.insertFilterMenu(i,r,s).then(e=>e.getGui());else if(o.display===`subMenu`||o.display===`accordion`){let e=this.insertFilterGroup(r,i,s);c=eo.resolve(e.getGui())}else c=eo.resolve(i.getGui());return c})).then(t=>{t.forEach((e,t)=>{e&&(t>0&&this.appendChild(Dl({tag:`div`,cls:`ag-filter-separator`})),this.appendChild(e))}),this.filterGuis=t,this.lastOpenedInContainer=e}))}destroyChildren(){for(let e of this.guiDestroyFuncs)e();this.guiDestroyFuncs.length=0,this.filterGuis.length=0}insertFilterMenu(e,t,n){let r=e.getGui();cs(r,`dialog`);let i=this.createBean(new AgMenuItemComponent);return i.init({menuItemDef:{name:n,subMenu:[],subMenuRole:`dialog`,cssClasses:[`ag-multi-filter-menu-item`],menuItem:AgMenuItemRenderer,menuItemParams:{cssClassPrefix:`ag-compact-menu-option`,isCompact:!0}},level:0,isAnotherSubMenuOpen:()=>!1,childComponent:{getGui:()=>e.getGui(),afterGuiAttached:n=>{e.afterGuiAttached?.(n),e!==t&&t.afterGuiAttached?.(n)}},contextParams:{column:null,node:null,value:null}}).then(()=>{i.setParentComponent(this),this.guiDestroyFuncs.push(()=>this.destroyBean(i)),this.addManagedListeners(i,{menuItemActivated:e=>{this.lastActivatedMenuItem&&this.lastActivatedMenuItem!==e.menuItem&&this.lastActivatedMenuItem.deactivate(),this.lastActivatedMenuItem=e.menuItem}});let e=i.getGui();return i.addManagedElementListeners(e,{keydown:e=>{let{key:t}=e;switch(t){case G.UP:case G.RIGHT:case G.DOWN:case G.LEFT:e.preventDefault(),t===G.RIGHT&&i.openSubMenu(!0)}},focusin:()=>i.activate(),focusout:()=>{!i.isSubMenuOpen()&&!i.isSubMenuOpening()&&i.deactivate()}}),i})}insertFilterGroup(e,t,n){let r=this.createBean(new AgGroupComponent({title:n,cssIdentifier:`multi-filter`}));return this.guiDestroyFuncs.push(()=>this.destroyBean(r)),r.addItem(t.getGui()),r.toggleGroupExpand(!1),e.afterGuiAttached&&r.addManagedListeners(r,{expanded:()=>e.afterGuiAttached({container:this.lastOpenedInContainer,suppressFocus:!0,hidePopup:this.hidePopup})}),r}afterGuiAttached(e){let t;e?(this.hidePopup=e.hidePopup,t=this.refreshGui(e.container)):(this.hidePopup=void 0,t=eo.resolve());let n=e?.suppressFocus;t.then(()=>{let{filterDefs:t,filterGuis:r,beans:i}=this,o=this.getFilterWrappers(),s=!!n;t&&forEachReverse(t,(t,i)=>{let c=i===0,p=t.display&&t.display!==`inline`,m=n||!c||p,h={...e??{},suppressFocus:m},g=o[i],_=g?this.getFilterFromWrapper(g):void 0;if(g){let e=this.getCompFromWrapper(g);e!==_&&e.afterGuiAttached(h)}if(_&&(this.executeFunctionIfExistsOnFilter(_,`afterGuiAttached`,h),c&&!m&&(s=!0)),!n&&c&&p){let e=r[i];e&&(ja(e)||e.focus({preventScroll:!0}),s=!0)}});let c=Lo(i);!s&&(ks(i)||this.getGui().contains(c))&&this.forceFocusOutOfContainer(!0)})}afterGuiDetached(){this.executeFunctionIfExists(`afterGuiDetached`)}onAnyFilterChanged(){this.executeFunctionIfExists(`onAnyFilterChanged`,e=>this.executeOnWrapper(e,`onAnyFilterChanged`))}onNewRowsLoaded(){this.executeFunctionIfExists(`onNewRowsLoaded`,e=>this.executeOnWrapper(e,`onNewRowsLoaded`))}destroy(){this.destroyChildren(),this.hidePopup=void 0,super.destroy()}executeOnWrapper(e,t){}executeFunctionIfExists(e,t){forEachReverse(this.getFilterWrappers(),n=>{n&&(t?.(n),this.executeFunctionIfExistsOnFilter(this.getFilterFromWrapper(n),e))})}executeFunctionIfExistsOnFilter(e,t,...n){let r=e[t];typeof r==`function`&&r.apply(e,n)}onFocusIn(e){let t=this.lastActivatedMenuItem;t!=null&&!t.getGui().contains(e.target)&&(t.deactivate(),this.lastActivatedMenuItem=null)}},MultiFilter=class extends BaseMultiFilter{constructor(){super(...arguments),this.filterType=`multi`,this.wrappers=[],this.activeFilterIndices=[],this.afterFiltersReadyFuncs=[]}
5init(e){this.params=e,this.filterDefs=getMultiFilterDefs(e);let t=Ns(this.beans.colFilter.model,e.column.getColId()),{filterChangedCallback:n}=e;this.filterChangedCallback=n;let r=this.filterDefs.map((e,n)=>this.createFilter(e,n,t));return new eo(e=>{eo.all(r).then(t=>{this.wrappers=t,this.refreshGui(`columnMenu`).then(()=>{e()})})}).then(()=>{for(let e of this.afterFiltersReadyFuncs)e();this.afterFiltersReadyFuncs.length=0})}refresh(e){return this.params=e,!0}isFilterActive(){return this.wrappers.some(e=>{if(!e)return!1;let{filter:t,handler:n,model:r}=e;return n?r!=null:t.isFilterActive()})}getLastActiveFilterIndex(){let e=this.activeFilterIndices;return e.length>0?e[e.length-1]:null}doesFilterPass(e,t){return this.wrappers.every((n,r)=>{if(!n||t!=null&&r===t)return!0;let{handler:i,filter:o,model:s}=n;return i?s==null||i.doesFilterPass({...e,model:s,handlerParams:n.handlerParams}):!o.isFilterActive()||o.doesFilterPass(e)})}getModelFromUi(){return{filterType:this.filterType,filterModels:this.wrappers.map(e=>{if(!e)return null;let t=e.filter;return typeof t.getModelFromUi==`function`?t.getModelFromUi():null})}}getModel(){return this.isFilterActive()?{filterType:this.filterType,filterModels:this.wrappers.map(e=>{if(!e)return null;let{filter:t,handler:n,model:r}=e;return n?r:t.isFilterActive()?t.getModel():null})}:null}setModel(e){let setFilterModel=(e,t)=>new eo(n=>{let r=e.setModel(t);r?r.then(()=>n()):n()}),t=[];return this.wrappers.forEach((n,r)=>{if(!n)return;let i=getFilterModelForIndex(e,r),{filter:o,filterParams:s,handler:c,handlerParams:p,state:m}=n;if(c){let e={model:i,state:m?.state};t.push(tu(()=>eo.resolve({filter:o,filterParams:s}),c,p,i,e,`api`).then(()=>{n.state=e,n.model=i,this.updateActiveListForHandler(r,i)}))}else t.push(setFilterModel(o,i).then(()=>{this.updateActiveListForFilter(r,o)}))}),eo.all(t).then(()=>{})}applyModel(e=`api`){let t=!1;for(let n of this.wrappers)if(n){let r=n.filter;r instanceof Po&&(t=r.applyModel(e)||t)}return t}getChildFilterInstance(e){return this.wrappers[e]?.filter}getNumChildFilters(){return this.wrappers.length}destroy(){for(let e of this.wrappers)this.destroyBean(e?.filter),this.destroyBean(e?.handler);this.wrappers.length=0,super.destroy()}getFilterWrappers(){return this.wrappers}getFilterFromWrapper(e){return e.filter}getCompFromWrapper(e){return e.comp}executeOnWrapper(e,t){e.handler?.[t]?.()}createFilter(e,t,n){let r=this.params.column,i=null,o,s=this.beans,onModelChange=(e,n)=>{let r=this.wrappers[t];if(!r)return;let i={model:e,state:r.state?.state};tu(()=>eo.resolve({filter:r.filter,filterParams:r.filterParams}),r.handler,r.handlerParams,e,i,`ui`).then(()=>{r.state=i,r.model=e,this.onHandlerModelChanged(t,e,n)})},{compDetails:c,handler:p,handlerParams:m,createFilterUi:h}=s.colFilter.createFilterInstance(r,e,`agTextColumnFilter`,(m,h)=>{let g={...m,filterChangedCallback:h?()=>{}:e=>{this.executeWhenAllFiltersReady(()=>this.onFilterModelChanged(t,e))},doesRowPassOtherFilter:e=>m.doesRowPassOtherFilter(e)&&this.doesFilterPass({node:e,data:e.data},t),getValue:updateGetValue(s,r,e,m.getValue)};return h&&(i=getFilterModelForIndex(n,t),o=this.updateDisplayParams(g,t,i,()=>c,()=>p,onModelChange)),g});if(!h)return eo.resolve(null);let g;if(p){let{doesRowPassOtherFilter:n,getValue:o}=m;g={...m,onModelChange,doesRowPassOtherFilter:e=>n(e)&&this.doesFilterPass({node:e,data:e.data},t),getValue:updateGetValue(s,r,e,o)},p.init?.({...g,model:i,source:`init`})}return h().then(e=>{if(!p)return{filter:e,comp:e};let t=c?.params;return{filter:e,comp:o(e),filterParams:t,handler:p,handlerParams:g,model:i}})}updateDisplayParams(e,t,n,r,i,o){let s=this.params.column,c=new es;e.model=n,e.state={model:n},e.onModelChange=o,e.getHandler=i;let updateState=(e,t)=>{e.state=t,c.dispatchEvent({type:`filterStateChanged`,column:s,state:t})};e.onStateChange=e=>{let n=this.wrappers[t];n&&(updateState(n,e),Vl(n.filter,n.filterParams,n.model??null,e,`ui`))};let updateModel=(e,n,i)=>{let o=this.wrappers[t];if(!o)return;let getModel=()=>o?.model??null;Hs(n,()=>{let e=eo.resolve(o.filter);
5return{created:!0,filterParams:o.filterParams,compDetails:r(),create:()=>e,promise:e}},getModel,()=>o?.state??{model:getModel()},e=>updateState(o,e),e=>o.filterParams?.onModelChange(e,i),o.handler?.processModelToApply?.bind(o.handler))};return e.onAction=(e,t,n)=>{updateModel(s,e,t),c.dispatchEvent({type:`filterAction`,column:s,action:e,event:n})},e=>{let t=r()?.params;return this.createManagedBean(new kc(s,{comp:e,params:t,isHandler:!0},c,updateModel,!1))}}executeWhenAllFiltersReady(e){(this.wrappers?.length??0)>0?e():this.afterFiltersReadyFuncs.push(e)}updateActiveListForFilter(e,t){this.updateActiveList(e,()=>t?.isFilterActive())}updateActiveListForHandler(e,t){this.updateActiveList(e,()=>t!=null)}updateActiveList(e,t){let n=this.activeFilterIndices;Zo(this.activeFilterIndices,e),t()&&n.push(e)}onFilterModelChanged(e,t){this.updateActiveListForFilter(e,this.wrappers[e]?.filter),this.filterChanged(e,t)}onHandlerModelChanged(e,t,n){this.updateActiveListForHandler(e,t),this.filterChanged(e,n)}filterChanged(e,t){this.filterChangedCallback(t),this.wrappers.forEach((t,n)=>{if(e===n||!t)return;let{filter:r,handler:i}=t;i?.onAnyFilterChanged?.(),typeof r.onAnyFilterChanged==`function`&&r.onAnyFilterChanged()})}getModelAsString(e){if(!e?.filterModels?.length)return``;let t=this.getLastActiveFilterIndex()??0;return(this.wrappers[t]?.filter)?.getModelAsString?.(e.filterModels[t])??``}},MultiFilterHandler=class extends U{constructor(){super(...arguments),this.filterType=`multi`,this.handlerWrappers=[],this.activeFilterIndices=[],this.filterDefs=[]}init(e){this.params=e;let t=getMultiFilterDefs(e.filterParams);this.filterDefs=t,t.forEach((t,n)=>{let r=this.beans.colFilter.createHandler(e.column,t,`agTextColumnFilter`);if(this.handlerWrappers.push(r),!r){q(278,{colId:e.column.getColId()});return}let{handler:i,handlerParams:o}=r;i.init?.({...this.updateHandlerParams(o,n,!0),model:getFilterModelForIndex(e.model,n),source:`init`})}),this.resetActiveList(e.model)}refresh(e){this.params=e;let{model:t,source:n,filterParams:r}=e,i=r?.filters;this.handlerWrappers.forEach((r,o)=>{if(r){let s=this.updateHandlerParams(e,o,!1),c=s.filterParams,p=i?.[o].filterParams,m=p?{...c,...p}:c,h={...s,filterParams:m};r.handlerParams=h,r.handler.refresh?.({...h,model:getFilterModelForIndex(t,o),source:n})}}),e.source!==`floating`&&e.source!==`ui`&&this.resetActiveList(e.model),e.additionalEventAttributes?.fromButtons&&this.onAnyFilterChanged()}updateHandlerParams(e,t,n){let{onModelChange:r,doesRowPassOtherFilter:i,getValue:o}=e,s={...e,onModelChange:(e,n)=>r(getUpdatedMultiFilterModel(this.params.model,this.handlerWrappers.length,e,t),n),doesRowPassOtherFilter:e=>i(e)&&this.doesFilterPass({node:e,data:e.data,model:this.params.model,handlerParams:s},t),getValue:updateGetValue(this.beans,e.column,this.filterDefs[t],o)};return s.filterParams.buttons&&(n&&q(292,{colId:e.column.getColId()}),delete s.filterParams.buttons),s}doesFilterPass(e,t){let n=e.model?.filterModels;return n==null||this.handlerWrappers.every((r,i)=>{let o=n[i];if(o==null||t!=null&&i===t)return!0;let s=r?.handler;return!s||s.doesFilterPass({...e,model:o,handlerParams:r.handlerParams})})}resetActiveList(e){this.activeFilterIndices=[];let t=e?.filterModels;if(t!=null)for(let e=0;e<this.handlerWrappers.length;e++)t[e]!=null&&this.activeFilterIndices.push(e)}updateActiveList(e,t){let n=this.activeFilterIndices;Zo(n,e),t!=null&&n.push(e)}getLastActiveFilterIndex(){let e=this.activeFilterIndices;return e.length>0?e[e.length-1]:null}getModelAsString(e,t){let n=t===`filterToolPanel`,defaultOption=()=>n?this.getLocaleTextFunc()(`filterSummaryInactive`,`is (All)`):``;if(!e?.filterModels?.length)return defaultOption();let r=this.getLastActiveFilterIndex()??0;return this.handlerWrappers[r]?.handler.getModelAsString?.(e.filterModels[r],t)??defaultOption()}getHandler(e){return this.handlerWrappers[e]?.handler}onAnyFilterChanged(){forEachReverse(this.handlerWrappers,e=>e?.handler?.onAnyFilterChanged?.())}onNewRowsLoaded(){forEachReverse(this.handlerWrappers,e=>e?.handler?.onNewRowsLoaded?.())}destroy(){for(let e of this.handlerWrappers)this.destroyBean(e?.handler);this.handlerWrappers.length=0,super.destroy()}},MultiFilterService=class extends U{constructor(){super(...arguments),this.beanName=`multiFilter`}getParamsForDataType(e,t,n,r){let i=e?.filters,o=this.beans;i||=[{filter:fo(n.baseDataType)},{filter:`agSetColumnFilter`}];let s=this.getLocaleTextFunc();return i=i.map(e=>{let{filter:i,filterParams:c,filterValueGetter:p}=e;if(typeof i!=`string`)return e;let{filterParams:m,filterValueGetter:h}=Ho(i,c,p??t,n,r,o,s);return{...e,filterParams:m,filterValueGetter:h}}),{filterParams:{...e,filters:i}}}},MultiFilterUi=class extends BaseMultiFilter{constructor(){super(...arguments),this.filterType=`multi`,this.filters=[],this.filterParams=[],this.validity=[]}init(e){this.params=e;
5let t=getMultiFilterDefs(e).map(t=>{if(t.filterParams?.buttons){q(292,{colId:e.column.getColId()});let n={...t.filterParams};return delete n.buttons,{...t,filterParams:n}}return t});this.filterDefs=t,this.allState=e.state;let n=this.filterDefs.map((e,t)=>this.createFilter(e,t));return new eo(e=>{eo.all(n).then(t=>{this.filters=t,this.refreshGui(`columnMenu`).then(()=>{e()})})})}refresh(e){let{model:t,state:n,source:r}=e;if(r===`colDef`)return!1;this.params=e;let i=this.filterParams;if(n===this.allState)return!0;this.allState=n;let o=n.state;return this.filters.forEach((e,s)=>{let c=getFilterModelForIndex(t,s),p={state:o?.[s],model:getFilterModelForIndex(n.model,s)};Vl(e,i[s],c,p,r)}),!0}getLastActiveFilterIndex(){return this.getHandler().getLastActiveFilterIndex?.()??null}getChildFilterInstance(e){return this.filters[e]??void 0}getNumChildFilters(){return this.filters.length}destroy(){for(let e of this.filters)this.destroyBean(e);this.filters.length=0,super.destroy()}getFilterWrappers(){return this.filters}getFilterFromWrapper(e){return e}getCompFromWrapper(e){return e}createFilter(e,t){let n=this.beans.userCompFactory,r=this.updateParams(e,this.params,t),i=ws(n,e,r,`agTextColumnFilter`);return i?(this.filterParams[t]=i.params,i.newAgStackInstance()):eo.resolve(null)}updateParams(e,t,n){let{doesRowPassOtherFilter:r,model:i,onModelChange:o,state:s,onStateChange:c,column:p,source:m,onAction:h,onUiChange:g,getValue:_}=t,v=getFilterModelForIndex(i,n),y=s?{model:getFilterModelForIndex(s.model,n),state:s.state?.[n]}:{model:v},onAnyFilterChanged=()=>{let e=this.getHandler();this.filters.forEach((t,r)=>{n!==r&&(e.getHandler(r)?.onAnyFilterChanged?.(),t?.onAnyFilterChanged?.())})},b=this.beans.colFilter;return{...b.createBaseFilterParams(p),...e,doesRowPassOtherFilter:e=>r(e)&&this.getHandler().doesFilterPass({node:e,data:e.data,model:this.params.model,handlerParams:b.getHandlerParams(p)},n),model:v,state:y,onModelChange:(e,t)=>
5{let{filters:r,params:i}=this,s=getUpdatedMultiFilterModel(i.model,r.length,e,n);this.updateActiveList(n,e),o(s,t),onAnyFilterChanged()},onStateChange:e=>this.onStateChange(c,n,e),getHandler:()=>this.getHandler().getHandler(n),onAction:(e,r,i)=>{if(jc(t))return;let o=e===`apply`||e===`reset`;o&&this.updateActiveList(n,getFilterModelForIndex(this.params.state.model,n)),h(e,r,i),o&&onAnyFilterChanged()},onUiChange:g,source:m,getValue:updateGetValue(this.beans,p,e,_)}}updateActiveList(e,t){this.getHandler().updateActiveList?.(e,t)}getHandler(){return this.params.getHandler()}onStateChange(e,t,n){let{model:r,state:i,valid:o}=n,s=this.validity;s[t]=o;let c=this.allState,p=getUpdatedMultiFilterModel(c.model,this.filters.length,r,t),m=s.every(e=>e!==!1),h=[...c.state??[]];h[t]=i;let g={state:h,model:p,valid:m};this.allState=g,e(g)}getModelAsString(e){return this.getHandler().getModelAsString?.(e)??``}},d_={tag:`div`,cls:`ag-multi-floating-filter ag-floating-filter-input`},MultiFloatingFilterComp=class extends K{constructor(){super(d_),this.floatingFilters=[],this.compDetailsList=[]}init(e){this.params=e;let{compDetailsList:t}=this.getCompDetailsList(e);return this.setParams(t)}setParams(e){let t=[];return e.forEach(e=>{let n=e?.newAgStackInstance();n!=null&&(this.compDetailsList.push(e),t.push(n))}),eo.all(t).then(e=>{e.forEach((e,t)=>{this.floatingFilters.push(e);let n=e.getGui();this.appendChild(n),t>0&&W(n,!1)})})}refresh(e){this.params=e;let{compDetailsList:t,floatingFilterParamsList:n}=this.getCompDetailsList(e);if(t.length===this.compDetailsList.length&&t.every((e,t)=>!this.beans.colFilter?.areFilterCompsDifferent(this.compDetailsList[t],e))){if(n.forEach((e,t)=>{this.floatingFilters[t].refresh?.(e)}),this.gos.get(`enableFilterHandlers`)){let t=e;if(t.model==null)this.floatingFilters.forEach((e,t)=>{W(e.getGui(),t===0)});else{let e=t.getHandler()?.getLastActiveFilterIndex?.();this.floatingFilters.forEach((t,n)=>{let r=e==null?n===0:n===e;W(t.getGui(),r)})}}}else Ml(this.getGui()),this.destroyBeans(this.floatingFilters),this.floatingFilters=[],this.compDetailsList=[],this.setParams(t)}getCompDetailsList(e){let t=[],n=[],r=e.filterParams,i=e.currentParentModel,o=getMultiFilterDefs(r);return o.forEach((r,s)=>{let c={...e,parentFilterInstance:e=>{this.parentMultiFilterInstance(t=>{let n=t.getChildFilterInstance(s);n!=null&&e(n)})},currentParentModel:()=>i()?.filterModels?.[s]??null};if(this.gos.get(`enableFilterHandlers`)){let e=c;e.model=e.model?.filterModels?.[s]??null;let{onModelChange:t,getHandler:n}=e;e.onModelChange=(e,n)=>t(getUpdatedMultiFilterModel(this.params.model,o.length,e,s),n),e.getHandler=()=>n().getHandler(s)}mc(c.filterParams,r.filterParams);let p=this.getCompDetails(r,c);p&&(t.push(p),n.push(c))}),{compDetailsList:t,floatingFilterParamsList:n}}onParentModelChanged(e,t){t?.afterFloatingFilter||this.parentMultiFilterInstance(n=>{if(e==null)this.floatingFilters.forEach((e,n)=>{e.onParentModelChanged(null,t),W(e.getGui(),n===0)});else{let r=n.getLastActiveFilterIndex();this.floatingFilters.forEach((n,i)=>{let o=e.filterModels.length>i?e.filterModels[i]:null;n.onParentModelChanged(o,t);let s=r==null?i===0:i===r;W(n.getGui(),s)})}})}destroy(){this.destroyBeans(this.floatingFilters),this.floatingFilters.length=0,super.destroy()}getCompDetails(e,t){let{colFilter:n,frameworkOverrides:r,userCompFactory:i}=this.beans,o=Ka(r,e,()=>n.getDefaultFloatingFilter(this.params.column))??`agReadOnlyFloatingFilter`;return dc(i,e,t,o)}parentMultiFilterInstance(e){this.params.parentFilterInstance(t=>{t instanceof MultiFilter||t instanceof MultiFilterUi||Hl(120),e(t)})}},f_={moduleName:`MultiFilter`,version:Z,userComponents:{agMultiColumnFilter:{getComp:e=>e.gos.get(`enableFilterHandlers`)?{classImp:MultiFilterUi,params:{useForm:!0}}:MultiFilter},agMultiColumnFloatingFilter:MultiFloatingFilterComp},beans:[MultiFilterService],dynamicBeans:{agMultiColumnFilterHandler:MultiFilterHandler},dependsOn:[fh,la,pg]},AggColumnNameService=class extends U{constructor(){super(...arguments),this.beanName=`aggColNameSvc`}getHeaderName(e,t){if(this.gos.get(`suppressAggFuncInHeader`))return t;let{valueColsSvc:n,colModel:r,rowGroupColsSvc:i}=this.beans,o=e.getColDef().pivotValueColumn,s=Xs(o),c=null,p;if(s){let r=n?.columns??[],i=this.gos.get(`removePivotHeaderRowWhenSingleValueColumn`)&&r.length===1,s=e.getColDef().pivotTotalColumnIds!==void 0;if(i&&!s)return t;c=o?o.getAggFunc():null,p=!0}else{let t=e.isValueActive(),n=i?.columns.length!==0,o=r.isPivotMode()||n||this.gos.get(`treeData`);t&&o?(c=e.getAggFunc(),p=!0):p=!1}if(p){let e=typeof c==`string`?c:`func`;return`${this.getLocaleTextFunc()(e,e)}(${t})`}return t}},p_={sum:`Sum`,first:`First`,last:`Last`,min:`Min`,max:`Max`,count:`Count`,avg:`Average`},AggFuncService=class extends U{constructor(){super(...arguments),this.beanName=`aggFuncSvc`,this.aggFuncsMap={},this.initialised=!1}postConstruct(){this.init()}init(){this.initialised||(this.initialiseWithDefaultAggregations(),this.addAggFuncs(this.gos.get(`aggFuncs`)))}initialiseWithDefaultAggregations(){let e=this.aggFuncsMap;e.sum=aggSum,e.first=aggFirst,e.last=aggLast,e.min=aggMin,e.max=aggMax,e.count=aggCount,e.avg=aggAvg,this.initialised=!0}isAggFuncPossible(e,t){let n=this.getFuncNames(e).includes(t),r=Xs(this.aggFuncsMap[t]);return n&&r}getDefaultFuncLabel(e){return p_[e]??e}getDefaultAggFunc(e){let t=e.getColDef().defaultAggFunc;if(Xs(t)&&this.isAggFuncPossible(e,t))return t;if(this.isAggFuncPossible(e,`sum`))return`sum`;let n=this.getFuncNames(e);return n?.length?n[0]:null}addAggFuncs(e){if(this.init(),e)for(let t of Object.keys(e))e[t]&&(this.aggFuncsMap[t]=e[t])}getAggFunc(e){return this.init(),this.aggFuncsMap[e]}getFuncNames(e){return e.getColDef().allowedAggFuncs??Object.keys(this.aggFuncsMap).sort()}clear(){this.aggFuncsMap={}}};function aggSum(e){let{values:t}=e,n=null;for(let e=0;e<t.length;e++){let r=t[e];
5typeof r==`number`?n===null?n=r:n+=typeof n==`number`?r:BigInt(r):typeof r==`bigint`&&(n=n===null?r:(typeof n==`bigint`?n:BigInt(n))+r)}return n}function aggFirst(e){return e.values.length>0?e.values[0]:null}function aggLast(e){return e.values.length>0?Kc(e.values):null}function aggMin(e){let{values:t}=e,n=null;for(let e=0;e<t.length;e++){let r=t[e];(typeof r==`number`||typeof r==`bigint`)&&(n===null||n>r)&&(n=r)}return n}function aggMax(e){let{values:t}=e,n=null;for(let e=0;e<t.length;e++){let r=t[e];(typeof r==`number`||typeof r==`bigint`)&&(n===null||n<r)&&(n=r)}return n}var m_=Object.freeze({toString:function(){return this.value.toString()},toNumber:function(){return this.value}});function aggCount(e){let{values:t}=e,n=0;for(let e=0;e<t.length;e++){let r=t[e];n+=r!=null&&typeof r.value==`number`?r.value:1}let r=e.rowNode?.aggData?.[e.column.getColId()];if(r&&r.value===n)return r;let i=Object.create(m_);return i.value=n,i}var h_=Object.freeze({toString:function(){return typeof this.value==`number`||typeof this.value==`bigint`?this.value.toString():``},toNumber:function(){return this.value}});function aggAvg(e){let{values:t}=e,n=0,r=0;for(let e=0;e<t.length;e++){let i=t[e],o=null;typeof i==`number`||typeof i==`bigint`?(o=i,r++):i!=null&&(typeof i.value==`number`||typeof i.value==`bigint`)&&typeof i.count==`number`&&(o=i.value*(typeof i.value==`number`?i.count:BigInt(i.count)),r+=i.count),typeof o==`number`?n+=typeof n==`number`?o:BigInt(o):typeof o==`bigint`&&(n=(typeof n==`bigint`?n:BigInt(n))+o)}let i=null;r>0&&(i=n/(typeof n==`number`?r:BigInt(r)));let o=e.rowNode?.aggData?.[e.column?.getColId()];if(o&&o.count===r&&o.value===i)return o;let s=Object.create(h_);return s.count=r,s.value=i,s}function addAggFuncs(e,t){e.aggFuncSvc&&e.aggFuncSvc.addAggFuncs(t)}function clearAggFuncs(e){e.aggFuncSvc&&e.aggFuncSvc.clear()}function setColumnAggFunc(e,t,n){e.valueColsSvc?.setColumnAggFunc?.(t,n,`api`)}function _aggregateValues(e,t,n,r,i,o){let s=typeof n==`string`?e.aggFuncSvc.getAggFunc(n):n;return typeof s==`function`?s(co(e.gos,{values:t,column:r,colDef:r.colDef,pivotResultColumn:o,rowNode:i,data:i?.data})):(q(109,{inputValue:n.toString(),allSuggestions:e.aggFuncSvc.getFuncNames(r)}),null)}var AggregationStage=class extends U{constructor(){super(...arguments),this.beanName=`aggStage`,this.step=`aggregate`,this.refreshProps=[`getGroupRowAgg`,`alwaysAggregateAtRootLevel`,`suppressAggFilteredOnly`,`grandTotalRow`]}wireBeans(e){this.colModel=e.colModel,this.pivotColsSvc=e.pivotColsSvc,this.valueColsSvc=e.valueColsSvc,this.pivotResultCols=e.pivotResultCols,this.valueSvc=e.valueSvc}execute(e){let t=!this.valueColsSvc?.columns?.length,n=!this.gos.getCallback(`getGroupRowAgg`);if(t&&n&&e.changedPath?.active)return;let r=this.createAggDetails(e);this.recursivelyCreateAggData(r)}createAggDetails(e){let t=this.colModel.isPivotActive(),n=this.valueColsSvc?.columns,r=t&&this.pivotColsSvc?this.pivotColsSvc.columns:[];return{alwaysAggregateAtRootLevel:this.gos.get(`alwaysAggregateAtRootLevel`),groupIncludeTotalFooter:!!Nl(this.gos),changedPath:e.changedPath,valueColumns:n??[],pivotColumns:r,filteredOnly:!this.isSuppressAggFilteredOnly(),userAggFunc:this.gos.getCallback(`getGroupRowAgg`)}}isSuppressAggFilteredOnly(){return Cl(this.gos)!==void 0||this.gos.get(`suppressAggFilteredOnly`)}recursivelyCreateAggData(e){let callback=t=>{if(!t.hasChildren()){t.aggData&&this.setAggData(t,null);return}if(t.level===-1&&!e.groupIncludeTotalFooter){let n=!this.colModel.isPivotMode();if(!e.alwaysAggregateAtRootLevel&&n){this.setAggData(t,null);return}}this.aggregateRowNode(t,e)};e.changedPath.forEachChangedNodeDepthFirst(callback,!0)}aggregateRowNode(e,t){let n=t.valueColumns.length===0,r=t.pivotColumns.length===0,i;i=t.userAggFunc?t.userAggFunc({nodes:e.childrenAfterFilter}):n?null:r?this.aggregateRowNodeUsingValuesOnly(e,t):this.aggregateRowNodeUsingValuesAndPivot(e),this.setAggData(e,i),e.sibling&&(this.setAggData(e.sibling,i),e.sibling.pinnedSibling&&this.setAggData(e.sibling.pinnedSibling,i))}aggregateRowNodeUsingValuesAndPivot(e){let t={},n=this.pivotResultCols?.getPivotResultCols()?.list??[],r=!0,i=this.beans;for(let o=0;o<n.length;o++){let s=n[o],c=s.getColDef();if(c.pivotTotalColumnIds!=null){r=!1;continue}let p=c.pivotKeys??[],m;m=e.leafGroup?this.getValuesFromMappedSet(e.childrenMapped,p,c.pivotValueColumn):this.getValuesPivotNonLeaf(e,c.colId),t[c.colId]=_aggregateValues(i,m,c.pivotValueColumn.getAggFunc(),c.pivotValueColumn,e,s)}if(!r)for(let r=0;r<n.length;r++){let o=n[r],s=o.getColDef();if(!s.pivotTotalColumnIds?.length)continue;let c=s.pivotTotalColumnIds.map(e=>t[e]);t[s.colId]=_aggregateValues(i,c,s.pivotValueColumn.getAggFunc(),s.pivotValueColumn,e,o)}return t}aggregateRowNodeUsingValuesOnly(e,t){let n={},{changedPath:r,valueColumns:i,filteredOnly:o}=t,s=r.active?r.getValueColumnsForNode(e,i):i,c=r.active?r.getNotValueColumnsForNode(e,i):null,p=this.getValuesNormal(e,s,o),m=e.aggData,h=this.beans;if(s.forEach((t,r)=>{n[t.getId()]=_aggregateValues(h,p[r],t.getAggFunc(),t,e)}),c&&m)for(let e of c)n[e.getId()]=m[e.getId()];return n}getValuesPivotNonLeaf(e,t){return e.childrenAfterFilter.map(e=>e.aggData[t])}getValuesFromMappedSet(e,t,n){let r=e;for(let e=0;e<t.length;e++){let n=t[e];r=r?r[n]:null}return r?r.map(e=>this.valueSvc.getValue(n,e)):[]}getValuesNormal(e,t,n){let r=[];t.forEach(()=>r.push([]));let i=t.length,o=n?e.childrenAfterFilter:e.childrenAfterGroup,s=o.length;for(let e=0;e<s;e++){let n=o[e];for(let e=0;e<i;e++){let i=t[e],o=this.valueSvc.getValue(i,n);r[e].push(o)}}return r}setAggData(e,t){let n=e.aggData;if(e.aggData=t,e.__localEventService){let eventFunc=t=>{let r=e.aggData?e.aggData[t]:void 0,i=n?n[t]:void 0;if(r===i)return;let o=this.colModel.getColById(t);o&&e.dispatchCellChangedEvent(o,r,i)};if(n)for(let e of Object.keys(n))eventFunc(e);if(t)for(let e of Object.keys(t))(!n||!(e in n))&&eventFunc(e)}}},FilterAggregatesStage=class extends U{constructor(){super(...arguments),this.beanName=`filterAggStage`,this.step=`filter_aggregates`,this.refreshPro
5ps=[]}wireBeans(e){this.filterManager=e.filterManager}execute(e){let t=this.beans.colModel.isPivotMode(),n=this.filterManager?.isAggregateFilterPresent()||this.filterManager?.isAggregateQuickFilterPresent(),defaultPrimaryColumnPredicate=e=>!e.node.group,defaultSecondaryColumnPredicate=e=>e.node.leafGroup,r=Cl(this.gos)||(t?defaultSecondaryColumnPredicate:defaultPrimaryColumnPredicate),{changedPath:i}=e,preserveChildren=(e,t=!1)=>{if(e.childrenAfterFilter){if(e.childrenAfterAggFilter=e.childrenAfterFilter,t)for(let n of e.childrenAfterAggFilter)preserveChildren(n,t);this.setAllChildrenCount(e)}e.sibling&&(e.sibling.childrenAfterAggFilter=e.childrenAfterAggFilter)},filterChildren=e=>{e.childrenAfterAggFilter=e.childrenAfterFilter?.filter(e=>r({node:e})&&this.filterManager.doesRowPassAggregateFilters({rowNode:e})?(preserveChildren(e,!0),!0):e.childrenAfterAggFilter?.length)||null,this.setAllChildrenCount(e),e.sibling&&(e.sibling.childrenAfterAggFilter=e.childrenAfterAggFilter)};i.forEachChangedNodeDepthFirst(n?filterChildren:preserveChildren,!0)}setAllChildrenCountTreeData(e){let t=e.childrenAfterAggFilter,n=0;if(t){let e=t.length;n=e;for(let r=0;r<e;++r)n+=t[r].allChildrenCount??0}e.setAllChildrenCount(n===0&&e.level>=0?null:n)}setAllChildrenCountGridGrouping(e){let t=0;e.childrenAfterAggFilter.forEach(e=>{e.group?t+=e.allChildrenCount:t++}),e.setAllChildrenCount(t)}setAllChildrenCount(e){if(!e.hasChildren()){e.setAllChildrenCount(null);return}this.gos.get(`treeData`)?this.setAllChildrenCountTreeData(e):this.setAllChildrenCountGridGrouping(e)}};function _createRowNodeFooter(e,t){if(e.sibling)return;let n=ac(e,t);n.footer=!0,n.setRowTop(null),n.setRowIndex(null),n.oldRowTop=null,n.id=`rowGroupFooter_`+e.id,n.sibling=e,e.sibling=n}function _destroyRowNodeFooter(e){e.sibling&&=(e.sibling.setRowTop(null),e.sibling.setRowIndex(null),void 0)}var FooterService=class extends U{constructor(){super(...arguments),this.beanName=`footerSvc`}addTotalRows(e,t,n,r,i,o){let s=e;if(i)return _positionMatchesGrandTotalRow(o,r&&Nl(this.gos))&&(_createRowNodeFooter(t,this.beans),n(t.sibling,s++)),s;let c=Gs(this.gos);return(r&&c({node:t}))===o&&(_createRowNodeFooter(t,this.beans),n(t.sibling,s++)),s}getTopDisplayIndex(e,t,n,r){let i=t;if(e[0].footer){if(t===0)return 0;--i}let o=e[e.length-1],s=i>=n.length;return o.footer&&s?o.rowIndex:r(i)}doesCellShowTotalPrefix(e,t){return!e.footer||!t?.getColDef().showRowGroup?!1:this.gos.get(`treeData`)?!0:e.level===-1?this.beans.showRowGroupCols?.getShowRowGroupCols()[0]===t:!!e.rowGroupColumn&&t?.isRowGroupDisplayed(e.rowGroupColumn.getId())}applyTotalPrefix(e,t,n,r){let i=r.getColDef().cellRendererParams?.totalValueGetter;if(i){let o=co(this.gos,{column:r,node:n,value:e,formattedValue:t});if(typeof i==`function`)return i(o);if(typeof i==`string`)return this.beans.expressionSvc?.evaluate(i,o);q(179)}return n.level===-1?this.getLocaleTextFunc()(`footerTotal`,`Total`)+` `:this.getTotalValue(t??e)??``}getTotalValue(e){return this.getLocaleTextFunc()(`footerTotal`,`Total`)+` `+(e??``)}};function _positionMatchesGrandTotalRow(e,t){switch(t){case`top`:case`pinnedTop`:return e===`top`;case`bottom`:case`pinnedBottom`:return e===`bottom`;default:return!1}}var ValueColsSvc=class extends _s{constructor(){super(...arguments),this.beanName=`valueColsSvc`,this.eventName=`columnValueChanged`,this.columnProcessors={set:(e,t,n)=>this.setValueActive(t,e,n),add:(e,t,n)=>this.setValueActive(!0,e,n),remove:(e,t,n)=>this.setValueActive(!1,e,n)},this.columnExtractors={setFlagFunc:(e,t,n)=>this.setColValueActive(e,t,n),getIndexFunc:()=>void 0,getInitialIndexFunc:()=>void 0,getValueFunc:e=>{let t=e.aggFunc;if(t===null||t===``)return null;if(t!==void 0)return!!t},getInitialValueFunc:e=>e.initialAggFunc!=null&&e.initialAggFunc!=``},this.modifyColumnsNoEventsCallbacks={addCol:e=>this.columns.push(e),removeCol:e=>Zo(this.columns,e)}}extractCols(e,t){this.columns=super.extractCols(e,t);for(let e of this.columns){let t=e.getColDef();t.aggFunc!=null&&t.aggFunc!=``?this.setColAggFunc(e,t.aggFunc):e.getAggFunc()||this.setColAggFunc(e,t.initialAggFunc)}return this.columns}
5setColumnAggFunc(e,t,n){if(!e)return;let r=this.colModel.getColDefCol(e);r&&(this.setColAggFunc(r,t),this.dispatchColumnChangedEvent(this.eventSvc,this.eventName,[r],n))}syncColumnWithState(e,t,n){let r=n(`aggFunc`).value1;r!==void 0&&(typeof r==`string`?(this.setColAggFunc(e,r),e.isValueActive()||(this.setColValueActive(e,!0,t),this.modifyColumnsNoEventsCallbacks.addCol(e))):(Xs(r)&&q(33),e.isValueActive()&&(this.setColValueActive(e,!1,t),this.modifyColumnsNoEventsCallbacks.removeCol(e))))}setValueActive(e,t,n){if(e!==t.isValueActive()&&(this.setColValueActive(t,e,n),e&&!t.getAggFunc()&&this.aggFuncSvc)){let e=this.aggFuncSvc.getDefaultAggFunc(t);this.setColAggFunc(t,e)}}setColAggFunc(e,t){e.aggFunc=t,e.dispatchStateUpdatedEvent(`aggFunc`)}setColValueActive(e,t,n){e.aggregationActive!==t&&(e.aggregationActive=t,e.dispatchColEvent(`columnValueChanged`,n))}},g_={moduleName:`SharedAggregation`,version:Z,beans:[AggFuncService,AggColumnNameService,FooterService,ValueColsSvc],apiFunctions:{addAggFuncs,clearAggFuncs,setColumnAggFunc},dependsOn:[fh]},__={moduleName:`Aggregation`,version:Z,beans:[AggregationStage,FilterAggregatesStage],rowModels:[`clientSide`],dependsOn:[g_]},getDate=({valueSvc:e,dataTypeSvc:t},n,r)=>{let i=e.getValue(n,r),o=null;return i instanceof Date?o=i:typeof i==`string`&&(o=(t?.getDateParserFunction(n)??Ec)(i)??null),o},getDatePartValueGetter=(e,t,n,r)=>i=>{let o=getDate(e,t,i.node),s=ys(o);return s?r?.(s[n])??s[n]:null},getHeaderValueGetter=({colNames:e},t,n)=>r=>{let i=e.getDisplayNameForColumn(t,r.location);return i?`${i} (${n})`:``},v_=Object.fromEntries(Oa.map(e=>[e,e.toLowerCase()])),numericalMonthToNamedMonth=e=>{let t=Oa[Number.parseInt(e,10)-1]??e;return{month:t,localeKey:v_[t]??e}};function _getGroupHierarchy(e){return e.groupHierarchy??e.rowGroupingHierarchy}var GroupHierarchyColService=class extends U{constructor(){super(...arguments),this.beanName=`groupHierarchyColSvc`,this.columns=null,this.sourceColumnMap=new WeakMap,this.inverseColumnMap=new WeakMap}addColumns(e){let t=this.columns;t!=null&&(e.list=t.list.filter(t=>!e.list.some(e=>e.getColId()===t.getColId())).concat(e.list),e.tree=t.tree.filter(t=>!e.tree.some(e=>e.getId()===t.getId())).concat(e.tree),Ac(e))}createColumns(e){let t=new WeakMap,n=new WeakMap,r=this.createGroupHierarchyColumns(e,t,n);if(Wo(r,this.columns?.list??[]))return;Qc(this.beans,this.columns?.tree),this.columns=null;let{colGroupSvc:i}=this.beans,o=i?.findDepth(e.tree)??0,s=i?.balanceTreeForAutoCols(r,o)??[];this.columns={list:r,tree:s,treeDepth:o,map:{}},this.sourceColumnMap=t,this.inverseColumnMap=n}updateColumns(e){}getColumn(e){return this.columns?.list.find(t=>rl(t,e))??null}getColumns(){return this.columns?.list??null}expandColumnInto(e,t){let n=this.getVirtualColumnsForColumn(t).concat(t);for(let t of n)e.some(e=>rl(e,t)||e.getColId()===t.getColId())||e.push(t)}compareVirtualColumns(e,t){let n=this.inverseColumnMap.get(e),r=this.inverseColumnMap.get(t);if(n&&n===r){let r=this.sourceColumnMap.get(n)??[];return r?.indexOf(e)-r?.indexOf(t)}return this.sourceColumnMap.get(e)?.includes(t)?1:this.sourceColumnMap.get(t)?.includes(e)?-1:null}insertVirtualColumnsForCol(e,t){let n=this.getVirtualColumnsForColumn(t);if(!n)return[];let r=e.indexOf(t);return r<0&&(r=e.length-1),Ys(e,n),e.splice(r,0,...n),n}getVirtualColumnsForColumn(e){return this.isGroupHierarchyColsEnabledForCol(e)?this.sourceColumnMap.get(e)??[]:[]}isGroupHierarchyColsEnabled(e){return e.list.some(e=>this.isGroupHierarchyColsEnabledForCol(e))}isGroupHierarchyColsEnabledForCol(e){let t=e.getColDef();return!!(_getGroupHierarchy(t)&&(t.rowGroup||t.enableRowGroup||t.rowGroupIndex!=null||t.pivot||t.enablePivot||t.pivotIndex!=null))}createGroupHierarchyColDefs(e){let t=[],n=e.getColDef(),r=_getGroupHierarchy(n);if(!r||!this.isGroupHierarchyColsEnabledForCol(e))return t;for(let i of r){let r=null;r=typeof i==`string`?this.createColDefForPart(i,e,n):i,r&&t.push(r)}return t}createGroupHierarchyColumns(e,t,n){if(!this.isGroupHierarchyColsEnabled(e))return[];let r=[];for(let i of e.list)for(let e of this.createGroupHierarchyColDefs(i)){let o=e.colId;this.gos.validateColDef(e,o,!0);let s=new ka(e,null,o,!0);this.createBean(s),r.push(s),updateMap(t,i,s),n.set(s,i)}return r}createColDefForPart(e,t,n){let{beans:r,gos:i}=this,o=`${Vs}-${t.getColId()}-${e}`,s={enableRowGroup:n.enableRowGroup,rowGroup:n.rowGroup,enablePivot:n.enablePivot,hide:!0,editable:!1},c=i.get(`groupHierarchyConfig`)??{};if(e in c){let t={...s,...c[e]};return t.colId??=o,mo(r,t,t.colId,!0)}let p=mo(r,{colId:o,...s},o,!0),m=r.localeSvc?.getLocaleTextFunc(),translatePart=(e,t)=>m?.(e,t)??t;switch(e){case`year`:return{...p,headerValueGetter:getHeaderValueGetter(r,t,translatePart(e,`Year`)),valueGetter:getDatePartValueGetter(r,t,0)};case`quarter`:return{...p,headerValueGetter:getHeaderValueGetter(r,t,translatePart(e,`Quarter`)),valueGetter:getDatePartValueGetter(r,t,1,e=>(Math.floor(Number(e)/4)+1).toString())};case`month`:return{...p,headerValueGetter:getHeaderValueGetter(r,t,translatePart(e,`Month`)),valueGetter:getDatePartValueGetter(r,t,1)};case`formattedMonth`:return{...p,headerValueGetter:getHeaderValueGetter(r,t,translatePart(`month`,`Month`)),valueGetter:getDatePartValueGetter(r,t,1,e=>{let t=numericalMonthToNamedMonth(e);return translatePart(t.localeKey,t.month)})};case`day`:return{...p,headerValueGetter:getHeaderValueGetter(r,t,translatePart(e,`Day`)),valueGetter:getDatePartValueGetter(r,t,2)};case`hour`:return{...p,headerValueGetter:getHeaderValueGetter(r,t,translatePart(e,`Hour`)),valueGetter:getDatePartValueGetter(r,t,3)};case`minute`:return{...p,headerValueGetter:getHeaderValueGetter(r,t,translatePart(e,`Minute`)),valueGetter:getDatePartValueGetter(r,t,4)};case`second`:return{...p,headerValueGetter:getHeaderValueGetter(r,t,translatePart(e,`Second`)),valueGetter:getDatePartValueGetter(r,t,5)};default:return null}}};
5function updateMap(e,t,n){let r=e.get(t);e.set(t,(r??[]).concat(n))}var y_={moduleName:`GroupHierarchy`,version:Z,beans:[GroupHierarchyColService]},PivotColsSvc=class extends _s{constructor(){super(...arguments),this.beanName=`pivotColsSvc`,this.eventName=`columnPivotChanged`,this.columnProcessors={set:(e,t,n)=>this.setColPivotActive(e,t,n),add:(e,t,n)=>this.setColPivotActive(e,!0,n),remove:(e,t,n)=>this.setColPivotActive(e,!1,n)},this.columnOrdering={enableProp:`pivot`,initialEnableProp:`initialPivot`,indexProp:`pivotIndex`,initialIndexProp:`initialPivotIndex`},this.columnExtractors={setFlagFunc:(e,t,n)=>this.setColPivotActive(e,t,n),getIndexFunc:e=>e.pivotIndex,getInitialIndexFunc:e=>e.initialPivotIndex,getValueFunc:e=>e.pivot,getInitialValueFunc:e=>e.initialPivot},this.modifyColumnsNoEventsCallbacks={addCol:e=>{this.columns.includes(e)||this.columns.push(e)},removeCol:e=>Zo(this.columns,e)}}syncColumnWithState(e,t,n,r){let{value1:i,value2:o}=n(`pivot`,`pivotIndex`);(i!==void 0||o!==void 0)&&(typeof o==`number`||i?(e.isPivotActive()||(this.setColPivotActive(e,!0,t),this.modifyColumnsNoEventsCallbacks.addCol(e)),r&&typeof o==`number`&&(r[e.getId()]=o)):e.isPivotActive()&&(this.setColPivotActive(e,!1,t),this.modifyColumnsNoEventsCallbacks.removeCol(e)))}setColPivotActive(e,t,n){e.pivotActive!==t&&(e.pivotActive=t,t&&(this.beans.groupHierarchyColSvc?.insertVirtualColumnsForCol(this.columns,e))?.forEach(e=>this.setColPivotActive(e,t,n)),e.dispatchColEvent(`columnPivotChanged`,n)),e.dispatchStateUpdatedEvent(`pivot`)}},RowGroupColsSvc=class extends _s{constructor(){super(...arguments),this.beanName=`rowGroupColsSvc`,this.eventName=`columnRowGroupChanged`,this.columnProcessors={set:(e,t,n)=>this.setActive(t,e,n),add:(e,t,n)=>this.setActive(!0,e,n),remove:(e,t,n)=>this.setActive(!1,e,n)},this.columnOrdering={enableProp:`rowGroup`,initialEnableProp:`initialRowGroup`,indexProp:`rowGroupIndex`,initialIndexProp:`initialRowGroupIndex`},this.columnExtractors={setFlagFunc:(e,t,n)=>this.setColRowGroupActive(e,t,n),getIndexFunc:e=>e.rowGroupIndex,getInitialIndexFunc:e=>e.initialRowGroupIndex,getValueFunc:e=>e.rowGroup,getInitialValueFunc:e=>e.initialRowGroup},this.modifyColumnsNoEventsCallbacks={addCol:e=>{this.columns.includes(e)||this.columns.push(e)},removeCol:e=>Zo(this.columns,e)}}moveColumn(e,t,n){if(this.columns.length===0)return;let r=this.columns[e],i=this.columns.slice(e,t);this.columns.splice(e,1),this.columns.splice(t,0,r),this.updateIndexMap(),this.eventSvc.dispatchEvent({type:this.eventName,columns:i,column:i.length===1?i[0]:null,source:n})}syncColumnWithState(e,t,n,r){let{value1:i,value2:o}=n(`rowGroup`,`rowGroupIndex`);(i!==void 0||o!==void 0)&&(typeof o==`number`||i?(e.isRowGroupActive()||(this.setColRowGroupActive(e,!0,t),this.modifyColumnsNoEventsCallbacks.addCol(e)),r&&typeof o==`number`&&(r[e.getId()]=o)):e.isRowGroupActive()&&(this.setColRowGroupActive(e,!1,t),this.modifyColumnsNoEventsCallbacks.removeCol(e)))}setActive(e,t,n){if(e===t.isRowGroupActive())return;this.setColRowGroupActive(t,e,n);let r=this.beans.groupHierarchyColSvc?.getColumn(t);Vo(this.gos,e)&&!r&&this.colModel.setColsVisible([t],!e,n)}setColRowGroupActive(e,t,n){e.rowGroupActive!==t&&(e.rowGroupActive=t,t&&(this.beans.groupHierarchyColSvc?.insertVirtualColumnsForCol(this.columns,e))?.forEach(e=>this.setColRowGroupActive(e,t,n)),e.dispatchColEvent(`columnRowGroupChanged`,n)),e.dispatchStateUpdatedEvent(`rowGroup`)}},AutoColService=class extends U{constructor(){super(...arguments),this.beanName=`autoColSvc`}postConstruct(){this.addManagedPropertyListener(`autoGroupColumnDef`,this.updateColumns.bind(this))}addColumns(e){this.columns!=null&&(e.list=this.columns.list.concat(e.list),e.tree=this.columns.tree.concat(e.tree),Ac(e))}createColumns(e,t,n){let r=this.beans,{colModel:i,gos:o,rowGroupColsSvc:s,colGroupSvc:c}=r,p=i.isPivotMode(),m=us(o,p),h=p?o.get(`pivotSuppressAutoColumn`):this.isSuppressAutoCol(),g=s?.columns,_=!(g&&g.length>0||o.get(`treeData`))||h||m,destroyPrevious=()=>{this.columns&&=(Qc(r,this.columns.tree),null)};if(_){destroyPrevious();return}let v=this.generateAutoCols(g),y=Wo(v,this.columns?.list||null),b=e.treeDepth,x=(this.columns?this.columns.treeDepth:-1)==b;if(y&&x){let e=new Map(v.map(e=>[e.getId(),e]));for(let t of this.columns?.list??[]){let r=e.get(t.getId());r&&t.setColDef(r.getColDef(),null,n)}return}destroyPrevious();let S=c?.findDepth(e.tree)??0,C=c?.balanceTreeForAutoCols(v,S)??[];this.columns={list:v,tree:C,treeDepth:S,map:{}};let putAutoColsFirstInList=e=>{if(!e)return null;let t=e.filter(e=>!ul(e));return[...v,...t]};t(putAutoColsFirstInList)}updateColumns(e){let t=Sl(e.source);this.columns?.list.forEach((e,n)=>this.updateOneAutoCol(e,n,t))}getColumn(e){return this.columns?.list.find(t=>rl(t,e))??null}getColumns(){return this.columns?.list??null}generateAutoCols(e=[]){let t=[],n=this.gos.get(`treeData`),r=hs(this.gos);return n&&r&&(q(182),r=!1),r?e.forEach((e,n)=>{t.push(this.createOneAutoCol(e,n))}):t.push(this.createOneAutoCol()),t}isSuppressAutoCol(){let e=this.gos;return e.get(`groupDisplayType`)===`custom`||e.get(`treeDataDisplayType`)===`custom`}createOneAutoCol(e,t){let n;n=e?`${Cc}-${e.getId()}`:Cc;let r=this.createAutoColDef(n,e,t);r.colId=n;let i=new ka(r,null,n,!0);return this.createBean(i),i}updateOneAutoCol(e,t,n){let r=e.getColDef(),i=typeof r.showRowGroup==`string`?r.showRowGroup:void 0,o=this.beans,s=i==null?void 0:o.colModel.getColDefCol(i),c=e.getId(),p=this.createAutoColDef(c,s??void 0,t);e.setColDef(p,null,n),Es(o,{state:[{colId:c,...p}]},n)}createAutoColDef(e,t,n){let r=this.createBaseColDef(t),i=this.gos.get(`autoGroupColumnDef`);mc(r,i),r=mo(this.beans,r,e,!0),this.gos.get(`treeData`)||dl(r.field)&&dl(r.valueGetter)&&dl(r.filterValueGetter)&&r.f
5ilter!==`agGroupColumnFilter`&&(r.filter=!1),n&&n>0&&(r.headerCheckboxSelection=!1);let o=Oo(this.gos),s=r.valueGetter||r.field!=null;return o&&!s&&(r.sortIndex=void 0,r.initialSort=void 0),r}createBaseColDef(e){let t=this.gos.get(`autoGroupColumnDef`),n={headerName:this.getLocaleTextFunc()(`group`,`Group`),showRowGroup:e?.getColId()??!0};return t&&(t.cellRenderer||t.cellRendererSelector)||(n.cellRenderer=`agGroupCellRenderer`),e&&(n.headerName=this.beans.colNames.getDisplayNameForColumn(e,`header`)??void 0,n.headerValueGetter=e.colDef.headerValueGetter),n}destroy(){Qc(this.beans,this.columns?.tree),super.destroy()}},BaseExpansionService=class extends U{addExpandedCss(e,t){t.isExpandable()&&(e.push(`ag-row-group`),e.push(t.expanded?`ag-row-group-expanded`:`ag-row-group-contracted`))}getRowExpandedListeners(e){let{rowNode:t}=e,n=this.updateExpandedCss.bind(this,e,t);return{expandedChanged:n,hasChildrenChanged:n}}setExpanded(e,t,n,r){if(e.expanded===t)return;e.expanded=t,e.dispatchRowEvent(`expandedChanged`);let i={...ec(e,this.gos,`rowGroupOpened`),expanded:t,event:n||null};this.dispatchExpandedEvent(i,r)}isExpandable(e){return e.footer?!1:this.beans.colModel.isPivotMode()?e.hasChildren()&&!e.leafGroup:e.hasChildren()||e.master}updateExpandedCss(e,t){let n=t.isExpandable(),r=t.expanded==1;e.forEachGui(void 0,e=>{let t=e.rowComp;t.toggleCss(`ag-row-group`,n),t.toggleCss(`ag-row-group-expanded`,n&&r),t.toggleCss(`ag-row-group-contracted`,n&&!r),to(e.element,n&&r)})}dispatchStateUpdatedEvent(){this.eventSvc.dispatchEvent({type:`rowExpansionStateChanged`})}},ClientSideExpansionService=class extends BaseExpansionService{constructor(){super(...arguments),this.beanName=`expansionSvc`,this.events=null,this.dispatchExpandedDebounced=null}destroy(){super.destroy(),this.events=null,this.dispatchExpandedDebounced=null}setExpansionState(e){let t=new Set(e.expandedRowGroupIds);this.beans.rowModel.forEachNode(e=>{let n=e.id;n&&(e.expanded=t.has(n))}),this.onGroupExpandedOrCollapsed()}getExpansionState(){let e=[],t=[];return this.beans.rowModel.forEachNode(n=>{let r=n.id;r&&(n.expanded?e.push(r):t.push(r))}),{expandedRowGroupIds:e,collapsedRowGroupIds:t}}expandAll(e){let{gos:t,rowModel:n,colModel:r,eventSvc:i}=this.beans,o=t.get(`treeData`),s=r.isPivotActive(),recursiveExpandOrCollapse=t=>{if(t)for(let n of t){let actionRow=()=>{n.expanded=e,recursiveExpandOrCollapse(n.childrenAfterGroup)};if(n.master){actionRow();continue}if(o){Xs(n.childrenAfterGroup)&&actionRow();continue}if(s){n.leafGroup||actionRow();continue}n.group&&actionRow()}},c=n.rootNode;c&&recursiveExpandOrCollapse(c.childrenAfterGroup),this.onGroupExpandedOrCollapsed(),i.dispatchEvent({type:`expandOrCollapseAll`,source:e?`expandAll`:`collapseAll`})}onGroupExpandedOrCollapsed(){this.dispatchStateUpdatedEvent(),this.beans.rowModel.refreshModel({step:`map`})}setDetailsExpansionState(e){let t=this.getExpansionState(),n=t.collapsedRowGroupIds.length===0;if(t.expandedRowGroupIds.length===0!==n)return n?e.expandAll():e.collapseAll()}dispatchExpandedEvent(e,t){if((this.events??=[]).push(e),t){this.dispatchExpandedEvents();return}let n=this.dispatchExpandedDebounced;if(!n){if(!this.isAlive())return;n=this.debounce(()=>this.dispatchExpandedEvents()),this.dispatchExpandedDebounced=n}n()}dispatchExpandedEvents(){let{eventSvc:e,rowRenderer:t}=this.beans,n=this.events,r=n?.length;if(!r)return;this.events=null;let i=Array(r);for(let t=0;t<r;++t)i[t]=n[t].node,e.dispatchEvent(n[t]);this.dispatchStateUpdatedEvent(),t.refreshCells({rowNodes:i})}debounce(e){let t=this.beans.animationFrameSvc;if(!t)return()=>window.setTimeout(e,0);let n=!1;return()=>{if(!t.active){window.setTimeout(e,0);return}n||(n=!0,t.addDestroyTask(()=>{n=!1,e()}))}}};function _getFlattenDetails(e){let t=e.get(`groupHideParentOfSingleChild`);return t||(t=e.get(`groupRemoveSingleChildren`),!t&&e.get(`groupRemoveLowestSingleChildren`)&&(t=`leafGroupsOnly`)),{groupHideParentOfSingleChild:t,isGroupMultiAutoColumn:hs(e),hideOpenParents:e.get(`groupHideOpenParents`),grandTotalRow:Nl(e),groupTotalRow:Gs(e)}}function _isRemovedSingleChildrenGroup(e,t,n){return e.groupHideParentOfSingleChild===!0&&n&&t.childrenAfterGroup.length===1}function _isRemovedLowestSingleChildrenGroup(e,t,n){return e.groupHideParentOfSingleChild===`leafGroupsOnly`&&n&&t.leafGroup&&t.childrenAfterGroup.length===1}function _shouldRowBeRendered(e,t,n,r,i,o){let s=r&&!n,c=r&&t.leafGroup,p=e.hideOpenParents&&t.expanded&&!t.master&&!c;return!s&&!p&&!i&&!o}var FlattenStage=class extends U{constructor(){super(...arguments),this.beanName=`flattenStage`,this.step=`map`,this.refreshPro
5ps=[`groupHideParentOfSingleChild`,`groupRemoveSingleChildren`,`groupRemoveLowestSingleChildren`,`groupTotalRow`,`masterDetail`]}execute(e){let t=e.rowNode,n=[],r=this.beans.colModel.isPivotMode(),i=r&&t.leafGroup&&t.aggData,o=i?[t]:t.childrenAfterSort,s=_getFlattenDetails(this.gos);this.recursivelyAddToRowsToDisplay(s,o,n,r,0);let c=n.length>0,p=s.grandTotalRow;if(!i&&c&&p){if(_createRowNodeFooter(t,this.beans),p===`pinnedBottom`||p===`pinnedTop`)this.beans.pinnedRowModel?.setGrandTotalPinned(p===`pinnedBottom`?`bottom`:`top`);else{let e=p===`top`;this.addRowNodeToRowsToDisplay(s,t.sibling,n,0,e)}}return n}recursivelyAddToRowsToDisplay(e,t,n,r,i){if(!t?.length)return;let o=this.beans.masterDetailSvc;for(let s=0;s<t.length;s++){let c=t[s],p=c.hasChildren(),m=_isRemovedSingleChildrenGroup(e,c,p),h=_isRemovedLowestSingleChildrenGroup(e,c,p);if(_shouldRowBeRendered(e,c,p,r,m,h)&&this.addRowNodeToRowsToDisplay(e,c,n,i),!(r&&c.leafGroup)){if(p){let t=m||h;if(c.expanded||t){let s=e.groupTotalRow({node:c});s||_destroyRowNodeFooter(c);let p=t?i:i+1;s===`top`&&(_createRowNodeFooter(c,this.beans),this.addRowNodeToRowsToDisplay(e,c.sibling,n,p));let m=o?.getDetail(c);m&&this.addRowNodeToRowsToDisplay(e,m,n,i),this.recursivelyAddToRowsToDisplay(e,c.childrenAfterSort,n,r,p),s===`bottom`&&(_createRowNodeFooter(c,this.beans),this.addRowNodeToRowsToDisplay(e,c.sibling,n,p))}}else{let t=o?.getDetail(c);t&&this.addRowNodeToRowsToDisplay(e,t,n,i)}}}}addRowNodeToRowsToDisplay(e,t,n,r,i){i?n.unshift(t):n.push(t),t.setUiLevel(e.isGroupMultiAutoColumn?0:r)}},GroupStage=class extends U{constructor(){super(...arguments),this.beanName=`groupStage`,this.step=`group`,this.refreshProps=[`groupAllowUnbalanced`,`groupDefaultExpanded`,`groupDisplayType`,`groupHideOpenParents`,`initialGroupOrderComparator`,`treeData`,`treeDataChildrenField`,`treeDataParentIdField`],this.treeData=!1,this.hasTreeData=!1,this.needReset=!1,this.nested=!1,this.strategy=void 0}postConstruct(){let e=this.gos;e.isModuleRegistered(`TreeData`)&&(this.hasTreeData=!0,this.treeData=!!e.get(`treeData`))}destroy(){this.strategy=this.destroyBean(this.strategy),super.destroy()}getNode(e){return this.strategy?.getNode(e)}getNestedDataGetter(){return this.getStrategy()?.nestedDataGetter}onPropChange(e){let t=this.gos,n=this.strategy?.nestedDataGetter;if(e.has(`treeData`)){let e=!!t.get(`treeData`)&&this.hasTreeData;this.treeData!==e&&(this.treeData=e,this.needReset=!0,this.strategy=this.destroyBean(this.strategy))}return this.strategy?.onPropChange?.(e),this.getNestedDataGetter()!==n}extractData(){let e=this.beans.rowModel.rootNode,t=this.nested?e?.childrenAfterGroup:e?._leafs;if(!t)return this.gos.get(`rowData`)??[];let n=t.length,r=Array(n),i=0;for(let e=0;e<n;++e){let n=t[e].data;n!=null&&(r[i++]=n)}return r.length=i,r}execute(e){let t=this.getStrategy(),n=!!t?.nestedDataGetter,r=this.needReset;return this.nested=n,r&&(this.needReset=!1,resetGrouping(e.rowNode,!n)),t?t.execute(e)||r:void 0}loadLeafs(e){return e.footer?loadFooterLeafs(e):loadRealLeafs(e)}getStrategy(){let e=this.strategy;return e!==void 0&&this.isAlive()?e:(e=this.beans.registry.createDynamicBean(this.treeData?`treeGroupStrategy`:`groupStrategy`,!1)??null,this.strategy=e&&this.createBean(e),e)}},loadFooterLeafs=e=>{let t=e.sibling;if(!t)return null;let n=t._leafs;return n===void 0?loadRealLeafs(t):n},loadRealLeafs=e=>{let t=e.childrenAfterGroup,n=t?.length;if(e._leafs=null,!n)return null;let r,i=n===1?t[0]:null;if(i?.group&&i.sourceRowIndex<0)r=i._leafs,r===void 0&&(r=loadRealLeafs(i));else if(e.leafGroup)r=t;else{r=[];for(let e=0;e<n;++e){let n=t[e];if(n.sourceRowIndex>=0&&r.push(n),!n.group)continue;let i=n._leafs;if(i===void 0&&(i=loadRealLeafs(n)),i)for(let e=0,t=i.length;e<t;++e)r.push(i[e])}}return e._leafs=r,r},resetGrouping=(e,t)=>{let n=e._leafs,r=e.sibling;e.treeNodeFlags=0,e.childrenAfterGroup=n,e.childrenMapped=null,e.groupData=null,r&&(r.childrenAfterGroup=e.childrenAfterGroup,r.childrenAfterAggFilter=e.childrenAfterAggFilter,r.childrenAfterFilter=e.childrenAfterFilter,r.childrenAfterSort=e.childrenAfterSort,r.childrenMapped=null);for(let r=0,i=n.length??0;r<i;++r){let i=n[r],o=i.sibling;i._leafs=void 0,resetChildRowGrouping(i),o&&resetChildRowGrouping(o),i.parent=e,t&&(i.treeParent=null),i.group=!1,i.updateHasChildren()}e.updateHasChildren()},resetChildRowGrouping=e=>{e.key=null,e.treeNodeFlags=0,e.allChildrenCount=null,e.childrenAfterGroup=null,e.childrenAfterAggFilter=null,e.childrenAfterFilter=null,e.childrenAfterSort=null,e.childrenMapped=null,e.level=0,e.groupData&&=null};function _isHiddenParent(e,t,n){let r=e,i=r.level-t.level;if(i<=0||!n.get(`groupHideOpenParents`))return!1;for(let e=0;e<i;e++){if(r.parent?.getFirstChild()!==r)return!1;r=r.parent}return r===t}var _getRowDefaultExpanded=(e,t,n,r=t.group)=>{let i=e.gos,o=r&&i.get(`isGroupOpenByDefault`);if(!o){let e=i.get(`groupDefaultExpanded`);return e===-1||n<e}return o({api:e.gridApi,context:e.gridOptions.context,rowNode:t,field:t.field,key:t.key,level:n,rowGroupColumn:t.rowGroupColumn})==1},GroupCellRendererCtrl=class extends U{constructor(){super(...arguments),this.indentClass=null}init(e,t,n,r,i,o,s){this.params=s,this.eGui=t,this.eCheckbox=n,this.eExpanded=r,this.eContracted=i,this.comp=e,this.compClass=o;let{node:c,column:p}=s;
5if(this.node=c,this.displayedNode=c,!this.isEmbeddedRowMismatch()){if(c.footer){this.initFooterCell();return}if(!p){this.initFullWidthCell();return}this.displayedNode=this.beans.showRowGroupColValueSvc?.getDisplayedNode(c,p)??this.node,this.setupExpand(),this.setupCheckbox(),this.addGroupValue(),this.setupIndent()}}initFooterCell(){let{node:e}=this.params;this.addGroupValue(),this.setupIndent(),e.level!==-1&&this.comp.toggleCss(`ag-row-group-leaf-indent`,!0)}initFullWidthCell(){let setupDragger=()=>{let{rowDragSvc:e}=this.beans;if(!this.params.rowDrag||!e)return;let t=e.createRowDragComp(()=>this.params.value,this.params.node);this.createManagedBean(t),this.eGui.insertAdjacentElement(`afterbegin`,t.getGui())};this.setupExpand(),setupDragger(),this.setupCheckbox(),this.addGroupValue(),this.setupIndent()}getCellAriaRole(){let e=this.params.colDef?.cellAriaRole,t=this.params.column?.getColDef().cellAriaRole;return e||t||`gridcell`}isEmbeddedRowMismatch(){if(!this.params.fullWidth||!this.gos.get(`embedFullWidthRows`))return!1;let{visibleCols:e}=this.beans,t=this.params.pinned===`left`,n=this.params.pinned===`right`,r=!t&&!n;return this.gos.get(`enableRtl`)?e.isPinningLeft()?!n:!r:e.isPinningLeft()?!t:!r}addGroupValue(){let{params:{value:e,valueFormatted:t}}=this,n=this.getInnerCompDetails();this.comp.setInnerRenderer(n,t??e??null)}setupExpand(){let{colModel:e}=this.beans,{eGridCell:t,column:n,suppressDoubleClickExpand:r}=this.params,addIconToDom=(e,t)=>{let n=J(e,this.beans,null);n&&(t.appendChild(n),this.addDestroyFunc(()=>n.remove()))};addIconToDom(`groupExpanded`,this.eExpanded),addIconToDom(`groupContracted`,this.eContracted);let i=this.comp,onExpandedChanged=()=>{if(!this.isExpandable())return;let e=this.displayedNode.expanded;i.setExpandedDisplayed(e),i.setContractedDisplayed(!e),to(t,!!this.displayedNode.expanded)},onExpandableChanged=()=>{let n=this.isExpandable();i.toggleCss(`ag-cell-expandable`,n),i.toggleCss(`ag-row-group`,n);let r=!n&&e.isPivotMode();i.toggleCss(`ag-pivot-leaf-group`,r);let o=!e.isPivotMode()&&(!this.displayedNode.footer||this.displayedNode.level!==-1);i.toggleCss(`ag-row-group-leaf-indent`,!n&&o);let s=this.getChildCount(),c=s>0?`(${s})`:``;i.setChildCount(c),n?onExpandedChanged():(i.setExpandedDisplayed(!1),i.setContractedDisplayed(!1),Xl(t))},setupListeners=()=>{!(n?.isCellEditable(this.displayedNode)&&this.gos.get(`enableGroupEdit`))&&!r&&this.addManagedListeners(t,{dblclick:this.onCellDblClicked.bind(this)}),this.addManagedListeners(this.eExpanded,{click:this.onExpandClicked.bind(this)}),this.addManagedListeners(this.eContracted,{click:this.onExpandClicked.bind(this)}),this.addManagedListeners(t,{keydown:this.onKeyDown.bind(this)}),this.addManagedListeners(this.displayedNode,{allChildrenCountChanged:onExpandableChanged,masterChanged:onExpandableChanged,groupChanged:onExpandableChanged,hasChildrenChanged:onExpandableChanged,expandedChanged:onExpandedChanged})};setupListeners(),onExpandableChanged()}getInnerCompDetails(){let{userCompFactory:e,findSvc:t}=this.beans,n=this.params;if(n.fullWidth){let r=this.gos.get(`groupRowRendererParams`);return Ol(e,r,n)||(t?.isMatch(n.node,null)?Ol(e,{...r,innerRenderer:`agFindCellRenderer`},n):void 0)}let isGroupRowRenderer=e=>e&&e.componentClass==this.compClass,r=Ol(e,n,n);if(r&&!isGroupRowRenderer(r))return r;let{displayedNode:{rowGroupColumn:i}}=this,o=i?.colDef,s=i&&n.column?.isRowGroupDisplayed(i.getId());if(o&&s){let t=su(e,o,n);if(t){if(isGroupRowRenderer(t)){if(o?.cellRendererParams?.innerRenderer)return Ol(e,o.cellRendererParams,n)}else return t}}if(t?.isMatch(n.node,n.column))return su(e,{...o??n.colDef,cellRenderer:`agFindCellRenderer`},n)}getChildCount(){let{column:e,suppressCount:t}=this.params;if(t)return 0;let{allChildrenCount:n,rowGroupColumn:r}=this.displayedNode;return!((n??0)>0&&(!r||!e||e?.isRowGroupDisplayed(r.getId())))||this.gos.get(`showOpenedGroup`)&&this.displayedNode!==this.node&&!_isHiddenParent(this.node,this.displayedNode,this.gos)?0:n??0}isExpandable(){let{node:e,column:t,colDef:n}=this.params;if(!this.displayedNode.isExpandable()||e.rowPinned)return!1;if(!t)return!0;
5if(e.hasChildren()&&n){let{showRowGroup:e}=n;if(!e)return!1;if(e===!0)return!0}return e===this.displayedNode?e.rowGroupColumn&&t?.isRowGroupDisplayed(e.rowGroupColumn.getId())?!0:e.master?n?.showRowGroup===!0||n?.showRowGroup==null:!1:_isHiddenParent(this.node,this.displayedNode,this.gos)}setupIndent(){let{suppressPadding:e,node:t,colDef:n}=this.params;if(e)return;let setIndent=()=>{let e=t.uiLevel;n&&n.showRowGroup!==!0&&(e=0);let r=`ag-row-group-indent-`+e;r!==this.indentClass&&(this.indentClass&&this.comp.toggleCss(this.indentClass,!1),this.indentClass=r,this.comp.toggleCss(r,!0),this.eGui.style.setProperty(`--ag-indentation-level`,String(e)))};this.addManagedListeners(t,{uiLevelChanged:setIndent.bind(this)}),setIndent()}setupCheckbox(){let{node:e}=this.params;!e.footer&&!e.rowPinned&&!e.detail&&(this.addManagedPropertyListener(`rowSelection`,({currentValue:e,previousValue:t})=>{let n=typeof e==`object`?e:void 0,r=typeof t==`object`?t:void 0;n?.checkboxLocation!==r?.checkboxLocation&&(this.destroyCheckbox(),this.addCheckbox())}),this.addCheckbox())}addCheckbox(){let{selectionSvc:e}=this.beans;if(!e||!Uo(this.gos))return;let{node:t,column:n}=this.params,r=this.gos.get(`rowSelection`),i=xa(r);if(i===`selectionColumn`)return;if(i===`autoGroupColumn`){let e=n?.getColDef().showRowGroup!=null,r=!n&&t.group;if(!(e||r))return}let o=typeof r==`object`?ms(r):this.params.checkbox;if(typeof o!=`function`&&o!==!0)return;if(typeof n?.getColDef().showRowGroup==`string`&&!this.isExpandable()){this.comp.setCheckboxSpacing(!0);return}let s=e.createCheckboxSelectionComponent();this.cbComp=s,this.createBean(s),s.init({rowNode:t,column:n,overrides:{isVisible:o,callbackParams:this.params,removeHidden:!0}}),this.eCheckbox.appendChild(s.getGui()),this.comp.setCheckboxVisible(!0)}destroyCheckbox(){this.comp.setCheckboxSpacing(!1),this.comp.setCheckboxVisible(!1),this.cbComp?.getGui().remove(),this.cbComp=this.destroyBean(this.cbComp)}onExpandClicked(e){xl(e)||(ua(e),this.onExpandOrContract(e))}onKeyDown(e){e.key!==G.ENTER||this.params.suppressEnterExpand||this.params.column?.isCellEditable(this.params.node)||this.onExpandOrContract(e)}onCellDblClicked(e){xl(e)||ro(this.eExpanded,e)||ro(this.eContracted,e)||this.onExpandOrContract(e)}onExpandOrContract(e){if(!this.isExpandable())return;let t=this.displayedNode,n=!t.expanded;!n&&t.sticky&&this.beans.ctrlsSvc.getScrollFeature().setVerticalScrollPosition(t.rowTop-t.stickyRowTop),t.setExpanded(n,e)}destroy(){super.destroy(),this.destroyCheckbox()}},b_={tag:`span`,cls:`ag-cell-wrapper`,children:[{tag:`span`,ref:`eExpanded`,cls:`ag-group-expanded ag-hidden`},{tag:`span`,ref:`eContracted`,cls:`ag-group-contracted ag-hidden`},{tag:`span`,ref:`eCheckbox`,cls:`ag-group-checkbox ag-invisible`},{tag:`span`,ref:`eValue`,cls:`ag-group-value`},{tag:`span`,ref:`eChildCount`,cls:`ag-group-child-count`}]},GroupCellRenderer=class extends K{constructor(){super(b_),this.eExpanded=null,this.eContracted=null,this.eCheckbox=null,this.eValue=null,this.eChildCount=null}init(e){let t={setInnerRenderer:(e,t)=>this.setRenderDetails(e,t),setChildCount:e=>this.eChildCount.textContent=e,toggleCss:(e,t)=>this.toggleCss(e,t),setContractedDisplayed:e=>W(this.eContracted,e),setExpandedDisplayed:e=>W(this.eExpanded,e),setCheckboxVisible:e=>this.eCheckbox.classList.toggle(`ag-invisible`,!e),setCheckboxSpacing:e=>this.eCheckbox.classList.toggle(`ag-group-checkbox-spacing`,e)},n=this.createManagedBean(new GroupCellRendererCtrl),r=!e.colDef,i=this.getGui();n.init(t,i,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,e),r&&cs(i,n.getCellAriaRole())}setRenderDetails(e,t){e?e.newAgStackInstance().then(e=>{if(!e)return;let destroyComp=()=>this.destroyBean(e);this.isAlive()?(this.eValue.appendChild(e.getGui()),this.addDestroyFunc(destroyComp)):destroyComp()}):this.eValue.innerText=t}destroy(){this.destroyBean(this.innerCellRenderer),super.destroy()}refresh(){return!1}},x_=`.ag-group-checkbox-spacing{width:var(--ag-icon-size)}:where(.ag-ltr) .ag-group-checkbox-spacing{margin-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-group-checkbox-spacing{margin-left:var(--ag-cell-widget-spacing)}`,ShowRowGroupColValueService=class extends U{constructor(){super(...arguments),this.beanName=`showRowGroupColValueSvc`}getGroupValue(e,t){if(!t)return e.group?{displayedNode:e,value:e.groupValue}:null;let n=this.beans.valueSvc,r=t.colDef.showRowGroup;if(!r)return null;if(e.level===-1&&e.footer)return{displayedNode:e,value:null};if(typeof r==`string`){if((this.beans.rowGroupColsSvc?.getColumnIndex(r)??-1)>e.level)return null;let i=this.getDisplayedNode(e,t,!0);if(i)return{displayedNode:i,value:n.getValue(t,i)}}let i=n.getValue(t,e);if(i==null){let r=this.getDisplayedNode(e,t);if(r)return{displayedNode:r,value:n.getValue(t,r)}}return{displayedNode:e,value:i}}formatAndPrefixGroupColValue(e,t,n=!1){let r=this.formatGroupColValue(e,t,n),{value:i,displayedNode:o}=e,s=this.beans.footerSvc;return s?.doesCellShowTotalPrefix(o,t)?s.applyTotalPrefix(i,r,o,t):o.footer&&o.level===-1?null:r}formatGroupColValue(e,t,n=!1){let r=this.beans.valueSvc,{displayedNode:i,value:o}=e,s=i.rowGroupColumn,c=i.group&&!t;if(s&&(c||t?.isRowGroupDisplayed(s.colId))){if(n&&s.colDef.useValueFormatterForExport===!1)return null;let e=r.formatValue(s,i,o);return e==null&&i.key===``?this.getLocaleTextFunc()(`blanks`,`(Blanks)`):e}return!t||i.group||n&&t.colDef.useValueFormatterForExport===!1?null:r.formatValue(t,i,o)}getDisplayedNode(e,t,n=!1){let r=this.gos,i=r.get(`groupHideOpenParents`),o=r.get(`showOpenedGroup`)&&!n;if(!i&&!o)return;let s=t.colDef.showRowGroup;if(s===!0)return e.group?void 0:e.parent??void 0;let c=e;for(;c&&c.rowGroupColumn?.getId()!=s;){let e=c===c.parent?.getFirstChild();if(!o&&!e)return;c=c.parent}if(c!==e)return c??void 0}},ShowRowGroupColsService=class extends U{constructor(){super(...arguments),this.beanName=`showRowGroupCols`}refresh(){this.showRowGroupCols=[],this.showRowGroupColsMap={};let{colModel:e,rowGroupColsSvc:t}=this.beans;for(let n of e.getCols()){let e=n.getColDef().showRowGroup,r=typeof e==`string`;
5if(!(!r&&e!==!0)){if(this.showRowGroupCols.push(n),r)this.showRowGroupColsMap[e]=n;else if(t)for(let e of t.columns)this.showRowGroupColsMap[e.getId()]=n}}}getShowRowGroupCols(){return this.showRowGroupCols}getShowRowGroupCol(e){return this.showRowGroupColsMap[e]}getSourceColumnsForGroupColumn(e){let t=e.getColDef().showRowGroup;if(!t)return null;let{rowGroupColsSvc:n,colModel:r}=this.beans;if(t===!0&&n)return n.columns.slice(0);let i=r.getColDefCol(t);return i?[i]:null}isRowGroupDisplayed(e,t){let{colDef:n}=e;if(n?.showRowGroup==null)return!1;let r=n.showRowGroup===!0,i=n.showRowGroup===t;return r||i}},StickyRowFeature=class extends U{constructor(e,t){super(),this.createRowCon=e,this.destroyRowCtrls=t,this.stickyTopRowCtrls=[],this.stickyBottomRowCtrls=[],this.extraTopHeight=0,this.extraBottomHeight=0}postConstruct(){this.isClientSide=Rc(this.gos),this.beans.ctrlsSvc.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl}),this.resetStickyContainers()}setOffsetTop(e){this.extraTopHeight!==e&&(this.extraTopHeight=e,this.eventSvc.dispatchEvent({type:`stickyTopOffsetChanged`,offset:e}))}setOffsetBottom(e){this.extraBottomHeight!==e&&(this.extraBottomHeight=e)}resetOffsets(){this.setOffsetBottom(0),this.setOffsetTop(0)}getLastPixelOfGroup(e){return this.isClientSide?getClientSideLastPixelOfGroup(e):getServerSideLastPixelOfGroup(e)}getFirstPixelOfGroup(e){return e.footer?e.sibling.rowTop+e.sibling.rowHeight-1:e.hasChildren()?e.rowTop-1:0}updateStickyRows(e){let t=e===`top`,n=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(e,new Set,n);let{rowModel:r,rowRenderer:i,pinnedRowModel:o}=this.beans,s=t?i.firstVisibleVPixel-this.extraTopHeight:i.lastVisibleVPixel-this.extraTopHeight,c=new Set,addStickyRow=e=>{if(c.add(e),t){let t=this.getLastPixelOfGroup(e),r=s+n+e.rowHeight;e.stickyRowTop=t<r?n+(t-r):n}else{let t=this.getFirstPixelOfGroup(e),r=s-(n+e.rowHeight);e.stickyRowTop=t>r?n-(t-r):n}n=0,c.forEach(e=>{let t=e.stickyRowTop+e.rowHeight;n<t&&(n=t)})},p=this.areFooterRowsStickySuppressed(),m=this.gos.get(`suppressGroupRowsSticky`),isRowSticky=t=>{if(!t.displayed)return!1;if(t.footer){if(p===!0||p===`grand`&&t.level===-1||p===`group`&&t.level>-1)return!1;let n=t.sibling.rowIndex?t.sibling.rowIndex+1===t.rowIndex:!1;return e===`bottom`&&n||t.level===-1&&o?.getGrandTotalPinned()?!1:!c.has(t)}return t.isExpandable()?m===!0||e===`bottom`?!1:!c.has(t)&&t.expanded:!1};for(let e=0;e<100;e++){let e=s+n;t||(e=s-n);let i=r.getRowIndexAtPixel(e),o=r.getRow(i);if(o==null)break;let c=this.getStickyAncestors(o).find(e=>(t?e.rowIndex<i:e.rowIndex>i)&&isRowSticky(e));if(c){addStickyRow(c);continue}if((t?o.rowTop<e:o.rowTop+o.rowHeight>e)&&isRowSticky(o)){addStickyRow(o);continue}break}return t||c.forEach(e=>{e.stickyRowTop=n-(e.stickyRowTop+e.rowHeight)}),this.refreshNodesAndContainerHeight(e,c,n)}areFooterRowsStickySuppressed(){let e=this.gos.get(`suppressStickyTotalRow`);if(e===!0)return!0;let t=e===`group`,n=e===`grand`;return t&&n?!0:n?`grand`:t?`group`:!1}canRowsBeSticky(){let e=Qa(this.gos),t=this.areFooterRowsStickySuppressed(),n=this.gos.get(`suppressGroupRowsSticky`);return e&&(!t||!n)}getStickyAncestors(e){let t=[],n=e.footer?e.sibling:e.parent;for(;n;)n.sibling&&t.push(n.sibling),t.push(n),n=n.parent;return t.reverse()}checkStickyRows(){let e=this.updateStickyRows(`top`),t=this.updateStickyRows(`bottom`);return e||t}destroyStickyCtrls(){this.resetStickyContainers()}resetStickyContainers(){this.refreshNodesAndContainerHeight(`top`,new Set,0),this.refreshNodesAndContainerHeight(`bottom`,new Set,0)}refreshStickyNode(e){let t=new Set;if(this.stickyTopRowCtrls.some(t=>t.rowNode===e)){for(let n=0;n<this.stickyTopRowCtrls.length;n++){let r=this.stickyTopRowCtrls[n].rowNode;r!==e&&t.add(r)}this.refreshNodesAndContainerHeight(`top`,t,this.topContainerHeight)&&this.checkStickyRows();return}for(let n=0;n<this.stickyBottomRowCtrls.length;n++){let r=this.stickyBottomRowCtrls[n].rowNode;r!==e&&t.add(r)}this.refreshNodesAndContainerHeight(`bottom`,t,this.bottomContainerHeight)&&this.checkStickyRows()}refreshNodesAndContainerHeight(e,t,n){let r=e===`top`,i=r?this.stickyTopRowCtrls:this.stickyBottomRowCtrls,o={},s=[];for(let e=0;e<i.length;e++){let n=i[e].rowNode;if(!t.has(n)){o[n.id]=i[e],n.sticky=!1;continue}s.push(i[e])}let c=new Set;for(let e=0;e<s.length;e++)c.add(s[e].rowNode);let p=[];
5t.forEach(e=>{c.has(e)||(e.sticky=!0,p.push(this.createRowCon(e,!1,!1)))});let m=!!p.length||s.length!==i.length;r?this.topContainerHeight!==n&&(this.topContainerHeight=n,this.gridBodyCtrl.setStickyTopHeight(n),m=!0):this.bottomContainerHeight!==n&&(this.bottomContainerHeight=n,this.gridBodyCtrl.setStickyBottomHeight(n),m=!0),this.destroyRowCtrls(o,!1);let h=[...s,...p];h.sort((e,t)=>t.rowNode.rowIndex-e.rowNode.rowIndex),r||h.reverse();for(let e of h)e.setRowTop(e.rowNode.stickyRowTop);let g=this.beans.pageBounds,_=0;if(r){for(let e of t)e.rowIndex<g.getFirstRow()&&(_+=e.rowHeight);_>this.topContainerHeight&&(_=this.topContainerHeight),this.setOffsetTop(_)}else{for(let e of t)e.rowIndex>g.getLastRow()&&(_+=e.rowHeight);_>this.bottomContainerHeight&&(_=this.bottomContainerHeight),this.setOffsetBottom(_)}return m?(r?this.stickyTopRowCtrls=h:this.stickyBottomRowCtrls=h,!0):!1}ensureRowHeightsValid(){let e=!1,updateRowHeight=t=>{let n=t.rowNode;if(n.rowHeightEstimated){let t=ru(this.beans,n);n.setRowHeight(t.height),e=!0}};return this.stickyTopRowCtrls.forEach(updateRowHeight),this.stickyBottomRowCtrls.forEach(updateRowHeight),e}};function getServerSideLastPixelOfGroup(e){if(e.isExpandable()||e.footer){if(e.master&&e.detailNode)return e.detailNode.rowTop+e.detailNode.rowHeight;if(!e.sibling||Math.abs(e.sibling.rowIndex-e.rowIndex)===1){let t=e.childStore?.getStoreBounds();return e.footer&&(t=e.sibling.childStore?.getStoreBounds()),(t?.heightPx??0)+(t?.topPx??0)}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return 2**53-1}function getClientSideLastPixelOfGroup(e){if(e.isExpandable()||e.footer){if(e.footer&&e.rowIndex===0)return 2**53-1;if(!e.sibling||Math.abs(e.sibling.rowIndex-e.rowIndex)===1){let t=e.footer?e.sibling:e;for(;t.isExpandable()&&t.expanded;)if(t.master&&t.detailNode)t=t.detailNode;else if(t.childrenAfterSort){if(t.childrenAfterSort.length===0)break;t=Kc(t.childrenAfterSort)}return t.rowTop+t.rowHeight}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return 2**53-1}var StickyRowService=class extends U{constructor(){super(...arguments),this.beanName=`stickyRowSvc`}createStickyRowFeature(e,t,n){let r=this.gos;if(Qa(r)&&Rc(r)||lc(r))return e.createManagedBean(new StickyRowFeature(t,n))}},S_={moduleName:`GroupCellRenderer`,version:Z,userComponents:{agGroupRowRenderer:GroupCellRenderer,agGroupCellRenderer:GroupCellRenderer},dynamicBeans:{groupCellRendererCtrl:GroupCellRendererCtrl},icons:{groupContracted:`tree-closed`,groupExpanded:`tree-open`},css:[x_],dependsOn:[fh]},C_={moduleName:`GroupColumn`,version:Z,beans:[AutoColService,ShowRowGroupColsService,ShowRowGroupColValueService,RowGroupColsSvc,PivotColsSvc,ValueColsSvc],dependsOn:[fh,S_]},w_={moduleName:`ClientSideRowModelHierarchy`,version:Z,rowModels:[`clientSide`],beans:[GroupStage,FlattenStage,ClientSideExpansionService],dependsOn:[fh]},T_={moduleName:`StickyRow`,version:Z,beans:[StickyRowService]},AgGridHeaderDropZones=class extends K{constructor(){super()}postConstruct(){this.setGui(this.createNorthPanel());let e=this.onRowGroupChanged.bind(this);this.addManagedEventListeners({columnRowGroupChanged:e,newColumnsLoaded:e}),this.addManagedPropertyListener(`rowGroupPanelShow`,e),this.addManagedPropertyListener(`pivotPanelShow`,()=>this.onPivotPanelShow()),this.onRowGroupChanged()}createNorthPanel(){let e=Dl({tag:`div`,cls:`ag-column-drop-wrapper`,role:`presentation`}),t=new RowGroupDropZonePanel(!0);this.rowGroupComp=this.createManagedBean(t);let n=new PivotDropZonePanel(!0);this.pivotComp=this.createManagedBean(n),e.appendChild(t.getGui()),e.appendChild(n.getGui());let r=this.onDropPanelVisible.bind(this);return this.addManagedListeners(t,{displayChanged:r}),this.addManagedListeners(n,{displayChanged:r}),this.onDropPanelVisible(),e}onDropPanelVisible(){let{rowGroupComp:e,pivotComp:t}=this,n=e.isDisplayed()&&t.isDisplayed(),r=`ag-column-drop-horizontal-half-width`;e.toggleCss(r,n),t.toggleCss(r,n)}onRowGroupChanged(){let e=this.rowGroupComp;if(!e)return;let t=this.gos.get(`rowGroupPanelShow`);if(t===`always`)e.setDisplayed(!0);else if(t===`onlyWhenGrouping`){let t=this.beans.rowGroupColsSvc?.columns?.length!==0;e.setDisplayed(t)}else e.setDisplayed(!1)}onPivotPanelShow(){let e=this.pivotComp;if(!e)return;let t=this.gos.get(`pivotPanelShow`);if(t===`always`)e.setDisplayed(!0);else if(t===`onlyWhenPivoting`){let t=this.beans.colModel.isPivotActive();e.setDisplayed(t)}else e.setDisplayed(!1)}},E_={selector:`AG-GRID-HEADER-DROP-ZONES`,component:AgGridHeaderDropZones};function processGroupFilterParams(e){return e.buttons&&=[],e}var D_={tag:`div`,cls:`ag-group-filter`,children:[{tag:`div`,ref:`eGroupField`},{tag:`div`,ref:`eUnderlyingFilter`}]},GroupFilter=class extends gs{constructor(){super(D_),this.filterType=`group`,this.eGroupField=null,this.eUnderlyingFilter=null}wireBeans(e){this.groupFilterSvc=e.groupFilter}postConstruct(){this.initialiseTabGuard({})}init(e){return this.params=e,this.updateParams().then(()=>{this.addHandlerListeners(this.updateGroups.bind(this))})}refresh(e){let t=e;return this.params=t,t.source===`colDef`&&this.updateParams(),!0}updateParams(){return this.validateParams(),this.updateGroups()}validateParams(){let{colDef:e}=this.params;e.field&&q(234),e.filterValueGetter&&q(235),e.filterParams&&q(236)}addHandlerListeners(e){let t=this.addManagedListeners(this.getHandler(),{sourceColumnsChanged:()=>{this.updateGroups()},destroyed:()=>{for(let e of t)e();this.addHandlerListeners(e)}})}updateGroups(){let{sourceColumns:e,selectedColumn:t}=this.updateGroupField();return this.dispatchLocalEvent({type:`columnsChanged`}),this.getUnderlyingFilters(e,t)}updateGroupField(){this.groupColumn=this.params.column;let e=this.getHandler();if(!e)return{sourceColumns:null};let{sourceColumns:t,hasMultipleColumns:n,selectedColumn:r}=e,i=this.eGroupField;return Ml(i),this.eGroupFieldSelect&&this.destroyBean(this.eGroupFieldSelect),n&&t&&(this.createGroupFieldSelectElement(t,r),i.appendChild(this.eGroupFieldSelect.getGui()),i.appendChild(Dl({tag:`div`,cls:`ag-filter-separator`}))),W(i,n),{sourceColumns:t,selectedColumn:r}}createGroupFieldSelectElement(e,t){let n=this.createManagedBean(new Go);this.eGroupFieldSelect=n;let r=this.getLocaleTextFunc();
5n.setLabel(r(`groupFilterSelect`,`Select field:`)),n.setLabelAlignment(`top`),n.addOptions(e.map(e=>({value:e.getColId(),text:this.beans.colNames.getDisplayNameForColumn(e,`groupFilter`,!1)??void 0}))),n.setValue(t.getColId()),n.onValueChange(e=>this.updateSelectedColumn(e)),n.addCss(`ag-group-filter-field-select-wrapper`),e.length===1&&n.setDisabled(!0)}getUnderlyingFilters(e,t){if(!e)return this.filterColumnPairs=void 0,this.selectedFilter=void 0,eo.resolve();let n=[],r=[],i=this.beans.colFilter;for(let o of e){let e=i.getOrCreateFilterUi(o);e&&n.push(e.then(e=>{e&&r.push({filter:e,column:o}),o.getColId()===t.getColId()&&(this.selectedFilter=e??void 0)}))}return eo.all(n).then(()=>{this.filterColumnPairs=r})}addUnderlyingFilterElement(e){if(Ml(this.eUnderlyingFilter),!e)return eo.resolve();let t=this.createManagedBean(new _c(e,`COLUMN_MENU`));return this.filterComp=t,t.hasFilter()?(this.eUnderlyingFilter.appendChild(t.getGui()),t.getFilter()?.then(()=>{t.afterGuiAttached?.(this.afterGuiAttachedParams),!this.afterGuiAttachedParams?.suppressFocus&&this.eGroupFieldSelect&&!this.eGroupFieldSelect.isDisabled()&&this.eGroupFieldSelect.getFocusableElement().focus()})??eo.resolve()):eo.resolve()}updateSelectedColumn(e){if(!e)return;this.filterComp?.afterGuiDetached(),this.destroyBean(this.filterComp);let t=this.getFilterColumnPair(e),n=t?.column;this.selectedFilter=t?.filter,this.getHandler().setSelectedColumn(n),this.dispatchLocalEvent({type:`columnsChanged`}),this.addUnderlyingFilterElement(n)}isFilterActive(){return this.groupFilterSvc.isFilterActive(this.groupColumn)}doesFilterPass(){return!0}getModel(){return null}setModel(){}afterGuiAttached(e){this.afterGuiAttachedParams=e,this.addUnderlyingFilterElement(this.getHandler().selectedColumn)}afterGuiDetached(){Ml(this.eUnderlyingFilter),this.selectedFilter?.afterGuiDetached?.()}getSelectedColumn(){return this.getHandler().selectedColumn}getHandler(){return this.params.getHandler()}getFilterColumnPair(e){if(e)return this.filterColumnPairs?.find(({column:t})=>t.getColId()===e)}},GroupFilterHandler=class extends U{init(e){this.params=e,this.validateModel(e),this.updateColumns(),this.addManagedEventListeners({columnRowGroupChanged:this.updateColumns.bind(this),filterDestroyed:e=>this.onFilterDestroyed(e)})}refresh(e){this.params=e,this.validateModel(e),e.source===`colDef`&&this.updateColumns()}doesFilterPass(){return!0}setSelectedColumn(e){this.selectedColumn=e,this.dispatchLocalEvent({type:`selectedColumnChanged`})}validateModel(e){e.model!=null&&e.onModelChange(null)}getSourceColumns(){let e=this.params.column;return this.gos.get(`treeData`)?(q(237),[]):this.beans.groupFilter.getSourceColumns(e)||(q(183),[])}updateColumns(){let e=this.getSourceColumns(),t=e.filter(e=>e.isFilterAllowed());this.sourceColumns=t;let n,r;t.length?e.length===1?(n=t[0],r=!1):(n=this.selectedColumn,(!n||!t.some(e=>e.getId()===n.getId()))&&(n=t[0]),r=!0):(n=void 0,r=!1),this.selectedColumn=n,this.hasMultipleColumns=r,this.dispatchLocalEvent({type:`sourceColumnsChanged`})}onFilterDestroyed({column:e,source:t}){if(t===`gridDestroyed`)return;let n=e.getColId();this.sourceColumns?.some(e=>e.getColId()===n)&&setTimeout(()=>{this.isAlive()&&this.updateColumns()})}},GroupFilterService=class extends U{constructor(){super(...arguments),this.beanName=`groupFilter`}postConstruct(){this.addManagedEventListeners({columnRowGroupChanged:()=>this.updateFilterFlags(`columnRowGroupChanged`)})}isGroupFilter(e){return e.getColDef().filter===`agGroupColumnFilter`}isFilterAllowed(e){let t=this.beans.colFilter;return!!this.getSourceColumns(e)?.some(e=>t?.isFilterAllowed(e))}isFilterActive(e){let t=this.beans.colFilter;return!!this.getSourceColumns(e)?.some(e=>t?.isFilterActive(e))}getSourceColumns(e){return this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(e)}updateFilterFlags(e,t){let{autoColSvc:n,colFilter:r}=this.beans;n?.getColumns()?.forEach(n=>{this.isGroupFilter(n)&&r?.setColFilterActive(n,this.isFilterActive(n),e,t)})}},O_={tag:`div`,ref:`eFloatingFilter`,cls:`ag-group-floating-filter ag-floating-filter-input`,role:`presentation`},GroupFloatingFilterComp=class extends K{constructor(){super(O_),this.eFloatingFilter=null,this.haveAddedColumnListeners=!1}init(e){this.params=e;let t=hs(this.gos),n=this.onColChange.bind(this),setupFilterElement=e=>{t?this.setupUnderlyingFloatingFilterElement().then(()=>e()):(this.setupReadOnlyFloatingFilterElement(),e())};return this.gos.get(`enableFilterHandlers`)?new eo(e=>setupFilterElement(e)).then(()=>{this.addHandlerListeners(e,n)}):new eo(e=>{this.params.parentFilterInstance(t=>{this.parentFilterInstance=t,setupFilterElement(e)})}).then(()=>{this.addManagedListeners(this.parentFilterInstance,{columnsChanged:n})})}refresh(e){if(this.params=e,this.setParams(),this.gos.get(`enableFilterHandlers`)){if(this.showingUnderlyingFloatingFilter){let e=this.getSelectedColumn(),t=this.beans.colFilter.getFloatingFilterCompDetail
5s(e,this.params.showParentFilter);this.underlyingFloatingFilter?.refresh?.(t?.params)}else this.updateDisplayedValue()}}setParams(){let e=this.beans.colNames.getDisplayNameForColumn(this.params.column,`header`,!0),t=this.getLocaleTextFunc();this.eFloatingFilterText?.setInputAriaLabel(`${e} ${t(`ariaFilterInput`,`Filter Input`)}`)}addHandlerListeners(e,t){let n=this.addManagedListeners(e.getHandler(),{selectedColumnChanged:t,sourceColumnsChanged:t,destroyed:()=>{for(let e of n)e();this.addHandlerListeners(this.params,t)}})}setupReadOnlyFloatingFilterElement(){this.eFloatingFilterText||(this.eFloatingFilterText=this.createManagedBean(new bo),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,Ml(this.eFloatingFilter);let e=this.getSelectedColumn();if(e&&!e.isVisible()){let t=this.beans.colFilter,n=t.getFloatingFilterCompDetails(e,this.params.showParentFilter);if(n)return this.haveAddedColumnListeners||(this.haveAddedColumnListeners=!0,this.addManagedListeners(e,{visibleChanged:this.onColumnVisibleChanged.bind(this),colDefChanged:this.onColDefChanged.bind(this)})),n.newAgStackInstance().then(n=>{this.underlyingFloatingFilter=n,this.underlyingFloatingFilter?.onParentModelChanged(t.getModelForColumn(e)),this.appendChild(n.getGui()),this.showingUnderlyingFloatingFilter=!0})}return this.setupReadOnlyFloatingFilterElement(),eo.resolve()}getSelectedColumn(){return this.gos.get(`enableFilterHandlers`)?this.params.getHandler().selectedColumn:this.parentFilterInstance.getSelectedColumn()}onColumnVisibleChanged(){this.setupUnderlyingFloatingFilterElement()}onColDefChanged(e){if(!e.column)return;let t=this.beans.colFilter.getFloatingFilterCompDetails(e.column,this.params.showParentFilter);t&&this.underlyingFloatingFilter?.refresh?.(t.params)}onParentModelChanged(e,t){this.showingUnderlyingFloatingFilter?this.underlyingFloatingFilter?.onParentModelChanged(this.beans.colFilter.getModelForColumn(this.getSelectedColumn()),t):this.updateDisplayedValue()}updateDisplayedValue(){let e=this.eFloatingFilterText;if(!e)return;let t=this.beans.colFilter,n=this.getSelectedColumn(),updateText=r=>{if(!r)e.setValue(``),e.setDisplayed(!1);else{let i=n?t.getModelForColumn(n):null;e.setValue(i==null?``:r.getModelAsString?.(i)??``),e.setDisplayed(!0)}};this.gos.get(`enableFilterHandlers`)?updateText(t.getHandler(n)):t.getOrCreateFilterUi(n)?.then(e=>{updateText(e)})}onColChange(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}},makeGroupColumns=e=>{if(!e)return[];let t=e.length,n=Array(t);for(let r=0;r<t;r++){let t=e[r],i=t.getColDef();n[r]={col:t,field:i.field,type:i.type,keyCreator:i.keyCreator,valueGetter:i.valueGetter}}return n},groupColumnsChanged=(e,t)=>{let n=e.length;if(n!==t?.length)return!0;for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n.col!==i)return!0;let o=i.getColDef();if(n.field!==o.field||n.type!==o.type||n.valueGetter!==o.valueGetter||n.keyCreator!==o.keyCreator)return!0}return!1};function sortGroupChildren(e){if(!e)return!1;let t=e.length;if(t<2)return!1;let n=!1;for(let r=1;r<t;r++)if(compareGroupChildren(e[r-1],e[r])>0){n=!0;break}return n?(e.sort(compareGroupChildren),!0):!1}function compareGroupChildren(e,t){let n=e.sourceRowIndex,r=t.sourceRowIndex,i=n>=0,o=r>=0;return i&&o?n-r:!i&&!o?e.__objectId-t.__objectId:i?1:-1}var GroupStrategy=class extends U{constructor(){super(...arguments),this.prevGroupCols=null,this.prevShowGroupCols=null}getNode(e){let t;return this.beans.rowModel.forEachNode(n=>{n.id===e&&(t=n)}),t}execute(e){let t=this.createGroupingDetails(e),n=e.changedRowNodes;n?this.handleDeltaUpdate(t,n):this.shotgunResetEverything(t,!!e.afterColumnsChanged);let r=e.changedPath;this.positionLeafsAndGroups(r),this.orderGroups(t),this.beans.selectionSvc?.updateSelectableAfterGrouping(r)}positionLeafsAndGroups(e){e.forEachChangedNodeDepthFirst(e=>{let t=e.childrenAfterGroup,n=t?.length;if(!n)return;let r=Array(n),i=0,o=!1,s;for(let e=0;e<n;++e){let c=t[e];if(!c.childrenAfterGroup?.length)o||=i!==e,r[i++]=c;else if(!s&&c.key===``){s=c;let t=n-1;o||=e!==t,r[t]=c}}if(o){for(let e=0;e<n;++e){let n=t[e];n.childrenAfterGroup?.length&&n!==s&&(r[i++]=n)}e.childrenAfterGroup=r;let o=e.sibling;o&&(o.childrenAfterGroup=r)}},!1)}createGroupingDetails(e){let{rowNode:t,changedPath:n}=e,r=!1,{rowGroupColsSvc:i,colModel:o,gos:s}=this.beans,c=i?.columns,p=this.prevGroupCols;return(!p||groupColumnsChanged(p,c))&&(r=!!p,this.prevGroupCols=p=makeGroupColumns(c)),{groupCols:p,rootNode:t,pivotMode:o.isPivotMode(),groupColsChanged:r,changedPath:n,groupAllowUnbalanced:s.get(`groupAllowUnbalanced`),isGroupOpenByDefault:s.getCallback(`isGroupOpenByDefault`),initialGroupOrderComparator:s.getCallback(`initialGroupOrderComparator`)}}handleDeltaUpdate(e,{removals:t,updates:n,adds:r,reordered:i}){let o=new Set,s=e.changedPath;s.active||(s=null);for(let e of t){let t=e.parent;this.removeFromParent(e),o.add(t),s?.addParentNode(t)}for(let t of n){let n=t.parent;s?.addParentNode(n),this.moveNodeInWrongPath(t,e)&&(o.add(n),s?.addParentNode(t.parent))}for(let t of r)this.insertOneNode(t,e),s?.addParentNode(t.parent);o.size&&(batchedRemove(o,t),this.removeEmptyGroups(o,t)),i&&this.sortChildren(e)}sortChildren(e){e.changedPath.forEachChangedNodeDepthFirst(t=>{sortGroupChildren(t.childrenAfterGroup)&&e.changedPath.addParentNode(t)},!1,!0)}orderGroups(e){let t=e.initialGroupOrderComparator;if(!t)return;let n=this.beans,r=n.gridApi,i=n.gridOptions.context,comparer=(e,n)=>t({api:r,context:i,nodeA:e,nodeB:n}),recursiveSort=e=>{let t=e.childrenAfterGroup,n=t?.length;if(!(!n||e.leafGroup)){n>1&&t.sort(comparer);for(let e=0,r=n;e<r;++e)recursiveSort(t[e])}};recursiveSort(e.rootNode)}getExistingPathForNode(e){let t=[],n=e.parent;for(;n;){let e=n.parent;e&&t.push(n.key),n=e}return t.reverse(),t}moveNodeInWrongPath(e,t){let n=this.getExistingPathForNode(e),r=this.getGroupInfo(e,t).map(e=>e.key);return!pa(n,r)&&(this.removeFromParent(e),this.insertOneNode(e,t),e.setData(e.data),!0)}groupShouldBeRemoved(e){let t=this.getChildrenMappedKey(e.key,e.rowGroupColumn),n=e.parent?.childrenMapped;return!n||!n[t]?!1:!!e.group&&(e.childrenAfterGroup?.length??0)===0}removeEmptyGroups(e,t){let n=this.beans.selectionSvc,r,i=Array.from(e);do{e.clear();for(let o=0;o<i.length;++o){let s=i[o];for(;s;){let c=s.parent;if(t.has(s)){i[o]=c,s=c;continue}if(!c)break;if(!this.groupShouldBeRemoved(s)){s=c;continue}e.add(c),t.add(s),this.removeFromParent(s),n&&s.isSelected()&&(r??=[],r.push(s)),i[o]=c,s=c}}batchedRemove(e,t)}while(e.size);r&&n.setNodesSelected({nodes:r,newValue:!1,source:`rowGroupChanged`})}removeFromParent(e){let t=e.parent;if(t){let n=this.getChildrenMappedKey(e.key,e.rowGroupColumn),r=t.childrenMapped;r&&delete r[n]}e.setRowTop(null),e.setRowIndex(null)}addToParent(e,t){let n=t.childrenMapped??={},r=this.getChildrenMappedKey(e.key,e.rowGroupColumn);if(n[r]!==e){n[r]=e;let i=t.childrenAfterGroup;if(!i){t.childrenAfterGroup=i=[];let e=t.sibling;e&&(e.childrenAfterGroup=t.childrenAfterGroup)}i.push(e),setRowNodeGroup(t,this.beans,!0),invalidateAllLeafChildren(t)}}checkAllGroupDataAfterColsChanged(e){let recurse=e=>{if(e)for(let t=0,n=e.length;t<n;++t){let n=e[t];if(!n.group)continue;let r={field:n.field,key:n.key,rowGroupColumn:n.rowGroupColumn,leafNode:ql
5(n.childrenAfterGroup)};this.setGroupData(n,r),recurse(n.childrenAfterGroup)}};recurse(e.rootNode.childrenAfterGroup)}shotgunResetEverything(e,t){if(this.noChangeInGroupingColumns(e,t))return;this.beans.selectionSvc?.filterFromSelection?.(e=>!e.group);let n=e.rootNode;n.leafGroup=e.groupCols.length===0,n.childrenAfterGroup=[],n.childrenMapped={},n.updateHasChildren();let r=n.sibling;r&&(r.childrenAfterGroup=n.childrenAfterGroup,r.childrenMapped=n.childrenMapped);let i=n._leafs;for(let t=0,n=i.length;t<n;++t)this.insertOneNode(i[t],e)}noChangeInGroupingColumns(e,t){let n=!1,r=this.prevShowGroupCols,i=this.beans.showRowGroupCols.getShowRowGroupCols();return(!r||groupColumnsChanged(r,i))&&(n=!!r,this.prevShowGroupCols=makeGroupColumns(i)),!t||e.groupColsChanged?!1:(n&&this.checkAllGroupDataAfterColsChanged(e),!0)}insertOneNode(e,t){let n=this.getGroupInfo(e,t),r=t.rootNode;for(let e=0,i=n.length;e<i;++e)r=this.getOrCreateNextNode(r,n[e],e,t);r.group||q(184,{parentGroupData:r.data,childNodeData:e.data}),e.parent=r,e.level=n.length,r.childrenAfterGroup.push(e),r.updateHasChildren(),invalidateAllLeafChildren(r)}getOrCreateNextNode(e,t,n,r){let i=this.getChildrenMappedKey(t.key,t.rowGroupColumn),o=e?.childrenMapped?.[i];return o||(o=this.createGroup(t,e,n,r),this.addToParent(o,e)),o}createGroup(e,t,n,r){let i=new zc(this.beans);return i.group=!0,i.field=e.field,i.rowGroupColumn=e.rowGroupColumn,this.setGroupData(i,e),i.key=e.key,i.id=this.createGroupId(i,t),i.level=n,i.leafGroup=n===r.groupCols.length-1,i.setAllChildrenCount(0),i.rowGroupIndex=n,i.childrenAfterGroup=[],i.childrenMapped={},i.updateHasChildren(),i.parent=t,this.setExpandedInitialValue(r,i),i}createGroupId(e,t){let n=``,r=e.rowGroupColumn;for(;t&&r;){let i=e.key;n=`-`+r.getColId()+`-`+i+n,e=t,r=e.rowGroupColumn,t=e.parent}return`row-group`+(n||`-null`)}setGroupData(e,t){let n=t.rowGroupColumn,{valueSvc:r,showRowGroupCols:i}=this.beans;n&&t.leafNode&&(e.groupValue=r.getValue(n,t.leafNode)),e.groupData={};let o=i.getShowRowGroupCols();for(let n of o){let i=e.rowGroupColumn;i!==null&&n.isRowGroupDisplayed(i.getId())&&(e.groupData[n.getColId()]=r.getValue(i,t.leafNode))}}getChildrenMappedKey(e,t){return t?t.getId()+`-`+e:e}setExpandedInitialValue(e,t){if(e.pivotMode&&t.leafGroup){t.expanded=!1;return}t.expanded=_getRowDefaultExpanded(this.beans,t,t.level)}getGroupInfo(e,t){let n=[],r=this.beans.valueSvc;for(let{col:i,field:o}of t.groupCols){let s=r.getKeyForNode(i,e),c=s!=null&&s!==``;if((t.pivotMode||!t.groupAllowUnbalanced)&&!c&&(s=``,c=!0),c){let t={key:s,field:o,rowGroupColumn:i,leafNode:e};n.push(t)}}return n}},batchedRemove=(e,t)=>{for(let n of e){let e=n?.childrenAfterGroup;if(!e)continue;let r=e.length,i=0;for(let o=0;o<r;++o){let r=e[o];r.parent===n&&!t.has(r)&&(i!==o&&(e[i]=r),++i)}r!==i&&(e.length=i,n.updateHasChildren(),invalidateAllLeafChildren(n))}},invalidateAllLeafChildren=e=>{for(;e._leafs!==void 0;){let t=e.parent;if(!t)break;e._leafs=void 0,e=t}};function setRowGroupColumns(e,t){e.rowGroupColsSvc?.setColumns(t,`api`)}function removeRowGroupColumns(e,t){e.rowGroupColsSvc?.removeColumns(t,`api`)}function addRowGroupColumns(e,t){e.rowGroupColsSvc?.addColumns(t,`api`)}function moveRowGroupColumn(e,t,n){e.rowGroupColsSvc?.moveColumn?.(t,n,`api`)}function getRowGroupColumns(e){return e.rowGroupColsSvc?.columns??[]}var k_={moduleName:`SharedRowGrouping`,version:Z,apiFunctions:{setRowGroupColumns,removeRowGroupColumns,addRowGroupColumns,getRowGroupColumns,moveRowGroupColumn},dependsOn:[fh,g_,C_,T_,y_]},A_={moduleName:`RowGrouping`,version:Z,dynamicBeans:{groupStrategy:GroupStrategy},rowModels:[`clientSide`],dependsOn:[k_,__,w_]},j_={moduleName:`RowGroupingPanel`,version:Z,selectors:[E_],icons:{pivotPanel:`pivot`,rowGroupPanel:`group`,panelDelimiter:`small-right`,panelDelimiterRtl:`small-left`},dependsOn:[fh,Ra]},M_={moduleName:`GroupFilter`,version:Z,userComponents:{agGroupColumnFilter:{classImp:GroupFilter,processParams:processGroupFilterParams},agGroupColumnFloatingFilter:GroupFloatingFilterComp},beans:[GroupFilterService],dynamicBeans:{agGroupColumnFilterHandler:GroupFilterHandler},dependsOn:[fh,la]},ViewportRowModel=class extends U{constructor(){super(...arguments),this.beanName=`rowModel`,this.firstRow=-1,this.lastRow=-1,this.rowCount=-1,this.rowNodesByIndex={},this.rootNode=null,this.viewportChangedContext=!1}ensureRowHeightsValid(e,t,n,r){return!1}postConstruct(){let e=this.beans,t=new zc(e);this.rootNode=t,t.level=-1,this.rowHeight=Ul(e),this.addManagedEventListeners({viewportChanged:this.onViewportChanged.bind(this)}),this.addManagedPropertyListener(`viewportDatasource`,()=>this.updateDatasource()),this.addManagedPropertyListener(`rowHeight`,()=>{this.rowHeight=Ul(e),this.updateRowHeights()})}start(){this.updateDatasource()}isLastRowIndexKnown(){return!0}destroy(){this.destroyDatasource(),super.destroy(),this.rootNode=null}destroyDatasource(){let e=this.datasource;e&&(e.destroy?.(),this.beans.rowRenderer.datasourceChanged(),this.firstRow=-1,this.lastRow=-1)}updateDatasource(){let e=this.gos.get(`viewportDatasource`);e&&this.setViewportDatasource(e)}getPageSize(){return this.gos.get(`viewportRowModelPageSize`)}getBufferSize(){return this.gos.get(`viewportRowModelBufferSize`)}calculateFirstRow(e){let t=this.getBufferSize(),n=this.getPageSize(),r=e-t;return r<0?0:Math.floor(r/n)*n}calculateLastRow(e){if(e===-1)return e;let t=this.getBufferSize(),n=this.getPageSize(),r=e+t,i=Math.ceil(r/n)*n,o=this.rowCount-1;return Math.min(i,o)}onViewportChanged(e){let t=this.calculateFirstRow(e.firstRow),n=this.calculateLastRow(e.lastRow);(this.firstRow!==t||this.lastRow!==n)&&(this.firstRow=t,this.lastRow=n,this.purgeRowsNotInViewport(),this.viewportChangedContext=!0,this.datasource?.setViewportRange(this.firstRow,this.lastRow),this.viewportChangedContext=!1)}purgeRowsNotInViewport(){let e=this.rowNodesByIndex;for(let t of Object.keys(e)){let n=parseInt(t,10);if(n<this.firstRow||n>this.lastRow){if(this.isRowFocused(n)||this.beans.editSvc?.isRowEditing(e[n]))continue;delete e[n]}}}isRowFocused(e){let t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();return!t||t.rowPinned!=null?!1:t.rowIndex===e}setViewportDatasource(e){this.destroyDatasource(),this.datasource=e,this.rowCount=-1,e.init?e.init({setRowCount:this.setRowCount.bind(this),setRowData:this.setRowData.bind(this),getRow:this.getRow.bind(this)}):q(226)}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(n=>{n.id===e&&(t=n)}),t}getRowCount(){return this.rowCount===-1?0:this.rowCount}getRowIndexAtPixel(e){return this.rowHeight===0?0:Math.floor(e/this.rowHeight)}resetRowHeights(){}onRowHeightChanged(){}getRowBounds(e){let t=this.rowHeight;return{rowHeight:t,rowTop:t*e}}updateRowHeights(){let e=this.rowHeight;this.forEachNode(t=>{t.setRowHeight(e),t.setRowTop(e*t.rowIndex)}),this.eventSvc.dispatchEvent({type:`modelUpdated`,newData:!1,newPage:!1,keepRenderedRows:!0,animate:!1})}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}isEmpty(){return this.rowCount>0}isRowsToRender(){return this.rowCount>0}getNodesInRangeForSelection(e,t){let n=e.rowIndex,r=t.rowIndex,i=n<this.firstRow||n>this.lastRow,o=r<this.firstRow||r>this.lastRow;if(i||o)return[];let s=[],c=n<=r?n:r,p=n<=r?r:n;for(let e=c;e<=p;e++)s.push(this.rowNodesByIndex[e]);return s}forEachNode(e){let t=0;for(let n of Object.keys(this.rowNodesByIndex)){let r=parseInt(n,10),i=this.rowNodesByIndex[r];e(i,t),t++}}setRowData(e){let t=Zs(this.beans.gos),n=new Map;if(t)for(let e of Object.values(this.rowNodesByIndex))n.set(e.id,e);for(let r=this.firstRow;r<=this.lastRow;r++){let i=e[r];if(!i)continue;let o,s;t?(o=t({data:i,rowPinned:void 0,level:0,parentKeys:void 0}),s=n.get(o)):s=this.rowNodesByIndex[r],s?(s.updateData(i),s.setRowIndex(r),s.setRowTop(this.rowHeight*r)):(s=this.createBlankRowNode(r),s.setDataAndId(i,o??r.toString())),this.rowNodesByIndex[r]=s}this.viewportChangedContext||this.eventSvc.dispatchEvent({type:`modelUpdated`,newData:!1,newPage:!1,keepRenderedRows:!0,animate:!1})}createBlankRowNode(e){let t=new zc(this.beans),n=this.rowHeight;return t.setRowHeight(n),t.setRowTop(n*e),t.setRowIndex(e),t}setRowCount(e,t=!1){if(e===this.rowCount)return;this.rowCount=e;let n=this.eventSvc;n.dispatchEventOnce({type:`rowCountReady`}),n.dispatchEvent({type:`modelUpdated`,newData:!1,newPage:!1,keepRenderedRows:t,animate:!1})}isRowPresent(e){return!!this.getRowNode(e.id)}},N_={moduleName:`ViewportRowModel`,version:Z,rowModels:[`viewport`],beans:[ViewportRowModel],dependsOn:[fh]};function copyToClipboard(e,t){e.clipboardSvc?.copyToClipboard(t)}function cutToClipboard(e,t){e.clipboardSvc?.cutToClipboard(t)}function copySelectedRowsToClipboard(e,t){e.clipboardSvc?.copySelectedRowsToClipboard(t)}function copySelectedRangeToClipboard(e,t){e.clipboardSvc?.copySelectedRangeToClipboard(t)}function copySelectedRangeDown(e){e.clipboardSvc?.copyRangeDown()}function pasteFromClipboard(e){e.clipboardSvc?.pasteFromClipboard()}var P_=`paste`,F_=`dragCopy`,I_=`clipboard`;function stringToArray(e,t=`,`){let n=[],isNewline=e=>e===`\r`||e===`
6`,r=!1;if(e===``)return[[``]];for(let i=0,o=0,s=0;s<e.length;s++){let c=e[s-1],p=e[s],m=e[s+1],ensureDataExists=()=>{n[i]||(n[i]=[]),n[i][o]||(n[i][o]=``)};if(ensureDataExists(),p===`"`&&(r?m===`"`?(n[i][o]+=`"`,s++):r=!1:(c===void 0||c===t||isNewline(c))&&(r=!0)),!r&&p!==`"`){if(p===t){o++,ensureDataExists();continue}if(isNewline(p)){o=0,i++,ensureDataExists(),p===`\r`&&m===`
7`&&s++;continue}}n[i][o]+=p}return n}var ClipboardService=class extends U{constructor(){super(...arguments),this.beanName=`clipboardSvc`,this.clientSideRowModel=null,this.gridCtrl=null,this.lastPasteOperationTime=0,this.navigatorApiFailed=!1}postConstruct(){let{gos:e,rowModel:t,ctrlsSvc:n}=this.beans;Rc(e,t)&&(this.clientSideRowModel=t),n.whenReady(this,e=>{this.gridCtrl=e.gridCtrl})}destroy(){super.destroy(),this.clientSideRowModel=null,this.gridCtrl=null}pasteFromClipboard(){!this.gos.get(`suppressClipboardApi`)&&!this.navigatorApiFailed&&navigator.clipboard?.readText?navigator.clipboard.readText().then(this.processClipboardData.bind(this)).catch(e=>{q(40,{e,method:`readText`}),this.navigatorApiFailed=!0,this.pasteFromClipboardLegacy()}):this.pasteFromClipboardLegacy()}pasteFromClipboardLegacy(){let e=!1,handlePasteEvent=t=>{let n=Date.now();n-this.lastPasteOperationTime<50&&(e=!0,t.preventDefault()),this.lastPasteOperationTime=n};this.executeOnTempElement(e=>{e.addEventListener(`paste`,handlePasteEvent),e.focus({preventScroll:!0})},t=>{let n=t.value;e?this.refocusLastFocusedCell():this.processClipboardData(n),t.removeEventListener(`paste`,handlePasteEvent)})}refocusLastFocusedCell(){let{focusSvc:e}=this.beans,t=e.getFocusedCell();t&&e.setFocusedCell({rowIndex:t.rowIndex,column:t.column,rowPinned:t.rowPinned,forceBrowserFocus:!0})}getClipboardDelimiter(){let e=this.gos.get(`clipboardDelimiter`);return Xs(e)?e:`	`}processClipboardData(e){if(e==null)return;let t=stringToArray(e,this.getClipboardDelimiter()),n=this.gos.getCallback(`processDataFromClipboard`);if(n&&(t=n({data:t})),t==null)return;this.gos.get(`suppressLastEmptyLineOnPaste`)&&this.removeLastLineIfBlank(t);let{rangeSvc:r,editSvc:i}=this.beans,pasteOperation=(e,n,o,s)=>{r?.isMoreThanOneCell()&&!this.hasOnlyOneValueToPaste(t)?this.pasteIntoActiveRange(t,e,n,s):this.pasteStartingFromFocusedCell(t,e,n,o,s),i?.stopEditing(void 0,{source:P_})};this.doPasteOperation(pasteOperation)}doPasteOperation(e){let t=`clipboard`,{eventSvc:n,focusSvc:r,rowRenderer:i,gos:o}=this.beans;n.dispatchEvent({type:`pasteStart`,source:t});let{clientSideRowModel:s}=this,c=s?.rootNode,p=c&&new js(o.get(`aggregateOnlyChangedColumns`),c),m={},h=[];
7e(m,h,r.getFocusedCell(),p);let g=[...h];p&&(s.doAggregate(p),p.forEachChangedNodeDepthFirst(e=>{g.push(e)})),i.refreshCells({rowNodes:g}),this.dispatchFlashCells(m),this.fireRowChanged(h),this.refocusLastFocusedCell(),n.dispatchEvent({type:`pasteEnd`,source:t})}getPreProcessRangeCallback(e){return t=>{let{rangeSvc:n}=this.beans;if(!n)return;let{rowDiff:r,colDiff:i}=this.getAdjustedRangeDimensionForPaste(t,e);r!==0&&n.extendRangeRowCountBy(t,r),i!==0&&n.extendRangeColumnCountBy(t,i)}}getAdjustedRangeDimensionForPaste(e,t){let n=this.beans.rangeSvc,r=t.length,i=n.getRangeRowCount(e),o=i>=r&&i%r===0,s=t[0].length,c=e.columns.length,p=c>=s&&c%s===0;return{rowDiff:o?0:r-i,colDiff:p?0:s-c}}pasteIntoActiveRange(e,t,n,r){let i=0,o=0,rowCallback=(s,c,p,m)=>{if(m-i>=e.length){if(m%e.length!==0)return;i+=o,o=0}let h=e[m-i];n.push(c);let g=this.gos.getCallback(`processCellFromClipboard`),_=p.columns,v=_.findIndex(Xc);v!==-1&&_.splice(v,1);for(let e=0;e<_.length;e++){let n=_[e];if(!n.isCellEditable(c)||n.isSuppressPaste(c))continue;let i=e;e>=h.length&&(i=e%h.length);let o=this.processCell(c,n,h[i],F_,g,!0);this.beans.editSvc?.commitNextEdit(),c.setDataValue(n,o,P_),r?.addParentNode(c.parent,[n]);let{rowIndex:p,rowPinned:m}=s,v=Mc({rowIndex:p,column:n,rowPinned:m});t[v]=!0}o++};this.iterateActiveRanges(rowCallback,!1,this.getPreProcessRangeCallback(e))}getDisplayedColumnsStartingAt(e){let t=e,n=[],{visibleCols:r}=this.beans;for(;t&&Ls(t);)t=r.getColAfter(t);for(;t!=null;)n.push(t),t=r.getColAfter(t);return n}pasteStartingFromFocusedCell(e,t,n,r,i){if(!r)return;let o={rowIndex:r.rowIndex,rowPinned:r.rowPinned},s=this.getDisplayedColumnsStartingAt(r.column);this.isPasteSingleValueIntoRange(e)?this.pasteSingleValueIntoRange(e,n,t,i):this.pasteMultipleValues(e,o,n,s,t,I_,i)}isPasteSingleValueIntoRange(e){let t=this.beans.rangeSvc;return this.hasOnlyOneValueToPaste(e)&&!!t&&!t.isEmpty()}pasteSingleValueIntoRange(e,t,n,r){let i=e[0][0],rowCallback=(e,o,s)=>{t.push(o),s.columns.forEach(e=>this.updateCellValue(o,e,i,n,I_,r))};this.iterateActiveRanges(rowCallback)}hasOnlyOneValueToPaste(e){return e.length===1&&e[0].length===1}copyRangeDown(){let{rangeSvc:e,gos:t,valueSvc:n}=this.beans;if(!e||e.isEmpty())return;let r=[],pasteOperation=(e,i,o,s)=>{let c=t.getCallback(`processCellForClipboard`),p=t.getCallback(`processCellFromClipboard`),rowCallback=(t,o,m)=>{let{columns:h}=m;r.length?(i.push(o),h.forEach((n,i)=>{if(!n.isCellEditable(o)||n.isSuppressPaste(o))return;let c=this.processCell(o,n,r[i],F_,p,!0);this.beans.editSvc?.commitNextEdit(),o.setDataValue(n,c,P_),s&&s.addParentNode(o.parent,[n]);let{rowIndex:m,rowPinned:h}=t,g=Mc({rowIndex:m,column:n,rowPinned:h});e[g]=!0})):h.forEach(e=>{let t=this.processCell(o,e,n.getValue(e,o),F_,c,!1,!0);r.push(t)})};this.iterateActiveRanges(rowCallback,!0)};this.doPasteOperation(pasteOperation)}removeLastLineIfBlank(e){let t=Kc(e);if(t&&t.length===1&&t[0]===``){if(e.length===1)return;Zo(e,t)}}fireRowChanged(e){if(this.gos.get(`editType`)===`fullRow`)for(let t of e)this.eventSvc.dispatchEvent({type:`rowValueChanged`,node:t,data:t.data,rowIndex:t.rowIndex,rowPinned:t.rowPinned})}pasteMultipleValues(e,t,n,r,i,o,s){let c=t,p=this.beans,{gos:m}=p,h=this.clientSideRowModel!=null&&!m.get(`enableGroupEdit`)&&!m.get(`treeData`),getNextGoodRowNode=()=>{for(;;){if(!c)return null;let e=Ql(p,c);if(c=Sc(p,{rowPinned:c.rowPinned,rowIndex:c.rowIndex}),e==null)return null;if(!(e.detail||e.footer||h&&e.group))return e}};for(let t of e){let e=getNextGoodRowNode();e&&(t.forEach((t,n)=>this.updateCellValue(e,r[n],t,i,o,s)),n.push(e))}}updateCellValue(e,t,n,r,i,o){if(!e||!t?.isCellEditable(e)||t?.isSuppressPaste(e))return;let s=this.processCell(e,t,n,i,this.gos.getCallback(`processCellFromClipboard`),!0);this.beans.editSvc?.commitNextEdit(),e.setDataValue(t,s,P_);let{rowIndex:c,rowPinned:p}=e,m=Mc({rowIndex:c,column:t,rowPinned:p});r[m]=!0,o&&o.addParentNode(e.parent,[t])}copyToClipboard(e={}){this.copyOrCutToClipboard(e)}cutToClipboard(e={},t=`api`){this.gos.get(`suppressCutToClipboard`)||(this.eventSvc.dispatchEvent({type:`cutStart`,source:t}),this.copyOrCutToClipboard(e,!0),this.eventSvc.dispatchEvent({type:`cutEnd`,source:t}))}copyOrCutToClipboard(e,t){let{includeHeaders:n,includeGroupHeaders:r}=e,{gos:i,focusSvc:o}=this.beans;n??=i.get(`copyHeadersToClipboard`),r??=i.get(`copyGroupHeadersToClipboard`);let s={includeHeaders:n,includeGroupHeaders:r},c=i.get(`rowSelection`),p=i.get(`cellSelection`),m=null;this.shouldCopyCells(p,c)?(this.copySelectedRangeToClipboard(s),m=0):this.shouldCopyRows(c)?(this.copySelectedRowsToClipboard(s),m=1):o.isAnyCellFocused()&&(this.copyFocusedCellToCl
7ipboard(s),m=2),t&&m!==null&&this.clearCellsAfterCopy(m)}shouldCopyCells(e,t){let{rangeSvc:n,selectionSvc:r,gos:i}=this.beans;if(!n||n.isEmpty())return!1;if(e)return!(typeof t==`object`&&t.copySelectedRows&&!r?.isEmpty());{let e=i.get(`suppressCopySingleCellRanges`);return!(!n.isMoreThanOneCell()&&e)}}shouldCopyRows(e){let{selectionSvc:t,gos:n}=this.beans;return t?.isEmpty()??!0?!1:e&&typeof e!=`string`?e.copySelectedRows??!1:!n.get(`suppressCopyRowsToClipboard`)}clearCellsAfterCopy(e){let t=this.beans,{rangeSvc:n,focusSvc:r,eventSvc:i}=t;if(i.dispatchEvent({type:`keyShortcutChangedCellStart`}),e===0)n.clearCellRangeCellValues({cellEventSource:`clipboardSvc`});else if(e===1)this.clearSelectedRows();else{let e=r.getFocusedCell();if(e==null)return;let n=Ql(t,e);n&&this.clearCellValue(n,e.column)}i.dispatchEvent({type:`keyShortcutChangedCellEnd`})}clearSelectedRows(){let{selectionSvc:e,visibleCols:t}=this.beans,n=e?.getSelectedNodes()??[],r=t.allCols;for(let e of n)for(let t of r)this.clearCellValue(e,t)}clearCellValue(e,t){if(!t.isCellEditable(e))return;let n=this.beans.valueSvc.getDeleteValue(t,e);e.setDataValue(t,n,`clipboardSvc`)}iterateActiveRanges(e,t,n){let r=this.beans.rangeSvc;if(!r||r.isEmpty())return;let i=r.getCellRanges(),o=t?[i[0]]:i;for(let t of o)this.iterateActiveRange({cellRange:t,rowCallback:e,preProcessRange:n})}iterateActiveRange(e){let{cellRange:t,preProcessRange:n,rowCallback:r}=e,{beans:i}=this,{rangeSvc:o}=i;if(!o)return;n&&n(t);let s=o.getRangeStartRow(t),c=o.getRangeEndRow(t),p=0,m=!1;for(;!m&&s!=null;){let e=Ql(i,s);m=fa(s,c),r(s,e,t,p++),s=Sc(i,s)}}copySelectedRangeToClipboard(e={}){let t=this.beans.rangeSvc;if(!t||t.isEmpty())return;let{data:n,cellsToFlash:r}=t.areAllRangesAbleToMerge()?this.buildDataFromMergedRanges(t,e):this.buildDataFromRanges(t,e);this.copyDataToClipboard(n),this.dispatchFlashCells(r)}buildDataFromMergedRanges(e,t){let n=new Set,r=e.getCellRanges(),i=new Map,o=[],s={},c=Rc(this.gos,this.beans.rowModel),p=new Set;c||this.beans.rowModel.forEachNode(e=>{p.add(e.rowIndex)});for(let t of r){t.columns.forEach(e=>n.add(e));let{rowPositions:r,cellsToFlash:m}=this.getRangeRowPositionsAndCellsToFlash(e,t);for(let e of r){let t=p.has(e.rowIndex);if(!c&&!t)continue;let n=`${e.rowIndex}-${e.rowPinned||`null`}`;i.get(n)||(i.set(n,!0),o.push(e))}Object.assign(s,m)}let m=this.beans.visibleCols.allCols,h=Array.from(n);return h.sort((e,t)=>m.indexOf(e)-m.indexOf(t)),{data:this.buildExportParams({columns:h,rowPositions:o,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}),cellsToFlash:s}}buildDataFromRanges(e,t){let n=e.getCellRanges(),r=[],i={};for(let o of n){let{rowPositions:n,cellsToFlash:s}=this.getRangeRowPositionsAndCellsToFlash(e,o);Object.assign(i,s),r.push(this.buildExportParams({columns:o.columns,rowPositions:n,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}))}return{data:r.join(`
8`),cellsToFlash:i}}getRangeRowPositionsAndCellsToFlash(e,t){let n=[],r={},i=e.getRangeStartRow(t),o=e.getRangeEndRow(t),s=i;for(;s;){n.push(s);for(let e of t.columns){let{rowIndex:t,rowPinned:n}=s,i=Mc({rowIndex:t,column:e,rowPinned:n});r[i]=!0}if(fa(s,o))break;s=Sc(this.beans,s)}return{rowPositions:n,cellsToFlash:r}}getCellsToFlashFromRowNodes(e){let t=this.beans.visibleCols.allCols,n={};for(let r=0;r<e.length;r++){let{level:i,rowIndex:o,rowPinned:s,sibling:c}=e[r],p=i===-1?c.rowIndex:o;if(p!=null)for(let e=0;e<t.length;e++){let r=t[e],i=Mc({rowIndex:p,column:r,rowPinned:s});n[i]=!0}}return n}copyFocusedCellToClipboard(e={}){let t=this.beans.focusSvc.getFocusedCell();if(t==null)return;t=this.beans.rowSpanSvc?.getCellStart(t)??t;let n=Mc(t),r={rowPinned:t.rowPinned,rowIndex:t.rowIndex},i=t.column,o=this.buildExportParams({columns:[i],rowPositions:[r],includeHeaders:e.includeHeaders,includeGroupHeaders:e.includeGroupHeaders});this.copyDataToClipboard(o),this.dispatchFlashCells({[n]:!0})}copySelectedRowsToClipboard(e={}){let{columnKeys:t,includeHeaders:n,includeGroupHeaders:r}=e,i=this.buildExportParams({columns:t,includeHeaders:n,includeGroupHeaders:r});this.copyDataToClipboard(i);let o=this.beans.selectionSvc?.getSelectedNodes()||[];this.dispatchFlashCells(this.getCellsToFlashFromRowNodes(o))}
8buildExportParams(e){let{columns:t,rowPositions:n,includeHeaders:r=!1,includeGroupHeaders:i=!1}=e,{gos:o,csvCreator:s}=this.beans,processRowGroupCallback=({node:e,column:t})=>{let{value:n,valueFormatted:r}=this.beans.valueSvc.getValueForDisplay(t,e,!0),i=r??n??``,s=o.getCallback(`processCellForClipboard`);return s?s({column:t,node:e,value:i,type:I_,formatValue:n=>this.beans.valueSvc.formatValue(t,e,n)??n,parseValue:r=>this.beans.valueSvc.parseValue(t,e,r,n)??r}):i},c={columnKeys:t,rowPositions:n,skipColumnHeaders:!r,skipColumnGroupHeaders:!i,suppressQuotes:!0,columnSeparator:this.getClipboardDelimiter(),onlySelected:!n,processCellCallback:o.getCallback(`processCellForClipboard`),processRowGroupCallback,processHeaderCallback:o.getCallback(`processHeaderForClipboard`),processGroupHeaderCallback:o.getCallback(`processGroupHeaderForClipboard`)};return s.getDataAsCsv(c,!0)}dispatchFlashCells(e){window.setTimeout(()=>{this.eventSvc.dispatchEvent({type:`flashCells`,cells:e})},0)}processCell(e,t,n,r,i,o,s){let c=this.beans.valueSvc;return i?i({column:t,node:e,value:n,type:r,formatValue:n=>c.formatValue(t,e??null,n)??n,parseValue:n=>c.parseValue(t,e??null,n,c.getValue(t,e))}):o&&t.getColDef().useValueParserForImport!==!1?c.parseValue(t,e??null,n,c.getValue(t,e)):s&&t.getColDef().useValueFormatterForExport!==!1?c.formatValue(t,e??null,n)??n:n}copyDataToClipboard(e){let t=this.gos.getCallback(`sendToClipboard`);if(t){t({data:e});return}if(!this.gos.get(`suppressClipboardApi`)&&navigator.clipboard){navigator.clipboard.writeText(e).catch(t=>{q(40,{e:t,method:`writeText`}),this.copyDataToClipboardLegacy(e)});return}this.copyDataToClipboardLegacy(e)}copyDataToClipboardLegacy(e){this.executeOnTempElement(t=>{let n=_l(this.beans),r=Lo(this.beans);t.value=e||` `,t.select(),t.focus({preventScroll:!0}),n.execCommand(`copy`)||q(41),r?.focus!=null&&r.focus({preventScroll:!0})})}executeOnTempElement(e,t){if(!this.gridCtrl)return;let n=_l(this.beans),r=n.createElement(`textarea`),i=r.style;i.width=`1px`,i.height=`1px`;let o=n.documentElement;i.top=o.scrollTop+`px`,i.left=o.scrollLeft+`px`,i.position=`absolute`,i.opacity=`0`,this.gridCtrl.getGui().appendChild(r);try{e(r)}catch{q(42)}t?window.setTimeout(()=>{t(r),r.remove()},100):r.remove()}},L_={moduleName:`Clipboard`,version:Z,beans:[ClipboardService],apiFunctions:{copyToClipboard,cutToClipboard,copySelectedRowsToClipboard,copySelectedRangeToClipboard,copySelectedRangeDown,pasteFromClipboard},dependsOn:[fh,Pc,$l,Wl]},R_=`.ag-row-number-cell{background-color:var(--ag-header-background-color);border:none;color:var(--ag-header-text-color);font-family:var(--ag-header-font-family);font-size:var(--ag-header-font-size);font-weight:var(--ag-header-font-weight);overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;width:100%}:where(.ag-ltr) .ag-row-number-cell{text-align:right}:where(.ag-rtl) .ag-row-number-cell{text-align:left}.ag-row-numbers-resizer{bottom:-2px;cursor:ns-resize;height:4px;position:absolute;width:100%}:where(.ag-ltr) .ag-row-numbers-resizer{left:0}:where(.ag-rtl) .ag-row-numbers-resizer{right:0}.ag-floating-bottom .ag-row-numbers-resizer{bottom:unset;top:-2px}:where(.ag-row-number-header.ag-row-number-selection-enabled){cursor:cell}.ag-row-number-range-highlight{background-color:var(--ag-range-header-highlight-color)}.ag-row-number-range-selected{background-color:var(--ag-row-numbers-selected-color)}:where(.ag-ltr){.ag-row-number-header,:where(.ag-cell.ag-row-number-cell):not(.ag-cell-last-left-pinned){border-right:var(--ag-pinned-column-border)}:where(.ag-cell.ag-row-number-cell.ag-row-number-selection-enabled){cursor:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjUiPjxwYXRoIGQ9Ik0zLjQ0NSA4LjkxMVY3LjQwOUg5Ljc1VjYuMDE0bDIuNTM1IDIuMTQ2LTIuNTM1IDIuMTQ2VjguOTExeiIgc3R5bGU9InN0cm9rZTojZmZmO3N0cm9rZS13aWR0aDouNDFweCIgdHJhbnNmb3JtPSJtYXRyaXgoMS41Nzg0IDAgMCAxLjg2NDI5IC00LjQxMyAtNy4yMTIpIi8+PC9zdmc+"),auto}}:where(.ag-rtl){.ag-row-number-header,:where(.ag-cell.ag-row-number-cell):not(.ag-cell-first-right-pinned){border-left:var(--ag-pinned-column-border)}:where(.ag-cell.ag-row-number-cell.ag-row-number-selection-enabled){cursor:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIg
8c3R5bGU9ImZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjUiPjxwYXRoIGQ9Ik01Ljk3OSA4LjkxMXYxLjM5NUwzLjQ0NSA4LjE2bDIuNTM0LTIuMTQ2djEuMzk1aDYuMzA2djEuNTAyeiIgc3R5bGU9InN0cm9rZTojZmZmO3N0cm9rZS13aWR0aDouNDFweCIgdHJhbnNmb3JtPSJtYXRyaXgoMS41Nzg0IDAgMCAxLjg2NDI5IC00LjQxMyAtNy4yMTIpIi8+PC9zdmc+"),auto}}`,z_={tag:`div`,cls:`ag-row-numbers-resizer`},AgRowNumbersRowResizer=class extends K{constructor(e){super(z_),this.cellCtrl=e,this.initialYPosition=-1,this.dragging=!1}postConstruct(){let{beans:e,cellCtrl:t}=this,{dragSvc:n,environment:r}=e;this.defaultRowHeight=r.getDefaultRowHeight(),n.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragStart:this.onDragStart.bind(this),onDragging:this.onDragging.bind(this),onDragStop:this.onDragStop.bind(this),onDragCancel:this.onDragCancel.bind(this),includeTouch:!0,stopPropagationForTouch:!0});let i=t.getRowPosition();this.node=Ql(this.beans,i)}onDragStart(e){if(!this.node)return;let{beans:{ctrlsSvc:t,eventSvc:n}}=this;t.get(`gridCtrl`).setResizeCursor(Ks.Vertical),this.dragging=!0,this.initialHeight=this.node.rowHeight,n.dispatchEvent({type:`rowResizeStarted`,node:this.node,event:e,rowHeight:this.initialHeight})}onDragging(e){let{clientY:t}=e;if(this.cellCtrl.rowNode.rowPinned===`bottom`&&(t*=-1),this.initialYPosition===-1||!this.dragging){this.initialYPosition=t;return}let{beans:n,initialHeight:r,initialYPosition:i,defaultRowHeight:o,node:s}=this;if(r==null)return;let c=s?.rowHeight,p=Math.max(r-(i-t),o);if(c===p)return;s?.setRowHeight(p);let{rowRenderer:m,rowModel:h,pinnedRowModel:g}=n,_=!!s?.rowPinned;_&&m.redraw({afterScroll:!0}),(!_||g?.isManual())&&h.onRowHeightChanged({animate:!1})}onDragStop(e){this.beans.eventSvc.dispatchEvent({type:`rowResizeEnded`,node:this.node,event:e,rowHeight:this.node?.rowHeight}),this.clearDragDetails(!0)}onDragCancel(){this.clearDragDetails(!0)}clearDragDetails(e){this.initialYPosition=-1,this.initialHeight=null,this.dragging=!1,e&&this.beans.ctrlsSvc.get(`gridCtrl`).setResizeCursor(!1)}destroy(){this.clearDragDetails(!1),this.node=void 0,super.destroy()}};function _isRowNumbersResizerEnabled(e){let t=e.get(`rowNumbers`);return!(!t||typeof t!=`object`||!t.enableRowResizer)}var RowNumbersRowResizeFeature=class{constructor(e,t){this.beans=e,this.cellCtrl=t}refreshRowResizer(){!_isRowNumbersResizerEnabled(this.beans.gos)||!this.isRowResizeSupported(this.cellCtrl.rowNode)?this.removeRowResizerFromCellComp():this.addResizerToCellComp()}isRowResizeSupported(e){let{pinnedRowModel:t,rowModel:n,visibleCols:r}=this.beans,i=!!n.onRowHeightChanged;return r.autoHeightCols.length?(q(276),!1):e.rowPinned==null?i:!t?.isManual()||i}addResizerToCellComp(){let{beans:e,cellCtrl:t}=this,{eGui:n}=t,{rowResizer:r}=this;if(r){n.appendChild(r.getGui());return}r=e.registry.createDynamicBean(`rowNumberRowResizer`,!1,t),r&&(this.rowResizer=e.context.createBean(r),n.appendChild(r.getGui()))}removeRowResizerFromCellComp(){let{rowResizer:e,beans:{context:t}}=this;e&&(Ta(e.getGui()),this.rowResizer=t.destroyBean(e))}destroy(){this.removeRowResizerFromCellComp()}},RowNumbersService=class extends U{constructor(){super(...arguments),this.beanName=`rowNumbersSvc`,this.isIntegratedWithSelection=!1,this.lastColumnResized=0}postConstruct(){let e=hc(this,this.refreshCells.bind(this),10);this.addManagedEventListeners({columnResized:()=>{this.lastColumnResized=Date.now()},modelUpdated:t=>{e(!1,!t.keepRenderedRows)},rangeSelectionChanged:()=>this.refreshCells(!0),pinnedRowsChanged:()=>e(!1,!0)}),this.addManagedPropertyListeners([`rowNumbers`,`cellSelection`],e=>{this.refreshSelectionIntegration(),this.updateColumns(e)}),this.refreshSelectionIntegration()}addColumns(e){this.columns!=null&&(e.list=this.columns.list.concat(e.list),e.tree=this.columns.tree.concat(e.tree),Ac(e))}createColumns(e,t){let destroyCollection=()=>{Qc(this.beans,this.columns?.tree),this.columns=null};if(!this.gos.get(`rowNumbers`)){destroyCollection();return}let n=e.treeDepth,r=(this.columns?.treeDepth??-1)==n,i=this.generateRowNumberCols();if(Wo(i,this.columns?.list??[])&&r)return;destroyCollection();
8let{colGroupSvc:o}=this.beans,s=o?.findDepth(e.tree)??0,c=o?.balanceTreeForAutoCols(i,s)??[];this.columns={list:i,tree:c,treeDepth:s,map:{}};let putRowNumbersColsFirstInList=e=>{if(!e)return null;let t=e.filter(e=>!yc(e));return[...i,...t]};t(putRowNumbersColsFirstInList)}handleMouseDownOnCell(e,t){return!this.isIntegratedWithSelection||t.target.classList.contains(`ag-row-numbers-resizer`)?!1:(!t.shiftKey&&!Ma(this.beans,t)&&this.focusFirstRenderedCellAtRowPosition(e),!0)}updateColumns(e){let t=Sl(e.source);this.refreshSelectionIntegration();for(let e of this.columns?.list??[]){let n=this.createRowNumbersColDef();e.setColDef(n,null,t),Es(this.beans,{state:[{colId:e.getColId(),...n}]},t)}}getColumn(){return this.columns?.list.find(yc)??null}getColumns(){return this.columns?.list??null}setupForHeader(e){let{column:t,eGridHeader:n}=e.params;yc(t)&&(ou(n,`Row Number`),this.addManagedElementListeners(n,{click:this.onHeaderClick.bind(this),keydown:this.onHeaderKeyDown.bind(this),focus:this.onHeaderFocus.bind(this)}))}createRowNumbersRowResizerFeature(e,t){if(_isRowNumbersResizerEnabled(this.gos))return new RowNumbersRowResizeFeature(e,t)}refreshSelectionIntegration(){let{beans:e}=this,{gos:t,rangeSvc:n}=e,r=t.get(`cellSelection`);this.refreshRowNumberOverrides(),this.isIntegratedWithSelection=!!n&&!!r&&!this.isSuppressCellSelectionIntegration}refreshRowNumberOverrides(){let e=this.gos.get(`rowNumbers`);if(this.rowNumberOverrides={},!(!e||typeof e!=`object`)){e.suppressCellSelectionIntegration&&(this.isSuppressCellSelectionIntegration=!0);for(let t of[`contextMenuItems`,`context`,`onCellClicked`,`onCellContextMenu`,`onCellDoubleClicked`,`headerTooltip`,`headerStyle`,`headerComponent`,`headerComponentParams`,`suppressHeaderKeyboardEvent`,`tooltipField`,`tooltipValueGetter`,`tooltipComponent`,`tooltipComponentParams`,`tooltipComponentSelector`,`valueGetter`,`valueFormatter`,`width`,`maxWidth`,`minWidth`,`resizable`])e[t]!=null&&(this.rowNumberOverrides[t]=e[t])}}onHeaderFocus(){this.beans.ariaAnnounce?.announceValue(`Press Space to select all cells`,`ariaSelectAllCells`)}onHeaderKeyDown(e){!this.isIntegratedWithSelection||e.key!==G.SPACE||this.handleFocusAllCellsFromHeader()}onHeaderClick(e){Date.now()-this.lastColumnResized<100||!this.isIntegratedWithSelection||this.getColumn()?.resizing||this.handleFocusAllCellsFromHeader()}handleFocusAllCellsFromHeader(){Fa(this.beans),this.focusFirstRenderedCellAtRowPosition()}refreshCells(e,t){let n=this.getColumn();if(n){if(t){let e=this.beans.autoWidthCalc?.getPreferredWidthForElements([this.createDummyElement(n)],2);e!=null&&this.beans.colResize?.setColumnWidths([{key:n,newWidth:e}],!1,!0,`rowNumbersService`)}this.beans.rowRenderer.refreshCells({columns:[n],force:e})}}createDummyElement(e){let t=Dl({tag:`div`,cls:`ag-cell-value ag-cell`}),n=String(this.beans.rowModel.getRowCount()+1);if(typeof this.rowNumberOverrides.valueFormatter==`function`){let t=co(this.beans.gos,{data:void 0,value:n,node:null,column:e,colDef:e.colDef});n=this.rowNumberOverrides.valueFormatter(t)}return t.textContent=n,t}createRowNumbersColDef(){let{gos:e,contextMenuSvc:t}=this.beans,n=e.get(`enableRtl`);return{minWidth:60,width:60,resizable:!1,valueGetter:this.valueGetter,contextMenuItems:this.isIntegratedWithSelection||!t?void 0:()=>[],...this.rowNumberOverrides,colId:Wc,chartDataType:`excluded`,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPinned:!0,pinned:n?`right`:`left`,lockPosition:n?`right`:`left`,editable:!1,suppressFillHandle:!0,suppressAutoSize:!0,suppressSizeToFit:!0,suppressHeaderContextMenu:!0,suppressNavigable:!0,headerClass:this.getHeaderClass(),cellClass:this.getCellClass.bind(this),cellAriaRole:`rowheader`}}valueGetter(e){let t=e.node;if(t?.rowPinned&&t.pinnedSibling){let{rowIndex:e}=t.pinnedSibling;return`${e==null?`-`:e+1}`}return String((t?.rowIndex||0)+1)}getHeaderClass(){let e=[`ag-row-number-header`];return this.isIntegratedWithSelection&&e.push(`ag-row-number-selection-enabled`),e}getCellClass(e){let{beans:t}=this,{rangeSvc:n,gos:r}=t,{node:i}=e,o=[`ag-row-number-cell`],s=r.get(`cellSelection`);if(!n||!s)return o;this.isIntegratedWithSelection&&o.push(`ag-row-number-selection-enabled`);let c=n.getCellRanges();if(!c.length)return o;let p=this.beans.visibleCols.allCols.length-1,m=typeof s==`object`&&s.enableHeaderHighlight;for(let e of c)n.isRowInRange(i.rowIndex,i.rowPinned,e)&&(m&&o.push(`ag-row-number-range-highlight`),e.columns.length===p&&o.push(`ag-row-number-range-selected`));return o}generateRowNumberCols(){let{gos:e}=this;if(!e.get(`rowNumbers`))return[];let t=this.createRowNumbersColDef(),n=t.colId;e.validateColDef(t,n,!0);let r=new ka(t,null,n,!1);return this.createBean(r),[r]}focusFirstRenderedCellAtRowPosition(e){if(!e&&(e=da(this.beans),!e))return;let{beans:t,gos:n}=this,{visibleCols:r,colViewport:i}=t,o=n.get(`enableRtl`)?r.rightCols:r.leftCols,s;if(o.length==1){let n=Ql(t,e);if(!n)return;s=i.getColsWithinViewport(n)}else s=o;let c=s.find(e=>!yc(e));if(!c)return;let{rowPinned:p,rowIndex:m}=e;setTimeout(()=>{t.focusSvc.setFocusedCell({rowIndex:m,rowPinned:p,column:c,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})})}destroy(){Qc(this.beans,this.columns?.tree),this.rowNumberOverrides=null,
8super.destroy()}},B_={moduleName:`RowNumbers`,version:Z,beans:[RowNumbersService],dynamicBeans:{rowNumberRowResizer:AgRowNumbersRowResizer},dependsOn:[fh,Ss,zo],css:[R_]},V_={tag:`div`,cls:`ag-filter-toolpanel-search`,role:`presentation`,children:[{tag:`div`,ref:`eExpand`,cls:`ag-filter-toolpanel-expand`},{tag:`ag-input-text-field`,ref:`eFilterTextField`,cls:`ag-filter-toolpanel-search-input`}]},AgFiltersToolPanelHeader=class extends K{constructor(){super(...arguments),this.eExpand=null,this.eFilterTextField=null}postConstruct(){this.setTemplate(V_,[To]);let e=this.getLocaleTextFunc();this.eFilterTextField.setAutoComplete(!1).setInputAriaLabel(e(`ariaFilterColumnsInput`,`Filter Columns Input`)).onValueChange(this.onSearchTextChanged.bind(this)),this.createExpandIcons(),this.setExpandState(0),this.addManagedElementListeners(this.eExpand,{click:this.onExpandClicked.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.showOrHideOptions.bind(this)})}init(e){this.params=e,this.beans.colModel.ready&&this.showOrHideOptions()}createExpandIcons(){let{eExpand:e,beans:t}=this;e.appendChild(this.eExpandChecked=J(`accordionOpen`,t)),e.appendChild(this.eExpandUnchecked=J(`accordionClosed`,t)),e.appendChild(this.eExpandIndeterminate=J(`accordionIndeterminate`,t))}showOrHideOptions(){let{params:e,eFilterTextField:t}=this,n=!e.suppressFilterSearch,r=!e.suppressExpandAll,i=this.getLocaleTextFunc();t.setInputPlaceholder(i(`searchOoo`,`Search...`));let isFilterGroupPresent=e=>e.getOriginalParent()&&e.isFilterAllowed(),o=this.beans.colModel.getCols().some(isFilterGroupPresent);W(t.getGui(),n),W(this.eExpand,r&&o)}onSearchTextChanged(){this.onSearchTextChangedDebounced||=hc(this,()=>this.dispatchLocalEvent({type:`searchChanged`,searchText:this.eFilterTextField.getValue()}),300),this.onSearchTextChangedDebounced()}onExpandClicked(){let e=this.currentExpandState===0?{type:`collapseAll`}:{type:`expandAll`};this.dispatchLocalEvent(e)}setExpandState(e){this.currentExpandState=e,W(this.eExpandChecked,e===0),W(this.eExpandUnchecked,e===1),W(this.eExpandIndeterminate,e===2)}},H_={selector:`AG-FILTERS-TOOL-PANEL-HEADER`,component:AgFiltersToolPanelHeader},U_={tag:`div`,cls:`ag-filter-toolpanel-instance`,children:[{tag:`div`,ref:`eFilterToolPanelHeader`,cls:`ag-filter-toolpanel-header ag-filter-toolpanel-instance-header`,role:`button`,attrs:{"aria-expanded":`false`},children:[{tag:`div`,ref:`eExpand`,cls:`ag-filter-toolpanel-expand`},{tag:`span`,ref:`eFilterName`,cls:`ag-header-cell-text`},{tag:`span`,ref:`eFilterIcon`,cls:`ag-header-icon ag-filter-icon ag-filter-toolpanel-instance-header-icon`,attrs:{"aria-hidden":`true`}}]},{tag:`div`,ref:`agFilterToolPanelBody`,cls:`ag-filter-toolpanel-instance-body ag-filter`}]},ToolPanelFilterComp=class extends K{constructor(e,t){super(U_),this.hideHeader=e,this.expandedCallback=t,this.eFilterToolPanelHeader=null,this.eFilterName=null,this.agFilterToolPanelBody=null,this.eFilterIcon=null,this.eExpand=null,this.expanded=!1}postConstruct(){let{beans:e,eExpand:t}=this,n=J(`accordionOpen`,e);this.eExpandChecked=n;let r=J(`accordionClosed`,e);this.eExpandUnchecked=r,t.appendChild(n),t.appendChild(r)}setColumn(e){this.column=e;let{beans:t,eFilterToolPanelHeader:n,eFilterIcon:r,eExpandChecked:i,hideHeader:o}=this;this.eFilterName.innerText=t.colNames.getDisplayNameForColumn(e,`filterToolPanel`,!1)||``,this.addManagedListeners(n,{click:this.toggleExpanded.bind(this),keydown:this.onKeyDown.bind(this)}),this.addManagedEventListeners({filterOpened:this.onFilterOpened.bind(this)}),this.addInIcon(`filterActive`,r,e),W(r,this.isFilterActive(),{skipAriaHidden:!0}),W(i,!1),o?(W(n,!1),n.removeAttribute(`tabindex`)):n.setAttribute(`tabindex`,`0`),this.addManagedListeners(e,{filterChanged:this.onFilterChanged.bind(this)})}onKeyDown(e){let{key:t}=e,{ENTER:n,SPACE:r,LEFT:i,RIGHT:o}=G;(t===n||t===r||t===i||t===o)&&(e.preventDefault(),t===n||t===r?this.toggleExpanded():t===G.LEFT?this.collapse():this.expand())}getColumn(){return this.column}getColumnFilterName(){return this.beans.colNames.getDisplayNameForColumn(this.column,`filterToolPanel`,!1)}addCssClassToTitleBar(e){this.eFilterToolPanelHeader.classList.add(e)}addInIcon(e,t,n){if(t==null)return;let r=J(e,this.beans,n);t.appendChild(r)}isFilterActive(){return!!this.beans.colFilter?.isFilterActive(this.column)}onFilterChanged(){W(this.eFilterIcon,this.isFilterActive(),{skipAriaHidden:!0}),this.dispatchLocalEvent({type:`filterChanged`})}toggleExpanded(){this.expanded?this.collapse():this.expand()}expand(){this.expanded||(this.expanded=!0,to(this.eFilterToolPanelHeader,!0),W(this.eExpandChecked,!0),W(this.eExpandUnchecked,!1),this.addFilterElement(),this.expandedCallback())}addFilterElement(e){let t=Dl({tag:`div`,cls:`ag-filter-toolpanel-instance-filter`}),n=this.createManagedBean(new _c(this.column,`TOOLBAR`));this.filterComp=n,n.hasFilter()&&n.getFilter()?.then(r=>{this.underlyingFilter=r,r&&(t.appendChild(n.getGui()),this.agFilterToolPanelBody.appendChild(t),n.afterGuiAttached({container:`toolPanel`,suppressFocus:e}))})}collapse(){if(!this.expanded)return;this.expanded=!1,to(this.eFilterToolPanelHeader,!1),this.removeFilterElement(),W(this.eExpandChecked,!1),W(this.eExpandUnchecked,!0);let e=this.filterComp;e?.afterGuiDetached(),this.destroyBean(e),this.expandedCallback()}removeFilterElement(){Ml(this.agFilterToolPanelBody)}isExpanded(){return this.expanded}onPanelHidden(){if(!this.expanded)return;let e=this.underlyingFilter;e&&e.afterGuiDetached?.()}onFilterOpened(e){e.source===`COLUMN_MENU`&&e.column===this.column&&this.expanded&&this.collapse()}},ToolPanelFilterGroupComp=class extends K{constructor(e,t,n,r,i){super(),this.columnGroup=e,this.childFilterComps=t,this.expandedCallback=n,this.depth=r,this.showingColumn=i,this.filterGroupComp=null}postConstruct(){this.setTemplate({tag:`div`,cls:`ag-filter-toolpanel-group-wrapper`,children:[{tag:`ag-group-component`,ref:`filterGroupComp`}]},[u_],{filterGroupComp:{cssIdentifier:`filter-toolpanel`,direction:`vertical`}}),this.setGroupTitle();let{filterGroupComp:e,depth:t,childFilterComps:n,gos:r}=this;e.setAlignItems(`stretch`),e.addCss(`ag-filter-toolpanel-group-level-${t}`),e.getGui().style.setProperty(`--ag-indentation-level`,String(t)),e.addCssClassToTitleBar(`ag-filter-toolpanel-group-level-${t}-header`);for(let r of n)e.addItem(r),r.addCssClassToTitleBar(`ag-filter-toolpanel-group-level-${t+1}-header`),r.getGui().style.setProperty(`--ag-indentation-level`,String(t+1));let i=this.showingColumn?this.columnGroup:void 0;this.tooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean(`tooltipFeature`,!1,{getGui:()=>this.getGui(),getLocation:()=>`filterToolPanelColumnGroup`,shouldDisplayTooltip:Jl(r,()=>e.getGui().querySelector(`.ag-group-title`)),getAdditionalParams:()=>({colDef:i?.getColDef(),column:i})})),this.refreshFilterClass(),this.addExpandCollapseListeners(),this.addFilterChangedListeners(),this.setupTooltip(),this.addInIcon(`filterActive`)}setupTooltip(){if(!this.showingColumn)return;let refresh=()=>{this.tooltipFeature?.setTooltipAndRefresh(this.columnGroup.getColDef().headerTooltip)};refresh(),this.addManagedEventListeners({newColumnsLoaded:refresh})}addCssClassToTitleBar(e){this.filterGroupComp.addCssClassToTitleBar(e)}onPanelHidden(){for(let e of this.childFilterComps)e.onPanelHidden()}isColumnGroup(){return Tc(this.columnGroup)}isExpanded(){return this.filterGroupComp.isExpanded()}getChildren(){return this.childFilterComps}getFilterGroupName(){return this.filterGroupName??``}getFilterGroupId(){return this.columnGroup.getId()}hideGroupItem(e,t){this.filterGroupComp.hideItem(e,t)}hideGroup(e){this.setDisplayed(!e)}addInIcon(e){let t=J(e,this.beans);t&&t.classList.add(`ag-filter-toolpanel-group-instance-header-icon`),this.filterGroupComp.addTitleBarWidget(t)}forEachToolPanelFilterChild(e){for(let t of this.childFilterComps)t instanceof ToolPanelFilterComp&&e(t)}addExpandCollapseListeners(){let e=this.isColumnGroup()?()=>this.expandedCallback():()=>this.forEachToolPanelFilterChild(e=>e.expand()),t=this.isColumnGroup()?()=>this.expandedCallback():()=>this.forEachToolPanelFilterChild(e=>e.collapse());
8this.addManagedListeners(this.filterGroupComp,{expanded:e,collapsed:t})}getColumns(){return Tc(this.columnGroup)?this.columnGroup.getLeafColumns():[this.columnGroup]}addFilterChangedListeners(){for(let e of this.getColumns())this.addManagedListeners(e,{filterChanged:()=>this.refreshFilterClass()});Tc(this.columnGroup)||this.addManagedEventListeners({filterOpened:this.onFilterOpened.bind(this)})}refreshFilterClass(){let e=this.getColumns(),anyChildFiltersActive=()=>e.some(e=>e.isFilterActive());this.filterGroupComp.toggleCss(`ag-has-filter`,anyChildFiltersActive())}onFilterOpened(e){e.source===`COLUMN_MENU`&&e.column===this.columnGroup&&this.isExpanded()&&this.collapse()}expand(){this.filterGroupComp.toggleGroupExpand(!0)}collapse(){this.filterGroupComp.toggleGroupExpand(!1)}setGroupTitle(){let e=this.columnGroup,t=Tc(e)?this.getColumnGroupName(e):this.getColumnName(e);this.filterGroupName=t,this.filterGroupComp.setTitle(t||``)}getColumnGroupName(e){return this.beans.colNames.getDisplayNameForProvidedColumnGroup(null,e,`filterToolPanel`)}getColumnName(e){return this.beans.colNames.getDisplayNameForColumn(e,`filterToolPanel`,!1)}destroyFilters(){this.childFilterComps=this.destroyBeans(this.childFilterComps),Ml(this.getGui())}destroy(){this.destroyFilters(),super.destroy()}},AgFiltersToolPanelList=class extends K{constructor(){super({tag:`div`,cls:`ag-filter-list-panel`}),this.initialised=!1,this.hasLoadedInitialState=!1,this.isInitialState=!1,this.filterGroupComps=[],this.suppressOnColumnsChanged=!1,this.onColumnsChangedPending=!1}wireBeans(e){this.colModel=e.colModel}init(e){this.initialised=!0;let t=co(this.gos,{suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGrid:!1});mc(t,e),this.params=t,t.suppressSyncLayoutWithGrid||this.addManagedEventListeners({columnMoved:()=>this.onColumnsChanged()}),this.addManagedEventListeners({newColumnsLoaded:()=>this.onColumnsChanged(),toolPanelVisibleChanged:e=>{e.key===`filters`&&!e.visible&&this.onPanelHidden()},dragStarted:()=>{this.suppressOnColumnsChanged=!0},dragStopped:()=>{this.suppressOnColumnsChanged=!1,this.onColumnsChangedPending&&(this.onColumnsChangedPending=!1,this.onColumnsChanged())}}),this.colModel.ready&&this.onColumnsChanged()}onColumnsChanged(){if(this.suppressOnColumnsChanged){this.onColumnsChangedPending=!0;return}let e=this.colModel.isPivotMode();!this.params.suppressSyncLayoutWithGrid&&!e?this.syncFilterLayout():this.buildTreeFromProvidedColumnDefs(),this.refreshAriaLabel()}syncFilterLayout(){syncLayoutWithGrid(this.colModel,this.setFiltersLayout.bind(this)),this.refreshAriaLabel()}buildTreeFromProvidedColumnDefs(){let e=this.colModel.getColDefColTree();this.recreateFilters(e)}setFiltersLayout(e){let t=toolPanelCreateColumnTree(this.colModel,e);this.recreateFilters(t)}recreateFilters(e){let t=Lo(this.beans);this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!this.params.initialState);let n=this.getExpansionState();this.destroyFilters();let r=this.recursivelyAddComps(e,0,n);this.filterGroupComps=r;let i=r.length;if(i){for(let e of r)this.appendChild(e);this.setFirstAndLastVisible(0,i-1)}let o=this.searchFilterText;Xs(o)&&this.searchFilters(o),this.fireExpandedEvent(),this.getGui().contains(t)&&t.focus(),this.isInitialState=!1,this.refreshAriaLabel()}recursivelyAddComps(e,t,n){return e.map(e=>{if(Tc(e))return this.recursivelyAddFilterGroupComps(e,t,n)?.flatMap(e=>e)??[];let r=e;if(!this.shouldDisplayFilter(r))return[];let i=new ToolPanelFilterComp(t===0,()=>this.onFilterExpanded());if(this.createBean(i),i.setColumn(r),n.get(r.getId())&&i.expand(),t>0)return i;let o=this.createBean(new ToolPanelFilterGroupComp(r,[i],this.onGroupExpanded.bind(this),t,!0));return o.addCssClassToTitleBar(`ag-filter-toolpanel-header`),n.get(o.getFilterGroupId())||o.collapse(),o}).flatMap(e=>e)}refreshAriaLabel(){let e=this.getLocaleTextFunc(),t=e(`ariaFilterPanelList`,`Filter List`),n=e(`filters`,`Filters`),r=this.getGui().querySelectorAll(`.ag-filter-toolpanel-group-item:not(.ag-filter-toolpanel-group-wrapper, .ag-hidden)`).length;ou(this.getAriaElement(),`${t} ${r} ${n}`)}recursivelyAddFilterGroupComps(e,t,n){if(!this.filtersExistInChildren(e.getChildren()))return;if(e.getColGroupDef()?.suppressFiltersToolPanel)return[];let r=e.isPadding()?t:t+1,i=this.recursivelyAddComps(e.getChildren(),r,n).flatMap(e=>e);if(e.isPadding())return i;let o=new ToolPanelFilterGroupComp(e,i,this.onGroupExpanded.bind(this),t,!1);this.createBean(o),o.addCssClassToTitleBar(`ag-filter-toolpanel-header`);let s=n.get(o.getFilterGroupId());return(this.isInitialState&&!s||s===!1)&&o.collapse(),[o]}filtersExistInChildren(e){return e.some(e=>Tc(e)?this.filtersExistInChildren(e.getChildren()):this.shouldDisplayFilter(e))}shouldDisplayFilter(e){let t=e.getColDef()?.suppressFiltersToolPanel;return e.isFilterAllowed()&&!t}getExpansionState(){let e=new Map;if(this.isInitialState){let{expandedColIds:t,expandedGroupIds:n}=this.params.initialState;for(let n of t)e.set(n,!0);for(let t of n)e.set(t,!0);return e}let recursiveGetExpansionState=t=>{e.set(t.getFilterGroupId(),t.isExpanded());for(let n of t.getChildren())n instanceof ToolPanelFilterGroupComp?recursiveGetExpansionState(n):e.set(n.getColumn().getId(),n.isExpanded())};return this.filterGroupComps.forEach(recursiveGetExpansionState),e}refresh(){}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}expandFilterGroups(e,t){let n=[],updateGroupExpandState=r=>{let i=r.getFilterGroupId();(!t||t.includes(i))&&(e&&r.isColumnGroup()?r.expand():r.collapse(),n.push(i));for(let e of r.getChildren())e instanceof ToolPanelFilterGroupComp&&updateGroupExpandState(e)};if(this.filterGroupComps.forEach(updateGroupExpandState),this.onGroupExpanded(),t){let e=t.filter(e=>n.indexOf(e)<0);e.length>0&&q(166,{unrecognisedGroupIds:e})}}expandFilters(e,t){let n=[],updateGroupExpandState=r=>{if(r instanceof ToolPanelFilterGroupComp){let t=!1;for(let n of r.getChildren())updateGroupExpandState(n)&&(e?(r.expand(),t=!0):r.isColumnGroup()||r.collapse());return t}let i=r.getColumn().getColId(),o=!t||t.includes(i);return o&&(e?r.expand():r.collapse(),n.push(i)),o};if(this.filterGroupComps.forEach(updateGroupExpandState),this.onGroupExpanded(),t){let e=t.filter(e=>n.indexOf(e)<0);e.length>0&&q(167,{unrecognisedColIds:e})}}onGroupExpanded(){this.fireExpandedEvent()}onFilterExpanded(){this.dispatchLocalEvent({type:`filterExpanded`})}fireExpandedEvent(){let e=0,t=0,updateExpandCounts=n=>{if(n.isColumnGroup()){n.isExpanded()?e++:t++;for(let e of n.getChildren())e instanceof ToolPanelFilterGroupComp&&updateExpandCounts(e)}};this.filterGroupComps.forEach(updateExpandCounts);let n;n=e>0&&t>0?2:+(t>0),this.dispatchLocalEvent({type:`groupExpanded`,state:n})}performFilterSearch(e){this.searchFilterText=Xs(e)?e.toLowerCase():null,this.searchFilters(this.searchFilterText)}searchFilters(e){let passesFilter=t=>!Xs(e)||t.toLowerCase().indexOf(e)!==-1,recursivelySearch=(e,t)=>{if(!(e instanceof ToolPanelFilterGroupComp))return passesFilter(e.getColumnFilterName()||``);let n=e.getChildren(),r=passesFilter(e.getFilterGroupName()),i=t||r;if(i){e.hideGroup(!1);for(let t=0;t<n.length;t++)recursivelySearch(n[t],i),e.hideGroupItem(!1,t);return!0}let o=!1;
8return n.forEach((n,r)=>{let i=recursivelySearch(n,t);e.hideGroupItem(!i,r),i&&(o=!0)}),e.hideGroup(!o),o},t,n;this.filterGroupComps.forEach((e,r)=>{recursivelySearch(e,!1);let i=e.getGui()?.classList.contains(`ag-hidden`);t===void 0?i||(t=r,n=r):!i&&n!==r&&(n=r)}),this.setFirstAndLastVisible(t,n),this.refreshAriaLabel()}setFirstAndLastVisible(e,t){this.filterGroupComps.forEach((n,r)=>{n.removeCss(`ag-first-group-visible`),n.removeCss(`ag-last-group-visible`),r===e&&n.addCss(`ag-first-group-visible`),r===t&&n.addCss(`ag-last-group-visible`)})}onPanelHidden(){for(let e of this.filterGroupComps)e.onPanelHidden()}getExpandedFiltersAndGroups(){let e=[],t=new Set,getExpandedFiltersAndGroups=n=>{if(n instanceof ToolPanelFilterGroupComp){for(let e of n.getChildren())getExpandedFiltersAndGroups(e);let r=n.getFilterGroupId();n.isExpanded()&&!t.has(r)&&e.push(r)}else n.isExpanded()&&t.add(n.getColumn().getColId())};return this.filterGroupComps.forEach(getExpandedFiltersAndGroups),{expandedGroupIds:e,expandedColIds:Array.from(t)}}destroyFilters(){this.filterGroupComps=this.destroyBeans(this.filterGroupComps),Ml(this.getGui())}destroy(){this.destroyFilters(),super.destroy()}},W_={selector:`AG-FILTERS-TOOL-PANEL-LIST`,component:AgFiltersToolPanelList},G_=`.ag-filter-toolpanel{flex:1 1 0px;min-width:0}.ag-filter-toolpanel-header,.ag-filter-toolpanel-search{align-items:center;color:var(--ag-header-text-color);display:flex;font-weight:var(--ag-header-font-weight);padding:0 var(--ag-spacing);>*{align-items:center;display:flex}}.ag-filter-toolpanel-header{padding-bottom:var(--ag-spacing);padding-top:var(--ag-spacing);position:relative;&:focus-visible{border-radius:var(--ag-border-radius);box-shadow:inset var(--ag-focus-shadow)}}:where(.ag-ltr) .ag-filter-toolpanel-group-instance-header-icon,:where(.ag-ltr) .ag-filter-toolpanel-instance-header-icon{margin-left:var(--ag-spacing)}:where(.ag-rtl) .ag-filter-toolpanel-group-instance-header-icon,:where(.ag-rtl) .ag-filter-toolpanel-instance-header-icon{margin-right:var(--ag-spacing)}.ag-filter-toolpanel-search{min-height:var(--ag-header-height);padding-bottom:var(--ag-spacing);padding-top:var(--ag-widget-container-vertical-padding)}:where(.ag-filter-toolpanel-group:not(.ag-has-filter)>.ag-group-title-bar) .ag-filter-toolpanel-group-instance-header-icon{display:none}.ag-filter-toolpanel-search-input{flex-grow:1;height:calc(var(--ag-spacing)*4)}:where(.ag-ltr) .ag-filter-toolpanel-group-title-bar-icon{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-filter-toolpanel-group-title-bar-icon{margin-left:var(--ag-spacing)}.ag-filter-toolpanel-expand{cursor:pointer}:where(.ag-ltr) .ag-filter-toolpanel-expand{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-filter-toolpanel-expand{margin-left:var(--ag-spacing)}:where(.ag-ltr) .ag-filter-toolpanel-group-title-bar,:where(.ag-ltr) .ag-filter-toolpanel-instance-header{padding-left:calc(var(--ag-spacing) + var(--ag-filter-tool-panel-group-indent)*var(--ag-indentation-level))}:where(.ag-rtl) .ag-filter-toolpanel-group-title-bar,:where(.ag-rtl) .ag-filter-toolpanel-instance-header{padding-right:calc(var(--ag-spacing) + var(--ag-filter-tool-panel-group-indent)*var(--ag-indentation-level))}:where(.ag-ltr) .ag-filter-toolpanel-instance-body{margin-left:var(--ag-filter-tool-panel-group-indent)}:where(.ag-rtl) .ag-filter-toolpanel-instance-body{margin-right:var(--ag-filter-tool-panel-group-indent)}.ag-filter-toolpanel-instance-filter{background-color:var(--ag-chrome-background-color)}.ag-filter-toolpanel-group-level-0{border-top:none}`,K_={tag:`div`,cls:`ag-filter-toolpanel`,children:[{tag:`ag-filters-tool-panel-header`,ref:`filtersToolPanelHeaderPanel`},{tag:`ag-filters-tool-panel-list`,ref:`filtersToolPanelListPanel`}]},FiltersToolPanel=class extends K{constructor(){super(K_,[H_,W_]),this.filtersToolPanelHeaderPanel=null,this.filtersToolPanelListPanel=null,this.initialised=!1,this.listenerDestroyFuncs=[],this.registerCSS(G_)}init(e){if(this.initialised){for(let e of this.listenerDestroyFuncs)e();this.listenerDestroyFuncs=[]}this.initialised=!0;let t={suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGri
8d:!1,...e};this.params=t;let{filtersToolPanelHeaderPanel:n,filtersToolPanelListPanel:r}=this;n.init(t),r.init(t);let{suppressExpandAll:i,suppressFilterSearch:o}=t;i&&o&&n.setDisplayed(!1),this.listenerDestroyFuncs.push(...this.addManagedListeners(n,{expandAll:()=>r.expandFilterGroups(!0),collapseAll:()=>r.expandFilterGroups(!1),searchChanged:e=>r.performFilterSearch(e.searchText)}),...this.addManagedListeners(r,{filterExpanded:t.onStateUpdated,groupExpanded:e=>{n.setExpandState(e.state),t.onStateUpdated()}}))}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}setFilterLayout(e){this.filtersToolPanelListPanel.setFiltersLayout(e)}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()}},FilterPanelService=class extends U{constructor(){super(...arguments),this.beanName=`filterPanelSvc`,this.states=new Map,this.orderedStates=[],this.initialStateApplied=!1,this.columnsLoaded=!1,this.isActive=!1}postConstruct(){if(!this.gos.get(`enableFilterHandlers`))return;let e=this.updateFilterStates.bind(this),updateApplyButton=()=>this.dispatchStatesUpdates(void 0,!0),t=this.onFilterDestroyed.bind(this);this.addManagedEventListeners({newColumnsLoaded:()=>{this.columnsLoaded=!0,this.initialStateApplied||this.applyState(),e()},filterChanged:e,filterDestroyed:t,filterHandlerDestroyed:t,filterOpened:updateApplyButton,filterClosed:updateApplyButton}),this.addManagedListeners(this.beans.colFilter,{filterStateChanged:({column:e})=>{this.states.get(e.getColId())?.refresh?.(),updateApplyButton()}})}updateParams(e,t){this.params=e;let n=!1;if(t&&(this.currState=t,this.columnsLoaded)){let e=new Set(t.filters?.map(e=>e.colId));for(let t of this.getIds())e.has(t)||this.remove(t);this.clearStates(),this.applyState(),this.updateFilterStates(),n=!0}n||this.dispatchStatesUpdates(),this.beans.colFilter?.setGlobalButtons(!!e.buttons?.length)}getIds(){return Array.from(this.states.keys())}getAvailable(){let e=this.beans,t=[];for(let n of e.colModel.getColDefCols()??[]){let r=n.getColId();n.isFilterAllowed()&&!n.colDef.suppressFiltersToolPanel&&!this.states.get(r)&&t.push({id:r,name:getDisplayName(e,n)})}return t}add(e){this.createFilter(e,!0),this.dispatchStatesUpdates(e)}remove(e){let{states:t,orderedStates:n,beans:{colFilter:r,selectableFilter:i}}=this,o=t.get(e);if(!o)return;o.destroy?.();let s=o.state.column;t.delete(e),i?.clearActive(e),r?.destroyFilter(s),this.eventSvc.dispatchEvent({type:`filterSwitched`,column:s});let c=n.indexOf(e);n.splice(c,1);let p=n[c];this.dispatchStatesUpdates(p)}getState(e){return this.states.get(e)?.state}updateFilterState(e,t,n,r){let i=this.getState(e);i&&(i[t]=n,r||this.dispatchLocalEvent({type:`filterPanelStateChanged`,id:e,state:i}))}expand(e,t){let n=this.states.get(e);if(!n)return;n.destroy?.();let{handler:r,state:{column:i}}=n,o=this.createFilterState(i,r,t);this.states.set(e,o),this.dispatchLocalEvent({type:`filterPanelStateChanged`,id:e,state:o.state})}updateType(e,t){let n=this.states.get(e);if(!n)return;let r=n.state;if(r.expanded===!1)return;let i=r.filterDefs;if(!i)return;let{colFilter:o,selectableFilter:s}=this.beans;s?.setActive(e,i,t),o.filterParamsChanged(e,`columnFilter`);let c=r.column;this.eventSvc.dispatchEvent({type:`filterSwitched`,column:c});let p=this.states.get(e);if(!p)return;let m=p.state;this.dispatchLocalEvent({type:`filterPanelStateChanged`,id:e,state:m})}getActions(){let e=this.params?.buttons;if(e?.length)return{actions:e,canApply:!!this.beans.colFilter?.canApplyAll()}}doAction(e){this.beans.colFilter?.updateAllModels(e)}getGridState(){let e=[];return this.states.forEach((t,n)=>{e.push({colId:n,expanded:t.state.expanded})}),{filters:e}}createFilter(e,t){let n=this.createFilterStateWrapper(e,t);n&&(this.states.set(e,n),this.orderedStates.push(e))}
8createFilterStateWrapper(e,t){let{colModel:n,colFilter:r}=this.beans,i=n.getColDefCol(e);if(i&&!i.colDef.suppressFiltersToolPanel){let e=r.getHandler(i,!0);if(e)return this.createFilterState(i,e,t)}}updateFilterStates(){if(!this.params)return;let e=this.beans.colFilter.getModel(),t=new Set;for(let n of Object.keys(e)){let e=this.states.get(n);e?e.refresh?.():this.createFilter(n),t.add(n)}this.states.forEach((e,n)=>{t.has(n)||e.refresh?.()}),this.dispatchStatesUpdates()}createFilterState(e,t,n){let r=this.beans,{colFilter:i,selectableFilter:o}=r,s=getDisplayName(r,e),c=e.getColId(),getIsEditing=()=>!!this.params?.buttons&&i.hasUnappliedModel(c),p=getIsEditing();if(n){let r=e.colDef,{filterDefs:i,activeFilterDef:m}=o?.getDefs(e,r)??{},h=this.createBean(new _c(e,`TOOLBAR`,!0));return{state:{column:e,name:s,isEditing:p,expanded:n,detail:h.getGui(),activeFilterDef:m,filterDefs:i,afterGuiAttached:h.afterGuiAttached.bind(h),afterGuiDetached:h.afterGuiDetached.bind(h)},handler:t,refresh:()=>{this.updateFilterState(c,`isEditing`,getIsEditing())},destroy:()=>this.destroyBean(h)}}{let n=e.getColId(),getSummary=()=>t.getModelAsString?.(i.getStateForColumn(n).model,`filterToolPanel`)??``;return{state:{column:e,name:s,isEditing:p,expanded:!1,summary:getSummary()},handler:t,refresh:()=>{this.updateFilterState(n,`isEditing`,getIsEditing(),!0),this.updateFilterState(n,`summary`,getSummary())}}}}onFilterDestroyed({column:e,source:t}){let{colFilter:n,filterManager:r}=this.beans;if(!n?.isAlive()||!r?.isFilterAllowed(e))return;let i=this.states,o=e.getColId(),s=i.get(o);if(s){let e=this.createFilterStateWrapper(o,s.state.expanded);e?(s.destroy?.(),i.set(o,e)):this.remove(o),t===`api`&&this.dispatchStatesUpdates()}}dispatchStatesUpdates(e,t){this.dispatchLocalEvent({type:`filterPanelStatesChanged`,activeId:e,action:t})}applyState(){if(this.params&&this.columnsLoaded){this.initialStateApplied=!0;for(let{colId:e,expanded:t}of this.currState?.filters??[])this.createFilter(e,t)}}destroy(){this.clearStates(),this.params=void 0,this.currState=void 0,super.destroy()}clearStates(){let{states:e,orderedStates:t}=this;e.forEach(e=>e.destroy?.()),e.clear(),t.length=0}};function getDisplayName(e,t){return e.colNames.getDisplayNameForColumn(t,`filterToolPanel`)??t.getColId()}var q_={addFilterCard:`Add Filter`,ariaLabelAddFilterField:`Add Filter Field`,ariaLabelFilterCardDelete:`Delete Filter`,ariaLabelFilterCardHasEdits:`Has Edits`,agTextColumnFilterDisplayName:`Simple Filter`,agNumberColumnFilterDisplayName:`Simple Filter`,agDateColumnFilterDisplayName:`Simple Filter`,agSetColumnFilterDisplayName:`Selection Filter`,agMultiColumnFilterDisplayName:`Combo Filter`,addFilterPlaceholder:`Search columns...`};function translateForFilterPanel(e,t){return tl(e,q_,t)}function compareAndUpdateListsInDom(e,t,n){let r=0;for(let e=0;e<n.length;e++){let i=n[e];i===t[r]?r++:Ta(i)}for(;r<t.length;)e.appendChild(t[r++])}var SelectableFilterService=class extends U{constructor(){super(...arguments),this.beanName=`selectableFilter`,this.selectedFilters=new Map,this.valueGetters=new Map}getFilterValueGetter(e){return this.valueGetters.get(e)}isSelectable(e){return e.filter===`agSelectableColumnFilter`}getFilterDef(e,t){return this.getDefs(e,t).activeFilterDef}getDefs(e,t){if(!this.isSelectable(t))return;let n=this.beans,{gos:r,dataTypeSvc:i,colFilter:o}=n,s=t.filterParams,c=e.colDef;typeof s==`function`&&(s=s(co(r,{column:e,colDef:c})));let p=i?.getBaseDataType(e),m=i?.getDataTypeDefinition(e),h=i?.getFormatValue(p),{filters:g,defaultFilterParams:_,defaultFilterIndex:v}=s??{},updateDef=t=>{let{filter:r,filterParams:i,name:s,filterValueGetter:g=c.filterValueGetter}=t,v=_?{..._,...i}:i,y;m&&h&&(y=r===`agMultiColumnFilter`?n.multiFilter?.getParamsForDataType(v,g,m,h):Ho(r,v,g,m,h,n,this.getLocaleTextFunc()));let b;if(!s){let t=r;typeof r==`boolean`&&(t=o?.getDefaultFilterFromDataType(()=>p)),typeof t==`string`?b=translateForFilterPanel(this,`${t}DisplayName`):(q(280,{colId:e.getColId()}),b=``)}return _||y||b?{...t,filterParams:v,name:b??s,...y}:t},y=(g??this.getDefaultFilters(e)).map(updateDef),b=this.selectedFilters.get(e.getColId())??v??(!g&&jl(r)?1:0);return b>=y.length&&(b=0),{filterDefs:y,activeFilterDef:y[b]}}setActive(e,t,n){let r=t.indexOf(n);if(r<0)return;let{selectedFilters:i,valueGetters:o}=this;i.set(e,r);let s=n.filterValueGetter;s?o.set(e,s):o.delete(e)}clearActive(e){let{selectedFilters:t,valueGetters:n}=this;t.delete(e),n.delete(e)}destroy(){let{selectedFilters:e,valueGetters:t}=this;e.clear(),t.clear(),super.destroy()}getDefaultFilters(e){let{gos:t,dataTypeSvc:n}=this.beans,r=t.isModuleRegistered(`MultiFilter`),i=n?.getBaseDataType(e);return[{filter:fo(i,!1)},{filter:`agSetColumnFilter`},...r?[{filter:`agMultiColumnFilter`}]:[]]}},J_={tag:`div`,cls:`ag-filter-card ag-filter-card-add`},AddFilterComp=class extends K{constructor(e){super(J_),this.options=new Map,this.setOptions(e)}postConstruct(){this.showButton()}refresh(e){this.setOptions(e);let{eSelect:t,options:n}=this;t&&t.setValueList({valueList:Array.from(n.keys()),refresh:!0})}showButton(){Ml(this.getGui()),this.destroySelect();let e=Dl({tag:`button`,cls:`ag-button ag-standard-button ag-filter-add-button`,children:[{tag:`span`,children:[()=>J(`filterAdd`,this.beans)]},{tag:`span`,cls:`ag-filter-add-button-label`,children:translateForFilterPanel(this,`addFilterCard`)}]});this.activateTabIndex([e]);let t=this.showSelect.bind(this);e.addEventListener(`click`,t),this.removeButton=()=>{e.removeEventListener(`click`,t)},this.appendChild(e),e.focus()}showSelect(){Ml(this.getGui()),this.destroyButton();let e=`ariaLabelAddFilterField`,t={className:`ag-filter-add-select`,pickerType:`virtual-list`,pickerAriaLabelKey:e,pickerAriaLabelValue:translateForFilterPanel(this,e),placeholder:translateForFilterPanel(this,`addFilterPlaceholder`),value:``,valueList:Array.from(this.options.keys()),searchType:`matchAny`,allowTyping:!0,filterList:!0,highlightMatch:!0,valueFormatter:e=>this.options.get(e)},n=this.createManagedBean(new AgRichSelect(t));this.eSelect=n,this.appendChild(n.getGui()),n.showPicker(),n.getFocusableElement().focus(),n.addManagedListeners(n,{fieldPickerValueSelected:({value:e})=>this.dispatchLocalEvent({type:`filterSelected`,id:e}),pickerHidden:()=>{this.showButton()}})}setOptions(e){let t=this.options;t.clear();for(let{id:n,name:r}of e)t.set(n,r)}destroySelect(){this.eSelect=this.destroyBean(this.eSelect)}
8destroyButton(){this.removeButton=this.removeButton?.()}destroy(){this.destroySelect(),this.destroyButton(),super.destroy()}},Y_={tag:`div`,cls:`ag-filter-card-body`,children:[{tag:`ag-select`,cls:`ag-filter-type-select`,ref:`eFilterType`}]},FilterDetailComp=class extends K{constructor(){super(...arguments),this.eFilterType=null}postConstruct(){this.setTemplate(Y_,[au],{eFilterType:{onValueChange:e=>this.dispatchLocalEvent({type:`filterTypeChanged`,filterDef:e})}}),this.eFilterType.setDisplayed(!1)}refresh(e){let t=this.state;this.state=e;let{activeFilterDef:n,filterDefs:r,detail:i,afterGuiAttached:o,afterGuiDetached:s}=e,{activeFilterDef:c,filterDefs:p,detail:m}=t??{},h=this.eFilterType;if(r!==p){h.clearOptions();let e=r?.map(e=>({value:e,text:e.name}));e&&h.clearOptions().addOptions(e).setValue(n,!0),h.setDisplayed(!!e)}else n!==c&&h.setValue(n,!0);i!==m&&(m&&(Ta(m),s()),this.appendChild(i),o({container:`newFiltersToolPanel`,suppressFocus:!0}))}},X_={tag:`div`,cls:`ag-filter-card-summary`,attrs:{"aria-hidden":`true`}},FilterSummaryComp=class extends K{constructor(){super(X_)}refresh(e){this.getGui().textContent=e.summary}},Z_={tag:`div`,cls:`ag-filter-card`,children:[{tag:`div`,cls:`ag-filter-card-header`,role:`presentation`,children:[{tag:`div`,cls:`ag-filter-card-heading`,role:`heading`,attrs:{"aria-level":`2`},children:[{tag:`button`,ref:`eExpand`,cls:`ag-button ag-filter-card-expand`,children:[{tag:`span`,ref:`eTitle`,cls:`ag-filter-card-title`},{tag:`span`,ref:`eEditing`,cls:`ag-filter-card-editing-icon`},{tag:`span`,ref:`eExpandIcon`,cls:`ag-filter-card-expand-icon`}]}]},{tag:`button`,ref:`eDelete`,cls:`ag-button ag-filter-card-delete`,children:[{tag:`span`,ref:`eDeleteIcon`,cls:`ag-filter-card-delete-icon`}]}]}]},FilterCardComp=class extends K{constructor(e){super(Z_),this.id=e,this.eTitle=null,this.eExpand=null,this.eDelete=null,this.eExpandIcon=null,this.eDeleteIcon=null,this.eEditing=null}postConstruct(){let{beans:e,eDelete:t,eExpand:n,eDeleteIcon:r,eEditing:i,id:o}=this,s=e.filterPanelSvc;ou(t,translateForFilterPanel(this,`ariaLabelFilterCardDelete`)),r.appendChild(qc(`close`,e,null)),this.activateTabIndex([n,t]),this.addManagedElementListeners(n,{click:()=>s.expand(o,!this.state?.expanded)}),this.addManagedElementListeners(t,{click:()=>s.remove(o)}),this.addManagedEventListeners({filterOpened:this.onFilterOpened.bind(this)}),i.appendChild(qc(`filterCardEditing`,e,null))}refresh(e){let{eExpand:t,eEditing:n,state:r,beans:i}=this;this.state=e;let{name:o,expanded:s,isEditing:c}=e;this.eTitle.textContent=o,W(n,c),(!r||s!==r.expanded)&&this.toggleExpand(e);let p=s?null:`${o} ${e.summary}`;c&&(p=`${p??o}. ${translateForFilterPanel(this,`ariaLabelFilterCardHasEdits`)}`),ou(t,p);let removeComp=e=>{if(e)return Ta(e.getGui()),this.destroyBean(e)},createOrRefreshComp=(t,n,r)=>(t||(t=this.createBean(new n),r?.(t),this.appendChild(t.getGui())),t.refresh(e),t);if(e.expanded){this.summaryComp=removeComp(this.summaryComp);let e=createOrRefreshComp(this.detailComp,FilterDetailComp,e=>e.addManagedListeners(e,{filterTypeChanged:({filterDef:e})=>i.filterPanelSvc.updateType(this.id,e)}));this.detailComp=e;let n=`ag-${this.getCompId()}-filter`;e.getGui().id=n,xo(t,n)}else this.detailComp=removeComp(this.detailComp),this.summaryComp=createOrRefreshComp(this.summaryComp,FilterSummaryComp),xo(t,null)}toggleExpand(e){let t=!!e.expanded,{eExpandIcon:n,eExpand:r,beans:i}=this;Ml(n),n.appendChild(qc(t?`filterCardCollapse`:`filterCardExpand`,i,null)),to(r,t)}onFilterOpened(e){let{state:t,beans:n,id:r}=this;e.source===`COLUMN_MENU`&&e.column===t?.column&&t?.expanded&&n.filterPanelSvc.expand(r,!1)}destroy(){this.detailComp=this.destroyBean(this.detailComp),this.summaryComp=this.destroyBean(this.summaryComp),this.state=void 0,super.destroy()}};function isSingleRefresh(e){return!!e?.id}function isActionRefresh(e){return!!e?.action}var Q_={tag:`div`,cls:`ag-filter-panel`,children:[{tag:`div`,cls:`ag-filter-panel-container`,ref:`eContainer`}]},FilterPanel=class extends K{constructor(){super(Q_),this.eContainer=null,this.filters=new Map}refresh(e){if(isActionRefresh(e)){this.refreshActions();return}if(isSingleRefresh(e)){this.filters.get(e.id)?.refresh(e.state);return}let{eContainer:t,filters:n,beans:r}=this,i=r.filterPanelSvc,o=i.getIds(),s=new Map,c=!ks(r),p=c?Lo(r):void 0,m=c&&t.contains(p),h=[],g=[];for(let e of o){let t=n.get(e)??this.createBean(new FilterCardComp(e));t.refresh(i.getState(e)),s.set(e,t),g.push(t.getGui())}this.filters=s;let _=[];
8n.forEach((e,t)=>{h.push(e.getGui()),s.has(t)||_.push(e)});let v=this.addFilterComp;v&&h.push(v.getGui());let y=i.getAvailable();y.length?(v||(v=this.createBean(new AddFilterComp(y)),v.addManagedListeners(v,{filterSelected:({id:e})=>i.add(e)})),v.refresh(y),g.push(v.getGui())):v=this.destroyBean(v),this.addFilterComp=v,compareAndUpdateListsInDom(t,g,h);for(let e of _)this.destroyBean(e);let b=e?.activeId,x=b&&s.get(b)?.getGui();x?ja(x):m&&ks(r)&&ja(g[g.length-1]??t),this.refreshActions()}refreshActions(){let e=this.beans.filterPanelSvc,{actions:t,canApply:n}=e.getActions()??{},r=this.buttonComp;if(t?.length){let i=t.map(e=>({type:e,label:Js(this,`${e}Filter`)}));if(!r){r=this.createBean(new sc({className:`ag-filter-panel-buttons`})),this.getGui().appendChild(r.getGui());let t={};for(let n of[`apply`,`clear`,`reset`,`cancel`])t[n]=()=>e.doAction(n);r.addManagedListeners(r,t)}r.updateButtons(i),r.updateValidity(n!==!1)}else r&&=(Ta(r.getGui()),this.destroyBean(r));this.buttonComp=r}destroy(){this.addFilterComp=this.destroyBean(this.addFilterComp),this.buttonComp=this.destroyBean(this.buttonComp);let e=this.filters;e.forEach(e=>this.destroyBean(e)),e.clear(),super.destroy()}},$_=`.ag-filter-panel{display:flex;flex-direction:column;width:100%;:where(.ag-standard-button){transition:background-color .25s ease-in-out,color .25s ease-in-out}}.ag-filter-panel .ag-simple-filter-body-wrapper{padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) 0}.ag-filter-panel .ag-mini-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-vertical-spacing)}.ag-filter-panel-container{flex:1;overflow:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding) 0}.ag-filter-panel-container>:where(:not(:last-child)){margin-bottom:var(--ag-widget-container-vertical-padding)}.ag-filter-card{background-color:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:var(--ag-border-radius)}.ag-filter-card-header{align-items:center;display:flex;flex-direction:row;padding-top:var(--ag-widget-vertical-spacing)}:where(.ag-ltr) .ag-filter-card-header{&>:where(:not(:last-child)){padding-right:var(--ag-spacing)}}:where(.ag-rtl) .ag-filter-card-header{&>:where(:not(:last-child)){padding-left:var(--ag-spacing)}}.ag-filter-card-heading{flex:1;overflow:hidden;padding-bottom:calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));padding-top:calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing))}:where(.ag-ltr) .ag-filter-card-heading{padding-left:var(--ag-widget-horizontal-spacing)}:where(.ag-rtl) .ag-filter-card-heading{padding-right:var(--ag-widget-horizontal-spacing)}.ag-filter-card-expand{align-items:center;display:flex;flex-direction:row;width:100%}.ag-filter-card-title{font-weight:var(--ag-header-font-weight);overflow:hidden;text-overflow:ellipsis}.ag-filter-card-expand-icon{display:flex;flex:1;justify-content:end}.ag-filter-card-editing-icon{margin:0 var(--ag-spacing)}.ag-filter-card-delete-icon,.ag-filter-card-editing-icon,.ag-filter-card-expand-icon,.ag-filter-card-summary{color:var(--ag-filter-panel-card-subtle-color)}.ag-filter-card-delete-icon,.ag-filter-card-expand-icon{transition:color .25s ease-in-out}.ag-filter-card-delete-icon:hover,.ag-filter-card-expand-icon:hover,.ag-filter-card-heading:hover .ag-filter-card-expand-icon{color:var(--ag-filter-panel-card-subtle-hover-color)}.ag-filter-add-button,.ag-filter-card-delete,.ag-filter-card-expand{border-radius:var(--ag-button-border-radius)}.ag-filter-card-summary,.ag-filter-type-select{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-filter-card-delete{margin-right:var(--ag-widget-horizontal-spacing)}:where(.ag-rtl) .ag-filter-card-delete{margin-left:var(--ag-widget-horizontal-spacing)}.ag-filter-card-summary{margin-bottom:var(--ag-widget-container-vertical-padding)}.ag-filter-type-select{padding-top:var(--ag-widget-vertical-spacing)}.ag-filter-card-add{border:0;padding:0}.ag-filter-add-button{align-items:center;display:flex;flex-direction:row;line-height:1.5;width:100%}:where(.ag-ltr) .ag-filter-add-button-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) .ag-filter-add-button-label{margin-right:var(--ag-spacing)}.ag-filter-add-select{border:0;.ag-rich-select-value{border:0;padding:calc(((1.5*var(--ag-font-size) + 2*var(--ag-button-vertical-padding)) - var(--ag-input-height))/2) var(--ag-spacing)}}:where(.ag-ltr) .ag-filter-add-select{.ag-text-field-input{padding-left:calc(var(--ag-spacing)*1.5 + 12px)!important}}:where(.ag-rtl) .ag-filter-add-select{.ag-text-field-input{padding-right:calc(var(--ag-spacing)*1.5 + 12px)!important}}.ag-filter-panel-buttons{display:flex;flex-wrap:wrap;gap:var(--ag-widget-vertical-spacing) var(--ag-widget-horizontal-spacing);justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding) 0}.ag-filter-panel-buttons-button{line-height:1.5}.ag-filter-panel .ag-filter-panel-buttons-apply-button{background-color:var(--ag-filter-panel-apply-button-background-color);color:var(--ag-filter-panel-apply-button-color)}.ag-filter-panel>:where(:last-child){padding-bottom:var(--ag-widget-container-vertical-padding)}.ag-filter-panel .ag-set-filter-body-wrapper,.ag-filter-panel .ag-simple-filter-body-wrapper>:last-child{margin-bottom:var(--ag-widget-container-vertical-padding)}`,WrapperToolPanel=class extends K{constructor(){super(),this.registerCSS($_)}init(e){if(!this.gos.get(`enableFilterHandlers`)){q(282);return}let t=this.beans.filterPanelSvc;t.isActive=!0,this.addDestroyFunc(()=>{t.isActive=!1}),this.updateParams(e,e.initialState);let n=this.createManagedBean(new FilterPanel);this.filterPanel=n;let refresh=t=>{n.refresh(t),e.onStateUpdated()};refresh(),this.addManagedListeners(t,{filterPanelStatesChanged:refresh,filterPanelStateChanged:refresh})}getGui(){return this.filterPanel?.getGui()}refresh(e){return this.updateParams(e,e.initialState),!0}updateParams(e,t){this.beans.filterPanelSvc?.updateParams(e,t)}getState(){return this.beans.filterPanelSvc?.getGridState()??{}}},ev={moduleName:`FiltersToolPanel`,version:Z,userComponents:{agFiltersToolPanel:FiltersToolPanel},icons:{filtersToolPanel:`filter`},dependsOn:[dg,fh,la]},tv={moduleName:`NewFiltersToolPanel`,version:Z,userComponents:{agNewFiltersToolPanel:WrapperToolPanel},beans:[FilterPanelService,SelectableFilterService],icons:{filterAdd:`filter-add`,filtersToolPanel:`filter`,richSelectOpen:`small-down`,richSelectRemove:`cancel`,filterCardExpand:`chevron-down`,filterCardCollapse:`chevron-up`,filterCardEditing:`edit`},dependsOn:[dg,fh,la]},DetailCellRendererCtrl=class extends U{constructor(){super(...arguments),this.loadRowDataVersion=0}wireBeans(e){this.environment=e.environment}init(e,t){this.params=t,this.comp=e,t.pinned??(this.setAutoHeightClasses(),this.setupRefreshStrategy(),this.createDetailGrid(),this.loadRowData(),this.addManagedEventListeners({fullWidthRowFocused:this.onFullWidthRowFocused.bind(this)}))}onFullWidthRowFocused(e){let t=this.params,n={rowIndex:t.node.rowIndex,rowPinned:t.node.rowPinned},r={rowIndex:e.rowIndex,rowPinned:e.rowPinned};fa(n,r)&&ja(this.comp.getGui(),e.fromBelow)}setAutoHeightClasses(){let e=this.gos.get(`detailRowAutoHeight`),t=e?`ag-details-row-auto-height`:`ag-details-row-fixed-height`,n=e?`ag-details-grid-auto-height`:`ag-details-grid-fixed-height`,r=this.comp;r.toggleCss(t,!0),r.toggleDetailGridCss(n,!0)}setupRefreshStrategy(){let e=this.params.refreshStrategy;if(e==`everything`||e==`nothing`||e==`rows`){this.refreshStrategy=e;return}e!=null&&q(170,{providedStrategy:e}),this.refreshStrategy=`rows`}createDetailGrid(){let{params:e,gos:t}=this;if(dl(e.detailGridOptions)){q(171);return}let n=t.get(`theme`),r=e.detailGridOptions.theme;r&&r!==n&&q(267);let i={themeStyleContainer:this.environment.eStyleContainer,...e.detailGridOptions,theme:n};t.get(`detailRowAutoHeight`)&&(i.domLayout=`autoHeight`),this.comp.setDetailGrid(i)}registerDetailWithMaster(e){let{params:t,beans:{selectionSvc:n,findSvc:r,expansionSvc:i}}=this,o=t.node.id,s=t.api,c={id:o,api:e},p=t.node;if(s.isDestroyed())return;s.addDetailGridInfo(o,c),p.detailGridInfo=c;let m=p.parent;r?.registerDetailGrid(p,e);function onDetailSelectionChanged(){m&&n?.refreshMasterNodeState(m)}function adjustDetailsOnExpandOrCollapseAll({source:t}
8){if(t===`expandAll`)return e.expandAll();if(t===`collapseAll`)return e.collapseAll()}function onMasterRowSelected({node:r,source:i}){r!==m||i===`masterDetail`||e.isDestroyed()||n?.setDetailSelectionState(m,t.detailGridOptions,e)}e.addEventListener(`firstDataRendered`,()=>{e.isDestroyed()||s.isDestroyed()||(n?.setDetailSelectionState(m,t.detailGridOptions,e),e.addEventListener(`selectionChanged`,onDetailSelectionChanged),s.addEventListener(`rowSelected`,onMasterRowSelected),e.isModuleRegistered(`CsrmSsrmSharedApiModule`)&&(s.addEventListener(`expandOrCollapseAll`,adjustDetailsOnExpandOrCollapseAll),i?.setDetailsExpansionState(e)))}),this.addManagedListeners(m,{masterChanged:e=>{e.node.master||this.onDestroy(c)}}),this.addDestroyFunc(()=>this.onDestroy(c))}onDestroy(e){let{params:t}=this,n=t.node,r=t.api;n.detailGridInfo===e&&(r.isDestroyed()||r.removeDetailGridInfo(n.id),n.detailGridInfo=null)}loadRowData(){this.loadRowDataVersion++;let e=this.loadRowDataVersion,t=this.params;if(t.detailGridOptions?.rowModelType===`serverSide`){t.node.detailGridInfo?.api?.refreshServerSide({purge:!0});return}let n=t.getDetailRowData;if(!n){q(172);return}let successCallback=t=>{this.loadRowDataVersion===e&&this.comp.setRowData(t)};n({node:t.node,data:t.node.data,successCallback,context:co(this.gos,{}).context})}refresh(){switch(this.refreshStrategy){case`nothing`:return!0;case`everything`:return!1}return this.loadRowData(),!0}},DetailFrameworkComponentWrapper=class{constructor(e){this.parentWrapper=e}wrap(e,t,n,r){return this.parentWrapper.wrap(e,t,n,r)}},nv={tag:`div`,cls:`ag-details-row`},rv={tag:`div`,cls:`ag-details-row`,role:`gridcell`,children:[{tag:`div`,ref:`eDetailGrid`,cls:`ag-details-grid`,role:`presentation`}]},DetailCellRenderer=class extends K{constructor(){super(...arguments),this.eDetailGrid=null}wireBeans(e){this.context=e.context}init(e){this.params=e,this.selectAndSetTemplate();let t={toggleCss:(e,t)=>this.toggleCss(e,t),toggleDetailGridCss:(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 DetailCellRendererCtrl),this.ctrl.init(t,e)}refresh(){return this.ctrl?.refresh()??!1}selectAndSetTemplate(){let e=this.params;if(e.pinned){this.setTemplate(nv);return}let setDefaultTemplate=()=>{this.setTemplate(rv)};if(dl(e.template))setDefaultTemplate();else if(typeof e.template==`string`)this.setTemplate(e.template,[]);else if(typeof e.template==`function`){let t=e.template,n=t(e);this.setTemplate(n,[])}else q(168),setDefaultTemplate();this.eDetailGrid??q(169)}setDetailGrid(e){if(!this.eDetailGrid)return;let t=new DetailFrameworkComponentWrapper(this.context.getBean(`frameworkCompWrapper`)),{frameworkOverrides:n}=this.beans,r=Gc(this.eDetailGrid,e,{frameworkOverrides:n,providedBeanInstances:{frameworkCompWrapper:t},modules:il(this.params.api.getGridId(),e.rowModelType??`clientSide`)});this.detailApi=r,this.ctrl?.registerDetailWithMaster(r),this.addDestroyFunc(()=>{r.destroy()})}setRowData(e){this.detailApi?.setGridOption(`rowData`,e)}};function operateOnStore(e,t){let n=e.masterDetailSvc?.store;return n?t(n):void 0}function addDetailGridInfo(e,t,n){operateOnStore(e,e=>{e[t]=n})}function removeDetailGridInfo(e,t){operateOnStore(e,e=>{delete e[t]})}function getDetailGridInfo(e,t){return operateOnStore(e,e=>e[t])}function forEachDetailGridInfo(e,t){operateOnStore(e,e=>{let n=0;Object.values(e).forEach(e=>{e&&t(e,n++)})})}var iv=`.ag-details-row{width:100%}.ag-details-row-fixed-height{height:100%}.ag-details-grid{width:100%}.ag-details-grid-fixed-height{height:100%}`,MasterDetailService=class extends U{constructor(){super(...arguments),this.beanName=`masterDetailSvc`,this.store={}}isEnabled(){return!!this.gos.get(`masterDetail`)}postConstruct(){let e=this.gos;Rc(e)&&(this.enabled=this.isEnabled()),lc(e)&&this.addEventListeners()}addEventListeners(){let rowNodeDataChanged=e=>{this.setMaster(e.node,!1,!0)},e,addOrRemoveListeners=()=>{if(e){for(let t of e)t();e=void 0}this.isEnabled()&&(e=this.addManagedListeners(this.beans.eventSvc,{rowNodeDataChanged}))};addOrRemoveListeners(),this.gos.addPropertyEventListener(`masterDetail`,addOrRemoveListeners)}refreshModel(e){if(e.changedProps){let e=this.isEnabled();if(this.enabled!==e){this.setMasters(null);return}}
8e.rowDataUpdated&&this.setMasters(e.changedRowNodes)}setMaster(e,t,n){let r=e.master,i=this.isEnabled(),o=i,s=this.gos,c=s.get(`isRowMaster`),p=s.get(`treeData`);if(i){if(t||n){if(c){let t=e.data;o=!!t&&!!c(t)}}else o=r}let m=this.beans;p||(o&&t?e.expanded=_getRowDefaultExpanded(m,e,m.rowGroupColsSvc?.columns.length??0,!1):!o&&r&&(e.expanded=!1)),o!==r&&(e.master=o,e.dispatchRowEvent(`masterChanged`))}setMasters(e){if(this.enabled=this.isEnabled(),e){for(let t of e.updates)this.setMaster(t,!1,!0);for(let t of e.adds)this.setMaster(t,!0,!1)}else{let e=Za(this.beans)?.rootNode?._leafs;if(e)for(let t=0,n=e.length;t<n;++t)this.setMaster(e[t],!0,!1)}}getDetail(e){if(!e.master||!e.expanded)return null;let t=e.detailNode;return t||(t=new zc(this.beans),t.detail=!0,t.selectable=!1,t.parent=e,Xs(e.id)&&(t.id=`detail_`+e.id),t.data=e.data,t.level=e.level+1,e.detailNode=t,t)}setupDetailRowAutoHeight(e,t){let{gos:n,beans:r}=this;if(!n.get(`detailRowAutoHeight`))return;let checkRowSizeFunc=()=>{let r=t.clientHeight;if(r!=null&&r>0){let updateRowHeightFunc=()=>{let{rowModel:t}=this.beans,{rowNode:i}=e;i.setRowHeight(r),(Rc(n,t)||lc(n,t))&&t.onRowHeightChanged()};window.setTimeout(updateRowHeightFunc,0)}},i=Zc(r,t,checkRowSizeFunc);e.addDestroyFunc(i),checkRowSizeFunc()}destroy(){this.store={},super.destroy()}},av={moduleName:`MasterDetail`,version:Z,dependsOn:[{moduleName:`SharedMasterDetail`,version:Z,beans:[MasterDetailService],userComponents:{agDetailCellRenderer:DetailCellRenderer},dynamicBeans:{detailCellRendererCtrl:DetailCellRendererCtrl},apiFunctions:{addDetailGridInfo,removeDetailGridInfo,getDetailGridInfo,forEachDetailGridInfo},dependsOn:[fh,S_,T_],css:[iv]},w_,Yc]},AbstractSelectionHandle=class extends K{constructor(){super(...arguments),this.changedCalculatedValues=!1,this.dragging=!1,this.shouldDestroyOnEndDragging=!1}postConstruct(){let{dragSvc:e,rangeSvc:t}=this.beans;e.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragStart:this.onDragStart.bind(this),onDragging:e=>{this.dragging=!0,t.autoScrollService.check(e),this.changedCalculatedValues&&=(this.onDrag(e),!1)},onDragStop:e=>{this.dragging=!1,this.onDragEnd(e),this.clearDragProperties(),this.shouldDestroyOnEndDragging&&this.destroy()},onDragCancel:()=>{this.dragging=!1,this.onDragCancel(),this.clearDragProperties()}}),this.addManagedElementListeners(this.getGui(),{mousedown:this.preventRangeExtension.bind(this)})}getLastCellHovered(){return this.lastCellHovered}preventRangeExtension(e){e.stopPropagation()}onDragStart(e){[this.cellHoverListener]=this.addManagedElementListeners(this.beans.ctrlsSvc.get(`gridCtrl`).getGui(),{mousemove:this.updateValuesOnMove.bind(this)}),document.body.classList.add(this.getDraggingCssClass())}getDraggingCssClass(){return`ag-dragging-${this.type===0?`fill`:`range`}-handle`}updateValuesOnMove(e){let t=qo(this.gos,e);!t||this.shouldSkipCell(t)||this.lastCellHovered&&Fs(t,this.lastCellHovered)||(this.lastCellHovered=t,this.changedCalculatedValues=!0)}clearDragProperties(){this.clearValues(),this.beans.rangeSvc.autoScrollService.ensureCleared(),document.body.classList.remove(this.getDraggingCssClass())}getType(){return this.type}refresh(e){let t=this.cellCtrl,n=this.getGui(),r=Kc(this.beans.rangeSvc.getCellRanges()),i=r.startRow,o=r.endRow;if(i&&o&&(Ps(o,i)?(this.rangeStartRow=o,this.rangeEndRow=i):(this.rangeStartRow=i,this.rangeEndRow=o)),t!==e||!El(n)){this.cellCtrl=e;let t=e.comp.getParentOfValue();t&&t.appendChild(n)}this.cellRange=r}clearValues(){this.lastCellHovered=void 0,this.removeListeners()}removeListeners(){let e=this.cellHoverListener;e&&(e(),this.cellHoverListener=void 0)}destroy(){if(!this.shouldDestroyOnEndDragging&&this.dragging){W(this.getGui(),!1),this.shouldDestroyOnEndDragging=!0;return}this.shouldDestroyOnEndDragging=!1,super.destroy(),this.removeListeners(),this.getGui()?.remove()}};function findLineByLeastSquares(e){let t=e.length,n=0;if(t<=1)return e;for(let t=0;t<e.length;t++){let r=e[t],i=r.toString().split(`e-`);if(i.length>1){n=Math.max(n,parseInt(i[1],10));continue}Math.floor(r)!==r&&(n=Math.max(n,r.toString().split(`.`)[1].length))}let r=0,i=0,o=0,s=0,c=0;for(let n=0;n<t;n++)c=e[n],r+=n,i+=c,s+=n*n,o+=n*c;let p=(t*o-r*i)/(t*s-r*r),m=i/t-p*r/t,h=[];for(let e=0;e<=t;e++)h.push(parseFloat((e*p+m).toFixed(n)));return h}var ov={tag:`div`,cls:`ag-fill-handle`},AgFillHandle=class extends AbstractSelectionHandle{constructor(){super(ov),this.markedCells=[],this.cellValues=[],this.isUp=!1,this.isLeft=!1,this.isReduce=!1,this.type=0}
8postConstruct(){super.postConstruct(),this.addManagedElementListeners(this.getGui(),{dblclick:this.onDblClick.bind(this)})}onDblClick(e){ua(e);let{cellRange:t,rangeStartRow:n,beans:r}=this,{rangeSvc:i,visibleCols:o}=r,s=Rl(r);if(!s)return;let c=this.getFillHandleDirection();this.dragAxis=c===`xy`?`y`:c;let p=i?.createCellRangeFromCellRangeParams({rowStartIndex:n.rowIndex,rowStartPinned:n.rowPinned,columnStart:t.columns[0],rowEndIndex:this.dragAxis===`x`?t.endRow?.rowIndex??null:s.rowIndex,rowEndPinned:this.dragAxis===`x`?t.endRow?.rowPinned:s.rowPinned,columnEnd:this.dragAxis===`x`?Kc(o.allCols):Kc(t.columns)});this.isUp=!1,this.isLeft=!1,p&&this.performFill({event:e,initialRange:t,finalRange:p}),this.dragAxis=void 0}updateValuesOnMove(e){super.updateValuesOnMove(e),this.initialXY||=gc(this.beans,e);let{x:t,y:n}=this.initialXY,{x:r,y:i}=gc(this.beans,e),o=Math.abs(t-r),s=Math.abs(n-i),c=this.getFillHandleDirection(),p;p=c===`xy`?o>s?`x`:`y`:c,p!==this.dragAxis&&(this.dragAxis=p,this.changedCalculatedValues=!0)}shouldSkipCell(e){return yc(e.column)}onDrag(e){if(!this.initialPosition){let e=this.cellCtrl;if(!e)return;this.initialPosition=e.cellPosition}let t=this.getLastCellHovered();t&&this.markPathFrom(this.initialPosition,t)}onDragEnd(e){if(this.initialXY=null,!this.markedCells.length)return;let t=this.dragAxis===`x`,{cellRange:n,rangeStartRow:r,rangeEndRow:i,beans:{rangeSvc:o}}=this,s=n.columns.length,c;if(!this.isUp&&!this.isLeft)c=o.createCellRangeFromCellRangeParams({rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,columnStart:n.columns[0],rowEndIndex:t?i.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:t?i.rowPinned:this.lastCellMarked.rowPinned,columnEnd:t?this.lastCellMarked.column:n.columns[s-1]});else{let e=t?r:this.lastCellMarked;c=o.createCellRangeFromCellRangeParams({rowStartIndex:e.rowIndex,rowStartPinned:e.rowPinned,columnStart:t?this.lastCellMarked.column:n.columns[0],rowEndIndex:i.rowIndex,rowEndPinned:i.rowPinned,columnEnd:n.columns[s-1]})}c&&this.performFill({event:e,initialRange:n,finalRange:c,shouldUpdateRange:!0})}onDragCancel(){this.initialXY=null,this.markedCells.length&&this.clearMarkedPath()}performFill({event:e,initialRange:t,finalRange:n,shouldUpdateRange:r}){let{eventSvc:i,rangeSvc:o}=this.beans;i.dispatchEvent({type:`fillStart`}),this.handleValueChanged(t,n,e),r&&o.setCellRanges([n]),i.dispatchEvent({type:`fillEnd`,initialRange:t,finalRange:n})}getFillHandleDirection(){let e=Os(this.gos)?.direction;return e?e!==`x`&&e!==`y`&&e!==`xy`?(q(177),`xy`):e:`xy`}handleValueChanged(e,t,n){let{beans:r}=this,{rangeSvc:i,gos:o,valueSvc:s}=r,c=i.getRangeEndRow(e),p=i.getRangeStartRow(e),m=i.getRangeEndRow(t),h=i.getRangeStartRow(t),g=this.dragAxis===`y`;if(this.isReduce&&!Os(o)?.suppressClearOnFillReduction){let n=g?e.columns:e.columns.filter(e=>t.columns.indexOf(e)<0),i=g?Sc(r,m):h;i&&this.clearCellsInRange(i,c,n);return}let _=[],v=[],y=[],b=[],x=!0,S=0,resetValues=()=>{_.length=0,v.length=0,y.length=0,b.length=0,S=0},iterateAcrossCells=(t,n)=>{let i=this.isUp?c:p,o=!1;for(g&&(x=!0,resetValues());!o&&i;){let s=Ql(r,i);if(!s)break;if(g&&t)fillValues(_,t,s,()=>!fa(i,this.isUp?p:c));else if(n){x=!0,resetValues();for(let t of n)fillValues(_,t,s,()=>t!==(this.isLeft?e.columns[0]:Kc(e.columns)))}o=fa(i,this.isUp?h:m),i=this.isUp?Oc(this.beans,i):Sc(r,i)}},fillValues=(e,t,r,i)=>{let o,c=!1;if(x)o=s.getValue(t,r),v.push(o),y.push(s.getValue(t,r,!0)),b.push(s.formatValue(t,r,o)),x=i();else{let{value:i,fromUserFunction:p,sourceCol:m,sourceRowNode:h}=this.processValues({event:n,values:e,initialValues:v,initialNonAggregatedValues:y,initialFormattedValues:b,col:t,rowNode:r,idx:S++});if(o=i,t.isCellEditable(r)){let e=s.getValue(t,r);if(!p){if(m){let e=m.getColDef();if(e.useValueFormatterForExport!==!1&&e.valueFormatter){let e=s.formatValue(m,h,o);e!=null&&(o=e)}}t.getColDef().useValueParserForImport!==!1&&(o=s.parseValue(t,r,m?o:Al(o),e))}!p||e!==o?r.setDataValue(t,o,`rangeSvc`):c=!0}}c||e.push({value:o,column:t,rowNode:r})};g?e.columns.forEach(e=>{iterateAcrossCells(e)}):iterateAcrossCells(void 0,this.isLeft?[...t.columns].reverse():t.columns),this.beans.editSvc?.stopEditing(void 0,{source:`fillHandle`})}clearCellsInRange(e,t,n){let r={startRow:e,endRow:t,columns:n,startColumn:n[0]};this.beans.rangeSvc.clearCellRangeCellValues({cellRanges:[r]})}processValues(e){let{event:t,values:n,initialValues:r,initialNonAggregatedValues:i,initialFormattedValues:o,col:s,rowNode:c,idx:p}=e,m=Os(this.gos)?.setFillValue,h=this.dragAxis===`y`,g;if(g=h?this.isUp?`up`:`down`:this.isLeft?`left`:`right`,m){let e=m(co(this.gos,{event:t,values:n.map(({value:e})=>e),initialValues:r,initialNonAggregatedValues:i,initialFormattedValues:o,currentIndex:p,currentCellValue:this.beans.valueSvc.getValue(s,c),direction:g,column:s,rowNode:c}));if(e!==!1)return{value:e,fromUserFunction:!0}}let _=!n.some(({value:e})=>{let t=parseFloat(e);return isNaN(t)||t.toString()!==e.toString()});if(t.altKey||!_){if(_&&r.length===1){let e=this.isUp||this.isLeft?-1:1;return{value:parseFloat(Kc(n).value)+1*e,fromUserFunction:!1}}let{value:e,column:t,rowNode:i}=n[p%n.length];return{value:e,fromUserFunction:!1,sourceCol:t,sourceRowNode:i}}return{value:Kc(findLineByLeastSquares(n.map(({value:e})=>Number(e)))),fromUserFunction:!1}}
8clearValues(){this.clearMarkedPath(),this.clearCellValues(),this.lastCellMarked=void 0,super.clearValues()}clearMarkedPath(){for(let e of this.markedCells){if(!e.isAlive())continue;let{comp:t}=e;t.toggleCss(`ag-selection-fill-top`,!1),t.toggleCss(`ag-selection-fill-right`,!1),t.toggleCss(`ag-selection-fill-bottom`,!1),t.toggleCss(`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(),this.dragAxis===`y`){if(fa(t,e))return;let n=Ps(t,e),{rangeStartRow:r,rangeEndRow:i}=this;n&&(t.rowPinned==r.rowPinned&&t.rowIndex>=r.rowIndex||r.rowPinned!=i.rowPinned&&t.rowPinned==i.rowPinned&&t.rowIndex<=i.rowIndex)?(this.reduceVertical(e,t),this.isReduce=!0):(this.extendVertical(e,t,n),this.isReduce=!1)}else{let n=e.column,r=t.column;if(n===r)return;let i=this.beans.visibleCols.allCols,o=i.indexOf(n),s=i.indexOf(r);s<=o&&s>=i.indexOf(this.cellRange.columns[0])?(this.reduceHorizontal(e,t),this.isReduce=!0):(this.extendHorizontal(e,t,s<o),this.isReduce=!1)}this.lastCellMarked=t}extendVertical(e,t,n){let r=this.beans,{rangeSvc:i}=r,o=e;do{let s=this.cellRange,c=s.columns.length;for(let p=0;p<c;p++){let m=s.columns[p],h={rowIndex:o.rowIndex,rowPinned:o.rowPinned,column:m},g=i.isCellInSpecificRange(h,s),_=fa(o,e);if(n&&(this.isUp=!0),!_){let e=no(r,h);if(e){this.markedCells.push(e);let r=e.comp;g||(r.toggleCss(`ag-selection-fill-left`,p===0),r.toggleCss(`ag-selection-fill-right`,p===c-1)),r.toggleCss(n?`ag-selection-fill-top`:`ag-selection-fill-bottom`,fa(o,t))}}}if(fa(o,t))break}while(o=n?Oc(this.beans,o):Sc(r,o))}reduceVertical(e,t){let n=e,r=this.beans;do{let e=this.cellRange,i=e.columns.length,o=fa(n,t);for(let o=0;o<i;o++){let i={rowIndex:n.rowIndex,rowPinned:n.rowPinned,column:e.columns[o]},s=no(r,i);s&&(this.markedCells.push(s),s.comp.toggleCss(`ag-selection-fill-bottom`,fa(n,t)))}if(o)break}while(n=Oc(r,n))}extendHorizontal(e,t,n){let r=this.beans,{visibleCols:i}=r,o=i.allCols,s=o.indexOf(n?t.column:e.column),c=o.indexOf(n?this.cellRange.columns[0]:t.column),p=+!n,m=o.slice(s+p,c+p),{rangeStartRow:h,rangeEndRow:g}=this;for(let e of m){let t=h,i=!1;do{i=fa(t,g);let o=no(r,{rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:e});if(o){this.markedCells.push(o);let r=o.comp;r.toggleCss(`ag-selection-fill-top`,fa(t,h)),r.toggleCss(`ag-selection-fill-bottom`,fa(t,g)),n?(this.isLeft=!0,r.toggleCss(`ag-selection-fill-left`,e===m[0])):r.toggleCss(`ag-selection-fill-right`,e===Kc(m))}t=Sc(r,t)}while(!i)}}reduceHorizontal(e,t){let n=this.beans,{visibleCols:r}=n,i=r.allCols,o=i.indexOf(t.column),s=i.indexOf(e.column),c=i.slice(o,s),{rangeStartRow:p,rangeEndRow:m}=this;for(let e of c){let t=p,r=!1;do{r=fa(t,m);let i=no(this.beans,{rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:e});i&&(this.markedCells.push(i),i.comp.toggleCss(`ag-selection-fill-right`,e===c[0])),t=Sc(n,t)}while(!r)}}refresh(e){let t=this.beans.rangeSvc.getCellRanges()[0];if(!t.startRow||!t.endRow){this.destroy();return}super.refresh(e)}},AgRangeHandle=class extends AbstractSelectionHandle{constructor(){super({tag:`div`,cls:`ag-range-handle`}),this.type=1,this.rangeFixed=!1}onDrag(e){let t=this.getLastCellHovered();if(!t)return;let n=this.beans.rangeSvc,r=n.getCellRanges(),i=Kc(r);this.rangeFixed||=(this.fixRangeStartEnd(i),!0),this.endPosition={rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:t.column},r.length===2&&r[0].type===Ds.DIMENSION&&i.type===Ds.VALUE&&(fa(this.endPosition,n.getRangeEndRow(i))||n.updateRangeRowBoundary({cellRange:r[0],boundary:`end`,cellPosition:{...this.endPosition,column:r[0].columns[0]},silent:!0})),n.extendLatestRangeToCell(this.endPosition)}shouldSkipCell(e){return!1}onDragEnd(e){let t=Kc(this.beans.rangeSvc.getCellRanges());this.fixRangeStartEnd(t),this.rangeFixed=!1}onDragCancel(){this.rangeFixed=!1}fixRangeStartEnd(e){let t=this.beans.rangeSvc,n=t.getRangeStartRow(e),r=t.getRangeEndRow(e),i=e.columns[0];e.startRow=n,e.endRow=r,e.startColumn=i}},sv=`.ag-body-viewport:not(.ag-has-focus) .ag-cell-range-single-cell:not(.ag-cell-inline-editing),.ag-cell-range-selected.ag-cell-range-chart,.ag-cell-range-selected:not(.ag-cell-focus){background-color:var(--ag-range-selection-background-color);&.ag-cell-range-chart{background-color:var(--ag-range-selection-chart-background-color)!important;&.ag-cell-range-chart-category{background-color:var(--ag-range-selection-chart-category-background-color)!important}}}.ag-cell-range-selected-1.ag-cell-range-chart,.ag-cell-range-selected-1:not(.ag-cell-focus),.ag-root:not(.ag-context-menu-open) .ag-body-viewport:not(.ag-has-focus) .ag-cell-range-selected-1:not(.ag-cell-inline-editing){background-color:var(--ag-range-selection-background-color)}.ag-cell-range-selected-2.ag-cell-range-chart,.ag-cell-range-selected-2:not(.ag-cell-focus){background-image:linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color))}.ag-cell-range-selected-3.ag-cell-range-chart,.ag-cell-range-selected-3:not(.ag-cell-focus){background-image:linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color)),linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color))}.ag-cell-range-selected-4.ag-cell-range-chart,.ag-cell-range-selected-4:not(.ag-cell-focus){background-image:linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color)),linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color)),linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color))}.ag-cell.ag-cell-range-selected:not(.ag-cell-range-single-cell){&.ag-cell-range-top{border-top-color:var(--ag-range-selection-border-color);border-top-style:var(--ag-range-selection-border-style)}&.ag-cell-range-right{border-right-color:var(--ag-range-selection-border-color);border-right-style:var(--ag-range-selection-border-style)}&.ag-cell-range-bottom{border-bottom-color:var(--ag-range-selection-border-color);border-bottom-style:var(--ag-range-selection-border-style)}&.ag-cell-range-left{border-left-color:var(--ag-range-selection-border-color);border-left-style:var(--ag-range-selection-border-style)}}.ag-cell.ag-selection-fill-top,.ag-cell.ag-selection-fill-top.ag-cell-range-selected{border-top:1px dashed;border-top-color:var(--ag-range-selection-border-color)}:where(.ag-ltr) .ag-cell.ag-selection-fill-right,:where(.ag-ltr) .ag-cell.ag-selection-fill-right.ag-cell-range-selected{border-right:1px dashed var(--ag-range-selection-border-color)!important}:where(.ag-rtl) .ag-cell.ag-selection-fill-right,:where(.ag-rtl) .ag-cell.ag-selection-fill-right.ag-cell-range-selected{border-left:1px dashed var(--ag-range-selection-border-color)!important}.ag-cell.ag-selection-fill-bottom,.ag-cell.ag-selection-fill-bottom.ag-cell-range-selected{border-bottom:1px dashed;border-bottom-color:var(--ag-range-selection-border-color)}:where(.ag-ltr) .ag-cell.ag-selection-fill-left,:where(.ag-ltr) .ag-cell.ag-selection-fill-left.ag-cell-range-selected{border-left:1px dashed var(--ag-range-selection-border-color)!important}:where(.ag-rtl) .ag-cell.ag-selection-fill-left,:where(.ag-rtl) .ag-cell.ag-selection-fill-left.ag-cell-range-selected{border-right:1px dashed var(--ag-range-selection-border-color)!important}.ag-fill-handle,.ag-range-handle{background-color:var(--ag-range-selection-border-color);bottom:-1px;height:6px;position:absolute;width:6px}:where(.ag-ltr) .ag-fill-handle,:where(.ag-ltr) .ag-range-handle{right:-1px}:where(.ag-rtl) .ag-fill-handle,:where(.ag-rtl) .ag-range-handle{left:-1px}.ag-fill-handle{cursor:crosshair}:where(.ag-ltr) .ag-range-handle{cursor:nwse-resize}:where(.ag-rtl) .ag-range-handle{cursor:nesw-resize}`;function getCellRanges(e){return e.rangeSvc?.getCellRanges()??null}function addCellRange(e,t){e.rangeSvc?.addCellRange(t)}function clearRangeSelection(e){e.rangeSvc?.removeAllCellRanges()}var cv=`ag-cell-range-selected`,lv=`ag-cell-range-chart`,uv=`ag-cell-range-single-cell`,dv=`ag-cell-range-chart-category`,fv=`ag-cell-range-handle`,pv=`ag-cell-range-top`,mv=`ag-cell-range-right`,hv=`ag-cell-range-bottom`,gv=`ag-cell-range-left`;function _isRangeHandleEnabled(e){let t=e.get(`cellSelection`);return t===void 0?e.get(`enableRangeHandle`):typeof t!=`boolean`&&t.handle?.mode===`range`}function _isFillHandleEnabled(e){let t=e.get(`cellSelection`);return t===void 0?e.get(`enableFillHandle`):typeof t!=`boolean`&&t.handle?.mode===`fill`}var CellRangeFeature=class{constructor(e,t){this.beans=e,this.cellCtrl=t,this.rangeSvc=e.rangeSvc}setComp(e){this.cellComp=e,this.eGui=this.cellCtrl.eGui,this.onCellSelectionChanged()}unsetComp(){this.beans.context.destroyBean(this.selectionHandle)}onCellSelectionChanged(){let e=this.cellComp;if(!e)return;let{rangeSvc:t,cellCtrl:n,eGui:r}=this,i=t.getCellRangeCount(n.cellPosition);this.rangeCount=i;let o=this.getHasChartRange();this.hasChartRange=o,e.toggleCss(cv,i!==0),e.toggleCss(`${cv}-1`,i===1),e.toggleCss(`${cv}-2`,i===2),e.toggleCss(`${cv}-3`,i===3),e.toggleCss(`${cv}-4`,i>=4),e.toggleCss(lv,o),Ga(r,i>0||void 0),e.toggleCss(uv,this.isSingleCell()),this.updateRangeBorders(),this.refreshHandle()}updateRangeBorders(){let e=this.getRangeBorders(),t=this.isSingleCell(),n=!t&&e.top,r=!t&&e.right,i=!t&&e.bottom,o=!t&&e.left,s=this.cellComp;s.toggleCss(pv,n),s.toggleCss(mv,r),s.toggleCss(hv,i),s.toggleCss(gv,o)}isSingleCell(){let{rangeSvc:e}=this;return this.rangeCount===1&&!!e&&!e.isMoreThanOneCell()}getHasChartRange(){let{rangeSvc:e}=this;if(!this.rangeCount||!e)return!1;let t=e.getCellRanges();return t.length>0&&t.every(e=>[Ds.DIMENSION,Ds.VALUE].includes(e.type))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())}getRangeBorders(){let e=this.beans.gos.get(`enableRtl`),t=!1,n=!1,r=!1,i=!1,{rangeSvc:o,beans:{visibleCols:s},cellCtrl:{cellPosition:c}}=this,p=c.column,m=o.getCellRanges().filter(e=>o.isCellInSpecificRange(c,e));if(!m.length)return{top:t,right:n,bottom:r,left:i};let h,g;e?(h=s.getColAfter(p),g=s.getColBefore(p)):(h=s.getColBefore(p),g=s.getColAfter(p)),h||(i=!0),g||(n=!0);for(let e=0;e<m.length&&!(t&&n&&r&&i);e++){let s=m[e],p=o.getRangeStartRow(s),_=o.getRangeEndRow(s);!t&&fa(p,c)&&(t=!0),!r&&fa(_,c)&&(r=!0),!i&&h&&s.columns.indexOf(h)<0&&(i=!0),!n&&g&&s.columns.indexOf(g)<0&&(n=!0)}return{top:t,right:n,bottom:r,left:i}}refreshHandle(){let{context:e}=this.beans;if(e.isDestroyed())return;let t=this.shouldHaveSelectionHandle();this.selectionHandle&&!t&&(this.selectionHandle=e.destroyBean(this.selectionHandle)),t&&this.addSelectionHandle(),this.cellComp.toggleCss(fv,!!this.selectionHandle)}shouldHaveSelectionHandle(){let{gos:e,editSvc:t}=this.beans,n=this.rangeSvc,r=n.getCellRanges(),i=r.length;if(this.rangeCount<1||i<1)return!1;let o=Kc(r),{cellPosition:s,column:c}
8=this.cellCtrl,p=_isFillHandleEnabled(e)&&!c.isSuppressFillHandle(),m=_isRangeHandleEnabled(e),h=t?.isEditing(this.cellCtrl,{withOpenEditor:!0}),g=i===1&&!h&&(p||m);if(this.hasChartRange){let e=r[0].type===Ds.DIMENSION&&n.isCellInSpecificRange(s,r[0]);this.cellComp.toggleCss(dv,e),g=o.type===Ds.VALUE}return g&&o.endRow!=null&&n.isContiguousRange(o)&&n.isBottomRightCell(o,s)}addSelectionHandle(){let{beans:e,rangeSvc:t}=this,n=Kc(t.getCellRanges()).type,r=_isFillHandleEnabled(e.gos)&&dl(n)?0:1;if(this.selectionHandle&&this.selectionHandle.getType()!==r&&(this.selectionHandle=e.context.destroyBean(this.selectionHandle)),!this.selectionHandle){let t=e.registry.createDynamicBean(r===0?`fillHandle`:`rangeHandle`,!1);t&&(this.selectionHandle=e.context.createBean(t))}this.selectionHandle?.refresh(this.cellCtrl)}destroy(){this.unsetComp()}},DragListenerFeature=class extends U{constructor(e){super(),this.eContainer=e}postConstruct(){let{beans:e,gos:t,eContainer:n}=this,r=e.rangeSvc,i={eElement:n,onDragStart:r.onDragStart.bind(r),onDragStop:r.onDragStop.bind(r),onDragging:r.onDragging.bind(r)},o=e.dragSvc,s=o.addDragSource.bind(o,i),c=o.removeDragSource.bind(o,i);this.addManagedPropertyListeners([`enableRangeSelection`,`cellSelection`],()=>{_a(t)?s():c()}),this.addDestroyFunc(c),_a(t)&&s()}},RangeHeaderHighlightFeature=class extends U{constructor(e,t){super(),this.column=e,this.comp=t,this.columnMap=new Map,this.isActive=!1,this.resetColumnMap()}postConstruct(){this.addManagedPropertyListener(`cellSelection`,()=>{this.refreshActive()}),this.refreshActive(),this.setupRangeHeaderHighlight()}resetColumnMap(){this.columnMap.clear();let e;e=this.column.isColumn?[this.column]:this.column.getDisplayedLeafColumns();for(let t of e)this.columnMap.set(t,!1)}refreshActive(){let{gos:e,rangeSvc:t}=this.beans,n=e.get(`cellSelection`);this.isActive=!!(n&&t&&typeof n==`object`&&n.enableHeaderHighlight)}setupRangeHeaderHighlight(){let e=this.onRangeSelectionChanged.bind(this);this.addManagedEventListeners({rangeSelectionChanged:e,columnPinned:e,columnMoved:e,columnGroupOpened:e}),e()}onRangeSelectionChanged(){if(!this.isActive)return;this.resetColumnMap();let e=this.beans.rangeSvc.getCellRanges(),t=!1,n=!0;for(let n of e){if(t)break;for(let e of n.columns)this.columnMap.has(e)&&(this.columnMap.set(e,!0),t||=!0)}for(let e of Array.from(this.columnMap.values()))if(e===!1){n=!1;break}this.comp.toggleCss(`ag-header-range-highlight`,t&&n)}destroy(){super.destroy(),this.comp=null,this.column=null}},RangeService=class extends U{constructor(){super(...arguments),this.beanName=`rangeSvc`,this.cellRanges=[],this.bodyScrollListener=this.onBodyScroll.bind(this),this.dragging=!1,this.intersectionRange=!1}wireBeans(e){this.rowModel=e.rowModel,this.dragSvc=e.dragSvc,this.colModel=e.colModel,this.visibleCols=e.visibleCols,this.cellNavigation=e.cellNavigation,this.ctrlsSvc=e.ctrlsSvc,this.valueSvc=e.valueSvc}postConstruct(){let e=this.onColumnsChanged.bind(this),removeAllCellRanges=()=>this.removeAllCellRanges(),t=this.refreshLastRangeStart.bind(this);this.addManagedEventListeners({newColumnsLoaded:e,columnVisible:e,columnValueChanged:e,columnPivotModeChanged:removeAllCellRanges,columnRowGroupChanged:removeAllCellRanges,columnPivotChanged:removeAllCellRanges,columnGroupOpened:t,columnMoved:t,columnPinned:t}),this.ctrlsSvc.whenReady(this,e=>{let t=e.gridBodyCtrl;
8this.autoScrollService=new ss({scrollContainer:t.eBodyViewport,scrollAxis:`xy`,getVerticalPosition:()=>t.scrollFeature.getVScrollPosition().top,setVerticalPosition:e=>t.scrollFeature.setVerticalScrollPosition(e),getHorizontalPosition:()=>t.scrollFeature.getHScrollPosition().left,setHorizontalPosition:e=>t.scrollFeature.setHorizontalScrollPosition(e),shouldSkipVerticalScroll:()=>!Ha(this.gos,`normal`),shouldSkipHorizontalScroll:()=>!t.scrollFeature.isHorizontalScrollShowing()})})}onDragStart(e){let t=this.gos;if(!_a(t)||Bs(t,e.target)?.isSuppressMouseEvent(e))return;let{ctrlKey:n,metaKey:r,shiftKey:i}=e,o=n||r,s=!as(t)&&o,c=i&&!!this.cellRanges?.length;!s&&(!c||Xs(Kc(this.cellRanges).type))&&this.removeAllCellRanges(!0);let p=this.dragSvc.startTarget;if(p&&this.updateValuesOnMove(p),this.lastCellHovered){if(this.dragging=!0,this.lastMouseEvent=e,this.intersectionRange=s&&this.getCellRangeCount(this.lastCellHovered)>1,c||this.setNewestRangeStartCell(this.lastCellHovered),this.cellRanges.length>0)this.draggingRange=Kc(this.cellRanges);else{let e={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned},t=this.getColumnsFromModel([this.lastCellHovered.column]);if(!t?.length)return;this.draggingRange={startRow:e,endRow:e,columns:t,startColumn:this.newestRangeStartCell.column},this.cellRanges.push(this.draggingRange)}this.ctrlsSvc.getGridBodyCtrl().eBodyViewport.addEventListener(`scroll`,this.bodyScrollListener,{passive:!0}),this.dispatchChangedEvent(!0,!1,this.draggingRange.id)}}onDragging(e){let{dragging:t,lastCellHovered:n,newestRangeStartCell:r,autoScrollService:i,cellHasChanged:o}=this;if(!t||!e)return;this.updateValuesOnMove(e.target),this.lastMouseEvent=e;let isMouseAndStartInPinned=e=>n&&n.rowPinned===e&&r.rowPinned===e,s=isMouseAndStartInPinned(`top`)||isMouseAndStartInPinned(`bottom`);if(i.check(e,s),!o||!n)return;let c=r?.column,p=n?.column,m=this.calculateColumnsBetween(c,p);if(!m)return;let{rowIndex:h,rowPinned:g}=n;this.draggingRange.endRow={rowIndex:h,rowPinned:g},this.draggingRange.columns=m,this.dispatchChangedEvent(!1,!1,this.draggingRange.id)}onDragStop(){if(!this.dragging)return;let{id:e}=this.draggingRange;this.autoScrollService.ensureCleared(),this.ctrlsSvc.getGridBodyCtrl().eBodyViewport.removeEventListener(`scroll`,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)}onColumnsChanged(){this.refreshLastRangeStart();let e=this.visibleCols.allCols;for(let t of this.cellRanges){let n=t.columns;t.columns=t.columns.filter(t=>t.isVisible()&&e.indexOf(t)!==-1),pa(n,t.columns)||this.dispatchChangedEvent(!1,!0,t.id)}let t=this.cellRanges.length;this.cellRanges=this.cellRanges.filter(e=>e.columns.length>0),t>this.cellRanges.length&&this.dispatchChangedEvent(!1,!0)}refreshLastRangeStart(){let e=Kc(this.cellRanges);e&&this.refreshRangeStart(e)}isContiguousRange(e){let t=e.columns;if(!t.length)return!1;let n=this.visibleCols.allCols,r=t.map(e=>n.indexOf(e)).sort((e,t)=>e-t);return Kc(r)-r[0]+1===t.length}getRangeStartRow(e){return e.startRow&&e.endRow?Ps(e.startRow,e.endRow)?e.startRow:e.endRow:{rowIndex:0,rowPinned:(this.beans.pinnedRowModel?.getPinnedTopRowCount()??0)>0?`top`:null}}getRangeEndRow(e){if(e.startRow&&e.endRow)return Ps(e.startRow,e.endRow)?e.endRow:e.startRow;let t=this.beans.pinnedRowModel?.getPinnedBottomRowCount()??0;return t>0?{rowIndex:t-1,rowPinned:`bottom`}:{rowIndex:this.rowModel.getRowCount()-1,rowPinned:null}}getRangeRowCount(e){let t=this.beans,n=this.getRangeStartRow(e),r=this.getRangeEndRow(e),i=So(t,n);return So(t,r)-i+1}setRangeToCell(e,t=!1){let{gos:n}=this;if(!_a(n))return;let r=n.get(`rowNumbers`),i=yc(e.column);r&&this.setSelectionMode(i);let o=this.calculateColumnsBetween(e.column,e.column);if(!o)return;(as(this.gos)||!t||dl(this.cellRanges))&&this.removeAllCellRanges(!0);let s={rowIndex:e.rowIndex,rowPinned:e.rowPinned},c={startRow:s,endRow:s,columns:o,startColumn:e.column};this.cellRanges.push(c),this.setNewestRangeStartCell(e),this.onDragStop(),this.dispatchChangedEvent(!0,!0)}getRangeLastColumn(e){let t=e.columns[0],n=Kc(e.columns);return this.newestRangeStartCell?.column===t?n:t}extendRangeRowCountBy(e,t){let{beans:n}=this,{startRow:r,endRow:i}=e;if(!r||!i)return;let o=0,s,c=Ps(i,r);s=c?r:i;let p=t>0?Sc:Oc,m=Math.abs(t);for(;o<m;){let e=p(n,s);if(!e)break;s=e,o++}if(o!==m)return;let h={...s,column:this.getRangeLastColumn(e)};this.updateRangeRowBoundary({cellRange:e,boundary:c?`start`:`end`,cellPosition:h})}
8extendRangeColumnCountBy(e,t){let{columns:n,startColumn:r}=e;if(t===0)return;let i=this.getColumnsFromModel();if(!i)return;let o=Kc(n),s=r===n[0]?o:n[0];if(!o||!s)return;let c=i.indexOf(r),p=i.indexOf(s),m=p<c;m&&(c=p);let h=n.length+t;if(h<=0)return;let g=[];for(let e=c;e<c+h;e++){let t=i[e];if(!t)break;g.push(t)}if(g.length===h){if(m){let t=Kc(g);e.startColumn=t,this.focusCellOnNewColumn(e,t)}e.columns=g,this.dispatchChangedEvent(!0,!0,e.id)}}extendLatestRangeToCell(e){if(this.isEmpty()||!this.newestRangeStartCell)return;let t=Kc(this.cellRanges);this.setSelectionMode(yc(e.column)),this.updateRangeRowBoundary({cellRange:t,boundary:`end`,cellPosition:e})}updateRangeRowBoundary(e){let{cellRange:t,boundary:n,cellPosition:r,silent:i=!1}=e,o=r.column,s=this.calculateColumnsBetween(t.startColumn,o);!s||this.isLastCellOfRange(t,r)||(n===`start`&&this.focusCellOnNewRow(t,r),t.columns=s,t[n===`start`?`startRow`:`endRow`]={rowIndex:r.rowIndex,rowPinned:r.rowPinned},i||this.dispatchChangedEvent(!0,!0,t.id))}getRangeEdgeColumns(e){let t=this.visibleCols.allCols,n=e.columns.map(e=>t.indexOf(e)).filter(e=>e>-1).sort((e,t)=>e-t);return{left:t[n[0]],right:t[Kc(n)]}}extendLatestRangeInDirection(e){if(this.isEmpty()||!this.newestRangeStartCell)return;let t=e.key,n=e.ctrlKey||e.metaKey,r=Kc(this.cellRanges),i=this.newestRangeStartCell,o=r.endRow.rowIndex,s=r.endRow.rowPinned,c={column:this.getRangeLastColumn(r),rowIndex:o,rowPinned:s},p=this.cellNavigation.getNextCellToFocus(t,c,n);if(p)return this.setCellRange({rowStartIndex:i.rowIndex,rowStartPinned:i.rowPinned,rowEndIndex:p.rowIndex,rowEndPinned:p.rowPinned,columnStart:i.column,columnEnd:p.column}),p}setCellRange(e){_a(this.gos)&&(this.removeAllCellRanges(!0),this.addCellRange(e))}setCellRanges(e){if(!pa(this.cellRanges,e)&&this.verifyCellRanges(this.gos)){this.removeAllCellRanges(!0);for(let t of e){if(t.columns&&t.startRow){let e=this.getColumnsFromModel(t.columns);if(!e||e.length===0)continue;t.columns=e;let{startRow:n}=t;this.setNewestRangeStartCell({rowIndex:n.rowIndex,rowPinned:n.rowPinned,column:t.columns[0]})}this.cellRanges.push(t)}this.dispatchChangedEvent(!1,!0)}}clearCellRangeCellValues(e){let{beans:t,valueSvc:n,eventSvc:r}=this,{cellEventSource:i=`rangeSvc`,dispatchWrapperEvents:o,wrapperEventSource:s=`deleteKey`}=e,{cellRanges:c}=e;o&&(r.dispatchEvent({type:`cellSelectionDeleteStart`,source:s}),r.dispatchEvent({type:`rangeDeleteStart`,source:s})),c||=this.cellRanges;for(let e of c)this.forEachRowInRange(e,r=>{let o=Ql(t,r);if(o)for(let t=0;t<e.columns.length;t++){let r=this.getColumnFromModel(e.columns[t]);if(!r?.isCellEditable(o))continue;let s=n.getDeleteValue(r,o);o.setDataValue(r,s,i)}});o&&(r.dispatchEvent({type:`cellSelectionDeleteEnd`,source:s}),r.dispatchEvent({type:`rangeDeleteEnd`,source:s}))}createCellRangeFromCellRangeParams(e){return this.createPartialCellRangeFromRangeParams(e,!1)}createPartialCellRangeFromRangeParams(e,t){let{columns:n,columnStart:r,columnEnd:i,rowStartIndex:o,rowStartPinned:s,rowEndIndex:c,rowEndPinned:p}=e,m=this.getColumnsFromParams(n,r,i);if(!m||!t&&m.columns.length===0)return;let{columns:h,startsOnTheRight:g}=m;return{startRow:this.createRowPosition(o,s),endRow:this.createRowPosition(c,p),columns:h,startColumn:this.getColumnFromModel(r)??(g?Kc(h):h[0])}}addCellRange(e){let t=this.gos;if(!_a(t)||!this.verifyCellRanges(t))return;this.setSelectionMode(!1);let n=this.createCellRangeFromCellRangeParams(e);n&&(n.startRow&&this.setNewestRangeStartCell({rowIndex:n.startRow.rowIndex,rowPinned:n.startRow.rowPinned,column:n.startColumn}),this.cellRanges.push(n),this.dispatchChangedEvent(!1,!0,n.id))}getCellRanges(){return this.cellRanges}isEmpty(){return this.cellRanges.length===0}isMoreThanOneCell(){let e=this.cellRanges.length;if(e===0)return!1;if(e>1)return!0;let t=this.cellRanges[0],n=this.getRangeStartRow(t),r=this.getRangeEndRow(t);return n.rowPinned!==r.rowPinned||n.rowIndex!==r.rowIndex||t.columns.length!==1}areAllRangesAbleToMerge(){let e=new Map;if(this.cellRanges.length<=1)return!0;for(let t of this.cellRanges)this.forEachRowInRange(t,n=>{let r=`${n.rowPinned||`normal`}_${n.rowIndex}`,i=e.get(r),o=t.columns.map(e=>e.getId());if(i){let e=o.filter(e=>i.indexOf(e)===-1);i.push(...e)}else e.set(r,o)});let t;for(let n of e.values()){let e=n.sort().join();if(t===void 0){t=e;continue}if(t!==e)return!1}return!0}removeAllCellRanges(e){this.isEmpty()||(this.onDragStop(),this.cellRanges.length=0,e||this.dispatchChangedEvent(!1,!0))}isCellInAnyRange(e){return this.getCellRangeCount(e)>0}isCellInSpecificRange(e,t){let n=t.columns?.includes(e.column),r=this.isRowInRange(e.rowIndex,e.rowPinned,t);return n&&r}isBottomRightCell(e,t){let n=this.visibleCols.allCols,r=e.columns.map(e=>n.indexOf(e)).sort((e,t)=>
8e-t),{startRow:i,endRow:o}=e,s=Ps(i,o)?o:i,c=n.indexOf(t.column)===Kc(r),p=t.rowIndex===s.rowIndex&&ic(t.rowPinned)===ic(s.rowPinned);return c&&p}getCellRangeCount(e){return this.isEmpty()?0:this.cellRanges.filter(t=>this.isCellInSpecificRange(e,t)).length}isRowInRange(e,t,n){let r=this.getRangeStartRow(n),i=this.getRangeEndRow(n),o={rowIndex:e,rowPinned:t||null},s=o.rowIndex===r.rowIndex&&o.rowPinned==r.rowPinned,c=o.rowIndex===i.rowIndex&&o.rowPinned==i.rowPinned;if(s||c)return!0;let p=!Ps(o,r),m=Ps(o,i);return p&&m}intersectLastRange(e){if(e&&this.dragging||as(this.gos)||this.isEmpty())return;let t=Kc(this.cellRanges),n=this.getRangeStartRow(t),r=this.getRangeEndRow(t),i=[];for(let e of this.cellRanges.slice(0,-1)){let o=this.getRangeStartRow(e),s=this.getRangeEndRow(e),c=e.columns,p=c.filter(e=>t.columns.indexOf(e)===-1);if(p.length===c.length){i.push(e);continue}if(Ps(r,o)||Ps(s,n)){i.push(e);continue}let m=i.length;if(Ps(o,n)){let e={columns:[...c],startColumn:t.startColumn,startRow:{...o},endRow:Oc(this.beans,n)};i.push(e)}if(p.length>0){let e={columns:p,startColumn:p.includes(t.startColumn)?t.startColumn:p[0],startRow:this.rowMax([{...n},{...o}]),endRow:this.rowMin([{...r},{...s}])};i.push(e)}Ps(r,s)&&i.push({columns:[...c],startColumn:t.startColumn,startRow:Sc(this.beans,r),endRow:{...s}}),i.length-m===1&&(i[i.length-1].id=e.id)}this.cellRanges=i,e&&this.dispatchChangedEvent(!1,!0)}createRangeHighlightFeature(e,t,n){e.createManagedBean(new RangeHeaderHighlightFeature(t,n))}setSelectionMode(e){this.selectionMode=+!!e}refreshRangeStart(e){let{startColumn:t,columns:n}=e,moveColInCellRange=(t,n)=>{let r=e.columns.filter(e=>e!==t);t?(e.startColumn=t,e.columns=n?[t,...r]:[...r,t]):e.columns=r},{left:r,right:i}=this.getRangeEdgeColumns(e);if(t===n[0]&&t!==r){moveColInCellRange(r,!0);return}t===Kc(n)&&t===i&&moveColInCellRange(i,!1)}setNewestRangeStartCell(e){this.newestRangeStartCell=e}getColumnsFromParams(e,t,n){let r=!e&&!t&&!n,i,o=!1;return r||e?i=this.getColumnsFromModel(r?void 0:e):t&&n&&(i=this.calculateColumnsBetween(t,n),i?.length&&(o=i[0]!==this.getColumnFromModel(t))),i?{columns:i,startsOnTheRight:o}:void 0}createRowPosition(e,t){return e==null?void 0:{rowIndex:e,rowPinned:t}}verifyCellRanges(e){let t=Us(e)&&as(e)&&this.cellRanges.length>1;return t&&q(93),!t}forEachRowInRange(e,t){let n=this.getRangeStartRow(e),r=this.getRangeEndRow(e),i=n;for(;i&&(t(i),!fa(i,r));)i=Sc(this.beans,i)}onBodyScroll(){this.dragging&&this.lastMouseEvent&&this.onDragging(this.lastMouseEvent)}isLastCellOfRange(e,t){let{startRow:n,endRow:r}=e,i=Ps(n,r)?r:n,o=t.rowIndex===i.rowIndex&&t.rowPinned===i.rowPinned,s=e.columns[0],c=Kc(e.columns),p=e.startColumn===s?c:s;return t.column===p&&o}rowMax(e){let t;for(let n of e)(t===void 0||Ps(t,n))&&(t=n);return t}rowMin(e){let t;for(let n of e)(t===void 0||Ps(n,t))&&(t=n);return t}updateValuesOnMove(e){let t=_o(this.gos,e),n=t?.cellPosition;if(this.cellHasChanged=!1,!(!n||this.lastCellHovered&&Fs(n,this.lastCellHovered))){if(this.beans.editSvc?.isEditing(t,{withOpenEditor:!0})){this.dragSvc.cancelDrag(e);return}this.lastCellHovered&&(this.cellHasChanged=!0),this.lastCellHovered=n}}shouldSkipCurrentColumn(e){return yc(e)}
8dispatchChangedEvent(e,t,n){this.eventSvc.dispatchEvent({type:`cellSelectionChanged`,started:e,finished:t,id:n}),this.eventSvc.dispatchEvent({type:`rangeSelectionChanged`,started:e,finished:t,id:n})}getColumnFromModel(e){return typeof e==`string`?this.colModel.getCol(e):e}getColumnsFromModel(e){let{gos:t,visibleCols:n}=this,r=t.get(`rowNumbers`);(!e||this.selectionMode===1)&&(e=n.allCols);let i=[];for(let t of e){let e=this.getColumnFromModel(t);!e||r&&this.shouldSkipCurrentColumn(e)||i.push(e)}return i.length?i:void 0}calculateColumnsBetween(e,t){let n=this.visibleCols.allCols,r=this.getColumnFromModel(e),i=this.getColumnFromModel(t),o=r===i,s=n.indexOf(r);if(s<0){q(178,{colId:r.getId()});return}let c=o?s:n.indexOf(i);if(c<0){q(178,{colId:i.getId()});return}if(o||this.selectionMode===1)return this.getColumnsFromModel([r]);let p=Math.min(s,c),m=p===s?c:s,h=[];for(let e=p;e<=m;e++)h.push(n[e]);return this.getColumnsFromModel(h)}focusCellOnNewColumn(e,t){let{focusSvc:n}=this.beans,r=n.getFocusedCell();r&&this.isCellInSpecificRange(r,e)&&n.setFocusedCell({...r,column:t,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}focusCellOnNewRow(e,t){let{focusSvc:n}=this.beans,r=n.getFocusedCell();r&&this.isCellInSpecificRange(r,e)&&n.setFocusedCell({...t,column:r.column,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}createDragListenerFeature(e){return new DragListenerFeature(e)}createCellRangeFeature(e,t){return new CellRangeFeature(e,t)}},_v={moduleName:`CellSelection`,version:Z,beans:[RangeService],dynamicBeans:{fillHandle:AgFillHandle,rangeHandle:AgRangeHandle},apiFunctions:{getCellRanges,addCellRange,clearRangeSelection,clearCellSelection:clearRangeSelection},dependsOn:[fh,$l,ll],css:[sv]},vv={tag:`div`,cls:`ag-loading`,children:[{tag:`span`,ref:`eLoadingIcon`,cls:`ag-loading-icon`},{tag:`span`,ref:`eLoadingText`,cls:`ag-loading-text`}]},LoadingCellRenderer=class extends K{constructor(){super(vv),this.eLoadingIcon=null,this.eLoadingText=null}init(e){e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){this.eLoadingText.textContent=this.getLocaleTextFunc()(`loadingError`,`ERR`)}setupLoading(){let e=J(`groupLoading`,this.beans,null);e&&this.eLoadingIcon.appendChild(e),this.eLoadingText.textContent=this.getLocaleTextFunc()(`loadingOoo`,`Loading`)}refresh(e){return!1}},yv={moduleName:`LoadingCellRenderer`,version:Z,userComponents:{agLoadingCellRenderer:LoadingCellRenderer},icons:{groupLoading:`loading`},dependsOn:[fh]};function isPivotMode(e){return e.colModel.isPivotMode()}function getPivotResultColumn(e,t,n){return e.pivotResultCols?.lookupPivotResultCol(t,n)??null}function setValueColumns(e,t){e.valueColsSvc?.setColumns(t,`api`)}function getValueColumns(e){return e.valueColsSvc?.columns??[]}function removeValueColumns(e,t){e.valueColsSvc?.removeColumns(t,`api`)}function addValueColumns(e,t){e.valueColsSvc?.addColumns(t,`api`)}function setPivotColumns(e,t){e.pivotColsSvc?.setColumns(t,`api`)}function removePivotColumns(e,t){e.pivotColsSvc?.removeColumns(t,`api`)}function addPivotColumns(e,t){e.pivotColsSvc?.addColumns(t,`api`)}function getPivotColumns(e){return e.pivotColsSvc?.columns??[]}function setPivotResultColumns(e,t){e.pivotResultCols?.setPivotResultCols(t,`api`)}function getPivotResultColumns(e){let t=e.pivotResultCols?.getPivotResultCols();return t?t.list:null}var bv=`PivotRowTotal_`,headerNameComparator=({headerName:e},{headerName:t})=>e&&!t?1:!e&&t?-1:!e&&!t?0:e<t?-1:+(e>t),convertToHeaderNameComparator=e=>(t,n)=>e(t.headerName,n.headerName),PivotColDefService=class extends U{constructor(){super(...arguments),this.beanName=`pivotColDefSvc`}wireBeans(e){this.colModel=e.colModel,this.pivotColsSvc=e.pivotColsSvc,this.valueColsSvc=e.valueColsSvc,this.colNames=e.colNames}postConstruct(){let getFieldSeparator=()=>this.gos.get(`serverSidePivotResultFieldSeparator`)??`_`;this.fieldSeparator=getFieldSeparator(),this.addManagedPropertyListener(`serverSidePivotResultFieldSeparator`,()=>{this.fieldSeparator=getFieldSeparator()});let getPivotDefaultExpanded=()=>this.gos.get(`pivotDefaultExpanded`);this.pivotDefaultExpanded=getPivotDefaultExpanded(),this.addManagedPropertyListener(`pivotDefaultExpanded`,()=>{this.pivotDefaultExpanded=getPivotDefaultExpanded()})}createPivotColumnDefs(e){let t=this.createPivotColumnsFromUniqueValues(e);
8function extractColDefs(e,t=[]){return e.forEach(e=>{e.children===void 0?t.push(e):extractColDefs(e.children,t)}),t}let n=extractColDefs(t);return this.addRowGroupTotals(t,n),this.addExpandablePivotGroups(t,n),this.addPivotTotalsToGroups(t,n),t}createPivotColumnsFromUniqueValues(e){let t=this.pivotColsSvc?.columns??[],n=t.length;return this.recursivelyBuildGroup(0,e,[],n,t)}recursivelyBuildGroup(e,t,n,r,i){if(e>=r)return this.buildMeasureCols(n);let{pivotComparator:o}=i[e].getColDef(),s=o?convertToHeaderNameComparator(o):headerNameComparator,c=this.valueColsSvc?.columns;if(c?.length===1&&this.gos.get(`removePivotHeaderRowWhenSingleValueColumn`)&&e===r-1){let e=[];for(let r of t.keys()){let t=[...n,r],i=this.createColDef(c[0],r,t);i.columnGroupShow=`open`,e.push(i)}return e.sort(s),e}let p=[];for(let o of t.keys()){let s=this.pivotDefaultExpanded===-1||e<this.pivotDefaultExpanded,c=[...n,o];p.push({children:this.recursivelyBuildGroup(e+1,t.get(o),c,r,i),headerName:o,pivotKeys:c,columnGroupShow:`open`,openByDefault:s,groupId:this.generateColumnGroupId(c)})}return p.sort(s),p}buildMeasureCols(e){let t=this.valueColsSvc?.columns??[];return t.length===0?[this.createColDef(null,`-`,e)]:t.map(t=>{let n=this.colNames.getDisplayNameForColumn(t,`header`),r=this.createColDef(t,n,e);return r.columnGroupShow=`open`,r})}addExpandablePivotGroups(e,t){let n=this.gos.get(`suppressExpandablePivotGroups`);if(n||this.gos.get(`pivotColumnGroupTotals`))return;let recursivelyAddSubTotals=(e,t,r)=>{if(`children`in e){let{valueColsSvc:i}=this,{columns:o=[]}=i??{},s=new Map;e.children.forEach(e=>{recursivelyAddSubTotals(e,t,s)});let c=!e.children.some(e=>e.children),p=c&&o.length===1&&this.gos.get(`removePivotHeaderRowWhenSingleValueColumn`);for(let r of o){let i=this.colNames.getDisplayNameForColumn(r,`header`),o=this.createColDef(r,i,e.pivotKeys);o.pivotTotalColumnIds=s.get(r.getColId()),o.columnGroupShow=n?`open`:`closed`,o.aggFunc=r.getAggFunc(),(!c||p)&&(e.children.push(o),t.push(o))}this.merge(r,s);return}if(!e.pivotValueColumn)return;let i=e.pivotValueColumn.getColId();r.has(i)?r.get(i).push(e.colId):r.set(i,[e.colId])};e.forEach(e=>{recursivelyAddSubTotals(e,t,new Map)})}addPivotTotalsToGroups(e,t){if(!this.gos.get(`pivotColumnGroupTotals`))return;let n=this.gos.get(`pivotColumnGroupTotals`)===`after`,r=this.valueColsSvc?.columns,i=r?.map(e=>e.getAggFunc());if(!(!i||i.length<1||!this.sameAggFuncs(i))&&r){let i=r[0];e.forEach(e=>{this.recursivelyAddPivotTotal(e,t,i,n)})}}recursivelyAddPivotTotal(e,t,n,r){let i=e;if(!i.children){let t=e;return t.colId?[t.colId]:null}let o=[];if(i.children.forEach(e=>{let i=this.recursivelyAddPivotTotal(e,t,n,r);i&&(o=o.concat(i))}),i.children.length>1){let i=this.getLocaleTextFunc()(`pivotColumnGroupTotals`,`Total`),s=this.createColDef(n,i,e.pivotKeys,!0);s.pivotTotalColumnIds=o,s.aggFunc=n.getAggFunc(),s.columnGroupShow=this.gos.get(`suppressExpandablePivotGroups`)?`open`:void 0;let c=e.children;r?c.push(s):c.unshift(s),t.push(s)}return o}addRowGroupTotals(e,t){if(!this.gos.get(`pivotRowTotals`))return;let n=this.gos.get(`pivotRowTotals`)===`after`,r=(this.valueColsSvc?.columns??[]).slice();n||r.reverse();let i=r.length>1||!this.gos.get(`removePivotHeaderRowWhenSingleValueColumn`);for(let o=0;o<r.length;o++){let s=r[o],c=this.colNames.getDisplayNameForColumn(s,`header`),p=this.createColDef(s,c,[]),m=[];for(let e=0;e<t.length;e++){let n=t[e];n.pivotValueColumn===s&&m.push(n.colId)}p.pivotTotalColumnIds=m,p.colId=bv+p.colId;let h=i?{children:[p],pivotKeys:[],groupId:`${bv}_pivotGroup_${s.getColId()}`}:p;t.push(p),n?e.push(h):e.unshift(h)}}recreateColDef(e){let{pivotValueColumn:t,headerName:n,pivotKeys:r,pivotTotalColumnIds:i,columnGroupShow:o,colId:s,valueGetter:c,aggFunc:p}=e;if(!t)return e;let m=this.createColDef(t,n,r,!!i);return m.columnGroupShow=o,m.colId=s,m.valueGetter=c,m.aggFunc=p,m.pivotTotalColumnIds=i,this.gos.get(`processPivotResultColDef`)?.(m),m}createColDef(e,t,n,r=!1){let i={};if(e){let t=e.getColDef();Object.assign(i,t),i.hide=!1}return i.headerName=t,i.colId=this.generateColumnId(n||[],e&&!r?e.getColId():``),i.field=i.colId,i.valueGetter=e=>e.data?.[e.colDef.field],i.pivotKeys=n,i.pivotValueColumn=e,i.filter===!0&&(i.filter=`agNumberColumnFilter`),i}sameAggFuncs(e){if(e.length==1)return!0;for(let t=1;t<e.length;t++)if(e[t]!==e[0])return!1;return!0}merge(e,t){t.forEach((t,n)=>{let r=[...e.has(n)?e.get(n):[],...t];e.set(n,r)})}generateColumnGroupId(e){return`pivotGroup_${(this.pivotColsSvc?.columns??[]).map(e=>e.getColId()).join(`-`)}_${e.join(`-`)}`}generateColumnId(e,t){return`pivot_${(this.pivotColsSvc?.columns??[]).map(e=>e.getColId()).join(`-`)}_${e.join(`-`)}_${t}`}createColDefsFromFields(e){let t=new Map;for(let n=0;n<e.length;n++){let r=e[n].split(this.fieldSeparator),i=t;for(let e=0;e<r.length;e++){let t=r[e],n=i.get(t);n||(n=new Map,i.set(t,n)),i=n}}let uniqueValuesToGroups=(e,t,n,r)=>{let i=[];for(let[t,o]of n){let n=uniqueValuesToGroups(`${e}${this.fieldSeparator}${t}`,t,o,r+1);i.push(n)}if(i.length===0){let n=this.colModel.getColDefCol(t);if(n){let r=this.colNames.getDisplayNameForColumn(n,`header`)??t,i=this.createColDef(n,r,void 0,!1);return i.colId=e,i.aggFunc=n.getAggFunc(),i.valueGetter=t=>t.data?.[e],i}return{colId:e,headerName:t,valueGetter:t=>t.data?.[e]}}return this.gos.get(`removePivotHeaderRowWhenSingleValueColumn`)&&i.length===1&&`c
8olId`in i[0]?(i[0].headerName=t,i[0]):{openByDefault:this.pivotDefaultExpanded===-1||r<this.pivotDefaultExpanded,groupId:e,headerName:t,children:i}},n=[];for(let[e,r]of t){let t=uniqueValuesToGroups(e,e,r,0);n.push(t)}return n}},PivotResultColsService=class extends U{constructor(){super(...arguments),this.beanName=`pivotResultCols`}wireBeans(e){this.colModel=e.colModel,this.visibleCols=e.visibleCols}destroy(){Qc(this.beans,this.pivotResultCols?.tree),super.destroy()}isPivotResultColsPresent(){return this.pivotResultCols!=null}lookupPivotResultCol(e,t){if(this.pivotResultCols==null)return null;let n=this.colModel.getColDefCol(t),r=null;for(let t of this.pivotResultCols.list){let i=t.getColDef().pivotKeys,o=t.getColDef().pivotValueColumn;pa(i,e)&&o===n&&(r=t)}return r}getPivotResultCols(){return this.pivotResultCols}getPivotResultCol(e){return this.pivotResultCols?this.colModel.getColFromCollection(e,this.pivotResultCols):null}setPivotResultCols(e,t){if(this.colModel.ready&&(e!=null||this.pivotResultCols!=null)){if(e){this.processPivotResultColDef(e);let n=(t===`api`?Ws:sl)(this.beans,e,!1,this.pivotResultCols?.tree||this.previousPivotResultCols||void 0,t);Qc(this.beans,this.pivotResultCols?.tree,n.columnTree);let r=n.columnTree,i=n.treeDepth,o=ls(r),s={};this.pivotResultCols={tree:r,treeDepth:i,list:o,map:s};for(let e of this.pivotResultCols.list)this.pivotResultCols.map[e.getId()]=e;let c=!!this.previousPivotResultCols;this.previousPivotResultCols=null,this.colModel.refreshCols(!c,t)}else this.previousPivotResultCols=this.pivotResultCols?this.pivotResultCols.tree:null,this.pivotResultCols=null,this.colModel.refreshCols(!1,t);this.visibleCols.refresh(t)}}processPivotResultColDef(e){let t=this.gos.get(`processPivotResultColDef`),n=this.gos.get(`processPivotResultColGroupDef`);if(!t&&!n)return;let searchForColDefs=e=>{e.forEach(e=>{if(Xs(e.children)){let t=e;n&&n(t),searchForColDefs(t.children)}else t&&t(e)})};e&&searchForColDefs(e)}},xv=`Exceeded maximum allowed pivot column count.`,mapToObject=e=>{let t={};return e.forEach((e,n)=>t[n]=e instanceof Map?mapToObject(e):e),t},PivotStage=class extends U{constructor(){super(...arguments),this.beanName=`pivotStage`,this.step=`pivot`,this.refreshProps=[`removePivotHeaderRowWhenSingleValueColumn`,`pivotRowTotals`,`pivotColumnGroupTotals`,`suppressExpandablePivotGroups`],this.uniqueValues=new Map,this.lastTimeFailed=!1,this.maxUniqueValues=-1,this.currentUniqueCount=0}wireBeans(e){this.valueSvc=e.valueSvc,this.colModel=e.colModel,this.pivotResultCols=e.pivotResultCols,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueColsSvc=e.valueColsSvc,this.pivotColsSvc=e.pivotColsSvc,this.pivotColDefSvc=e.pivotColDefSvc}execute(e){let t=e.changedPath;this.colModel.isPivotActive()?this.executePivotOn(t):this.executePivotOff(t)}executePivotOff(e){this.aggregationColumnsHashLastTime=null,this.uniqueValues=new Map,this.pivotResultCols.isPivotResultColsPresent()&&(this.pivotResultCols.setPivotResultCols(null,`rowModelUpdated`),e&&(e.active=!1))}executePivotOn(e){let t=this.valueColsSvc?.columns.length??1,n=this.gos.get(`pivotMaxGeneratedColumns`);this.maxUniqueValues=n===-1?-1:n/t;let r;try{r=this.bucketUpRowNodes(e)}catch(e){if(e.message===xv){this.pivotResultCols.setPivotResultCols([],`rowModelUpdated`),this.eventSvc.dispatchEvent({type:`pivotMaxColumnsExceeded`,message:e.message}),this.lastTimeFailed=!0;return}throw e}let i=this.setUniqueValues(r),o=this.valueColsSvc?.columns??[],s=o.map(e=>`${e.getId()}-${e.getColDef().headerName}`).join(`#`),c=o.map(e=>e.getAggFunc().toString()).join(`#`),p=this.aggregationColumnsHashLastTime!==s,m=this.aggregationFuncsHashLastTime!==c;this.aggregationColumnsHashLastTime=s,this.aggregationFuncsHashLastTime=c;let h=(this.rowGroupColsSvc?.columns??[]).map(e=>e.getId()).join(`#`),g=h!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=h;let _=this.gos.get(`pivotRowTotals`),v=this.gos.get(`pivotColumnGroupTotals`),y=this.gos.get(`suppressExpandablePivotGroups`),b=this.gos.get(`removePivotHeaderRowWhenSingleValueColumn`),x=_!==this.pivotRowTotalsLastTime||v!==this.pivotColumnGroupTotalsLastTime||y!==this.suppressExpandablePivotGroupsLastTime||b!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=_,this.pivotColumnGroupTotalsLastTime=v,this.suppressExpandablePivotGroupsLastTime=y,this.removePivotHeaderRowWhenSingleValueColumnLastTime=b,this.lastTimeFailed||i||p||g||m||x){let t=this.pivotColDefSvc.createPivotColumnDefs(this.uniqueValues);this.pivotResultCols.setPivotResultCols(t,`rowModelUpdated`),e&&(e.active=!1)}this.lastTimeFailed=!1}
8setUniqueValues(e){return JSON.stringify(mapToObject(this.uniqueValues))!==JSON.stringify(mapToObject(e))&&(this.uniqueValues=e,!0)}bucketUpRowNodes(e){this.currentUniqueCount=0;let t=new Map;e.forEachChangedNodeDepthFirst(e=>{e.leafGroup&&(e.childrenMapped=null)});let recursivelyBucketFilteredChildren=e=>{e.leafGroup?this.bucketRowNode(e,t):e.childrenAfterFilter?.forEach(recursivelyBucketFilteredChildren)};return e.executeFromRootNode(recursivelyBucketFilteredChildren),t}bucketRowNode(e,t){let n=this.pivotColsSvc?.columns;e.childrenMapped=n?.length===0?null:mapToObject(this.bucketChildren(e.childrenAfterFilter,n,0,t)),e.sibling&&(e.sibling.childrenMapped=e.childrenMapped)}bucketChildren(e,t=[],n,r){let i=new Map,o=t[n];if(e.forEach(e=>{let t=this.valueSvc.getKeyForNode(o,e);if(dl(t)&&(t=``),!r.get(t)){this.currentUniqueCount+=1,r.set(t,new Map);let e=this.maxUniqueValues!==-1,n=this.currentUniqueCount>this.maxUniqueValues;if(e&&n)throw Error(xv)}i.has(t)||i.set(t,[]),i.get(t).push(e)}),n===t.length-1)return i;let s=new Map;for(let e of i.keys())s.set(e,this.bucketChildren(i.get(e),t,n+1,r.get(e)));return s}},Sv={moduleName:`SharedPivot`,version:Z,beans:[PivotResultColsService,PivotColDefService,PivotColsSvc],apiFunctions:{isPivotMode,getPivotResultColumn,setValueColumns,getValueColumns,removeValueColumns,addValueColumns,setPivotColumns,removePivotColumns,addPivotColumns,getPivotColumns,setPivotResultColumns,getPivotResultColumns},dependsOn:[k_,fc]},Cv={moduleName:`Pivot`,version:Z,rowModels:[`clientSide`],beans:[PivotStage],dependsOn:[Sv,A_,w_]},fieldGetter=e=>{let t=e.split(`.`);if(t.includes(`__proto__`))return()=>{};let n=t.length;return n<2?t=>t?.[e]:e=>{let r=0;do if(e=e?.[t[r++]],r===n)return e;while(typeof e==`object`)}},wv=2147483648,Tv=1073741824,Ev=536870912,Dv=268435456,Ov=268435455,kv=String.fromCodePoint(31,41150,8291),Av=3,TreeGroupStrategy=class extends U{constructor(){super(...arguments),this.nestedDataGetter=null,this.parentIdGetter=null,this.groupColsIds=``,this.groupColsChanged=!0,this.fillerNodesById=null,this.nodesToUnselect=null,this.fullReload=!1}postConstruct(){this.onPropChange(null)}onPropChange(e){let t=this.gos;if(!e||e.has(`treeDataParentIdField`)){let e=t.get(`treeDataParentIdField`),n=e?fieldGetter(e):null;this.fullReload||=this.parentIdGetter!==n,this.parentIdGetter=n,n&&(this.nestedDataGetter=null)}if(!e||e.has(`treeDataChildrenField`)){let e=this.parentIdGetter?``:t.get(`treeDataChildrenField`),n=e?fieldGetter(e):null;this.fullReload||=this.nestedDataGetter!==n,this.nestedDataGetter=n}}destroy(){this.nodesToUnselect=null,this.groupColsIds=``,this.reset(),super.destroy()}reset(){this.destroyFillerRows(),this.deselectHiddenNodes(!1),this.fullReload=!0}getNode(e){return this.fillerNodesById?.get(e)}execute(e){this.fullReload&&this.reset();let{changedRowNodes:t,changedPath:n,afterColumnsChanged:r}=e;this.checkGroupColsUpdated(r);let i=e.rowNode,o=n?.active?n:void 0,s=this.fullReload||!t&&!o,c=!!t&&this.flagUpdatedNodes(t);(s||c)&&(this.fullReload=!1,this.parentIdGetter?this.loadSelfRef(e,s):this.nestedDataGetter?this.loadNested(e,s):this.loadDataPath(e,s));let p=this.initRowsParents(i,t?.removals);this.destroyFillerRows(),this.initRowsChildrenSize(i);let m=this.preprocessRows(i),h=p||(m&wv)!==0;m&=~wv;let g=this.traverseRoot(i,o);return m>0&&m!==g&&(this.handleCycles(i),this.traverseRoot(i,o)),i.treeNodeFlags=0,this.deselectHiddenNodes(p||s),h}flagUpdatedNodes(e){let{adds:t,updates:n,removals:r}=e,i=r.size>0;if(t.size>0){i=!0;for(let e of t)e.treeNodeFlags|=Tv}if(n.size>0){i=!0;for(let e of n)e.treeNodeFlags|=Tv}return i}initRowsParents(e,t){t?.size===0&&(t=void 0);let n=e._leafs,r=n.length,i=!1;for(let e=0;e<r;++e)this.initRowParent(n[e],t)&&(i=!0);return i}initRowParent(e,t){let n=!1;for(;;){let r=e.parent,i=e.treeParent;if(i===null){r&&(n=!0,this.hideRow(e));break}let o=i.treeNodeFlags+1,s=r!==i;if(s&&(n=!0,o|=Tv,e.parent=i),s&&r&&(t?.has(r)&&maybeExpandFromRemovedParent(i,r)&&(o|=Dv),r.treeNodeFlags|=Tv),i.sourceRowIndex>=0||i.treeNodeFlags&Ev||i.treeParent===null){i.treeNodeFlags=o;break}i.treeNodeFlags=o|Ev|e.treeNodeFlags&Tv,e=i}return n}destroyFillerRows(){let e=this.fillerNodesById;if(e){for(let t of e.values())(t.treeParent===null||(t.treeNodeFlags&Ov)===0)&&(e.delete(t.id),this.hideRow(t));e.size===0&&(this.fillerNodesById=null)}}initRowsChildrenSize(e){this.initRowChildrenSize(e);let t=e._leafs,n=t.length;for(let e=0;e<n;++e)this.initRowChildrenSize(t[e]);let r=this.fillerNodesById;if(r!==null)for(let e of r.values())this.initRowChildrenSize(e)}initRowChildrenSize(e){let{childrenAfterGroup:t,_leafs:n,treeNodeFlags:r}=e,i=t?.length,o=r&Ov;if(e.treeNodeFlags=r&~Ov|((i||0)===o?0:wv),o===0&&e.level>=0){if(t!==Ja){e.childrenAfterGroup=Ja;let t=e.sibling;t&&(t.childrenAfterGroup=Ja)}}else if(i!==o||t===n){if(!t||t===Ja||t===n){e.childrenAfterGroup=t=Array(o);let n=e.sibling;n&&(n.childrenAfterGroup=t)}else t.length=o}}preprocessRows(e){let t=e._leafs,n=t.length,r=this.groupColsChanged,i=0,o=!1;for(let e=0;e<n;++e){let n=t[e];for(;;){let e=n.treeParent;if(e===null)break;++i;let t=e.treeNodeFlags,s=e.childrenAfterGroup,c=t&Ov;if(t=t&~Ov|c+1,(t&wv||s[c]!==n)&&(t|=wv,s[c]=n,o=!0),e.treeNodeFlags=t,(!n.groupData||r)&&(n.treeNodeFlags|=Tv,this.setGroupData(n,n.key)),e.data||(e.treeNodeFlags&Ev)===0||e.treeParent===null)break;e.treeNodeFlags=t&~Ev|n.treeNodeFlags&Tv,n=e}}return i|(o?wv:0)}traverseRoot(e,t){let n=0,r=e.childrenAfterGroup;for(let e=0,i=r.length;e<i;++e)n+=this.traverse(r[e],0,!1,t);return n&~wv}traverse(e,t,n,r){let i=e.childrenAfterGroup,o=i.length,s=e.treeNodeFlags;e.treeNodeFlags=s&Dv,e.level=t,e.group===!!o?e.hasChildren()!==!!o&&(e.updateHasChildren(),s|=Tv):(setRowNodeGroup(e,this.beans,!!o),s|=Tv),(s&(Tv|wv))!==0&&r?.addParentNode(e),o!==0||e.master?(s&Dv)===0&&(e.treeNodeFlags|=Dv,e.expanded=_getRowDefaultExpanded(this.beans,e,t)):(e.expanded&&=!1,(s&Dv)!==0&&(e.treeNodeFlags&=~Dv)),n&&e.rowIndex!==null&&e.clearRowTopAndRowIndex(),n||=e.expanded===!1,++t,s&=wv;for(let e=0;e<o;++e){let o=i[e],c=this.traverse(o,t,n,r);s=s+(c&~wv)|c&wv}return s&wv&&(e._leafs=void 0),s+1}handleCycles(e){let t=new Set,mark=e=>{if(t.has(e))return!1;t.add(e);for(let t of e.childrenAfterGroup)mark(t);return!0};mark(e);let n=e.childrenAfterGroup;n.length=0;let r=e._leafs;for(let t=0,i=r.length;t<i;++t){let i=r[t],o=i.treeParent;o&&mark(i)?(o.treeNodeFlags|=wv|Tv,i.parent=e,Zo(o.childrenAfterGroup,i),n.push(i),q(270,{id:i.id,parentId:o?.id??``})):o===e&&n.push(i)}}setGroupData(e,t){let n={},r=this.beans.showRowGroupCols?.getShowRowGroupCols();if(e.groupData=n,r)for(let e of r)n[e.getColId()]=t}loadNested({rowNode:e,changedRowNodes:t},n){if(!n&&t){for(let e of t.adds)e.key=e.id;return}let r=e._leafs;for(let e=0,t=r.length;e<t;++e){let t=r[e],n=t.id;t.key!==n&&(t.key=n,t.groupData=null)}}loadSelfRef({rowNode:e,changedRowNodes:t},n){let r=e._leafs,i=r.length;if(!this.gos.get(`getRowId`)){for(let e=0;e<i;e++)r[e].treeParent=null;return}let o=this.beans.rowModel,s=t?.removals,c=this.parentIdGetter;for(let t=0;t<i;t++){let i=r[t];if(n||i.treeNodeFlags&Tv||s?.has(i.treeParent)){let t,n=c?.(i.data);n!=null&&(t=o.getRowNode(n),t||q(271,{id:i.id,parentId:n})),i.treeParent=t??e;let r=i.id;i.key!==r&&(i.key=r,i.groupData=null)}else i.treeParent??=e}}loadFlattened(e){let t=e._leafs;for(let n=0,r=t.length;n<r;++n){let r=t[n];r.treeParent=e;let i=r.id;r.key!==i&&(r.key=i,r.groupData=null)}}loadDataPath({rowNode:e},t){let n=this.gos.get(`getDataPath`);if(!n){this.loadFlattened(e);return}let r=new Map,i=new Map,o;t||(o=this.loadExistingDataPath(e,r,i));let s=e._leafs;for(let e=0,c=s.length;e<c;++e){let c=s[e];if(!t&&c.treeParent!==null&&(c.treeNodeFlags&Tv)===0)continue;let p=n(c.data),m=p?.length;if(!m){q(185,{data:c.data});continue}let h=p[m-1];c.key!==h&&(c.key=h,c.groupData=null);let g=p.join(kv);i.set(c,g);let _=r.get(g);_===void 0?r.set(g,c):_!==c&&(o=this.duplicatedPath(r,o,_,c,g))}o&&this.processDuplicatePaths(o,i),this.buildFromPaths(e,r,i)}loadExistingDataPath(e,t,n){let r,i=e._leafs;for(let o=0,s=i.length;o<s;++o){let s=i[o],c=s.treeParent;if(c===null||(s.treeNodeFlags&Tv)!==0)continue;let p=s.key,m=c;for(;m&&m!==e&&m!==s;){p=kv+p;let e=n.get(m);
8if(e!==void 0){p=e+p;break}p=m.key+p,m=m.treeParent}if(m!==s){n.set(s,p);let e=t.get(p);e===void 0?t.set(p,s):e!==s&&(r=this.duplicatedPath(t,r,e,s,p))}}return r}duplicatedPath(e,t,n,r,i){r.sourceRowIndex<n.sourceRowIndex&&e.set(i,r);let o=(t??=new Map).get(i);return o===void 0?t.set(i,[n,r]):o.push(r),t}buildFromPaths(e,t,n){let r=Array(48),i=e._leafs;for(let o=0,s=i.length;o<s;++o){let s=i[o],c=n.get(s);if(c===void 0)continue;let p=this.splitPathKey(r,c),m=0,h=e;for(let e=p-1;e>=0;--e){let n=t.get(c.slice(0,r[e]));if(n){h=n,m=e+1;break}}m<p&&(h=this.buildMissingFillers(t,c,r,p,m,h)),s.treeParent=h}}splitPathKey(e,t){let n=0,r=0,i=t.length;for(;r<i;){let i=t.indexOf(kv,r);if(i===-1)break;e[n++]=i,r=i+Av}return n}buildMissingFillers(e,t,n,r,i,o){let s=0,c=`row-group`;o.sourceRowIndex<0&&o.treeParent&&(s=i,c=o.id);do{let r=i===0?0:n[i-1]+Av,p=n[i],m=t.slice(0,p),h=e.get(m);if(h===void 0){let o=r===0?m:t.slice(r,p);c=this.makeFillerIdBase(t,n,i,c,s)+o,h=this.getOrCreateFiller(o,c),e.set(m,h),s=i+1}else h.sourceRowIndex<0&&(c=h.id,s=i+1);h.treeParent=o,o=h,++i}while(i<r);return o}processDuplicatePaths(e,t){for(let n of e.values()){n.sort(compareSourceRowIndex);let e=n.length,r=Array(e-1);for(let i=1;i<e;++i){let e=n[i];t.delete(e),e.treeParent=null,r[i-1]=e.data}let i=n[0];q(186,{rowId:i.id,rowData:i.data,duplicateRowsData:r})}}getOrCreateFiller(e,t){let n=this.fillerNodesById??=new Map,r=n.get(t);return r===void 0&&(r=new zc(this.beans),r.id=t,r.key=e,r.group=!0,r.leafGroup=!1,r.rowGroupIndex=null,n.set(t,r)),r}makeFillerIdBase(e,t,n,r,i){for(;i<n;){let n=i>0?t[i-1]+Av:0,o=t[i];r+=`-`+i+`-`+e.slice(n,o),++i}return r+`-`+n+`-`}deselectHiddenNodes(e){let t=this.beans.selectionSvc,n=this.nodesToUnselect,r=`rowDataChanged`;if(n&&(this.nodesToUnselect=null,t?.setNodesSelected({newValue:!1,nodes:n,suppressFinishActions:!0,source:r})),(n||e)&&t?.updateGroupsFromChildrenSelections?.(r),n){let e=t?.getSelectedNodes()??null;this.eventSvc.dispatchEvent({type:`selectionChanged`,source:r,selectedNodes:e,serverSideState:null})}}hideRow(e){e.isSelected()&&(this.nodesToUnselect??=[]).push(e),e.parent=null,e.group=!1,e.groupData=null,e.treeParent=null,e.treeNodeFlags=0,e.childrenAfterGroup=Ja,e._leafs=void 0;let t=e.sibling;t&&(t.childrenAfterGroup=Ja),e.updateHasChildren(),e.rowIndex!==null&&e.clearRowTopAndRowIndex()}checkGroupColsUpdated(e){if(this.groupColsChanged=!1,e||!this.groupColsIds){let e=this.beans.showRowGroupCols?.getShowRowGroupCols()??Ja,t=``;for(let n=0,r=e.length;n<r;++n)t+=e[n].getId()+kv;this.groupColsIds!==t&&(this.groupColsIds=t,this.groupColsChanged=!0)}}},compareSourceRowIndex=(e,t)=>e.sourceRowIndex-t.sourceRowIndex,maybeExpandFromRemovedParent=(e,t)=>(t.treeNodeFlags&Dv)!==0&&(e.treeNodeFlags&Dv)===0&&e.treeParent!==null&&e.sourceRowIndex<0&&(e.expanded=t.expanded,!0),jv={moduleName:`SharedTreeData`,version:Z,dependsOn:[fh,g_,C_,T_]},Mv={moduleName:`TreeData`,version:Z,dynamicBeans:{treeGroupStrategy:TreeGroupStrategy},rowModels:[`clientSide`],dependsOn:[jv,__,w_]},Nv=`ag-Grid-MissingKey`,BlockUtils=class extends U{constructor(){super(...arguments),this.beanName=`ssrmBlockUtils`}wireBeans(e){this.valueSvc=e.valueSvc,this.showRowGroupCols=e.showRowGroupCols,this.nodeManager=e.ssrmNodeManager,this.expansionSvc=e.expansionSvc,this.serverSideRowModel=e.rowModel,this.storeFactory=e.ssrmStoreFactory}createRowNode(e){let t=new zc(this.beans),n=e.rowHeight==null?Ul(this.beans):e.rowHeight;return t.setRowHeight(n),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.rowGroupIndex=e.level),t}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(),e.id!=null&&this.nodeManager.removeNode(e)}setTreeGroupInfo(e){e.updateHasChildren();let t=this.gos.get(`getServerSideGroupKey`),n=e.hasChildren();n&&t!=null&&(e.key=t(e.data)),!n&&e.childStore!=null&&(this.destroyBean(e.childStore),e.childStore=null,e.master||(e.expanded=!1))}setRowGroupInfo(e){if(e.key=this.valueSvc.getValue(e.rowGroupColumn,e),(e.key===null||e.key===void 0)&&Dc(()=>{q(190,{rowGroupId:e.rowGroupColumn?.getId(),data:e.data})},`SSBlock-BadKey`),this.gos.get(`groupAllowUnbalanced`)&&e.key===``){let t=this.serverSideRowModel.getParams();e.childStore=this.createBean(this.storeFactory.createStore(t,e))}Gs(this.beans.gos)({node:e})&&(_createRowNodeFooter(e,this.beans),e.sibling&&(e.sibling.uiLevel=e.uiLevel+1))}setMasterDetailInfo(e){let t=this.gos.get(`isRowMaster`);e.master=t==null||t(e.data)}updateDataIntoRowNode(e,t){e.updateData(t),this.gos.get(`treeData`)?(this.setTreeGroupInfo(e),this.setChildCountIntoRowNode(e),this.updateRowFooter(e)):e.group?(this.setChildCountIntoRowNode(e),this.updateRowFooter(e)):this.gos.get(`masterDetail`)}updateRowFooter(e){if(!e.footer){if(e.group&&Gs(this.beans.gos)({node:e}
8)&&!e.sibling){_createRowNodeFooter(e,this.beans);return}e.sibling&&_destroyRowNodeFooter(e)}}setDataIntoRowNode(e,t,n,r){e.stub=!1;let i=this.gos.get(`treeData`);e.setDataAndId(t,n);let o=e.group;(i||!o)&&this.gos.get(`masterDetail`)&&this.setMasterDetailInfo(e),i?this.setTreeGroupInfo(e):o&&this.setRowGroupInfo(e),(i||o)&&(this.setGroupDataIntoRowNode(e),this.setChildCountIntoRowNode(e)),Xs(t)&&(e.setRowHeight(ru(this.beans,e,!1,r).height),e.sibling?.setRowHeight(ru(this.beans,e.sibling,!1,r).height))}setChildCountIntoRowNode(e){let t=this.gos.get(`getChildCount`);t&&e.setAllChildrenCount(t(e.data))}setGroupDataIntoRowNode(e){e.groupValue=e.key;let t=this.showRowGroupCols?.getShowRowGroupCols()??[],n=this.gos.get(`treeData`);for(let r of t)if(e.groupData??={},n)e.groupData[r.getColId()]=e.key;else if(r.isRowGroupDisplayed(e.rowGroupColumn.getId())){let t=this.valueSvc.getValue(e.rowGroupColumn,e);e.groupData[r.getColId()]=t}}clearDisplayIndex(e){e.clearRowTopAndRowIndex(),e.hasChildren()&&e.childStore&&e.childStore?.clearDisplayIndexes(),e.master&&e.detailNode&&e.detailNode?.clearRowTopAndRowIndex()}setDisplayIndex(e,t,n,r){let i=this.gos.get(`groupAllowUnbalanced`)&&e.group&&e.key===``;if(this.gos.get(`groupHideOpenParents`)&&e.group&&e.expanded||i?(e.setRowIndex(null),e.setRowTop(null)):(e.setRowIndex(t.value++),e.setRowTop(n.value),n.value+=e.rowHeight),e.setUiLevel(r),!e.footer&&(e.master&&(e.expanded&&e.detailNode?(e.detailNode.setRowIndex(t.value++),e.detailNode.setRowTop(n.value),n.value+=e.detailNode.rowHeight):e.detailNode&&e.detailNode.clearRowTopAndRowIndex()),e.hasChildren()&&e.childStore)){let o=e.childStore;e.expanded||i?o.setDisplayIndexes(t,n,i?r:r+1):o.clearDisplayIndexes()}}extractRowBounds(e,t){let extractRowBounds=e=>({rowHeight:e.rowHeight,rowTop:e.rowTop});if(e.rowIndex===t)return extractRowBounds(e);if(e.hasChildren()&&e.expanded&&e.childStore){let n=e.childStore;if(n.isDisplayIndexInStore(t))return n.getRowBounds(t)}else if(e.master&&e.expanded&&e.detailNode&&e.detailNode.rowIndex===t)return extractRowBounds(e.detailNode)}isPixelInNodeRange(e,t){return!Xs(e.rowTop)||!Xs(e.rowHeight)?!1:t>=e.rowTop&&t<e.rowTop+e.rowHeight}getIndexAtPixel(e,t){if(this.isPixelInNodeRange(e,t))return e.rowIndex;let n=e.master&&e.expanded,r=e.detailNode;if(n&&r&&this.isPixelInNodeRange(r,t))return r.rowIndex;if(e.hasChildren()&&e.expanded&&e.childStore){let n=e.childStore;if(n.isPixelInRange(t))return n.getRowIndexAtPixel(t)}return null}createNodeIdPrefix(e){let t=[],n=e;for(;n&&n.level>=0;)n.key===``?t.push(Nv):t.push(n.key),n=n.parent;if(t.length>0)return t.reverse().join(`-`)}checkOpenByDefault(e){let t=!!this.expansionSvc?.isNodeExpanded(e),n=e.expanded;!!n===t?n===void 0&&(e.expanded=t):e.setExpanded(t)}},ExpandListener=class extends U{constructor(){super(...arguments),this.beanName=`ssrmExpandListener`}postConstruct(){lc(this.gos)&&this.addManagedEventListeners({rowExpansionStateChanged:this.onRowExpandStateChanged.bind(this)})}onRowExpandStateChanged(){let e=this.beans,t=e.expansionSvc;e.rowModel.forEachNode(e=>{t.updateExpandedState(e)}),this.eventSvc.dispatchEvent({type:`storeUpdated`})}},FilterListener=class extends U{constructor(){super(...arguments),this.beanName=`ssrmFilterListener`}wireBeans(e){this.serverSideRowModel=e.rowModel,this.filterManager=e.filterManager,this.listenerUtils=e.ssrmListenerUtils}postConstruct(){lc(this.gos)&&this.addManagedEventListeners({advancedFilterEnabledChanged:()=>this.onFilterChanged(!0),filterChanged:()=>this.onFilterChanged()})}onFilterChanged(e){let t=this.serverSideRowModel.getParams();if(!t)return;let n=t.filterModel,r,i;if(this.filterManager?.isAdvFilterEnabled()){r=this.filterManager.getAdvFilterModel();let t=e?Object.keys(n??{}):this.getAdvancedFilterColumns(n),o=this.getAdvancedFilterColumns(r);for(let e of t)o.add(e);i=Array.from(o)}else if(r=this.filterManager?.getFilterModel()??{},e){let e=this.getAdvancedFilterColumns(n);for(let t of Object.keys(r))e.add(t);i=Array.from(e)}else i=this.findChangedColumns(n,r);let o={valueColChanged:this.listenerUtils.isSortingWithValueColumn(i),secondaryColChanged:this.listenerUtils.isSortingWithSecondaryColumn(i),changedColumns:i};this.serverSideRowModel.refreshAfterFilter(r,o)}findChangedColumns(e,t){let n={};for(let t of Object.keys(e))n[t]=!0;for(let e of Object.keys(t))n[e]=!0;let r=[];for(let i of Object.keys(n))JSON.stringify(e[i])!=JSON.stringify(t[i])&&r.push(i);return r}getAdvancedFilterColumns(e){let t=new Set;if(!e)return t;let processAdvancedFilterModel=e=>{if(e.filterType===`join`)for(let t of e.conditions)processAdvancedFilterModel(t);else t.add(e.colId)};return processAdvancedFilterModel(e),t}},ListenerUtils=class extends U{constructor(){super(...arguments),this.beanName=`ssrmListenerUtils`}wireBeans(e){this.pivotResultCols=e.pivotResultCols,this.valueColsSvc=e.valueColsSvc}isSortingWithValueColumn(e){let t=(this.valueColsSvc?.columns??[]).map(e=>e.getColId());for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return!0;return!1}isSortingWithSecondaryColumn(e){let t=this.pivotResultCols?.getPivotResultCols();if(!t)return!1;let n=t.list.map(e=>e.getColId());for(let t=0;t<e.length;t++)if(n.indexOf(e[t])>-1)return!0;return!1}},SortListener=class extends U{constructor(){super(...arguments),this.beanName=`ssrmSortSvc`}wireBeans(e){this.sortSvc=e.sortSvc,this.serverSideRowModel=e.rowModel,this.listenerUtils=e.ssrmListenerUtils}postConstruct(){lc(this.gos)&&this.addManagedEventListeners({sortChanged:this.onSortChanged.bind(this)})}onSortChanged(){let e=this.serverSideRowModel.getParams();if(!e)return;let t=this.sortSvc.getSortModel(),n=e.sortModel,r=this.findChangedColumnsInSort(t,n),i={valueColChanged:this.listenerUtils.isSortingWithValueColumn(r),secondaryColChanged:this.listenerUtils.isSortingWithSecondaryColumn(r),changedColumns:r};this.serverSideRowModel.refreshAfterSort(t,i)}findChangedColumnsInSort(e,t){let n=[];for(let r of[e,t])if(r){let e=r.map(e=>e.colId);n=n.concat(e)}let differentSorts=(e,t)=>(e?e.sort:null)!==(t?t.sort:null),differentIndexes=(n,r)=>(n?t.indexOf(n):-1)!==(r?e.indexOf(r):-1);return n.filter(n=>{let r=t.find(e=>e.colId===n),i=e.find(e=>e.colId===n);return differentSorts(r,i)||differentIndexes(r,i)})}},NodeManager=class extends U{constructor(){super(...arguments),this.beanName=`ssrmNodeManager`,this.rowNodes=new Map}addRowNode(e){let t=e.id;this.rowNodes.has(t)&&q(187,{rowId:t,firstData:this.rowNodes.get(t).data,secondData:e.data}),this.rowNodes.set(t,e)}removeNode(e){let t=e.id;this.rowNodes.delete(t)}destroy(){this.clear(),super.destroy()}clear(){this.rowNodes.clear(),super.destroy()}},ServerSideRowModel=class extends U{constructor(){super(...arguments),this.beanName=`rowModel`,this.started=!1,this.managingPivotResultColumns=!1,this.onRowHeightChanged_debounced=hc(this,this.onRowHeightChanged.bind(this),100)}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.pivotResultCols=e.pivotResultCols,this.rowGroupColsSvc=e.rowGroupColsSvc,this.pivotColsSvc=e.pivotColsSvc,this.valueColsSvc=e.valueColsSvc,this.filterManager=e.filterManager,this.sortSvc=e.sortSvc,this.rowRenderer=e.rowRenderer,this.nodeManager=e.ssrmNodeManager,this.storeFactory=e.ssrmStoreFactory,this.pivotColDefSvc=e.pivotColDefSvc}ensureRowHeightsValid(){return!1}start(){this.started=!0,this.updateDatasource()}destroyDatasource(){this.datasource&&=(this.datasource.destroy&&this.datasource.destroy(),this.rowRenderer.datasourceChanged(),void 0)}postConstruct(){let e=this.resetRootStore.bind(this);this.addManagedEventListeners({newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.onStoreUpdated.bind(this),columnValueChanged:e,columnPivotChanged:e,columnRowGroupChanged:e,columnPivotModeChanged:e}),this.addManagedPropertyListeners([`masterDetail`,`treeData`,`removePivotHeaderRowWhenSingleValueColumn`,`cacheBlockSize`],e),this.addManagedPropertyListeners([`groupAllowUnbalanced`,`groupTotalRow`],()=>this.onStoreUpdated()),this.addManagedPropertyListener(`rowHeight`,()=>this.resetRowHeights()),this.verifyProps(),this.addManagedPropertyListener(`serverSideDatasource`,()=>this.updateDatasource())}updateDatasource(){let e=this.gos.get(`serverSideDatasource`);e&&this.setDatasource(e)}verifyProps(){Uo(this.gos)&&!this.gos.exists(`getRowId`)&&q(188,{feature:`selection`})}setDatasource(e){this.started&&(this.destroyDatasource(),this.datasource=e,this.resetRootStore())}applyRowData(e,t,n){let r=this.getRootStore();if(!r)return;let i=r.getChildStore(n);i&&i.applyRowData(e,t,e.rowData.length)}isLastRowIndexKnown(){let e=this.getRootStore();return e?e.isLastRowIndexKnown():!1}onColumnEverything(){if(!this.storeParams){this.resetRootStore();return}let e=this.columnsToValueObjects(this.rowGroupColsSvc?.columns),t=this.columnsToValueObjects(this.valueColsSvc?.columns),n=this.columnsToValueObjects(this.pivotColsSvc?.columns),areColsSame=e=>{let t={};for(let n of e.oldCols)t[n.id]=n;let n=e.newCols.every(e=>{let n=t[e.id];
8return n&&delete t[e.id],n&&n.field===e.field&&n.aggFunc===e.aggFunc}),r=!e.allowRemovedColumns&&!!Object.values(t).length;return n&&!r},r=!$s(this.storeParams.sortModel,this.sortSvc?.getSortModel()??[]),i=!areColsSame({oldCols:this.storeParams.rowGroupCols,newCols:e}),o=!areColsSame({oldCols:this.storeParams.pivotCols,newCols:n}),s=!!e?.length&&!areColsSame({oldCols:this.storeParams.valueCols,newCols:t,allowRemovedColumns:!0});if(r||i||o||s)this.resetRootStore();else{let e=this.createStoreParams();this.storeParams.rowGroupCols=e.rowGroupCols,this.storeParams.pivotCols=e.pivotCols,this.storeParams.valueCols=e.valueCols}}destroyRootStore(){this.rootNode?.childStore&&(this.rootNode.childStore=this.destroyBean(this.rootNode.childStore),this.nodeManager.clear())}refreshAfterSort(e,t){this.storeParams&&(this.storeParams.sortModel=e);let n=this.getRootStore();n&&(n.refreshAfterSort(t),this.onStoreUpdated())}generateSecondaryColumns(e){if(!this.pivotColDefSvc){this.gos.assertModuleRegistered(`SharedPivot`,2);return}let t=this.pivotColDefSvc.createColDefsFromFields(e);this.managingPivotResultColumns=!0,this.pivotResultCols?.setPivotResultCols(t,`rowModelUpdated`)}resetRowHeights(){let e=this.resetRowHeightsForAllRowNodes(),t=ru(this.beans,this.rootNode);if(this.rootNode.setRowHeight(t.height,t.estimated),this.rootNode.sibling){let e=ru(this.beans,this.rootNode.sibling);this.rootNode.sibling.setRowHeight(e.height,e.estimated)}e&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{let n=ru(this.beans,t);t.setRowHeight(n.height,n.estimated);let r=t.detailNode;if(r){let e=ru(this.beans,r);r.setRowHeight(e.height,e.estimated)}if(t.sibling){let e=ru(this.beans,t.sibling);r?.setRowHeight(e.height,e.estimated)}e=!0}),e}resetRootStore(){this.destroyRootStore(),this.rootNode=new zc(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.pivotResultCols?.setPivotResultCols(null,`api`),!1),this.dispatchModelUpdated(!0)}columnsToValueObjects(e=[]){return e.map(e=>({id:e.getId(),aggFunc:e.getAggFunc(),displayName:this.colNames.getDisplayNameForColumn(e,`model`),field:e.getColDef().field}))}createStoreParams(){let e=this.columnsToValueObjects(this.rowGroupColsSvc?.columns),t=this.columnsToValueObjects(this.valueColsSvc?.columns),n=this.columnsToValueObjects(this.pivotColsSvc?.columns),r=Sa(this.gos);return{valueCols:t,rowGroupCols:e,pivotCols:n,pivotMode:this.colModel.isPivotMode(),filterModel:this.filterManager?.isAdvFilterEnabled()?this.filterManager?.getAdvFilterModel():this.filterManager?.getFilterModel()??{},sortModel:this.sortSvc?.getSortModel()??[],datasource:this.datasource,lastAccessedSequence:{value:0},dynamicRowHeight:r}}getParams(){return this.storeParams}dispatchModelUpdated(e=!1){this.eventSvc.dispatchEvent({type:`modelUpdated`,animate:!e,keepRenderedRows:!e,newPage:!1,newData:!1})}onStoreUpdated(){this.updateRowIndexesAndBounds(),this.dispatchModelUpdated()}onRowHeightChanged(){this.updateRowIndexesAndBounds(),this.dispatchModelUpdated()}updateRowIndexesAndBounds(){let e=this.getRootStore();e&&e.setDisplayIndexes({value:0},{value:0},0)}retryLoads(){let e=this.getRootStore();e&&(e.retryLoads(),this.onStoreUpdated())}getRow(e){let t=this.getRootStore();if(t)return t.getRowUsingDisplayIndex(e)}refreshAfterFilter(e,t){this.storeParams&&(this.storeParams.filterModel=e);let n=this.getRootStore();n&&(n.refreshAfterFilter(t),this.onStoreUpdated())}getRootStore(){return this.rootNode?.childStore}getRowCount(){let e=this.getRootStore();return e?e.getDisplayIndexEnd():0}getTopLevelRowCount(){let e=this.getRootStore();return e?e.getRowCount():1}getTopLevelRowDisplayedIndex(e){let t=this.getRootStore();return t?t.getTopLevelRowDisplayedIndex(e):e}getRowBounds(e){let t=this.getRootStore();return t?t.getRowBounds(e):{rowTop:0,rowHeight:Ul(this.beans)}}getBlockStates(){let e=this.getRootStore();if(!e)return;let t={};return e.forEachStoreDeep(e=>{let n=e.getBlockStates();for(let e of Object.keys(n))t[e]=n[e]}),t}getRowIndexAtPixel(e){let t=this.getRootStore();return e<=0||!t?0:t.getRowIndexAtPixel(e)}isEmpty(){return!1}isRowsToRender(){return this.getRootStore()!=null&&this.getRowCount()>0}getType(){return`serverSide`}forEachNode(e){let t=this.getRootStore();t&&t.forEachNodeDeep(e)}forEachDisplayedNode(e){let wrappedCallback=(t,n)=>{t.stub||!t.displayed||e(t,n)};this.forEachNode(wrappedCallback)}forEachNodeAfterFilterAndSort(e,t=!1){let n=this.getRootStore();
8n&&n.forEachNodeDeepAfterFilterAndSort(e,void 0,t)}executeOnStore(e,t){if(!this.started)return!1;let n=this.getRootStore();if(!n)return!0;let r=n.getChildStore(e);return r&&t(r),!0}refreshStore(e={}){let t=e.route?e.route:[];this.executeOnStore(t,t=>t.refreshStore(e.purge==1))}getStoreState(){let e=[],t=this.getRootStore();return t&&t.addStoreStates(e),e}getNodesInRangeForSelection(e,t){let n=e.rowIndex,r=t.rowIndex;if(n===null&&r===null)return[];if(r===null)return e?[e]:[];if(n===null)return[t];let i=[],[o,s]=[n,r].sort((e,t)=>e-t);return this.forEachNode(e=>{let t=e.rowIndex;t==null||e.stub||t>=o&&t<=s&&i.push(e)}),i.length===s-o+1?i:null}getRowNode(e){let t;return this.forEachNode(n=>{n.id===e&&(t=n),n.detailNode&&n.detailNode.id===e&&(t=n.detailNode)}),t}isRowPresent(e){return!!this.getRowNode(e.id)}setRowCount(e,t){let n=this.getRootStore();n&&n.setRowCount(e,t)}destroy(){this.destroyDatasource(),this.destroyRootStore(),super.destroy()}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}};function getServerSideSelectionState(e){return e.selectionSvc?.getSelectionState()??null}function setServerSideSelectionState(e,t){e.selectionSvc?.setSelectionState(t,`api`)}function applyServerSideTransaction(e,t){return e.ssrmTxnManager?.applyTransaction(t)}function applyServerSideRowData(e,t){let n=t.startRow??0,r=t.route??[];if(n<0){q(189,{startRow:n});return}Da(e)?.applyRowData(t.successParams,n,r)}function applyServerSideTransactionAsync(e,t,n){return e.ssrmTxnManager?.applyTransactionAsync(t,n)}function retryServerSideLoads(e){Da(e)?.retryLoads()}function flushServerSideAsyncTransactions(e){return e.ssrmTxnManager?.flushAsyncTransactions()}function refreshServerSide(e,t){Da(e)?.refreshStore(t)}function getServerSideGroupLevelState(e){return Da(e)?.getStoreState()??[]}var ExpandStrategy=class extends U{constructor(){super(...arguments),this.name=`expand`,this.expanded=new Set,this.collapsed=new Set,this.initialState=new Map}setExpandedState({expandedRowGroupIds:e,collapsedRowGroupIds:t}){this.expanded=new Set(e),this.collapsed=new Set(t);for(let e of this.expanded)this.initialState.set(e,!1);for(let e of this.collapsed)this.initialState.set(e,!0)}getExpandedState(){return{expandedRowGroupIds:Array.from(this.expanded),collapsedRowGroupIds:Array.from(this.collapsed)}}setRowExpanded(e,t){let n=e.id,r=this.initialState.get(n)===t;if(t){this.collapsed.delete(n),r||this.expanded.add(n);return}this.expanded.delete(n),r||this.collapsed.add(n)}isRowExpanded(e){let t=e.id;if(this.expanded.has(t))return!0;if(this.collapsed.has(t))return!1;let n=this.initialState.get(t);if(n!=null)return n;let r=this.getInitialRowState(e);return this.initialState.set(t,r),r}getInitialRowState(e){if(!e.isExpandable())return!1;let t=this.gos.getCallback(`isServerSideGroupOpenByDefault`);return t?t({data:e.data,rowNode:e}):!1}isRowInitialised(e){return this.initialState.has(e)}expandAll(e){this.beans.rowModel.forEachNode(t=>{this.setRowExpanded(t,e)})}},ExpandAllStrategy=class extends U{constructor(){super(...arguments),this.name=`expandAll`,this.allExpanded=void 0,this.flipped=new Set}setExpandedState(e){this.allExpanded=e.expandAll,this.flipped=new Set(e.invertedRowGroupIds)}getExpandedState(){return{expandAll:this.allExpanded,invertedRowGroupIds:Array.from(this.flipped)}}setRowExpanded(e,t){let n=e.id;if(t===this.allExpanded){this.flipped.delete(n);return}this.flipped.add(n)}isRowExpanded(e){let t=e.id;return this.allExpanded!==this.flipped.has(t)}isRowInitialised(){return!0}expandAll(e){this.allExpanded=e,this.flipped.clear()}},ServerSideExpansionService=class extends BaseExpansionService{constructor(){super(...arguments),this.beanName=`expansionSvc`}wireBeans(e){this.serverSideRowModel=e.rowModel,this.storeFactory=e.ssrmStoreFactory}postConstruct(){let setDefaultExpand=()=>{this.strategy=this.createManagedBean(new ExpandStrategy)};this.addManagedEventListeners({columnRowGroupChanged:setDefaultExpand,columnPivotChanged:setDefaultExpand,columnPivotModeChanged:setDefaultExpand}),this.addManagedPropertyListener(`ssrmExpandAllAffectsAllRows`,e=>{e.currentValue||(this.strategy=this.createManagedBean(new ExpandStrategy),this.updateAllNodes(),this.dispatchStateUpdatedEvent())}),setDefaultExpand()}setExpansionState(e){let t=`expandAll`in e;
8t!==this.isExpandAllStrategy(this.strategy)&&(this.strategy=t?this.createManagedBean(new ExpandAllStrategy):this.createManagedBean(new ExpandStrategy)),this.strategy.setExpandedState(e),this.dispatchStateUpdatedEvent(),this.updateAllNodes()}getExpansionState(){return this.strategy.getExpandedState()}updateAllNodes(){this.serverSideRowModel.forEachNode(e=>{super.setExpanded(e,this.isNodeExpanded(e))})}isNodeExpanded(e){return this.strategy.isRowExpanded(e)}setExpanded(e,t,n,r){this.strategy.setRowExpanded(e,t),super.setExpanded(e,t,n),this.dispatchStateUpdatedEvent(),this.updateExpandedState(e)}expandAll(e){let t=this.beans.gos.get(`ssrmExpandAllAffectsAllRows`),n=!this.isExpandAllStrategy(this.strategy)&&t;this.strategy=n?new ExpandAllStrategy:this.strategy,this.strategy.expandAll(e),this.updateAllNodes(),this.dispatchStateUpdatedEvent(),this.beans.eventSvc.dispatchEvent({type:`expandOrCollapseAll`,source:e?`expandAll`:`collapseAll`})}isExpandAllStrategy(e){return e.name===`expandAll`}onGroupExpandedOrCollapsed(){}setDetailsExpansionState(e){let{gos:t}=this.beans;if(!t.get(`ssrmExpandAllAffectsAllRows`))return;let n=this.getExpansionState();if(n.expandAll===void 0)return;let r=n.expandAll&&n.invertedRowGroupIds.length===0;if((!n.expandAll&&n.invertedRowGroupIds.length===0)!==r)return r?e.expandAll():e.collapseAll()}dispatchExpandedEvent(e){this.eventSvc.dispatchEvent(e),this.beans.rowRenderer.refreshCells({rowNodes:[e.node]})}updateExpandedState(e){let t=e.childStore;if(e.expanded){if(e.master&&!e.detailNode&&(e.detailNode=this.createDetailNode(e)),!t&&e.hasChildren()){let t=this.serverSideRowModel.getParams();e.childStore=this.createBean(this.storeFactory.createStore(t,e))}}else t&&this.gos.get(`purgeClosedRowNodes`)&&(e.childStore=this.destroyBean(t))}createDetailNode(e){let t=new zc(this.beans);return t.detail=!0,t.selectable=!1,t.parent=e,Xs(e.id)&&(t.id=`detail_`+e.id),t.data=e.data,t.level=e.level+1,t.rowHeight=ru(this.beans,t).height||200,t}},DefaultStrategy=class extends U{constructor(e){super(),this.selectionCtx=e,this.selectedState={selectAll:!1,toggledNodes:new Set},this.selectAllUsed=!1,this.selectedNodes={}}getSelectedState(){return{selectAll:this.selectedState.selectAll,toggledNodes:[...this.selectedState.toggledNodes]}}setSelectedState(e){if(typeof e!=`object`){Hl(116);return}if(!(`selectAll`in e)){Hl(116);return}if(typeof e.selectAll!=`boolean`){Hl(117);return}if(!(`toggledNodes`in e)||!Array.isArray(e.toggledNodes))return q(197);let t={selectAll:e.selectAll,toggledNodes:new Set};e.toggledNodes.forEach(e=>{typeof e==`string`?t.toggledNodes.add(e):q(196,{key:e})});let n=t.selectAll||t.toggledNodes.size>1;if(ol(this.gos)&&!vl(this.gos)&&n){q(130);return}this.selectedState=t}deleteSelectionStateFromParent(e,t){if(this.selectedState.toggledNodes.size===0)return!1;let n=!1;for(let e of t)this.selectedState.toggledNodes.delete(e)&&(n=!0);return n}setNodesSelected(e){let{nodes:t,clearSelection:n,newValue:r,source:i}=e;if(t.length===0)return 0;let o=n&&r;if(!vl(this.gos)||o){if(t.length>1)return Hl(130),0;let e=t[0],n=e.footer?e.sibling:e;return r&&n.selectable?(this.selectedNodes={[n.id]:n},this.selectedState={selectAll:!1,toggledNodes:new Set([n.id])}):(this.selectedNodes={},this.selectedState={selectAll:!1,toggledNodes:new Set}),1}let updateNodeState=(e,t=r)=>{let n=e.footer?e.sibling:e;t&&n.selectable?this.selectedNodes[n.id]=n:delete this.selectedNodes[n.id],t===this.selectedState.selectAll||!n.selectable?this.selectedState.toggledNodes.delete(n.id):this.selectedState.toggledNodes.add(n.id)};for(let e of t)updateNodeState(e);return t.length===1&&i===`api`&&this.selectionCtx.setRoot(t[0].footer?t[0].sibling:t[0]),1}processNewRow(e){this.selectedNodes[e.id]&&(this.selectedNodes[e.id]=e)}isNodeSelected(e){let t=this.selectedState.toggledNodes.has(e.id);return this.selectedState.selectAll?!t:t}getSelectedNodes(e=!1,t=!0){let{selectedState:{selectAll:n},selectedNodes:r,selectAllUsed:i}=this;return t&&i&&q(199),e&&n?null:Object.values(r)}getSelectedRows(){return(this.getSelectedNodes()??[]).map(e=>e.data)}getSelectionCount(){return this.selectedState.selectAll?-1:this.selectedState.toggledNodes.size}isEmpty(){return!this.selectedState.selectAll&&!this.selectedState.toggledNodes?.size}selectAllRowNodes(){this.reset(!0)}deselectAllRowNodes(){this.reset(!1)}reset(e){this.selectedState={selectAll:e,toggledNodes:new Set},this.selectedNodes={},this.selectAllUsed||=e}getSelectAllState(){return this.selectedState.selectAll?this.selectedState.toggledNodes.size>0?null:!0:this.selectedState.toggledNodes.size>0&&null}},GroupSelectsChildrenStrategy=class extends U{constructor(e){super(),this.selectionCtx=e,this.selectedState={selectAllChildren:!1,toggledNodes:new Map}}wireBeans(e){this.rowModel=e.rowModel,this.rowGroupColsSvc=e.rowGroupColsSvc,this.filterManager=e.filterManager,this.selectionSvc=e.selectionSvc}postConstruct(){this.addManagedEventListeners({modelUpdated:()=>this.removeRedundantState(),columnRowGroupChanged:()=>this.selectionSvc.reset(`rowGroupChanged`)})}getSelectedState(){let{gos:e,rowGroupColsSvc:t,selectedState:n}=this,r=e.get(`treeData`),recursivelySerializeState=(e,n,i)=>{let o={nodeId:i};if((r||t&&n<=t.columns.length)&&(o.selectAllChildren=e.selectAllChildren),e.toggledNodes.size){let t=[];
8e.toggledNodes.forEach((e,r)=>{let i=recursivelySerializeState(e,n+1,r);t.push(i)}),o.toggledNodes=t}return o};return recursivelySerializeState(n,0)}setSelectedState(e){if(`selectAll`in e){Hl(111);return}let recursivelyDeserializeState=(e,t)=>{if(typeof e!=`object`)throw Hl(243),Error();if(`selectAllChildren`in e&&typeof e.selectAllChildren!=`boolean`)throw Hl(244),Error();if(`toggledNodes`in e){if(!Array.isArray(e.toggledNodes))throw Hl(245),Error();if(!e.toggledNodes.every(e=>typeof e==`object`&&`nodeId`in e&&typeof e.nodeId==`string`))throw Hl(246),Error()}let n=e.selectAllChildren??!t,r=e.toggledNodes?.map(e=>[e.nodeId,recursivelyDeserializeState(e,n)]);if(r?.some(([,e])=>n===e.selectAllChildren&&e.toggledNodes.size===0))throw Hl(247),Error();return{selectAllChildren:n,toggledNodes:new Map(r)}};try{this.selectedState=recursivelyDeserializeState(e,!!e.selectAllChildren)}catch{}}deleteSelectionStateFromParent(e,t){let n=this.selectedState,r=[...e];for(;n&&r.length;)n=n.toggledNodes.get(r.pop());if(!n)return!1;let i=!1;for(let e of t)n?.toggledNodes.delete(e)&&(i=!0);return i&&this.removeRedundantState(),i}setNodesSelected({nodes:e,newValue:t,clearSelection:n,source:r}){if(e.length===0)return 0;let i=n&&t;if(!vl(this.gos)||i){if(e.length>1)return Hl(130),0;this.deselectAllRowNodes()}for(let n of e){let e=n.footer?n.sibling:n,r=this.getRouteToNode(e);this.recursivelySelectNode(r,this.selectedState,t)}return this.removeRedundantState(),e.length===1&&r===`api`&&this.selectionCtx.setRoot(e[0].footer?e[0].sibling:e[0]),1}isNodeSelected(e){let t=this.getRouteToNode(e);return this.isNodePathSelected(t,this.selectedState)}isNodePathSelected([e,...t],n){if(t.length===0){let t=n.toggledNodes.has(e.id);return e.hasChildren()&&n.toggledNodes.get(e.id)?.toggledNodes.size?void 0:n.selectAllChildren?!t:t}if(n.toggledNodes.has(e.id)){let r=n.toggledNodes.get(e.id);if(r)return this.isNodePathSelected(t,r)}return n.selectAllChildren}getRouteToNode(e){let t=[],n=e;for(;n.parent;)t.push(n),n=n.parent;return t.reverse()}removeRedundantState(){if(this.filterManager?.isAnyFilterPresent())return;let forEachNodeStateDepthFirst=(e=this.selectedState,t,n)=>{if(e.toggledNodes.forEach((t,n)=>{forEachNodeStateDepthFirst(t,n,e)}),t){let n=this.rowModel.getRowNode(t)?.childStore;if(n?.isLastRowIndexKnown()&&e.toggledNodes.size>=n.getRowCount()){for(let t of e.toggledNodes.entries()){let[e,n]=t;if(n.toggledNodes.size>0||!this.rowModel.getRowNode(e))return}e.selectAllChildren=!e.selectAllChildren,e.toggledNodes.clear()}}let r=e.toggledNodes.size===0,i=n?.selectAllChildren===e.selectAllChildren;r&&i&&n?.toggledNodes.delete(t)};forEachNodeStateDepthFirst()}recursivelySelectNode([e,...t],n,r){if(!e)return;if(!t.length){let t=e.selectable;if(n.selectAllChildren===r||!t){n.toggledNodes.delete(e.id);return}let i={selectAllChildren:r,toggledNodes:new Map};n.toggledNodes.set(e.id,i);return}let i=n.toggledNodes.has(e.id),o=n.toggledNodes.get(e.id)??{selectAllChildren:n.selectAllChildren,toggledNodes:new Map};i||n.toggledNodes.set(e.id,o),this.recursivelySelectNode(t,o,r),n.selectAllChildren===o.selectAllChildren&&o.toggledNodes.size===0&&n.toggledNodes.delete(e.id)}getSelectedNodes(e=!1){if(q(202),this.selectedState.selectAllChildren&&e)return null;let t=[];return this.rowModel.forEachNode(e=>{e.isSelected()&&t.push(e)}),t}processNewRow(){}getSelectedRows(){return this.getSelectedNodes()?.map(e=>e.data)??[]}getSelectionCount(){return-1}isEmpty(){return!this.selectedState.selectAllChildren&&!this.selectedState.toggledNodes?.size}selectAllRowNodes(){this.reset(!0)}deselectAllRowNodes(){this.reset(!1)}reset(e){this.selectedState={selectAllChildren:e,toggledNodes:new Map}}getSelectAllState(){return this.selectedState.selectAllChildren?this.selectedState.toggledNodes.size>0?null:!0:this.selectedState.toggledNodes.size>0&&null}},ServerSideSelectionService=class extends hl{constructor(){super(...arguments),this.beanName=`selectionSvc`}postConstruct(){super.postConstruct(),this.addManagedPropertyListeners([`groupSelectsChildren`,`rowSelection`],()=>{let e=Nc(this.gos),t=e&&this.selectionStrategy instanceof DefaultStrategy?GroupSelectsChildrenStrategy:!e&&this.selectionStrategy instanceof GroupSelectsChildrenStrategy?DefaultStrategy:void 0;t&&(this.destroyBean(this.selectionStrategy),this.selectionStrategy=this.createManagedBean(new t(this.selectionCtx)),this.shotgunResetN
8odeSelectionState(),this.dispatchSelectionChanged(`api`))}),this.addManagedPropertyListeners([`rowSelection`],()=>{let e=$o(this.gos);e!==this.selectionMode&&(this.selectionMode=e,this.deselectAllRowNodes({source:`api`}))}),this.selectionMode=$o(this.gos);let e=Nc(this.gos)?GroupSelectsChildrenStrategy:DefaultStrategy;this.selectionStrategy=this.createManagedBean(new e(this.selectionCtx))}handleSelectionEvent(e,t,n){if(this.isRowSelectionBlocked(t))return 0;let r=0,i=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,n);return i==null?0:(this.selectionCtx.selectAll=!1,`select`in i?(i.reset?this.selectionStrategy.deselectAllRowNodes({source:`api`}):this.selectionStrategy.setNodesSelected({nodes:i.deselect,newValue:!1,source:n}),r=this.selectionStrategy.setNodesSelected({nodes:i.select,newValue:!0,source:n})):r=this.selectionStrategy.setNodesSelected({nodes:[i.node],newValue:i.newValue,clearSelection:i.clearSelection,event:e,source:n}),this.shotgunResetNodeSelectionState(n),this.dispatchSelectionChanged(n),r)}getSelectionState(){return this.selectionStrategy.getSelectedState()}setSelectionState(e,t){if(!Uo(this.gos)){e&&q(132);return}Array.isArray(e)||(e?(this.selectionStrategy.setSelectedState(e),this.shotgunResetNodeSelectionState(),this.dispatchSelectionChanged(t)):this.deselectAllRowNodes({source:t}))}setNodesSelected(e){if(!Uo(this.gos)&&e.newValue)return q(132),0;let{nodes:t,...n}=e;if(t.length>1&&this.selectionMode!==`multiRow`)return q(130),0;let r={nodes:t.filter(e=>e.selectable),...n};if(!r.nodes.length)return 0;let i=this.selectionStrategy.setNodesSelected(r);return this.shotgunResetNodeSelectionState(r.source),this.dispatchSelectionChanged(r.source),i}deleteSelectionStateFromParent(e,t){this.selectionStrategy.deleteSelectionStateFromParent(e,t)&&(this.shotgunResetNodeSelectionState(),this.dispatchSelectionChanged(`api`))}shotgunResetNodeSelectionState(e){this.beans.rowModel.forEachNode(t=>{if(t.stub)return;let n=this.selectionStrategy.isNodeSelected(t);n!==t.isSelected()&&this.selectRowNode(t,n,void 0,e)})}getSelectedNodes(){return this.selectionStrategy.getSelectedNodes()??[]}getSelectedRows(){return this.selectionStrategy.getSelectedRows()}getSelectionCount(){return this.selectionStrategy.getSelectionCount()}syncInRowNode(e){this.selectionStrategy.processNewRow(e);let t=this.selectionStrategy.isNodeSelected(e);if(t!=0&&!e.selectable){this.selectionStrategy.setNodesSelected({nodes:[e],newValue:!1,source:`api`}),this.shotgunResetNodeSelectionState(),this.dispatchSelectionChanged(`api`);return}e.__selected=t}reset(){this.selectionStrategy.deselectAllRowNodes({source:`api`}),this.selectionCtx.reset()}isEmpty(){return this.selectionStrategy.isEmpty()}hasNodesToSelect(){return!0}selectAllRowNodes(e){if(!Uo(this.gos)){q(132);return}if(validateSelectionParameters(e),ol(this.gos)&&!vl(this.gos))return q(130);this.selectionStrategy.selectAllRowNodes(e),this.selectionCtx.selectAll=!0,this.beans.rowModel.forEachNode(t=>{t.stub||this.selectRowNode(t,!0,void 0,e.source)}),this.dispatchSelectionChanged(e.source)}deselectAllRowNodes(e){validateSelectionParameters(e),this.selectionStrategy.deselectAllRowNodes(e),this.selectionCtx.selectAll=!1,this.beans.rowModel.forEachNode(t=>{t.stub||this.selectRowNode(t,!1,void 0,e.source)}),this.dispatchSelectionChanged(e.source)}getSelectAllState(e){return this.selectionStrategy.getSelectAllState(e)}getBestCostNodeSelection(){return q(194,{method:`getBestCostNodeSelection`})}updateSelectable(){if(!Uo(this.gos))return;let e=[];this.beans.rowModel.forEachNode(t=>{!this.updateRowSelectable(t,!0)&&t.isSelected()&&e.push(t)}),e.length&&this.setNodesSelected({nodes:e,newValue:!1,source:`selectableChanged`})}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:`selectionChanged`,source:e,selectedNodes:this.selectionStrategy instanceof GroupSelectsChildrenStrategy?null:this.selectionStrategy.getSelectedNodes(!0,!1),serverSideState:this.getSelectionState()})}updateSelectableAfterGrouping(){return Hl(194,{method:`updateSelectableAfterGrouping`})}refreshMasterNodeState(){}setDetailSelectionState(){}};function validateSelectionParameters({selectAll:e}){(e===`filtered`||e===`currentPage`)&&q(195,{justCurrentPage:e===`currentPage`})}var SsrmRowChildrenService=class extends U{constructor(){super(...arguments),this.beanName=`rowChildrenSvc`}getHasChildrenValue(e){let t=this.gos.get(`treeData`),n=this.gos.get(`isServerSideGroup`);return!e.stub&&!e.footer&&(t?!!n&&n(e.data):!!e.group)}},LazyBlockLoadingService=class extends U{constructor(){super(...arguments),this.beanName=`lazyBlockLoadingSvc`,this.outboundRequests=0,this.cacheLoadingNodesMap=new Map,this.isCheckQueued=!1,this.nextBlockToLoad=void 0}wireBeans(e){this.rowRenderer=e.rowRenderer,this.rowModel=e.rowModel}postConstruct(){this.maxOutboundRequests=oc(this.gos)}subscribe(e){this.cacheLoadingNodesMap.set(e,new Set)}unsubscribe(e){this.cacheLoadingNodesMap.delete(e)}queueLoadCheck(){this.isCheckQueued||(this.isCheckQueued=!0,setTimeout(()=>{this.queueLoadAction(),this.isCheckQueued=!1}))}onLoadComplete(){--this.outboundRequests,this.queueLoadCheck()}hasAvailableLoadBandwidth(){return this.maxOutboundRequests===void 0||this.outboundRequests<this.maxOutboundRequests}queueLoadAction(){let e=this.getBlockToLoad();if(!e)return;let 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);let t=Number(this.nextBlockToLoad.index),n=this.nextBlockToLoad.cache,r=e.index+e.cache.getBlockSize();this.loaderTimeout=window.setTimeout(()=>{n.isAlive()&&(this.loaderTimeout=void 0,this.attemptLoad(n,t,r),this.nextBlockToLoad=void 0)},this.gos.get(`blockLoadDebounceMillis`))}}attemptLoad(e,t,n){this.hasAvailableLoadBandwidth()&&(this.executeLoad(e,t,n),this.queueLoadCheck())}executeLoad(e,t,n){let r=e.getSsrmParams(),i={startRow:t,endRow:n,rowGroupCols:r.rowGroupCols,valueCols:r.valueCols,pivotCols:r.pivotCols,pivotMode:r.pivotMode,groupKeys:e.store.getParentNode().getRoute()??[],filterModel:r.filterModel,sortModel:r.sortModel},o=this.cacheLoadingNodesMap.get(e),removeNodesFromLoadingMap=()=>{for(let e=0;e<n-t;e++)o.delete(t+e)},addNodesToLoadingMap=()=>{for(let e=0;e<n-t;e++)o.add(t+e)},success=r=>{this.onLoadComplete(),e.onLoadSuccess(t,n-t,r),removeNodesFromLoadingMap()},fail=()=>{this.onLoadComplete(),e.onLoadFailed(t,n-t),removeNodesFromLoadingMap()},s=co(this.gos,{request:i,success,fail,parentNode:e.store.getParentNode()});addNodesToLoadingMap(),this.outboundRequests+=1,e.getSsrmParams().datasource?.getRows(s)}
8getBlockToLoad(){let e=this.rowRenderer.firstRenderedRow,t=this.rowRenderer.lastRenderedRow;for(let n=e;n<=t;n++){let e=this.rowModel.getRow(n);if(!e)continue;let t=e.parent?.childStore;if(!t)continue;let r=t.getCache(),i=r.getNodes().getBy(`node`,e);if(i&&!this.cacheLoadingNodesMap.get(r)?.has(i.index)&&(e.__needsRefreshWhenVisible||e.stub&&!e.failedLoad))return{cache:r,index:r.getBlockStartIndex(i.index)}}let n=null,r=null,i=2**53-1;for(let o of this.cacheLoadingNodesMap.keys())o.getNodesToRefresh().forEach(s=>{if(s.rowIndex==null){r=s,n=o;return}let c=o.getNodes().getBy(`node`,s);if(!c||this.cacheLoadingNodesMap.get(o)?.has(c.index))return;let p=Math.abs(e-s.rowIndex),m=Math.abs(s.rowIndex-t);p<i&&(r=s,i=p,n=o),m<i&&(r=s,i=m,n=o)});if(!n)return;let o=n,s=o.getNodes().getBy(`node`,r)?.index;return s==null?void 0:{cache:o,index:o.getBlockStartIndex(s)}}isRowLoading(e,t){return this.cacheLoadingNodesMap.get(e)?.has(t)??!1}},MultiIndexMap=class{constructor(...e){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){return this.maps.get(e).get(t)}set(e){for(let t of this.indexes)this.maps.get(t).set(e[t],e)}delete(e){for(let t of this.indexes)this.maps.get(t).delete(e[t])}clear(){this.maps.forEach(e=>e.clear())}getIterator(e){return this.maps.get(e).values()}forEach(e){let t=this.getIterator(this.indexes[0]),n;for(;(n=t.next())&&!n.done;)e(n.value)}find(e){let t=this.getIterator(this.indexes[0]),n;for(;(n=t.next())&&!n.done;)if(e(n.value))return n.value}filter(e){let t=this.getIterator(this.indexes[0]),n,r=[];for(;(n=t.next())&&!n.done;)e(n.value)&&r.push(n.value);return r}},Pv=100,LazyCache=class extends U{constructor(e,t,n,r){super(),this.live=!0,this.removedNodeCache=new Map,this.store=e,this.numberOfRows=t,this.isLastRowKnown=n,this.storeParams=r}wireBeans(e){this.rowRenderer=e.rowRenderer,this.blockUtils=e.ssrmBlockUtils,this.focusSvc=e.focusSvc,this.nodeManager=e.ssrmNodeManager,this.serverSideRowModel=e.rowModel,this.rowNodeSorter=e.rowNodeSorter,this.sortSvc=e.sortSvc,this.lazyBlockLoadingSvc=e.lazyBlockLoadingSvc,this.colModel=e.colModel}postConstruct(){this.lazyBlockLoadingSvc.subscribe(this),this.nodeMap=new MultiIndexMap(`index`,`id`,`node`),this.nodeDisplayIndexMap=new Map,this.nodesToRefresh=new Set,this.defaultNodeIdPrefix=this.blockUtils.createNodeIdPrefix(this.store.getParentNode()),this.getRowIdFunc=Zs(this.gos),this.isMasterDetail=this.gos.get(`masterDetail`)}destroy(){this.lazyBlockLoadingSvc.unsubscribe(this),this.numberOfRows=0,this.nodeMap.forEac
8h(e=>this.blockUtils.destroyRowNode(e.node)),this.nodeMap.clear(),this.nodeDisplayIndexMap.clear(),this.nodesToRefresh.clear(),this.live=!1,super.destroy()}getRowByDisplayIndex(e){if(!this.store.isDisplayIndexInStore(e))return;let t=this.nodeDisplayIndexMap.get(e);if(t)return(t.stub||t.__needsRefreshWhenVisible)&&this.lazyBlockLoadingSvc.queueLoadCheck(),t;if(this.gos.get(`groupHideOpenParents`)||this.gos.get(`groupAllowUnbalanced`)){let t=this.nodeMap.find(t=>!!t.node.childStore?.isDisplayIndexInStore(e));if(t)return t.node.childStore?.getRowUsingDisplayIndex(e)}if(e===this.store.getDisplayIndexStart())return this.createStubNode(0,e);let n=this.nodeDisplayIndexMap.get(e-1);if(n){if(this.isMasterDetail&&n.master&&n.expanded)return n.detailNode;if(n.expanded&&n.childStore?.isDisplayIndexInStore(e))return n.childStore?.getRowUsingDisplayIndex(e);let t=this.nodeMap.getBy(`node`,n);return this.createStubNode(t.index+1,e)}let r=this.getSurroundingNodesByDisplayIndex(e);if(r==null){let t=this.store.getRowCount()-(this.store.getDisplayIndexEnd()-e);return this.createStubNode(t,e)}let{previousNode:i,nextNode:o}=r;if(i?.node.expanded&&i.node.childStore?.isDisplayIndexInStore(e))return i.node.childStore?.getRowUsingDisplayIndex(e);if(o){let t=o.node.rowIndex-e,n=o.index-t;return this.createStubNode(n,e)}let s=this.store.getRowCount()-(this.store.getDisplayIndexEnd()-e);return this.createStubNode(s,e)}createStubNode(e,t){let n=this.store.getRowBounds(t),r=this.createRowAtIndex(e,null,e=>{e.setRowIndex(t),e.setRowTop(n.rowTop),this.nodeDisplayIndexMap.set(t,e)});if(e===0&&this.gos.get(`groupHideOpenParents`)){let e=this.store.getParentNode().groupData;if(e)for(let t of Object.keys(e))setRowNodeGroupValue(r,this.colModel,t,e[t])}return this.lazyBlockLoadingSvc.queueLoadCheck(),r}getRowByStoreIndex(e){return this.nodeMap.getBy(`index`,e)?.node}skipDisplayIndexes(e,t,n){if(e===0)return;let r=Ul(this.beans);t.value+=e,n.value+=e*r}setDisplayIndexes(e,t,n){this.nodeDisplayIndexMap.clear();let r={};
8this.nodeMap.forEach(e=>{r[e.index]=e.node});let i=-1;for(let o of Object.keys(r)){let s=r[o],c=Number(o),p=c-1-i;this.skipDisplayIndexes(p,e,t);let m=c===0;if(s.firstChild!==m&&(s.firstChild=m,s.dispatchRowEvent(`firstChildChanged`)),m&&this.gos.get(`groupHideOpenParents`)){let e=this.store.getParentNode().groupData;if(e)for(let t of Object.keys(e))setRowNodeGroupValue(s,this.colModel,t,m?e[t]:void 0)}this.blockUtils.setDisplayIndex(s,e,t,n),s.rowIndex!=null&&this.nodeDisplayIndexMap.set(s.rowIndex,s),i=c}let o=this.numberOfRows-1-i;this.skipDisplayIndexes(o,e,t),this.purgeExcessRows()}getRowCount(){return this.numberOfRows}setRowCount(e,t){this.numberOfRows=e,t!=null&&(this.isLastRowKnown=t,t===!1&&(this.numberOfRows+=1)),this.fireStoreUpdatedEvent()}getNodes(){return this.nodeMap}getNodeCachedByDisplayIndex(e){return this.nodeDisplayIndexMap.get(e)??null}getNodesToRefresh(){return this.nodesToRefresh}getSurroundingNodesByDisplayIndex(e){let t,n;return this.nodeMap.forEach(r=>{if(e>r.node.rowIndex){(n==null||n.node.rowIndex<r.no
8de.rowIndex)&&(n=r);return}(t==null||t.node.rowIndex>r.node.rowIndex)&&(t=r)}),!n&&!t?null:{previousNode:n,nextNode:t}}getDisplayIndexFromStoreIndex(e){let t=this.nodeMap.getBy(`index`,e);if(t)return t.node.rowIndex;let n,r;if(this.nodeMap.forEach(t=>{if(e>t.index){(r==null||r.index<t.index)&&(r=t);return}(n==null||n.index>t.index)&&(n=t)}),!n)return this.store.getDisplayIndexEnd()-(this.numberOfRows-e);if(!r)return this.store.getDisplayIndexStart()+e;let i=e-r.index;return(r.node.childStore?.getDisplayIndexEnd()??r.node.rowIndex)+i}createRowAtIndex(e,t,n){let r=this.nodeMap.getBy(`index`,e);if(r){let{node:n}=r;if(n.__needsRefreshWhenVisible=!1,this.doesNodeMatch(t,n))return this.blockUtils.updateDataIntoRowNode(n,t),this.nodesToRefresh.delete(n),n;if(this.getRowIdFunc==null&&n.hasChildren()&&n.expanded)return this.nodesToRefresh.delete(n),n;this.destroyRowAtIndex(e)}if(t&&this.getRowIdFunc!=null){let n=this.getRowId(t),r=n&&this.removedNodeCache?.get(n);if(r)return this.removedNodeCache?.delete(n),this.blockUtils.updateDataIntoRowNode(r,t),this.nodeMap.set({id:r.id,node:r,index:e}),this.nodesToRefresh.delete(r),r.__needsRefreshWhenVisible=!1,r;let i=this.nodeMap.getBy(`id`,n);if(i){this.nodeMap.delete(i);let{node:n,index:r}=i;return this.blockUtils.updateDataIntoRowNode(n,t),this.nodeMap.set({id:n.id,node:n,index:e}),this.nodesToRefresh.delete(n),n.__needsRefreshWhenVisible=!1,this.getBlockStartIndex(r)===this.getBlockStartIndex(e)||this.markBlockForVerify(r),n}}let i=this.blockUtils.createRowNode(this.store.getRowDetails());if(t!=null){let e=this.getPrefixedId(this.store.getIdSequence().value++);this.blockUtils.setDataIntoRowNode(i,t,e,void 0),this.blockUtils.checkOpenByDefault(i),this.nodeManager.addRowNode(i)}return this.nodeMap.set({id:i.id,node:i,index:e}),n&&n(i),i}getBlockStates(){let e={},t={};
8this.nodeMap.forEach(({node:n,index:r})=>{let i=this.getBlockStartIndex(r);!n.stub&&!n.failedLoad&&(e[i]=(e[i]??0)+1);let o=`loaded`;n.failedLoad?o=`failed`:this.lazyBlockLoadingSvc.isRowLoading(this,i)?o=`loading`:(this.nodesToRefresh.has(n)||n.stub)&&(o=`needsLoading`),t[i]||(t[i]=new Set),t[i].add(o)});let n={loading:4,failed:3,needsLoading:2,loaded:1},r=this.blockUtils.createNodeIdPrefix(this.store.getParentNode()),i={};for(let o of Object.keys(t)){let s=[...t[o]].sort((e,t)=>(n[e]??0)-(n[t]??0))[0],c=Number(o)/this.getBlockSize(),p=r?`${r}-${c}`:String(c);i[p]={blockNumber:c,startRow:Number(o),endRow:Number(o)+this.getBlockSize(),pageStatus:s,loadedRowCount:e[o]??0}}return i}destroyRowAtIndex(e){let 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){let[t,n]=this.getBlockBounds(e);this.nodeMap.filter(e=>e.index>
8=t&&e.index<n).forEach(({node:e})=>{e.__needsRefreshWhenVisible=!0})}doesNodeMatch(e,t){if(t.stub)return!1;let n=this.getRowId(e);return n===null?t.data===e:t.id===n}purgeStubsOutsideOfViewport(){let{firstRenderedRow:e,lastRenderedRow:t}=this.rowRenderer,n=this.getBlockStartIndex(e),[,r]=this.getBlockBounds(t);this.nodeMap.forEach(e=>{this.lazyBlockLoadingSvc.isRowLoading(this,e.index)||e.node.failedLoad||e.node.stub&&(e.index<n||e.index>r)&&this.destroyRowAtIndex(e.index)})}getBlocksDistanceFromRow(e,t){let n={};return e.forEach(({node:e,index:r})=>{let[i,o]=this.getBlockBounds(r);if(i in n)return;let s=Math.abs(e.rowIndex-t),c,p=this.nodeMap.getBy(`index`,[o-1]);p&&(c=Math.abs(p.node.rowIndex-t)),n[i]=c==null||s<c?s:c}),Object.entries(n)}purgeExcessRows(){if(this.purgeStubsOutsideOfViewport(),this.store.getDisplayIndexEnd()==null||this.storeParams.maxBlocksInCache==null)return;let{firstRenderedRow:e,lastRenderedRow:t}=this.rowRenderer,n=new Set,r=new Set;this.nodeMap.forEach(({index:i,node:o})=>{let s=this.getBlockStartIndex(i);n.add(s),o.rowIndex>=e&&o.rowIndex<=t&&r.add(s)});let i=Math.max(r.size,this.storeParams.maxBlocksInCache??0),o=n.size-i;if(o<=0)return;let s=2**53-1,c=-(2**53-1);r.forEach(e=>{s>e&&(s=e),c<e&&(c=e)});let p=this.nodeMap.filter(({node:e,index:t})=>{let n=this.getBlockStartIndex(t);return!(n>=s&&n<=c)&&!this.isNodeCached(e)});if(p.length===0)return;let m=e+(t-e)/2,h=this.getBlocksDistanceFromRow(p,m),g=this.getBlockSize();h.sort((e,t)=>Math.sign(t[1]-e[1]));for(let e=0;e<Math.min(o,h.length);e++){let t=Number(h[e][0]);for(let e=t;e<t+g;e++){let t=this.nodeMap.getBy(`index`,e);!t||this.isNodeCached(t.node)||this.destroyRowAtIndex(e)}}}isNodeFocused(e){let t=this.focusSvc.getFocusCellToUseAfterRefresh();return!t||t.rowPinned!=null?!1:t.rowIndex===e.rowIndex}isNodeCached(e){let t=e.isExpandable()&&e.expanded,n=this.gos.get(`groupAllowUnbalanced`)&&e.key===``,r=!!this.beans.editSvc?.isRowEditing(e);return t||this.isNodeFocused(e)||n||r}extractDuplicateIds(e){if(this.getRowIdFunc==null)return[];let t=new Set,n=new Set;return e.forEach(e=>{let r=this.getRowId(e);if(t.has(r)){n.add(r);return}t.add(r)}),[...n]}onLoadSuccess(e,t,n){if(!this.live)return;let r=n.groupLevelInfo;if(this.store.setStoreInfo(r),this.getRowIdFunc!=null){let r=this.extractDuplicateIds(n.rowData);if(r.length>0){let n=r.join(`, `);q(205,{duplicateIdText:n}),this.onLoadFailed(e,t);return}}n.pivotResultFields&&this.serverSideRowModel.generateSecondaryColumns(n.pivotResultFields);let i=this.nodesToRefresh.size>0;if(n.rowData.forEach((t,n)=>{let r=e+n,i=this.nodeMap.getBy(`index`,r);if(i?.node?.stub){this.createRowAtIndex(r,t);return}if(i&&this.doesNodeMatch(t,i.node)){this.blockUtils.updateDataIntoRowNode(i.node,t),this.nodesToRefresh.delete(i.node),i.node.__needsRefreshWhenVisible=!1;return}this.createRowAtIndex(r,t)}),n.rowCount!=null&&n.rowCount!==-1)this.numberOfRows=n.rowCount,this.isLastRowKnown=!0;else if(t>n.rowData.length)this.numberOfRows=e+n.rowData.length,this.isLastRowKnown=!0;else if(!this.isLastRowKnown){let t=e+n.rowData.length+1;t>this.numberOfRows&&(this.numberOfRows=t)}this.isLastRowKnown&&this.nodeMap.filter(e=>e.index>
8=this.numberOfRows).forEach(e=>this.destroyRowAtIndex(e.index)),this.fireStoreUpdatedEvent();let o=this.nodesToRefresh.size===0;i&&o&&this.fireRefreshFinishedEvent()}fireRefreshFinishedEvent(){this.nodesToRefresh.size===0&&(this.removedNodeCache.forEach(e=>{this.blockUtils.destroyRowNode(e)}),this.removedNodeCache=new Map,this.store.fireRefreshFinishedEvent())}isStoreFullyLoaded(){let e=this.isLastRowKnown,t=this.nodeMap.getSize()===this.numberOfRows;if(!e||!t||this.nodesToRefresh.size>0)return;let n=-1;return this.nodeMap.find(e=>(n+=1,!!(e.index!==n||e.node.__needsRefreshWhenVisible||e.node.stub)))==null}isLastRowIndexKnown(){return this.isLastRowKnown}onLoadFailed(e,t){if(!this.live)return;let n=this.nodesToRefresh.size>0;for(let n=e;n<e+t&&n<this.getRowCount();n++){let{node:e}=this.nodeMap.getBy(`index`,n)??{};e&&this.nodesToRefresh.delete(e),e?.stub||(e&&!e.stub&&this.destroyRowAtIndex(n),e=this.createRowAtIndex(n)),e.__needsRefreshWhenVisible=!1,e.failedLoad=!0}let r=this.nodesToRefresh.size===0;n&&r&&this.fireRefreshFinishedEvent(),this.fireStoreUpdatedEvent()}
8markNodesForRefresh(){this.nodeMap.forEach(e=>{e.node.stub&&!e.node.failedLoad||this.nodesToRefresh.add(e.node)}),this.lazyBlockLoadingSvc.queueLoadCheck(),this.isLastRowKnown&&this.numberOfRows===0&&(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(this.getRowIdFunc==null)return null;let{level:t}=this.store.getRowDetails(),n=this.store.getParentNode().getRoute()??[];return this.getRowIdFunc({data:e,parentKeys:n.length>0?n:void 0,level:t})}getOrderedNodeMap(){let e={};return this.nodeMap.forEach(t=>e[t.index]=t),e}clearDisplayIndexes(){this.nodeDisplayIndexMap.clear()}clientSideSortRows(){let e=this.sortSvc?.getSortOptions()??[];if(!e.some(e=>e.sort!=null)||!this.rowNodeSorter)return;let t=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){let t=[];return e.forEach(e=>{let n=this.getRowId(e),r=this.nodeMap.getBy(`id`,n);r&&(this.blockUtils.updateDataIntoRowNode(r.node,e),t.push(r.node))}),t}insertRowNodes(e,t){let n=this.store.getRowCount()-+!!this.store.getParentNode().sibling,r=t==null&&this.isLastRowKnown?n:t;if(r==null||n<r)return[];let i={};e.forEach(e=>{let t=this.getRowId(e);t&&this.isNodeInCache(t)||(i[t]=e)});let o=Object.values(i),s=o.length;if(s===0)return[];let c=this.nodeMap.filter(e=>e.index>=r);return c.forEach(e=>this.nodeMap.delete(e)),c.forEach(e=>{this.nodeMap.set({node:e.node,index:e.index+s,id:e.id})}),this.numberOfRows+=s,o.map((e,t)=>this.createRowAtIndex(r+t,e))}removeRowNodes(e){let t=[],n=[],r=0,i=[...e],o=this.getOrderedNodeMap(),s=-1;for(let e of Object.keys(o)){s+=1;let c=o[e],p=i.findIndex(e=>e===c.id);if(p!==-1){i.splice(p,1),this.destroyRowAtIndex(Number(e)),t.push(c.node),r+=1;continue}if(r===0)continue;let m=Number(e);s!==m&&n.push(c.node),this.nodeMap.delete(c),this.nodeMap.set({id:c.id,node:c.node,index:m-r})}return this.numberOfRows-=this.isLastRowIndexKnown()?e.length:r,i.length>0&&n.length>0&&(n.forEach(e=>e.__needsRefreshWhenVisible=!0),this.lazyBlockLoadingSvc.queueLoadCheck()),t}getBlockSize(){return this.storeParams.cacheBlockSize||Pv}getBlockStartIndex(e){return e-e%this.getBlockSize()}getBlockBounds(e){let t=this.getBlockStartIndex(e);return[t,t+this.getBlockSize()]}},LazyStore=class extends U{constructor(e,t,n){super(),this.idSequence={value:0},this.ssrmParams=e,this.parentRowNode=n,this.storeParams=t,this.level=n.level+1,this.group=e.rowGroupCols?this.level<e.rowGroupCols.length:!1,this.leafGroup=e.rowGroupCols?this.level===e.rowGroupCols.length-1:!1,this.info={}}wireBeans(e){this.blockUtils=e.ssrmBlockUtils,this.storeUtils=e.ssrmStoreUtils,this.selectionSvc=e.selectionSvc,this.rowGroupColsSvc=e.rowGroupColsSvc}postConstruct(){let e=1;if(this.level===0&&(e=this.storeUtils.getServerSideInitialRowCount()??1,this.eventSvc.dispatchEventOnce({type:`rowCountReady`})),this.cache=this.createManagedBean(new LazyCache(this,e,!1,this.storeParams)),!this.gos.get(`treeData`)&&this.group&&this.rowGroupColsSvc){let e=this.ssrmParams.rowGroupCols[this.level];this.groupField=e.field,this.rowGroupColumn=this.rowGroupColsSvc.columns[this.level]}}destroy(){this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.destroyBean(this.cache),super.destroy()}applyRowData(e,t,n){this.cache.onLoadSuccess(t,n,e)}applyTransaction(e){let t=Zs(this.gos);if(!t)return q(206),{status:ko.Cancelled};let n=this.gos.getCallback(`isApplyServerSideTransaction`);if(n&&!n({transaction:e,parentNode:this.parentRowNode,groupLevelInfo:this.info}))return{status:ko.Cancelled};let r=this.cache.isStoreFullyLoaded(),i;e.update?.length&&(i=this.cache.updateRowNodes(e.update));let o;if(e.add?.length){let t=e.addIndex;t!=null&&t<0&&(t=void 0),o=this.cache.insertRowNodes(e.add,t)}let s;if(e.remove?.length){let n=e.remove.map(e=>t({level:this.level,parentKeys:this.parentRowNode.getRoute()??[],data:e})),r=[...new Set(n)];s=this.cache.removeRowNodes(r)}let c=this.gos.get(`serverSideEnableClientSideSort`),p=i?.length||o?.length;return r&&c&&p&&this.cache.clientSideSortRows(),this.updateSelectionAfterTransaction(i,s),{status:ko.Applied,update:i,add:o,remove:s}}updateSelectionAfterTransaction(e,t){if(!this.selectionSvc)return;let n=[];for(let t of e??[])t.isSelected()&&!t.selectable&&n.push(t);for(let e of t??[])e.isSelected()&&n.push(e);n.length&&this.selectionSvc.setNodesSelected({newValue:!1,clearSelection:!1,nodes:n,source:`rowDataChanged`})}clearDisplayIndexes(){this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.cache.getNodes().forEac
8h(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 this.cache.getRowCount()!==0&&this.displayIndexStart<=e&&e<this.getDisplayIndexEnd()}setDisplayIndexes(e,t,n){this.displayIndexStart=e.value,this.topPx=t.value;let r=this.parentRowNode.level>-1&&Gs(this.gos)({node:this.parentRowNode});r||_destroyRowNodeFooter(this.parentRowNode),r===`top`&&(_createRowNodeFooter(this.parentRowNode,this.beans),this.blockUtils.setDisplayIndex(this.parentRowNode.sibling,e,t,n)),this.cache.setDisplayIndexes(e,t,n),r===`bottom`&&(_createRowNodeFooter(this.parentRowNode,this.beans),this.blockUtils.setDisplayIndex(this.parentRowNode.sibling,e,t,n)),this.displayIndexEnd=e.value,this.heightPx=t.value-this.topPx}forEachStoreDeep(e,t={value:0}){e(this,t.value++),this.cache.getNodes().forEach(n=>{let r=n.node.childStore;r&&r.forEachStoreDeep(e,t)})}forEachNodeDeep(e,t={value:0}){this.cache.getNodes().forEach(n=>{e(n.node,t.value++);let r=n.node.childStore;r&&r.forEachNodeDeep(e,t)})}forEachNodeDeepAfterFilterAndSort(e,t={value:0},n=!1){let r=this.parentRowNode.level>-1&&Gs(this.gos)({node:this.parentRowNode});r===`top`&&e(this.parentRowNode.sibling,t.value++);let i=this.cache.getOrderedNodeMap();for(let r of Object.values(i)){e(r.node,t.value++);let i=r.node.childStore;i&&i.forEachNodeDeepAfterFilterAndSort(e,t,n)}r===`bottom`&&e(this.parentRowNode.sibling,t.value++)}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){if(!this.isDisplayIndexInStore(e))return null;let t=this.cache.getNodeCachedByDisplayIndex(e);if(t){let n=this.blockUtils.extractRowBounds(t,e);if(n)return n}let{previousNode:n,nextNode:r}=this.cache.getSurroundingNodesByDisplayIndex(e)??{};if(n){let t=this.blockUtils.extractRowBounds(n.node,e);if(t!=null)return t}let i=Ul(this.beans);if(r){let t=(r.node.rowIndex-e)*i;return{rowTop:r.node.rowTop-t,rowHeight:i}}return{rowTop:this.topPx+this.heightPx-(this.getDisplayIndexEnd()-e)*i,rowHeight:i}}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=2**53-1,n=null,r=2**53-1,i=null;if(this.cache.getNodes().forEach(({node:o})=>{let s=Math.abs(e-o.rowTop);if(o.rowTop<e){s<t&&(t=s,n=o);return}s<r&&(r=s,i=o)}),n=n,i=i,n){let t=this.blockUtils.getIndexAtPixel(n,e);if(t!=null)return t}let o=Ul(this.beans);if(i){let t=i.rowTop,n=Math.ceil((t-e)/o);return i.rowIndex-n}let s=this.topPx+this.heightPx,c=Math.floor((s-e)/o);return this.getDisplayIndexEnd()-c}getChildStore(e){return this.storeUtils.getChildStore(e,this,e=>{let 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)){let e=this.cache.isStoreFullyLoaded(),t=this.gos.get(`serverSideEnableClientSideSort`);if(!(e&&t)){let e=this.cache.getRowCount(),t=this.cache.isLastRowIndexKnown();this.destroyBean(this.cache),this.cache=this.createManagedBean(new LazyCache(this,e,t,this.storeParams));return}this.cache.clientSideSortRows()}this.forEachChildStoreShallow(t=>t.refreshAfterSort(e))}refreshAfterFilter(e){if(!this.storeUtils.isServerSideOnlyRefreshFilteredGroups()||this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,e)){this.refreshStore(!0);return}this.forEachChildStoreShallow(t=>t.refreshAfterFilter(e))}refreshStore(e){if(e){this.destroyBean(this.cache),this.cache=this.createManagedBean(new LazyCache(this,1,!1,this.storeParams)),this.fireStoreUpdatedEvent();return}this.cache.markNodesForRefresh()}getTopLevelRowDisplayedIndex(e){return this.cache.getDisplayIndexFromStoreIndex(e)??e}isLastRowIndexKnown(){return this.cache.isLastRowIndexKnown()}getRowNodesInRange(e,t){return this.cache.getNodes().filter(({node:n})=>n.rowIndex>=e.rowIndex&&n.rowIndex<=t.rowIndex).map(({node:e})=>e)}addStoreStates(e){e.push({route:this.parentRowNode.getRoute()??[],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}
8getRowDetails(){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(){this.eventSvc.dispatchEvent({type:`storeUpdated`})}fireRefreshFinishedEvent(){this.eventSvc.dispatchEvent({type:`storeRefreshed`,route:this.parentRowNode.getRoute()})}getBlockStates(){return this.cache.getBlockStates()}getStoreBounds(){return{topPx:this.topPx,heightPx:this.heightPx}}getCache(){return this.cache}getFirstNode(){return this.cache.getNodes().getBy(`index`,0)?.node??null}},StoreFactory=class extends U{constructor(){super(...arguments),this.beanName=`ssrmStoreFactory`}wireBeans(e){this.colModel=e.colModel,this.rowGroupColsSvc=e.rowGroupColsSvc,this.pivotColsSvc=e.pivotColsSvc,this.rowAutoHeight=e.rowAutoHeight}createStore(e,t){return new LazyStore(e,this.getStoreParams(e,t),t)}getStoreParams(e,t){let n=this.getLevelSpecificParams(t);return{cacheBlockSize:this.getBlockSize(n),maxBlocksInCache:this.getMaxBlocksInCache(e,n)}}getMaxBlocksInCache(e,t){let n=t?.maxBlocksInCache==null?this.gos.get(`maxBlocksInCache`):t.maxBlocksInCache;if(n!=null&&n>=0){if(e.dynamicRowHeight){q(203);return}if(this.rowAutoHeight?.active){q(204);return}return n}}getBlockSize(e){let t=e?.cacheBlockSize==null?this.gos.get(`cacheBlockSize`):e.cacheBlockSize;return t!=null&&t>0?t:100}getLevelSpecificParams(e){let t=this.gos.getCallback(`getServerSideGroupLevelParams`);if(t)return t({level:e.level+1,parentRowNode:e.level>=0?e:void 0,rowGroupColumns:this.rowGroupColsSvc?.columns??[],pivotColumns:this.pivotColsSvc?.columns??[],pivotMode:this.colModel.isPivotMode()})}},StoreUtils=class extends U{constructor(){super(...arguments),this.beanName=`ssrmStoreUtils`}wireBeans(e){this.colModel=e.colModel,this.serverSideRowModel=e.rowModel,this.storeFactory=e.ssrmStoreFactory}getChildStore(e,t,n){if(!e?.length)return t;let r=e[0],i=n(r);if(i){if(e.length===1&&!i.childStore){let e=this.serverSideRowModel.getParams();i.childStore=this.createBean(this.storeFactory.createStore(e,i))}let t=e.slice(1,e.length),n=i.childStore;return n?n.getChildStore(t):null}return null}isServerRefreshNeeded(e,t,n){if(n.valueColChanged||n.secondaryColChanged)return!0;let r=e.level+1;if(!(r<t.length))return!0;let i=t[r].id;return n.changedColumns.indexOf(i)>-1||this.colModel.getCols().filter(e=>e.getColDef().showRowGroup&&n.changedColumns.includes(e.getId())).map(e=>e.getColDef().showRowGroup).some(e=>e===!0||e===i)}getServerSideInitialRowCount(){return this.gos.get(`serverSideInitialRowCount`)}isServerSideSortAllLevels(){return this.gos.get(`serverSideSortAllLevels`)&&lc(this.gos)}isServerSideOnlyRefreshFilteredGroups(){return this.gos.get(`serverSideOnlyRefreshFilteredGroups`)&&lc(this.gos)}},TransactionManager=class extends U{constructor(){super(...arguments),this.beanName=`ssrmTxnManager`,this.asyncTransactions=[]}wireBeans(e){this.valueCache=e.valueCache,this.serverSideRowModel=e.rowModel,this.selectionSvc=e.selectionSvc}postConstruct(){lc(this.gos)}applyTransactionAsync(e,t){this.asyncTransactionsTimeout??this.scheduleExecuteAsync(),this.asyncTransactions.push({transaction:e,callback:t})}scheduleExecuteAsync(){let e=this.gos.get(`asyncTransactionWaitMillis`);this.asyncTransactionsTimeout=window.setTimeout(()=>{this.executeAsyncTransactions()},e)}executeAsyncTransactions(){if(!this.asyncTransactions)return;let e=[],t=[],n=[],r=!1;for(let i of this.asyncTransactions){let o;if(this.serverSideRowModel.executeOnStore(i.transaction.route,e=>{o=e.applyTransaction(i.transaction)})?o??={status:ko.StoreNotFound}:o={status:ko.StoreNotStarted},t.push(o),o.status==ko.StoreLoading){n.push(i);continue}i.callback&&e.push(()=>i.callback(o)),o.status===ko.Applied&&(r=!0)}e.length>0&&window.setTimeout(()=>{for(let t of e)t()},0),this.asyncTransactionsTimeout=void 0,this.asyncTransactions=n,r&&(this.valueCache?.onDataChanged(),this.eventSvc.dispatchEvent({type:`storeUpdated`})),t.length>0&&this.eventSvc.dispatchEvent({type:`asyncTransactionsFlushed`,results:t})}flushAsyncTransactions(){this.asyncTransactionsTimeout!=null&&clearTimeout(this.asyncTransactionsTimeout),this.executeAsyncTransactions()}applyTransaction(e){let t;if(!this.serverSideRowModel.executeOnStore(e.route,n=>{t=n.applyTransaction(e)}))return{status:ko.StoreNotStarted};if(t){if(this.valueCache?.onDataChanged(),t.remove&&this.selectionSvc){let n=t.remove.map(e=>e.id);this.selectionSvc.deleteSelectionStateFromParent(e.route||[],n)}return this.eventSvc.dispatchEvent({type:`storeUpdated`}),t}return{status:ko.StoreNotFound}}},Fv={moduleName:`ServerSideRowModel`,version:Z,rowModels:[`serverSide`],beans:[ServerSideRowModel,ExpandListener,StoreUtils,BlockUtils,NodeManager,TransactionManager,FilterListener,StoreFactory,ListenerUtils,ServerSideSelectionService,LazyBlockLoadingService,SsrmRowChildrenService,ServerSideExpansionService,SortListener],dependsOn:[fh,Yo,yo,Sv,jv,yv]},Iv={moduleName:`ServerSideRowModelApi`,version:Z,apiFunctions:{getServerSideSelectionState,setServerSideSelectionState,applyServerSideTransaction,applyServerSideTransactionAsync,applyServerSideRowData,retryServerSideLoads,flushServerSideAsyncTransactions,refreshServerSide,getServerSideGroupLevelState,resetRowHeights:eu,onRowHeightChanged:Bl},dependsOn:[fh,va,wl,lu]},Lv=`.ag-sparkline-wrapper{height:100%;line-height:normal;position:absolute;top:0;width:100%}`,Rv=Symbol(`WrappedFunctionMarker`),wrapFn=(e,t)=>{if(e[Rv])return e;let wrapped=(...n)=>t(e,...n);return wrapped[Rv]=Rv,wrapped};function tooltipRendererWithXValue(e){return{content:`${e.xValue} ${e.yValue}`}}function tooltipRenderer(e){return{content:`${e.yValue}`}}var SparklineCellRenderer=class extends K{constructor(){super({tag:`div`,cls:`ag-sparkline-wrapper`,children:[{tag:`span`,ref:`eSparkline`}]}),this.eSparkline=null,this.cachedWidth=0,this.cachedHeight=0,this.dataRef=[],this.processedData=[]}postConstruct(){this.env=this.beans.environment,this.addManagedPropertyListeners([`chartThemeOverrides`,`chartThemes`,`styleNonce`],()=>this.refresh(this.params))}createListener(e=!0){return()=>
8this.updateSize(this.params?.column?.getActualWidth()??0,(this.params?.node.rowHeight??0)-2,e)}initGridObserver(){let e=this.createListener(),t=this.createListener(!1),n=this.params?.column,r=this.params?.node;n.__addEventListener(`columnStateUpdated`,e),r.__addEventListener(`heightChanged`,e),this.addDestroyFunc(()=>{n.__removeEventListener(`columnStateUpdated`,e),r.__removeEventListener(`heightChanged`,e)}),t()}updateSize(e,t,n=!0){if(e-=this.env.getCellPadding(),e!==this.cachedWidth||t!==this.cachedHeight){this.cachedWidth=e,this.cachedHeight=t;let r=this.refresh.bind(this);n?uc(()=>this.isAlive()&&r()):r()}}init(e){this.params=e,this.initGridObserver()}refresh(e=this.params){var t;this.params=e;let n=this.cachedWidth,r=this.cachedHeight,i=this.gos.get(`styleNonce`);if(!this.sparklineInstance&&e&&n>0&&r>0){if(this.sparklineOptions={container:this.eSparkline,width:n,height:r,...e.sparklineOptions,...i?{styleNonce:i}:{},data:this.processData(e.value)},(t=this.sparklineOptions).type??(t.type=`line`),this.sparklineOptions.tooltip?.renderer)this.wrapTooltipRenderer();else{let e=this.getDefaultTooltipRenderer();this.sparklineOptions.tooltip={...this.sparklineOptions.tooltip,renderer:e}}let o=this.sparklineOptions?.theme;return this.sparklineOptions.type===`bar`&&this.sparklineOptions.itemStyler?this.wrapItemStyler(this.sparklineOptions):o?.overrides?.bar?.series?.itemStyler&&this.wrapItemStyler(o.overrides.bar.series),this.sparklineInstance=e.createSparkline(this.sparklineOptions),!0}return this.sparklineInstance?(this.sparklineInstance.update({...this.sparklineOptions,data:this.processData(e?.value),width:n,height:r,...i?{styleNonce:i}:{}}),!0):!1}processData(e=[]){return e.length===0?e:(this.dataRef!==e&&(this.dataRef=e,this.processedData=Array.isArray(e[0])?e.filter(e=>e!=null):e),this.processedData)}createContext(){return{data:this.params?.data,cellData:this.params?.value}}getDefaultTooltipRenderer(e){let t=e?.title,n=this.sparklineOptions.xKey,r=Array.isArray(this.sparklineOptions.data?.[0]);return!t&&(n||r)?tooltipRendererWithXValue:tooltipRenderer}wrapItemStyler(e){e.itemStyler=wrapFn(e.itemStyler,(e,t)=>e({...t,context:this.createContext()}))}wrapTooltipRenderer(){this.sparklineOptions.tooltip={...this.sparklineOptions.tooltip,renderer:wrapFn(this.sparklineOptions.tooltip.renderer,(e,t)=>{let n=e({...t,context:this.createContext()});return typeof n==`string`?n:{...this.getDefaultTooltipRenderer(n)(t),...n}})}}destroy(){super.destroy(),this.sparklineInstance?.destroy()}},zv=`Sparklines`,Bv={moduleName:zv,version:Z,dependsOn:[fh],validate:()=>({isValid:!1,message:bc(258)}),with:e=>(e.setup(),{moduleName:zv,version:Z,dependsOn:[fh],css:[Lv],userComponents:{agSparklineCellRenderer:{classImp:SparklineCellRenderer,params:{createSparkline:e.createSparkline}}},validate:()=>({isValid:!0})})},Vv=`.ag-find-cell{display:block;overflow:hidden;text-overflow:ellipsis}.ag-find-match{background-color:var(--ag-find-match-background-color);color:var(--ag-find-match-color)}.ag-find-active-match{background-color:var(--ag-find-active-match-background-color);color:var(--ag-find-active-match-color)}`;function findNext(e){e.findSvc?.next()}function findPrevious(e){e.findSvc?.previous()}function findGetTotalMatches(e){return e.findSvc?.totalMatches??0}function findGoTo(e,t,n){e.findSvc?.goTo(t,n)}function findClearActive(e){e.findSvc?.clearActive()}function findGetActiveMatch(e){return e.findSvc?.activeMatch}function findGetNumMatches(e,t){let{node:n,column:r}=t;return e.findSvc?.getNumMatches(n,r)??0}function findGetParts(e,t){return e.findSvc?.getParts(t)??[]}function findRefresh(e){return e.findSvc?.refresh(!0)}var Hv={tag:`span`,cls:`ag-find-cell`},FindCellRenderer=class extends K{constructor(){super(Hv)}init(e){this.refresh(e)}refresh(e){let{node:t,column:n}=e,{findSvc:r,valueSvc:i}=this.beans,{value:o,valueFormatted:s}=i.getValueForDisplay(n,t,!0),c=s??o??``,p=this.getGui();Ml(p);let m=r?.getParts({value:c,node:t,column:n??null});if(!m)p.textContent=cc(c)??``,p.classList.remove(`ag-find-cell-active-match`);else{let e=!1;for(let{value:t,match:n,activeMatch:r}of m){let i=cc(t)??``;if(n){let t=Dl({tag:`mark`,cls:`ag-find-match`});t.textContent=i,r&&(t.classList.add(`ag-find-active-match`),e=!0),p.appendChild(t)}else p.appendChild(document.createTextNode(i))}p.classList.toggle(`ag-find-cell-active-match`,e)}return!0}};function defaultCaseFormat(e){return e?.toLocaleLowerCase()}function getMatchesForValue(e,t,n){let r=t(cc(n)),i=0;if(r?.length){let t=-1;for(;t=r.indexOf(e,t+1),t!=-1;)i++}return i}var FindService=class extends U{constructor(){super(...arguments),this.beanName=`findSvc`,this.active=!1,this.topMatches=new Map,this.topNodes=[],this.topNumMatches=0,this.centerMatches=new Map,this.centerNodes=[],this.centerNumMatches=0,this.bottomMatches=new Map,this.bottomNodes=[],this.caseFormat=defaultCaseFormat,this.scrollOnRefresh=!1,this.totalMatches=0}postConstruct(){if(!Rc(this.gos))return;let e=this.refresh.bind(this,!1),t=this.refresh.bind(this,!0),n=hc(this,()=>{this.isAlive()&&t()},0);this.refreshDebounced=n,this.addManagedPropertyListener(`findSearchValue`,e),this.addManagedPropertyListener(`findOptions`,({currentValue:t,previousValue:n})=>{$s(t,n)||e()}),this.addManagedPropertyListeners([`groupSuppressBlankHeader`,`showOpenedGroup`],t),this.addManagedEventListeners({modelUpdated:t,displayedColumnsChanged:t,pinnedRowDataChanged:t,cellValueChanged:n,rowNodeDataChanged:n});let r=this.beans.rowSpanSvc;r&&this.addManagedListeners(r,{spannedCellsUpdated:n}),e()}next(){this.findAcrossContainers(!1,[`top`,null,`bottom`],1,1)}previous(){this.findAcrossContainers(!0,[`bottom`,null,`top`],this.totalMatches,-1)}goTo(e,t){if(!t&&e===this.activeMatch?.numOverall)return;let{topMatches:n,topNumMatches:r,centerMatches:i,centerNumMatches:o,bottomMatches:s}=this;if(e<=r){this.goToInContainer(n,e,0);return}if(e<=o){this.goToInContainer(i,e,r);return}
8this.goToInContainer(s,e,r+o)}clearActive(){this.activeMatch&&this.setActive(void 0)}isMatch(e,t){return this.active&&!!this.getMatches(e.rowPinned).get(e)?.some(([e])=>e===t)}getNumMatches(e,t){return this.getMatches(e.rowPinned).get(e)?.find(([e])=>e===t)?.[1]??0}getParts(e){let{value:t,node:n,column:r,precedingNumMatches:i}=e,o=this.findSearchValue,s=cc(t)??``;if(dl(o))return[{value:s}];let c=this.caseFormat(s)??``,p=this.getActiveMatchNum(n,r)-(i??0),m=0,h=0,g=o.length,_=[];for(;;){let e=c.indexOf(o,m);if(e!=-1){h++,e>m&&_.push({value:s.slice(m,e)});let t=e+g;_.push({value:s.slice(e,t),match:!0,activeMatch:h===p}),m=t}else return m<s.length&&_.push({value:s.slice(m)}),_}}registerDetailGrid(e,t){let n=this.gos;if(!Rc(n))return;let isSearchDetail=()=>n.get(`findOptions`)?.searchDetail,compareMatchesAndRefresh=t=>{t!==(this.centerMatches.get(e)?.[0]?.[1]??0)&&this.refreshDebounced()};t.addEventListener(`findChanged`,e=>{t.isDestroyed()||!this.isAlive()||!this.active||!isSearchDetail()||compareMatchesAndRefresh(e.totalMatches)}),t.addEventListener(`gridPreDestroyed`,()=>{if(!this.isAlive()||!this.active||!isSearchDetail())return;let t=e.parent,r=this.findSearchValue;if(!t||!r)return;let i=n.get(`detailCellRendererParams`)?.getFindMatches?.({node:t,data:t.data,findSearchValue:n.get(`findSearchValue`),updateMatches:this.refreshDebounced,getMatchesForValue:e=>getMatchesForValue(r,this.caseFormat,e)})??0;compareMatchesAndRefresh(i)}),isSearchDetail()&&t.setGridOption(`findSearchValue`,n.get(`findSearchValue`))}refresh(e){let t=new Set([...this.topNodes,...this.centerNodes,...this.bottomNodes]);this.topNodes=[],this.centerNodes=[],this.bottomNodes=[];let{topNodes:n,topMatches:r,centerMatches:i,centerNodes:o,bottomNodes:s,bottomMatches:c,beans:{gos:p,visibleCols:m,rowModel:h,valueSvc:g,pinnedRowModel:_,pagination:v,rowSpanSvc:y,masterDetailSvc:b,colModel:x},findSearchValue:S}=this,C=p.get(`findOptions`),w=C?.caseSensitive?e=>e??void 0:defaultCaseFormat;this.caseFormat=w;let T=p.get(`findSearchValue`),E=w(T?.trim());this.findSearchValue=E,r.clear(),i.clear(),c.clear();let D=e?this.activeMatch:void 0;this.activeMatch=void 0;let O=p.get(`masterDetail`)&&C?.searchDetail&&b;if(dl(E)){if(this.active=!1,this.topNumMatches=0,this.centerNumMatches=0,this.totalMatches=0,this.refreshRows(t),O){let e=b.store;for(let t of Object.keys(e))e[t]?.api?.findClearActive()}dl(S)||this.dispatchFindChanged();return}let k=m.allCols,ee=p.getCallback(`isFullWidthRow`),te=p.get(`detailCellRendererParams`),A=p.get(`fullWidthCellRendererParams`),j=p.get(`groupRowRendererParams`),ne=_getFlattenDetails(p),M=x.isPivotMode(),re=0,ie,ae,oe=!1,addMatches=(e,n,r,i)=>{if(!r)return;let o=ie.get(e);o||(o=[],ie.set(e,o),ae.push(e),i||t.add(e)),o.push([n,r]),re+=r},findMatchesForRow=e=>{if(oe){let t=e.rowIndex,n=e.parent;for(;t==null&&n;)t=n.rowIndex,n=n.parent;if(t==null||!v.isRowInPage(t))return}let t=e.hasChildren();if(!_shouldRowBeRendered(ne,e,t,M,_isRemovedSingleChildrenGroup(ne,e,t),_isRemovedLowestSingleChildrenGroup(ne,e,t)))return;let n=e.data;if(ee?.({rowNode:e}
8)){if(A){let t=A.getFindMatches?.({node:e,data:n,findSearchValue:T,updateMatches:this.refreshDebounced,getMatchesForValue:e=>getMatchesForValue(E,w,e)})??0;addMatches(e,null,t)}return}if(cu(p,e,M)){let t,r=j?.getFindText;if(r){let i=g.getValueForDisplay(void 0,e).value;t=r(co(p,{value:i,node:e,data:n,column:null,colDef:null,getValueFormatted:()=>{let{valueFormatted:t}=g.getValueForDisplay(void 0,e,!0);return t}}))}else{let{value:n,valueFormatted:r}=g.getValueForDisplay(void 0,e,!0);t=r??n}let i=getMatchesForValue(E,w,t);addMatches(e,null,i);return}let r=e.level>0&&p.get(`groupHideOpenParents`)&&e.parent?.getFirstChild()===e&&!e.parent?.expanded;for(let t of k){if(Ls(t))continue;let i=y?.getCellSpan(t,e);if(i&&i.firstNode!==e||t.colDef.showRowGroup&&r)continue;let o,s=t.colDef,c=s.getFindText;if(c){let r=g.getValueForDisplay(t,e).value;o=c(co(p,{value:r,node:e,data:n,column:t,colDef:s,getValueFormatted:()=>{let{valueFormatted:n}=g.getValueForDisplay(t,e,!0);return n}}))}else{let{value:n,valueFormatted:r}=g.getValueForDisplay(t,e,!0);o=r??n}let m=getMatchesForValue(E,w,o);addMatches(e,t,m)}if(e.master&&O){let t=e.detailNode;if(t){let e=t.detailGridInfo?.api;if(e){e.setGridOption(`findSearchValue`,T);let n=e.findGetTotalMatches();addMatches(t,null,n);return}}if(te){let r=te.getFindMatches?.({node:e,data:n,findSearchValue:T,updateMatches:this.refreshDebounced,getMatchesForValue:e=>getMatchesForValue(E,w,e)})??0;addMatches(t??{parent:e,dummy:!0},null,r,!t)}}};ie=r,ae=n,_?.forEachPinnedRow(`top`,findMatchesForRow),this.topNumMatches=re;let se=re;ie=i,ae=o,re=0,oe=!!v&&!!C?.currentPageOnly,h.forEachNodeAfterFilterAndSort(findMatchesForRow,!0),this.centerNumMatches=re,se+=re,ie=c,ae=s,re=0,oe=!1,_?.forEachPinnedRow(`bottom`,findMatchesForRow),se+=re,this.totalMatches=se,this.active=!0,this.refreshRows(t),D&&this.resetActiveMatch(D),this.dispatchFindChanged()}resetActiveMatch(e){let{column:t,numInMatch:n}=e,r=e.node;if(r.dummy){let e=r.parent?.detailNode;if(!e)return;r=e}let i=r.rowPinned??null;if(!this.getMatches(i)?.get(r)?.some(([e,r])=>e===t&&r>=n))return;let o=0;i==null?o=this.topNumMatches:i===`bottom`&&(o=this.topNumMatches+this.centerNumMatches);let updateNumInMatches=()=>{let e=this.getMatches(i);for(let i of e.keys()){let s=i===r,c=e.get(i);for(let[e,r]of c){if(s&&e===t){o+=n;return}o+=r}}};updateNumInMatches();let s={...e,node:r,numOverall:o};this.activeMatch=s,this.refreshRows(new Set([r]),t==null?void 0:new Set([t])),this.scrollOnRefresh&&(this.scrollOnRefresh=!1,this.scrollToActive(s)),this.setDetailActive(s)}refreshRows(e,t){e.size&&this.beans.rowRenderer.refreshCells({rowNodes:[...e],columns:t?[...t]:void 0,force:!0,suppressFlash:!0})}findAcrossContainers(e,t,n,r){if(!this.totalMatches){this.setActive();return}let i=this.activeMatch,o=t;if(i){let{column:n,node:s,numInMatch:c,numOverall:p}=i,m=s.rowPinned??null,h=p+r;if(this.findInContainer(m,e,h,s,n,c))return;let g=t.indexOf(m),_=t.length;if(t.slice(g+1,_).some(t=>this.findInContainer(t,e,h)))return;o=t.slice(0,g+1)}o.some(t=>this.findInContainer(t,e,n))}findInContainer(e,t,n,r,i,o){let s=this.getMatches(e),c=this.getRowNodes(e),p=t?-1:1;if(r!=null){let e=s.get(r),c=e?.findIndex(([e])=>e===i);if(c!=null&&c!=-1){let[i,s]=e[c];if(t?o>1:o<s)return this.setActive({column:i,node:r,numInMatch:o+p,numOverall:n}),!0}let m=c!=null&&c!=-1?e?.[c+p]:void 0;if(m){let[e,i]=m;return this.setActive({column:e,node:r,numInMatch:t?i:1,numOverall:n}),!0}}let m;if(m=r==null?c[t?c.length-1:0]:c[c.findIndex(e=>e===r)+p],m==null)return!1;let h=s.get(m),g=h?.[t?h.length-1:0];if(g){let[e,r]=g;return this.setActive({column:e,node:m,numInMatch:t?r:1,numOverall:n}),!0}return!1}dispatchFindChanged(){let{eventSvc:e,activeMatch:t,totalMatches:n,findSearchValue:r}=this;e.dispatchEvent({type:`findChanged`,activeMatch:t,totalMatches:n,findSearchValue:r})}setActive(e){if(e&&e.node.rowIndex==null){let t=e.node,n=t.footer?t.sibling:t.parent;for(;n&&n.level!==-1;)n.expanded=!0,n=n.parent;this.activeMatch=e,this.scrollOnRefresh=!0,this.beans.expansionSvc?.onGroupExpandedOrCollapsed();return}let t=this.activeMatch;this.activeMatch=e,this.refreshAndScrollToActive(e,t),e&&this.setDetailActive(e),this.dispatchFindChanged()}setDetailActive({node:e,numInMatch:t}
8){e.detail&&e.detailGridInfo?.api?.findGoTo(t)}refreshAndScrollToActive(e,t){if(e||t){let n=new Set,r=new Set,i=!1,addMatch=e=>{if(!e)return;let{node:t,column:o}=e;n.add(t),o==null?i=!0:r.add(o)};addMatch(e),addMatch(t),this.refreshRows(n,i?void 0:r)}e&&this.scrollToActive(e)}scrollToActive({node:{rowPinned:e,rowIndex:t},column:n}){let{ctrlsSvc:r,pagination:i,gos:o}=this.beans,s=r.getScrollFeature();e==null&&t!=null&&(i&&!o.get(`findOptions`)?.currentPageOnly&&!i.isRowInPage(t)&&i.goToPageWithIndex(t),s.ensureIndexVisible(t)),s.ensureColumnVisible(n)}goToInContainer(e,t,n){let r=n;for(let n of e.keys()){let i=e.get(n);for(let[e,o]of i){if(t<=r+o){this.setActive({column:e,node:n,numInMatch:t-r,numOverall:t});return}r+=o}}}getMatches(e){return e===`top`?this.topMatches:e===`bottom`?this.bottomMatches:this.centerMatches}getRowNodes(e){return e===`top`?this.topNodes:e===`bottom`?this.bottomNodes:this.centerNodes}getActiveMatchNum(e,t){let n=this.activeMatch;return n!=null&&n.node===e&&n.column===t?n.numInMatch:0}destroy(){this.topMatches.clear(),this.topNodes.length=0,this.centerMatches.clear(),this.centerNodes.length=0,this.bottomMatches.clear(),this.bottomNodes.length=0,this.activeMatch=void 0,super.destroy()}},Uv={moduleName:`Find`,version:Z,apiFunctions:{findGetTotalMatches,findGoTo,findNext,findPrevious,findGetActiveMatch,findGetNumMatches,findGetParts,findClearActive,findRefresh},dependsOn:[{moduleName:`FindCore`,version:Z,rowModels:[`clientSide`],beans:[FindService],userComponents:{agFindCellRenderer:FindCellRenderer},css:[Vv]}]};function startBatchEdit({editSvc:e,gos:t,rowModel:n}){if(!e?.isBatchEditing()){if(!Rc(t,n)){q(289,{rowModelType:t.get(`rowModelType`)});return}e?.setBatchEditing(!0)}}function cancelBatchEdit({editSvc:e}){e?.isBatchEditing()&&(e?.stopEditing(void 0,{cancel:!0,source:`api`,forceCancel:!0}),e?.setBatchEditing(!1))}function commitBatchEdit({editSvc:e}){e?.isBatchEditing()&&(e?.stopEditing(void 0,{source:`api`,forceStop:!0}),e?.setBatchEditing(!1))}function isBatchEditing(e){return e.editSvc?.isBatchEditing()??!1}var Wv={moduleName:`BatchEdit`,version:Z,beans:[],apiFunctions:{isBatchEditing,startBatchEdit,cancelBatchEdit,commitBatchEdit},dependsOn:[nc,fh],css:[]},AgChartsExports=class extends U{constructor(e){super(),this.beanName=`agChartsExports`,this.isEnterprise=!1,this.create=e.create,this._Theme=e._Theme,this._Scene=e._Scene,this.isEnterprise=e.isEnterprise,this._Util=e._Util}};function deproxy(e){return e.chart==null?e:e.chart}var Gv=new Set([`__proto__`,`constructor`,`prototype`]);function get(e,t,n){if(e==null)return n;let r=t.split(`.`),i=e;for(;r.length>1;)if(i=i[r.shift()],i==null)return n;return i[r[0]]??n}function set(e,t,n){if(e==null)return;let r=t.split(`.`),i=e;r.filter(e=>!Gv.has(e)).forEach((e,t)=>{i[e]||(i[e]={}),t<r.length-1&&(i=i[e])}),i[r[r.length-1]]=n}var Kv={column:`bar`,groupedColumn:`bar`,stackedColumn:`bar`,normalizedColumn:`bar`,bar:`bar`,groupedBar:`bar`,stackedBar:`bar`,normalizedBar:`bar`,line:`line`,stackedLine:`line`,normalizedLine:`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`,funnel:`funnel`,coneFunnel:`cone-funnel`,pyramid:`pyramid`},qv=new Set([`columnLineCombo`,`areaColumnCombo`,`customCombo`]),Jv=[`grouped`,`stacked`,`normalized`],Yv={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,isStatistical:!0,isEnterprise:!0,canSwitchDirection:!0}
8,"range-area":{isCartesian:!0,isStatistical:!0,isEnterprise:!0},"box-plot":{isCartesian:!0,isStatistical:!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},funnel:{isCartesian:!0,isEnterprise:!0,canSwitchDirection:!0},"cone-funnel":{isCartesian:!0,isEnterprise:!0,canSwitchDirection:!0},pyramid:{isCartesian:!0,isEnterprise:!0,canSwitchDirection:!0}};function isSeriesType(e){return!!Yv[e]}function isComboChart(e){return qv.has(e)}function doesSeriesHaveProperty(e,t){return!!Yv[e]?.[t]}function isEnterpriseChartType(e){return doesSeriesHaveProperty(getSeriesType(e),`isEnterprise`)}var Xv=new Set([`stackedColumn`,`normalizedColumn`,`stackedBar`,`normalizedBar`]);function isStacked(e){return Xv.has(e)}function isCartesian(e){return doesSeriesHaveProperty(e,`isCartesian`)}function isFunnel(e){return e===`funnel`||e===`cone-funnel`||e===`pyramid`}function isPolar(e){return doesSeriesHaveProperty(e,`isPolar`)}function isRadial(e){return doesSeriesHaveProperty(e,`isRadial`)}function isHierarchical(e){return doesSeriesHaveProperty(e,`isHierarchical`)}function isStatistical(e){return doesSeriesHaveProperty(e,`isStatistical`)}function getCanonicalChartType(e){return e===`doughnut`?`donut`:e}function getSeriesTypeIfExists(e){return Kv[e]}function getSeriesType(e){return getSeriesTypeIfExists(e)??`line`}function isPieChartSeries(e){return doesSeriesHaveProperty(e,`isPie`)}function canOnlyHaveSingleSeries(e){return e===`pie`||e===`waterfall`||e===`histogram`||e===`funnel`||e===`coneFunnel`||e===`pyramid`}function getMaxNumCategories(e){return isHierarchical(getSeriesType(e))?void 0:1}function getMaxNumSeries(e){if(isHierarchical(getSeriesType(e)))return 2;if(canOnlyHaveSingleSeries(e))return 1}function supportsInvertedCategorySeries(e){return!isComboChart(e)&&doesSeriesHaveProperty(getSeriesType(e),`canInvert`)}function canSwitchDirection(e){return doesSeriesHaveProperty(getSeriesType(e),`canSwitchDirection`)}function getFullChartNameTranslationKey(e){switch(e){case`groupedColumn`:case`stackedColumn`:case`normalizedColumn`:case`groupedBar`:case`stackedBar`:case`normalizedBar`:case`stackedLine`:case`normalizedLine`:case`stackedArea`:case`normalizedArea`:return`${e}Full`;case`doughnut`:return`donut`;case`areaColumnCombo`:return`AreaColumnCombo`;default:return e}}var Zv=[`number`,`category`,`grouped-category`,`log`,`time`];function getLegacyAxisType(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`stackedLine`:case`normalizedLine`: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}}function createAgChartTheme(e,t,n,r,i){let{chartOptionsToRestore:o,chartPaletteToRestore:s,chartThemeToRestore:c,agChartsExports:p}=e,m=getSelectedTheme(e),h=isStockTheme(m,p._Theme),g=h?{baseTheme:m}:lookupCustomChartTheme(e,m)??{},_=e.getGridOptionsChartThemeOverrides(),v=e.apiChartThemeOverrides,y=getSeriesType(e.chartType),b=e.crossFiltering?createCrossFilterThemeOverrides(t,e,y):void 0,isTitleEnabled=()=>{let isTitleEnabled2=e=>e?Object.keys(e).some(t=>get(e[t],`title.enabled`,!1)):!1;return isTitleEnabled2(_)||isTitleEnabled2(v)},x=[h?inbuiltStockThemeOverrides(e,n,isTitleEnabled()):void 0,pieAndDonutOverrides(),r,b,_,v,{...o??{}},i].filter(e=>!!e).reduce((e,t)=>({baseTheme:e,overrides:t}),g);if(s&&m===c){let t=e.agChartsExports._Theme.getChartTheme(g).palette;isIdenticalPalette(s,t)||(x.palette=s)}return x}function isIdenticalPalette(e,t){let arrayCompare=(e,t)=>e===t?!0:e?.length===t?.length?e?.every((e,n)=>e===t?.[n])??!1:!1;return arrayCompare(e.fills,t.fills)&&arrayCompare(e.strokes,t.strokes)}function isStockTheme(e,t){return Object.keys(t.themes).includes(e)}function createCrossFilterThemeOverrides(e,t,n){let r={tooltip:{delay:500},legend:{listeners:{legendItemClick:t=>{let n=e.getChart(),r=[t.seriesId,`${t.seriesId}-filtered-out`];for(let e of n.series.filter(e=>r.includes(e.id)))e.toggleSeriesItem(void 0,`category`,t.itemId,void 0)}}},listeners:{click:e=>t.crossFilterCallback(e,!0)}};if(n===`pie`||n===`donut`)return{[n]:{series:{fills:{$applyCycle:[{$cacheMax:{$size:{$path:[`./data`,{$path:`/data`}]}}},{$palette:`fills`},{$if:[{$eq:[{$value:`$parentIndex`},0]},{$mix:[{$value:`$1`},{$ref:`backgroundColor`},.7]},{$value:`$1`}]}]},strokes:{$applyCycle:[{$cacheMax:{$size:{$path:[`./data`,{$path:`/data`}]}}},{$palette:`strokes`},{$if:[{$eq:[{$value:`$parentIndex`},0]},{$mix:[{$value:`$1`},{$ref:`backgroundColor`},.7]},{$value:`$1`}]}]}},...r}};let i={};return n!==`line`&&(i.fill={$if:[{$isEven:[{$value:`$index`}]},{$palette:`fill`},{$mix:[{$path:[`../$prevIndex/fill`,{$palette:`fill`}]},{$ref:`backgroundColor`},.7]}]}),{[n]:{series:{stroke:{$if:[{$isEven:[{$value:`$index`}]},{$palette:`stroke`},{$mix:[{$path:[`../$prevIndex/fill`,{$palette:`stroke`}]},{$ref:`backgroundColor`},.7]}]},...i},...r}}}var Qv=Zv.reduce((e,t)=>
8({...e,[t]:{title:{_enabledFromTheme:!0}}}),{});function inbuiltStockThemeOverrides(e,t,n){let r=e.getExtraPaddingDirections();return{common:{...t?{animation:{duration:500}}:void 0,axes:Qv,padding:{top:!n&&r.includes(`top`)?40:20,right:r.includes(`right`)?30:20,bottom:r.includes(`bottom`)?40:20,left:r.includes(`left`)?30:20}}}}function pieAndDonutOverrides(){return{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 getSelectedTheme(e){let t=e.getChartThemeName(),n=e.getChartThemes();return n.includes(t)||(t=n[0]),t}function lookupCustomChartTheme(e,t){let{customChartThemes:n}=e,r=n?.[t];return r||q(140,{name:t}),r}var ChartProxy=class{constructor(e){this.chartProxyParams=e,this.clearThemeOverrides=!1,this.agChartsExports=e.agChartsExports,this.chart=e.chartInstance,this.chartType=e.chartType,this.crossFiltering=e.crossFiltering,this.crossFilterCallback=e.crossFilterCallback,this.standaloneChartType=getSeriesType(this.chartType),this.chart==null?this.chart=e.agChartsExports.create(this.getCommonChartOptions()):this.clearThemeOverrides=!0}crossFilteringReset(){}update(e){this.getChartRef().update(this.getUpdateOptions(e,this.getCommonChartOptions(e.updatedOverrides)))}updateThemeOverrides(e){this.getChartRef().updateDelta({theme:{overrides:e}})}getChart(){return deproxy(this.chart)}getChartRef(){return this.chart}downloadChart(e,t,n){let{chart:r}=this,i=deproxy(r),o=t||i.title.node.getPlainText(),{width:s,height:c}=e||{};r.download({width:s,height:c,fileName:o,fileFormat:n})}getChartImageDataURL(e){return this.getChart().getCanvasDataURL(e)}getChartOptions(){return this.chart.getOptions()}getChartThemeOverrides(){return this.getChartOptions().theme.overrides??{}}getChartPalette(){return this.agChartsExports._Theme.getChartTheme(this.getChartOptions().theme).palette}setPaired(e){let t=getSeriesType(this.chartProxyParams.chartType);this.chart.updateDelta({theme:{overrides:{[t]:{paired:e}}}})}isPaired(){let e=getSeriesType(this.chartProxyParams.chartType);return get(this.getChartThemeOverrides(),`${e}.paired`,!0)}lookupCustomChartTheme(e){return lookupCustomChartTheme(this.chartProxyParams,e)}getSeriesGroupType(){}transformCategoryData(e,t){return e.map((e,n)=>{let r=e[t],i=r?.toString?r.toString():``,o={...e};return o[t]={id:n,value:r,toString:()=>i},o})}getCommonChartOptions(e){let t=this.clearThemeOverrides?{}:this.chart?.getOptions()??{},n=this.chart==null?void 0:this.getActiveFormattingPanelOverrides();this.clearThemeOverrides=!1;let r=this.chartProxyParams.styleNonce,i=createAgChartTheme(this.chartProxyParams,this,this.agChartsExports.isEnterprise,this.getChartThemeDefaults(),e??n),o={...t,mode:`integrated`,...r?{styleNonce:r}:{}};return this.chartProxyParams.suppressFieldDotNotation!==void 0&&(o.suppressFieldDotNotation=this.chartProxyParams.suppressFieldDotNotation),o.theme=i,o.container=this.chartProxyParams.parentElement,o}getChartThemeDefaults(){let e=this.getSeriesChartThemeDefaults(),t=e?{[this.standaloneChartType]:e}:{},n={enabled:!0,snap:!0,label:{enabled:!1}},r=this.agChartsExports.isEnterprise?{zoom:{enabled:!0},animation:{enabled:!0,duration:500},axes:{number:{crosshair:n},category:{crosshair:n},log:{crosshair:n},time:{crosshair:n}}}:{};return r.minHeight=0,r.minWidth=0,r.navigator={enabled:!1,height:18},r.context=this.chartProxyParams.context,{common:r,...t}}getSeriesChartThemeDefaults(){}getActiveFormattingPanelOverrides(){return this.clearThemeOverrides?{}:this.chart?.getOptions().theme?.overrides??{}}destroy({keepChartInstance:e=!1}={}){if(e)return this.chart.resetAnimations(),this.chart;this.destroyChart()}destroyChart(){this.chart&&=(this.chart.destroy(),void 0)}},CartesianChartProxy=class extends ChartProxy{constructor(){super(...arguments),this.crossFilteringAllPoints=new Set,this.crossFilteringSelectedPoints=[]}getUpdateOptions(e,t){let n=this.getAxes(e,t);return{...t,data:this.getData(e,n),axes:n,series:this.getSeries(e)}}getData(e,t){let n=[`area`,`line`].includes(this.standaloneChartType);return this.crossFiltering&&n?this.getCrossFilterData(e):this.getDataTransformedData(e,t)}getDataTransformedData(e,t){let n=t[0].type,{categories:r,data:i}=e,[o]=r;switch(n){case`category`:return this.transformCategoryData(i,o.id);case`time`:return this.transformTimeData(i,o.id,o.convertTime);default:return i}}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,n){let[r]=e.categories;if(r?.chartDataType)return r.chartDataType===t;if(!n)return!1;let i=e.data[0];return i?n(i[r.id]):!1}transformTimeData(e,t,n){return e[0]?.[t]instanceof Date?e:e.map(e=>{let r=e[t];
8return typeof r==`string`?{...e,[t]:n?n(r):Ec(r)}:e})}crossFilteringReset(){this.crossFilteringSelectedPoints=[],this.crossFilteringAllPoints.clear()}crossFilteringPointSelected(e){return this.crossFilteringSelectedPoints.length==0||this.crossFilteringSelectedPoints.includes(e)}crossFilteringDeselectedPoints(){return this.crossFilteringSelectedPoints.length>0&&this.crossFilteringAllPoints.size!==this.crossFilteringSelectedPoints.length}extractLineAreaCrossFilterSeries(e,t){let[n]=t.categories,getYKey=e=>this.standaloneChartType===`area`?t.getCrossFilteringContext().lastSelectedChartId===t.chartId?e+`-total`:e:e+`-total`;return e.map(e=>(e.yKey=getYKey(e.yKey),e.listeners={seriesNodeClick:t=>{let n=t.datum[e.xKey],r=t.event.metaKey||t.event.ctrlKey;this.crossFilteringAddSelectedPoint(r,n),this.crossFilterCallback(t)}},e.marker={itemStyler:e=>{let t=e.datum[n.id];return{fill:e.highlighted?`yellow`:e.fill,size:e.highlighted?14:this.crossFilteringPointSelected(t)?8:0}}},this.standaloneChartType===`area`&&(e.fillOpacity=this.crossFilteringDeselectedPoints()?.3:1),this.standaloneChartType===`line`&&(e.strokeOpacity=this.crossFilteringDeselectedPoints()?.3:1),e))}getCrossFilterData(e){this.crossFilteringAllPoints.clear();let[t]=e.categories,n=e.fields[0].colId,r=`${n}-filtered-out`,i=e.getCrossFilteringContext().lastSelectedChartId;return e.data.map(o=>{let s=o[t.id];this.crossFilteringAllPoints.add(s);let c=this.crossFilteringPointSelected(s);return this.standaloneChartType===`area`&&i===e.chartId&&(o[`${n}-total`]=c?o[n]:o[n]+o[r]),this.standaloneChartType===`line`&&(o[`${n}-total`]=c?o[n]:o[n]+o[r]),o})}crossFilteringAddSelectedPoint(e,t){e?this.crossFilteringSelectedPoints.push(t):this.crossFilteringSelectedPoints=[t]}isHorizontal(e){let t=this.standaloneChartType;if(t!==`waterfall`&&t!==`box-plot`&&t!==`range-bar`)return!1;let n=e.theme,isHorizontal=e=>{let n=e?.overrides?.[t]?.series?.direction;return n==null?typeof e?.baseTheme==`object`&&isHorizontal(e.baseTheme):n===`horizontal`};return isHorizontal(n)}},HistogramChartProxy=class extends CartesianChartProxy{getSeries(e){let 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`}]}},WaterfallChartProxy=class extends CartesianChartProxy{getAxes(e,t){return[{type:this.getXAxisType(e),position:this.isHorizontal(t)?`left`:`bottom`},{type:`number`,position:this.isHorizontal(t)?`bottom`:`left`}]}getSeries(e){let[t]=e.categories,[n]=e.fields;return[{type:this.standaloneChartType,xKey:t.id,xName:t.name,yKey:n.colId,yName:n.displayName??void 0}]}},FunnelChartProxy=class extends ChartProxy{getUpdateOptions(e,t){return{...t,data:this.transformFunnelCategories(e),series:this.getSeries(e)}}transformFunnelCategories(e){let{data:t}=e,[{id:n}]=e.categories;return t.map((e,t)=>({...e,[n]:{name:e[n],id:t,toString:()=>String(e[n])}}))}getSeriesChartThemeDefaults(){let e={crosshair:{enabled:!1}};return{zoom:{enabled:!1},...this.chartType!==`pyramid`&&{axes:{category:e,number:e}}}}getSeries(e){let[{id:t}]=e.categories,[{colId:n}]=e.fields;return[{type:this.standaloneChartType,stageKey:t,valueKey:n}]}},$v=`AG-GRID-DEFAULT-LABEL-KEY`;function createCategoryHierarchy(e,t){return formatCategoryHierarchy(buildNestedHierarchy(e,getItemDepth,getItemCategoryLabel));function getItemDepth(e){return t.length}function getItemCategoryLabel(e,n){let r=e[t[n]];return getCategoryLabel(r)}function getCategoryLabel(e){return e==null?null:String(e)}}function createAutoGroupHierarchy(e,t){return formatCategoryHierarchy(buildNestedHierarchy(e,getItemDepth,getItemGroupLabel));function getItemDepth(e){return t(e)?.length??0}function getItemGroupLabel(e,n){let r=t(e);return r&&r[n]}}function formatCategoryHierarchy(e,t=null,n){let{depth:r,rootValues:i,value:o,children:s}=e;if(i)return i.map(e=>({[$v]:t,...e}));if(r===0)return[{[$v]:t,...o}];let c=[];for(let[e,t]of s.entries())c.push(...formatCategoryHierarchy(t,e,!0));return n?[{[$v]:t,children:c,...o??{}}]:c}function buildNestedHierarchy(e,t,n){let r={depth:0,children:new Map};for(let i of e)createNestedItemHierarchy(i,t(i),n,0,r);return r;function createNestedItemHierarchy(e,t,n,r,i){if(r===t)return r===0?(i.rootValues||=[],i.rootValues.push(e)):i.value=e,i;{let o=n(e,r),s=i.children.get(o),c=createNestedItemHierarchy(e,t,n,r+1,s||{depth:0,children:new Map});return i.children.set(o,c),i.depth=Math.max(1+c.depth,i.depth),i}}}var HierarchicalChartProxy=class extends ChartProxy{getUpdateOptions(e,t){let{fields:n}=e,[r,i]=n;return{...t,series:this.getSeries(r,i),data:this.getData(e,r,i)}}getSeriesChartThemeDefaults(){return{gradientLegend:{gradient:{preferredLength:200},position:`right`}}}getSeries(e,t){return[{type:this.standaloneChartType,labelKey:$v,sizeKey:e?.colId,sizeName:e?.displayName??void 0,colorKey:t?.colId,colorName:t?.displayName??void 0}]}getData(e,t,n){let{categories:r,data:i,groupData:o,grouping:s}=e;return s?createAutoGroupHierarchy(n?i.concat(o?.map(e=>{let n={...e};return delete n[t.colId],n})??[]):i,e=>e[`ag-Grid-AutoColumn`]?.value??null):createCategoryHierarchy(i,r.map(({id:e})=>e))}},PolarChartProxy=class extends ChartProxy{getAxes(e){let t=this.standaloneChartType===`radial-bar`;return[{type:t?`angle-number`:`angle-category`}
8,{type:t?`radius-category`:`radius-number`}]}getSeries(e){let{fields:t,categories:n,seriesGroupType:r}=e,[i]=n,o=this.standaloneChartType===`radial-bar`,s=this.getSeriesGroupTypeOptions(r);return t.map(e=>({type:this.standaloneChartType,angleKey:o?e.colId:i.id,angleName:o?e.displayName??void 0:i.name,radiusKey:o?i.id:e.colId,radiusName:o?i.name:e.displayName??void 0,...s}))}getSeriesGroupType(){let e=this.standaloneChartType;if(![`nightingale`,`radial-bar`,`radial-column`].includes(e))return;let t=this.getChart().series?.[0]?.properties.toJson(),getStackedValue=()=>t.normalizedTo?`normalized`:`stacked`;return e===`nightingale`?t.grouped?`grouped`:getStackedValue():t.stacked?getStackedValue():`grouped`}getUpdateOptions(e,t){let n=this.getAxes(e);return{...t,data:this.getData(e,n),axes:n,series:this.getSeries(e)}}getData(e,t){if(t.some(e=>e.type===`angle-category`||e.type===`radius-category`)){let[t]=e.categories;return this.transformCategoryData(e.data,t.id)}return e.data}getSeriesGroupTypeOptions(e){return e?{grouped:e===`grouped`||void 0,stacked:e!==`grouped`||void 0,normalizedTo:e===`normalized`?100:void 0}:{}}},ey=`AG-GRID-DEFAULT-HEATMAP-CATEGORY-KEY`,ty=`AG-GRID-DEFAULT-HEATMAP-SERIES-KEY`,ny=`AG-GRID-DEFAULT-HEATMAP-VALUE-KEY`;function flatMap(e,t){return e.reduce((e,n,r,i)=>e.concat(t(n,r,i)),[])}var HeatmapChartProxy=class extends ChartProxy{getUpdateOptions(e,t){let n=ty,r=ny,i=ey;return{...t,series:this.getSeries(e,n,r,i),data:this.getData(e,n,r,i)}}getSeries(e,t,n,r){let[i]=e.categories;return[{type:this.standaloneChartType,yKey:r,xKey:t,colorKey:n,yName:i.name,xName:void 0,colorName:void 0}]}getData(e,t,n,r){let[i]=e.categories;return flatMap(e.data,(o,s)=>{let c=o[i.id],p=c==null?``:String(c),m={id:s,value:c,toString:()=>p};return e.fields.map(({colId:e,displayName:i})=>({...o,[t]:i,[n]:o[e],[r]:m}))})}getSeriesChartThemeDefaults(){return{gradientLegend:{gradient:{preferredLength:200},position:`right`},series:{tooltip:{renderer:renderHeatmapTooltip}}}}};function renderHeatmapTooltip(e){let{xKey:t,yKey:n,colorKey:r,yName:i,datum:o}=e;return{title:``,data:[{label:i,value:o[n]},{label:o[t],value:r&&o[r]}].map(({label:e,value:t})=>({label:String(e),value:String(t)}))}}var ChartDatasource=class extends U{wireBeans(e){this.sortSvc=e.sortSvc,this.gridRowModel=e.rowModel,this.colModel=e.colModel,this.valueSvc=e.valueSvc,this.pivotResultCols=e.pivotResultCols,this.rowNodeSorter=e.rowNodeSorter}getData(e){if(e.crossFiltering){if(e.grouping)return q(141),{chartData:[],colNames:{}};if(!Rc(this.gos))return q(142),{chartData:[],colNames:{}}}lc(this.gos)&&e.pivoting&&this.updatePivotKeysForSSRM();let t=this.extractRowsFromGridRowModel(e);return t.chartData=this.aggregateRowsByDimension(e,t.chartData),t}extractRowsFromGridRowModel(e){let{crossFiltering:t,startRow:n,endRow:r,valueCols:i,dimensionCols:o,grouping:s,crossFilteringSort:c,combineGroupValues:p}=e,m=[],h={},g={},_={},v={},y=[],b;if(t)v=this.getFilteredRowNodes(),y=this.getAllRowNodes(c),b=y.length;else{let e=this.gridRowModel.getRowCount()-1;b=n===r&&n===0&&o.length===0&&i.length===0?0:(r>=0?Math.min(r,e):e)-n+1}if(b>0)for(let e of i){let t=[],n=e.getColDef().pivotKeys;n&&(t=n.slice());let r=e.getColDef().headerName;r&&t.push(r),t.length>0&&(h[e.getId()]=t)}let x=0,S=0,C={};for(let r=0;r<b;r++){let c=t?y[r]:this.gridRowModel.getRow(r+n);if(c.footer||c.detail){x++;continue}let h={node:c};for(let e of o){let t=e.colId,n=this.colModel.getCol(t);if(n){let e=this.valueSvc.getValue(n,c);if(s){let n=e?.toString?String(e.toString()):` `,i=this.getGroupLabels(c,n),o=i.slice().reverse(),s={value:o,id:S++,toString:()=>o.filter(Boolean).join(` - `)};if(p){let e=s.toString(),t=C[e];t?s=t:C[e]=s}h[t]=s,c.group&&(g[i.toString()]=r-x);let m=i.slice(1,i.length).toString();m&&(_[m]=g[m])}else h[t]=e}else h[iy]=r+1}for(let n of i){let r=n.getColId();if(t){let t=r+`-filtered-out`,i=this.valueSvc.getValue(n,c),o=i;i!=null&&(typeof i.toNumber==`function`?o=i.toNumber():typeof i.value==`number`&&(o=i.value)),v[c.id]?(h[r]=o,h[t]=e.aggFunc||e.isScatter?void 0:0):(h[r]=e.aggFunc||e.isScatter?void 0:0,h[t]=o)}else{let e=this.valueSvc.getValue(n,c);e&&typeof e.value==`number`&&(e=e.value),e&&Object.prototype.hasOwnProperty.call(e,`toString`)&&(e=parseFloat(e.toString())),h[r]=e!=null&&typeof e.toNumber==`function`?e.toNumber():e}}m.push(h)}let w;if(s){let e=Object.values(_),t=m;m=[],w=[];for(let n=0;n<t.length;n++)(e.includes(n)?w:m).push(t[n])}
8return{chartData:m,colNames:h,groupChartData:w}}aggregateRowsByDimension(e,t){let n=e.dimensionCols;if(!e.aggFunc||n.length===0)return t;let r=Kc(n)?.colId,i={},o=[];for(let e of t){let t=i;for(let i of n){let s=i.colId,c=e[s];if(s===r){let r=t[c];if(!r){r={__children:[]};for(let t of n){let n=t.colId;r[n]=e[n]}t[c]=r,o.push(r)}r.__children.push(e)}else t[c]||(t[c]={}),t=t[c]}}if(this.gos.assertModuleRegistered(`SharedAggregation`,1))for(let t of o)for(let n of e.valueCols){let r=n.getColId();if(e.crossFiltering){let i=t.__children.filter(e=>e[r]!==void 0).map(e=>e[r]),o=_aggregateValues(this.beans,i,e.aggFunc,n);t[r]=o&&o.value!==void 0?o.value:o;let s=`${r}-filtered-out`,c=t.__children.filter(e=>e[s]!==void 0).map(e=>e[s]),p=_aggregateValues(this.beans,c,e.aggFunc,n);t[s]=p&&p.value!==void 0?p.value:p}else{let i=t.__children.map(e=>e[r]),o=_aggregateValues(this.beans,i,e.aggFunc,n);t[r]=o&&o.value!==void 0?o.value:o}}return o}updatePivotKeysForSSRM(){let e=this.pivotResultCols?.getPivotResultCols()?.list;if(!e)return;let t=this.extractPivotKeySeparator(e);for(let n of e)if(t===``)n.getColDef().pivotKeys=[];else{let e=n.getColId().split(t);n.getColDef().pivotKeys=e.slice(0,e.length-1)}}extractPivotKeySeparator(e){if(e.length===0)return``;let extractSeparator=(e,t)=>{let n=e.getGroupId();return e.getParent()?extractSeparator(e.getParent(),n):t.split(n)[1][0]},t=e[0];return t.getParent()==null?``:extractSeparator(t.getParent(),t.getColId())}getGroupLabels(e,t){let n=[t];for(;e&&e.level!==0;)if(e=e.parent,e){if(e.group){let t=this.colModel.getCol(Cc);if(t){let r=this.valueSvc.getValue(t,e),i=r?.toString?String(r.toString()):` `;n.push(i)}}else n.push(e.key)}return n}getFilteredRowNodes(){let e={};return this.gridRowModel.forEachNodeAfterFilterAndSort(t=>{e[t.id]=t}),e}getAllRowNodes(e){let t=[];return this.gridRowModel.forEachNode(e=>{t.push(e)}),this.sortRowNodes(t,e)}sortRowNodes(e,t){let n=t===!0?this.sortSvc?.getSortOptions():t;return!n||n.length==0||!this.rowNodeSorter?e:this.rowNodeSorter.doFullSort(e,n)}},ChartColumnService=class extends U{constructor(){super(...arguments),this.valueColsWithoutSeriesType=new Set}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.valueSvc=e.valueSvc}postConstruct(){let clearValueCols=()=>this.valueColsWithoutSeriesType.clear();this.addManagedEventListeners({newColumnsLoaded:clearValueCols,rowDataUpdated:clearValueCols})}getColumn(e){return this.colModel.getColDefCol(e)}getAllDisplayedColumns(){return this.beans.visibleCols.allCols}getColDisplayName(e){return this.colNames.getDisplayNameForColumn(e,`chart`)}getColGroupDisplayName(e){return this.colNames.getDisplayNameForColumnGroup(e,`chart`)}getRowGroupColumns(){return this.beans.rowGroupColsSvc?.columns??[]}getGroupDisplayColumns(){return this.beans.showRowGroupCols?.getShowRowGroupCols()??[]}isPivotMode(){return this.colModel.isPivotMode()}isPivotActive(){return this.colModel.isPivotActive()}getChartColumns(){let e=this.colModel.getCols(),t=new Set,n=new Set;for(let r of e){let e=r.getColDef(),i=e.chartDataType;if(i)switch(i){case`category`:case`time`:t.add(r);continue;case`series`:n.add(r);continue;case`excluded`:continue;default:q(153,{chartDataType:i})}if(e.colId===`ag-Grid-AutoColumn`){t.add(r);continue}if(!r.isPrimary()){n.add(r);continue}(this.isInferredValueCol(r)?n:t).add(r)}return{dimensionCols:t,valueCols:n}}isInferredValueCol(e){let t=e.getColId();if(t===`ag-Grid-AutoColumn`)return!1;let n=Ql(this.beans,{rowIndex:0,rowPinned:null});if(!n)return this.valueColsWithoutSeriesType.has(t);let r=this.valueSvc.getValue(e,n);r??=this.extractLeafData(n,e),r!=null&&(typeof r.toNumber==`function`?r=r.toNumber():typeof r.value==`number`&&(r=r.value));let i=typeof r==`number`||e.colDef.cellDataType===`number`||[`series`,`time`].includes(e.colDef.chartDataType);return i?this.valueColsWithoutSeriesType.add(t):r==null&&e.colDef.cellDataType!==`number`&&q(265,{colId:t}),i}extractLeafData(e,t){let n=e.data&&this.valueSvc.getValue(t,e);if(n!=null)return n;let r=e.childrenAfterGroup;if(r)for(let e=0,n=r.length;e<n;++e){let n=r[e],i=this.extractLeafData(n,t);if(i!=null)return i}return null}destroy(){this.valueColsWithoutSeriesType.clear(),super.destroy()}},ry=new Set([`line`,`groupedColumn`,`stackedColumn`,`area`,`stackedArea`]),ComboChartModel=class extends U{constructor(e){super(),this.suppressComboChartWarnings=!1,this.chartDataModel=e,this.seriesChartTypes=e.params.seriesChartTypes??[]}postConstruct(){this.initComboCharts()}update(e){this.seriesChartTypes=e??this.seriesChartTypes,this.initComboCharts(),this.updateSeriesChartTypes()}initComboCharts(){let e=this.seriesChartTypes&&this.seriesChartTypes.length>0;(this.chartDataModel.chartType===`customCombo`||e)&&(this.chartDataModel.chartType=`customCombo`,this.savedCustomSeriesChartTypes=this.seriesChartTypes||[])}updateSeriesChartTypes(){if(this.chartDataModel.isComboChart()){if(this.seriesChartTypes=this.seriesChartTypes.map(e=>(e.secondaryAxis=![`groupedColumn`,`stackedColumn`,`stackedArea`].includes(e.chartType)&&e.secondaryAxis,e)),this.chartDataModel.chartType===`customCombo`){this.updateSeriesChartTypesForCustomCombo();return}this.updateChartSeriesTypesForBuiltInCombos()}}updateSeriesChartTypesForCustomCombo(){!(this.seriesChartTypes&&this.seriesChartTypes.length>0)&&!this.suppressComboChartWarnings&&q(150),this.seriesChartTypes=this.seriesChartTypes.map(e=>(ry.has(e.chartType)||(q(151,{chartType:e.chartType}),e.chartType=`line`),e));let getSeriesChartType=e=>((!this.savedCustomSeriesChartTypes||this.savedCustomSeriesChartTypes.length===0)&&(this.savedCustomSeriesChartTypes=this.seriesChartTypes),this.savedCustomSeriesChartTypes.find(t=>t.colId===e.colId)||(e.selected&&!this.suppressComboChartWarnings&&q(152,{colId:e.colId}
8),{colId:e.colId,chartType:`line`,secondaryAxis:!1})),e=this.chartDataModel.valueColState.map(getSeriesChartType);this.seriesChartTypes=e,this.savedCustomSeriesChartTypes=e,this.suppressComboChartWarnings=!0}updateChartSeriesTypesForBuiltInCombos(){let{chartType:e,valueColState:t}=this.chartDataModel,n=e===`columnLineCombo`?`groupedColumn`:`stackedArea`,r=e===`columnLineCombo`?`line`:`groupedColumn`,i=t.filter(e=>e.selected),o=Math.ceil(i.length/2);this.seriesChartTypes=i.map((e,t)=>{let i=t>=o?r:n;return{colId:e.colId,chartType:i,secondaryAxis:!1}})}},iy=`AG-GRID-DEFAULT-CATEGORY`,ChartDataModel=class extends U{constructor(e){super(),this.unlinked=!1,this.chartData=[],this.valueColState=[],this.dimensionColState=[],this.colNames={},this.crossFiltering=!1,this.crossFilteringSort=!0,this.grouping=!1,this.params=e,this.chartId=e.chartId,this.setParams(e)}wireBeans(e){this.rangeSvc=e.rangeSvc,this.chartTranslation=e.chartTranslation}setParams(e){let{chartType:t,pivotChart:n,chartThemeName:r,switchCategorySeries:i,aggFunc:o,cellRange:s,suppressChartRanges:c,unlinkChart:p,crossFiltering:m,crossFilteringSort:h,seriesGroupType:g}=e;this.chartType=t,this.pivotChart=n??!1,this.chartThemeName=r,this.switchCategorySeries=!!i,this.aggFunc=o,this.referenceCellRange=s,this.suppliedCellRange=s,this.suppressChartRanges=c??!1,this.unlinked=!!p,this.crossFiltering=!!m,this.crossFilteringSort=h??!0,this.seriesGroupType=g}postConstruct(){this.datasource=this.createManagedBean(new ChartDatasource),this.chartColSvc=this.createManagedBean(new ChartColumnService),this.comboChartModel=this.createManagedBean(new ComboChartModel(this)),this.updateCellRanges({setColsFromRange:!0}),this.updateData()}updateModel(e){let{cellRange:t,seriesChartTypes:n}=e;t!==this.suppliedCellRange&&(this.dimensionCellRange=void 0,this.valueCellRange=void 0),this.setParams(e),this.updateSelectedDimensions(t?.columns),this.updateCellRanges({setColsFromRange:!0}),(this.isComboChart()||n)&&this.comboChartModel.update(n),this.unlinked||this.updateData()}updateCellRanges(e){let{updatedColState:t,resetOrder:n,maintainColState:r,setColsFromRange:i}=e??{};this.valueCellRange&&(this.referenceCellRange=this.valueCellRange);let{dimensionCols:o,valueCols:s}=this.chartColSvc.getChartColumns(),c=this.getAllColumnsFromRanges();t&&this.updateColumnState(t,n),this.setDimensionCellRange(o,c,t),this.setValueCellRange(s,c,i),!t&&!r&&(this.resetColumnState(),this.syncDimensionCellRange()),this.comboChartModel.updateSeriesChartTypes()}updateData(){let{startRow:e,endRow:t}=this.getRowIndexes();this.pivotChart&&this.resetColumnState(),this.grouping=this.isGrouping();let n={aggFunc:this.aggFunc,dimensionCols:this.getSelectedDimensions(),grouping:this.grouping,pivoting:this.isPivotActive(),crossFiltering:this.crossFiltering,crossFilteringSort:this.getCrossFilteringSort(),valueCols:this.getSelectedValueCols(),startRow:e,endRow:t,isScatter:[`scatter`,`bubble`].includes(this.chartType),combineGroupValues:isStatistical(getSeriesType(this.chartType))},{chartData:r,colNames:i,groupChartData:o}=this.datasource.getData(n);this.chartData=r,this.groupChartData=o,this.colNames=i,this.categoryAxisType=void 0}isGrouping(){let e=this.gos.get(`treeData`),t=e?null:this.chartColSvc.getRowGroupColumns(),n=e||t&&t.length>0,r=this.getSelectedDimensions().map(({colId:e})=>e),i=this.chartColSvc.getGroupDisplayColumns().map(e=>e.getColId()).some(e=>r.includes(e));return!!n&&i}getSelectedValueCols(){return this.valueColState.filter(e=>e.selected).map(e=>e.column)}getSelectedDimensions(){return this.dimensionColState.filter(e=>e.selected)}getValueColState(){return this.valueColState.map(this.displayNameMapper.bind(this))}displayNameMapper(e){let{column:t}=e;if(t){let n=this.getColDisplayName(t);e.displayName=this.isPivotMode()?this.getPivotDisplayName(t,n):n}else{let n=this.colNames[e.colId];e.displayName=n?n.join(` - `):this.getColDisplayName(t)}return e}getPivotDisplayName(e,t){let n=!1,r=[t],getDisplayName2=e=>{if(!e)return;let t=this.chartColSvc.getColGroupDisplayName(e);t?.length?(r.unshift(t),getDisplayName2(e.getParent())):n=!0};if(getDisplayName2(e.getParent()),n){let t=this.colNames[e.getColId()];t&&(r=t)}return r.join(` - `)}getColDisplayName(e){return this.chartColSvc.getColDisplayName(e)}isPivotMode(){return this.chartColSvc.isPivotMode()}getChartDataType(e){let t=this.chartColSvc.getColumn(e);return t?t.getColDef().chartDataType:void 0}getConvertTime(e){let t=this.chartColSvc.getColumn(e);if(t?.colDef.cellDataType===`dateString`)return this.beans.dataTypeSvc?.getDateParserFunction(t)}isPivotActive(){return this.chartColSvc.isPivotActive()}createCellRange(e,...t){return{id:this.chartId,startRow:this.referenceCellRange.startRow,endRow:this.referenceCellRange.endRow,columns:t,startColumn:e===Ds.DIMENSION||this.referenceCellRange.startColumn==null?t[0]:this.referenceCellRange.startColumn,type:e}}getAllColumnsFromRanges(){if(this.pivotChart)return new Set(this.chartColSvc.getAllDisplayedColumns());let e=this.dimensionCellRange||this.valueCellRange?[]:this.referenceCellRange.columns;return this.dimensionCellRange&&e.push(...this.dimensionCellRange.columns),this.valueCellRange&&e.push(...this.valueCellRange.columns),new Set(e)}getRowIndexes(){let e=0,t=0,{rangeSvc:n,valueCellRange:r,dimensionCellRange:i}=this,o=r||i;if(n&&o){e=n.getRangeStartRow(o).rowIndex;let r=n.getRangeEndRow(o);t=r.rowPinned===`bottom`?-1:r.rowIndex}return{startRow:e,endRow:t}}resetColumnState(){let{dimensionCols:e,valueCols:t}=this.chartColSvc.getChartColumns(),n=this.getAllColumnsFromRanges(),r=this.valueColState.length<1;this.dimensionColState=[],this.valueColState=[];let i=isHierarchical(getSeriesType(this.chartType)),o=!1,s=1,c=this.suppliedCellRange.columns[0];
8e.forEach(e=>{let t=e.getColId()===`ag-Grid-AutoColumn`,r=!1;this.crossFiltering&&this.aggFunc?c.getColId()===e.getColId()&&(r=!0):r=t?!0:(!o||i)&&n.has(e),this.dimensionColState.push({column:e,colId:e.getColId(),displayName:this.getColDisplayName(e),selected:r,order:s++}),r&&(o=!0)});let p={colId:iy,displayName:this.chartTranslation.translate(`defaultCategory`),selected:!o,order:0};this.dimensionColState.unshift(p);let m=this.referenceCellRange.columns.filter(e=>t.has(e));t.forEach(e=>{r&&this.referenceCellRange.columns.includes(e)&&(e=m.shift()),this.valueColState.push({column:e,colId:e.getColId(),displayName:this.getColDisplayName(e),selected:n.has(e),order:s++})})}updateColumnState(e,t){let idsMatch=t=>t.colId===e.colId,{dimensionColState:n,valueColState:r}=this,i=n.find(idsMatch),o=r.find(idsMatch);if(i){if(isHierarchical(getSeriesType(this.chartType)))i.selected=e.selected;else{let t=e.selected?i:n.filter(e=>e!==i).find(({selected:e})=>e);n.forEach(e=>e.selected=e===t)}}else o&&(o.selected=e.selected);let s=[...n,...r],c=[];t||(s.forEach((t,n)=>{n===e.order&&c.push(e.colId),t.colId!==e.colId&&c.push(t.colId)}),s.forEach(e=>{e.order=c.indexOf(e.colId)>=0?c.indexOf(e.colId):s.length-1})),this.reorderColState()}reorderColState(){let ascColStateOrder=(e,t)=>e.order-t.order;this.dimensionColState.sort(ascColStateOrder),this.valueColState.sort(ascColStateOrder)}setDimensionCellRange(e,t,n){this.dimensionCellRange=void 0;let r=isHierarchical(getSeriesType(this.chartType));if(!n&&!this.dimensionColState.length){let n=[];e.forEach(e=>{n.length>0&&!r||!t.has(e)||n.push(e)}),n.length>0&&(this.dimensionCellRange=this.createCellRange(Ds.DIMENSION,...n));return}let i=n?[n]:[];if(this.crossFiltering&&this.aggFunc){let e=this.suppliedCellRange.columns[0];i=this.dimensionColState.filter(t=>t.colId===e.getColId())}else(r||i.length===0||i.some(({column:t})=>!t||!e.has(t)))&&(i=this.dimensionColState.filter(e=>e.selected));let o=i.length===1&&i[0].colId===iy,s=i.map(({column:e})=>e).filter(e=>e!=null);s.length>0&&!o&&(this.dimensionCellRange=this.createCellRange(Ds.DIMENSION,...s))}setValueCellRange(e,t,n){this.valueCellRange=void 0;let r=[],i=getMaxNumSeries(this.chartType),o=0;if(e.forEach(e=>{n?(i==null||o<i)&&t.has(e)&&(r.push(e),o++):this.valueColState.some(t=>t.selected&&t.colId===e.getColId())&&r.push(e)}),r.length>0){let e=[];this.valueColState.length>0?e=this.valueColState.map(e=>e.colId):t.forEach(t=>e.push(t.getColId())),r.sort((t,n)=>e.indexOf(t.getColId())-e.indexOf(n.getColId())),this.valueCellRange=this.createCellRange(Ds.VALUE,...r)}}resetCellRanges(e,t){if(!e&&!t)return;let{dimensionCols:n,valueCols:r}=this.chartColSvc.getChartColumns(),i=this.getAllColumnsFromRanges();e&&this.setDimensionCellRange(n,i),t&&this.setValueCellRange(r,i)}updateSelectedDimensions(e){let t=new Set(e.map(e=>e.getColId()));if(isHierarchical(getSeriesType(this.chartType))){let e=this.dimensionColState.filter(e=>t.has(e.colId)),n=new Set(e.map(e=>e.colId));this.dimensionColState=this.dimensionColState.map(e=>({...e,selected:n.has(e.colId)}))}else{let e=(this.dimensionColState.find(e=>t.has(e.colId))||this.dimensionColState[0]).colId;this.dimensionColState=this.dimensionColState.map(t=>({...t,selected:t.colId===e}))}}syncDimensionCellRange(){let e=this.getSelectedDimensions();if(e.length===0)return;let t=e.map(({column:e})=>e).filter(e=>e!=null);t.length>0&&(this.dimensionCellRange=this.createCellRange(Ds.DIMENSION,...t))}isComboChart(e){return isComboChart(e??this.chartType)}getCrossFilteringSort(){let e=this.crossFilteringSort;if(typeof e==`boolean`)return e;let t=[];return e.forEach(({sort:e,colId:n})=>{let r=this.chartColSvc.getColumn(n);r&&t.push({sort:e,column:r})}),t}},StatisticalChartProxy=class extends CartesianChartProxy{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){let{data:n,fields:r}=e,[i]=e.categories,o=i.id||iy,s=this.groupDataByCategory(o,n);return Array.from(s).map(([e,n])=>{let o={[i.id]:e};return r.forEach((e,r)=>{let i=n.map(t=>t[e.colId]).filter(e=>typeof e==`number`&&!isNaN(e)),s=t(i);for(let e of Object.keys(s)){let t=`${e}:${r}`;o[t]=i.length>0?s[e]:null}}),o})}groupDataByCategory(e,t){let getCategory=t=>{if(e===iy)return 1;let n=t[e];return n==null?``:n instanceof Date?n.getTime():n};return t.reduce((e,t)=>
8{let n=getCategory(t),r=e.get(n);return r?r.push(t):e.set(n,[t]),e},new Map)}},BoxPlotChartProxy=class extends StatisticalChartProxy{getSeries(e){let[t]=e.categories;return e.fields.map((e,n)=>({type:this.standaloneChartType,xKey:t.id,xName:t.name,yName:e.displayName??void 0,minName:`Min`,q1Name:`Q1`,medianName:`Median`,q3Name:`Q3`,maxName:`Max`,minKey:`min:${n}`,q1Key:`q1:${n}`,medianKey:`median:${n}`,q3Key:`q3:${n}`,maxKey:`max:${n}`}))}getData(e){return this.computeSeriesStatistics(e,e=>{let 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){let n=(e.length-1)*t,r=Math.floor(n),i=n-r;return e[r+1]===void 0?e[r]:e[r]+i*(e[r+1]-e[r])}},RangeChartProxy=class extends StatisticalChartProxy{getSeries(e){let[t]=e.categories;return e.fields.map((e,n)=>({type:this.standaloneChartType,xKey:t.id,xName:t.name,yName:e.displayName??void 0,yLowName:`Min`,yHighName:`Max`,yLowKey:`min:${n}`,yHighKey:`max:${n}`}))}getData(e){return this.computeSeriesStatistics(e,e=>({min:Math.min(...e),max:Math.max(...e)}))}},EnterpriseChartProxyFactory=class extends U{constructor(){super(...arguments),this.beanName=`enterpriseChartProxyFactory`}createChartProxy(e){switch(e.chartType){case`histogram`:return new HistogramChartProxy(e);case`radarLine`:case`radarArea`:case`nightingale`:case`radialColumn`:case`radialBar`:return new PolarChartProxy(e);case`rangeBar`:case`rangeArea`:return new RangeChartProxy(e);case`boxPlot`:return new BoxPlotChartProxy(e);case`treemap`:case`sunburst`:return new HierarchicalChartProxy(e);case`heatmap`:return new HeatmapChartProxy(e);case`waterfall`:return new WaterfallChartProxy(e);case`funnel`:case`coneFunnel`:case`pyramid`:return new FunnelChartProxy(e)}}},ChartPanelFeature=class extends U{constructor(e,t,n,r){super(),this.chartController=e,this.eGui=t,this.cssClass=n,this.createPanels=r,this.panels=[]}postConstruct(){this.addManagedListeners(this.chartController,{chartUpdated:()=>this.refreshPanels(!0),chartApiUpdate:()=>this.refreshPanels(!1)})}addComponent(e){this.createBean(e),this.panels.push(e),e.addCss(this.cssClass),this.eGui.appendChild(e.getGui())}refreshPanels(e){let t=this.chartController.getChartType(),n=this.chartController.isGrouping(),r=getSeriesType(t);e&&t===this.chartType&&n===this.isGrouping||(this.destroyPanels(),this.createPanels(t,r),this.chartType=t,this.isGrouping=n)}destroyPanels(){for(let e of this.panels)Ta(e.getGui()),this.destroyBean(e);this.panels=[]}destroy(){this.destroyPanels(),super.destroy()}},AnimationPanel=class extends K{constructor(e){super(),this.chartMenuParamsFactory=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){let e=this.chartMenuParamsFactory.addEnableParams(`animation.enabled`,{cssIdentifier:`charts-advanced-settings-top-level`,direction:`vertical`,suppressOpenCloseIcons:!0,title:this.chartTranslation.translate(`animation`),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.chartMenuParamsFactory.getDefaultNumberInputParams(`animation.duration`,`durationMillis`,{min:0});this.setTemplate(`<div>
9            <ag-group-component data-ref="animationGroup">
10                <ag-input-number-field data-ref="animationHeightInput"></ag-input>
11            </ag-group-component>
12        </div>`,[u_,Fc],{animationGroup:e,animationHeightInput:t})}},ay={tag:`div`,cls:`ag-color-input`,role:`presentation`,children:[{tag:`div`,ref:`eLabel`,cls:`ag-input-field-label`},{tag:`div`,ref:`eWrapper`,cls:`ag-wrapper ag-input-wrapper`,role:`presentation`,children:[{tag:`input`,ref:`eInput`,cls:`ag-input-field-input`},{tag:`div`,ref:`eColor`,cls:`ag-color-input-color`}]}]},AgColorInput=class extends bo{constructor(){super({template:ay}),this.eColor=null}wireBeans(e){this.chartTranslation=e.chartTranslation,this.color=e.agChartsExports._Util.Color}setColor(e){let t=e.toRgbaString();this.setValue(this.color.fromString(t).toHexString().toUpperCase(),!0),this.eColor.style.backgroundColor=t}setValue(e,t){let n=this.color.validColorString(e??``);return this.eInput.setCustomValidity(n?``:this.chartTranslation.translate(`invalidColor`)),super.setValue(e,t),n&&!t&&this.dispatchLocalEvent({type:`colorChanged`}),this}onColorChanged(e){this.addManagedListeners(this,{colorChanged:()=>e(this.color.fromString(this.value))})}},oy={selector:`AG-COLOR-INPUT`,component:AgColorInput},sy=8,cy=[],AgColorPanel=class extends K{constructor(e){super(`<div class="ag-color-panel" tabindex="-1">
13            <div data-ref="spectrumColor" class="ag-spectrum-color">
14                <div class="ag-spectrum-sat ag-spectrum-fill">
15                    <div data-ref="spectrumVal" class="ag-spectrum-val ag-spectrum-fill">
16                        <div data-ref="spectrumDragger" class="ag-spectrum-dragger"></div>
17                    </div>
18                </div>
19            </div>
20            <div class="ag-spectrum-tools">
21                <div data-ref="spectrumHue" class="ag-spectrum-hue ag-spectrum-tool">
22                    <div class="ag-spectrum-hue-background"></div>
23                    <div data-ref="spectrumHueSlider" class="ag-spectrum-slider"></div>
24                </div>
25                <div data-ref="spectrumAlpha" class="ag-spectrum-alpha ag-spectrum-tool">
26                    <div class="ag-spectrum-alpha-background"></div>
27                    <div data-ref="spectrumAlphaSlider" class="ag-spectrum-slider"></div>
28                </div>
29                <ag-color-input data-ref="colorInput"></ag-color-input>
30                <div data-ref="recentColors" class="ag-recent-colors"></div>
31            </div>
32        </div>`,[oy]),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.spectrumColor=null,this.spectrumVal=null,this.spectrumDragger=null,this.spectrumHue=null,this.spectrumHueSlider=null,this.spectrumAlpha=null,this.spectrumAlphaSlider=null,this.colorInput=null,this.recentColors=null,this.picker=e.picker}wireBeans(e){this._Color=e.agChartsExports._Util.Color}postConstruct(){this.initTabIndex(),this.initRecentColors(),this.addGuiEventListener(`focus`,()=>this.spectrumColor.focus()),this.addGuiEventListener(`keydown`,e=>{e.key===G.ENTER&&!e.defaultPrevented&&this.destroy()}),this.addManagedListeners(this.spectrumColor,{keydown:e=>this.moveDragger(e)}),this.addManagedListeners(this.spectrumAlphaSlider,{keydown:e=>this.moveAlphaSlider(e)}
32),this.addManagedListeners(this.spectrumHueSlider,{keydown:e=>this.moveHueSlider(e)}),this.addManagedListeners(this.spectrumVal,{mousedown:this.onSpectrumDraggerDown.bind(this)}),this.addManagedListeners(this.spectrumHue,{mousedown:this.onSpectrumHueDown.bind(this)}),this.addManagedListeners(this.spectrumAlpha,{mousedown:this.onSpectrumAlphaDown.bind(this)}),this.addGuiEventListener(`mousemove`,e=>{this.onSpectrumDraggerMove(e),this.onSpectrumHueMove(e),this.onSpectrumAlphaMove(e)}),this.addManagedListeners(document,{mouseup:this.onMouseUp.bind(this)}),this.colorInput.onColorChanged(this.setColor.bind(this)),this.addManagedListeners(this.recentColors,{click:this.onRecentColorClick.bind(this),keydown:e=>{(e.key===G.ENTER||e.key===G.SPACE)&&(e.preventDefault(),this.onRecentColorClick(e))}})}initTabIndex(){let 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){e.preventDefault(),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){let t=this.spectrumValRect;if(!t)return;let n,r;if(e instanceof MouseEvent)n=e.clientX-t.left,r=e.clientY-t.top;else{let t=e.key===G.LEFT,i=e.key===G.RIGHT,o=e.key===G.UP,s=e.key===G.DOWN,c=o||s,p=t||i;if(!c&&!p)return;e.preventDefault();let{x:m,y:h}=this.getSpectrumValue();n=m+(p?t?-5:5:0),r=h+(c?o?-5:5:0)}n=Math.max(n,0),n=Math.min(n,t.width),r=Math.max(r,0),r=Math.min(r,t.height),this.setSpectrumValue(n/t.width,1-r/t.height)}moveHueSlider(e){let t=this.spectrumHueRect;if(!t)return;let n=this.moveSlider(this.spectrumHueSlider,e);n!=null&&(this.H=1-n/t.width,this.update())}moveAlphaSlider(e){let t=this.spectrumAlphaRect;if(!t)return;let n=this.moveSlider(this.spectrumAlphaSlider,e);n!=null&&(this.A=n/t.width,this.update())}moveSlider(e,t){let n=e.getBoundingClientRect(),r=e.parentElement?.getBoundingClientRect();if(!e||!r)return null;let i=n.width/2,o;if(t instanceof MouseEvent)o=Math.floor(t.clientX-r.left);else{let n=t.key===G.LEFT,r=t.key===G.RIGHT;if(!n&&!r)return null;t.preventDefault();let s=n?-5:5;o=parseFloat(e.style.left)+i+s}return o=Math.max(o,0),o=Math.min(o,r.width),e.style.left=o-i+`px`,o}update(e){let{A:t,S:n,B:r,H:i,_Color:o}=this,s=i*360,c=o.fromHSB(s,n,r,t),p=c.toRgbaString(),m=o.fromHSB(s,n,r).toRgbaString(),h=o.fromHSB(s,1,1).toRgbaString(),g=this.picker;o.fromString(g.getValue()).toRgbaString()!==p&&(this.colorChanged=!0),g.setValue(p),this.spectrumColor.style.backgroundColor=h,this.spectrumDragger.style.backgroundColor=m,this.spectrumHueSlider.style.backgroundColor=h,this.spectrumAlpha.style.setProperty(`--ag-internal-spectrum-alpha-color-from`,o.fromHSB(s,n,r,0).toRgbaString()),this.spectrumAlpha.style.setProperty(`--ag-internal-spectrum-alpha-color-to`,m),this.spectrumAlpha.style.setProperty(`--ag-internal-spectrum-alpha-color`,p),e||this.colorInput.setColor(c)}setSpectrumValue(e,t,n){let r=this.spectrumValRect||this.refreshSpectrumRect();if(r==null)return;let i=this.spectrumDragger,o=i.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,i.style.left=e*r.width-o.width/2+`px`,i.style.top=(1-t)*r.height-o.height/2+`px`,this.update(n)}getSpectrumValue(){let e=this.spectrumDragger,t=e.getBoundingClientRect();return{x:parseFloat(e.style.left)+t.width/2,y:parseFloat(e.style.top)+t.height/2}}initRecentColors(){let e=cy,t=e.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(``),W(this.recentColors,!!e.length)}setValue(e){let t=this._Color.fromString(e);this.setColor(t,!0)}setColor(e,t){let[n,r,i]=e.toHSB();this.H=(isNaN(n)?0:n)/360,this.A=e.a;let o=this.spectrumHueRect||this.refreshHueRect(),s=this.spectrumAlp
32haRect||this.refreshAlphaRect();this.spectrumHueSlider.style.left=`${(this.H-1)*-o.width-this.spectrumHueSlider.getBoundingClientRect().width/2}px`,this.spectrumAlphaSlider.style.left=`${this.A*s.width-this.spectrumAlphaSlider.getBoundingClientRect().width/2}px`,this.setSpectrumValue(r,i,!t)}onRecentColorClick(e){let t=e.target;if(!Xs(t.id))return;let n=parseInt(t.id,10);this.setValue(cy[n]),this.destroy()}addRecentColor(){let e=this._Color.fromHSB(this.H*360,this.S,this.B,this.A).toRgbaString(),t=cy;!this.colorChanged||t[0]===e||(t=t.filter(t=>t!=e),t=[e].concat(t),t.length>sy&&(t=t.slice(0,sy)),cy=t)}destroy(){this.addRecentColor(),super.destroy()}},AgColorPicker=class extends Fo{constructor(e){super({pickerAriaLabelKey:`ariaLabelColorPicker`,pickerAriaLabelValue:`Color Picker`,pickerType:`ag-list`,className:`ag-color-picker`,pickerIcon:`chartsColorPicker`,...e})}postConstruct(){this.eDisplayFieldColor=Dl({tag:`span`,cls:`ag-color-picker-color`}),this.eDisplayFieldText=Dl({tag:`span`,cls:`ag-color-picker-value`}),this.eDisplayField.append(this.eDisplayFieldColor,this.eDisplayFieldText),super.postConstruct(),this.value&&this.setValue(this.value)}createPickerComponent(){let e=this.eWrapper.getBoundingClientRect(),t=this.beans.popupSvc.getParentRect();return this.createBean(new AgDialog({closable:!1,modal:!0,hideTitleBar:!0,minWidth:190,width:190,height:250,x:e.right-t.left-190,y:e.top-t.top-250-(this.config.pickerGap??0),postProcessPopupParams:{type:`colorPicker`,eventSource:this.eWrapper}}))}renderAndPositionPicker(){let e=this.pickerComponent,t=this.createBean(new AgColorPanel({picker:this}));return e.addCss(`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())}),()=>this.pickerComponent?.close()}setValue(e){return this.value===e?this:(this.eDisplayFieldColor.style.backgroundColor=e,this.eDisplayFieldText.textContent=this.beans.agChartsExports._Util.Color.fromString(e).toHexString().toUpperCase(),super.setValue(e))}getValue(){return this.value}},ly={selector:`AG-COLOR-PICKER`,component:AgColorPicker},CrosshairPanel=class extends K{constructor(e){super(),this.chartMenuParamsFactory=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){let e=this.chartMenuParamsFactory.addEnableParams(`crosshair.enabled`,{cssIdentifier:`charts-advanced-settings-top-level`,direction:`vertical`,suppressOpenCloseIcons:!0,title:this.chartTranslation.translate(`crosshair`),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.chartMenuParamsFactory.getDefaultCheckboxParams(`crosshair.label.enabled`,`crosshairLabel`),n=this.chartMenuParamsFactory.getDefaultCheckboxParams(`crosshair.snap`,`crosshairSnap`),r=this.chartMenuParamsFactory.getDefaultColorPickerParams(`crosshair.stroke`,`color`);this.setTemplate(`<div>
33            <ag-group-component data-ref="crosshairGroup">
34                <ag-checkbox data-ref="crosshairLabelCheckbox"></ag-checkbox>
35                <ag-checkbox data-ref="crosshairSnapCheckbox"></ag-checkbox>
36                <ag-color-picker data-ref="crosshairStrokeColorPicker"></ag-color-picker>
37            </ag-group-component>
38        </div>`,[u_,Pa,ly],{crosshairGroup:e,crosshairLabelCheckbox:t,crosshairSnapCheckbox:n,crosshairStrokeColorPicker:r})}},AgInputRange=class extends wa{constructor(e){super(e,`ag-range-field`,`range`)}postConstruct(){super.postConstruct();let{min:e,max:t,step:n}=this.config;e!=null&&this.setMinValue(e),t!=null&&this.setMaxValue(t),this.setStep(n||1)}addInputListeners(){this.addManagedElementListeners(this.eInput,{input
38:e=>{let 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){this.min!=null&&(e=Math.max(parseFloat(e),this.min).toString()),this.max!=null&&(e=Math.min(parseFloat(e),this.max).toString());let n=super.setValue(e,t);return this.eInput.value=e,n}},uy={selector:`AG-INPUT-RANGE`,component:AgInputRange},AgSlider=class extends Gl{constructor(e){super(e,`<div class="ag-slider">
39            <label data-ref="eLabel"></label>
40            <div class="ag-wrapper ag-slider-wrapper">
41                <ag-input-range data-ref="eSlider"></ag-input-range>
42                <ag-input-number-field data-ref="eText"></ag-input-number-field>
43            </div>
44        </div>`,[uy,Fc]),this.eLabel=null,this.eSlider=null,this.eText=null,this.labelAlignment=`top`}postConstruct(){super.postConstruct(),this.eSlider.addCss(`ag-slider-field`);let{minValue:e,maxValue:t,textFieldWidth:n,step:r,value:i,onValueChange:o}=this.config;e!=null&&this.setMinValue(e),t!=null&&this.setMaxValue(t),n!=null&&this.setTextFieldWidth(n),r!=null&&this.setStep(r),i!=null&&this.setValue(i),o!=null&&this.onValueChange(o)}onValueChange(e){return this.addManagedListeners(this.eText,{fieldValueChanged:()=>{let t=parseFloat(this.eText.getValue());this.eSlider.setValue(t.toString(),!0),e(t||0)}}),this.addManagedListeners(this.eSlider,{fieldValueChanged:()=>{let 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:(this.eText.setValue(e,!0),this.eSlider.setValue(e,!0),t||this.dispatchLocalEvent({type:`fieldValueChanged`}),this)}setStep(e){return this.eSlider.setStep(e),this.eText.setStep(e),this}},dy={selector:`AG-SLIDER`,component:AgSlider},NavigatorPanel=class extends K{constructor(e){super(),this.chartMenuParamsFactory=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){let e=this.chartMenuParamsFactory.addEnableParams(`navigator.enabled`,{cssIdentifier:`charts-advanced-settings-top-level`,direction:`vertical`,suppressOpenCloseIcons:!0,title:this.chartTranslation.translate(`navigator`),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.chartMenuParamsFactory.getDefaultSliderParams(`navigator.height`,`height`,60);t.minValue=10;let n=this.chartMenuParamsFactory.getDefaultCheckboxParams(`navigator.miniChart.enabled`,`miniChart`);this.setTemplate(`<div>
45            <ag-group-component data-ref="navigatorGroup">
46                <ag-slider data-ref="navigatorHeightSlider"></ag-slider>
47                <ag-checkbox data-ref="navigatorMiniChartCheckbox"></ag-checkbox>
48            </ag-group-component>
49        </div>`,[u_,dy,Pa],{navigatorGroup:e,navigatorHeightSlider:t,navigatorMiniChartCheckbox:n})}},ZoomPanel=class extends K{constructor(e){super(),this.chartMenuParamsFactory=e,this.zoomScrollingStepInput=null}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){let e=this.chartMenuParamsFactory.addEnableParams(`zoom.enabled`,{cssIdentifier:`charts-advanced-settings-top-level`,direction:`vertical`,suppressOpenCloseIcons:!0,title:this.chartTranslation.translate(`zoom`),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.chartMenuParamsFactory.getDefaultCheckboxParams(`zoom.enableScrolling`,`scrollingZoom`),n=this.chartMenuParamsFactory.getDefaultSliderParams(`zoom.scrollingStep`,`scrollingStep`,1);n.step=.01,n.minValue=n.step;let r=this.chartMenuParamsFactory.getDefaultCheckboxParams(`zoom.enableSelecting`,`selectingZoom`);t.onValueChange=(e=>t=>{e&&(e(t),this.zoomScrollingStepInput.setDisabled(!t))})(t.onValueChange),this.setTemplate(`<div>
50            <ag-group-component data-ref="zoomGroup">
51                <ag-checkbox data-ref="zoomSelectingCheckbox"></ag-checkbox>
52                <ag-checkbox data-ref="zoomScrollingCheckbox"></ag-checkbox>
53                <ag-slider data-ref="zoomScrollingStepInput"></ag-slider>
54            </ag-group-component>
55        </div>`,[u_,Pa,dy],{zoomGroup:e,zoomScrollingCheckbox:t,zoomScrollingStepInput:n,zoomSelectingCheckbox:r}),this.zoomScrollingStepInput.setDisabled(!t.value)}}
55,fy=[`navigator`,`zoom`,`animation`,`crosshair`],AdvancedSettingsPanel=class extends K{constructor(e){super(`<div class="ag-chart-advanced-settings-wrapper"></div>`),this.chartMenuContext=e}postConstruct(){this.chartPanelFeature=this.createManagedBean(new ChartPanelFeature(this.chartMenuContext.chartController,this.getGui(),`ag-chart-advanced-settings-section`,(e,t)=>this.createPanels(e,t))),this.chartPanelFeature.refreshPanels()}createPanels(e,t){for(let e of fy){if(!this.isGroupPanelShownForSeries(e,t))continue;let n=this.createPanel(e);this.chartPanelFeature.addComponent(n)}}isGroupPanelShownForSeries(e,t){return e===`animation`||isCartesian(t)&&!isFunnel(t)}createPanel(e){let{chartMenuParamsFactory:t,chartAxisMenuParamsFactory:n}=this.chartMenuContext;switch(e){case`navigator`:return new NavigatorPanel(t);case`zoom`:return new ZoomPanel(t);case`animation`:return new AnimationPanel(t);case`crosshair`:return new CrosshairPanel(n)}}},AdvancedSettingsMenuFactory=class extends U{constructor(){super(...arguments),this.beanName=`advSettingsMenuFactory`}showMenu(e,t){this.hideMenu();let n=this.createBean(new AdvancedSettingsMenu(e));this.activeDialog=this.createBean(new AgDialog({title:this.beans.chartTranslation.translate(`advancedSettings`),component:n,width:300,height:400,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{Zl(n.getGui())[0]?.focus()},closedCallback:()=>{this.activeMenu=this.destroyBean(this.activeMenu),this.activeDialog=void 0,t?.focus({preventScroll:!0})}})),this.activeMenu=n}hideMenu(){this.activeDialog&&this.destroyBean(this.activeDialog)}destroy(){this.activeMenu=this.destroyBean(this.activeMenu),this.activeDialog=this.destroyBean(this.activeDialog),super.destroy()}},AdvancedSettingsMenu=class extends gs{constructor(e){super(`<div class="ag-chart-advanced-settings"></div>`),this.chartMenuContext=e}postConstruct(){this.advancedSettingsPanel=this.createManagedBean(new AdvancedSettingsPanel(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();let t=e.shiftKey,n=this.advancedSettingsPanel.getGui(),r=Qo(this.beans,n,!1,t);if(r)r.focus();else{let e=Zl(n);e.length&&e[t?e.length-1:0].focus()}}},ChartMenuListFactory=class extends U{constructor(){super(...arguments),this.beanName=`chartMenuListFactory`}wireBeans(e){this.popupSvc=e.popupSvc,this.chartMenuSvc=e.chartMenuSvc,this.chartTranslation=e.chartTranslation}showMenuList(e){let{eventSource:t,showMenu:n,chartMenuContext:r}=e,i=this.chartMenuSvc.doChartToolPanelsExist(r.chartController),o=this.mapWithStockItems(this.getMenuItems(r.chartController,i),r,n,t,i);if(!o.length)return;let s=this.createBean(new ChartMenuList(o));this.activeChartMenuList=s;let c=-1,p=`left`;this.gos.get(`enableRtl`)&&(c=1,p=`right`);let m=s.getGui();this.popupSvc.addPopup({modal:!0,eChild:m,closeOnEsc:!0,closedCallback:()=>{this.destroyBean(s),this.activeChartMenuList=void 0,ks(this.beans)&&t.focus({preventScroll:!0})},afterGuiAttached:e=>s.afterGuiAttached(e),positionCallback:()=>{this.popupSvc.positionPopupByComponent({type:`chartMenu`,eventSource:t,ePopup:m,alignSide:p,nudgeX:4*c,nudgeY:4,position:`under`,keepWithinBounds:!0})},ariaLabel:`Chart Menu`})}getMenuItems(e,t){let n=[...t?[`chartEdit`]:[],...e.isEnterprise()?[`chartAdvancedSettings`]:[],e.isChartLinked()?`chartUnlink`:`chartLink`,`chartDownload`],r=this.gos.get(`chartMenuItems`);return r?Array.isArray(r)?r:r(co(this.gos,{defaultItems:n,chartId:e.getChartId()})):n}mapWithStockItems(e,t,n,r,i){if(!e)return[];let o=[];for(let s of e){let e;
55if(e=typeof s==`string`?this.getStockMenuItem(s,t,n,r,i):{...s},!e)continue;let{subMenu:c}=e;Array.isArray(c)&&(e.subMenu=this.mapWithStockItems(c,t,n,r,i)),o.push(e)}return o}getStockMenuItem(e,t,n,r,i){switch(e){case`chartEdit`:return i?this.createMenuItem(this.chartTranslation.translate(`chartEdit`),`chartsMenuEdit`,n):null;case`chartAdvancedSettings`:return this.createMenuItem(this.chartTranslation.translate(`chartAdvancedSettings`),`chartsMenuAdvancedSettings`,()=>this.chartMenuSvc.openAdvancedSettings(t,r));case`chartUnlink`:return t.chartController.isChartLinked()?this.createMenuItem(this.chartTranslation.translate(`chartUnlink`),`unlinked`,()=>this.chartMenuSvc.toggleLinked(t)):null;case`chartLink`:return t.chartController.isChartLinked()?null:this.createMenuItem(this.chartTranslation.translate(`chartLink`),`linked`,()=>this.chartMenuSvc.toggleLinked(t));case`chartDownload`:return this.createMenuItem(this.chartTranslation.translate(`chartDownload`),`chartsDownload`,()=>this.chartMenuSvc.downloadChart(t))}return null}createMenuItem(e,t,n){return{name:e,icon:J(t,this.beans,null),action:n}}destroy(){this.destroyBean(this.activeChartMenuList),super.destroy()}},ChartMenuList=class extends K{constructor(e){super(`
56            <div data-ref="eChartsMenu" role="presentation" class="ag-menu ag-chart-menu-popup"></div>
57        `),this.menuItems=e,this.eChartsMenu=null}postConstruct(){this.mainMenuList=this.createManagedBean(new AgMenuList(0)),this.mainMenuList.addMenuItems(this.menuItems),this.mainMenuList.addEventListener(`closeMenu`,this.onHidePopup.bind(this)),this.eChartsMenu.appendChild(this.mainMenuList.getGui())}onHidePopup(){this.hidePopupFunc?.()}afterGuiAttached({hidePopup:e}){e&&(this.hidePopupFunc=e,this.addDestroyFunc(e)),ja(this.mainMenuList.getGui())}},ChartCrossFilterService=class extends U{constructor(){super(...arguments),this.beanName=`chartCrossFilterSvc`}filter(e,t=!1){let n=this.beans.filterManager,r=n?.getFilterModel()??{};if(t){Object.keys(r).length>0&&n?.setFilterModel(null);return}let i=extractFilterColId(e);i.indexOf(`-filtered-out`)&&(i=i.replace(`-filtered-out`,``)),this.updateFilters(r,e,i)}updateFilters(e,t,n){let r=extractFilterColId(t),i=this.convertRawValue(n,t.datum[r]);if(i===void 0)return;let o=this.beans.filterManager;o?.getColumnFilterInstance(n).then(r=>{let s=r?.filterType,c,processModel=e=>e;if(s===`multi`){let e=extractFromMultiFilter(r);c=e.setFilter,processModel=e.processModel??processModel}else s===`set`&&(c=r);if(!c){q(154,{colId:n});return}let p=t.event.metaKey||t.event.ctrlKey,m=c.getFilterHandler().getCrossFilterModel((e,t,n)=>getSetFilterModel(p,e(i),t,n)),h=processModel(m),g=p?{...e}:{};g[n]=h,o?.setFilterModel(g)})}convertRawValue(e,t){let{colModel:n,dataTypeSvc:r}=this.beans,i=n.getColById(e),o=i?.colDef;return o&&r&&o.chartDataType===`time`&&o.cellDataType===`dateString`?r.getDateFormatterFunction(i)(t):t}};function processMultiFilterModel(e,t,n){let r=Array(n);for(let i=0;i<n;i++)r[i]=i===t?e:null;return{filterType:`multi`,filterModels:r}}function extractFromMultiFilter(e){let t=e.getNumChildFilters();for(let n=0;n<t;n++){let r=e.getChildFilterInstance(n);if(r?.filterType===`set`)return{setFilter:r,processModel:e=>processMultiFilterModel(e,n,t)}}return{}}function extractFilterColId(e){return e.xKey||e.calloutLabelKey}function getSetFilterModel(e,t,n,r){let i;if(e){if(n.has(t)&&(r==null||r.includes(t))){if(i=[],r==null)for(let e of n)e!==t&&i.push(e);else for(let e of r)e!==t&&n.has(e)&&i.push(e)}else{if(r==null)i=Array.from(n);else{i=[];for(let e of r)n.has(e)&&i.push(e)}i.push(t)}}else i=[t];return{filterType:`set`,values:i}}var py=[`chartUnlink`,`chartLink`,`chartDownload`,`chartMenu`],my={settings:`chartSettings`,data:`chartData`,format:`chartFormat`},ChartMenuService=class extends U{constructor(){super(...arguments),this.beanName=`chartMenuSvc`}wireBeans(e){this.advSettingsMenuFactory=e.advSettingsMenuFactory}downloadChart(e,t,n,r){e.chartController.getChartProxy().downloadChart(t,n,r)}toggleLinked(e){e.chartController.detachChartRange()}openAdvancedSettings(e,t){this.advSettingsMenuFactory?.showMenu(e,t)}hideAdvancedSettings(){this.advSettingsMenuFactory?.hideMenu()}getChartToolbarOptions(){let e=[`chartMenu`],t=this.gos.getCallback(`getChartToolbarItems`);return t?t({defaultItems:e}).filter(e=>py.includes(e)?!0:(q(155,{option:e}),!1)):e}getChartToolPanels(e){let t=this.gos.get(`chartToolPanelsDef`),n=t?.panels?.map(e=>{let t=my[e];return t||q(156,{panel:e}),t}).filter(e=>!!e)??Object.values(my);e.isPivotChart()&&(n=n.filter(e=>e!==`chartData`));let r=t?.defaultToolPanel,i=r&&my[r]||n[0];return{panels:n,defaultPanel:i}}doesChartToolbarExist(){return this.getChartToolbarOptions().length>0}doChartToolPanelsExist(e){let{panels:t}=this.getChartToolPanels(e);return t.length>0}},hy={pivotChartTitle:`Pivot Chart`,rangeChartTitle:`Range Chart`,settings:`Chart`,data:`Set Up`,format:`Customize`,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`,radiu
57sAxis:`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`,polygon:`Polygon`,square:`Square`,cross:`Cross`,diamond:`Diamond`,plus:`Plus`,triangle:`Triangle`,heart:`Heart`,orientation:`Orientation`,fixed:`Fixed`,parallel:`Parallel`,perpendicular:`Perpendicular`,radiusAxisPosition:`Position`,ticks:`Ticks`,gridLines:`Grid Lines`,width:`Width`,height:`Height`,length:`Length`,padding:`Padding`,spacing:`Spacing`,chartStyle:`Chart Style`,title:`Title`,chartTitles:`Titles`,chartTitle:`Chart Title`,chartSubtitle:`Subtitle`,horizontalAxisTitle:`Horizontal Axis Title`,verticalAxisTitle:`Vertical Axis Title`,polarAxisTitle:`Polar Axis Title`,titlePlaceholder:`Chart Title`,background:`Background`,font:`Font`,weight:`Weight`,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`,stackedLineTooltip:`Stacked`,normalizedLineTooltip:`100% Stacked`,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`,waterfallTooltip:`Waterfall`,heatmapTooltip:`Heatmap`,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`,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`,bar:`Bar`,column:`Column`,histogram:`Histogram`,advancedSettings:`Advanced Settings`,direction:`Direction`,horizontal:`Horizontal`,vertical:`Vertical`,seriesGroupType:`Group Type`,groupedSeriesGroupType:`Grouped`,stackedSeriesGroupType:`Stacked`,normalizedSeriesGroupType:`100% Stacked`,legendEnabled:`Enabled`,invalidColor:`Color value is invali
57d`,groupedColumnFull:`Grouped Column`,stackedColumnFull:`Stacked Column`,normalizedColumnFull:`100% Stacked Column`,groupedBarFull:`Grouped Bar`,stackedBarFull:`Stacked Bar`,normalizedBarFull:`100% Stacked Bar`,stackedAreaFull:`Stacked Area`,normalizedAreaFull:`100% Stacked Area`,stackedLineFull:`Stacked Line`,normalizedLineFull:`100% Stacked Line`,customCombo:`Custom Combination`,funnel:`Funnel`,coneFunnel:`Cone Funnel`,pyramid:`Pyramid`,funnelGroup:`Funnel`,funnelTooltip:`Funnel`,coneFunnelTooltip:`Cone Funnel`,pyramidTooltip:`Pyramid`,dropOff:`Drop-Off`,stageLabels:`Stage Labels`,reverse:`Reverse`,tooltipMode:`Tooltip Mode`,tooltipModeSingle:`Single`,tooltipModeShared:`Multiple`,tooltipModeCompact:`Compact`,groupedColumn:`Grouped`,stackedColumn:`Stacked`,pie:`Pie`,donut:`Donut`,line:`Line`,scatter:`Scatter`,bubble:`Bubble`,area:`Area`,stackedArea:`Stacked`,radarLine:`Radar Line`,radarArea:`Radar Area`,nightingale:`Nightingale`,radialColumn:`Radial Column`,radialBar:`Radial Bar`,boxPlot:`Box Plot`,rangeBar:`Range Bar`,rangeArea:`Range Area`,treemap:`Treemap`,sunburst:`Sunburst`,waterfall:`Waterfall`,heatmap:`Heatmap`,columnLineCombo:`Column & Line`,AreaColumnCombo:`Area & Column`,ariaChartMenuClose:`Close Chart Edit Menu`,ariaChartSelected:`Selected`,group:`Group`,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`},ChartTranslationService=class extends U{constructor(){super(...arguments),this.beanName=`chartTranslation`}translate(e){let t=this.getLocaleTextFunc(),n=hy[e];return t(e,n)}},validateIfDefined=e=>t=>t==null||e(t),gy=e(e=>typeof e==`string`,`isString`),isBoolean=e=>typeof e==`boolean`,isValidSeriesChartType=e=>typeof e==`object`,createWarnMessage=(e,t)=>n=>`AG Grid - unable to update chart as invalid params supplied:  \`${e}: ${n}\`, expected ${t}.`,createEnterpriseMessage=e=>`${e} is not supported in AG Charts Community ('ag-charts-enterprise' hasn't been loaded). See https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/ for more details.`,_y=[`doughnut`],vy=[`type`,`chartId`,`chartType`,`chartThemeName`,`chartThemeOverrides`,`unlinkChart`];function isValidChartType(e){return!!getSeriesTypeIfExists(e)||isComboChart(e)}function isLegacyChartType(e){return _y.includes(e)}var yy=validateIfDefined(e=>{if(isValidChartType(e))return!0;if(isLegacyChartType(e)){let t=getCanonicalChartType(e);return Qs(`The chart type '${e}' has been deprecated. Please use '${t}' instead.`),t}return!1}),by=validateIfDefined(e=>typeof e==`object`),xy=validateIfDefined(e=>typeof e==`object`),Sy=validateIfDefined(e=>typeof e==`string`||typeof e==`function`),enterpriseChartTypeValidation=e=>({property:`chartType`,validationFn:validateIfDefined(t=>e||!t||!isEnterpriseChartType(t)),warnMessage:e=>createEnterpriseMessage(`The '${e}' chart type`)}),switchCategorySeriesValidation=e=>({property:`switchCategorySeries`,validationFn:validateIfDefined(t=>{if(!t||e)return!0}),warnMessage:()=>createEnterpriseMessage(`'switchCategorySeries' has been ignored as it`),warnIfFixed:!0}),commonUpdateValidations=()=>[{property:`chartId`,validationFn:gy,warnMessage:createWarnMessage(`chartId`,`string`)},{property:`chartType`,validationFn:yy,warnMessage:createWarnMessage(`chartType`,`ChartType`)},{property:`chartThemeName`,validationFn:gy,warnMessage:createWarnMessage(`chartThemeName`,`string`)},{property:`chartThemeOverrides`,validationFn:by,warnMessage:createWarnMessage(`chartThemeOverrides`,`AgChartThemeOverrides`)},{property:`unlinkChart`,validationFn:isBoolean,warnMessage:createWarnMessage(`unlinkChart`,`boolean`)}],cellRangeValidations=e=>[{property:`cellRange`,validationFn:xy,warnMessage:createWarnMessage(`cellRange`,`ChartParamsCellRange`)},{property:`suppressChartRanges`,validationFn:isBoolean,warnMessage:createWarnMessage(`suppressChartRanges`,`boolean`)},{property:`aggFunc`,validationFn:Sy,warnMessage:createWarnMessage(`aggFunc`,`string or IAggFunc`)},switchCategorySeriesValidation(e)];function validateUpdateParams(e,t){switch(e.type){case`rangeChartUpdate`:return validateUpdateRangeChartParams(e,t);case`pivotChartUpdate`:return validateUpdatePivotChartParams(e);case`crossFilterChartUpdate`:return validateUpdateCrossFilterChartParams(e,t);default:return Qs(`Invalid value supplied for 'type': ${e.type}. It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'.`),!1}}function validateCreateParams(e,t){return validateProperties(e,[enterpriseChartTypeValidation(t),switchCategorySeriesValidation(t)])}function validateUpdateRangeChartParams(e,t){return validateProperties(e,[...commonUpdateValidations(),enterpriseChartTypeValidation(t),...cellRangeValidations(t),{property:`seriesChartTypes`,validationFn:e=>e===void 0||Array.isArray(e)&&e.every(isValidSeriesChartType),warnMessage:createWarnMessage(`seriesChartTypes`,`Array of SeriesChartType`)}],[...vy,`cellRange`,`suppressChartRanges`,`switchCategorySeries`,`aggFunc`,`seriesChartTypes`,`seriesGroupType`],`UpdateRangeChartParams`)}function validateUpdatePivotChartParams(e){return validateProperties(e,[...commonUpdateValidations()],[...vy],`UpdatePivotChartParams`)}function validateUpdateCrossFilterChartParams(e,t){return validateProperties(e,[...commonUpdateValidations(),...cellRangeValidations(t)],[...vy,`cellRange`,`suppressChartRanges`,`aggFunc`],`UpdateCrossFilterChartParams`)}function validateProperties(e,t,n,r){let i;for(let n of t){let{property:t,validationFn:r,warnMessage:o,warnIfFixed:s}=n;if(t in e){let n=e[t],c=r(n);if(c===!0)continue;if(c===!1)return Qs(o(n)),!1;i||={...e},i[t]=c,s&&Qs(o(n))}}if(n){for(let t of Object.keys(e))if(!n.includes(t))return Qs(`Unexpected property supplied. ${r} does not contain: \`${t}\`.`),!1}return i||!0}var Cy=[`ag-default`,`ag-material`,`ag-sheets`,`ag-polychroma`,`ag-vivid`],ChartController=class extends U{constructor(e){super(),this.model=e,this.isEnterprise=()=>this.agChartsExports.isEnterprise}wireBeans(e){this.rangeSvc=e.rangeSvc,this.agChartsExports=e.agChartsExports}postConstruct(){this.setChartRange(),this.model.unlinked&&this.rangeSvc&&this.rangeSvc.setCellRanges([]);let e=this.updateForGridChange.bind(this,{});this.addManagedEventListeners({cellSelectionChanged:e=>{e.id&&e.id===this.model.chartId&&this.updateForRangeChange()},columnMoved:e,columnPinned:e,columnVisible:e,columnRowGroupChanged:e,modelUpdated:e,cellValueChanged:this.updateForDataChange.bind(this),cellEditValuesChanged:this.updateForDataChange.bind(this)})}update(e){if(!this.validUpdateType(e))return!1;let t=validateUpdateParams(e,this.agChartsExports.isEnterprise);if(!t)return!1;let n=t===!0?e:t;return this.applyValidatedChartParams(n),!0}applyValidatedChartParams(e){let{chartId:t,chartType:n,chartThemeName:r,unlinkChart:i}=e,o={chartId:t,pivotChart:this.model.pivotChart,chartType:n??this.model.chartType,chartThemeName:r??this.model.chartThemeName,unlinkChart:i??this.model.unlinked,cellRange:this.model.suppliedCellRange,switchCategorySeries:this.model.switchCategorySeries,aggFunc:this.model.aggFunc,seriesChartTypes:void 0,suppressChartRanges:!1,crossFiltering:!1};switch(e.type){case`rangeChartUpdate`:o.cellRange=this.createCellRange(e)??this.model.suppliedCellRange,o.switchCategorySeries=e.switchCategorySeries??this.model.switchCategorySeries,o.aggFunc=e.aggFunc??this.model.aggFunc,o.seriesChartTypes=e.seriesChartTypes,o.suppressChartRanges=e.suppressChartRanges??this.model.suppressChartRanges,o.seriesGroupType=e.seriesGroupType??this.model.seriesGroupType;break;case`crossFilterChartUpdate`:o.cellRange=this.createCellRange(e)??this.model.suppliedCellRange,o.switchCategorySeries=!1,o.aggFunc=e.aggFunc??this.model.aggFunc,o.crossFiltering=!0,o.crossFilteringSort=this.model.crossFilteringSort,o.suppressChartRanges=e.suppressChartRanges??this.model.suppressChartRanges;break;case`pivotChartUpdate`:o.switchCategorySeries=!1}this.model.updateModel(o),o.unlinkChart||o.suppressChartRanges?this.rangeSvc?.setCellRanges([]):this.setChartRange()}updateForGridChange(e){if(this.model.unlinked)return;let{maintainColState:t,setColsFromRange:n}=e??{};this.model.updateCellRanges({maintainColState:t,setColsFromRange:n}),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){let t=this.getSelectedValueColState().map(e=>({colId:e.colId,displayName:e.displayName})),n=this.getChartData(),r=this.getSelectedDimensions(),i=this.model,o={data:n,groupData:i.groupChartData,grouping:this.isGrouping(),categories:r.map(({colId:e,displayName:t})=>{let n=i.categoryAxisType??i.getChartDataType(e);return{id:e,name:t,chartDataType:n,convertTime:n===`time`?i.getConvertTime(e):void 0}}),fields:t,chartId:this.getChartId(),getCrossFilteringContext:()=>({lastSelectedChartId:`xxx`}),seriesChartTypes:this.getSeriesChartTypes(),updatedOverrides:e,seriesGroupType:i.seriesGroupType};return this.isCategorySeriesSwitched()?this.invertCategorySeriesParams(o):o}invertCategorySeriesParams(e){let[t]=e.categories,n=[{id:iy,name:``}],r=e.data.map((e,n)=>{let r=`${t.id}:${n}`,i=e[t.id];return{colId:r,displayName:i==null?``:String(i)}}),i=e.fields.map(n=>{let r={[iy]:n.displayName};for(let[i,o]of e.data.entries()){let e=`${t.id}:${i}`;r[e]=o[n.colId]}return r});return{...e,categories:n,fields:r,data:i}}getChartModel(){let 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()}isCategorySeriesSwitched(){return this.model.switchCategorySeries&&!this.model.isGrouping()}switchCategorySeries(e){supportsInvertedCategorySeries(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){let updateForMax=(e,t)=>{let n=0;for(let r of e)r.selected&&(n>=t?r.selected=!1:n++);n===0&&(e[0].selected=!0)},n=getMaxNumCategories(t),r=getMaxNumSeries(t),i=n!=null&&(getMaxNumCategories(e)??100)>(n??100),o=r!=null&&(getMaxNumSeries(e)??100)>(r??100);i&&updateForMax(this.model.dimensionColState,n),o&&updateForMax(this.model.valueColState,r),(i||o)&&(this.model.resetCellRanges(i,o),this.setChartRange(!0))}setChartThemeName(e,t){this.model.chartThemeName=e,t||this.raiseChartModelUpdateEvent()}getChartThemeName(){return this.model.chartThemeName}
57isPivotChart(){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`)||Cy}getThemes(){return this.getThemeNames().map(e=>{let t=isStockTheme(e,this.agChartsExports._Theme)?e:this.chartProxy.lookupCustomChartTheme(e);return this.agChartsExports._Theme.getChartTheme(t)})}getPalettes(){return this.getThemes().map(e=>e.palette)}getSelectedValueColState(){return this.model.getValueColState().filter(e=>e.selected)}getSelectedDimensions(){return this.model.getSelectedDimensions()}getColStateForMenu(){return{dimensionCols:this.model.dimensionColState,valueCols:this.model.getValueColState()}}setChartRange(e=!1){this.rangeSvc&&!this.model.suppressChartRanges&&!this.model.unlinked&&this.rangeSvc.setCellRanges(this.getCellRanges()),e||this.raiseChartModelUpdateEvent()}detachChartRange(){this.model.unlinked=!this.model.unlinked,this.model.unlinked?this.rangeSvc&&this.rangeSvc.setCellRanges([]):this.updateForGridChange(),this.dispatchLocalEvent({type:`chartLinkedChanged`})}setChartProxy(e){this.chartProxy=e}getChartProxy(){return this.chartProxy}isActiveXYChart(){return[`scatter`,`bubble`].includes(this.getChartType())}isChartLinked(){return!this.model.unlinked}customComboExists(){let e=this.model.comboChartModel.savedCustomSeriesChartTypes;return e&&e.length>0}getSeriesChartTypes(){return this.model.comboChartModel.seriesChartTypes}isComboChart(e){return this.model.isComboChart(e)}updateSeriesChartType(e,t,n){let r=this.model.comboChartModel.seriesChartTypes.find(t=>t.colId===e);if(r){let e=this.model.chartType!==`customCombo`;e&&(this.model.chartType=`customCombo`);let i=r.chartType;t!=null&&(r.chartType=t),n!=null&&(r.secondaryAxis=n),this.model.comboChartModel.savedCustomSeriesChartTypes=this.model.comboChartModel.seriesChartTypes,this.model.comboChartModel.updateSeriesChartTypes(),this.updateForDataChange(),e&&this.dispatchLocalEvent({type:`chartTypeChanged`}),i!==t&&this.dispatchLocalEvent({type:`chartSeriesChartTypeChanged`}),this.raiseChartOptionsChangedEvent()}}getActiveSeriesChartTypes(){let e=this.getSelectedValueColState().map(e=>e.colId);return this.getSeriesChartTypes().filter(t=>e.includes(t.colId))}getChartSeriesTypes(e){let t=e??this.getChartType();return this.isComboChart(t)?[`line`,`bar`,`area`]:[getSeriesType(t)]}getChartSeriesType(){let e=this.getSeriesChartTypes();if(e.length===0)return`bar`;let t=e[0].chartType;return t===`columnLineCombo`?`bar`:t===`areaColumnCombo`?`area`:getSeriesType(t)}getCellRanges(){return[this.model.dimensionCellRange,this.model.valueCellRange].filter(e=>e)}createCellRange(e){return e.cellRange&&this.rangeSvc?.createPartialCellRangeFromRangeParams(e.cellRange,!0)}validUpdateType(e){if(!e.type)return q(136),!1;let t={"Range Chart":()=>!this.isPivotChart()&&!this.isCrossFilterChart(),"Pivot Chart":()=>this.isPivotChart(),"Cross Filter Chart":()=>this.isCrossFilterChart()},n=Object.keys(t).find(e=>t[e]())??`Range Chart`,r=e.type===`${n[0].toLowerCase()}${n.slice(1).replace(/ /g,``)}Update`;return r||q(137,{currentChartType:n,type:e.type}),r}getCellRangeParams(){let e=this.getCellRanges(),t=e[0],n=t?.startRow||null,r=t?.endRow||null;return{rowStartIndex:n?.rowIndex??null,rowStartPinned:n?.rowPinned,rowEndIndex:r?.rowIndex??null,rowEndPinned:r?.rowPinned,columns:e.reduce((e,t)=>e.concat(t.columns.map(e=>e.getId())),[])}}setCategoryAxisType(e){this.model.categoryAxisType=e,this.raiseChartModelUpdateEvent()}getSeriesGroupType(){return this.model.seriesGroupType??this.chartProxy.getSeriesGroupType()}setSeriesGroupType(e){this.model.seriesGroupType=e,this.raiseChartModelUpdateEvent()}raiseChartModelUpdateEvent(){this.dispatchLocalEvent({type:`chartModelUpdate`}),this.raiseChartOptionsChangedEvent()}raiseChartUpdatedEvent(){this.dispatchLocalEvent({type:`chartUpdated`})}raiseChartApiUpdateEvent(){this.dispatchLocalEvent({type:`chartApiUpdate`})}raiseChartOptionsChangedEvent(){let{chartId:e,chartType:t}=this.getChartModel();this.eventSvc.dispatchEvent({type:`chartOptionsChanged`,chartId:e,chartType:t,chartThemeName:this.getChartThemeName(),chartOptions:this.chartProxy?.getChartThemeOverrides()})}raiseChartRangeSelectionChangedEvent(){this.eventSvc.dispatchEvent({type:`chartRangeSelectionChanged`,id:this.model.chartId,chartId:this.model.chartId,cellRange:this.getCellRangeParams()})}destroy(){super.destroy(),this.rangeSvc&&this.rangeSvc.setCellRanges([])}},AreaChartProxy=class extends CartesianChartProxy{getAxes(e){let t=[{type:this.getXAxisType(e),position:`bottom`},{type:`number`,position:`left`}];if(this.isNormalised()){let e=t[1];e.label={...e.label,formatter:e=>Math.round(e.value)+`%`}}return t}getSeries(e){let[t]=e.categories,n=e.fields.map(e=>({type:this.standaloneChartType,xKey:t.id,xName:t.name,yKey:e.colId,yName:e.displayName,normalizedTo:this.chartType===`normalizedArea`?100:void 0,stacked:[`normalizedArea`,`stackedArea`].includes(this.chartType)}));return this.crossFiltering?this.extractLineAreaCrossFilterSeries(n,e):n}isNormalised(){return!this.crossFiltering&&this.chartType===`normalizedArea`}},wy=new Set([`bar`,`groupedBar`,`stackedBar`,`normalizedBar`]),BarChartProxy=class extends CartesianChartProxy{getAxes(e){let t=[{type:this.getXAxisType(e),position:this.isHorizontal()?`left`:`bottom`},{type:`number`,position:this.isHorizontal()?`bottom`:`left`}];if(this.isNormalised()){let e=t[1];e.label={...e.label,formatter:e=>Math.round(e.value)+`%`}}return t}getSeries(e){let[t]=e.categories,n=e.fields.map(e=>({type:this.standaloneChartType,direction:this.isHorizontal()?`horizontal`:`vertical`,stacked:this.crossFiltering||isStacked(this.chartType),normalizedTo:this.isNormalised()?100:void 0,xKey:t.id,xName:t.name,yKey:e.colId,yName:e.displayName}));return this.crossFiltering?this.extractCrossFilterSeries(n):n}extractCrossFilterSeries(e){let t=[];for(let n=0;n<e.length;n++){let r={...e[n],listeners:{seriesNodeClick:this.crossFilterCallback}}
57,i={...r,yKey:`${r.yKey}-filtered-out`,showInLegend:!1};t.push(r),t.push(i)}return t}isNormalised(){return!this.crossFiltering&&[`normalizedColumn`,`normalizedBar`].includes(this.chartType)}isHorizontal(){return wy.has(this.chartType)}},LineChartProxy=class extends CartesianChartProxy{getAxes(e){let t=[{type:this.getXAxisType(e),position:`bottom`},{type:`number`,position:`left`}];if(this.isNormalised()){let e=t[1];e.label={...e.label,formatter:e=>Math.round(e.value)+`%`}}return t}getSeries(e){let[t]=e.categories,n=[`normalizedLine`,`stackedLine`].includes(this.chartType),r=e.fields.map(e=>({type:this.standaloneChartType,xKey:t.id,xName:t.name,yKey:e.colId,yName:e.displayName,normalizedTo:n&&this.isNormalised()?100:void 0,stacked:n}));return this.crossFiltering?this.extractLineAreaCrossFilterSeries(r,e):r}isNormalised(){return!this.crossFiltering&&[`normalizedLine`].includes(this.chartType)}},ScatterChartProxy=class extends CartesianChartProxy{getAxes(e){return[{type:`number`,position:`bottom`},{type:`number`,position:`left`}]}getSeries(e){let[t]=e.categories,n=this.isPaired(),r=this.getSeriesDefinitions(e.fields,n),i=t.id===iy?void 0:t,o=r.map(e=>e?.sizeField?{type:`bubble`,xKey:e.xField.colId,xName:e.xField.displayName??void 0,yKey:e.yField.colId,yName:e.yField.displayName??void 0,title:`${e.yField.displayName} vs ${e.xField.displayName}`,sizeKey:e.sizeField.colId,sizeName:e.sizeField.displayName??``,labelKey:i?i.id:e.yField.colId,labelName:i?i.name:void 0}:{type:`scatter`,xKey:e.xField.colId,xName:e.xField.displayName??void 0,yKey:e.yField.colId,yName:e.yField.displayName??void 0,title:`${e.yField.displayName} vs ${e.xField.displayName}`,labelKey:i?i.id:e.yField.colId,labelName:i?i.name:void 0});return this.crossFiltering?this.extractCrossFilterSeries(o,e):o}extractCrossFilterSeries(e,t){let{data:n}=t,filteredOutKey=e=>`${e}-filtered-out`,calcMarkerDomain=(e,t)=>{let n=[1/0,-1/0];if(t!=null)for(let r of e){let e=r[t]??r[filteredOutKey(t)];e<n[0]&&(n[0]=e),e>n[1]&&(n[1]=e)}if(n[0]<=n[1])return n},updatePrimarySeries=e=>{let t;if(e.type===`bubble`){let{sizeKey:r}=e;t=calcMarkerDomain(n,r)}return{...e,domain:t,highlight:{highlightedItem:{fill:`yellow`}},listeners:{...e.listeners,seriesNodeClick:this.crossFilterCallback}}},updateFilteredOutSeries=e=>{let{yKey:t,xKey:n}=e,r={};return e.type===`bubble`&&(r={sizeKey:filteredOutKey(e.sizeKey)}),{...e,...r,yKey:filteredOutKey(t),xKey:filteredOutKey(n),showInLegend:!1,listeners:{...e.listeners,seriesNodeClick:e=>{let t=e.datum[filteredOutKey(n)],r={...e,xKey:n,datum:{...e.datum,[n]:t}};this.crossFilterCallback(r)}}}},r=e.map(updatePrimarySeries);return[...r,...r.map(updateFilteredOutSeries)]}getSeriesDefinitions(e,t){if(e.length<2)return[];let n=this.chartType===`bubble`;if(t)return n?e.map((t,n)=>n%3==0?{xField:t,yField:e[n+1],sizeField:e[n+2]}:null).filter(e=>e?.yField&&e.sizeField):e.map((t,n)=>n%2==0?{xField:t,yField:e[n+1]}:null).filter(e=>e?.yField);let r=e[0];return n?e.map((t,n)=>n%2==1?{xField:r,yField:t,sizeField:e[n+1]}:null).filter(e=>e?.sizeField):e.filter((e,t)=>t>0).map(e=>({xField:r,yField:e}))}},ComboChartProxy=class extends CartesianChartProxy{getAxes(e){let t=e?e.fields:[],n=new Map(t.map(e=>[e.colId,e])),{primaryYKeys:r,secondaryYKeys:i}=this.getYKeys(t,e.seriesChartTypes),o=[{type:this.getXAxisType(e),position:`bottom`}];return r.length>0&&o.push({type:`number`,keys:r,position:`left`}),i.length>0&&i.forEach(e=>{let t=n.get(e);if(!(t&&t.colId===e))return;let r={type:`number`,keys:[e],position:`right`};o.push(r)}),o}getSeries(e){let{fields:t,seriesChartTypes:n}=e,[r]=e.categories;return t.map(e=>{let t=n.find(t=>t.colId===e.colId);if(t){let n=t.chartType,i=[`groupedColumn`,`groupedBar`].includes(n)?{grouped:!0}:{};return{type:getSeriesType(n),xKey:r.id,yKey:e.colId,yName:e.displayName,stacked:[`stackedArea`,`stackedColumn`].includes(n),...i}}})}getYKeys(e,t){let n=[],r=[];for(let i of e){let e=i.colId,o=t.find(t=>t.colId===e);o&&(o.secondaryAxis?r.push(e):n.push(e))}return{primaryYKeys:n,secondaryYKeys:r}}};function calculateOffsets(e){let t=e.currentOffset;e.currentOffset-=e.offsetAmount;let n=e.currentOffset;return e.currentOffset-=e.offsetAmount,{outerRadiusOffset:t,innerRadiusOffset:n}}var PieChartProxy=class extends ChartProxy{getUpdateOptions(e,t){return{...t,data:this.crossFiltering?this.getCrossFilterData(e):e.data,series:this.getSeries(e)}}getSeries(e){let[t]=e.categories,n=e.fields.length,r={currentOffset:0,offsetAmount:n>1?20:40},i=this.getFields(e).map(e=>{let i={type:this.standaloneChartType,angleKey:e.colId,angleName:e.displayName,sectorLabelKey:e.colId,calloutLabelName:t.name,calloutLabelKey:t.
57id};if(this.chartType===`donut`||this.chartType===`doughnut`){let{outerRadiusOffset:t,innerRadiusOffset:o}=calculateOffsets(r),s=e.displayName?{title:{text:e.displayName,showInLegend:n>1}}:void 0;return{...i,type:`donut`,outerRadiusOffset:t,innerRadiusOffset:o,...s}}return i});return this.crossFiltering?this.extractCrossFilterSeries(i):i}getCrossFilterData(e){let t=e.fields[0].colId,n=`${t}-filtered-out`;return e.data.map(e=>{let r=e[t]+e[n];return e[`${t}-total`]=r,e[n]=1,e[t]=e[t]/r,e})}extractCrossFilterSeries(e){let t=e[0],n=t.angleKey,r={...t,radiusMin:0,radiusMax:1,listeners:{seriesNodeClick:this.crossFilterCallback},legendItemKey:t.calloutLabelKey,angleKey:`${n}-total`},i={...r,radiusKey:n,sectorLabelKey:`${n}-total`};return[{...r,radiusKey:`${n}-filtered-out`,showInLegend:!1},i]}getFields(e){return this.chartType===`pie`?e.fields.slice(0,1):e.fields}},ChartToolbar=class extends K{constructor(){super(`<div class="ag-chart-menu" data-ref="eMenu"></div>`),this.eMenu=null,this.buttonListenersDestroyFuncs=[]}wireBeans(e){this.chartTranslation=e.chartTranslation}updateParams(e){let{buttons:t}=e;this.createButtons(t)}createButtons(e){for(let e of this.buttonListenersDestroyFuncs)e?.();this.buttonListenersDestroyFuncs=[];let t=this.eMenu;Ml(t);for(let n of e){let{buttonName:e,iconName:r,callback:i}=n,o=this.createButton(r),s=this.chartTranslation.translate(e+`ToolbarTooltip`);s&&o instanceof HTMLElement&&(o.title=s),this.buttonListenersDestroyFuncs.push(...this.addManagedElementListeners(o,{click:e=>i(e.currentTarget)})),t.appendChild(o)}}createButton(e){let t=J(e,this.beans);t.classList.add(`ag-chart-menu-icon`);let n=Dl({tag:`button`,attrs:{type:`button`},cls:`ag-chart-menu-toolbar-button`});return n.appendChild(t),n}destroy(){this.buttonListenersDestroyFuncs=[],super.destroy()}},Ty=`.ag-pill-select{display:flex;flex-direction:column}:where(.ag-pill-select){.ag-column-drop-list{padding:0}.ag-select{padding-top:var(--ag-spacing)}.ag-picker-field-wrapper{background-color:transparent;border:0}.ag-picker-field-display{cursor:pointer;font-weight:500}.ag-picker-field-display,.ag-picker-field-icon{color:var(--ag-chart-menu-label-color)}}`,AgPillSelect=class extends K{constructor(e){super(`<div class="ag-pill-select" role="presentation"></div>`),this.config=e??{};let{selectedValueList:t,valueFormatter:n,valueList:r}=this.config;this.selectedValues=t??[],this.valueList=r??[],this.valueFormatter=n??(e=>nu(e)),this.registerCSS(Ty)}postConstruct(){let{ariaLabel:e,onValuesChange:t,dragSourceId:n}=this.config;this.dropZonePanel=this.createManagedBean(new PillSelectDropZonePanel({getValues:()=>this.selectedValues,setValues:e=>this.updateValues(e),isDraggable:()=>this.selectedValues.length>1},e=>this.valueFormatter(e),e,n)),this.getGui().appendChild(this.dropZonePanel.getGui()),this.initSelect(),t!=null&&(this.onValuesChange=t)}setValues(e,t){let{added:n,removed:r,updated:i}=this.getChanges(this.valueList,e),o=!1;return(n.length||r.length||i.length)&&(o=!0),this.valueList=e,this.updateValues(t,o,!0),this}setValueFormatter(e){return this.valueFormatter=e,this}initSelect(){let e=this.createSelectOptions();if(!e.length)return!1;let{selectPlaceholder:t}=this.config;return this.eSelect=this.createBean(new Go({options:e,placeholder:t,onValueChange:e=>this.addValue(e),pickerIcon:`chartsMenuAdd`})),this.getGui().appendChild(this.eSelect.getGui()),!0}createSelectOptions(){let e=[],{maxSelection:t}=this.config;if(t&&this.selectedValues.length>=t)return e;for(let t of this.valueList)this.selectedValues.includes(t)||e.push({value:t,text:this.valueFormatter(t)});return e}addValue(e){this.dropZonePanel.addItem(e)}updateValues(e,t,n){let r=this.selectedValues;this.selectedValues=e;let i=this.getChanges(r,e),o=t||i.added.length||i.removed.length,s=Lo(this.beans),c=this.eSelect?.getGui().contains(s),p=this.dropZonePanel?.getGui().contains(s);n||this.onValuesChange?.(i);let m=o?!this.refreshSelect():!1;this.dropZonePanel.refreshGui(),o&&c&&(m?this.dropZonePanel.focusList(!0):this.eSelect?.getFocusableElement().focus()),p&&!e.length&&this.eSelect?.getFocusableElement().focus()}getChanges(e,t){return{added:t.filter(t=>!e.includes(t)),removed:e.filter(e=>
57!t.includes(e)),updated:t.filter((t,n)=>e[n]!==t),selected:t}}refreshSelect(){if(!this.eSelect)return this.initSelect();let e=this.createSelectOptions();return e.length?(this.eSelect.clearOptions().addOptions(e).setValue(void 0,!0),!0):(Ta(this.eSelect.getGui()),this.eSelect=this.destroyBean(this.eSelect),!1)}destroy(){this.destroyBean(this.eSelect),super.destroy()}},PillSelectDragComp=class extends PillDragComp{constructor(e,t,n,r,i,o){super(t,n,!1),this.value=e,this.valueFormatter=r,this.draggable=i,this.sourceId=o}getItem(){return this.value}getDisplayName(){return this.valueFormatter(this.value)}getAriaDisplayName(){return this.getDisplayName()}getTooltip(){}createGetDragItem(){return()=>({value:this.value})}getDragSourceType(){return kl.ChartPanel}getDragSourceId(){return this.sourceId}isMovable(){return this.isDraggable()}isDraggable(){return this.draggable}},PillSelectDropZonePanel=class extends PillDropZonePanel{constructor(e,t,n,r){super(!1),this.model=e,this.valueFormatter=t,this.ariaLabel=n,this.sourceId=r}postConstruct(){super.init()}isItemDroppable(e,t){return this.isSourceEventFromTarget(t)||this.sourceId!=null&&this.sourceId===t.dragSource.sourceId}updateItems(e){this.model.setValues(e)}getExistingItems(){return this.model.getValues()}getIconName(){return this.isPotentialDndItems()?`move`:`notAllowed`}getAriaLabel(){return this.ariaLabel}createPillComponent(e,t,n){return new PillSelectDragComp(e,t,n,this.valueFormatter,this.model.isDraggable(),this.sourceId)}getItems(e){return[e.value]}isInterestedIn(e){return e===kl.ChartPanel}},DragDataPanel=class extends K{constructor(e,t,n,r){super(r),this.chartController=e,this.allowMultipleSelection=t,this.maxSelection=n}wireBeans(e){this.chartTranslation=e.chartTranslation}addItem(e){this.groupComp.addItem(e)}createGroup(e,t,n,r,i){if(this.allowMultipleSelection){let i=e.filter(e=>e.selected);this.valuePillSelect=this.groupComp.createManagedBean(new AgPillSelect({valueList:e,selectedValueList:i,valueFormatter:t,selectPlaceholder:this.chartTranslation.translate(n),dragSourceId:r,onValuesChange:e=>this.onValueChange(e),maxSelection:this.maxSelection})),this.groupComp.addItem(this.valuePillSelect)}else{let t=this.createValueSelectParams(e);t.onValueChange=t=>{for(let t of e)t.selected=!1;t.selected=!0,t.colId===iy&&this.chartController.setAggFunc(void 0,!0),this.chartController.updateForPanelChange({updatedColState:t,skipAnimation:i?.()})},this.valueSelect=this.groupComp.createManagedBean(new Go(t)),this.groupComp.addItem(this.valueSelect)}}refreshValueSelect(e){if(!this.valueSelect)return;let{options:t,value:n}=this.createValueSelectParams(e);this.valueSelect.clearOptions().addOptions(t).setValue(n,!0)}createValueSelectParams(e){let t;return{options:e.map(e=>{let n=e.displayName??``;return e.selected&&(t=e),{value:e,text:n}}),value:t}}onValueChange({added:e,updated:t,removed:n,selected:r}){let i,o,updateOrder=()=>{r.forEach((e,t)=>{e.order=t}),o=!0};e.length?(i=e[0],i.selected=!0,updateOrder()):n.length?(i=n[0],i.selected=!1):t.length&&(updateOrder(),i=t[0]),i&&this.chartController.updateForPanelChange({updatedColState:i,resetOrder:o})}destroy(){this.valuePillSelect=void 0,this.valueSelect=void 0,super.destroy()}},Ey=`sum`,CategoriesDataPanel=class extends DragDataPanel{constructor(e,t,n,r,i){super(e,n,void 0,`<div id="categoriesGroup"></div>`),this.title=t,this.dimensionCols=r,this.isOpen=i}postConstruct(){this.groupComp=this.createBean(new AgGroupComponent({title:this.title,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:`charts-data`,expanded:this.isOpen})),this.createGroup(this.dimensionCols,e=>e.displayName??``,`categoryAdd`,`categorySelect`,()=>!this.chartController.getAggFunc()),this.createAggFuncControls(this.dimensionCols),this.getGui().appendChild(this.groupComp.getGui())}refresh(e){this.valuePillSelect?.setValues(e,e.filter(e=>e.selected)),this.refreshValueSelect(e),this.refreshAggFuncControls(e,this.chartController.getAggFunc())}createAggFuncControls(e){let t=this.chartController.getAggFunc();this.groupComp.addItem(this.aggFuncToggle=this.createBean(new ya({label:this.chartTranslation.translate(`aggregate`),labelAlignment:`left`,labelWidth:`flex`,inputWidth:`flex`,value:t!=null,onValueChange:e=>{let t=e?Ey:void 0;this.chartController.setAggFunc(t),this.aggFuncSelect?.setValue(t,!0),this.aggFuncSelect?.setDisplayed(t!=null)}}))),this.groupComp.addItem(this.aggFuncSelect=this.createBean(new Go({options:[{value:`sum`,text:this.chartTranslation.translate(`sum`)},{value:`first`,text:this.chartTranslation.translate(`first`)},{value:`last`,text:this.chartTranslation.translate(`last`)},{value:`min`,text:this.chartTranslation.translate(`min`)},{value:`max`,text:this.chartTranslation.translate(`max`)},{value:`count`,text:this.chartTranslation.translate(`count`)},{value:`avg`,text:this.chartTranslation.translate(`avg`)}],value:typeof t==`string`?t:void 0,onValueChange:e=>{this.chartController.setAggFunc(e)}}
57))),this.refreshAggFuncControls(e,t)}refreshAggFuncControls(e,t){let n=e.filter(e=>e.selected).some(e=>e.colId!==iy);this.aggFuncToggle?.setValue(t!=null),this.aggFuncSelect?.setValue(typeof t==`string`?t:void 0,!0),this.aggFuncToggle?.setDisplayed(n),this.aggFuncSelect?.setDisplayed(n&&t!=null)}clearAggFuncControls(){this.aggFuncToggle=this.destroyBean(this.aggFuncToggle),this.aggFuncSelect=this.destroyBean(this.aggFuncSelect)}destroy(){this.clearAggFuncControls(),this.groupComp=this.destroyBean(this.groupComp),super.destroy()}},ChartMenuParamsFactory=class extends U{constructor(e){super(),this.chartOptionsProxy=e}wireBeans(e){this.chartTranslation=e.chartTranslation}getDefaultColorPickerParams(e,t,n){return this.addValueParams(e,{label:this.chartTranslation.translate(t??`color`),labelWidth:`flex`,inputWidth:`flex`,labelAlignment:`top`,pickerGap:6},n)}getDefaultNumberInputParams(e,t,n){return this.addValueParams(e,{label:this.chartTranslation.translate(t),labelAlignment:`top`,labelWidth:`flex`,inputWidth:`flex`,precision:n?.precision,step:n?.step,min:n?.min,max:n?.max},{parseInputValue:e=>{let t=Number(e);return isNaN(t)?void 0:t},formatInputValue:e=>e==null?``:`${e}`})}getDefaultSliderParams(e,t,n,r){let i=this.chartOptionsProxy.getValue(e)??0;r&&Array.isArray(i)&&(i=i[0]);let o=this.getDefaultSliderParamsWithoutValueParams(i,t,n);return o.onValueChange=t=>this.chartOptionsProxy.setValue(e,r?[t]:t),o}getDefaultSliderParamsWithoutValueParams(e,t,n){return{label:this.chartTranslation.translate(t),minValue:0,maxValue:Math.max(e,n),textFieldWidth:45,value:`${e}`}}getDefaultCheckboxParams(e,t,n){let r=this.chartOptionsProxy.getValue(e),i={label:this.chartTranslation.translate(t),value:r,readOnly:n?.readOnly,passive:n?.passive};return i.onValueChange=t=>{this.chartOptionsProxy.setValue(e,typeof t==`boolean`?t:void 0)},i}getDefaultToggleParams(e,t,n){let r=this.chartOptionsProxy.getValue(e),i={label:this.chartTranslation.translate(t),labelAlignment:`left`,labelWidth:`flex`,inputWidth:`flex`,value:r,readOnly:n?.readOnly,passive:n?.passive};return i.onValueChange=t=>{this.chartOptionsProxy.setValue(e,typeof t==`boolean`?t:void 0)},i}getDefaultSelectParams(e,t,n){return this.getDefaultSelectParamsWithoutValueParams(t,n,this.chartOptionsProxy.getValue(e),t=>{this.chartOptionsProxy.setValue(e,t)})}getDefaultSelectParamsWithoutValueParams(e,t,n,r){return{label:this.chartTranslation.translate(e),labelAlignment:`top`,options:t,pickerGap:6,value:n,onValueChange:r}}getDefaultFontPanelParams(e,t){let keyMapper=t=>`${e}.${t}`;return this.addEnableParams(keyMapper(`enabled`),{name:this.chartTranslation.translate(t),suppressEnabledCheckbox:!1,chartMenuParamsFactory:this,keyMapper})}addValueParams(e,t,n){let r=this.chartOptionsProxy.getValue(e);return t.value=n?.formatInputValue?n.formatInputValue(r):r,t.onValueChange=t=>{let r=n?.parseInputValue?n.parseInputValue(t):t;this.chartOptionsProxy.setValue(e,r)},t}addEnableParams(e,t){return t.enabled=this.chartOptionsProxy.getValue(e)??!1,t.onEnableChange=t=>this.chartOptionsProxy.setValue(e,t),t}getChartOptions(){return this.chartOptionsProxy}},ChartSpecificDataPanel=class extends K{constructor(e,t){super(),this.chartMenuContext=e,this.isOpen=t,this.chartSpecificGroup=null,this.hasContent=!1}wireBeans(e){this.chartTranslation=e.chartTranslation,this.chartSvc=e.chartSvc}postConstruct(){let e={title:this.getTitle(),enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:`charts-data`,expanded:this.isOpen,items:[...this.createDirectionSelect(),this.createReverseSelect(),this.createGroupTypeSelect()]};this.setTemplate(`
58            <div id="chartSpecificGroup">
59                <ag-group-component data-ref="chartSpecificGroup"></ag-group-component>
60            </div>`,[u_],{chartSpecificGroup:e}),this.setDisplayed(this.hasContent)}refresh(){this.hasContent=!1,this.chartSpecificGroup.setTitle(this.getTitle()),this.updateDirectionSelect(),this.updateReverseSelect(),this.updateGroupTypeSelect(),this.setDisplayed(this.hasContent)}getTitle(){let e=this.chartMenuContext.chartController.getChartType();return this.chartTranslation.translate(getFullChartNameTranslationKey(e))}createDirectionSelect(){if(!this.chartSvc.isEnterprise())return[];let{chartOptionsService:e,chartController:t}=this.chartMenuContext,n=e.getSeriesOptionsProxy(()=>getSeriesType(t.getChartType())),r=this.createManagedBean(new ChartMenuParamsFactory(n)),i=[`horizontal`,`vertical`].map(e=>({value:e,text:this.chartTranslation.translate(e)}
60)),o=r.getDefaultSelectParams(`direction`,`direction`,i),s=o.onValueChange;return o.onValueChange=e=>{s(e),t.raiseChartModelUpdateEvent()},this.directionSelect=this.createManagedBean(new Go(o)),this.updateDirectionSelect(),[this.directionSelect]}createReverseSelect(){let{chartMenuParamsFactory:e}=this.chartMenuContext,t=e.getDefaultToggleParams(`series.reverse`,`reverse`);return this.reverseToggle=this.createManagedBean(new ya(t)),this.updateReverseSelect(),this.reverseToggle}updateReverseSelect(){let e=this.chartMenuContext.chartController.getChartType()===`pyramid`;this.updateDisplayed(this.reverseToggle,e)}updateDirectionSelect(){let e=canSwitchDirection(this.chartMenuContext.chartController.getChartType());this.updateDisplayed(this.directionSelect,e)}createGroupTypeSelect(){let{chartController:e,chartMenuParamsFactory:t}=this.chartMenuContext;return this.groupTypeSelect=this.createManagedBean(new Go(t.getDefaultSelectParamsWithoutValueParams(`seriesGroupType`,Jv.map(e=>({value:e,text:this.chartTranslation.translate(`${e}SeriesGroupType`)})),e.getSeriesGroupType(),t=>e.setSeriesGroupType(t)))),this.updateGroupTypeSelect(),this.groupTypeSelect}updateGroupTypeSelect(){let e=[`radialColumn`,`radialBar`,`nightingale`].includes(this.chartMenuContext.chartController.getChartType());this.updateDisplayed(this.groupTypeSelect,e)}updateDisplayed(e,t){e?.setDisplayed(t),e&&(this.hasContent=this.hasContent||t)}},SeriesChartTypePanel=class extends K{constructor(e,t,n){super(`<div id="seriesChartTypeGroup"></div>`),this.chartController=e,this.columns=t,this.isOpen=n,this.selectedColIds=[],this.chartTypeComps=new Map,this.secondaryAxisComps=new Map}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){this.createSeriesChartTypeGroup(this.columns)}refresh(e){pa(this.getValidColIds(e),this.selectedColIds)?this.refreshComps():this.recreate(e)}recreate(e){this.isOpen=this.seriesChartTypeGroupComp.isExpanded(),Ml(this.getGui()),this.destroyBean(this.seriesChartTypeGroupComp),this.columns=e,this.selectedColIds=[],this.clearComps(),this.postConstruct()}getValidColIds(e){let 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 AgGroupComponent({title:this.chartTranslation.translate(`seriesChartType`),enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:`charts-data`,expanded:this.isOpen}));let t=this.chartController.getSeriesChartTypes();for(let n of e){if(!n.selected)continue;let e=t.filter(e=>e.colId===n.colId)[0];if(!e)continue;this.selectedColIds.push(n.colId);let r=this.seriesChartTypeGroupComp.createManagedBean(new AgGroupComponent({title:n.displayName,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!0,cssIdentifier:`charts-format-sub-level`})),isSecondaryAxisDisabled=e=>[`groupedColumn`,`stackedColumn`,`stackedArea`].includes(e),i=this.seriesChartTypeGroupComp.createManagedBean(new ts({label:this.chartTranslation.translate(`secondaryAxis`),labelWidth:`flex`,disabled:isSecondaryAxisDisabled(e.chartType),value:!!e.secondaryAxis,onValueChange:e=>this.chartController.updateSeriesChartType(n.colId,void 0,e)}));r.addItem(i);let o=[`line`,`area`,`stackedArea`,`groupedColumn`,`stackedColumn`].map(e=>({value:e,text:this.chartTranslation.translate(getFullChartNameTranslationKey(e))})),s=r.createManagedBean(new Go({options:o,value:e.chartType,onValueChange:e=>this.chartController.updateSeriesChartType(n.colId,e)}));r.addItem(s),this.seriesChartTypeGroupComp.addItem(r),this.chartTypeComps.set(n.colId,s),this.secondaryAxisComps.set(n.colId,i)}this.getGui().appendChild(this.seriesChartTypeGroupComp.getGui())}refreshComps(){let e=this.chartController.getSeriesChartTypes();for(let t of this.selectedColIds){let n=e.find(e=>e.colId===t);if(!n)continue;let r=this.chartTypeComps.get(t),i=this.secondaryAxisComps.get(t);r?.setValue(n.chartType),i?.setValue(!!n.secondaryAxis),i?.setDisabled(this.isSecondaryAxisDisabled(n.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()}},SeriesDataPanel=class extends DragDataPanel{constructor(e,t,n,r,i,o,s){super(e,r,i,`<div id="seriesGroup"></div>`),this.chartOptionsService=t,this.title=n,this.valueCols=o,this.isOpen=s}postConstruct(){if(this.groupComp=this.createBean(new AgGroupComponent({title:this.title,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:`charts-data`,expanded:this.isOpen})),this.chartController.isActiveXYChart()){let e=this.groupComp.createManagedBean(new ya({label:this.chartTranslation.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.createGroup(this.valueCols,this.generateGetSeriesLabel(this.valueCols),`seriesAdd`,`seriesSelect`),this.getGui().appendChild(this.groupComp.getGui())}refresh(e){this.valuePillSelect?.setValueFormatter(this.generateGetSeriesLabel(e)),this.valuePillSelect?.setValues(e,e.filter(e=>e.selected)),this.refreshValueSelect(e)}generateGetSeriesLabel(e){if(!this.chartController.isActiveXYChart())return e=>e.displayName??``;let t=e.filter(e=>e.selected),n=this.chartController.getChartType()===`bubble`,r=this.chartOptionsService.getPairedMode(),i=new Map;return i.set(0,`X`),i.set(1,`Y`),i.set(2,`size`),e=>{let o=e.displayName??``;if(!e.selected)return o;let s=t.indexOf(e);if(s===-1)return o;let c;return c=r?i.get(s%(n?3:2)):s===0?`X`:n&&s%2==0?`size`:`Y`,`${o} (${c})`}}destroy(){this.groupComp=this.destroyBean(this.groupComp),super.destroy()}},Dy={groups:[{type:`categories`,isOpen:!0},{type:`series`,isOpen:!0},{type:`seriesChartType`,isOpen:!0},{type:`chartSpecific`,isOpen:!0}]},ChartDataPanel=class extends K{constructor(e){super(`<div class="ag-chart-data-wrapper ag-scrollable-container"></div>`),this.chartMenuContext=e,this.isSwitchCategorySeriesToggled=!1,this.restoreSwitchCategorySeriesToggleFocus=!1,this.panels=[],this.chartController=e.chartController}wireBeans(e){this.chartTranslation=e.chartTranslation,this.chartSvc=e.chartSvc}postConstruct(){this.createSwitchCategorySeriesToggle(),this.isSwitchCategorySeriesToggled=this.chartController.isCategorySeriesSwitched(),this.updatePanels();let e=this.updatePanels.bind(this);this.addManagedListeners(this.chartController,{chartModelUpdate:e,chartApiUpdate:e})}destroy(){this.clearPanelComponents(),super.destroy()}updatePanels(){let e=this.chartType,t=this.isSwitchCategorySeriesToggled,{dimensionCols:n,valueCols:r}=this.chartController.getColStateForMenu();this.chartType=this.chartController.getChartType(),this.isSwitchCategorySeriesToggled=this.chartController.isCategorySeriesSwitched();let i=this.isSwitchCategorySeriesToggled!==t;this.canRefresh(e,this.chartType)&&!i?(this.categoriesDataPanel?.refresh(n),this.seriesDataPanel?.refresh(r),this.seriesChartTypePanel?.refresh(r),this.chartSpecificPanel?.refresh()):this.recreatePanels(n,r);let o=supportsInvertedCategorySeries(this.chartType)&&this.chartSvc.isEnterprise()&&!this.chartController.isGrouping();W(this.switchCategorySeriesToggle.getGui(),o),i&&this.switchCategorySeriesToggle?.setValue(this.chartController.isCategorySeriesSwitched()),this.restoreSwitchCategorySeriesToggleFocus&&(this.restoreSwitchCategorySeriesToggleFocus=!1,o&&this.switchCategorySeriesToggle.getFocusableElement().focus())}canRefresh(e,t){if(e===void 0)return!1;if(e===t)return!0;let isCombo=e=>[`columnLineCombo`,`areaColumnCombo`,`customCombo`].includes(e);return!!(isCombo(e)&&isCombo(t))}recreatePanels(e,t){this.clearPanelComponents();let{chartType:n}=this;if(!n)return;let r=this.chartController.isCategorySeriesSwitched();this.getDataPanelDef().groups?.forEach(({type:i,isOpen:o})=>{i===(r?`series`:`categories`)?(this.categoriesDataPanel=this.createBean(new CategoriesDataPanel(this.chartController,this.getCategoryGroupTitle(r),this.getCategoryGroupMultipleSelect(n,r),e,o)),this.panels.push(this.categoriesDataPanel)):i===(r?`categories`:`series`)?(this.seriesDataPanel=this.createBean(new SeriesDataPanel(this.chartController,this.chartMenuContext.chartOptionsService,this.get
60SeriesGroupTitle(r),this.getSeriesGroupMultipleSelect(n,r),this.getSeriesGroupMaxSelection(n,r),t,o)),this.panels.push(this.seriesDataPanel)):i===`seriesChartType`?this.chartController.isComboChart()&&(this.seriesChartTypePanel=this.createBean(new SeriesChartTypePanel(this.chartController,t,o)),this.panels.push(this.seriesChartTypePanel)):i===`chartSpecific`?(this.chartSpecificPanel=this.createBean(new ChartSpecificDataPanel(this.chartMenuContext,o)),this.panels.push(this.chartSpecificPanel)):q(144,{type:i})}),(r?this.categoriesDataPanel:this.seriesDataPanel)?.addItem(this.switchCategorySeriesToggle.getGui()),this.addPanelComponents()}addPanelComponents(){if(!this.panels.length)return;let e=_l(this.beans).createDocumentFragment();for(let t of this.panels)t.addCss(`ag-chart-data-section`),e.appendChild(t.getGui());this.getGui().appendChild(e)}clearPanelComponents(){for(let e of this.panels)e.getGui().remove(),this.destroyBean(e);this.panels=[]}getDataPanelDef(){return this.gos.get(`chartToolPanelsDef`)?.dataPanel??Dy}getCategoryGroupTitle(e){return e?this.chartTranslation.translate(`seriesLabels`):this.chartTranslation.translate(this.chartController.isActiveXYChart()?`labels`:`categories`)}getCategoryGroupMultipleSelect(e,t){return!t&&getMaxNumCategories(e)!==1}getSeriesGroupTitle(e){return e?this.chartTranslation.translate(`categoryValues`):this.chartTranslation.translate(this.chartController.isActiveXYChart()?`xyValues`:`series`)}getSeriesGroupMultipleSelect(e,t){return this.getSeriesGroupMaxSelection(e,t)!==1}getSeriesGroupMaxSelection(e,t){if(!t)return getMaxNumSeries(e)}createSwitchCategorySeriesToggle(){this.switchCategorySeriesToggle=this.createManagedBean(new ya({label:this.chartTranslation.translate(`switchCategorySeries`),labelAlignment:`left`,labelWidth:`flex`,inputWidth:`flex`,value:this.chartController.isCategorySeriesSwitched(),onValueChange:e=>{this.restoreSwitchCategorySeriesToggleFocus=!0,this.chartController.switchCategorySeries(e)}}))}},AgAngleSelect=class extends Gl{constructor(e){super(e,`<div class="ag-angle-select">
61            <div data-ref="eLabel"></div>
62            <div class="ag-wrapper ag-angle-select-wrapper">
63                <div class="ag-angle-select-field">
64                    <div data-ref="eParentCircle" class="ag-angle-select-parent-circle">
65                        <div data-ref="eChildCircle" class="ag-angle-select-child-circle"></div>
66                    </div>
67                </div>
68                <ag-input-number-field data-ref="eAngleValue"></ag-input-number-field>
69            </div>
70        </div>`,[Fc]),this.eLabel=null,this.eParentCircle=null,this.eChildCircle=null,this.eAngleValue=null,this.radius=0,this.offsetX=0,this.offsetY=0}wireBeans(e){this.dragSvc=e.dragSvc}postConstruct(){super.postConstruct();let{value:e,onValueChange:t}=this.config;e!=null&&this.setValue(e,void 0,!0),t!=null&&this.onValueChange(t),this.dragListener={eElement:this.eParentCircle,dragStartPixels:0,onDragStart:()=>{this.parentCircleRect=this.eParentCircle.getBoundingClientRect()},onDragging:e=>this.calculateAngleDrag(e),onDragStop:()=>{}},this.dragSvc?.addDragSource(this.dragListener),this.eAngleValue.setLabel(``).setLabelWidth(5).setInputWidth(45).setMin(0).setMax(360).setValue(`${this.degrees}`).onValueChange(e=>{(e==null||e===``)&&(e=`0`),e=this.eAngleValue.normalizeValue(e);let t=parseFloat(e);t>180&&(t-=360),this.setValue(t)}),this.updateNumberInput(),Xs(this.getValue())&&this.eAngleValue.setValue(this.normalizeNegativeValue(this.getValue()).toString()),this.addManagedListeners(this,{fieldValueChanged:()=>{this.eAngleValue.getInputElement().contains(Lo(this.beans))||this.updateNumberInput()}})}updateNumberInput(){let e=this.normalizeNegativeValue(this.getValue());this.eAngleValue.setValue(e.toString())}positionChildCircle(e){let t=this.parentCircleRect||{width:24,height:24},n=this.eChildCircle,r=t.width/2,i=t.height/2;n.style.left=`${r+Math.cos(e)*8}px`,n.style.top=`${i+Math.sin(e)*8}px`}calculatePolar(){let e=this.offsetX,t=this.offsetY,n=Math.atan2(t,e);this.degrees=this.toDegrees(n),this.radius=Math.sqrt(e*e+t*t),this.positionChildCircle(n)}calculateCartesian(){let 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){let t=this.parentCircleRect,n=t.width/2,r=t.height/2,i=e.clientX-t.left,o=e.clientY-t.top,s=i-n,c=o-r,p=Math.atan2(c,s);this.setValue(p,!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%=Math.PI*2,e<-Math.PI?e+=Math.PI*2:e>=Math.PI&&(e-=Math.PI*2),e}getRadius(){return this.radius}setRadius(e){return this.radius===e?this:(this.radius=e,this.calculateCartesian(),this)}onValueChange(e){return this.addManagedListeners(this,{fieldValueChanged:()=>{e(this.degrees)}}),this}getValue(e){return e?this.toRadians(this.degrees):this.degrees}setValue(e,t,n){let r;return r=t?e:this.normalizeAngle180(this.toRadians(e)),e=this.toDegrees(r),this.degrees!==e&&(this.degrees=Math.floor(e),this.calculateCartesian(),this.positionChildCircle(r),n||this.dispatchLocalEvent({type:`fieldValueChanged`})),this}setWidth(e){return Cs(this.getGui(),e),this}setDisabled(e){return super.setDisabled(e),this.eAngleValue.setDisabled(e),this}destroy(){this.dragSvc?.removeDragSource(this.dragListener),super.destroy()}};function _capitalise(e){return e[0].toUpperCase()+e.substring(1).toLowerCase()}var FontPanel=class extends K{constructor(e){super(),this.params=e,this.fontGroup=null,this.activeComps=[],this.chartOptions=e.chartMenuParamsFactory.getChartOptions()}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){let{cssIdentifier:e=`charts-format-sub-level`,name:t,enabled:n,onEnableChange:r,suppressEnabledCheckbox:i,chartMenuParamsFactory:o,keyMapper:s}=this.params,c={cssIdentifier:e,direction:`vertical`,suppressOpenCloseIcons:!0,title:t,enabled:n,suppressEnabledCheckbox:!0,onEnableChange:e=>{r&&r(e)},useToggle:!i};this.setTemplate(`<div class="ag-font-panel">
71        <ag-group-component data-ref="fontGroup">
72            <ag-select data-ref="familySelect"></ag-select>
73            <ag-select data-ref="weightStyleSelect"></ag-select>
74            <div class="ag-charts-font-size-color">
75                <ag-select data-ref="sizeSelect"></ag-select>
76                <ag-color-picker data-ref="colorPicker"></ag-color-picker>
77            </div>
78        </ag-group-component>
79    </div>`,[u_,au,ly],{fontGroup:c,familySelect:this.getFamilySelectParams(),weightStyleSelect:this.getWeightStyleSelectParams(),sizeSelect:this.getSizeSelectParams(),colorPicker:o.getDefaultColorPickerParams(s(`color`))}),this.toggleCss(`ag-font-panel-no-header`,!t)}addItem(e,t){t?this.fontGroup.prependItem(e):this.fontGroup.addItem(e),this.activeComps.push(e)}setEnabled(e){this.fontGroup.setEnabled(e)}getFamilySelectParams(){let e=[`Arial, sans-serif`,`Aria Black, sans-serif`,`Book Antiqua,  serif`,`Charcoal, sans-serif`,`C
79omic 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`),n=e[0];if(t){let r=e.map(e=>e.toLowerCase()).indexOf(t.toLowerCase());if(r>=0)n=e[r];else{let r=_capitalise(t);e.push(r),n=r}}let r=e.sort().map(e=>({value:e,text:e}));return this.params.chartMenuParamsFactory.getDefaultSelectParamsWithoutValueParams(`font`,r,`${n}`,e=>this.setFont({fontFamily:e}))}getSizeSelectParams(){let e=[8,10,12,14,16,18,20,22,24,26,28,30,32,34,36],t=this.getInitialFontValue(`fontSize`);e.includes(t)||e.push(t);let n=e.sort((e,t)=>e-t).map(e=>({value:`${e}`,text:`${e}`}));return this.params.chartMenuParamsFactory.getDefaultSelectParamsWithoutValueParams(`size`,n,`${t}`,e=>this.setFont({fontSize:parseInt(e,10)}))}getWeightStyleSelectParams(){let e=this.getInitialFontValue(`fontWeight`)??`normal`,t=this.getInitialFontValue(`fontStyle`)??`normal`,n=[{name:`normal`,weight:`normal`,style:`normal`},{name:`bold`,weight:`bold`,style:`normal`},{name:`italic`,weight:`normal`,style:`italic`},{name:`boldItalic`,weight:`bold`,style:`italic`}],r=n.find(n=>n.weight===e&&n.style===t);r||(r={name:`predefined`,weight:e,style:t},n.unshift(r));let i=n.map(e=>({value:e.name,text:this.chartTranslation.translate(e.name)}));return this.params.chartMenuParamsFactory.getDefaultSelectParamsWithoutValueParams(`weight`,i,r.name,e=>{let t=n.find(t=>t.name===e);this.setFont({fontWeight:t.weight,fontStyle:t.style})})}destroyActiveComps(){for(let e of this.activeComps)Ta(e.getGui()),this.destroyBean(e)}destroy(){this.destroyActiveComps(),super.destroy()}setFont(e){let{keyMapper:t}=this.params;for(let n of Object.keys(e)){let r=e[n];r&&this.chartOptions.setValue(t(n),r)}}getInitialFontValue(e){let{keyMapper:t}=this.params;return this.chartOptions.getValue(t(e))}},AxisTicksPanel=class extends K{constructor(e){super(),this.chartMenuUtils=e,this.axisTicksSizeSlider=null}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){let{chartMenuUtils:e}=this,t=e.addEnableParams(`tick.enabled`,{cssIdentifier:`charts-format-sub-level`,direction:`vertical`,suppressOpenCloseIcons:!0,title:this.chartTranslation.translate(`ticks`),suppressEnabledCheckbox:!0,useToggle:!0}),n=e.getDefaultColorPickerParams(`tick.stroke`),r=e.getDefaultSliderParams(`tick.width`,`width`,10),i=e.getDefaultSliderParams(`tick.size`,`length`,30);this.setTemplate(`<div>
80            <ag-group-component data-ref="axisTicksGroup">
81                <ag-color-picker data-ref="axisTicksColorPicker"></ag-color-picker>
82                <ag-slider data-ref="axisTicksWidthSlider"></ag-slider>
83                <ag-slider data-ref="axisTicksSizeSlider"></ag-slider>
84            </ag-group-component>
85        </div>`,[u_,ly,dy],{axisTicksGroup:t,axisTicksColorPicker:n,axisTicksWidthSlider:r,axisTicksSizeSlider:i})}setTickSizeSliderDisplayed(e){this.axisTicksSizeSlider.setDisplayed(e)}},GridLinePanel=class extends K{constructor(e){super(),this.chartMenuUtils=e,this.chartOptions=e.getChartOptions()}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){let e=this.chartMenuUtils.addEnableParams(`gridLine.enabled`,{cssIdentifier:`charts-format-sub-level`,direction:`vertical`,suppressOpenCloseIcons:!0,title:this.chartTranslation.translate(`gridLines`),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.getGridLineColorPickerParams(`color`),n=this.getGridLineWidthSliderParams(`thickness`),r=this.getGridLineDashSliderParams(`lineDash`);this.setTemplate(`<div>
86            <ag-group-component data-ref="gridLineGroup">
87                <ag-color-picker data-ref="gridLineColorPicker"></ag-color-picker>
88                <ag-slider data-ref="gridLineWidthSlider"></ag-slider>
89                <ag-slider data-ref="gridLineLineDashSlider"></ag-slider>
90            </ag-group-component>
91        </div>`,[u_,ly,dy],{gridLineGroup:e,gridLineColorPicker:t,gridLineWidthSlider:n,gridLineLineDashSlider:r})}getGridLineColorPickerParams(e){return this.chartMenuUtils.getDefaultColorPickerParams(`gridLine.style`,e,{formatInputValue:e=>e?.[0]?.stroke,parseInputValue:e=>{let t=this.chartOptions.getValue(`gridLine.style`)??[];return t.length===0?[{stroke:e,lineDash:[]}]:[{...t[0],stroke:e}]}})}getGridLineWidthSliderParams(e){return this.chartMenuUtils.getDefaultSliderParams(`gridLine.width`,e,10)}getGridLineDashSliderParams(e){let t=this.chartOptions.getValue(`gridLine.style`)?.[0]?.lineDash?.[0],n=this.chartMenuUtils.getDefaultSliderParamsWithoutValueParams(t??0,e,30);return n.onValueChange=e=>{let t=this.chartOptions.getValue(`gridLine.style.0.stroke`);this.chartOptions.setValue(`gridLine.style`,[{lineDash:[e],stroke:t}])},n}},Oy=`%d %B %Y`,CartesianAxisPanel=class extends K{constructor(e,t){super(),this.axisType=e,this.options=t,this.axisGroup=null,this.axisTypeSelect=null,this.axisPositionSelect=null,this.axisTimeFormatSelect=null,this.activePanels=[],this.updateFuncs=[];let{chartOptionsService:n,seriesType:r,chartController:i}=t;this.chartOptionsService=n,this.chartController=i,this.chartOptionsSeriesProxy=n.get
91SeriesOptionsProxy(()=>r)}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){let{isExpandedOnInit:e,chartOptionsService:t,registerGroupComponent:n}=this.options,r=this.axisType,i={cssIdentifier:`charts-format-top-level`,direction:`vertical`,title:this.translate(r),expanded:e,suppressEnabledCheckbox:!0},o=t.getCartesianAxisOptionsProxy(this.axisType),s=this.createManagedBean(new ChartMenuParamsFactory(o)),c=this.createManagedBean(new ChartMenuParamsFactory(t.getCartesianAxisThemeOverridesProxy(this.axisType))),p=this.getAxisTypeSelectParams(s,t.getCartesianAxisAppliedThemeOverridesProxy(this.axisType)),m=this.getAxisPositionSelectParams(s),h=this.getAxisTimeFormatSelectParams(s),g=this.getAxisColorInputParams(c),_=this.getAxisLineWidthSliderParams(c);this.setTemplate(`<div>
92            <ag-group-component data-ref="axisGroup">
93                <ag-select data-ref="axisTypeSelect"></ag-select>
94                <ag-select data-ref="axisTimeFormatSelect"></ag-select>
95                <ag-select data-ref="axisPositionSelect"></ag-select>
96                <ag-color-picker data-ref="axisColorInput"></ag-color-picker>
97                <ag-slider data-ref="axisLineWidthSlider"></ag-slider>
98            </ag-group-component>
99        </div>`,[u_,au,ly,dy],{axisGroup:i,axisTypeSelect:p??void 0,axisPositionSelect:m??void 0,axisTimeFormatSelect:h??void 0,axisColorInput:g,axisLineWidthSlider:_}),n(this.axisGroup),this.axisTypeSelect.setDisplayed(!!p.options?.length),m||this.removeTemplateComponent(this.axisPositionSelect);let updateTimeFormatVisibility=()=>{let e=o.getValue(`type`)===`time`;W(this.axisTimeFormatSelect.getGui(),e)};h?(updateTimeFormatVisibility(),this.addManagedEventListeners({chartOptionsChanged:()=>{updateTimeFormatVisibility()}})):this.removeTemplateComponent(this.axisTimeFormatSelect),this.initGridLines(c),this.initAxisTicks(c),this.initAxisLabels(c);let updateFns=()=>{for(let e of this.updateFuncs)e()};this.addManagedListeners(this.chartController,{chartUpdated:updateFns,chartModelUpdate:()=>setTimeout(()=>{this.isAlive()&&(this.refreshAxisTypeSelect(s),updateTimeFormatVisibility())})})}getAxisTypeSelectParams(e,t){let n=e.getChartOptions(),r=this.getAxisTypeSelectOptions(),i=e.getDefaultSelectParams(`type`,`axisType`,r);return i.onValueChange=e=>{let r=n.getValue(`type`);if(e===r)return;let i=t.getValue(`*`),o=r===`time`,s=e===`time`,c=o===s?null:s?Oy:void 0;if(this.chartOptionsService.setCartesianCategoryAxisType(this.axisType,e),c!==null){let e=n.getValue(`label`)??{};n.setValue(`label`,{...e,format:c})}t.setValue(`*`,i)},i}refreshAxisTypeSelect(e){let t=this.getAxisTypeSelectOptions(),n=!!t.length;this.axisTypeSelect.setDisplayed(n),n&&this.axisTypeSelect.clearOptions().addOptions(t).setValue(e.getChartOptions().getValue(`type`))}getAxisTypeSelectOptions(){let e=this.chartController,t=e.getChartType(),supportsNumericalAxis=()=>{let t=e.getChartData()[0];return t?e.getSelectedDimensions().every(e=>!isNaN(parseFloat(t[e.colId]))):!1};return[`heatmap`,`histogram`,`boxPlot`,`rangeBar`,`scatter`,`bubble`].includes(t)||e.isGrouping()||!this.isCategoryAxis()||e.isCategorySeriesSwitched()||!supportsNumericalAxis()?[]:[`category`,`number`,`time`].map(e=>({value:e,text:this.translate(e)}))}isCategoryAxis(){let e=this.chartOptionsSeriesProxy.getValue(`direction`)===`horizontal`;return e&&this.axisType===`yAxis`||!e&&this.axisType===`xAxis`}getAxisPositionSelectParams(e){let t=((e,t)=>{if(e===`heatmap`)return null;if(t===`xAxis`)return[{value:`top`,text:this.translate(`top`)},{value:`bottom`,text:this.translate(`bottom`)}];if(t===`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;let 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.stroke`)}
99getAxisLineWidthSliderParams(e){let t=e.getChartOptions(),getAxisLineWidth=()=>t.getValue(`line.enabled`)?t.getValue(`line.width`):null,setAxisLineWidth=e=>{t.setValues([{expression:`line.enabled`,value:e!=null},{expression:`line.width`,value:e??0}])},n=e.getDefaultSliderParamsWithoutValueParams(getAxisLineWidth()??0,`thickness`,10);return n.onValueChange=e=>{setAxisLineWidth(e===0?null:e)},n}initGridLines(e){if(this.chartController.getChartType()===`heatmap`)return;let t=this.createBean(new GridLinePanel(e));this.axisGroup.addItem(t),this.activePanels.push(t)}initAxisTicks(e){if(!this.hasConfigurableAxisTicks())return;let t=this.createBean(new AxisTicksPanel(e));this.axisGroup.addItem(t),this.activePanels.push(t);let updateTickFn=()=>t.setTickSizeSliderDisplayed(this.isGroupedCategoryAxis());this.updateFuncs.push(updateTickFn),updateTickFn()}hasConfigurableAxisTicks(){switch(this.chartController.getChartType()){case`radarLine`:case`radarArea`:case`rangeBar`:case`boxPlot`:case`waterfall`:return!1;default:return!0}}initAxisLabels(e){let t={name:this.translate(`labels`),enabled:!0,suppressEnabledCheckbox:!0,chartMenuParamsFactory:e,keyMapper:e=>`label.${e}`},n=this.createBean(new FontPanel(t));this.axisGroup.addItem(n),this.activePanels.push(n),this.addAdditionalLabelComps(n,e)}addAdditionalLabelComps(e,t){this.addLabelPadding(e,t);let n=this.createRotationWidget(`labelRotation`,t),r=this.initLabelRotation(n,t);e.addItem(r),e.addItem(n)}initLabelRotation(e,t){let n=t.getChartOptions(),getLabelRotationValue=()=>n.getValue(`label.rotation`),getLabelAutoRotateValue=()=>n.getValue(`label.autoRotate`),updateAutoRotate=t=>{t&&(this.prevRotation=getLabelRotationValue()),n.setValues([{expression:`label.autoRotate`,value:t},{expression:`label.rotation`,value:t?void 0:this.prevRotation}]),e.setDisplayed(!t)},r=typeof getLabelRotationValue()!=`number`&&getLabelAutoRotateValue(),i=this.createBean(new ts({label:this.translate(`autoRotate`),value:r,onValueChange:updateAutoRotate}));e.setDisplayed(!r);let autoRotateUpdateFn=()=>i.setDisplayed(this.isGroupedCategoryAxis());return this.updateFuncs.push(autoRotateUpdateFn),autoRotateUpdateFn(),i}createRotationWidget(e,t){let n=t.getChartOptions(),getLabelRotationValue=()=>n.getValue(`label.rotation`),setLabelRotationValue=e=>n.setValue(`label.rotation`,e),r=new AgAngleSelect({label:`${this.chartTranslation.translate(e)} °`,labelWidth:`flex`,value:getLabelRotationValue()??0,onValueChange:setLabelRotationValue});return this.updateFuncs.push(()=>{r.setValue(getLabelRotationValue()??0)}),this.createBean(r)}isGroupedCategoryAxis(){return this.chartOptionsService.getCartesianAxisOptionsProxy(this.axisType).getValue(`type`)!==`grouped-category`||!this.isCategoryAxis()}addLabelPadding(e,t){let n=this.createBean(new AgSlider(t.getDefaultSliderParams(`label.spacing`,`padding`,30)));e.addItem(n)}translate(e){return this.chartTranslation.translate(e)}removeTemplateComponent(e){Ta(e.getGui()),this.destroyBean(e)}destroyActivePanels(){for(let e of this.activePanels)Ta(e.getGui()),this.destroyBean(e)}destroy(){this.destroyActivePanels(),super.destroy()}},PolarAxisPanel=class extends K{constructor(e){super(),this.options=e,this.axisGroup=null}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){let{isExpandedOnInit:e,chartAxisMenuParamsFactory:t,registerGroupComponent:n}=this.options,r={cssIdentifier:`charts-format-top-level`,direction:`vertical`,title:this.translate(`polarAxis`),expanded:e,suppressEnabledCheckbox:!0},i=t.getDefaultColorPickerParams(`line.stroke`),o=t.getDefaultSliderParams(`line.width`,`thickness`,10);this.setTemplate(`<div>
100            <ag-group-component data-ref="axisGroup">
101                <ag-color-picker data-ref="axisColorInput"></ag-color-picker>
102                <ag-slider data-ref="axisLineWidthSlider"></ag-slider>
103            </ag-group-component>
104        </div>`,[u_,ly,dy],{axisGroup:r,axisColorInput:i,axisLineWidthSlider:o}),n(this.axisGroup),this.initAxis(),this.initAxisLabels(),this.initRadiusAxis()}initAxis(){let e=this.options.chartController.getChartType();if([`radarLine`,`radarArea`].includes(e)){let e=[{value:`circle`,text:this.translate(`circle`)},{value:`polygon`,text:this.translate(`polygon`)}];this.axisGroup.addItem(this.createSelect({labelKey:`shape`,options:e,property:`shape`}))}e!==`pie`&&this.axisGroup.addItem(this.createSlider({labelKey:`innerRadius`,defaultMaxValue:1,property:`innerRadiusRatio`}))}initAxisLabels(){let e={name:this.translate(`labels`),enabled:!0,suppressEnabledCheckbox:!0,chartMenuParamsFactory:this.options.chartAxisMenuParamsFactory,keyMapper:e=>`label.${e}`},t=this.createManagedBean(new FontPanel(e)),n=this.createOrientationWidget();t.addItem(n),this.axisGroup.addItem(t)}createOrientationWidget(){let 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(!isRadial(getSeriesType(this.options.chartController.getChartType())))return;let e=[this.createSlider({labelKey:`groupPadding`,defaultMaxValue:1,property:`paddingInner`}),this.createSlider({labelKey:`seriesPadding`,defaultMaxValue:1,property:`groupPaddingInner`})],t=this.createManagedBean(new 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){let{labelKey:t,defaultMaxValue:n,step:r=.05,property:i}=e,o=this.options.chartAxisMenuParamsFactory.getDefaultSliderParams(i,t,n);return o.step=r,this.createManagedBean(new AgSlider(o))}createSelect(e){let{labelKey:t,options:n,property:r}=e;return this.createManagedBean(new Go(this.options.chartAxisMenuParamsFactory.getDefaultSelectParams(r,t,n)))}translate(e){return this.chartTranslation.translate(e)}}
104,BackgroundPanel=class extends K{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){let e=this.chartMenuUtils.addEnableParams(`background.visible`,{cssIdentifier:`charts-format-sub-level`,direction:`vertical`,suppressOpenCloseIcons:!0,title:this.chartTranslation.translate(`background`),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.chartMenuUtils.getDefaultColorPickerParams(`background.fill`);this.setTemplate(`<div>
105            <ag-group-component data-ref="chartBackgroundGroup">
106                <ag-color-picker data-ref="colorPicker"></ag-color-picker>
107            </ag-group-component>
108        <div>`,[u_,ly],{chartBackgroundGroup:e,colorPicker:t})}},PaddingPanel=class extends K{constructor(e,t){super(),this.chartMenuUtils=e,this.chartController=t,this.paddingTopSlider=null}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){let e={cssIdentifier:`charts-format-sub-level`,direction:`vertical`,suppressOpenCloseIcons:!0,title:this.chartTranslation.translate(`padding`),suppressEnabledCheckbox:!0},getSliderParams=e=>this.chartMenuUtils.getDefaultSliderParams(`padding.`+e,e,200);this.setTemplate(`<div>
109            <ag-group-component data-ref="chartPaddingGroup">
110                <ag-slider data-ref="paddingTopSlider"></ag-slider>
111                <ag-slider data-ref="paddingRightSlider"></ag-slider>
112                <ag-slider data-ref="paddingBottomSlider"></ag-slider>
113                <ag-slider data-ref="paddingLeftSlider"></ag-slider>
114            </ag-group-component>
115        <div>`,[u_,dy],{chartPaddingGroup:e,paddingTopSlider:getSliderParams(`top`),paddingRightSlider:getSliderParams(`right`),paddingBottomSlider:getSliderParams(`bottom`),paddingLeftSlider:getSliderParams(`left`)}),this.addManagedEventListeners({chartOptionsChanged:e=>{this.updateTopPadding(e.chartOptions)}})}updateTopPadding(e){let t=[...this.chartController.getChartSeriesTypes(),`common`].map(t=>e?.[t]?.padding?.top).find(e=>e!=null);t!=null&&this.paddingTopSlider.setValue(`${t}`)}},ChartPanel=class extends K{constructor(e){super(),this.options=e,this.chartGroup=null}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){let{chartController:e,chartMenuParamsFactory:t,isExpandedOnInit:n,registerGroupComponent:r}=this.options,i={cssIdentifier:`charts-format-top-level`,direction:`vertical`,title:this.chartTranslation.translate(`chartStyle`),expanded:n,suppressEnabledCheckbox:!0,items:[this.createManagedBean(new PaddingPanel(t,e)),this.createManagedBean(new BackgroundPanel(t))]};this.setTemplate(`<div>
116            <ag-group-component data-ref="chartGroup"></ag-group-component>
117        </div>`,[u_],{chartGroup:i}),r(this.chartGroup)}},GroupExpansionFeature=class extends U{constructor(e){super(),this.groupContainer=e,this.id=0,this.groupComponents=new Map}addGroupComponent(e){let t=this.id++;this.groupComponents.set(t,e),e.isExpanded()&&(this.expandedGroupComponent=t),e.onExpandedChange(n=>{if(n){let n=this.expandedGroupComponent;if(this.expandedGroupComponent=t,n!=null){let t=e.getGui(),r=t.offsetTop-this.groupContainer.parentElement.scrollTop;this.groupComponents.get(n)?.toggleGroupExpand(!1,!0);let i=t.offsetTop-r;i<0&&(i=0),i!==this.groupContainer.parentElement.scrollTop&&(this.groupContainer.parentElement.scrollTop=i)}}else this.expandedGroupComponent=void 0})}destroy(){this.groupComponents.clear(),super.destroy()}},LegendPanel=class extends K{constructor(e,t){super(),this.options=e,this.legendGroup=null,this.enabledGroup=null,this.isGradient=[`treemap`,`sunburst`,`heatmap`].includes(e.seriesType),this.key=this.isGradient?`gradientLegend`:`legend`,this.chartController=t.chartController}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){let{chartMenuParamsFactory:e,isExpandedOnInit:t,registerGroupComponent:n}=this.options,r=this.createManagedBean(new Go(e.getDefaultSelectParams(`${this.key}.position`,`position`,[`top`,`right`,`bottom`,`left`].map(e=>({value:e,text:this.chartTranslation.translate(e)})))));this.enabledGroup=this.createManagedBean(new AgGroupComponent(e.addEnableParams(`${this.key}.enabled`,{cssIdentifier:`charts-format-sub-level`,direction:`vertical`,suppressOpenCloseIcons:!0,title:this.chartTranslation.translate(`legendEnabled`),suppressEnabledCheckbox:!0,useToggle:!0,items:[this.createLabelPanel(e),r,...this.getItems(e)]})));let i={cssIdentifier:`charts-format-top-level`,direction:`vertical`,title:this.chartTranslation.translate(`legend`),suppressEnabledCheckbox:!0,expanded:t,items:[this.enabledGroup]};this.setTemplate(`<div>
118            <ag-group-component data-ref="legendGroup">
119            </ag-group-component>
120        </div>`,[u_],{legendGroup:i}),n(this.legendGroup);let o=this.updateLegendEnabledState.bind(this);this.addManagedListeners(this.chartController,{chartModelUpdate:o,chartApiUpdate:o})}updateLegendEnabledState(){let{valueCols:e}=this.chartController.getColStateForMenu();this.enabledGroup.setEnabled(e.filter(e=>e.selected).length>1)}getItems(e){let createSlider=(t,n,r)=>this.createManagedBean(new AgSlider(e.getDefaultSliderParams(`${this.key}.${t}`,n,r)));return this.isGradient?[this.createManagedBean(new ts(e.addValueParams(`gradientLegend.reverseOrder`,{label:this.chartTranslation.translate(`reverseDirection`),labelWidth:`flex`}))),createSlider(`gradient.thickness`,`thickness`,40),createSlider(`gradient.preferredLength`,`preferredLength`,300),createSlider(`spacing`,`spacing`,200)]:[createSlider(`spacing`,`spacing`,200),createSlider(`item.marker.size`,`markerSize`,40),createSlider(`item.marker.strokeWidth`,`markerStroke`,10),createSlider(`item.marker.padding`,`itemSpacing`,20),createSlider(`item.paddingX`,`layoutHorizontalSpacing`,50),createSlider(`item.paddingY`,`layoutVerticalSpacing`,50)]}createLabelPanel(e){let t=this.isGradient?`gradientLegend.scale.label`:`legend.item.label`,n={enabled:!0,suppressEnabledCheckbox:!0,chartMenuParamsFactory:e,keyMapper:e=>`${t}.${e}`,cssIdentifier:`charts-format-sub-level-no-header`};return this.createManagedBean(new FontPanel(n))}},ToggleablePanel=class extends K{constructor(e){super(),this.params=e,this.toggleableGroup=null,this.activeComps=[],this.chartOptions=e.chartMenuParamsFactory.getChartOptions()}postConstruct(){let{tag:e,cssIdentifier:t=`charts-format-sub-level`,title:n,suppressEnabledCheckbox:r}=this.params,i=this.params.chartMenuParamsFactory.addEnableParams(`${e}.enabled`,{cssIdentifier:t,direction:`vertical`,suppressOpenCloseIcons:!0,title:n,suppressEnabledCheckbox:!0,useToggle:!r});this.setTemplate(`<div class="ag-toggleable-group-panel">
121                <ag-group-component data-ref="toggleableGroup">
122                </ag-group-component>
123            </div>`,[u_],{toggleableGroup:i}),this.toggleCss(`ag-toggleable-group-panel-no-header`,!n)}addItem(e,t){t?this.toggleableGroup.prependItem(e):this.toggleableGroup.addItem(e),this.activeComps.push(e)}setEnabled(e){this.toggleableGroup.setEnabled(e)}destroyActiveComps(){for(let e of this.activeComps)Ta(e.getGui()),this.destroyBean(e)}destroy(){this.destroyActiveComps(),super.destroy()}},CalloutPanel=class extends K{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){let e={cssIdentifier:`charts-format-sub-level`,direction:`vertical`,title:this.chartTranslation.translate(`callout`),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`<div>
124            <ag-group-component data-ref="calloutGroup">
125                <ag-slider data-ref="calloutLengthSlider"></ag-slider>
126                <ag-slider data-ref="calloutStrokeWidthSlider"></ag-slider>
127                <ag-slider data-ref="labelOffsetSlider"></ag-slider>
128            </ag-group-component>
129        </div>`,[u_,dy],{calloutGroup:e,calloutLengthSlider:this.chartMenuUtils.getDefaultSliderParams(`calloutLine.length`,`length`,40),calloutStrokeWidthSlider:this.chartMenuUtils.getDefaultSliderParams(`calloutLine.strokeWidth`,`strokeWidth`,10),labelOffsetSlider:this.chartMenuUtils.getDefaultSliderParams(`calloutLabel.offset`,`offset`,30)})}},CapsPanel=class extends K{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){let e={cssIdentifier:`charts-format-sub-level`,direction:`vertical`,title:this.chartTranslation.translate(`cap`),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0},t=this.chartMenuUtils.getDefaultSliderParams(`cap.lengthRatio`,`capLengthRatio`,1);t.step=.05,this.setTemplate(`<div>
130            <ag-group-component data-ref="capsGroup">
131                <ag-slider data-ref="capLengthRatioSlider"></ag-slider>
132            </ag-group-component>
133        </div>`,[u_,dy],{capsGroup:e,capLengthRatioSlider:t})}},ConnectorLinePanel=class extends K{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){let e={cssIdentifier:`charts-format-sub-level`,direction:`vertical`,title:this.chartTranslation.translate(`connectorLine`),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`<div>
134            <ag-group-component data-ref="lineGroup">
135                <ag-color-picker data-ref="lineColorPicker"></ag-color-picker>
136                <ag-slider data-ref="lineStrokeWidthSlider"></ag-slider>
137                <ag-slider data-ref="lineOpacitySlider"></ag-slider>
138                <ag-slider data-ref="lineDashSlider"></ag-slider>                
139            </ag-group-component>
140        </div>`,[u_,ly,dy],{lineGroup:e,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,n,r=1,i=!1){let o=this.chartMenuUtils.getDefaultSliderParams(n,e,t,i);return o.step=r,o}};function getShapeSelectOptions(e){return[`square`,`circle`,`cross`,`diamond`,`plus`,`triangle`,`heart`].map(t=>({value:t,text:e.translate(t)}))}var MarkersPanel=class extends K{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){let e=this.chartMenuUtils.addEnableParams(`marker.enabled`,{cssIdentifier:`charts-format-sub-level`,direction:`vertical`,title:this.chartTranslation.translate(`markers`),suppressEnabledCheckbox:!0,useToggle:!0,suppressOpenCloseIcons:!0});this.setTemplate(`<div>
141            <ag-group-component data-ref="seriesMarkersGroup">
142                <ag-select data-ref="seriesMarkerShapeSelect"></ag-select>
143                <ag-slider data-ref="seriesMarkerSizeSlider"></ag-slider>
144                <ag-slider data-ref="seriesMarkerStrokeWidthSlider"></ag-slider>
145            </ag-group-component>
146        </div>`,[u_,au,dy],{seriesMarkersGroup:e,seriesMarkerShapeSelect:this.chartMenuUtils.getDefaultSelectParams(`marker.shape`,`shape`,getShapeSelectOptions(this.chartTranslation)),seriesMarkerSizeSlider:this.chartMenuUtils.getDefaultSliderParams(`marker.size`,`size`,60),seriesMarkerStrokeWidthSlider:this.chartMenuUtils.getDefaultSliderParams(`marker.strokeWidth`,`strokeWidth`,10)})}},SeriesItemsPanel=class extends K{constructor(e){super(),this.chartMenuUtils=e,this.seriesItemsGroup=null,this.activePanels=[]}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){let e={cssIdentifier:`charts-format-sub-level`,direction:`vertical`,title:this.chartTranslation.translate(`seriesItems`),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`<div>
147            <ag-group-component data-ref="seriesItemsGroup">
148                <ag-select data-ref="seriesItemSelect"></ag-select>
149            </ag-group-component>
150        </div>`,[u_,au],{seriesItemsGroup:e,seriesItemSelect:this.getSeriesItemsParams()}
150),this.initSeriesControls()}getSeriesItemsParams(){let e=[{value:`positive`,text:this.chartTranslation.translate(`seriesItemPositive`)},{value:`negative`,text:this.chartTranslation.translate(`seriesItemNegative`)}],seriesItemChangedCallback=e=>{this.destroyActivePanels(),this.initSeriesControls(e)};return this.chartMenuUtils.getDefaultSelectParamsWithoutValueParams(`seriesItemType`,e,`positive`,seriesItemChangedCallback)}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,n,r=1,i=!1){let o=this.chartMenuUtils.getDefaultSliderParams(n,e,t,i);o.step=r;let s=this.seriesItemsGroup.createManagedBean(new AgSlider(o));this.seriesItemsGroup.addItem(s),this.activePanels.push(s)}initItemLabels(e){let t=this.chartMenuUtils.getDefaultFontPanelParams(`item.${e}.label`,`seriesItemLabels`),n=this.createBean(new FontPanel(t));this.seriesItemsGroup.addItem(n),this.activePanels.push(n)}destroyActivePanels(){for(let e of this.activePanels)Ta(e.getGui()),this.destroyBean(e)}destroy(){this.destroyActivePanels(),super.destroy()}},ShadowPanel=class extends K{constructor(e,t=`shadow`){super(),this.chartMenuUtils=e,this.propertyKey=t}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){let e=this.propertyKey,t=this.chartMenuUtils.addEnableParams(`${e}.enabled`,{cssIdentifier:`charts-format-sub-level`,direction:`vertical`,suppressOpenCloseIcons:!0,title:this.chartTranslation.translate(`shadow`),suppressEnabledCheckbox:!0,useToggle:!0}),n=this.chartMenuUtils.getDefaultColorPickerParams(`${e}.color`);this.setTemplate(`<div>
151            <ag-group-component data-ref="shadowGroup">
152                <ag-color-picker data-ref="shadowColorPicker"></ag-color-picker>
153                <ag-slider data-ref="shadowBlurSlider"></ag-slider>
154                <ag-slider data-ref="shadowXOffsetSlider"></ag-slider>
155                <ag-slider data-ref="shadowYOffsetSlider"></ag-slider>
156            </ag-group-component>
157        </div>`,[u_,ly,dy],{shadowGroup:t,shadowColorPicker:n,shadowBlurSlider:this.getSliderParams(`blur`,0,20),shadowXOffsetSlider:this.getSliderParams(`xOffset`,-10,10),shadowYOffsetSlider:this.getSliderParams(`yOffset`,-10,10)})}getSliderParams(e,t,n){let r=`${this.propertyKey}.${e}`,i=this.chartMenuUtils.getDefaultSliderParams(r,e,n);return i.minValue=t,i}},TileSpacingPanel=class extends K{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){let e={cssIdentifier:`charts-format-sub-level`,direction:`vertical`,enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`<div>
158            <ag-group-component data-ref="groupSpacing">
159                <ag-slider data-ref="groupPaddingSlider"></ag-slider>
160                <ag-slider data-ref="groupSpacingSlider"></ag-slider>
161            </ag-group-component>
162            <ag-group-component data-ref="tileSpacing">
163                <ag-slider data-ref="tilePaddingSlider"></ag-slider>
164                <ag-slider data-ref="tileSpacingSlider"></ag-slider>
165            </ag-group-component>
166        </div>`,[u_,dy],{groupSpacing:{...e,title:this.chartTranslation.translate(`group`)},tileSpacing:{...e,title:this.chartTranslation.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`)}
vendor: 3,212 bytes, lines 166-178
166)}getSliderParams(e,t){return this.chartMenuUtils.getDefaultSliderParams(t,e,10)}};function _capitalise2(e){return e[0].toUpperCase()+e.substring(1)}var TooltipPanel=class extends K{constructor(e){super(),this.chartMenuUtils=e,this.tooltipMode=null}postConstruct(){let{chartMenuUtils:e,beans:t}=this,n=`tooltip`,r=t.chartTranslation,i=e.addEnableParams(`${n}.enabled`,{cssIdentifier:`charts-format-sub-level`,direction:`vertical`,suppressOpenCloseIcons:!0,title:r.translate(`tooltips`),suppressEnabledCheckbox:!0,useToggle:!0}),o=`tooltipMode`,s=[`single`,`shared`,`compact`].map(e=>({value:e,text:r.translate(`${o}${_capitalise2(e)}`)})),c=`${n}.mode`,p=e.getDefaultSelectParams(c,o,s);this.setTemplate(`<div>
167            <ag-group-component data-ref="tooltipGroup">
168                <ag-select data-ref="tooltipMode"></ag-select>
169            </ag-group-component>
170        </div>`,[u_,au],{tooltipGroup:i,tooltipMode:p}),this.addManagedEventListeners({chartOptionsChanged:()=>{let t=e.getChartOptions().getValue(c);this.tooltipMode.setValue(t,!0)}})}},WhiskersPanel=class extends K{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){let e={cssIdentifier:`charts-format-sub-level`,direction:`vertical`,title:this.chartTranslation.translate(`whisker`),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`<div>
171            <ag-group-component data-ref="whiskersGroup">
172                <ag-color-picker data-ref="whiskerColorPicker"></ag-color-picker>
173                <ag-slider data-ref="whiskerThicknessSlider"></ag-slider>
174                <ag-slider data-ref="whiskerOpacitySlider"></ag-slider>
175                <ag-slider data-ref="whiskerLineDashSlider"></ag-slider>
176                <ag-slider data-ref="whiskerLineDashOffsetSlider"></ag-slider>
177            </ag-group-component>
178        </div>`,[u_,ly,dy],{whiskersGroup:e,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)})}},ky=`tooltips`,Ay=`strokeWidth`,jy=`lineWidth`,My=`lineDash`,Ny=`lineOpacity`,Py=`fillOpacity`,Fy=`labels`,Iy=`shadow`,Ly=`stageLabels`,Ry=`markers`,SeriesPanel=class extends K{constructor(e){super(),this.options=e,this.seriesGroup=null,this.activePanels=[],this.widgetFuncs={lineWidth:()=>this.initStrokeWidth(jy),[Ay]:()=>this.initStrokeWidth(`strokeWidth`),lineColor:()=>this.initLineColor(),[My]:()=>this.initLineDash(),[Ny]:()=>this.initOpacity(`strokeOpacity`),[Py]:()=>this.initOpacity(`fillOpacity`),markers:()=>new MarkersPanel(this.chartMenuUtils),[Fy]:()=>this.initLabels(),sectorLabels:()=>this.initSectorLabels(),[Iy]:()=>new ShadowPanel(this.chartMenuUtils),[ky]:()=>new TooltipPanel(this.options.chartMenuParamsFactory),bins:()=>this.initBins(),whiskers:()=>
178new WhiskersPanel(this.chartMenuUtils),caps:()=>new CapsPanel(this.chartMenuUtils),connectorLine:()=>new ConnectorLinePanel(this.chartMenuUtils),seriesItems:()=>new SeriesItemsPanel(this.chartMenuUtils),tileSpacing:()=>new TileSpacingPanel(this.chartMenuUtils),shape:()=>this.initShape(),size:()=>this.initSize(`size`,`size`),minSize:()=>this.initSize(`size`,`minSize`),maxSize:()=>this.initSize(`maxSize`,`maxSize`),dropoff:()=>this.initDropOff(),stageLabels:()=>this.initStageLabels()},this.seriesWidgetMappings={bar:[ky,Ay,My,Ny,Py,Fy,Iy],pie:[ky,Ay,Ny,Py,Fy,`sectorLabels`,Iy],donut:[ky,Ay,Ny,Py,Fy,`sectorLabels`,Iy],line:[ky,jy,My,Ny,Ry,Fy],scatter:[ky,`shape`,`size`,Ay,Fy],bubble:[ky,`shape`,`minSize`,`maxSize`,Ay,Fy],area:[ky,jy,My,Ny,Py,Ry,Fy,Iy],histogram:[ky,`bins`,Ay,My,Ny,Py,Fy,Iy],"radial-column":[ky,Ay,My,Ny,Py,Fy],"radial-bar":[ky,Ay,My,Ny,Py,Fy],"radar-line":[ky,Ay,My,Ny,Ry,Fy],"radar-area":[ky,Ay,My,Ny,Py,Ry,Fy],nightingale:[ky,Ay,My,Ny,Py,Fy],"box-plot":[ky,Ay,My,Ny,Py,`whiskers`,`caps`],"range-bar":[ky,Ay,My,Ny,Py,Fy],"range-area":[ky,jy,My,Ny,Py,Ry,Fy,Iy],treemap:[ky,`tileSpacing`],sunburst:[ky],heatmap:[ky,Fy,`lineColor`,jy,Ny],waterfall:[ky,`connectorLine`,`seriesItems`],funnel:[ky,Ay,My,Ny,Py,Fy,`dropoff`,Ly,Iy],"cone-funnel":[ky,Ay,My,Ny,Py,Fy,Ly],pyramid:[ky,Ay,My,Ny,Py,Fy,Ly,Iy]},this.seriesType=e.seriesType}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){let{isExpandedOnInit:e,chartOptionsService:t,chartController:n,registerGroupComponent:r}=this.options,i={cssIdentifier:`charts-format-top-level`,direction:`vertical`,title:this.translate(`series`),expanded:e,suppressEnabledCheckbox:!0};this.setTemplate(`<div>
179            <ag-group-component data-ref="seriesGroup">
180            </ag-group-component>
181        </div>`,[u_],{seriesGroup:i}),r(this.seriesGroup),this.chartMenuUtils=this.createManagedBean(new ChartMenuParamsFactory(t.getSeriesOptionsProxy(()=>this.seriesType))),this.addManagedListeners(n,{chartSeriesChartTypeChanged:this.refreshWidgets.bind(this)}),this.refreshWidgets()}refreshWidgets(){let{chartController:e}=this.options;this.destroyActivePanels(),e.getChartProxy().getChart().waitForUpdate().then(()=>{if(this.isAlive()){e.isComboChart()&&(this.updateSeriesType(),this.initSeriesSelect());for(let e of this.seriesWidgetMappings[this.seriesType]??[]){let t=this.widgetFuncs[e](),n;if(Array.isArray(t)){let e=this.createBean(t[0]);n=e,t[1](e)}else n=this.createBean(t);this.seriesGroup.addItem(n),this.activePanels.push(n)}}}).catch(e=>Hl(105,{e}))}initSeriesSelect(){let e=this.createBean(new Go(this.chartMenuUtils.getDefaultSelectParamsWithoutValueParams(`seriesType`,this.getSeriesSelectOptions(),`${this.seriesType}`,e=>{this.seriesType=e,this.refreshWidgets()})));this.seriesGroup.addItem(e),this.activePanels.push(e)}initLineColor(){return new AgColorPicker(this.chartMenuUtils.getDefaultColorPickerParams(`stroke`,`strokeColor`))}initStrokeWidth(e,t){return new AgSlider(this.chartMenuUtils.getDefaultSliderParams(t?`${t}.${e}`:`strokeWidth`,e,10))}initLineDash(e){return new AgSlider(this.chartMenuUtils.getDefaultSliderParams(e?`${e}.lineDash`:`lineDash`,`lineDash`,30,!0))}initOpacity(e,t){let n=this.chartMenuUtils.getDefaultSliderParams(t?`${t}.${e}`:e,e,1);return n.step=.05,new AgSlider(n)}initDropOff(){let e=new ToggleablePanel({tag:`dropOff`,cssIdentifier:`charts-format-sub-level`,title:this.translate(`dropOff`),suppressEnabledCheckbox:!1,chartMenuParamsFactory:this.chartMenuUtils}),addItems=e=>{for(let t of[this.initStrokeWidth(`strokeWidth`,`dropOff`),this.initLineDash(`dropOff`),this.initOpacity(`strokeOpacity`,`dropOff`),this.initOpacity(`fillOpacity`,`dropOff`)]){let n=e.createManagedBean(t);e.addItem(n),this.activePanels.push(n)}};return[e,addItems]}initLabels(){let e=isPieChartSeries(this.seriesType),t=e?`calloutLabel`:`label`,n=e?`calloutLabels`:`labels`,r=new FontPanel(this.chartMenuUtils.getDefaultFontPanelParams(t,n)),addItems=t=>{if(e){let e=t.createManagedBean(new CalloutPanel(this.chartMenuUtils));t.addItem(e),this.activePanels.push(e)}if(this.seriesType===`range-bar`){let e=[{value:`inside`,text:this.translate(`inside`)},{value:`outside`,text:this.translate(`outside`)}],n=t.createManagedBean(new Go(this.chartMenuUtils.getDefaultSelectParams(`label.placement`,`labelPlacement`,e)));t.addItem(n),this.activePanels.push(n);let r=t.createManagedBean(new AgSlider(this.chartMenuUtils.getDefaultSliderParams(`label.padding`,`padding`,200)));t.addItem(r),this.activePanels.push(r)}};return[r,addItems]}initSectorLabels(){let e=new FontPanel(this.chartMenuUtils.getDefaultFontPanelParam
181s(`sectorLabel`,`sectorLabels`)),addItems=e=>{let t=this.chartMenuUtils.getDefaultSliderParams(`sectorLabel.positionRatio`,`positionRatio`,1);t.step=.05;let n=e.createManagedBean(new AgSlider(t));e.addItem(n)};return[e,addItems]}initStageLabels(){return new FontPanel(this.chartMenuUtils.getDefaultFontPanelParams(`stageLabel`,Ly))}initBins(){let e=this.chartMenuUtils.getDefaultSliderParams(`binCount`,`histogramBinCount`,20),t=this.chartMenuUtils.getChartOptions(),n=(t.getValue(`bins`)??t.getValue(`calculatedBins`,!0)).length;return e.value=`${n}`,e.maxValue=Math.max(n,20),new AgSlider(e)}initShape(){return new Go(this.chartMenuUtils.getDefaultSelectParams(`shape`,`shape`,getShapeSelectOptions(this.chartTranslation)))}initSize(e,t){return new AgSlider(this.chartMenuUtils.getDefaultSliderParams(e,t,60))}getSeriesSelectOptions(){let e=this.getActiveSeriesTypes();return[`area`,`bar`,`line`].filter(t=>e.includes(t)).map(e=>({value:e,text:this.translate(e)}))}updateSeriesType(){let e=this.getActiveSeriesTypes();!e.includes(this.seriesType)&&e.length>0&&(this.seriesType=e[0])}getActiveSeriesTypes(){return this.options.chartController.getActiveSeriesChartTypes().map(e=>getSeriesType(e.chartType))}translate(e){return this.chartTranslation.translate(e)}destroyActivePanels(){for(let e of this.activePanels)Ta(e.getGui()),this.destroyBean(e)}destroy(){this.destroyActivePanels(),super.destroy()}},TitlePanel=class extends K{constructor(e,t,n){super(`<div></div>`),this.chartMenuUtils=e,this.name=t,this.key=n,this.chartOptions=e.getChartOptions()}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){this.initFontPanel()}hasTitle(){let e=this.chartOptions.getValue(this.key);return e?.enabled&&e.text&&e.text.length>0}initFontPanel(){let e=this.hasTitle(),t={name:this.chartTranslation.translate(this.name),enabled:e,suppressEnabledCheckbox:!1,chartMenuParamsFactory:this.chartMenuUtils,keyMapper:e=>`${this.key}.${e}`,onEnableChange:e=>this.onEnableChange(e)};this.fontPanel=this.createManagedBean(new FontPanel(t)),this.fontPanel.addItem(this.createBean(new bo(this.getTextInputParams())),!0),this.fontPanel.addItem(this.createBean(new AgSlider(this.getSpacingSliderParams()))),this.getGui().appendChild(this.fontPanel.getGui())}getTextInputParams(){return this.chartMenuUtils.addValueParams(`${this.key}.text`,{label:this.chartTranslation.translate(`title`),labelAlignment:`top`})}getSpacingSliderParams(){return this.chartMenuUtils.getDefaultSliderParams(`${this.key}.spacing`,`spacing`,100)}onEnableChange(e){this.chartOptions.setValue(`${this.key}.enabled`,e)}},ChartTitlePanel=class extends TitlePanel{wireBeans(e){super.wireBeans(e),this.chartMenuSvc=e.chartMenuSvc}postConstruct(){this.titlePlaceholder=this.chartTranslation.translate(`titlePlaceholder`),super.postConstruct(),this.addManagedEventListeners({chartTitleEdit:()=>{this.fontPanel.setEnabled(this.hasTitle())}})}getTextInputParams(){let e=super.getTextInputParams();return this.shouldOverrideTextWithPlaceholder(e.value)&&(e.value=this.titlePlaceholder),e}getSpacingSliderParams(){let e=super.getSpacingSliderParams();return e.value=`10`,e}onEnableChange(e){if(this.chartMenuSvc.doesChartToolbarExist()){let t=this.chartOptions.getValue(`padding.top`);this.chartOptions.setValue(`padding.top`,e?t-20:t+20)}this.chartOptions.setValue(`${this.key}.enabled`,e);let t=this.chartOptions.getValue(`${this.key}.text`);e&&this.shouldOverrideTextWithPlaceholder(t)&&this.chartOptions.setValue(`${this.key}.text`,this.titlePlaceholder)}shouldOverrideTextWithPlaceholder(e){return e===`Title`||e?.trim().length===0}},TitlesPanel=class extends K{constructor(e){super(),this.options=e,this.titleGroup=null}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){let{chartMenuParamsFactory:e,chartAxisMenuParamsFactory:t,chartOptionsService:n,seriesType:r,isExpandedOnInit:i=!1,registerGroupComponent:o}=this.options,s=[];if(isCartesian(r)&&r!==`pyramid`){let createAxisParamsFactory=e=>this.createManagedBean(new ChartMenuParamsFactory(n.getCartesianAxisThemeOverridesProxy(e)));s.push(this.createManagedBean(new TitlePanel(createAxisParamsFactory(`xAxis`),`horizontalAxisTitle`,`title`))),s.push(this.createManagedBean(new TitlePanel(createAxisParamsFactory(`yAxis`),`verticalAxisTitle`,`title`)))}else isPolar(r)&&s.push(this.createManagedBean(new TitlePanel(t,`polarAxisTitle`,`title`)));let c={cssIdentifier:`charts-format-top-level`,direction:`vertical`,title:this.chartTranslation.translate(`chartTitles`),expanded:i,suppressEnabledCheckbox:!0,items:[this.createManagedBean(new ChartTitlePanel(e,`chartTitle`,`title`)),this.createManagedBean(new TitlePanel(e,`chartSubtitle`,`subtitle`)),...s]};this.setTemplate(`<div>
182            <ag-group-component data-ref="titleGroup"></ag-group-component>
183        </div>`,[u_],{titleGroup:c}),o(this.titleGroup)}},zy={groups:[{type:`chart`},{type:`titles`},{type:`legend`},{type:`series`},{type:`axis`}]},By=[`axis`,`horizontalAxis`,`verticalAxis`],FormatPanel=class extends K{constructor(e){super(`<div class="ag-chart-format-wrapper"></div>`),this.chartMenuContext=e}postConstruct(){this.groupExpansionFeature=this.createManagedBean(new GroupExpansionFeature(this.getGui())),this.chartPanelFeature=this.createManagedBean(new ChartPanelFeature
183(this.chartMenuContext.chartController,this.getGui(),`ag-chart-format-section`,(e,t)=>this.createPanels(t))),this.chartPanelFeature.refreshPanels()}createPanels(e){let t=!1;this.getFormatPanelDef().groups?.forEach(({type:n,isOpen:r=!1})=>{if(!this.isGroupPanelShownInSeries(n,e))return;r&&(t&&q(145,{group:n}),t=!0);let registerGroupComponent=e=>this.groupExpansionFeature.addGroupComponent(e),i={...this.chartMenuContext,isExpandedOnInit:r,seriesType:e,registerGroupComponent};switch(n){case`chart`:this.chartPanelFeature.addComponent(new ChartPanel(i));break;case`titles`:this.chartPanelFeature.addComponent(new TitlesPanel(i));break;case`legend`:this.chartPanelFeature.addComponent(new LegendPanel(i,this.chartMenuContext));break;case`axis`:isPolar(e)?this.chartPanelFeature.addComponent(new PolarAxisPanel(i)):isCartesian(e)&&(this.chartPanelFeature.addComponent(new CartesianAxisPanel(`xAxis`,i)),this.chartPanelFeature.addComponent(new CartesianAxisPanel(`yAxis`,i)));break;case`horizontalAxis`:this.chartPanelFeature.addComponent(new CartesianAxisPanel(`xAxis`,i));break;case`verticalAxis`:this.chartPanelFeature.addComponent(new CartesianAxisPanel(`yAxis`,i));break;case`series`:this.chartPanelFeature.addComponent(new SeriesPanel(i));break;default:q(147,{group:n})}})}getFormatPanelDef(){return this.gos.get(`chartToolPanelsDef`)?.formatPanel||zy}isGroupPanelShownInSeries(e,t){let n=[`chart`,`titles`,`legend`,`series`].includes(e)||isCartesian(t)&&By.includes(e)||isPolar(t)&&e===`axis`,r=isFunnel(t)&&e===`legend`||isFunnel(t)&&By.includes(e);return n&&!r}},Vy=`ag-chart-mini-thumbnail-canvas`,MiniChart=class extends K{constructor(e,t,n){super(),this.agChartsExports=t,this.tooltipName=n,this.size=58,this.padding=5;let{_Scene:r}=t;this.root=new r.Group;let i=new r.Scene({width:this.size,height:this.size});i.canvas.element.classList.add(Vy),i.setRoot(this.root),i.setContainer(e),this.scene=i}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){this.scene.canvas.element.title=this.chartTranslation.translate(this.tooltipName);try{this.scene.render()}catch(e){Hl(108,{e})}}};function createColumnRects(e){let{stacked:t,size:n,padding:r,xScalePadding:i,xScaleDomain:o,yScaleDomain:s,agChartsExports:{_Scene:c}}=e,p=new c.CategoryScale;p.domain=o,p.range=[r,n-r],p.paddingInner=i,p.paddingOuter=i;let m=new c.LinearScale;m.domain=s,m.range=[n-r,r];let createBars=(e,t,n)=>e.map((e,r)=>{let i=n.convert(e),o=new c.Rect;return o.x=t.convert(r),o.y=i,o.width=t.bandwidth,o.height=n.convert(0)-i,o.strokeWidth=0,o.crisp=!0,o});return t?e.data.map(e=>createBars(e,p,m)):createBars(e.data,p,m)}function prepareXYScales(e,t,n,r){let i=[],o=[];for(let e of t)for(let[t,n]of e)i.push(t),o.push(n);let s=new e.LinearScale;s.domain=[Math.min(...i),Math.max(...i)],s.range=[r,n-r];let c=new e.LinearScale;return c.domain=[Math.min(...o),Math.max(...o)],c.range=[n-r,r],{xScale:s,yScale:c}}function prepareLinearScene(e,t,n,r){let i=[0,t[0].length-1],o=t.reduce((e,t)=>{for(let n of t)n<e[0]&&(e[0]=n),n>e[1]&&(e[1]=n);return e},[1/0,-1/0]);o[0]--,o[o.length-1]++;let s=new e.LinearScale;s.domain=i,s.range=[r,n-r];let c=new e.LinearScale;return c.domain=o,c.range=[n-r,r],{xScale:s,yScale:c}}function createXPathCommands(e,t,n){return e.map(e=>e.map((e,r)=>[r>0?`lineTo`:`moveTo`,t.convert(r),n.convert(e)]))}function createXYPathCommands(e,t,n){return e.map(([e,r],i)=>[i>0?`lineTo`:`moveTo`,t.convert(e),n.convert(r)])}function closePath(e){let t=e[0],n=e[1],r=Kc(e);return(n[1]!==r[1]||n[2]!==r[2])&&e.push([t[0],n[1],n[2]]),e}function createPath(e,t){let n=new e.Path;return t.forEach(([e,t,r])=>n.path[e](t,r)),n}function createAreaPathCommands(e,t,n){return e.map((e,r,i)=>{let o=[...n?closePathViaPreviousSeries(i,r,t):closePathViaOrigin(e,t)].reverse().map(([e,t,n])=>[`lineTo`,t,n]),s=e[0],c=Kc(o);return(s[1]!==c[1]||s[2]!==c[2])&&o.push([`lineTo`,s[1],s[2]]),[...e,...o]})}function closePathViaPreviousSeries(e,t,n){return t===0?closePathViaOrigin(e[t],n):[...e[t-1]]}function closePathViaOrigin(e,t){return e.map(([e,n])=>[e,n,t.convert(0)])}function commandsToPath(e,t){let n=createPath(e,t);return n.fill=void 0,n.lineCap=`round`,n.strokeWidth=3,n}function createShapePaths({_Scene:e},t,n,r,i){let{xScale:o,yScale:s}=prepareXYScales(e,n,r,i),c=n.map(e=>createXYPathCommands(e,o,s)).map(e=>closePath(e)).map(t=>commandsToPath(e,t)).reduce((e,t)=>
183e.concat(t),[]),p=new e.Group;return p.setClipRect(new e.BBox(i,i,r-i*2,r-i*2)),p.append(c),t.append(p),c}function createLinePaths({_Scene:e},t,n,r,i){let{xScale:o,yScale:s}=prepareLinearScene(e,n,r,i),c=createXPathCommands(n,o,s).map(t=>commandsToPath(e,t)),p=new e.Group;return p.setClipRect(new e.BBox(i,i,r-i*2,r-i*2)),p.append(c),t.append(p),c}function createAreaPaths(e,t,n,r,i,o=!1){let{xScale:s,yScale:c}=prepareLinearScene(e,n,r,i),p=createAreaPathCommands(createXPathCommands(n,s,c),c,o),m=new e.Group;m.setClipRect(new e.BBox(i,i,r-i*2,r-i*2));let h=p.map(t=>createPath(e,t));return m.append(h),t.append(m),h}function stackData(e){return e.map((e,t,n)=>e.map((e,r)=>n.slice(0,t+1).reduce((e,t)=>e+t[r],0)))}function normalizeStackData(e){let t=e.map((t,n)=>e.reduce((e,t)=>Math.max(e,t[n]),0));return e.map(e=>e.map((e,n)=>e/t[n]*19))}function createPolarPaths(e,t,n,r,i,o,s=0){let{_Scene:c}=e,p=new c.LinearScale;p.domain=[0,7],p.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2);let m=new c.LinearScale;m.domain=[0,10],m.range=[i,o];let h=[],g=r/2,_=n.map(e=>{let t=new c.Path;return t.strokeWidth=1,t.strokeOpacity=.5,t.lineCap=`round`,t.fill=void 0,t.fillOpacity=.8,e.forEach((e,n)=>{let r=p.convert(n),_=i+o-m.convert(e),v=_*Math.cos(r)+g,y=_*Math.sin(r)+g;if(t.path[n>0?`lineTo`:`moveTo`](v,y),s>0){let e=new c.Marker({shape:`circle`});e.x=v,e.y=y,e.size=s,h.push(e)}}),t.path.closePath(),t}),v=new c.Group;return v.append([..._,...h]),t.append(v),{paths:_,markers:h}}function accumulateData(e){let[t,n]=[1/0,-1/0];return{processedData:e.reduce((e,r,i)=>{let o=i>0?e[i-1]:void 0;e[i]??(e[i]=[]);let s=e[i];return r.forEach((e,r)=>{o&&(e+=o[r]),s[r]=e,s[r]<t&&(t=s[r]),s[r]>n&&(n=s[r])}),e},[]),min:t,max:n}}var Hy=[[[13,16],[13,12],[3,12],[3,16]],[[12,11],[12,7],[4,7],[4,11]],[[10.125,6],[10.125,1.5],[5.875,1.5],[5.875,6]]],MiniFunnelClass=class extends MiniChart{constructor(e,t,n,r,i,o=`funnelTooltip`,s=Hy){super(e,t,o),this.shapes=createShapePaths(t,this.root,s,this.size,this.padding),this.updateColors(n,r)}updateColors(e,t){for(let n of this.shapes)n.fill=e[0],n.stroke=t[0],n.strokeWidth=0}},Uy={chartType:`funnel`,miniChart:MiniFunnelClass},Wy=[[[13,16],[10.75,11.5],[5.25,11.5],[3,16]],[[10.75,11.5],[8.875,6],[7.125,6],[5.25,11.5]],[[8.875,6],[8.875,1.5],[7.125,1.5],[7.125,6]]],MiniConeFunnelClass=class extends MiniFunnelClass{constructor(e,t,n,r,i,o=`coneFunnelTooltip`){super(e,t,n,r,i,o,Wy)}updateColors(e,t){this.shapes.forEach((n,r)=>{n.fill=e[0],n.fillOpacity=1-r*.2,n.stroke=t[0],n.strokeWidth=0})}},Gy={chartType:`coneFunnel`,miniChart:MiniConeFunnelClass},Ky=[[[8,16],[10,12],[6,12]],[[10.5,11],[12.5,7],[3.5,7],[5.5,11]],[[13,6],[15.5,1.5],[.5,1.5],[3,6]]],MiniPyramidClass=class extends MiniFunnelClass{constructor(e,t,n,r,i,o=`pyramidTooltip`){super(e,t,n,r,i,o,Ky)}updateColors(e,t){this.shapes.forEach((n,r)=>{n.fill=e[r],n.stroke=t[r],n.strokeWidth=0})}},qy={chartType:`pyramid`,miniChart:MiniPyramidClass},MiniChartWithAxes=class extends MiniChart{constructor(e,t,n){super(e,t,n),this.stroke=`gray`,this.axisOvershoot=3}postConstruct(){let{_Scene:e}=this.agChartsExports,t=this.size,n=this.padding,r=new e.Line;r.x1=n,r.y1=n,r.x2=n,r.y2=t-n+this.axisOvershoot,r.stroke=this.stroke;let i=new e.Line;i.x1=n-this.axisOvershoot+1,i.y1=t-n,i.x2=t-n+1,i.y2=t-n,i.stroke=this.stroke;let o=this.root;o.append(r),o.append(i),super.postConstruct()}},MiniColumnClass=class extends MiniChartWithAxes{constructor(e,t,n,r){super(e,t,`groupedColumnTooltip`),this.columnData=[2,3,4];let{root:i,columnData:o,size:s,padding:c}=this;this.columns=createColumnRects({stacked:!1,root:i,data:o,size:s,padding:c,xScaleDomain:[0,1,2],yScaleDomain:[0,4],xScalePadding:.3,agChartsExports:t}),i.append(this.columns),this.updateColors(n,r)}updateColors(e,t){this.columns.forEach((n,r)=>{n.fill=e[r],n.stroke=t[r]})}},Jy={chartType:`groupedColumn`,miniChart:MiniColumnClass},Yy=[[8,12,16],[6,9,12],[2,3,4]],MiniStackedColumnClass=class extends MiniChartWithAxes{constructor(e,t,n,r,i,o=Yy,s=[0,16],c=`stackedColumnTooltip`){super(e,t,c);let{root:p,size:m,padding:h}=this;this.stackedColumns=createColumnRects({stacked:!0,root:p,data:o,size:m,padding:h,xScaleDomain:[0,1,2],yScaleDomain:s,xScalePadding:.3,agChartsExports:t}),p.append(rs(this.stackedColumns)),this.updateColors(n,r)}updateColors(e,t){this.stackedColumns.forEach((n,r)=>{for(let i of n)i.fill=e[r],i.stroke=t[r]})}},Xy={chartType:`stackedColumn`,miniChart:MiniStackedColumnClass},Zy=[[10,10,10],[6,7,8],[2,4,6]],MiniNormalizedColumnClass=class extends MiniStackedColumnClass{constructor(e,t,n,r,i){super(e,t,n,r,i,Zy,[0,10],`normalizedColumnTooltip`)}},Qy={chartType:`normalizedColumn`,miniChart:MiniNormalizedColumnClass}
183,MiniBarClass=class extends MiniChartWithAxes{constructor(e,t,n,r){super(e,t,`groupedBarTooltip`);let{_Scene:i}=t,o=this.padding,s=this.size,c=[2,3,4],p=new i.CategoryScale;p.domain=[0,1,2],p.range=[o,s-o],p.paddingInner=.3,p.paddingOuter=.3;let m=new i.LinearScale;m.domain=[0,4],m.range=[s-o,o];let h=m.convert(0),g=p.bandwidth;this.bars=c.map((e,t)=>{let n=new i.Rect;return n.x=o,n.y=p.convert(t),n.width=h-m.convert(e),n.height=g,n.strokeWidth=0,n.crisp=!0,n}),this.updateColors(n,r),this.root.append(this.bars)}updateColors(e,t){this.bars.forEach((n,r)=>{n.fill=e[r],n.stroke=t[r]})}},$y={chartType:`groupedBar`,miniChart:MiniBarClass},eb=[[8,12,16],[6,9,12],[2,3,4]],MiniStackedBarClass=class extends MiniChartWithAxes{constructor(e,t,n,r,i,o=eb,s=[0,16],c=`stackedBarTooltip`){super(e,t,c);let{_Scene:p}=t,m=this.size,h=this.padding,g=new p.CategoryScale;g.domain=[0,1,2],g.range=[h,m-h],g.paddingInner=.3,g.paddingOuter=.3;let _=new p.LinearScale;_.domain=s,_.range=[m-h,h];let v=_.convert(0),y=g.bandwidth;this.bars=o.map(e=>e.map((e,t)=>{let n=new p.Rect;return n.x=h,n.y=g.convert(t),n.width=v-_.convert(e),n.height=y,n.strokeWidth=0,n.crisp=!0,n})),this.updateColors(n,r),this.root.append(rs(this.bars))}updateColors(e,t){this.bars.forEach((n,r)=>n.forEach(n=>{n.fill=e[r],n.stroke=t[r]}))}},tb={chartType:`stackedBar`,miniChart:MiniStackedBarClass},nb=[[10,10,10],[6,7,8],[2,4,6]],MiniNormalizedBarClass=class extends MiniStackedBarClass{constructor(e,t,n,r,i){super(e,t,n,r,i,nb,[0,10],`normalizedBarTooltip`)}},rb={chartType:`normalizedBar`,miniChart:MiniNormalizedBarClass},MiniDonutClass=class extends MiniChart{constructor(e,t,n,r,i,o=.6,s=`donutTooltip`){super(e,t,s);let{size:c,padding:p,agChartsExports:{_Scene:m}}=this,h=(c-p*2)/2,g=h+p,_=m.toRadians,v=[[_(-90),_(30)],[_(30),_(120)],[_(120),_(180)],[_(180),_(210)],[_(210),_(240)],[_(240),_(270)]];this.sectors=v.map(([e,t])=>{let n=new m.Sector;return n.centerX=g,n.centerY=g,n.innerRadius=h*o,n.outerRadius=h,n.startAngle=e,n.endAngle=t,n.stroke=void 0,n.strokeWidth=0,n.inset=.75,n}),this.updateColors(n,r),this.root.append(this.sectors)}updateColors(e,t){this.sectors.forEach((n,r)=>{n.fill=e[r%e.length],n.stroke=t[r%t.length]})}},ib={chartType:`donut`,miniChart:MiniDonutClass},MiniPieClass=class extends MiniDonutClass{constructor(e,t,n,r,i){super(e,t,n,r,i,0,`pieTooltip`)}},ab={chartType:`pie`,miniChart:MiniPieClass},ob=[[1,3,5],[2,6,4],[5,3,1]],MiniLineClass=class extends MiniChartWithAxes{constructor(e,t,n,r,i,o=ob,s=`lineTooltip`){super(e,t,s);let{size:c,padding:p,root:m}=this;this.lines=createLinePaths(t,m,o,c,p),this.updateColors(n,r)}updateColors(e,t){this.lines.forEach((t,n)=>{t.stroke=e[n]})}},sb={chartType:`line`,miniChart:MiniLineClass},lb=stackData(ob),MiniStackedLineClass=class extends MiniLineClass{constructor(e,t,n,r,i,o=lb,s=`stackedLineTooltip`){super(e,t,n,r,i,o,s)}},ub={chartType:`stackedLine`,miniChart:MiniStackedLineClass},db=normalizeStackData(lb),MiniNormalizedLineClass=class extends MiniLineClass{constructor(e,t,n,r,i,o=db,s=`normalizedLineTooltip`){super(e,t,n,r,i,o,s)}},fb={chartType:`normalizedLine`,miniChart:MiniNormalizedLineClass},MiniScatterClass=class extends MiniChartWithAxes{constructor(e,t,n,r){super(e,t,`scatterTooltip`);let{size:i,padding:o,agChartsExports:{_Scene:s}}=this,c=[[[.3,3],[1.1,.9],[2,.4],[3.4,2.4]],[[0,.3],[1,2],[2.4,1.4],[3,0]]],p=new s.LinearScale;p.domain=[-.5,4],p.range=[o*2,i-o];let m=new s.LinearScale;m.domain=[-.5,3.5],m.range=[i-o,o];let h=[];c.forEach(e=>{e.forEach(([e,t])=>{let n=new s.Arc;n.strokeWidth=0,n.centerX=p.convert(e),n.centerY=m.convert(t),n.radius=2.5,h.push(n)})}),this.points=h,this.updateColors(n,r);let g=new s.Group;g.setClipRect(new s.BBox(o,o,i-o*2,i-o*2)),g.append(this.points),this.root.append(g)}updateColors(e,t){this.points.forEach((n,r)=>{n.stroke=t[r%t.length],n.fill=e[r%e.length]})}},pb={chartType:`scatter`,miniChart:MiniScatterClass},MiniBubbleClass=class extends MiniChartWithAxes{constructor(e,t,n,r){super(e,t,`bubbleTooltip`);let{size:i,padding:o,agChartsExports:{_Scene:s}}=this,c=[[[.1,.3,5],[.5,.4,7],[.2,.8,7]],[[.8,.7,5],[.7,.3,9]]],p=new s.LinearScale;p.domain=[0,1],p.range=[o*2,i-o];let m=new s.LinearScale;m.domain=[0,1],m.range=[i-o,o];let h=[];
183c.forEach(e=>{e.forEach(([e,t,n])=>{let r=new s.Arc;r.strokeWidth=0,r.centerX=p.convert(e),r.centerY=m.convert(t),r.radius=n,r.fillOpacity=.7,h.push(r)})}),this.points=h,this.updateColors(n,r);let g=new s.Group;g.setClipRect(new s.BBox(o,o,i-o*2,i-o*2)),g.append(this.points),this.root.append(g)}updateColors(e,t){this.points.forEach((n,r)=>{n.stroke=t[r%t.length],n.fill=e[r%e.length]})}},mb={chartType:`bubble`,miniChart:MiniBubbleClass},hb=ob,MiniAreaClass=class extends MiniChartWithAxes{constructor(e,t,n,r,i,o=hb,s=`groupedAreaTooltip`,c=!1){super(e,t,s),this.areas=createAreaPaths(t._Scene,this.root,o,this.size,this.padding,c),this.updateColors(n,r)}updateColors(e,t){this.areas.forEach((n,r)=>{n.fill=e[r],n.stroke=t[r],n.strokeWidth=1,n.strokeOpacity=.75,n.fillOpacity=.7})}},gb={chartType:`area`,miniChart:MiniAreaClass},_b=stackData(hb),MiniStackedAreaClass=class extends MiniAreaClass{constructor(e,t,n,r,i,o=_b,s=`stackedAreaTooltip`){super(e,t,n,r,i,o,s,!0)}updateColors(e,t){this.areas.forEach((n,r)=>{n.fill=e[r],n.stroke=t[r]})}},vb={chartType:`stackedArea`,miniChart:MiniStackedAreaClass},yb=normalizeStackData(_b),MiniNormalizedAreaClass=class extends MiniStackedAreaClass{constructor(e,t,n,r,i,o=yb,s=`normalizedAreaTooltip`){super(e,t,n,r,i,o,s)}},bb={chartType:`normalizedArea`,miniChart:MiniNormalizedAreaClass},MiniHistogramClass=class extends MiniChartWithAxes{constructor(e,t,n,r){super(e,t,`histogramTooltip`);let{padding:i,size:o,agChartsExports:{_Scene:s}}=this,c=[2,5,11,13,10,6,1],p=new s.LinearScale;p.domain=[0,c.length],p.range=[i,o-i];let m=new s.LinearScale;m.domain=[0,c.reduce((e,t)=>Math.max(e,t),0)],m.range=[o-i,i];let h=m.convert(0);this.bars=c.map((e,t)=>{let n=m.convert(e),r=p.convert(t),i=p.convert(t+1),o=new s.Rect;return o.x=r,o.y=n,o.width=i-r,o.height=h-n,o.strokeWidth=1,o.strokeOpacity=.75,o.crisp=!0,o}),this.updateColors(n,r),this.root.append(this.bars)}updateColors([e],[t]){for(let n of this.bars)n.fill=e,n.stroke=t}},xb={chartType:`histogram`,miniChart:MiniHistogramClass},MiniChartWithPolarAxes=class extends MiniChart{constructor(e,t,n){super(e,t,n),this.stroke=`gray`,this.showRadiusAxisLine=!0,this.showAngleAxisLines=!0}postConstruct(){let{_Scene:e}=this.agChartsExports,t=this.size,n=this.padding,r=(t-n*2)/2,i=this.showAngleAxisLines?[r,r*.8,r*.6,r*.4]:[],o=new e.Line;o.x1=t/2,o.y1=n,o.x2=t/2,o.y2=t-n-r-i[i.length-1],o.stroke=this.stroke,o.strokeOpacity=.5,o.fill=void 0,o.visible=this.showRadiusAxisLine;let s=n+r;this.gridLines=i.map((t,n)=>{let r=new e.Path;return r.path.arc(s,s,t,0,2*Math.PI),r.strokeWidth=1,r.stroke=this.stroke,r.strokeOpacity=n===0?.5:.2,r.fill=void 0,r});let c=this.root;c.append(o),this.gridLines.length>0&&c.append(this.gridLines),super.postConstruct()}},MiniRadialColumnClass=class extends MiniChartWithPolarAxes{constructor(e,t,n,r){super(e,t,`radialColumnTooltip`),this.data=[[6,8,10,2,6,5],[4,4,3,6,4,4],[5,4,2,9,8,9]],this.showRadiusAxisLine=!1;let{padding:i,size:o,data:s,agChartsExports:{_Scene:c}}=this,p=(o-i*2)/2,m=p*.4,h=new c.CategoryScale;h.domain=s[0].map((e,t)=>t),h.range=[0,2*Math.PI],h.paddingInner=0,h.paddingOuter=0;let g=h.bandwidth*.7,{processedData:_,max:v}=accumulateData(s),y=new c.LinearScale;y.domain=[0,v],y.range=[m,p];let b=this.size/2;this.series=_.map((e,t)=>{let n=t===0?void 0:_[t-1],r=new c.TranslatableGroup({zIndex:1e6}),i=e.map((e,t)=>{let r=n?.[t],i=y.convert(e),o=y.convert(r??0),s=h.convert(t),_=s+g,v=c.getRadialColumnWidth(s,_,p,.5,.5),b=new c.RadialColumnShape;return b.columnWidth=v,b.innerRadius=o,b.outerRadius=i,b.startAngle=s,b.endAngle=_,b.isBeveled=!0,b.axisInnerRadius=m,b.axisOuterRadius=p,b.stroke=void 0,b.strokeWidth=0,b});return r.append(i),r.translationX=b,r.translationY=b,r}),this.root.append(this.series),this.updateColors(n,r)}updateColors(e,t){this.series.forEach((n,r)=>{for(let i of n.children())i.fill=e[r%e.length],i.stroke=t[r%t.length]})}},Sb={chartType:`radialColumn`,miniChart:MiniRadialColumnClass},MiniRadialBarClass=class extends MiniChartWithPolarAxes{constructor(e,t,n,r){super(e,t,`radialBarTooltip`),this.data=[[6,8,10],[4,4,3],[5,4,2]],this.showRadiusAxisLine=!1;let{size:i,padding:o,data:s,agChartsExports:{_Scene:c}}=this,p=(i-o)/2,m=p*.4,h=new c.CategoryScale;h.domain=s[0].map((e,t)=>t),h.range=[m,p],h.paddingInner=.5,h.paddingOuter=0;let g=h.bandwidth,{processedData:_,max:v}=accumulateData(s),y=new c.LinearScale;y.domain=[0,Math.ceil(v*1.5)];let b=3/2*Math.PI;y.range=[b,b+2*Math.PI];let x=i/2;this.series=_.map((e,t)=>{let n=t<0?void 0:_[t-1],r=new c.Group({zIndex:1e6}),i=e.map((e,t)=>{let r=n?.[t]??0,i=h.convert(t),o=i-g,s=y.convert(r),p=y.convert(e),m=new c.Sector;return m.centerX=x,m.centerY=x,m.innerRadius=o,m.outerRadius=i,m.startAngle=s,m.endAngle=p,m.stroke=void 0,m.strokeWidth=0,m});return r.append(i),r}),this.root.append(this.series),this.updateColors(n,r)}
183updateColors(e,t){this.series.forEach((n,r)=>{for(let i of n.children())i.fill=e[r%e.length],i.stroke=t[r%t.length]})}},Cb={chartType:`radialBar`,miniChart:MiniRadialBarClass},MiniRadarLineClass=class extends MiniChartWithPolarAxes{constructor(e,t,n,r){super(e,t,`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;let{size:i,padding:o,root:s,data:c}=this,{paths:p,markers:m}=createPolarPaths(t,s,c,i,(i-o*2)/2,0,this.markerSize);this.lines=p,this.markers=m,this.updateColors(n,r)}updateColors(e,t){this.lines.forEach((n,r)=>{let i=this.data[r].length;n.stroke=e[r];let o=r*i,s=o+i,c=this.markers.slice(o,s);for(let n of c)n.stroke=t[r],n.fill=e[r]})}},wb={chartType:`radarLine`,miniChart:MiniRadarLineClass},MiniRadarAreaClass=class extends MiniChartWithPolarAxes{constructor(e,t,n,r){super(e,t,`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]];let{size:i,padding:o,root:s,data:c}=this;this.showRadiusAxisLine=!1;let p=(i-o*2)/2,m=p-i*.3;this.areas=createPolarPaths(t,s,c,i,p,m).paths,this.updateColors(n,r)}updateColors(e,t){this.areas.forEach((n,r)=>{n.fill=e[r],n.stroke=t[r]})}},Tb={chartType:`radarArea`,miniChart:MiniRadarAreaClass},MiniNightingaleClass=class extends MiniChartWithPolarAxes{constructor(e,t,n,r){super(e,t,`nightingaleTooltip`),this.data=[[6,10,9,8,7,8],[4,6,5,4,5,5],[3,5,4,3,4,7]],this.showRadiusAxisLine=!1;let{size:i,padding:o,data:s,agChartsExports:{_Scene:c}}=this,p=(i-o*2)/2,m=new c.CategoryScale;m.domain=s[0].map((e,t)=>t),m.range=[-Math.PI,Math.PI],m.paddingInner=0,m.paddingOuter=0;let h=m.bandwidth*.7,{processedData:g,max:_}=accumulateData(s),v=new c.LinearScale;v.domain=[0,_],v.range=[0,p];let y=i/2;this.series=g.map((e,t)=>{let n=t<0?void 0:g[t-1],r=new c.Group({zIndex:1e6}),i=e.map((e,t)=>{let r=n?.[t],i=v.convert(e),o=v.convert(r??0),s=m.convert(t),p=s+h,g=new c.Sector;return g.centerX=y,g.centerY=y,g.innerRadius=o,g.outerRadius=i,g.startAngle=s,g.endAngle=p,g.stroke=void 0,g.strokeWidth=0,g});return r.append(i),r}),this.root.append(this.series),this.updateColors(n,r)}updateColors(e,t){this.series.forEach((n,r)=>{for(let i of n.children())i.fill=e[r%e.length],i.stroke=t[r%t.length]})}},Eb={chartType:`nightingale`,miniChart:MiniNightingaleClass},MiniRangeBarClass=class extends MiniChartWithAxes{constructor(e,t,n,r){super(e,t,`rangeBarTooltip`);let i=[3,3.5,3];this.bars=this.createRangeBar(this.root,i,this.size,this.padding,`vertical`),this.updateColors(n,r)}updateColors(e,t){this.bars.forEach((n,r)=>{n.fill=e[r],n.stroke=t[r]})}createRangeBar(e,t,n,r,i){let o=i===`horizontal`,s=2*r,{_Scene:c}=this.agChartsExports,p=new c.CategoryScale;p.domain=t.map((e,t)=>t),p.range=[r,n-r],p.paddingInner=.3,p.paddingOuter=.3;let m=.7,h=1.3,g=new c.LinearScale;g.domain=[t.reduce((e,t)=>Math.min(e,t),1/0)*m,t.reduce((e,t)=>Math.max(e,t),0)*h],g.range=[s,n-s];let _=p.bandwidth,v=t.map((e,t)=>{let[n,r]=[e*m,e*h],i=p.convert(t),s=g.convert(n),v=g.convert(r)-s,y=new c.Rect;return y.x=o?s:i,y.y=o?i:s,y.width=o?v:_,y.height=o?_:v,y.strokeWidth=0,y.crisp=!0,y});return e.append(v),v}},Db={chartType:`rangeBar`,miniChart:MiniRangeBarClass},MiniRangeAreaClass=class extends MiniChartWithAxes{constructor(e,t,n,r){super(e,t,`rangeAreaTooltip`);let i=[zigzag({offset:1.5,length:4,pattern:{low:3,high:5,period:4}}),zigzag({offset:1.5,length:4,pattern:{low:2.25,high:4.25,period:4}}),zigzag({offset:3,length:4,pattern:{low:2.5,high:4.5,period:4}})],o=1.75,s=i.map(e=>e.map(([e,t])=>({x:e,low:t-.5*o,high:t+.5*o}))),{lines:c,areas:p}=this.createRangeArea(this.root,s,this.size,this.padding);this.lines=c,this.areas=p,this.updateColors(n,r)}updateColors(e,t){e=swapArrayItems(e,1,2),t=swapArrayItems(t,1,2),this.lines.forEach(([e,n],r)=>{e.fill=void 0,e.stroke=t[r],n.fill=void 0,n.stroke=t[r]}),this.areas.forEach((t,n)=>{t.fill=e[n]})}createRangeArea(e,t,n,r){let i=t.reduce((e,t)=>t.reduce((e,{x:t})=>Math.min(e,t),e),1/0),o=t.reduce((e,t)=>t.reduce((e,{x:t})=>Math.max(e,t),e),-1/0),s=t.reduce((e,t)=>t.reduce((e,{low:t})=>Math.min(e,t),e),1/0),c=t.reduce((e,t)=>
183t.reduce((e,{high:t})=>Math.max(e,t),e),-1/0),{_Scene:p}=this.agChartsExports,m=new p.LinearScale;m.domain=[i,o],m.range=[r,n-r];let h=2*r,g=new p.LinearScale;g.domain=[s,c],g.range=[n-h,h];let _=[],v=[];return t.map(e=>{let t=new p.Path,n=new p.Path,r=new p.Path;return _.push([t,n]),v.push(r),t.strokeWidth=0,n.strokeWidth=0,r.strokeWidth=0,r.fillOpacity=.8,t.path.clear(),n.path.clear(),r.path.clear(),e.map((e,i)=>{let{x:o,low:s,high:c}=e,p=m.convert(o),h=g.convert(s),_=g.convert(c),v=i>0?`lineTo`:`moveTo`;return t.path[v](p,_),n.path[v](p,h),r.path[v](p,_),[p,h]})}).forEach((e,t)=>{let n=e.length-1,r=v[t];for(let t=n;t>=0;t--){let[n,i]=e[t];r.path.lineTo(n,i)}}),e.append(v.concat(..._)),{lines:_,areas:v}}};function zigzag(e){let{offset:t,length:n,pattern:r}=e,i=getZigzagInflectionPoints(t,n,r),o=n;return(i.length===0||i[0][0]!==0)&&i.unshift(getZigzagPoint(0,t,r)),i[i.length-1][0]!==o&&i.push(getZigzagPoint(o,t,r)),i;function getZigzagInflectionPoints(e,t,n){let{period:r}=n,i=e/r,o=[0,.5].map(e=>e-i).map(getRemainderAbs).sort((e,t)=>e-t);return Array.from({length:Math.floor(o.length*(r/t))},(e,t)=>o[t%o.length]+Math.floor(t/o.length)).map(e=>e*r).map(t=>getZigzagPoint(t,e,n))}function getZigzagPoint(e,t,n){return[e,getZigzagValue(t+e,n)]}function getZigzagValue(e,t){let{low:n,high:r,period:i}=t,o=getRemainderAbs(e/i),s=o>.5?1-2*(o-.5):2*o;return n+(r-n)*s}}function getRemainderAbs(e){let t=e%1;return t<0?t+1:t}function swapArrayItems(e,t,n){let r=[...e],i=r[t];return r[t]=r[n],r[n]=i,r}var Ob={chartType:`rangeArea`,miniChart:MiniRangeAreaClass},MiniBoxPlotClass=class extends MiniChartWithAxes{constructor(e,t,n,r,i){super(e,t,`boxPlotTooltip`);let{size:o,padding:s,agChartsExports:{_Scene:c}}=this,p=[11,11.5,10.5],m=1.2,h=.8,g=new c.LinearScale;g.domain=[p.reduce((e,t)=>Math.min(e,t),1/0)*h,p.reduce((e,t)=>Math.max(e,t),0)*m],g.range=[o-1.5*s,s];let _=new c.CategoryScale;_.domain=p.map((e,t)=>t),_.range=[s,o-s],_.paddingInner=.4,_.paddingOuter=.2;let v=Math.round(_.bandwidth),y=Math.round(_.bandwidth/2);this.boxPlotGroups=p.map((e,t)=>{let[n,r,i,o]=[e*h,e*.9,e*1.1,e*m],s=Math.round(g.convert(i)),p=Math.round(_.convert(t)),b=Math.round(p+v),x=Math.round(g.convert(r)),S=Math.round(g.convert(n)),C=Math.round(g.convert(e)),w=Math.round(g.convert(o)),T=p+y,E=new c.Group,D=new c.Rect,O=new c.Line,k=new c.Line,ee=new c.Line,te=new c.Line,A=new c.Line;return D.x=p,D.y=s,D.width=v,D.height=x-s,D.strokeWidth=1,D.strokeOpacity=.75,D.crisp=!0,this.setLineProperties(O,p,b,C,C),this.setLineProperties(k,T,T,w,s),this.setLineProperties(ee,T,T,S,x),this.setLineProperties(te,p,b,w,w),this.setLineProperties(A,p,b,S,S),E.append([D,O,k,ee,te,A]),E}),this.updateColors(n,r,i),this.root.append(this.boxPlotGroups)}updateColors(e,t,n){let{_Theme:r}=this.agChartsExports;this.boxPlotGroups.forEach((i,o)=>{for(let s of i.children()){let i=e[o%e.length];s.fill=n?i:r.resolveOperation({$mix:[i,{$ref:`backgroundColor`},.7]}),s.stroke=t[o%t.length]}})}setLineProperties(e,t,n,r,i){e.x1=t,e.x2=n,e.y1=r,e.y2=i,e.strokeOpacity=.75}},kb={chartType:`boxPlot`,miniChart:MiniBoxPlotClass},MiniTreemapClass=class extends MiniChart{constructor(e,t,n,r,i){super(e,t,`treemapTooltip`);let{size:o,padding:s,agChartsExports:{_Scene:c}}=this,p=[[1,1],[3,2,1]],m=p.length%2==0?.3:.2,h=[s,o-s],g=p.length,_=g*(g+1)/2,v=m/(g-1),y=h[1]-h[0],b=y-m,x=h[0];this.rects=p.reduce((e,t,n)=>{e??=[];let r=(g-n)/_,i=b*r,o=t.length,s=t.reduce((e,t)=>e+t,0),p=m/(o-1||1),S=o>1?y-m:y,C=h[0],w=t.map(e=>{let t=new c.Rect,n=S*e/s;return t.x=x,t.y=C,t.width=i,t.height=n,t.strokeWidth=.75,t.crisp=!0,C+=n+p,t});return x+=i+v,e.push(...w),e},[]),this.updateColors(n,r,i);let S=new c.Group;S.setClipRect(new c.BBox(s,s,o-s,o-s)),S.append(this.rects),this.root.append(S)}updateColors(e,t,n){let{_Theme:r}=this.agChartsExports;this.rects.forEach((i,o)=>{i.fill=e[o%t.length],i.stroke=n?t[o%t.length]:r.resolveOperation({$ref:`backgroundColor`})})}},Ab={chartType:`treemap`,miniChart:MiniTreemapClass},MiniSunburstClass=class extends MiniChartWithPolarAxes{constructor(e,t,n,r){super(e,t,`sunburstTooltip`),this.data=[[[],[]],[[],[]],[[],[]]],this.angleOffset=-Math.PI/2,this.innerRadiusRatio=0,this.showRadiusAxisLine=!1,this.showAngleAxisLines=!1;let{data:i,size:o,padding:s,angleOffset:c,innerRadiusRatio:p,agChartsExports:{_Scene:m}}=this,h=(o-s*2)/2,g=[c+0,c+2*Math.PI],_=Math.abs(g[1]-g[0]),v=[h*p,h],y=Math.abs(v[1]-v[0]),b=0,findMaxDepth=(e,t)=>{for(let n of e){let e=t+1;b=Math.max(b,e),findMaxDepth(n,e)}};findMaxDepth(i,0);let x=y/b,S=this.size/2,C=g[0];this.series=[];let createSectors=(e,t,n,r,i)=>{if(!Array.isArray(e))return;let o=t+1,s=n;e.forEach((e,n,c)=>{let p=i;p||(p=new m.Group,this.series.push(p));let h=v[0]+t*x,g=v[0]+o*x,_=1/c.length,y=s,b=y+r*_,C=new m.Sector;C.centerX=S,C.centerY=S,C.innerRadius=h,C.outerRadius=g,C.startAngle=y,C.endAngle=b,C.stroke=void 0,C.strokeWidth=0,C.inset=.75,s=b,p.append(C),createSectors(e,o,y,Math.abs(b-y),p)})};createSectors(i,0,C,_),this.root.append(this.series),this.updateColors(n,r)}
183updateColors(e,t){this.series.forEach((n,r)=>{for(let i of n.children())i.fill=e[r%e.length],i.stroke=t[r%t.length]})}},jb={chartType:`sunburst`,miniChart:MiniSunburstClass},MiniHeatmapClass=class extends MiniChart{constructor(e,t,n,r,i){super(e,t,`heatmapTooltip`);let{size:o,padding:s,agChartsExports:{_Scene:c}}=this,p=Array.from({length:3},(e,t)=>Array.from({length:3},(e,t)=>t)),m=p.map((e,t)=>t),h=new c.CategoryScale;h.domain=m,h.range=[s,o-s],h.paddingInner=.01,h.paddingOuter=.1;let g=new c.CategoryScale;g.domain=m,g.range=[s,o-s],g.paddingInner=.01,g.paddingOuter=.1;let _=h.bandwidth??0,v=g.bandwidth??0;this.rects=p.reduce((e,t,n)=>{e??=[];let r=t.map((e,t)=>{let r=new c.Rect;return r.x=h.convert(n),r.y=g.convert(t),r.width=_,r.height=v,r.strokeWidth=0,r.crisp=!0,r});return e.push(...r),e},[]),this.updateColors(n,r,i);let y=new c.Group;y.setClipRect(new c.BBox(s,s,o-s,o-s)),y.append(this.rects),this.root.append(y)}updateColors(e,t,n){let{_Theme:r,_Util:i}=this.agChartsExports,o=n?[e[0],e[1]]:r.resolveOperation({$palette:`divergingColors`}),s=n?t[0]:r.resolveOperation({$ref:`backgroundColor`}),c=i.interpolateColor(o[0],o[1]);this.rects.forEach((e,t)=>{e.fill=c(t*.2),e.stroke=s})}},Mb={chartType:`heatmap`,miniChart:MiniHeatmapClass},MiniWaterfallClass=class extends MiniChartWithAxes{constructor(e,t,n,r,i){super(e,t,`waterfallTooltip`),this.data=[4,3,-3,6,-3],this.bars=this.createWaterfall(this.root,this.data,this.size,this.padding,`vertical`).bars,this.updateColors(n,r,i)}updateColors(e,t,n){let{data:r,agChartsExports:{_Theme:i}}=this,o={fill:n?e[0]:i.resolveOperation({$palette:`altUp.fill`}),stroke:n?t[0]:i.resolveOperation({$palette:`altUp.stroke`})},s={fill:n?e[1]:i.resolveOperation({$palette:`altDown.fill`}),stroke:n?t[1]:i.resolveOperation({$palette:`altDown.stroke`})};this.bars.forEach((e,t)=>{let n=r[t]>=0;e.fill=n?o.fill:s.fill,e.stroke=n?o.stroke:s.stroke})}createWaterfall(e,t,n,r,i){let o=2*r,{processedData:s,min:c,max:p}=accumulateData(t.map(e=>[e])),m=s.reduce((e,t)=>e.concat(t),[]),{_Scene:h}=this.agChartsExports,g=new h.LinearScale;g.domain=[Math.min(c,0),p],g.range=[n-o,o];let _=new h.CategoryScale;_.domain=t.map((e,t)=>t),_.range=[r,n-r],_.paddingInner=.2,_.paddingOuter=.3;let v=_.bandwidth,y=new h.Path;y.stroke=`#575757`,y.strokeWidth=0;let b=Math.floor(y.strokeWidth)%2/2,x=y.path;x.clear();let S=i===`horizontal`,C=m.map((e,n)=>{let r=n>0?m[n-1]:0,i=t[n]>0,o=Math.round(g.convert(e)),s=Math.round(g.convert(r)),c=(i?o:s)-b,p=(i?s:o)+b,y=Math.abs(p-c),C=_.convert(n),w=new h.Rect;w.x=S?c:C,w.y=S?C:c,w.width=S?y:v,w.height=S?v:y,w.strokeWidth=0,w.crisp=!0;let T=o+b,E=s+b;if(n>0){let e=S?E:w.x,t=S?w.y:E;x.lineTo(e,t)}let D=S?T:w.x,O=S?w.y:T;return x.moveTo(D,O),w});return e.append([y,...C]),{bars:C}}},Nb={chartType:`waterfall`,miniChart:MiniWaterfallClass},MiniColumnLineComboClass=class extends MiniChartWithAxes{constructor(e,t,n,r){super(e,t,`columnLineComboTooltip`),this.columnData=[3,4],this.lineData=[[5,4,6,5,4]];let{root:i,columnData:o,lineData:s,size:c,padding:p}=this;this.columns=createColumnRects({stacked:!1,root:i,data:o,size:c,padding:p,xScaleDomain:[0,1],yScaleDomain:[0,4],xScalePadding:.5,agChartsExports:t}),i.append(this.columns),this.lines=createLinePaths(t,i,s,c,p),this.updateColors(n,r)}updateColors(e,t){this.columns.forEach((n,r)=>{n.fill=e[r],n.stroke=t[r]}),this.lines.forEach((t,n)=>{t.stroke=e[n+2]})}},Pb={chartType:`columnLineCombo`,miniChart:MiniColumnLineComboClass},MiniAreaColumnComboClass=class extends MiniChartWithAxes{constructor(e,t,n,r){super(e,t,`areaColumnComboTooltip`),this.columnData=[3,4.5],this.areaData=[[5,4,6,5,4]];let{root:i,columnData:o,areaData:s,size:c,padding:p,agChartsExports:{_Scene:m}}=this;this.columns=createColumnRects({stacked:!1,root:i,data:o,size:c,padding:p,xScaleDomain:[0,1],yScaleDomain:[0,6],xScalePadding:.5,agChartsExports:t});let h=new m.CategoryScale;h.range=[p,c-p],h.domain=[0,1,2,3,4],h.paddingInner=1,h.paddingOuter=0;let g=new m.LinearScale;g.range=[c-p,p],g.domain=[0,6];let _=[],v=g.convert(0),y=h.convert(0);s.forEach((e,t)=>{let n=_[t]||(_[t]=[]);e.forEach((e,t)=>{let r=e,i=t,o=h.convert(i),s=g.convert(r);n[t]={x:o,y:s}});let r=h.convert(e.length-1);_[t].push({x:r,y:v},{x:y,y:v})}),this.areas=_.map(e=>{let t=new m.Path;t.strokeWidth=0,t.fillOpacity=.8;let n=t.path;return e.forEach((e,t)=>n[t>0?`lineTo`:`moveTo`](e.x,e.y)),t});let b=new m.Group;b.setClipRect(new m.BBox(p,p,c-p*2,c-p*2));let x=new m.Group;x.setClipRect(new m.BBox(p,p,c-p*2,c-p*2)),b.append(this.areas),x.append(this.columns),i.append(b),i.append(x),this.updateColors(n,r)}updateColors(e,t){this.areas.forEach((n,r)=>{n.fill=e[r],n.stroke=t[r]}),this.columns.forEach((n,r)=>{n.fill=e[r+1],n.stroke=t[r+1]})}},Fb={chartType:`areaColumnCombo`,miniChart:MiniAreaColumnComboClass}
183,MiniCustomComboClass=class extends MiniChart{constructor(e,t,n,r){super(e,t,`customComboTooltip`),this.columnData=[3,4],this.lineData=[[5,4,6,5,4]];let{root:i,columnData:o,lineData:s,size:c,padding:p,agChartsExports:{_Scene:m}}=this;this.columns=createColumnRects({stacked:!1,root:i,data:o,size:c,padding:p,xScaleDomain:[0,1],yScaleDomain:[0,4],xScalePadding:.5,agChartsExports:t}),i.append(this.columns),this.lines=createLinePaths(this.agChartsExports,i,s,c,p);let h=`grey`,g=new m.Line;g.x1=p,g.y1=p,g.x2=p,g.y2=c-p+3,g.stroke=h;let _=new m.Line;_.x1=p-3+1,_.y1=c-p,_.x2=c-p+1,_.y2=c-p,_.stroke=h;let v=new m.Path;this.buildPenIconPath(v),v.fill=`whitesmoke`,v.stroke=`darkslategrey`,v.strokeWidth=1,i.append([_,g,v]),this.updateColors(n,r)}updateColors(e,t){this.columns.forEach((n,r)=>{n.fill=e[r],n.stroke=t[r]}),this.lines.forEach((t,n)=>{t.stroke=e[n+2]})}buildPenIconPath(e){let{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)}},Ib={columnGroup:{column:{range:!0,pivot:!0,enterprise:!1,icon:Jy},stackedColumn:{range:!0,pivot:!0,enterprise:!1,icon:Xy},normalizedColumn:{range:!0,pivot:!0,enterprise:!1,icon:Qy}},barGroup:{bar:{range:!0,pivot:!0,enterprise:!1,icon:$y},stackedBar:{range:!0,pivot:!0,enterprise:!1,icon:tb},normalizedBar:{range:!0,pivot:!0,enterprise:!1,icon:rb}},pieGroup:{pie:{range:!0,pivot:!0,enterprise:!1,icon:ab},donut:{range:!0,pivot:!0,enterprise:!1,icon:ib},doughnut:{range:!0,pivot:!0,enterprise:!1,icon:ib}},lineGroup:{line:{range:!0,pivot:!0,enterprise:!1,icon:sb},stackedLine:{range:!0,pivot:!0,enterprise:!1,icon:ub},normalizedLine:{range:!0,pivot:!0,enterprise:!1,icon:fb}},scatterGroup:{scatter:{range:!0,pivot:!0,enterprise:!1,icon:pb},bubble:{range:!0,pivot:!0,enterprise:!1,icon:mb}},areaGroup:{area:{range:!0,pivot:!0,enterprise:!1,icon:gb},stackedArea:{range:!0,pivot:!0,enterprise:!1,icon:vb},normalizedArea:{range:!0,pivot:!0,enterprise:!1,icon:bb}},polarGroup:{radarLine:{range:!0,pivot:!1,enterprise:!0,icon:wb},radarArea:{range:!0,pivot:!1,enterprise:!0,icon:Tb},nightingale:{range:!0,pivot:!1,enterprise:!0,icon:Eb},radialColumn:{range:!0,pivot:!1,enterprise:!0,icon:Sb},radialBar:{range:!0,pivot:!1,enterprise:!0,icon:Cb}},statisticalGroup:{boxPlot:{range:!0,pivot:!1,enterprise:!0,icon:kb},histogram:{range:!0,pivot:!1,enterprise:!1,icon:xb},rangeBar:{range:!0,pivot:!1,enterprise:!0,icon:Db},rangeArea:{range:!0,pivot:!1,enterprise:!0,icon:Ob}},hierarchicalGroup:{treemap:{range:!0,pivot:!0,enterprise:!0,icon:Ab},sunburst:{range:!0,pivot:!0,enterprise:!0,icon:jb}},specializedGroup:{heatmap:{range:!0,pivot:!1,enterprise:!0,icon:Mb},waterfall:{range:!0,pivot:!1,enterprise:!0,icon:Nb}}
183,combinationGroup:{columnLineCombo:{range:!0,pivot:!0,enterprise:!1,icon:Pb},areaColumnCombo:{range:!0,pivot:!0,enterprise:!1,icon:Fb},customCombo:{range:!0,pivot:!0,enterprise:!1,icon:{chartType:`customCombo`,miniChart:MiniCustomComboClass}}},funnelGroup:{funnel:{range:!0,pivot:!1,enterprise:!0,icon:Uy},coneFunnel:{range:!0,pivot:!1,enterprise:!0,icon:Gy},pyramid:{range:!0,pivot:!1,enterprise:!0,icon:qy}}},Lb={columnGroup:[`column`,`stackedColumn`,`normalizedColumn`],barGroup:[`bar`,`stackedBar`,`normalizedBar`],pieGroup:[`pie`,`donut`],lineGroup:[`line`,`stackedLine`,`normalizedLine`],areaGroup:[`area`,`stackedArea`,`normalizedArea`],scatterGroup:[`scatter`,`bubble`],polarGroup:[`radarLine`,`radarArea`,`nightingale`,`radialColumn`,`radialBar`],statisticalGroup:[`boxPlot`,`histogram`,`rangeBar`,`rangeArea`],hierarchicalGroup:[`treemap`,`sunburst`],specializedGroup:[`heatmap`,`waterfall`],funnelGroup:[`funnel`,`coneFunnel`,`pyramid`],combinationGroup:[`columnLineCombo`,`areaColumnCombo`,`customCombo`]},MiniChartsContainer=class extends K{constructor(e,t,n,r,i=Lb){super(`<div class="ag-chart-settings-mini-wrapper"></div>`),this.wrappers=new Map,this.chartController=e,this.fills=t,this.strokes=n,this.isCustomTheme=r,this.chartGroups={...i}}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){!this.chartController.customComboExists()&&this.chartGroups.combinationGroup&&(this.chartGroups.combinationGroup=this.chartGroups.combinationGroup.filter(e=>e!==`customCombo`));let e=this.getGui(),t=this.chartController.isEnterprise(),n=this.chartController.isPivotChart(),r=!n,i=Object.keys(this.chartGroups).map(e=>{let i=e in Ib?Ib[e]:void 0;if(!i)return q(148,{group:e}),null;let o=(this.chartGroups[e]??[]).map(o=>{let s=o in i?i[o]:void 0;return s?!t&&s.enterprise?null:r&&s.range||n&&s.pivot?s:null:(q(149,{group:e,chartType:o}),null)}).filter(e=>e!=null);return o.length===0?null:{label:this.chartTranslation.translate(e),items:o}}).filter(e=>e!=null);for(let{label:t,items:n}of i){let r=this.createBean(new AgGroupComponent({title:t,suppressEnabledCheckbox:!0,enabled:!0,suppressOpenCloseIcons:!0,cssIdentifier:`charts-settings`,direction:`horizontal`,suppressKeyboardNavigation:!0}));for(let e of n){let{miniChart:t,chartType:n}=e.icon,i=document.createElement(`div`);i.classList.add(`ag-chart-mini-thumbnail`),i.setAttribute(`tabindex`,`0`),i.setAttribute(`role`,`button`);let o=n,listener=()=>{this.chartController.setChartType(o),this.updateSelectedMiniChart()};this.addManagedListeners(i,{click:listener,keydown:e=>{(e.key==G.ENTER||e.key===G.SPACE)&&(e.preventDefault(),listener())}}),this.wrappers.set(o,i),this.createBean(new t(i,this.beans.agChartsExports,this.fills,this.strokes,this.isCustomTheme)),r.addItem(i)}e.appendChild(r.getGui())}this.updateSelectedMiniChart()}updateSelectedMiniChart(){let e=this.chartController.getChartType();this.wrappers.forEach((t,n)=>{let r=n===e;t.classList.toggle(`ag-selected`,r);let i=this.chartTranslation.translate(getFullChartNameTranslationKey(n)),o=r?`${i}. ${this.chartTranslation.translate(`ariaChartSelected`)}`:i;ou(t,o)})}destroy(){this.wrappers.clear(),super.destroy()}},ChartSettingsPanel=class extends K{constructor(e){super(`<div class="ag-chart-settings-wrapper">
184            <div data-ref="eMiniChartsContainer" class="ag-chart-settings-mini-charts-container ag-scrollable-container"></div>
185            <div data-ref="eNavBar" class="ag-chart-settings-nav-bar">
186                <div data-ref="ePrevBtn" class="ag-chart-settings-prev">
187                    <button type="button" class="ag-button ag-chart-settings-prev-button"></button>
188                </div>
189                <div data-ref="eCardSelector" class="ag-chart-settings-card-selector"></div>
190                <div data-ref="eNextBtn" class="ag-chart-settings-next">
191                    <button type="button" class="ag-button ag-chart-settings-next-button"></button>
192                </div>
193            </div>
194        </div>`),this.chartController=e,this.eMiniChartsContainer=null,this.eNavBar=null,this.eCardSelector=null,this.ePrevBtn=null,this.eNextBtn=null,this.miniChartsContainers=[],this.cardItems=[],this.activePaletteIndex=0,this.palettes=[],this.themes=[]}postConstruct(){this.resetPalettes();let e=this.gos.get(`enableRtl`);this.ePrevBtn.insertAdjacentElement(`afterbegin`,J(e?`chartsThemeNext`:`chartsThemePrevious`,this.beans)),this.eNextBtn.insertAdjacentElement(`afterbegin`,J(e?`chartsThemePrevious`:`chartsThemeNext`,this.beans)),this.addManagedElementListeners(this.ePrevBtn,{click:()=>
vendor: 8,340 bytes, line 194
194this.setActivePalette(this.getPrev(),`left`)}),this.addManagedElementListeners(this.eNextBtn,{click:()=>this.setActivePalette(this.getNext(),`right`)});let reset=()=>this.resetPalettes(!0);this.addManagedListeners(this.chartController,{chartTypeChanged:reset,chartApiUpdate:reset}),this.scrollSelectedIntoView()}scrollSelectedIntoView(){setTimeout(()=>{let isMiniChartsContainerVisible=e=>!e.getGui().classList.contains(`ag-hidden`),e=this.miniChartsContainers.find(isMiniChartsContainerVisible).getGui().querySelector(`.ag-selected`);if(e){let t=e.offsetParent;t&&this.eMiniChartsContainer.scrollTo(0,t.offsetTop)}},250)}resetPalettes(e){let t=this.chartController.getPalettes(),n=this.gos.get(`chartToolPanelsDef`)?.settingsPanel?.chartGroupsDef;if(pa(t,this.palettes)&&!e||this.isAnimating)return;this.palettes=t,this.themes=this.chartController.getThemeNames(),this.activePaletteIndex=this.themes.findIndex(e=>e===this.chartController.getChartThemeName()),this.cardItems=[],Ml(this.eCardSelector),this.destroyMiniCharts();let{themes:r}=this;this.palettes.forEach((e,t)=>{let i=this.activePaletteIndex===t,{fills:o=[],strokes:s=[]}=e,c=r[t],p=!isStockTheme(c,this.beans.agChartsExports._Theme),m=this.createBean(new MiniChartsContainer(this.chartController,o,s,p,n));this.miniChartsContainers.push(m),this.eMiniChartsContainer.appendChild(m.getGui()),this.addCardLink(t),i?m.updateSelectedMiniChart():m.setDisplayed(!1)}),W(this.eNavBar,this.palettes.length>1),Rs(this.cardItems[this.activePaletteIndex],`ag-selected`,`ag-not-selected`)}addCardLink(e){let t=document.createElement(`div`);t.classList.add(`ag-chart-settings-card-item`),this.addManagedElementListeners(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;Rs(this.cardItems[e],`ag-selected`,`ag-not-selected`);let n=this.miniChartsContainers[this.activePaletteIndex],r=n.getGui(),i=this.miniChartsContainers[e],o=i.getGui();n.updateSelectedMiniChart(),i.updateSelectedMiniChart();let s=t===`left`?-1:1,c=o.style.left=`${Do(this.getGui())*s}px`;this.activePaletteIndex=e,this.isAnimating=!0;let p=`ag-animating`;i.setDisplayed(!0),n.addCss(p),i.addCss(p),this.chartController.setChartThemeName(this.themes[e]),window.setTimeout(()=>{r.style.left=`${-parseFloat(c)}px`,o.style.left=`0px`},0),window.setTimeout(()=>{this.isAnimating=!1,n.removeCss(p),i.removeCss(p),n.setDisplayed(!1)},300)}destroyMiniCharts(){Ml(this.eMiniChartsContainer),this.miniChartsContainers=this.destroyBeans(this.miniChartsContainers)}destroy(){this.destroyMiniCharts(),super.destroy()}},Rb=`data`,zb=`format`,TabbedChartMenu=class extends K{constructor(e,t){super(),this.panels=e,this.chartMenuContext=t,this.tabs=[]}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){for(let e of this.panels){let t=e.replace(`chart`,``).toLowerCase(),n=this.createPanel(t),r=this.createTab(e,t,n);this.tabs.push(r),this.addDestroyFunc(()=>this.destroyBean(n))}this.tabbedLayout=new TabbedLayout({items:this.tabs,cssClass:`ag-chart-tabbed-menu`,keepScrollPosition:!0,suppressFocusBodyOnOpen:!0,suppressTrapFocus:!0,enableCloseButton:!0,closeButtonAriaLabel:this.chartTranslation.translate(`ariaChartMenuClose`),onCloseClicked:()=>{this.eventSource?.focus({preventScroll:!0}),this.dispatchLocalEvent({type:`closed`})}}),this.createBean(this.tabbedLayout)}createTab(e,t,n){let r=Dl({tag:`div`,cls:`ag-chart-tab ag-chart-${t}`});this.createBean(n),r.appendChild(n.getGui());let i=this.chartTranslation.translate(t);return{title:Dl({tag:`div`,children:i}),titleLabel:i,bodyPromise:eo.resolve(r),getScrollableContainer:()=>r.querySelector(`.ag-scrollable-container`)||r,name:e}}showTab(e){let t=this.tabs[e];this.tabbedLayout.showItem(t)}getGui(){return this.tabbedLayout?.getGui()}showMenu(e,t){this.eventSource=e,t||this.tabbedLayout?.focusHeader(!0)}destroy(){this.parentComponent?.isAlive()&&this.destroyBean(this.parentComponent),super.destroy()}createPanel(e){switch(e){case Rb:return new ChartDataPanel(this.chartMenuContext);case zb:return new FormatPanel(this.chartMenuContext);default:return new ChartSettingsPanel(this.chartMenuContext.chartController)}}},ChartMenu=class extends K{constructor(e,t,n){super(`<div class="ag-chart-menu-wrapper"></div>`),this.eChartContainer=e,this.eMenuPanelContainer=t,this.chartMenuContext=n,this.buttons={chartLink:{iconName:`linked`,callback:()=>this.chartMenuSvc.toggleLinked(this.chartMenuContext)},chartUnlink:{iconName:`unlinked`,callback:()=>this.chartMenuSvc.toggleLinked(this.chartMenuContext)},chartDownload:{iconName:`chartsDownload`,callback:()=>this.chartMenuSvc.downloadChart(this.chartMenuContext)},chartMenu:{iconName:`chartsMenu`,callback:e=>this.showMenuList(e)}},this.panels=[],this.menuVisible=!1,this.chartController=n.chartController}wireBeans(e){this.chartMenuSvc=e.chartMenuSvc,this.chartMenuListFactory=e.chartMenuListFactory}postConstruct(){this.chartToolbar=this.createManagedBean(new ChartToolbar),this.getGui().appendChild(this.chartToolbar.getGui()),this.refreshToolbarAndPanels(),this.addManagedEventListeners({chartCreated:e=>{e.chartId===this.chartController.getChartId()&&this.gos.get(`chartToolPanelsDef`)?.defaultToolPanel&&this.showMenu({panel:this.defaultPanel,suppressFocus:!0})}}),this.addManagedListeners(this.chartController,{chartLinkedChanged:this.refreshToolbarAndPanels.bind(this)}),this.refreshMenuClasses(),this.addManagedListeners(this.chartController,{chartApiUpdate:this.refreshToolbarAndPanels.bind(this)})}isVisible(){return this.menuVisible}getExtraPaddingDirections(){return[`chartMenu`,`chartLink`,`chartUnlink`,`chartDownload`].some(e=>this.chartToolbarOptions.includes(e))?[`top`]:[]}refreshToolbarAndPanels(){this.initToolbarOptionsAndPanels(),this.updateToolbar()}initToolbarOptionsAndPanels(){let{panels:e,defaultPanel:t}=this.chartMenuSvc.getChartToolPanels(this.chartController);this.panels=e,this.defaultPanel=t,this.chartToolbarOptions=this.chartMenuSvc.getChartToolbarOptions()}updateToolbar(){let e=this.chartToolbarOptions.map(e=>{let{iconName:t,callback:n}=this.buttons[e];return{buttonName:e,iconName:t,callback:n}});this.chartToolbar.updateParams({buttons:e})}createMenuPanel(e){let t=this.menuPanel=this.createBean(new AgPanel({height:`100%`,closable:!0,hideTitleBar:!0,cssIdentifier:`chart-menu`}));return t.setParentComponent(this),this.eMenuPanelContainer.appendChild(t.getGui()),this.tabbedMenu=this.createBean(new TabbedChartMenu(this.panels,this.chartMenuContext)),this.addManagedListeners(this.tabbedMenu,{closed:()=>{this.hideMenu()}}),this.addManagedListeners(t,{destroyed:()=>this.destroyBean(this.tabbedMenu)}),new eo(n=>{window.setTimeout(()=>{t.setBodyComponent(this.tabbedMenu),this.tabbedMenu.showTab(e),n(t)},100)})}showContainer(e,t){this.menuPanel&&(this.menuVisible=!0,this.refreshMenuClasses(),this.tabbedMenu.showMenu(e,t))}showMenu(e){let{panel:t,eventSource:n,suppressFocus:r}=e??{};if(this.menuPanel&&!t)this.showContainer(n,r);else{let e=t||this.defaultPanel,i=this.panels.indexOf(e);i<0&&(q(143,{panel:t}),i=this.panels.indexOf(this.defaultPanel)),this.menuPanel?(this.tabbedMenu.showTab(i),this.showContainer(n,r)):this.createMenuPanel(i).then(()=>this.showContainer(n,r))}}hideMenu(){this.menuVisible=!1,this.refreshMenuClasses()}refreshMenuClasses(){this.eChartContainer.classList.toggle(`ag-chart-menu-visible`,this.menuVisible),this.eChartContainer.classList.toggle(`ag-chart-menu-hidden`,!this.menuVisible)}showMenuList(e){this.chartMenuListFactory.showMenuList({eventSource:e,showMenu:()=>this.showMenu({eventSource:e}),chartMenuContext:this.chartMenuContext})}destroy(){super.destroy(),this.menuPanel?.isAlive()&&this.destroyBean(this.menuPanel),this.tabbedMenu?.isAlive()&&this.destroyBean(this.tabbedMenu)}},Bb=[`number`,`category`,`time`,`grouped-category`],Vb=[`angle-category`,`angle-number`,`radius-category`,`radius-number`],Hb=[...Bb,...Vb],ChartOptionsService=class extends U{constructor(e){super(),this.chartController=e}getChartThemeOverridesProxy(){return{getValue:e=>this.getChartOption(e),setValue:(e,t)=>
194this.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,n)=>this.setCartesianAxisOptions(e,[{expression:t,value:n}]),setValues:t=>this.setCartesianAxisOptions(e,t)}}getCartesianAxisThemeOverridesProxy(e){return{getValue:t=>this.getCartesianAxisProperty(e,t),setValue:(t,n)=>this.setCartesianAxisThemeOverrides(e,[{expression:t,value:n}]),setValues:t=>this.setCartesianAxisThemeOverrides(e,t)}}getCartesianAxisAppliedThemeOverridesProxy(e){return{getValue:t=>this.getCartesianAxisThemeOverride(e,t===`*`?null:t),setValue:(t,n)=>this.setCartesianAxisThemeOverrides(e,[{expression:t===`*`?null:t,value:n}]),setValues:t=>this.setCartesianAxisThemeOverrides(e,t)}}getSeriesOptionsProxy(e){return{getValue:(t,n)=>this.getSeriesOption(e(),t,n),setValue:(t,n)=>this.setSeriesOptions(e(),[{expression:t,value:n}]),setValues:t=>this.setSeriesOptions(e(),t)}}getPersistedChartThemeOverrides(e,t,n,r){let i=this.getRetainedChartThemeOverrideKeys(n,r),o=this.getRetainedChartAxisThemeOverrideKeys(null,n,r),s=this.createChartOptions();for(let t of i){let i=this.retrieveChartOptionsThemeOverride(e,n,t);i!==void 0&&this.assignChartOptionsThemeOverride(s,r,t,i)}return t&&this.assignPersistedAxisOverrides({existingAxes:t,retainedChartAxisThemeOverrideKeys:o,existingChartOptions:e,targetChartOptions:s,existingChartType:n,targetChartType:r}),s.theme.overrides}assignPersistedAxisOverrides(e){let{existingAxes:t,retainedChartAxisThemeOverrideKeys:n,existingChartOptions:r,targetChartOptions:i,existingChartType:o,targetChartType:s}=e;for(let{expression:e,targetAxisTypes:c}of n)for(let n of t.map(e=>e.type)){let t=this.retrieveChartOptionsThemeOverride(r,o,[`axes`,n,e].join(`.`));if(t!==void 0)for(let n of c)this.assignChartOptionsThemeOverride(i,s,[`axes`,n,e].join(`.`),t)}}getRetainedChartThemeOverrideKeys(e,t){let n=[`animation`],r=[`zoom`,`navigator`],i=((e,t)=>{let n=[];return isCartesian(getSeriesType(e))&&isCartesian(getSeriesType(t))&&n.push(...r),n})(e,t);return[...n,...i]}getRetainedChartAxisThemeOverrideKeys(e,t,n){return isCartesian(getSeriesType(t))&&isCartesian(getSeriesType(n))?this.getRetainedCartesianAxisThemeOverrideKeys(e).map(e=>({expression:e,targetAxisTypes:Bb})):[]}getRetainedCartesianAxisThemeOverrideKeys(e){let t=e===`xAxis`?[``,`.top`,`.bottom`]:e===`yAxis`?[``,`.left`,`.right`]:[``,`.left`,`.right`,`.top`,`.bottom`],n=[`crosshair`],r=[];for(let e of n)for(let n of t)r.push(`${e}${n}`);return r}getChartOption(e){return get(this.getChart(),e,void 0)}setChartThemeOverrides(e){let t=this.getChartType(),n=this.createChartOptions();for(let{expression:r,value:i}of e)this.assignChartOptionsThemeOverride(n,t,r,i);this.applyChartOptions(n)}applyChartOptions(e,t){Object.keys(e).length!==0&&(this.updateChart(e),t?.silent||this.raiseChartOptionsChangedEvent())}awaitChartOptionUpdate(e){this.chartController.getChartProxy().getChart().waitForUpdate().then(()=>e()).catch(e=>Hl(108,{e}))}getAxisProperty(e){return get(this.getChart().axes?.[0],e,void 0)}setAxisThemeOverrides(e){let t=this.getChart(),n=this.getChartType(),r=this.createChartOptions();for(let{expression:i,value:o}of e){let e=t.axes?.filter(e=>{let t=i.split(`.`),n=e;for(let e of t){if(!(e in n))return!1;n=n[e]}return!0});if(e)for(let t of e)this.isValidAxisType(t)&&this.assignChartAxisThemeOverride(r,n,t.type,null,i,o)}this.applyChartOptions(r)}getCartesianAxisProperty(e,t){let n=this.getChartAxes();return get(this.getCartesianAxis(n,e),t,void 0)}getCartesianAxisThemeOverride(e,t){let n=this.getChartAxes(),r=this.getCartesianAxis(n,e);if(!r||!this.isValidAxisType(r))return;let i=this.getChartType(),o=this.getChart().getOptions();return this.retrieveChartAxisThemeOverride(o,i,r.type,e===`yAxis`?[`left`,`right`]:[`bottom`,`top`],t)}setCartesianAxisThemeOverrides(e,t){let n=this.getChartAxes(),r=this.getCartesianAxis(n,e);if(!r||!this.isValidAxisType(r))return;let i=this.getChartType(),o=this.createChartOptions();for(let{expression:n,value:s}of t)this.assignChartAxisThemeOverride(o,i,r.type,e===`yAxis`?[`left`,`right`]:[`bottom`,`top`],n,s);this.applyChartOptions(o)}setCartesianAxisOptions(e,t){this.updateCartesianAxisOptions(e,(e,n,r)=>{let i=n.indexOf(r);for(let{expression:n,value:r}of t)this.assignChartOption(e,`axes.${i}.${n}`,r)})}updateCartesianAxisOptions(e,t){let n=this.getChart().getOptions(),r=`axes`in n?n.axes:void 0;if(!n||!r)return;let i=this.getChartAxes(),o=this.getCartesianAxis(i,e);if(!o)return;let s=this.createChartOptions();s.axes=r,t(s,i,o,n),this.applyChartOptions(s)}setCartesianCategoryAxisType(e,t){this.updateCartesianAxisOptions(e,(n,r,i,o)=>{let s=this.getChartType();this.assignPersistedAxisOverrides({existingAxes:[i],retainedChartAxisThemeOverrideKeys:this.getRetainedChartAxisThemeOverrideKeys(e,s,s),existingChartOptions:o,targetChartOptions:n,existingChartType:s,targetChartType:s}),this.assignChartOption(n,`axes.0.type`,t),this.chartController.setCategoryAxisType(t)})}getCartesianAxis(e,t){if(!(e.length<2))switch(t){case`xAxis`:return e[0].direction===`x`?e[0]:e[1];case`yAxis`:return e[1].direction===`y`?e[1]:e[0]}}getSeriesOption(e,t,n){let r=this.getChart().series.find(t=>isMatchingSeries(e,t));return get(n?r:r?.properties.toJson(),t,void 0)}setSeriesOptions(e,t){let n=this.createChartOptions();for(let{expression:r,value:i}of t)this.assignChartOptionsSeriesThemeOverride(n,e,`series.${r}`,i);this.applyChartOptions(n)}getPairedMode(){return this.chartController.getChartProxy().isPaired()}setPairedMode(e){this.chartController.getChartProxy().setPaired(e)}getChartAxes(){return this.getChart().axes??[]}
194retrieveChartAxisThemeOverride(e,t,n,r,i){if(r)for(let o of r){let r=this.retrieveChartOptionsThemeOverride(e,t,[`axes`,n,o,...i?[i]:[]].join(`.`));if(r!==void 0)return r}else return this.retrieveChartOptionsThemeOverride(e,t,[`axes`,n,...i?[i]:[]].join(`.`))}assignChartAxisThemeOverride(e,t,n,r,i,o){if(r)for(let s of r)this.assignChartOptionsThemeOverride(e,t,[`axes`,n,s,...i?[i]:[]].join(`.`),o);else this.assignChartOptionsThemeOverride(e,t,[`axes`,n,...i?[i]:[]].join(`.`),o)}isValidAxisType(e){return Hb.includes(e.type)}getChartType(){return this.chartController.getChartType()}getChart(){return this.chartController.getChartProxy().getChart()}updateChart(e){let t=this.chartController.getChartProxy().getChartRef();t.skipAnimations(),t.updateDelta(e)}createChartOptions(){return{theme:{overrides:{}}}}retrieveChartOptionsThemeOverride(e,t,n){let r=this.getChartThemeOverridesSeriesTypeKeys(t);for(let t of r){let r=this.retrieveChartOptionsSeriesThemeOverride(e,t,n);if(r!==void 0)return r}}assignChartOptionsThemeOverride(e,t,n,r){let i=this.getChartThemeOverridesSeriesTypeKeys(t);for(let t of i)this.assignChartOptionsSeriesThemeOverride(e,t,n,r)}retrieveChartOptionsSeriesThemeOverride(e,t,n){return this.retrieveChartOption(e,[`theme`,`overrides`,t,...n?[n]:[]].join(`.`))}assignChartOptionsSeriesThemeOverride(e,t,n,r){this.assignChartOption(e,[`theme`,`overrides`,t,...n?[n]:[]].join(`.`),r)}getChartThemeOverridesSeriesTypeKeys(e){let t=this.chartController.getChartSeriesTypes(e);return this.chartController.isComboChart()&&t.push(`common`),t}retrieveChartOption(e,t){return get(e,t,void 0)}assignChartOption(e,t,n){set(e,t,n)}raiseChartOptionsChangedEvent(){let e=this.chartController.getChartModel();this.eventSvc.dispatchEvent({type:`chartOptionsChanged`,chartId:e.chartId,chartType:e.chartType,chartThemeName:this.chartController.getChartThemeName(),chartOptions:e.chartOptions})}};function isMatchingSeries(e,t){return isSeriesType(e)&&t.type===e}var GridChartComp=class extends K{constructor(e){super(`
195            <div style="height: 100%; width: 100%;">
196                <div class="ag-chart" data-ref="eWrapper">
197                    <div data-ref="eChartContainer" class="ag-chart-components-wrapper ag-chart-menu-hidden">
198                        <div data-ref="eChart" class="ag-chart-canvas-wrapper"></div>
199                        <div data-ref="eEmpty" class="ag-chart-empty-text ag-unselectable"></div>
200                    </div>
201                    <div data-ref="eMenuContainer" class="ag-chart-docked-container"></div>
202                </div>
203            </div>
204            `),this.eChart=null,this.eWrapper=null,this.eChartContainer=null,this.eMenuContainer=null,this.eEmpty=null,this.params=e}wireBeans(e){this.crossFilterService=e.chartCrossFilterSvc,this.chartTranslation=e.chartTranslation,this.chartMenuSvc=e.chartMenuSvc,this.focusSvc=e.focusSvc,this.popupSvc=e.popupSvc,this.enterpriseChartProxyFactory=e.enterpriseChartProxyFactory,this.environment=e.environment}postConstruct(){let e={...this.params,chartType:getCanonicalChartType(this.params.chartType),chartThemeName:this.getThemeName()},t=this.gos.get(`enableRtl`);this.eWrapper.classList.add(t?`ag-rtl`:`ag-ltr`);let n=this.createBean(new ChartDataModel(e));this.chartController=this.createManagedBean(new ChartController(n)),this.chartOptionsService=this.createManagedBean(new ChartOptionsService(this.chartController)),this.validateCustomThemes(),this.createChart(),this.params.insideDialog?this.addDialog():(this.addManagedEventListeners({gridStylesChanged:this.updateTheme.bind(this)}),this.updateTheme()),this.addMenu(),this.addManagedElementListeners(this.getGui(),{focusin:this.setActiveChartCellRange.bind(this)}),this.addManagedListeners(this.chartController,{chartModelUpdate:this.update.bind(this)}),this.addManagedPropertyListeners([`chartThemeOverrides`,`chartThemes`],this.reactivePropertyUpdate.bind(this)),this.update(),this.raiseChartCreatedEvent()}updateTheme(){this.environment.applyThemeClasses(this.getGui())}createChart(){let e;this.chartProxy&&(e=this.chartProxy.destroy({keepChartInstance:!0}));let crossFilterCallback=(e,t)=>{let n=this.params.crossFilteringContext;n.lastSelectedChartId=t?``:this.chartController.getChartId(),t&&this.params.crossFilteringResetCallback(),this.crossFilterService.filter(e,t)},t=this.chartController.getChartType(),n={agChartsExports:this.beans.agChartsExports,chartType:t,chartInstance:e,getChartThemeName:this.getChartThemeName.bind(this),getChartThemes:this.getChartThemes.bind(this),customChartThemes:this.gos.get(`customChartThemes`),styleNonce:this.gos.get(`styleNonce`),getGridOptionsChartThemeOverrides:()=>this.getGridOptionsChartThemeOverrides(),getExtraPaddingDirections:()=>this.chartMenu?.getExtraPaddingDirections()??[],apiChartThemeOverrides:this.params.chartThemeOverrides,crossFiltering:this.params.crossFiltering??!1,crossFilterCallback,parentElement:this.eChart,grouping:this.chartController.isGrouping(),chartThemeToRestore:this.params.chartThemeName,chartOptionsToRestore:this.params.chartOptionsToRestore,chartPaletteToRestore:this.params.chartPaletteToRestore,seriesChartTypes:this.chartController.getSeriesChartTypes(),suppressFieldDotNotation:this.gos.get(`suppressFieldDotNotation`),translate:e=>this.chartTranslation.translate(e),context:co(this.gos,{})};if(this.params.chartOptionsToRestore=void 0,this.chartType=t,this.chartProxy=this.createChartProxy(n),!this.chartProxy){q(138,{chartType:n.chartType});return}this.chartController.setChartProxy(this.chartProxy),this.createMenuContext()}createMenuContext(){if(this.chartMenuContext)return;let e=this.createManagedBean(new ChartMenuParamsFactory(this.chartOptionsService.getChartThemeOverridesProxy())),t=this.createManagedBean(new ChartMenuParamsFactory(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`)}createChartProxy(e){let{chartType:t}=e;switch(t){case`column`:case`bar`:case`groupedColumn`:case`stackedColumn`:case`normalizedColumn`:case`groupedBar`:case`stackedBar`:case`normalizedBar`:return new BarChartProxy(e);case`pie`:case`donut`:case`doughnut`:return new PieChartProxy(e);case`area`:case`stackedArea`:case`normalizedArea`:return new AreaChartProxy(e);case`line`:case`stackedLine`:case`normalizedLine`:return new LineChartProxy(e);case`scatter`:case`bubble`:return new ScatterChartProxy(e);case`columnLineCombo`:case`areaColumnCombo`:case`customCombo`:return new ComboChartProxy(e)}let n=this.enterpriseChartProxyFactory?.createChartProxy(e);if(!n)throw zs(251,{chartType:t});return n}addDialog(){let e=this.chartTranslation.translate(this.params.pivotChart?`pivotChartTitle`:`rangeChartTitle`),{width:t,height:n}=this.getBestDialogSize(),r=this.params.focusDialogOnOpen?()=>setTimeout(()=>ja(this.getGui())):void 0;this.chartDialog=new AgDialog({resizable:!0,movable:!0,maximizable:!0,title:e,width:t,height:n,
204component:this,centered:!0,closable:!0,afterGuiAttached:r,postProcessPopupParams:{type:`chart`}}),this.createBean(this.chartDialog),this.chartDialog.addEventListener(`destroyed`,()=>{this.destroy(),this.chartMenuSvc.hideAdvancedSettings();let e=this.focusSvc.getFocusedCell();setTimeout(()=>{this.focusSvc.isAlive()&&(e?this.focusSvc.setFocusedCell({...e,forceBrowserFocus:!0}):Ia(this.beans))})})}getBestDialogSize(){let e=this.popupSvc.getPopupParent(),t=Do(e)*.75,n=Lc(e)*.75,r=.553,i=this.chartProxy.getChart(),o=this.params.insideDialog?850:i.width,s=this.params.insideDialog?470:i.height;return(o>t||s>n)&&(o=Math.min(o,t),s=Math.round(o*r),s>n&&(s=n,o=Math.min(o,Math.round(s/r)))),{width:o,height:s}}addMenu(){this.params.crossFiltering||(this.chartMenu=this.createBean(new ChartMenu(this.eChartContainer,this.eMenuContainer,this.chartMenuContext)),this.eChartContainer.appendChild(this.chartMenu.getGui()))}update(e){if(e?.chartId&&!this.chartController.update(e))return;let t=this.chartTypeChanged(e),n=t||this.chartEmpty?(e=>{let t=this.chartType,n=e,r=this.chartProxy.getChart(),i=r?.getOptions(),o=r?.axes;return this.chartOptionsService.getPersistedChartThemeOverrides(i,o,t,n??t)})(t):void 0;t&&this.createChart(),n&&e?.chartThemeOverrides&&mc(n,e.chartThemeOverrides);let r=n??e?.chartThemeOverrides;this.updateChart(r),e?.chartId&&this.chartProxy.getChart().waitForUpdate().then(()=>{this.chartController.raiseChartApiUpdateEvent()})}updateChart(e){let{chartProxy:t}=this,n=this.chartController.getSelectedValueColState(),r=this.chartController.getChartData(),i=this.handleEmptyChart(r,n.length);if(this.chartEmpty=i,i){e&&this.chartController.updateThemeOverrides(e);return}let o=this.chartController.getChartUpdateParams(e);t.update(o),this.chartProxy.getChart().waitForUpdate().then(()=>{this.chartController.raiseChartUpdatedEvent()})}chartTypeChanged(e){let[t,n]=[this.chartController.getChartType(),e?.chartType],r=n?getCanonicalChartType(n):void 0;return this.chartType===t?r&&t!==r?r:null:r??t}getChartModel(){return this.chartController.getChartModel()}getChartImageDataURL(e){return this.chartProxy.getChartImageDataURL(e)}handleEmptyChart(e,t){let n=this.chartController.isPivotChart()&&!this.chartController.isPivotMode(),r=this.chartController.getChartType(),i=1;this.chartController.isActiveXYChart()?i=r===`bubble`?3:2:isHierarchical(getSeriesType(r))&&(i=0);let o=t<i||e.length===0;if(this.eChart){let e=n||o;W(this.eChart,!e),W(this.eEmpty,e)}return n?(this.eEmpty.textContent=this.chartTranslation.translate(`pivotChartRequiresPivotMode`),!0):o?(this.eEmpty.textContent=this.chartTranslation.translate(`noDataToChart`),!0):!1}downloadChart(e,t,n){this.chartProxy.downloadChart(e,t,n)}openChartToolPanel(e){let t=e&&my[e];this.chartMenu.showMenu({panel:t})}closeChartToolPanel(){this.chartMenu.hideMenu()}getChartId(){return this.chartController.getChartId()}getUnderlyingChart(){return this.chartProxy.getChartRef()}crossFilteringReset(){this.chartProxy.crossFilteringReset()}setMaximized(e){this.chartDialog?.setMaximized(e)}setActiveChartCellRange(e){this.getGui().contains(e.relatedTarget)||this.chartController.setChartRange(!0)}getThemeName(){let e=this.gos.get(`chartThemes`)||Cy;if(e.length===0)throw Error(zs(254));let{chartThemeName:t}=this.params;return e.includes(t)?t:e[0]}getAllKeysInObjects(e){let t={};for(let n of e.filter(e=>e!=null))for(let e of Object.keys(n))t[e]=null;return Object.keys(t)}validateCustomThemes(){let e=this.getChartThemes(),t=this.gos.get(`customChartThemes`);if(t)for(let n of this.getAllKeysInObjects([t]))e.includes(n)||q(139,{customThemeName:n})}reactivePropertyUpdate(){this.chartController.setChartThemeName(this.getThemeName(),!0);let e=this.getChartId(),t=this.chartController.isCrossFilterChart()?`crossFilter`:this.getChartModel().modelType,n=this.gos.get(`chartThemeOverrides`)||{};this.update({type:`${t}ChartUpdate`,chartId:e,chartThemeOverrides:n})}raiseChartCreatedEvent(){this.chartProxy.getChart().waitForUpdate().then(()=>{this.eventSvc.dispatchEvent({type:`chartCreated`,chartId:this.chartController.getChartId()})})}raiseChartDestroyedEvent(){this.eventSvc.dispatchEvent({type:`chartDestroyed`,chartId:this.chartController.getChartId()})}destroy(){super.destroy(),this.chartProxy&&this.chartProxy.destroy(),this.destroyBean(this.chartMenu),this.chartDialog?.isAlive()&&this.destroyBean(this.chartDialog),this.onDestroyColorSchemeChangeListener?.();let e=this.getGui();Ml(e),Ta(e),this.raiseChartDestroyedEvent()}};function upgradeChartModel(e){return e.version,e.version??(e.version=heuristicVersionDetection(e)),e=migrateIfBefore(`23.0.0`,e,migrateV23),e=migrateIfBefore(`24.0.0`,e,migrateV24),e=migrateIfBefore(`25.1.0`,e,migrateV25_1),e=migrateIfBefore(`26.0.0`,e,migrateV26),e=migrateIfBefore(`26.1.0`,e,migrateV26_1),e=migrateIfBefore(`26.2.0`,e,migrateV26_2),e=migrateIfBefore(`28.0.0`,e,migrateV28),e=migrateIfBefore(`28.2.0`,e,migrateV28_2),e=migrateIfBefore(`29.0.0`,e,migrateV29),e=migrateIfBefore(`29.1.0`,e,migrateV29_1),e=migrateIfBefore(`29.2.0`,e,migrateV29_2),e=migrateIfBefore(`30.0.0`,e,migrateV30),e=migrateIfBefore(`31.0.0`,e,migrateV31),e=migrateIfBefore(`32.0.0`,e,migrateV32),e=migrateIfBefore(`33.0.0`,e,migrateV33),e=migrateIfBefore(`34.0.0`,e,migrateV34),e=cleanup(e),e=migrateIfBefore(Z,e,e=>e),e}function migrateV23(e){return e=jsonRename(`chartOptions.legend.item.marker.type`,`shape`,e),e=jsonRename(`chartOptions.seriesDefaults.marker.type`,`shape`,e),e=jsonRename(`chartOptions.legend.padding`,`spacing`,e),e}function migrateV24(e){e=jsonDelete(`chartOptions.seriesDefaults.marker.minSize`,e);let{chartType:t,chartPalette:n,chartOptions:{xAxis:r,yAxis:i,...o},...s}=e,c=getLegacyAxisType(t)?.map((e,t)=>({type:e,...t===0?r:i}));return{chartType:t,chartThemeName:{borneo:`ag-default`,material:`ag-material`,bright:`ag-vivid`}[n]??`ag-default`,chartOptions:{...o,axes:c,xAxis:r,yAxis:i},...s}}function migrateV25_1(e){return e=jsonRename(`chartOptions.seriesDefaults.label.minRequiredA
204ngle`,`minAngle`,e),e}function migrateV26(e){let highlightOptUpdate=({dimOpacity:e,...t})=>({...t,...e==null?{}:{series:{dimOpacity:e}}});return e=jsonMutate(`chartOptions.seriesDefaults.highlightStyle`,e,highlightOptUpdate),e=jsonDelete(`chart`,e),e=jsonDelete(`chartOptions.seriesDefaults.tooltipClass`,e),e=jsonDelete(`chartOptions.seriesDefaults.tooltipTracking`,e),e=jsonDeleteDefault(`chartOptions.axes[].label.rotation`,0,e),e=jsonDeleteDefault(`chartOptions.axes[].label.rotation`,335,e),e}function migrateV26_1(e){let highlightOptUpdate=({item:e,series:t,...n})=>({item:{...n,...e},...t?{series:t}:{}});return e=jsonMutate(`chartOptions.seriesDefaults.highlightStyle`,e,highlightOptUpdate),e=jsonMutate(`chartOptions.series[].highlightStyle`,e,highlightOptUpdate),e}function migrateV26_2(e){e=jsonMove(`chartOptions.seriesDefaults.fill.opacity`,`chartOptions.seriesDefaults.fillOpacity`,e),e=jsonMove(`chartOptions.seriesDefaults.stroke.opacity`,`chartOptions.seriesDefaults.strokeOpacity`,e),e=jsonMove(`chartOptions.seriesDefaults.stroke.width`,`chartOptions.seriesDefaults.strokeWidth`,e),e=jsonDelete(`chartOptions.seriesDefaults.fill`,e),e=jsonDelete(`chartOptions.seriesDefaults.stroke`,e),e=jsonDelete(`chartOptions.seriesDefaults.callout.colors`,e),e=jsonDelete(`chartOptions.xAxis`,e),e=jsonDelete(`chartOptions.yAxis`,e);let{chartType:t,chartOptions:{axes:n,series:r,seriesDefaults:i,...o},...s}=e,c=getCanonicalChartType(t),p=getSeriesType(c),m=[p],h={};if(!isPieChartSeries(p)){let e={top:{},bottom:{},left:{},right:{}},t=n.map(({type:t,...n})=>({[t]:{...e,...n}})).reduce(merge,{});for(let n of Zv.filter(e=>t[e]==null))t[n]={...e};h.axes=t}let g=m.map(e=>({[e]:{...h,series:i,...o}})).reduce(merge,{});return e={...s,chartType:c,chartOptions:g},e}function migrateV28(e){return e=jsonDelete(`chartOptions.*.title.padding`,e),e=jsonDelete(`chartOptions.*.subtitle.padding`,e),e=jsonDelete(`chartOptions.*.axes.*.title.padding`,e),e=jsonBackfill(`chartOptions.*.axes.*.title.enabled`,!1,e),e}function migrateV28_2(e){return e=jsonRename(`chartOptions.pie.series.callout`,`calloutLine`,e),e=jsonRename(`chartOptions.pie.series.label`,`calloutLabel`,e),e=jsonRename(`chartOptions.pie.series.labelKey`,`sectorLabelKey`,e),e=jsonRename(`chartOptions.pie.series.labelName`,`sectorLabelName`,e),e=jsonRename(`chartOptions.donut.series.callout`,`calloutLine`,e),e=jsonRename(`chartOptions.donut.series.label`,`calloutLabel`,e),e=jsonRename(`chartOptions.donut.series.labelKey`,`sectorLabelKey`,e),e=jsonRename(`chartOptions.donut.series.labelName`,`sectorLabelName`,e),e}function migrateV29(e){return e=jsonMoveIfMissing(`chartOptions.scatter.series.fill`,`chartOptions.scatter.series.marker.fill`,e),e=jsonMoveIfMissing(`chartOptions.scatter.series.fillOpacity`,`chartOptions.scatter.series.marker.fillOpacity`,e),e=jsonMoveIfMissing(`chartOptions.scatter.series.stroke`,`chartOptions.scatter.series.marker.stroke`,e),e=jsonMoveIfMissing(`chartOptions.scatter.series.strokeOpacity`,`chartOptions.scatter.series.marker.strokeOpacity`,e),e=jsonMoveIfMissing(`chartOptions.scatter.series.strokeWidth`,`chartOptions.scatter.series.marker.strokeWidth`,e),e=jsonMove(`chartOptions.scatter.series.paired`,`chartOptions.scatter.paired`,e),e}function migrateV29_1(e){return e=jsonDelete(`chartOptions.axes[].tick.count`,e),e}function migrateV29_2(e){let tooltipOptUpdate=({tracking:e,...t})=>{let n={...t};return e===!1?(n.position??={type:`pointer`},n.range??=`nearest`):e===!0&&(n.position??={type:`node`},n.range??=`nearest`),n};return e=jsonMutate(`chartOptions.*.tooltip`,e,tooltipOptUpdate),e}function migrateV30(e){return e=jsonRename(`chartOptions.pie.series.labelKey`,`sectorLabelKey`,e),e=jsonRename(`chartOptions.pie.series.labelName`,`sectorLabelName`,e),e=migrateV29_1(e),e=migrateV29_2(e),e=jsonDelete(`chartOptions.*.series.flipXY`,e),e=jsonAdd(`chartOptions.common.legend.enabled`,!0,e),e=jsonBackfill(`chartOptions.common.legend.position`,`right`,e),e}function migrateV31(e){let t={"ag-pastel":`ag-sheets`,"ag-solar":`ag-polychroma`},n=jsonRename(`chartOptions.column`,`bar`,e),r=t[n.chartThemeName]||n.chartThemeName;return{...n,chartThemeName:r}}function migrateV32(e){return e=jsonMutateProperty(`chartOptions.*.autoSize`,!0,e,(e,t)=>{e[t]===!0||e[t]===!1&&(e.minHeight=600,e.minWidth=300),delete e[t]}),e}function migrateV33(e){return e=jsonDelete(`chartOptions.*.axes.category.label.format`,e),e=jsonDelete(`chartOptions.*.axes.category.crosshair.label.format`,e),e=jsonDelete(`chartOptions.*.axes.angle-category.label.format`,e),e=jsonDelete(`chartOptions.*.axes.radius-category.label.format`,e),e=jsonRename(`chartOptions.*.axes.*.label.padding`,`spacing`,e),e=jsonRename(`chartOptions.*.navigator.miniChart.label.padding`,`spacing`,e),e=jsonDelete(`chartOptions.*.axes.*.crossLines.label.className`,e),e=jsonMutateProperty(`chartOptions.*.axes.*.crossLines.label.position`,!0,e,(e,t)=>{typeof e[t]==`string`&&(e[t]=e[t].replace(/([A-Z])/,`-$1`).toLowerCase())}),e=jsonDelete(`chartOptions.bullet`,e),e=jsonRenameEnumValues(`chartOptions.bar.series.label.placement`,e,{inside:`inside-center`,outside:`inside-end`}),e=jsonRenameEnumValues(`chartOptions.waterfall.series.item.*.label.placement`,e,{inside:`inside-center`,start:`outside-start`,end:`outside-end`}),e=jsonDelete(`chartOptions.*.navigator.min`,e),e=jsonDelete(`chartOptions.*.navigator.max`,e),e=jsonDelete(`chartOptions.*.zoom.ratioX`,e),e=jsonDelete(`chartOptions.*.zoom.ratioY`,e),e=jsonDelete(`chartOptions.*.zoom.rangeX`,e),e=jsonDelete(`chartOptions.*.zoom.rangeY`,e),e}function migrateV34(e){let highlightUpdate=(e,t)=>
204{let n=e[t];if(n==null)return;let r={};if(n.item&&(r.highlightedItem=n.item),n.series){let{dimOpacity:e,...t}=n.series;e!=null&&(r.unhighlightedSeries={opacity:e}),Object.keys(t).length>0&&(r.highlightedSeries=t)}delete e[t],e.highlight=r};return jsonMutateProperty(`chartOptions.series[].highlightStyle`,!0,e,highlightUpdate),e}function cleanup(e){return e=jsonDelete(`chartOptions.*.width`,e),e=jsonDelete(`chartOptions.*.height`,e),e=jsonBackfill(`chartOptions.*.axes.category.label.autoRotate`,!0,e),e}function heuristicVersionDetection(e){let t=e;if(e.version!=null)return e.version;let hasKey=(e,...t)=>Object.keys(e||{}).some(e=>t.includes(e)),n=t.chartOptions,r=hasKey(n,`seriesDefaults`)?n?.seriesDefaults:n?.[Object.keys(n)[0]],i={"27.0.0":hasKey(t,`seriesChartTypes`),"26.2.0":!hasKey(n,`seriesDefaults`),"26.1.0":hasKey(r?.highlightStyle,`item`),"26.0.0":hasKey(r?.highlightStyle,`series`),"25.1.0":hasKey(r?.label,`minAngle`),"25.0.0":hasKey(t,`modelType`,`aggFunc`,`unlinkChart`,`suppressChartRanges`)||hasKey(r,`lineDash`,`lineDashOffset`),"24.0.0":hasKey(t,`chartThemeName`,`chart`)||hasKey(n,`series`),"23.2.0":hasKey(n,`navigator`),"23.0.0":hasKey(n?.legend?.item?.marker,`shape`),"22.1.0":hasKey(t,`chartPalette`,`chartType`)},[o=`27.1.0`]=Object.entries(i).filter(([e,t])=>t)[0];return o}function migrateIfBefore(e,t,n){if(versionNumber(e)>versionNumber(t.version)){let r=n(t);return r.version=e,r}return t}function versionParts(e){let t=e.includes(`-beta`)?e.replace(/-beta.*/,``):e,n=typeof t==`string`?t.split(`.`).map(e=>Number(e)):[];if(n.length!==3||n.some(e=>isNaN(e)))throw Error(zs(253,{version:t}));return{major:n[0],minor:n[1],patch:n[2]}}function versionNumber(e){let{major:t,minor:n,patch:r}=versionParts(e);return t*1e4+n*100+r}function jsonDeleteDefault(e,t,n){return jsonMutateProperty(e,!0,n,(e,n)=>{e[n]===t&&delete e[n]})}function jsonBackfill(e,t,n){return jsonMutateProperty(e,!1,n,(e,n)=>{e[n]??(e[n]=t)})}function jsonAdd(e,t,n){typeof e==`string`&&(e=e.split(`.`));let r=e[0];return e.length>1&&(n[r]=jsonAdd(e.slice(1),t,n[r]??{})),Object.keys(n).includes(r)||(n[r]=t),n}function jsonMove(e,t,n){let r,i=!1;return n=jsonMutateProperty(e,!0,n,(e,t)=>{i=!0,r=e[t],delete e[t]}),i?jsonMutateProperty(t,!1,n,(e,t)=>{e[t]=r}):n}function jsonMoveIfMissing(e,t,n){let r,i=!1;return n=jsonMutateProperty(e,!0,n,(e,t)=>{i=!0,r=e[t],delete e[t]}),i?jsonMutateProperty(t,!1,n,(e,t)=>{e[t]===void 0&&(e[t]=r)}):n}function jsonRename(e,t,n){return jsonMutateProperty(e,!0,n,(e,n)=>{e[t]=e[n],delete e[n]})}function jsonDelete(e,t){return jsonMutateProperty(e,!0,t,(e,t)=>delete e[t])}function jsonMutateProperty(e,t,n,r){let i=e instanceof Array?e:e.split(`.`),o=i.slice(0,i.length-1),s=i[i.length-1];return jsonMutate(o,n,e=>{let n=Object.keys(e).includes(s);if(t&&!n)return e;let i={...e};return r(i,s),i})}function jsonMutate(e,t,n){let r=e instanceof Array?e:e.split(`.`);if(t={...t},r.length===0)return n(t);if(r[0].startsWith(`{`)){let e=r[0].substring(1,r[0].lastIndexOf(`}`)).split(`,`);for(let i of e)t[i]!=null&&(t[i]=jsonMutate(r.slice(1),t[i],n))}else if(r[0].endsWith(`[]`)){let i=r[0].substring(0,e[0].indexOf(`[`));t[i]instanceof Array&&(t[i]=t[i].map(e=>jsonMutate(r.slice(1),e,n)))}else if(r[0]===`*`)for(let e of Object.keys(t))t[e]=jsonMutate(r.slice(1),t[e],n);else t[r[0]]!=null&&(t[r[0]]=jsonMutate(r.slice(1),t[r[0]],n));return t}function jsonRenameEnumValues(e,t,n){return jsonMutateProperty(e,!0,t,(e,t)=>{typeof e[t]==`string`&&(e[t]=n[t]??t)})}var merge=(e,t)=>({...e,...t}),ChartService=class extends U{constructor(){super(...arguments),this.beanName=`chartSvc`,this.activeCharts=new Set,this.activeChartComps=new Set,this.crossFilteringContext={lastSelectedChartId:``},this.isEnterprise=()=>this.agChartsExports.isEnterprise}wireBeans(e){this.visibleCols=e.visibleCols,this.rangeSvc=e.rangeSvc,this.agChartsExports=e.agChartsExports}updateChart(e){if(this.activeChartComps.size===0){q(124);return}let t=[...this.activeChartComps].find(t=>t.getChartId()===e.chartId);if(!t){q(125,{chartId:e.chartId});return}t.update(e)}getChartModels(){let e=[],versionedModel=e=>({...e,version:Z});for(let t of this.activeChartComps)e.push(versionedModel(t.getChartModel()));return e}getChartRef(e){let t;for(let n of this.activeCharts)n.chartId===e&&(t=n);return t}getChartComp(e){let t;for(let n of this.activeChartComps)n.getChartId()===e&&(t=n);return t}getChartImageDataURL(e){let t;for(let n of this.activeChartComps)n.getChartId()===e.chartId&&(t=n.getChartImageDataURL(e.fileFormat));return t}downloadChart(e){Array.from(this.activeChartComps).find(t=>t.getChartId()===e.chartId)?.downloadChart(e.dimensions,e.fileName,e.fileFormat)}openChartToolPanel(e){Array.from(this.activeChartComps).find(t=>t.getChartId()===e.chartId)?.openChartToolPanel(e.panel)}closeChartToolPanel(e){Array.from(this.activeChartComps).find(t=>t.getChartId()===e)?.closeChartToolPanel()}createChartFromCurrentRange(e=`groupedColumn`,t){let n=this.getSelectedRange();return this.createChart({cellRange:n,chartType:e,focusDialogOnOpen:!t})}restoreChart(e,t){if(!e){q(126);return}e.version!==Z&&(e=upgradeChartModel(e));let n,r,i,o;if(e.modelType===`pivot`?(this.gos.updateGridOptions({options:{pivotMode:!0},source:`pivotChart`}),n=this.createCellRange(void 0,!0),r=!0,i=!0):(n=this.createCellRange(e.cellRange),o=e.chartPalette,i=e.suppressChartRanges),n)return this.createChart({...e,cellRange:n,pivotChart:r,suppressChartRanges:i,chartContainer:t,chartOptionsToRestore:e.chartOptions,chartPaletteToRestore:o})}createRangeChart(e,t){let n=this.createCellRange(e.cellRange);if(n)return this.createChart({...e,cellRange:n,focusDialogOnOpen:!t})}createPivotChart(e,t){this.gos.updateGridOptions({options:{pivotMode:!0},source:`pivotChart`});let n=this.createCellRange(void 0,!0);if(n)return this.createChart({...e,cellRange:n,pivotChart:!0,suppressChartRanges:!0,focusDialogOnOpen:!t})}createCrossFilterChart(e,t){let n=this.createCellRange(e.cellRange);if(!n)return;let r=e.suppressChartRanges!==void 0&&e.suppressChartRanges!==null?e.suppressChartRanges:!0;return this.createChart({...e,cellRange:n,suppressChartRanges:r,crossFiltering:!0,crossFilteringSort:e.sort,focusDialogOnOpen:!t})}createChart(e){let t=validateCreateParams(e,this.agChartsExports.isEnterprise);if(!t)return;e=t===!0?e:t;let{chartType:n,chartContainer:r}=e,i=this.gos.getCallback(`createChartContainer`),o=new GridChartComp({...e,chartId:this.generateId(),chartType:getCanonicalChartType(n),insideDialog:!(r||i),crossFilteringContext:this.crossFilteringContext,crossFilteringResetCallback:()=>{for(let e of this.activeChartComps)e.crossFilteringReset()}});this.createBean(o);let s=this.createChartRef(o);return r?r.appendChild(s.chartElement):i?i(s):o.addEventListener(`destroyed`,()=>{this.activeChartComps.delete(o),this.activeCharts.delete(s)}),s}
204createChartRef(e){let t={destroyChart:()=>{this.activeCharts.has(t)&&(this.destroyBean(e),this.activeChartComps.delete(e),this.activeCharts.delete(t))},focusChart:()=>{ja(e.getGui())},chartElement:e.getGui(),chart:e.getUnderlyingChart(),chartId:e.getChartModel().chartId,setMaximized:e.setMaximized.bind(e)};return this.activeCharts.add(t),this.activeChartComps.add(e),t}getSelectedRange(){let e=this.rangeSvc?.getCellRanges();if(!e||e.length===0)return{columns:[]};let t=new Set,n=Number.MAX_VALUE,r=-Number.MAX_VALUE;for(let{startRow:i,endRow:o,columns:s}of e){if(!(i&&o))continue;for(let e of s)t.add(e);let{rowIndex:e,rowPinned:c}=i,{rowIndex:p,rowPinned:m}=o;if(c===`top`){if(m===`top`)continue;e=0}if(m===`bottom`){if(c===`bottom`)continue;p=this.beans.pageBounds.getLastRow()}e!==void 0&&(n=Math.min(n,e)),p!==void 0&&(r=Math.max(r,p))}if(n===Number.MAX_VALUE||r===-Number.MAX_VALUE)return{columns:[]};let i=Array.from(t);return{columns:i,startColumn:i[0],startRow:{rowIndex:n,rowPinned:void 0},endRow:{rowIndex:r,rowPinned:void 0}}}generateId(){return`id-${Math.random().toString(36).substring(2,18)}`}createCellRange(e,t){let n=t?{rowStartIndex:null,rowStartPinned:void 0,rowEndIndex:null,rowEndPinned:void 0,columns:this.visibleCols.allCols.map(e=>e.getColId())}:e,r=n&&this.rangeSvc?.createPartialCellRangeFromRangeParams(n,!0);return r||q(127,{allRange:t}),r}destroy(){for(let e of this.activeCharts)e.destroyChart();super.destroy()}};function getChartModels(e){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.getChartModels())}function getChartRef(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.getChartRef(t))}function getChartImageDataURL(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.getChartImageDataURL(t))}function downloadChart(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.downloadChart(t))}function openChartToolPanel(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.openChartToolPanel(t))}function closeChartToolPanel(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.closeChartToolPanel(t.chartId))}function createRangeChart(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.createRangeChart(t,!0))}function createPivotChart(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.createPivotChart(t,!0))}function createCrossFilterChart(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.createCrossFilterChart(t,!0))}function updateChart(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.updateChart(t))}function restoreChart(e,t,n){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.restoreChart(t,n))}var Ub=`.ag-chart{display:flex;height:100%;position:relative;width:100%}.ag-chart-components-wrapper{display:flex}.ag-chart-canvas-wrapper,.ag-chart-components-wrapper{flex:1 1 auto;position:relative}.ag-chart-menu{background:var(--ag-background-color);background-color:color-mix(in srgb,transparent,var(--ag-background-color) 30%);border-radius:var(--ag-border-radius);display:flex;flex-direction:row;gap:20px;padding:4px 2px;position:absolute;top:8px;width:auto;--ag-icon-size:20px}:where(.ag-ltr) .ag-chart-menu{justify-content:right;right:calc(var(--ag-cell-horizontal-padding) + var(--ag-spacing) - 4px)}:where(.ag-rtl) .ag-chart-menu{justify-content:left;left:calc(var(--ag-cell-horizontal-padding) + var(--ag-spacing) - 4px)}.ag-chart-docked-container{min-width:var(--ag-chart-menu-panel-width);position:relative}:where(.ag-chart-menu-hidden)~.ag-chart-docked-container{display:none}.ag-chart-tabbed-menu{display:flex;flex-direction:column;height:100%;overflow:hidden;width:100%}.ag-chart-tabbed-menu-header{cursor:default;flex:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-chart-tabbed-menu-body{align-items:stretch;display:flex;flex:1 1 auto;overflow:hidden;position:relative;&:after{background:linear-gradient(var(--ag-background-color),transparent);content:"";display:block;height:16px;left:0;position:absolute;right:0;top:0}}.ag-chart-tab{overflow:hidden;overflow-y:auto;width:100%}.ag-chart-settings{overflow-x:hidden}.ag-chart-settings-wrapper{display:flex;flex-direction:column;height:100%;overflow:hidden;position:relative;width:100%}.ag-chart-settings-nav-bar{align-items:center;border-top:solid var(--ag-border-width) var(--ag-border-color);display:flex;height:30px;padding:0 10px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.ag-chart-settings-card-selector{align-items:center;display:flex;flex:1 1 auto;height:100%;justify-content:space-around;padding:0 10px}.ag-chart-settings-card-item{background-color:var(--ag-foreground-color);border-radius:4px;cursor:pointer;height:8px;position:relative;width:8px;&.ag-not-selected{opacity:.2}&:before{background-color:transparent;content:" ";display:block;height:20px;left:50%;margin-left:-10px;margin-top:-10px;position:absolute;top:50%;width:20px}&.ag-selected{background-color:var(--ag-accent-color)}}.ag-chart-settings-next,.ag-chart-settings-prev{flex:none;position:relative;&:focus-within{border-radius:1px;box-shadow:var(--ag-focus-shadow)}}.ag-chart-settings-next-button,.ag-chart-settings-prev-button{curs
204or:pointer;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%}.ag-chart-settings-mini-charts-container{flex:1 1 auto;overflow:hidden auto;position:relative}.ag-chart-settings-mini-wrapper{display:flex;flex-direction:column;left:0;min-height:100%;overflow:hidden;padding-bottom:var(--ag-widget-container-vertical-padding);position:absolute;top:0;width:100%;&.ag-animating{transition:left .3s;transition-timing-function:ease-in-out}}.ag-chart-mini-thumbnail{border:solid var(--ag-border-width) var(--ag-border-color);border-radius:5px;cursor:pointer;padding:1px;&.ag-selected{border-color:var(--ag-accent-color);border-width:calc(var(--ag-border-width) + 1px);padding:unset}&:focus-visible{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}}.ag-chart-mini-thumbnail-canvas{display:block}.ag-chart-advanced-settings-wrapper,.ag-chart-data-wrapper,.ag-chart-format-wrapper{display:flex;flex-direction:column;padding-bottom:16px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-chart-advanced-settings-wrapper,.ag-chart-data-wrapper{height:100%;overflow-y:auto}.ag-chart-advanced-settings{background-color:var(--ag-chrome-background-color)}.ag-chart-advanced-settings,.ag-chart-advanced-settings-wrapper{width:100%}.ag-chart-advanced-settings-wrapper{padding-bottom:0}.ag-chart-advanced-settings-section{border-bottom:solid var(--ag-border-width) var(--ag-border-color);display:flex;margin:0;padding-bottom:var(--ag-widget-container-vertical-padding);padding-top:var(--ag-widget-container-vertical-padding)}.ag-chart-empty-text{align-items:center;background-color:var(--ag-background-color);display:flex;height:100%;justify-content:center;top:0;width:100%}.ag-charts-font-size-color{align-self:stretch;display:flex;justify-content:space-between}.ag-charts-data-group-item{padding-bottom:var(--ag-widget-container-vertical-padding);position:relative}.ag-charts-data-group-item:where(:not(:last-child)){margin-bottom:var(--ag-spacing)}.ag-chart-menu-icon{border-radius:var(--ag-border-radius);cursor:pointer;margin:2px 0;opacity:.8;&:hover{opacity:1}}.ag-chart-menu-toolbar-button{background-color:unset;border:0;border-radius:1px;padding:0 2px}.ag-chart-data-column-drag-handle{margin-left:var(--ag-spacing)}.ag-charts-advanced-settings-top-level-group-title-bar{background-color:unset;position:relative}.ag-charts-data-group-container{padding:calc(var(--ag-widget-container-vertical-padding)*.5) var(--ag-widget-container-horizontal-padding)}.ag-charts-data-group-item:where(:not(.ag-charts-format-sub-level-group,.ag-pill-select,.ag-select)){height:var(--ag-list-item-height)}.ag-charts-data-group-item:where(.ag-picker-field){margin-top:var(--ag-spacing)}.ag-charts-advanced-settings-top-level-group-container,.ag-charts-format-top-level-group-container{margin-left:calc(var(--ag-spacing)*2);padding:var(--ag-spacing)}.ag-charts-advanced-settings-top-level-group-item,.ag-charts-format-top-level-group-item{margin:var(--ag-spacing) 0}.ag-charts-format-sub-level-group-container{display:flex;flex-direction:column;padding:var(--ag-widget-vertical-spacing) 0}.ag-charts-settings-group-container{display:grid;grid-template-columns:60px 1fr 60px 1fr 60px;padding:var(--ag-spacing);row-gap:8px;:where(.ag-chart-mini-thumbnail:nth-child(3n+1)){grid-column:1}:where(.ag-chart-mini-thumbnail:nth-child(3n+2)){grid-column:3}:where(.ag-chart-mini-thumbnail:nth-child(3n+3)){grid-column:5}}.ag-chart-data-section,.ag-chart-format-section{display:flex;margin:0;:where(.ag-label:not(.ag-group-title-bar)){color:var(--ag-chart-menu-label-color)}:where(.ag-label-align-top .ag-label){margin-bottom:var(--ag-widget-vertical-spacing);margin-top:calc(var(--ag-widget-vertical-spacing)*.5)}:where(.ag-slider.ag-label-align-top .ag-label){margin-bottom:0}:where(label){display:inline-block}}.ag-chart-menu-panel{--ag-panel-background-color:var(--ag-chrome-background-color)}:where(.ag-ltr) .ag-chart-menu-panel{border-left:solid var(--ag-border-width) var(--ag-border-color)}:where(.ag-rtl) .ag-chart-menu-panel{border-right:solid var(--ag-border-width) var(--ag-border-color)}.ag-charts-data-group-title-bar,.ag-charts-format-top-level-group-title-bar,.ag-charts-settings-group-container,.ag-charts-settings-group-title-bar{border-top:none;font-weight:500;padding:0 calc(var(--ag-spacing)*1.5)}.ag-charts-format-sub-level-group-title-bar{background:none;font-weight:500;padding:var(--ag-widget-vertical-spacing) 0}.ag-chart-data-wrapper,.ag-chart-format-wrapper,.ag-charts-data-group-container,.ag-charts-data-group-title-bar,.ag-charts-format-sub-level-group,.ag-charts-format-sub-level-group-container>*,.ag-charts-format-sub-level-group-item:last-child,.ag-charts-format-top-level-group,.ag-charts-format-top-level-group-item,.ag-charts-format-top-level-group-title-bar,.ag-charts-settings-group-container,.ag-charts-settings-group-title-bar,:where(.ag-charts-format-top-level-group) .ag-charts-format-top-level-group-container{margin:0;padding:0}.ag-charts-data-group-title-bar,.ag-charts-format-top-level-group-title-bar,.ag-charts-settings-group-title-bar{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:relative}.ag-charts-data-group,.ag-charts-format-top-level-group{border-top:solid var(--ag-border-width) var(--ag-border-color)}:where(.ag-charts-data-group) .ag-charts-data-group-container,:where(.ag-charts-format-top-level-group) .ag-charts-format-top-level-group-container,:where(.ag-charts-settings-group) .ag-charts-settings-group-container{padding:0 var(--ag-widget-container-horizontal-padding)}.ag-charts-format-sub-level-group-container>*,.ag-charts-format-sub-level-no-header-group-container>*,.ag-charts-format-top-level-group-container>*{margin-bottom:var(--ag-widget-vertical-spacing)}.ag-charts-advanced-settings-top-level-group-container{margin:0}:where(.ag-charts-advanced-settings-top-level-group){.ag-charts-advanced-settings-top-level-group-container,.ag-charts-advanced-settings-top-level-group-title-bar{padding:0 var(--ag-widget-container-horizontal-padding)}}.ag-charts-advanced-settings-top-level-group-item{margin-bottom:0;margin-top:calc(var(--ag-widget-vertical-spacing)*2)}.ag-chart-settings-card-item.ag-not-selected:hover{opacity:.35}.ag-angle-select{align-items:center;display:flex}.ag-angle-select-wrapper{display:flex}.ag-angle-select-parent-circle{background-color:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:12px;display:block;height:24px;position:relative;width:24px}.ag-angle-select-child-circle{background-color:var(--ag-foreground-color);border-radius:3px;height:6px;left:12px;margin-left:-3px;margin-top:-4px;position:absolute;top:4px;width:6px}.ag-slider-wrapper{display:flex;:where(.ag-input-field){flex:1 1 auto}}.ag-color-panel{display:flex;flex-direction:column;padding:var(--ag-spacing);text-align:center;width:100%}.ag-spectrum-color{cursor:default;flex:1 1 auto;overflow:visible;position:relative}.ag-spectrum-color,.ag-spectrum-fill{border-radius:var(--ag-border-radius)}.ag-spectrum-fill{inset:0;position:absolute}.ag-spectrum-val{background-image:linear-gradient(0deg,#000,hsla(20,42%,65%,0));cursor:pointer}.ag-spectrum-dragger{background:#000;border:var(--ag-color-picker-thumb-border-width) solid #fff;border-radius:var(--ag-color-picker-thumb-size);box-shadow:0 0 2px 0 rgba(0,0,0,.24);cursor:pointer;height:var(--ag-color-picker-thumb-size);pointer-events:none;position:absolute;width:var(--ag-color-picker-thumb-size)}.ag-spectrum-alpha,.ag-spectrum-hue{cursor:default}.ag-spectrum-hue-background{background:linear-gradient(270deg,red 3%,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);height:100%;width:100%}.ag-spectrum-alpha-background{background:linear-gradient(to right,var(--ag-internal-spectrum-alpha-color-from),var(--ag-internal-spectrum-alpha-color-to)),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>') 0 0 /4px 4px;height:100%;width:100%}.ag-spectrum-tool{cursor:pointer;height:var(--ag-color-picker-track-size);margin-bottom:10px;position:relative}.ag-spectrum-slider,.ag-spectrum-tool{border-radius:var(--ag-color-picker-thumb-size)}.ag-spectrum-slider{border:var(--ag-color-picker-thumb-border-width) solid #fff;box-shadow:0 1px 4px 0 rgba(0,0,0,.37);height:var(--ag-color-picker-thumb-size);margin-top:calc(var(--ag-color-picker-track-size)/2*-1 + var(--ag-color-picker-thumb-size)/2*-1);pointer-events:none;position:absolute;width:var(--ag-color-picker-thumb-size)}:where(.ag-spectrum-alpha) .ag-spectrum-slider{background:linear-gradient(to bottom,var(--ag-internal-spectrum-alpha-color),var(--ag-internal-spectrum-alpha-color)) var(--ag-background-color)}.ag-recent-colors{display:flex;gap:6px;margin:10px var(--ag-spacing) 2px}.ag-recent-color{border:solid var(--ag-border-width) var(--ag-border-color);cursor:pointer}.ag-angle-select[disabled]{opacity:.5;pointer-events:none}:where(.ag-ltr) .ag-angle-select-field,:where(.ag-ltr) .ag-slider-field{margin-right:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-angle-select-field,:where(.ag-rtl) .ag-slider-field{margin-left:calc(var(--ag-spacing)*2)}.ag-color-dialog{border-radius:5px}:where(.ag-color-picker){.ag-picker-field-wrapper{padding-left:var(--ag-spacing);padding-right:var(--ag-spacing)}.ag-picker-field-display{align-items:center;display:flex;flex-direction:row;min-height:var(--ag-list-item-height)}}:where(.ag-ltr) .ag-color-picker-color,:where(.ag-ltr) .ag-color-picker-value{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-color-picker-color,:where(.ag-rtl) .ag-color-picker-value{margin-left:var(--ag-spacing)}.ag-spectrum-tools{padding:10px 0 0}.ag-spectrum-alpha-background,.ag-spectrum-hue-background{border-radius:var(--ag-color-picker-track-border-radius)}.ag-color-input-color,.ag-color-picker-color,.ag-recent-color{border-radius:var(--ag-color-picker-color-border-radius)}.ag-spectrum-sat{background-image:linear-gradient(90deg,#fff,hsla(20,42%,65%,0))}.ag-recent-color,.ag-spectrum-color,.ag-spectrum-slider{&:where(:not
204(:disabled,[readonly])):focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-color-input-color,.ag-color-picker-color{border:solid var(--ag-border-width) var(--ag-border-color);height:var(--ag-icon-size);width:var(--ag-icon-size)}:where(.ag-ltr) .ag-color-input .ag-input-field-input{padding-left:calc(var(--ag-icon-size) + var(--ag-spacing)*2)}:where(.ag-rtl) .ag-color-input .ag-input-field-input{padding-right:calc(var(--ag-icon-size) + var(--ag-spacing)*2)}:where(.ag-color-input) .ag-color-input-color{position:absolute}:where(.ag-ltr) :where(.ag-color-input) .ag-color-input-color{margin-left:var(--ag-spacing)}:where(.ag-rtl) :where(.ag-color-input) .ag-color-input-color{margin-right:var(--ag-spacing)}.ag-range-field{align-items:center;display:flex;:where(.ag-input-wrapper){height:100%}}.ag-range-field-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;height:100%;overflow:visible;padding:0;width:100%;&:disabled{opacity:.5}}.ag-range-field-input{&::-webkit-slider-runnable-track{background-color:var(--ag-border-color);border-radius:1.5px;height:3px;margin:0;padding:0;width:100%}&::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:100%;height:var(--ag-icon-size);margin:0;padding:0;transform:translateY(calc(var(--ag-icon-size)*-.5 + 1.5px));width:var(--ag-icon-size)}&:focus::-webkit-slider-thumb{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}&:active::-webkit-slider-runnable-track{background-color:var(--ag-accent-color)}}.ag-range-field-input{&::-moz-range-track{background-color:var(--ag-border-color);border-radius:1.5px;height:3px;margin:0;padding:0;width:100%}&::-moz-ag-range-thumb{-moz-appearance:none;appearance:none;background-color:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:100%;height:var(--ag-icon-size);margin:0;padding:0;transform:translateY(calc(var(--ag-icon-size)*-.5 + 1.5px));width:var(--ag-icon-size)}&:focus::-moz-ag-range-thumb{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}&:active::-moz-ag-range-track{background-color:var(--ag-accent-color)}}`,Wb=28,Gb=6;function isValidVersion(e){return e?.match(/\d+\.\d+\.\d+/)}function isValidMajorVersion({gridMajorVersion:e,chartsMajorVersion:t}){let n=parseInt(e,10),r=parseInt(t,10),i=n-Wb;return i===r-Gb&&i>=0}function gridChartVersion(e){if(!e||!isValidVersion(e))return;let[t,n]=e.split(`.`)||[],r=`${t}.${n}.x`,i=parseInt(t,10)-Wb+Gb;if(!(i<0))return{gridMajorMinor:r,chartsMajorMinor:`${i}.${n}.x`}}function validGridChartsVersionErrorMessage({type:e,gridVersion:t,chartsVersion:n}){let r=`AG Grid: AG Grid version is incompatible. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.`;if(!t)return r;let i=gridChartVersion(t);if(!i)return r;let{gridMajorMinor:o,chartsMajorMinor:s}=i;return e===`incompatible`?`AG Grid version ${t} and AG Charts version ${n} is not supported. AG Grid version ${o} should be used with AG Chart ${s}. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.`:e===`invalidCharts`?`AG Grid version ${o} should be used with AG Chart ${s} not ${n}. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.`:r}function validGridChartsVersion({gridVersion:e,chartsVersion:t}){if(!isValidVersion(t))return{isValid:!1,message:validGridChartsVersionErrorMessage({type:`invalidCharts`,gridVersion:e,chartsVersion:t})};if(!isValidVersion(e))return{isValid:!1,message:validGridChartsVersionErrorMessage({type:`invalidGrid`,gridVersion:e,chartsVersion:t})};let[n,r]=e.split(`.`)||[],[i,o,s]=t.split(`.`)||[],c=isValidMajorVersion({gridMajorVersion:n,chartsMajorVersion:i});return c&&r===o||s.includes(`beta`)?{isValid:!0}:!c||r!==o?{isValid:!1,message:validGridChartsVersionErrorMessage({type:`incompatible`,gridVersion:e,chartsVersion:t})}:{isValid:!1,message:validGridChartsVersionErrorMessage({type:`invalid`,gridVersion:e,chartsVersion:t})}}var Kb={linked:`linked`,unlinked:`unlinked`,chartsMenu:`menu-alt`,chartsDownload:`save`,chartsMenuEdit:`chart`,chartsMenuAdvancedSettings:`settings`,chartsMenuAdd:`plus`,chartsColorPicker:`small-down`,chartsThemePrevious:`previous`,chartsThemeNext:`next`},qb={getChartModels,getChartRef,getChartImageDataURL,downloadChart,openChartToolPanel,closeChartToolPanel,createRangeChart,createPivotChart,createCrossFilterChart,updateChart,restoreChart},Jb=[_v,fh,zo,Ra,pg],Yb=`IntegratedCharts`,Xb={moduleName:Yb,version:Z,dependsOn:Jb,validate:()=>({isValid:!1,message:bc(257)}
204),with:e=>{if(e.setup(),e.setGridContext?.(!0),e.isEnterprise&&e.setLicenseKey){let t={setLicenseKey:e.setLicenseKey};Yp.setChartsLicenseManager(t)}return{moduleName:Yb,version:Z,icons:Kb,apiFunctions:qb,dependsOn:Jb,css:[Ub],validate:()=>validGridChartsVersion({gridVersion:Z,chartsVersion:e.VERSION}),beans:[AgChartsExports.bind(null,e),ChartService,ChartTranslationService,ChartCrossFilterService,ChartMenuListFactory,ChartMenuService,EnterpriseChartProxyFactory,AdvancedSettingsMenuFactory]}}},Zb=[Ya,L_,Ag,c_,ev,tv,av,Vg,Hg,_v,Ug,B_,A_,j_,M_,Fv,Iv,Qg,f_,Wh,dg,s_,N_,Cv,Mv,Uv,Wv,$h],Qb=`AllEnterprise`,$b={with:e=>({moduleName:Qb,version:Z,dependsOn:[...Zb,Xb.with(e),Bv.with(e)]}),moduleName:Qb,version:Z,dependsOn:Zb},ex={},tx={};function addHandler(e,t){ex[e]=ex[e]||[],ex[e].push(t)}function maybeInstrument(e,t){if(!tx[e]){tx[e]=!0;try{t()}catch(t){v&&xe.error(`Error while instrumenting ${e}`,t)}}}function triggerHandlers(e,t){let n=e&&ex[e];if(n)for(let r of n)try{r(t)}catch(t){v&&xe.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${ke(r)}\nError:`,t)}}var nx=null;function addGlobalErrorInstrumentationHandler(e){let t=`error`;addHandler(t,e),maybeInstrument(t,instrumentError)}function instrumentError(){nx=ue.onerror,ue.onerror=function(e,t,n,r,i){return triggerHandlers(`error`,{column:r,error:i,line:n,msg:e,url:t}),nx?nx.apply(this,arguments):!1},ue.onerror.__SENTRY_INSTRUMENTED__=!0}var rx=null;function addGlobalUnhandledRejectionInstrumentationHandler(e){let t=`unhandledrejection`;addHandler(t,e),maybeInstrument(t,instrumentUnhandledRejection)}function instrumentUnhandledRejection(){rx=ue.onunhandledrejection,ue.onunhandledrejection=function(e){return triggerHandlers(`unhandledrejection`,e),!rx||rx.apply(this,arguments)},ue.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function parseSampleRate(e){if(typeof e==`boolean`)return Number(e);let t=typeof e==`string`?parseFloat(e):e;if(!(typeof t!=`number`||isNaN(t)||t<0||t>1))return t}function createEnvelope(e,t=[]){return[e,t]}function addItemToEnvelope(e,t){let[n,r]=e;return[n,[...r,t]]}function forEachEnvelopeItem(e,t){let n=e[1];for(let e of n){let n=e[0].type;if(t(e,n))return!0}return!1}function encodeUTF8(e){let t=m(ue);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function serializeEnvelope(e){let[t,n]=e,r=JSON.stringify(t);function append(e){typeof r==`string`?r=typeof e==`string`?r+e:[encodeUTF8(r),e]:r.push(typeof e==`string`?encodeUTF8(e):e)}for(let e of n){let[t,n]=e;if(append(`\n${JSON.stringify(t)}\n`),typeof n==`string`||n instanceof Uint8Array)append(n);else{let e;try{e=JSON.stringify(n)}catch{e=JSON.stringify(h(n))}append(e)}}return typeof r==`string`?r:concatBuffers(r)}function concatBuffers(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function createAttachmentEnvelopeItem(e){let t=typeof e.data==`string`?encodeUTF8(e.data):e.data;return[{type:`attachment`,length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var ix={session:`session`,sessions:`session`,attachment:`attachment`,transaction:`transaction`,event:`error`,client_report:`internal`,user_report:`default`,profile:`profile`,profile_chunk:`profile`,replay_event:`replay`,replay_recording:`replay`,check_in:`monitor`,feedback:`feedback`,span:`span`,raw_security:`security`,log:`log_item`};function envelopeItemTypeToDataCategory(e){return ix[e]}function getSdkMetadataForEnvelopeHeader(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function createEventEnvelopeHeaders(e,t,n,r){let i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:y(r)},...i&&{trace:i}}}function enhanceEventWithSdkInfo(e,t){return t?(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]],e):e}function createSessionEnvelope(e,t,n,r){let i=getSdkMetadataForEnvelopeHeader(n);return createEnvelope({sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:y(t)}},[`aggregates`in e?[{type:`sessions`},e]:[{type:`session`},e.toJSON()]])}function createEventEnvelope(e,t,n,r){let i=getSdkMetadataForEnvelopeHeader(n),o=e.type&&e.type!==`replay_event`?e.type:`event`;enhanceEventWithSdkInfo(e,n?.sdk);let s=createEventEnvelopeHeaders(e,i,r,t);return delete e.sdkProcessingMetadata,createEnvelope(s,[[{type:o},e]])}var ax=`7`;function getBaseApiEndpoint(e){let t=e.protocol?`${e.protocol}:`:``,n=e.port?`:${e.port}`:``;return`${t}//${e.host}${n}${e.path?`/${e.path}`:``}/api/`}function _getIngestEndpoint(e){return`${getBaseApiEndpoint(e)}${e.projectId}/envelope/`}function _encodedAuth(e,t){let n={sentry_version:ax};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function getEnvelopeEndpointWithUrlEncodedAuth(e,t,n){return t||`${_getIngestEndpoint(e)}?${_encodedAuth(e,n)}`}function getReportDialogEndpoint(e,t){let n=_(e);if(!n)return``;let r=`${getBaseApiEndpoint(n)}embed/error-page/`,i=`dsn=${y(n)}`;for(let e in t)if(e!==`dsn`&&e!==`onClose`){if(e===`user`){let e=t.user;if(!e)continue;e.name&&(i+=`&name=${encodeURIComponent(e.name)}
204`),e.email&&(i+=`&email=${encodeURIComponent(e.email)}`)}else i+=`&${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`}return`${r}?${i}`}var ox=[];function filterDuplicates(e){let t={};return e.forEach(e=>{let{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}function getIntegrationsToSetup(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(e=>{e.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n==`function`){let e=n(t);r=Array.isArray(e)?e:[e]}else r=t;return filterDuplicates(r)}function setupIntegrations(e,t){let n={};return t.forEach(t=>{t&&setupIntegration(e,t,n)}),n}function afterSetupIntegrations(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function setupIntegration(e,t,n){if(n[t.name]){v&&xe.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,ox.indexOf(t.name)===-1&&typeof t.setupOnce==`function`&&(t.setupOnce(),ox.push(t.name)),t.setup&&typeof t.setup==`function`&&t.setup(e),typeof t.preprocessEvent==`function`){let n=t.preprocessEvent.bind(t);e.on(`preprocessEvent`,(t,r)=>n(t,r,e))}if(typeof t.processEvent==`function`){let n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}v&&xe.log(`Integration installed: ${t.name}`)}function defineIntegration(e){return e}function createClientReportEnvelope(e,t,n){let r=[{type:`client_report`},{timestamp:n||dt(),discarded_events:e}];return createEnvelope(t?{dsn:t}:{},[r])}function getPossibleEventMessages(e){let t=[];e.message&&t.push(e.message);try{let n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function convertTransactionEventToSpanJson(e){let{trace_id:t,parent_span_id:n,span_id:r,status:i,origin:o,data:s,op:p}=e.contexts?.trace??{};return{data:s??{},description:e.transaction,op:p,parent_span_id:n,span_id:r??``,start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:t??``,origin:o,profile_id:s?.[Ie],exclusive_time:s?.[c],measurements:e.measurements,is_segment:!0}}function convertSpanJsonToTransactionEvent(e){return{type:`transaction`,timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{"sentry.profile_id":e.profile_id},...e.exclusive_time&&{"sentry.exclusive_time":e.exclusive_time}}}},measurements:e.measurements}}var sx=`Not capturing exception because it's already been captured.`,cx=`Discarded session because of missing or non-string release`,lx=Symbol.for(`SentryInternalError`),ux=Symbol.for(`SentryDoNotSendEventError`);function _makeInternalError(e){return{message:e,[lx]:!0}}function _makeDoNotSendEventError(e){return{message:e,[ux]:!0}}function _isInternalError(e){return!!e&&typeof e==`object`&&lx in e}function _isDoNotSendEventError(e){return!!e&&typeof e==`object`&&ux in e}var Client=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=_(e.dsn):v&&xe.warn(`No DSN provided, client will not send events.`),this._dsn){let t=getEnvelopeEndpointWithUrlEncodedAuth(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,n){let r=C();if(fe(e))return v&&xe.log(sx),r;let i={event_id:r,...t};return this._process(this.eventFromException(e,i).then(e=>this._captureEvent(e,i,n))),i.event_id}captureMessage(e,t,n,r){let i={event_id:C(),...n},o=Ce(e)?e:String(e),s=et(e)?this.eventFromMessage(o,t,i):this.eventFromException(e,i);return this._process(s.then(e=>this._captureEvent(e,i,r))),i.event_id}captureEvent(e,t,n){let r=C();if(t?.originalException&&fe(t.originalException))return v&&xe.log(sx),r;let i={event_id:r,...t},o=e.sdkProcessingMetadata||{},s=o.capturedSpanScope,c=o.capturedSpanIsolationScope;return this._process(this._captureEvent(e,i,s||n,c)),i.event_id}captureSession(e){this.sendSession(e),se(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let t=this._transport;
204return t?(this.emit(`flush`),this._isClientDoneProcessing(e).then(n=>t.flush(e).then(e=>n&&e))):le(!0)}close(e){return this.flush(e).then(e=>(this.getOptions().enabled=!1,this.emit(`close`),e))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith(`Spotlight`)))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){let t=this._integrations[e.name];setupIntegration(this,e,this._integrations),t||afterSetupIntegrations(this,[e])}sendEvent(e,t={}){this.emit(`beforeSendEvent`,e,t);let n=createEventEnvelope(e,this._dsn,this._options._metadata,this._options.tunnel);for(let e of t.attachments||[])n=addItemToEnvelope(n,createAttachmentEnvelopeItem(e));let r=this.sendEnvelope(n);r&&r.then(t=>this.emit(`afterSendEvent`,e,t),null)}sendSession(e){let{release:t,environment:n=re}=this._options;if(`aggregates`in e){let r=e.attrs||{};if(!r.release&&!t){v&&xe.warn(cx);return}r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t){v&&xe.warn(cx);return}e.release=e.release||t,e.environment=e.environment||n}this.emit(`beforeSendSession`,e);let r=createSessionEnvelope(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,n=1){if(this._options.sendClientReports){let r=`${e}:${t}`;v&&xe.log(`Recording outcome: "${r}"${n>1?` (${n} times)`:``}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){let n=this._hooks[e]=this._hooks[e]||[];return n.push(t),()=>{let e=n.indexOf(t);e>-1&&n.splice(e,1)}}emit(e,...t){let n=this._hooks[e];n&&n.forEach(e=>e(...t))}sendEnvelope(e){return this.emit(`beforeEnvelope`,e),this._isEnabled()&&this._transport?this._transport.send(e).then(null,e=>(v&&xe.error(`Error while sending envelope:`,e),e)):(v&&xe.error(`Transport disabled`),le({}))}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=setupIntegrations(this,e),afterSetupIntegrations(this,e)}_updateSessionFromEvent(e,t){let n=t.level===`fatal`,r=!1,i=t.exception?.values;if(i){r=!0;for(let e of i)if(e.mechanism?.handled===!1){n=!0;break}}let o=e.status===`ok`;(o&&e.errors===0||o&&n)&&(se(e,{...n&&{status:`crashed`},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Se(t=>{let n=0,r=setInterval(()=>{this._numProcessing==0?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))},1)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,n,r){let i=this.getOptions(),o=Object.keys(this._integrations);return!t.integrations&&o?.length&&(t.integrations=o),this.emit(`preprocessEvent`,e,t),e.type||r.setLastEventId(e.event_id||t.event_id),ct(i,e,t,n,this,r).then(e=>e===null?e:(this.emit(`postprocessEvent`,e,t),e.contexts={trace:x(n),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:de(this,n),...e.sdkProcessingMetadata},e))}_captureEvent(e,t={},n=M(),r=ie()){return v&&isErrorEvent(e)&&xe.log(`Captured error event \`${getPossibleEventMessages(e)[0]||`<unknown>`}\``),this._processEvent(e,t,n,r).then(e=>e.event_id,e=>{v&&(_isDoNotSendEventError(e)?xe.log(e.message):_isInternalError(e)?xe.warn(e.message):xe.warn(e))})}_processEvent(e,t,n,r){let i=this.getOptions(),{sampleRate:o}=i,s=isTransactionEvent(e),c=isErrorEvent(e),p=e.type||`error`,m=`before send for type \`${p}\``,h=o===void 0?void 0:parseSampleRate(o);if(c&&typeof h==`number`&&Math.random()>h)return this.recordDroppedEvent(`sample_rate`,`error`),ot(_makeDoNotSendEventError(`Discarding event because it's not included in the random sample (sampling rate = ${o})`));let g=p===`replay_event`?`replay`:p;return this._prepareEvent(e,t,n,r).then(e=>{if(e===null)throw this.recordDroppedEvent(`event_processor`,g),_makeDoNotSendEventError("An event processor returned `null`, will not send event.");return t.data&&t.data.__sentry__===!0?e:_validateBeforeSendResult(processBeforeSend(this,i,e,t),m)}).then(i=>{if(i===null){if(this.recordDroppedEvent(`before_send`,g),s){let t=1+(e.spans||[]).length;this.recordDroppedEvent(`before_send`,`span`,t)}throw _makeDoNotSendEventError(`${m} returned \`null\`, will not send event.`)}
204let o=n.getSession()||r.getSession();if(c&&o&&this._updateSessionFromEvent(o,i),s){let e=(i.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(i.spans?i.spans.length:0);e>0&&this.recordDroppedEvent(`before_send`,`span`,e)}let p=i.transaction_info;return s&&p&&i.transaction!==e.transaction&&(i.transaction_info={...p,source:`custom`}),this.sendEvent(i,t),i}).then(null,e=>{throw _isDoNotSendEventError(e)||_isInternalError(e)?e:(this.captureException(e,{data:{__sentry__:!0},originalException:e}),_makeInternalError(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`))})}_process(e){this._numProcessing++,e.then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{let[n,r]=e.split(`:`);return{reason:n,category:r,quantity:t}})}_flushOutcomes(){v&&xe.log(`Flushing outcomes...`);let e=this._clearOutcomes();if(e.length===0){v&&xe.log(`No outcomes to send`);return}if(!this._dsn){v&&xe.log(`No dsn provided, will not send outcomes`);return}v&&xe.log(`Sending outcomes:`,e);let t=createClientReportEnvelope(e,this._options.tunnel&&y(this._dsn));this.sendEnvelope(t)}};function _validateBeforeSendResult(e,t){let n=`${t} must return \`null\` or a valid event.`;if(Ke(e))return e.then(e=>{if(!ze(e)&&e!==null)throw _makeInternalError(n);return e},e=>{throw _makeInternalError(`${t} rejected with ${e}`)});if(!ze(e)&&e!==null)throw _makeInternalError(n);return e}function processBeforeSend(e,t,n,r){let{beforeSend:i,beforeSendTransaction:o,beforeSendSpan:s}=t,c=n;if(isErrorEvent(c)&&i)return i(c,r);if(isTransactionEvent(c)){if(s){let e=s(convertTransactionEventToSpanJson(c));if(e?c=te(n,convertSpanJsonToTransactionEvent(e)):Le(),c.spans){let e=[];for(let t of c.spans){let n=s(t);n?e.push(n):(Le(),e.push(t))}c.spans=e}}if(o){if(c.spans){let e=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return o(c,r)}}return c}function isErrorEvent(e){return e.type===void 0}function isTransactionEvent(e){return e.type===`transaction`}function createLogContainerEnvelopeItem(e){return[{type:`log`,item_count:e.length,content_type:`application/vnd.sentry.items.log+json`},{items:e}]}function createLogEnvelope(e,t,n,r){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=y(r)),createEnvelope(i,[createLogContainerEnvelopeItem(e)])}function _INTERNAL_flushLogsBuffer(e,t){let n=t??_INTERNAL_getLogBuffer(e)??[];if(n.length===0)return;let r=e.getOptions(),i=createLogEnvelope(n,r._metadata,r.tunnel,e.getDsn());_getBufferMap().set(e,[]),e.emit(`flushLogs`),e.sendEnvelope(i)}function _INTERNAL_getLogBuffer(e){return _getBufferMap().get(e)}function _getBufferMap(){return ce(`clientToLogBufferMap`,()=>new WeakMap)}function initAndBind(e,t){t.debug===!0&&(v?xe.enable():st(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),M().update(t.initialScope);let n=new e(t);return setCurrentClient(n),n.init(),n}function setCurrentClient(e){M().setClient(e)}var dx=Symbol.for(`SentryBufferFullError`);function makePromiseBuffer(e){let t=[];function isReady(){return e===void 0||t.length<e}function remove(e){return t.splice(t.indexOf(e),1)[0]||Promise.resolve(void 0)}function add(e){if(!isReady())return ot(dx);let n=e();return t.indexOf(n)===-1&&t.push(n),n.then(()=>remove(n)).then(null,()=>remove(n).then(null,()=>{})),n}function drain(e){return new Se((n,r)=>{let i=t.length;if(!i)return n(!0);let o=setTimeout(()=>{e&&e>0&&n(!1)},e);t.forEach(e=>{le(e).then(()=>{--i||(clearTimeout(o),n(!0))},r)})})}return{$:t,add,drain}}var fx=6e4;function parseRetryAfterHeader(e,t=Date.now()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?fx:r-t}function disabledUntil(e,t){return e[t]||e.all||0}function isRateLimited(e,t,n=Date.now()){return disabledUntil(e,t)>n}function updateRateLimits(e,{statusCode:t,headers:n},r=Date.now()){let i={...e},o=n?.[`x-sentry-rate-limits`],s=n?.[`retry-after`];if(o)for(let e of o.trim().split(`,`)){let[t,n,,,o]=e.split(`:`,5),s=parseInt(t,10),c=(isNaN(s)?60:s)*1e3;if(!n)i.all=r+c;else for(let e of n.split(`;`))e===`metric_bucket`?(!o||o.split(`;`).includes(`custom`))&&(i[e]=r+c):i[e]=r+c}else s?i.all=r+parseRetryAfterHeader(s,r):t===429&&(i.all=r+6e4);return i}function createTransport(e,t,n=makePromiseBuffer(e.bufferSize||64)){let r={},flush=e=>n.drain(e);function send(i){let o=[];if(forEachEnvelopeItem(i,(t,n)=>{let i=envelopeItemTypeToDataCategory(n);isRateLimited(r,i)?e.recordDroppedEvent(`ratelimit_backoff`,i):o.push(t)}),o.length===0)return le({});let s=createEnvelope(i[0],o),recordEnvelopeLoss=t=>{forEachEnvelopeItem(s,(n,r)=>{e.recordDroppedEvent(t,envelopeItemTypeToDataCategory(r))})},requestTask=()=>t({body:serializeEnvelope(s)}).then(e=>(e.statusCode!==void 0&&(e.statusCode<200||e.statusCode>=300)&&v&&xe.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=updateRateLimits(r,e),e),e=>
204{throw recordEnvelopeLoss(`network_error`),v&&xe.error(`Encountered error running transport request:`,e),e});return n.add(requestTask).then(e=>e,e=>{if(e===dx)return v&&xe.error(`Skipped sending event because buffer is full.`),recordEnvelopeLoss(`queue_overflow`),le({});throw e})}return{send,flush}}function addAutoIpAddressToUser(e){e.user?.ip_address===void 0&&(e.user={...e.user,ip_address:`{{auto}}`})}function addAutoIpAddressToSession(e){`aggregates`in e?e.attrs?.ip_address===void 0&&(e.attrs={...e.attrs,ip_address:`{{auto}}`}):e.ipAddress===void 0&&(e.ipAddress=`{{auto}}`)}function applySdkMetadata(e,t,n=[t],r=`npm`){let i=e._metadata||{};i.sdk||={name:`sentry.javascript.${t}`,packages:n.map(e=>({name:`${r}:@sentry/${e}`,version:rt})),version:rt},e._metadata=i}var px=100;function addBreadcrumb(e,t){let n=j(),r=ie();if(!n)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:o=px}=n.getOptions();if(o<=0)return;let s={timestamp:dt(),...e},c=i?st(()=>i(s,t)):s;c!==null&&(n.emit&&n.emit(`beforeAddBreadcrumb`,c,t),r.addBreadcrumb(c,o))}var mx,hx=`FunctionToString`,gx=new WeakMap,_functionToStringIntegration=(()=>({name:hx,setupOnce(){mx=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=ge(this),n=gx.has(j())&&t!==void 0?t:this;return mx.apply(n,e)}}catch{}},setup(e){gx.set(e,!0)}})),_x=defineIntegration(_functionToStringIntegration),vx=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,`can't redefine non-configurable property "solana"`,`vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)`,`Can't find variable: _AutofillCallbackHandler`,/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],yx=`EventFilters`,bx=defineIntegration((e={})=>{let t;return{name:yx,setup(n){t=_mergeOptions(e,n.getOptions())},processEvent(n,r,i){return t||=_mergeOptions(e,i.getOptions()),_shouldDropEvent$1(n,t)?null:n}}}),xx=defineIntegration(((e={})=>({...bx(e),name:`InboundFilters`})));function _mergeOptions(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:vx],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function _shouldDropEvent$1(e,t){if(!e.type){if(_isIgnoredError(e,t.ignoreErrors))return v&&xe.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${me(e)}`),!0;if(_isUselessError(e))return v&&xe.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${me(e)}`),!0;if(_isDeniedUrl(e,t.denyUrls))return v&&xe.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${me(e)}.\nUrl: ${_getEventFilterUrl(e)}`),!0;if(!_isAllowedUrl(e,t.allowUrls))return v&&xe.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${me(e)}.\nUrl: ${_getEventFilterUrl(e)}`),!0}else if(e.type===`transaction`&&_isIgnoredTransaction(e,t.ignoreTransactions))return v&&xe.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${me(e)}`),!0;return!1}e(_shouldDropEvent$1,`_shouldDropEvent`);function _isIgnoredError(e,t){return t?.length?getPossibleEventMessages(e).some(e=>ae(e,t)):!1}function _isIgnoredTransaction(e,t){if(!t?.length)return!1;let n=e.transaction;return n?ae(n,t):!1}function _isDeniedUrl(e,t){if(!t?.length)return!1;let n=_getEventFilterUrl(e);return n?ae(n,t):!1}function _isAllowedUrl(e,t){if(!t?.length)return!0;let n=_getEventFilterUrl(e);return!n||ae(n,t)}function _getLastValidUrl(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!==`<anonymous>`&&n.filename!==`[native code]`)return n.filename||null}return null}function _getEventFilterUrl(e){try{let t=[...e.exception?.values??[]].reverse().find(e=>e.mechanism?.parent_id===void 0&&e.stacktrace?.frames?.length)?.stacktrace?.frames;return t?_getLastValidUrl(t):null}catch{return v&&xe.error(`Cannot extract url for event ${me(e)}`),null}}function _isUselessError(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&e.type!==`Error`||e.value):!1}function applyAggregateErrorsToEvent(e,t,n,r,i,o){if(!i.exception?.values||!o||!Ze(o.originalException,Error))return;let s=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;s&&(i.exception.values=aggregateExceptionsFromError(e,t,r,o.originalException,n,i.exception.values,s,0))}function aggregateExceptionsFromError(e,t,n,r,i,o,s,c){if(o.length>=n+1)return o;let p=[...o];if(Ze(r[i],Error)){applyExceptionGroupFieldsForParentException(s,c);let o=e(t,r[i]),m=p.length;applyExceptionGroupFieldsForChildException(o,i,m,c),p=aggregateExceptionsFromError(e,t,n,r[i],i,[o,...p],o,m)}
204return Array.isArray(r.errors)&&r.errors.forEach((r,o)=>{if(Ze(r,Error)){applyExceptionGroupFieldsForParentException(s,c);let m=e(t,r),h=p.length;applyExceptionGroupFieldsForChildException(m,`errors[${o}]`,h,c),p=aggregateExceptionsFromError(e,t,n,r,i,[m,...p],m,h)}}),p}function applyExceptionGroupFieldsForParentException(e,t){e.mechanism=e.mechanism||{type:`generic`,handled:!0},e.mechanism={...e.mechanism,...e.type===`AggregateError`&&{is_exception_group:!0},exception_id:t}}function applyExceptionGroupFieldsForChildException(e,t,n,r){e.mechanism=e.mechanism||{type:`generic`,handled:!0},e.mechanism={...e.mechanism,type:`chained`,source:t,exception_id:n,parent_id:r}}function addConsoleInstrumentationHandler(e){let t=`console`;addHandler(t,e),maybeInstrument(t,instrumentConsole)}function instrumentConsole(){`console`in ue&&tt.forEach(function(e){e in ue.console&&D(ue.console,e,function(t){return at[e]=t,function(...t){triggerHandlers(`console`,{args:t,level:e}),at[e]?.apply(ue.console,t)}})})}function severityLevelFromString(e){return e===`warn`?`warning`:[`fatal`,`error`,`warning`,`log`,`info`,`debug`].includes(e)?e:`log`}var Sx=`Dedupe`,_dedupeIntegration=(()=>{let e;return{name:Sx,processEvent(t){if(t.type)return t;try{if(_shouldDropEvent(t,e))return v&&xe.warn(`Event dropped due to being a duplicate of previously captured event.`),null}catch{}return e=t}}}),Cx=defineIntegration(_dedupeIntegration);function _shouldDropEvent(e,t){return t?!!(_isSameMessageEvent(e,t)||_isSameExceptionEvent(e,t)):!1}function _isSameMessageEvent(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!_isSameFingerprint(e,t)||!_isSameStacktrace(e,t))}function _isSameExceptionEvent(e,t){let n=_getExceptionFromEvent(t),r=_getExceptionFromEvent(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!_isSameFingerprint(e,t)||!_isSameStacktrace(e,t))}function _isSameStacktrace(e,t){let n=je(e),r=je(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let e=0;e<r.length;e++){let t=r[e],i=n[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function _isSameFingerprint(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join(``)===r.join(``)}catch{return!1}}function _getExceptionFromEvent(e){return e.exception?.values?.[0]}function parseUrl(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||``,r=t[8]||``;return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function getBreadcrumbLogLevelFromHttpStatusCode(e){if(e!==void 0){if(e>=400&&e<500)return`warning`;if(e>=500)return`error`}}var wx=ue;function supportsHistory(){return`history`in wx&&!!wx.history}function _isFetchSupported(){if(!(`fetch`in wx))return!1;try{return new Headers,new Request(`http://www.example.com`),new Response,!0}catch{return!1}}function isNativeFunction(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function supportsNativeFetch(){if(typeof EdgeRuntime==`string`)return!0;if(!_isFetchSupported())return!1;if(isNativeFunction(wx.fetch))return!0;let e=!1,t=wx.document;if(t&&typeof t.createElement==`function`)try{let n=t.createElement(`iframe`);n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=isNativeFunction(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){v&&xe.warn(`Could not create sandbox iframe for pure fetch check, bailing to window.fetch: `,e)}return e}function addFetchInstrumentationHandler(e,t){let n=`fetch`;addHandler(n,e),maybeInstrument(n,()=>instrumentFetch(void 0,t))}function instrumentFetch(e,t=!1){t&&!supportsNativeFetch()||D(ue,`fetch`,function(t){return function(...n){let r=Error(),{method:i,url:o}=parseFetchArgs(n),s={args:n,fetchData:{method:i,url:o},startTimestamp:p()*1e3,virtualError:r,headers:getHeadersFromFetchArgs(n)};return e||triggerHandlers(`fetch`,{...s}),t.apply(ue,n).then(async t=>(e?e(t):triggerHandlers(`fetch`,{...s,endTimestamp:p()*1e3,response:t}),t),e=>{if(triggerHandlers(`fetch`,{...s,endTimestamp:p()*1e3,error:e}),Ne(e)&&e.stack===void 0&&(e.stack=r.stack,k(e,`framesToPop`,1)),e instanceof TypeError&&(e.message===`Failed to fetch`||e.message===`Load failed`||e.message===`NetworkError when attempting to fetch resource.`))try{let t=new URL(s.fetchData.url);e.message=`${e.message} (${t.host})`}catch{}throw e})}})}function hasProp(e,t){return!!e&&typeof e==`object`&&!!e[t]}function getUrlFromResource(e){return typeof e==`string`?e:e?hasProp(e,`url`)?e.url:e.toString?e.toString():``:``}function parseFetchArgs(e){if(e.length===0)return{method:`GET`,url:``};if(e.length===2){let[t,n]=e;return{url:getUrlFromResource(t),method:hasProp(n,`method`)?String(n.method).toUpperCase():`GET`}}let t=e[0];return{url:getUrlFromResource(t),method:hasProp(t,`method`)?String(t.method).toUpperCase():`GET`}}function getHeadersFromFetchArgs(e){let[t,n]=e;try{if(typeof n==`object`&&n&&`headers`in n&&n.headers)return new Headers(n.headers);if(we(t))return new Headers(t.headers)}catch{}}function getSDKSource(){return`npm`}var Tx=ue,Ex=0;function shouldIgnoreOnError(){return Ex>0}function ignoreNextOnError(){Ex++,setTimeout(()=>{Ex--})}function wrap(e,t={}){function isFunction(e){return typeof e==`function`}if(!isFunction(e))return e;try{let t=e.__sentry_wrapped__;if(t)return typeof t==`function`?t:e;if(ge(e))return e}catch{return e}let sentryWrapped=function(...n){try{let r=n.map(e=>wrap(e,t));return e.apply(this,r)}catch(e){throw ignoreNextOnError(),E(r=>{r.addEventProcessor(e=>(t.mechanism&&(w(e,void 0,void 0),pe(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),Oe(e)}),e}};try{for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(sentryWrapped[t]=e[t])}catch{}he(sentryWrapped,e),k(e,`__sentry_wrapped__`,sentryWrapped);try{Object.getOwnPropertyDescriptor(sentryWrapped,`name`).configurable&&Object.defineProperty(sentryWrapped,"name",{get(){return e.name}})}catch{}return sentryWrapped}function getHttpRequestData(){let e=Ee(),{referrer:t}=Tx.document||{},{userAgent:n}=Tx.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}function exceptionFromError(e,t){let n=parseStackFrames(e,t),r={type:extractType(t),value:extractMessage(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===``&&(r.value=`Unrecoverable error caught`),r}function eventFromPlainObject(e,t,n,r){let i=j()?.getOptions().normalizeDepth,o=getErrorPropertyFromObject(t),s={__serialized__:it(t,i)};if(o)return{exception:{values:[exceptionFromError(e,o)]},extra:s};let c={exception:{values:[{type:We(t)?t.constructor.name:r?`UnhandledRejection`:`Error`,value:getNonErrorObjectExceptionValue(t,{isUnhandledRejection:r})}]},extra:s};if(n){let t=parseStackFrames(e,n);t.length&&(c.exception.values[0].stacktrace={frames:t})}return c}function eventFromError(e,t){return{exception:{values:[exceptionFromError(e,t)]}}}function parseStackFrames(e,t){let n=t.stacktrace||t.stack||``,r=getSkipFirstStackStringLines(t),i=getPopFirstTopFrames(t);try{return e(n,r,i)}catch{}return[]}var Dx=/Minified React error #\d+;/i;function getSkipFirstStackStringLines(e){return e&&Dx.test(e.message)?1:0}function getPopFirstTopFrames(e){return typeof e.framesToPop==`number`?e.framesToPop:0}function isWebAssemblyException(e){return typeof WebAssembly<`u`&&WebAssembly.Exception!==void 0&&e instanceof WebAssembly.Exception}function extractType(e){let t=e?.name;return!t&&isWebAssemblyException(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:`WebAssembly.Exception`:t}function extractMessage(e){let t=e?.message;return isWebAssemblyException(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:`wasm exception`:t?t.error&&typeof t.error.message==`string`?t.error.message:t:`No error message`}function eventFromException(e,t,n,r){let i=eventFromUnknownInput(e,t,n?.syntheticException||void 0,r);
204return pe(i),i.level=`error`,n?.event_id&&(i.event_id=n.event_id),le(i)}function eventFromMessage(e,t,n=`info`,r,i){let o=eventFromString(e,t,r?.syntheticException||void 0,i);return o.level=n,r?.event_id&&(o.event_id=r.event_id),le(o)}function eventFromUnknownInput(e,t,n,r,i){let o;if(be(t)&&t.error)return eventFromError(e,t.error);if(He(t)||Ye(t)){let i=t;if(`stack`in t)o=eventFromError(e,t);else{let t=i.name||(He(i)?`DOMError`:`DOMException`),s=i.message?`${t}: ${i.message}`:t;o=eventFromString(e,s,n,r),w(o,s)}return`code`in i&&(o.tags={...o.tags,"DOMException.code":`${i.code}`}),o}return Ne(t)?eventFromError(e,t):ze(t)||We(t)?(o=eventFromPlainObject(e,t,n,i),pe(o,{synthetic:!0}),o):(o=eventFromString(e,t,n,r),w(o,`${t}`,void 0),pe(o,{synthetic:!0}),o)}function eventFromString(e,t,n,r){let i={};if(r&&n){let r=parseStackFrames(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]}),pe(i,{synthetic:!0})}if(Ce(t)){let{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}function getNonErrorObjectExceptionValue(e,{isUnhandledRejection:t}){let n=Je(e),r=t?`promise rejection`:`exception`;return be(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:We(e)?`Event \`${getObjectClassName(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function getObjectClassName(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function getErrorPropertyFromObject(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];if(n instanceof Error)return n}}var Ox=5e3,BrowserClient=class extends Client{constructor(e){let t=applyDefaultOptions(e);applySdkMetadata(t,`browser`,[`browser`],Tx.SENTRY_SDK_SOURCE||getSDKSource()),super(t);let{sendDefaultPii:n,sendClientReports:r,enableLogs:i,_experiments:o}=this._options,s=i??o?.enableLogs;Tx.document&&(r||s)&&Tx.document.addEventListener(`visibilitychange`,()=>{Tx.document.visibilityState===`hidden`&&(r&&this._flushOutcomes(),s&&_INTERNAL_flushLogsBuffer(this))}),s&&(this.on(`flush`,()=>{_INTERNAL_flushLogsBuffer(this)}),this.on(`afterCaptureLog`,()=>{this._logFlushIdleTimeout&&clearTimeout(this._logFlushIdleTimeout),this._logFlushIdleTimeout=setTimeout(()=>{_INTERNAL_flushLogsBuffer(this)},Ox)})),n&&(this.on(`postprocessEvent`,addAutoIpAddressToUser),this.on(`beforeSendSession`,addAutoIpAddressToSession))}eventFromException(e,t){return eventFromException(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t=`info`,n){return eventFromMessage(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||`javascript`,super._prepareEvent(e,t,n,r)}};function applyDefaultOptions(e){return{release:typeof __SENTRY_RELEASE__==`string`?__SENTRY_RELEASE__:Tx.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}var kx=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,Ax=ue,jx=1e3,Mx,Nx,Px;function addClickKeypressInstrumentationHandler(e){addHandler(`dom`,e),maybeInstrument(`dom`,instrumentDOM)}function instrumentDOM(){if(!Ax.document)return;let e=triggerHandlers.bind(null,`dom`),t=makeDOMEventHandler(e,!0);Ax.document.addEventListener(`click`,t,!1),Ax.document.addEventListener(`keypress`,t,!1),[`EventTarget`,`Node`].forEach(t=>{let n=Ax[t]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(D(n,`addEventListener`,function(t){return function(n,r,i){if(n===`click`||n==`keypress`)try{let r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},o=r[n]=r[n]||{refCount:0};if(!o.handler){let r=makeDOMEventHandler(e);o.handler=r,t.call(this,n,r,i)}o.refCount++}catch{}return t.call(this,n,r,i)}}),D(n,`removeEventListener`,function(e){return function(t,n,r){if(t===`click`||t==`keypress`)try{let n=this.__sentry_instrumentation_handlers__||{},i=n[t];i&&(i.refCount--,i.refCount<=0&&(e.call(this,t,i.handler,r),i.handler=void 0,delete n[t]),Object.keys(n).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function isSimilarToLastCapturedEvent(e){if(e.type!==Nx)return!1;try{if(!e.target||e.target._sentryId!==Px)return!1}catch{}return!0}function shouldSkipDOMEvent(e,t){return e===`keypress`?!t?.tagName||!(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable):!1}function makeDOMEventHandler(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=getEventTarget(n);if(shouldSkipDOMEvent(n.type,r))return;k(n,`_sentryCaptured`,!0),r&&!r._sentryId&&k(r,`_sentryId`,C());let i=n.type===`keypress`?`input`:n.type;isSimilarToLastCapturedEvent(n)||(e({event:n,name:i,global:t}
204),Nx=n.type,Px=r?r._sentryId:void 0),clearTimeout(Mx),Mx=Ax.setTimeout(()=>{Px=void 0,Nx=void 0},jx)}}function getEventTarget(e){try{return e.target}catch{return null}}var Fx;function addHistoryInstrumentationHandler(e){let t=`history`;addHandler(t,e),maybeInstrument(t,instrumentHistory)}function instrumentHistory(){if(Ax.addEventListener(`popstate`,()=>{let e=Ax.location.href,t=Fx;Fx=e,t!==e&&triggerHandlers(`history`,{from:t,to:e})}),!supportsHistory())return;function historyReplacementFunction(e){return function(...t){let n=t.length>2?t[2]:void 0;if(n){let r=Fx,i=getAbsoluteUrl(String(n));if(Fx=i,r===i)return e.apply(this,t);triggerHandlers(`history`,{from:r,to:i})}return e.apply(this,t)}}D(Ax.history,`pushState`,historyReplacementFunction),D(Ax.history,`replaceState`,historyReplacementFunction)}function getAbsoluteUrl(e){try{return new URL(e,Ax.location.origin).toString()}catch{return e}}var Ix={};function getNativeImplementation(e){let t=Ix[e];if(t)return t;let n=Ax[e];if(isNativeFunction(n))return Ix[e]=n.bind(Ax);let r=Ax.document;if(r&&typeof r.createElement==`function`)try{let t=r.createElement(`iframe`);t.hidden=!0,r.head.appendChild(t);let i=t.contentWindow;i?.[e]&&(n=i[e]),r.head.removeChild(t)}catch(t){kx&&xe.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n&&(Ix[e]=n.bind(Ax))}function clearCachedImplementation(e){Ix[e]=void 0}var Lx=`__sentry_xhr_v3__`;function addXhrInstrumentationHandler(e){addHandler(`xhr`,e),maybeInstrument(`xhr`,instrumentXHR)}function instrumentXHR(){if(!Ax.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){let r=Error(),i=p()*1e3,o=De(n[0])?n[0].toUpperCase():void 0,s=parseXhrUrlArg(n[1]);if(!o||!s)return e.apply(t,n);t[Lx]={method:o,url:s,request_headers:{}},o===`POST`&&s.match(/sentry_key/)&&(t.__sentry_own_request__=!0);let onreadystatechangeHandler=()=>{let e=t[Lx];if(e&&t.readyState===4){try{e.status_code=t.status}catch{}triggerHandlers(`xhr`,{endTimestamp:p()*1e3,startTimestamp:i,xhr:t,virtualError:r})}};return`onreadystatechange`in t&&typeof t.onreadystatechange==`function`?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply(e,t,n){return onreadystatechangeHandler(),e.apply(t,n)}}):t.addEventListener(`readystatechange`,onreadystatechangeHandler),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){let[r,i]=n,o=t[Lx];return o&&De(r)&&De(i)&&(o.request_headers[r.toLowerCase()]=i),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){let r=t[Lx];return r?(n[0]!==void 0&&(r.body=n[0]),triggerHandlers(`xhr`,{startTimestamp:p()*1e3,xhr:t}),e.apply(t,n)):e.apply(t,n)}})}function parseXhrUrlArg(e){if(De(e))return e;try{return e.toString()}catch{}}function makeFetchTransport(e,t=getNativeImplementation(`fetch`)){let n=0,r=0;function makeRequest(i){let o=i.body.length;n+=o,r++;let s={body:i.body,method:`POST`,referrerPolicy:`strict-origin`,headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};if(!t)return clearCachedImplementation(`fetch`),ot(`No fetch implementation available`);try{return t(e.url,s).then(e=>(n-=o,r--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get(`X-Sentry-Rate-Limits`),"retry-after":e.headers.get(`Retry-After`)}}))}catch(e){return clearCachedImplementation(`fetch`),n-=o,r--,ot(e)}}return createTransport(e,makeRequest)}var Rx=30,zx=50;function createFrame(e,t,n,r){let i={filename:e,function:t===`<anonymous>`?`?`:t,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var Bx=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Vx=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Hx=/\((\S*)(?::(\d+))(?::(\d+))\)/,chromeStackParserFn=e=>{let t=Bx.exec(e);if(t){let[,e,n,r]=t;return createFrame(e,`?`,+n,+r)}let n=Vx.exec(e);if(n){if(n[2]&&n[2].indexOf(`eval`)===0){let e=Hx.exec(n[2]);e&&(n[2]=e[1],n[3]=e[2],n[4]=e[3])}let[e,t]=extractSafariExtensionDetails(n[1]||`?`,n[2]);return createFrame(t,e,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},Ux=[Rx,chromeStackParserFn],Wx=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Gx=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,gecko=e=>{let t=Wx.exec(e);if(t){if(t[3]&&t[3].indexOf(` > eval`)>-1){let e=Gx.exec(t[3]);e&&(t[1]=t[1]||`eval`,t[3]=e[1],t[4]=e[2],t[5]=``)}let e=t[3],n=t[1]||`?`;
204return[n,e]=extractSafariExtensionDetails(n,e),createFrame(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},Kx=Be(Ux,[zx,gecko]),extractSafariExtensionDetails=(e,t)=>{let n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?`?`:e.split(`@`)[0],n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},qx=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,Jx=1024,Yx=`Breadcrumbs`,_breadcrumbsIntegration=((e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Yx,setup(e){t.console&&addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(e)),t.dom&&addClickKeypressInstrumentationHandler(_getDomBreadcrumbHandler(e,t.dom)),t.xhr&&addXhrInstrumentationHandler(_getXhrBreadcrumbHandler(e)),t.fetch&&addFetchInstrumentationHandler(_getFetchBreadcrumbHandler(e)),t.history&&addHistoryInstrumentationHandler(_getHistoryBreadcrumbHandler(e)),t.sentry&&e.on(`beforeSendEvent`,_getSentryBreadcrumbHandler(e))}}}),Xx=defineIntegration(_breadcrumbsIntegration);function _getSentryBreadcrumbHandler(e){return function addSentryBreadcrumb(t){j()===e&&addBreadcrumb({category:`sentry.${t.type===`transaction`?`transaction`:`event`}`,event_id:t.event_id,level:t.level,message:me(t)},{event:t})}}function _getDomBreadcrumbHandler(e,t){return function _innerDomBreadcrumb(n){if(j()!==e)return;let r,i,s=typeof t==`object`?t.serializeAttribute:void 0,c=typeof t==`object`&&typeof t.maxStringLength==`number`?t.maxStringLength:void 0;c&&c>Jx&&(qx&&xe.warn(`\`dom.maxStringLength\` cannot exceed ${Jx}, but a value of ${c} was configured. Sentry will use ${Jx} instead.`),c=Jx),typeof s==`string`&&(s=[s]);try{let e=n.event,t=_isEvent(e)?e.target:e;r=Qe(t,{keyAttrs:s,maxStringLength:c}),i=o(t)}catch{r=`<unknown>`}if(r.length===0)return;let p={category:`ui.${n.name}`,message:r};i&&(p.data={"ui.component_name":i}),addBreadcrumb(p,{event:n.event,name:n.name,global:n.global})}}function _getConsoleBreadcrumbHandler(e){return function _consoleBreadcrumb(t){if(j()!==e)return;let n={category:`console`,data:{arguments:t.args,logger:`console`},level:severityLevelFromString(t.level),message:_e(t.args,` `)};if(t.level===`assert`){if(t.args[0]===!1)n.message=`Assertion failed: ${_e(t.args.slice(1),` `)||`console.assert`}`,n.data.arguments=t.args.slice(1);else return}addBreadcrumb(n,{input:t.args,level:t.level})}}function _getXhrBreadcrumbHandler(e){return function _xhrBreadcrumb(t){if(j()!==e)return;let{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[Lx];if(!n||!r||!i)return;let{method:o,url:s,status_code:c,body:p}=i,m={method:o,url:s,status_code:c},h={xhr:t.xhr,input:p,startTimestamp:n,endTimestamp:r},g={category:`xhr`,data:m,type:`http`,level:getBreadcrumbLogLevelFromHttpStatusCode(c)};e.emit(`beforeOutgoingRequestBreadcrumb`,g,h),addBreadcrumb(g,h)}}function _getFetchBreadcrumbHandler(e){return function _fetchBreadcrumb(t){if(j()!==e)return;let{startTimestamp:n,endTimestamp:r}=t;if(r&&!(t.fetchData.url.match(/sentry_key/)&&t.fetchData.method===`POST`)){if(t.fetchData.method,t.fetchData.url,t.error){let i=t.fetchData,o={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},s={category:`fetch`,data:i,level:`error`,type:`http`};e.emit(`beforeOutgoingRequestBreadcrumb`,s,o),addBreadcrumb(s,o)}else{let i=t.response,o={...t.fetchData,status_code:i?.status};t.fetchData.request_body_size,t.fetchData.response_body_size,i?.status;let s={input:t.args,response:i,startTimestamp:n,endTimestamp:r},c={category:`fetch`,data:o,type:`http`,level:getBreadcrumbLogLevelFromHttpStatusCode(o.status_code)};e.emit(`beforeOutgoingRequestBreadcrumb`,c,s),addBreadcrumb(c,s)}}}}function _getHistoryBreadcrumbHandler(e){return function _historyBreadcrumb(t){if(j()!==e)return;let n=t.from,r=t.to,i=parseUrl(Tx.location.href),o=n?parseUrl(n):void 0,s=parseUrl(r);o?.path||(o=i),i.protocol===s.protocol&&i.host===s.host&&(r=s.relative),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),addBreadcrumb({category:`navigation`,data:{from:n,to:r}})}}function _isEvent(e){return!!e&&!!e.target}var Zx=`EventTarget.Window.Node.ApplicationCache.AudioTrackList.BroadcastChannel.ChannelMergerNode.CryptoOperation.EventSource.FileReader.HTMLUnknownElement.IDBDatabase.IDBRequest.IDBTransaction.Ke
204yOperation.MediaController.MessagePort.ModalWindow.Notification.SVGElementInstance.Screen.SharedWorker.TextTrack.TextTrackCue.TextTrackList.WebSocket.WebSocketWorker.Worker.XMLHttpRequest.XMLHttpRequestEventTarget.XMLHttpRequestUpload`.split(`.`),Qx=`BrowserApiErrors`,_browserApiErrorsIntegration=((e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:Qx,setupOnce(){t.setTimeout&&D(Tx,`setTimeout`,_wrapTimeFunction),t.setInterval&&D(Tx,`setInterval`,_wrapTimeFunction),t.requestAnimationFrame&&D(Tx,`requestAnimationFrame`,_wrapRAF),t.XMLHttpRequest&&`XMLHttpRequest`in Tx&&D(XMLHttpRequest.prototype,`send`,_wrapXHR);let e=t.eventTarget;e&&(Array.isArray(e)?e:Zx).forEach(e=>_wrapEventTarget(e,t))}}}),$x=defineIntegration(_browserApiErrorsIntegration);function _wrapTimeFunction(e){return function(...t){let n=t[0];return t[0]=wrap(n,{mechanism:{data:{function:ke(e)},handled:!1,type:`instrument`}}),e.apply(this,t)}}function _wrapRAF(e){return function(t){return e.apply(this,[wrap(t,{mechanism:{data:{function:`requestAnimationFrame`,handler:ke(e)},handled:!1,type:`instrument`}})])}}function _wrapXHR(e){return function(...t){let n=this;return[`onload`,`onerror`,`onprogress`,`onreadystatechange`].forEach(e=>{e in n&&typeof n[e]==`function`&&D(n,e,function(t){let n={mechanism:{data:{function:e,handler:ke(t)},handled:!1,type:`instrument`}},r=ge(t);return r&&(n.mechanism.data.handler=ke(r)),wrap(t,n)})}),e.apply(this,t)}}function _wrapEventTarget(e,t){let n=Tx[e]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(D(n,`addEventListener`,function(n){return function(r,i,o){try{isEventListenerObject(i)&&(i.handleEvent=wrap(i.handleEvent,{mechanism:{data:{function:`handleEvent`,handler:ke(i),target:e},handled:!1,type:`instrument`}}))}catch{}return t.unregisterOriginalCallbacks&&unregisterOriginalCallback(this,r,i),n.apply(this,[r,wrap(i,{mechanism:{data:{function:`addEventListener`,handler:ke(i),target:e},handled:!1,type:`instrument`}}),o])}}),D(n,`removeEventListener`,function(e){return function(t,n,r){try{let i=n.__sentry_wrapped__;i&&e.call(this,t,i,r)}catch{}return e.call(this,t,n,r)}}))}function isEventListenerObject(e){return typeof e.handleEvent==`function`}function unregisterOriginalCallback(e,t,n){e&&typeof e==`object`&&`removeEventListener`in e&&typeof e.removeEventListener==`function`&&e.removeEventListener(t,n)}
204var eS=defineIntegration(()=>({name:`BrowserSession`,setupOnce(){if(Tx.document===void 0){qx&&xe.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}nt({ignoreDuration:!0}),Ve(),addHistoryInstrumentationHandler(({from:e,to:t})=>{e!==void 0&&e!==t&&(nt({ignoreDuration:!0}),Ve())})}})),tS=`GlobalHandlers`,_globalHandlersIntegration=((e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:tS,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(_installGlobalOnErrorHandler(e),globalHandlerLog(`onerror`)),t.onunhandledrejection&&(_installGlobalOnUnhandledRejectionHandler(e),globalHandlerLog(`onunhandledrejection`))}}}),nS=defineIntegration(_globalHandlersIntegration);function _installGlobalOnErrorHandler(e){addGlobalErrorInstrumentationHandler(t=>{let{stackParser:n,attachStacktrace:r}=getOptions();if(j()!==e||shouldIgnoreOnError())return;let{msg:i,url:o,line:s,column:c,error:p}=t,m=_enhanceEventWithInitialFrame(eventFromUnknownInput(n,p||i,void 0,r,!1),o,s,c);m.level=`error`,Te(m,{originalException:p,mechanism:{handled:!1,type:`onerror`}})})}function _installGlobalOnUnhandledRejectionHandler(e){addGlobalUnhandledRejectionInstrumentationHandler(t=>{let{stackParser:n,attachStacktrace:r}=getOptions();if(j()!==e||shouldIgnoreOnError())return;let i=_getUnhandledRejectionError(t),o=et(i)?_eventFromRejectionWithPrimitive(i):eventFromUnknownInput(n,i,void 0,r,!0);o.level=`error`,Te(o,{originalException:i,mechanism:{handled:!1,type:`onunhandledrejection`}})})}function _getUnhandledRejectionError(e){if(et(e))return e;try{if(`reason`in e)return e.reason;if(`detail`in e&&`reason`in e.detail)return e.detail.reason}catch{}return e}function _eventFromRejectionWithPrimitive(e){return{exception:{values:[{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function _enhanceEventWithInitialFrame(e,t,n,r){let i=e.exception=e.exception||{},o=i.values=i.values||[],s=o[0]=o[0]||{},c=s.stacktrace=s.stacktrace||{},p=c.frames=c.frames||[],m=r,h=n,g=De(t)&&t.length>0?t:Ee();return p.length===0&&p.push({colno:m,filename:g,function:`?`,in_app:!0,lineno:h}),e}function globalHandlerLog(e){qx&&xe.log(`Global Handler attached: ${e}`)}function getOptions(){return j()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}var rS=defineIntegration(()=>({name:`HttpContext`,preprocessEvent(e){if(!Tx.navigator&&!Tx.location&&!Tx.document)return;let t=getHttpRequestData(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}})),iS=`cause`,aS=5,oS=`LinkedErrors`,_linkedErrorsIntegration=((e={})=>{let t=e.limit||aS,n=e.key||iS;return{name:oS,preprocessEvent(e,r,i){applyAggregateErrorsToEvent(exceptionFromError,i.getOptions().stackParser,n,t,e,r)}}}),sS=defineIntegration(_linkedErrorsIntegration);function checkAndWarnIfIsEmbeddedBrowserExtension(){return _isEmbeddedBrowserExtension()?(qx&&st(()=>{console.error(`[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/`)}),!0):!1}function _isEmbeddedBrowserExtension(){if(Tx.window===void 0)return!1;let e=Tx;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;let t=Ee();return!(Tx===Tx.top&&[`chrome-extension`,`moz-extension`,`ms-browser-extension`,`safari-web-extension`].some(e=>
204t.startsWith(`${e}://`)))}function getDefaultIntegrations(e){return[xx(),_x(),$x(),Xx(),nS(),sS(),Cx(),rS(),eS()]}function init$1(e={}){let t=!e.skipBrowserExtensionCheck&&checkAndWarnIfIsEmbeddedBrowserExtension();return initAndBind(BrowserClient,{...e,enabled:!t&&e.enabled,stackParser:ve(e.stackParser||Kx),integrations:getIntegrationsToSetup({integrations:e.integrations,defaultIntegrations:e.defaultIntegrations==null?getDefaultIntegrations():e.defaultIntegrations}),transport:e.transport||makeFetchTransport})}e(init$1,`init`);function showReportDialog(e={}){let t=Tx.document,n=t?.head||t?.body;if(!n){qx&&xe.error(`[showReportDialog] Global document not defined`);return}let r=M(),i=j()?.getDsn();if(!i){qx&&xe.error(`[showReportDialog] DSN not configured`);return}let o={...e,user:{...r.getUser(),...e.user},eventId:e.eventId||Me()},s=Tx.document.createElement(`script`);s.async=!0,s.crossOrigin=`anonymous`,s.src=getReportDialogEndpoint(i,o);let{onLoad:c,onClose:p}=o;if(c&&(s.onload=c),p){let reportDialogClosedMessageHandler=e=>{if(e.data===`__sentry_reportdialog_closed__`)try{p()}finally{Tx.removeEventListener(`message`,reportDialogClosedMessageHandler)}};Tx.addEventListener(`message`,reportDialogClosedMessageHandler)}n.appendChild(s)}var $=n(bt());function init(e){let t={...e};return applySdkMetadata(t,`react`),Ae(`react`,{version:$.version}),init$1(t)}function isAtLeastReact17(e){let t=e.match(/^([^.]+)/);return t!==null&&parseInt(t[0])>=17}function setCause(e,t){let n=new WeakSet;function recurse(e,t){if(!n.has(e)){if(e.cause)return n.add(e),recurse(e.cause,t);e.cause=t}}recurse(e,t)}function captureReactException(e,{componentStack:t},n){if(isAtLeastReact17($.version)&&Ne(e)&&t){let n=Error(e.message);n.name=`React ErrorBoundary ${e.name}`,n.stack=t,setCause(e,n)}return E(r=>(r.setContext(`react`,{componentStack:t}),Oe(e,n)))}var cS=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,lS={componentStack:null,error:null,eventId:null},ErrorBoundary=class extends $.Component{constructor(e){super(e),this.state=lS,this._openFallbackReportDialog=!0;let t=j();t&&e.showDialog&&(this._openFallbackReportDialog=!1,this._cleanupHook=t.on(`afterSendEvent`,t=>{!t.type&&this._lastEventId&&t.event_id===this._lastEventId&&showReportDialog({...e.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(e,t){let{componentStack:n}=t,{beforeCapture:r,onError:i,showDialog:o,dialogOptions:s}=this.props;E(c=>{r&&r(c,e,n);let p=captureReactException(e,t,{mechanism:{handled:this.props.handled==null?!!this.props.fallback:this.props.handled}});i&&i(e,n,p),o&&(this._lastEventId=p,this._openFallbackReportDialog&&showReportDialog({...s,eventId:p})),this.setState({error:e,componentStack:n,eventId:p})})}componentDidMount(){let{onMount:e}=this.props;e&&e()}componentWillUnmount(){let{error:e,componentStack:t,eventId:n}=this.state,{onUnmount:r}=this.props;r&&(this.state===lS?r(null,null,null):r(e,t,n)),this._cleanupHook&&=(this._cleanupHook(),void 0)}resetErrorBoundary(){let{onReset:e}=this.props,{error:t,componentStack:n,eventId:r}=this.state;e&&e(t,n,r),this.setState(lS)}render(){let{fallback:e,children:t}=this.props,n=this.state;if(n.componentStack===null)return typeof t==`function`?t():t;let r=typeof e==`function`?$.createElement(e,{error:n.error,componentStack:n.componentStack,resetError:()=>this.resetErrorBoundary(),eventId:n.eventId}):e;return $.isValidElement(r)?r:(e&&cS&&xe.warn(`fallback did not produce a valid ReactElement`),null)}},uS=`[object String]`;function isString(e){return typeof e==`string`||!qi(e)&&ta(e)&&Xn(e)==uS}var dS=`[object RegExp]`;function baseIsRegExp(e){return ta(e)&&Xn(e)==dS}var fS=Wn&&Wn.isRegExp,pS=fS?At(fS):baseIsRegExp,mS=jr(`length`),hS=`\\ud800-\\udfff`,gS=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,_S=`\\ufe0e\\ufe0f`,vS=`[`+hS+`]`,yS=`[`+gS+`]`,bS=`\\ud83c[\\udffb-\\udfff]`,xS=`(?:`+yS+`|`+bS+`)`,SS=`[^`+hS+`]`,CS=`(?:\\ud83c[\\udde6-\\uddff]){2}`,wS=`[\\ud800-\\udbff][\\udc00-\\udfff]`,TS=`\\u200d`,ES=xS+`?`,DS=`[`+_S+`]?`,OS=`(?:`+TS+`(?:`+[SS,CS,wS].join(`|`)+`)`+DS+ES+`)*`,kS=DS+ES+OS,AS=`(?:`+[SS+yS+`?`,yS,CS,wS,vS].join(`|`)+`)`,jS=RegExp(bS+`(?=`+bS+`)|`+AS+kS,`g`);function unicodeSize(e){for(var t=jS.lastIndex=0;jS.test(e);)++t;return t}function stringSize(e){return Qt(e)?unicodeSize(e):mS(e)}var MS=_i(function(e,t){if(e==null)return[];var n=t.length;return n>1&&ni(e,t[0],t[1])?t=[]:n>2&&ni(t[0],t[1],t[2])&&(t=[t[0]]),ed(e,ar(t,1),[])}),NS=30,PS=`...`,FS=/\w*$/;function truncate(e,t){var n=NS,r=PS;if(Xr(t)){var i=`separator`in t?t.separator:i;n=`length`in t?pu(t.length):n,r=`omission`in t?Sr(t.omission):r}e=gn(e);var o=e.length;if(Qt(e)){var s=Rn(e);o=s.length}if(n>=o)return e;var c=n-stringSize(r);if(c<1)return r;var p=s?cn(s,0,c).join(``):e.slice(0,c);if(i===void 0)return p+r;if(s&&(c+=p.length-c),pS(i)){if(e.slice(c).search(i)){var m,h=p;for(i.global||(i=RegExp(i.source,gn(FS.exec(i))+`g`)),i.lastIndex=0;m=i.exec(h);)var g=m.index;p=p.slice(0,g===void 0?c:g)}}
vendor: 17,375 bytes, lines 204-211
204else if(e.indexOf(Sr(i),c)!=c){var _=p.lastIndexOf(i);_>-1&&(p=p.slice(0,_))}return p+r}var IS=r((e=>{function push(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,i=e[r];if(0<compare(i,t))e[r]=t,e[n]=i,n=r;else break a}}function peek(e){return e.length===0?null:e[0]}function pop(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,i=e.length,o=i>>>1;r<o;){var s=2*(r+1)-1,c=e[s],p=s+1,m=e[p];if(0>compare(c,n))p<i&&0>compare(m,c)?(e[r]=m,e[p]=n,r=p):(e[r]=c,e[s]=n,r=s);else if(p<i&&0>compare(m,n))e[r]=m,e[p]=n,r=p;else break a}}return t}function compare(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var t=performance;e.unstable_now=function(){return t.now()}}else{var n=Date,r=n.now();e.unstable_now=function(){return n.now()-r}}var i=[],o=[],s=1,c=null,p=3,m=!1,h=!1,g=!1,_=!1,v=typeof setTimeout==`function`?setTimeout:null,y=typeof clearTimeout==`function`?clearTimeout:null,b=typeof setImmediate<`u`?setImmediate:null;function advanceTimers(e){for(var t=peek(o);t!==null;){if(t.callback===null)pop(o);else if(t.startTime<=e)pop(o),t.sortIndex=t.expirationTime,push(i,t);else break;t=peek(o)}}function handleTimeout(e){if(g=!1,advanceTimers(e),!h){if(peek(i)!==null)h=!0,x||(x=!0,schedulePerformWorkUntilDeadline());else{var t=peek(o);t!==null&&requestHostTimeout(handleTimeout,t.startTime-e)}}}var x=!1,S=-1,C=5,w=-1;function shouldYieldToHost(){return _?!0:!(e.unstable_now()-w<C)}function performWorkUntilDeadline(){if(_=!1,x){var t=e.unstable_now();w=t;var n=!0;try{a:{h=!1,g&&(g=!1,y(S),S=-1),m=!0;var r=p;try{b:{for(advanceTimers(t),c=peek(i);c!==null&&!(c.expirationTime>t&&shouldYieldToHost());){var s=c.callback;if(typeof s==`function`){c.callback=null,p=c.priorityLevel;var v=s(c.expirationTime<=t);if(t=e.unstable_now(),typeof v==`function`){c.callback=v,advanceTimers(t),n=!0;break b}c===peek(i)&&pop(i),advanceTimers(t)}else pop(i);c=peek(i)}if(c!==null)n=!0;else{var b=peek(o);b!==null&&requestHostTimeout(handleTimeout,b.startTime-t),n=!1}}break a}finally{c=null,p=r,m=!1}n=void 0}}finally{n?schedulePerformWorkUntilDeadline():x=!1}}}var schedulePerformWorkUntilDeadline;if(typeof b==`function`)schedulePerformWorkUntilDeadline=function(){b(performWorkUntilDeadline)};else if(typeof MessageChannel<`u`){var T=new MessageChannel,E=T.port2;T.port1.onmessage=performWorkUntilDeadline,schedulePerformWorkUntilDeadline=function(){E.postMessage(null)}}else schedulePerformWorkUntilDeadline=function(){v(performWorkUntilDeadline,0)};function requestHostTimeout(t,n){S=v(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):C=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},e.unstable_requestPaint=function(){_=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},e.unstable_scheduleCallback=function(t,n,r){var c=e.unstable_now();switch(typeof r==`object`&&r?(r=r.delay,r=typeof r==`number`&&0<r?c+r:c):r=c,t){case 1:var p=-1;break;case 2:p=250;break;case 5:p=1073741823;break;case 4:p=1e4;break;default:p=5e3}return p=r+p,t={id:s++,callback:n,priorityLevel:t,startTime:r,expirationTime:p,sortIndex:-1},r>c?(t.sortIndex=r,push(o,t),peek(i)===null&&t===peek(o)&&(g?(y(S),S=-1):g=!0,requestHostTimeout(handleTimeout,r-c))):(t.sortIndex=p,push(i,t),h||m||(h=!0,x||(x=!0,schedulePerformWorkUntilDeadline()))),t},e.unstable_shouldYield=shouldYieldToHost,e.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}})),LS=r(((e,t)=>{t.exports=IS()})),RS=r((e=>{var t=LS(),n=bt(),r=ci();function formatProdErrorMessage(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function isValidContainer(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function getNearestMountedFiber(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function getSuspenseInstanceFromFiber(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function getActivityInstanceFromFiber(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function assertIsMounted(e){if(getNearestMountedFiber(e)!==e)throw Error(formatProdErrorMessage(188))}function findCurrentFiberUsingSlowPath(e){var t=e.alternate;if(!t){if(t=getNearestMountedFiber(e),t===null)throw Error(formatProdErrorMessage(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return assertIsMounted(i),e;if(o===r)return assertIsMounted(i),t;o=o.sibling}throw Error(formatProdErrorMessage(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,c=i.child;c;){if(c===n){s=!0,n=i,r=o;break}if(c===r){s=!0,r=i,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,r=i;break}if(c===r){s=!0,r=o,n=i;break}c=c.sibling}if(!s)throw Error(formatProdErrorMessage(189))}}if(n.alternate!==r)throw Error(formatProdErrorMessage(190))}if(n.tag!==3)throw Error(formatProdErrorMessage(188));return n.stateNode.current===n?e:t}function findCurrentHostFiberImpl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=findCurrentHostFiberImpl(e),t!==null)return t;e=e.sibling}return null}var i=Object.assign,o=Symbol.for(`react.element`),s=Symbol.for(`react.transitional.element`),c=Symbol.for(`react.portal`),p=Symbol.for(`react.fragment`),m=Symbol.for(`react.strict_mode`),h=Symbol.for(`react.profiler`),g=Symbol.for(`react.consumer`),_=Symbol.for(`react.context`),v=Symbol.for(`react.forward_ref`),y=Symbol.for(`react.suspense`),b=Symbol.for(`react.suspense_list`),x=Symbol.for(`react.memo`),S=Symbol.for(`react.lazy`),C=Symbol.for(`react.activity`),w=Symbol.for(`react.memo_cache_sentinel`),T=Symbol.iterator;function getIteratorFn(e){return typeof e!=`object`||!e?null:(e=T&&e[T]||e[`@@iterator`],typeof e==`function`?e:null)}var E=Symbol.for(`react.client.reference`);function getComponentNameFromType(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===E?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case p:return`Fragment`;case h:return`Profiler`;case m:return`StrictMode`;case y:return`Suspense`;case b:return`SuspenseList`;case C:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case c:return`Portal`;case _:return e.displayName||`Context`;case g:return(e._context.displayName||`Context`)+`.Consumer`;case v:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case x:return t=e.displayName||null,t===null?getComponentNameFromType(e.type)||`Memo`:t;case S:t=e._payload,e=e._init;try{return getComponentNameFromType(e(t))}catch{}}return null}var D=Array.isArray,O=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},te=[],A=-1;function createCursor(e){return{current:e}}function pop(e){0>A||(e.current=te[A],te[A]=null,A--)}function push(e,t){A++,te[A]=e.current,e.current=t}var j=createCursor(null),ne=createCursor(null),M=createCursor(null),re=createCursor(null);function pushHostContainer(e,t){switch(push(M,t),push(ne,e),push(j,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?getOwnHostContext(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=getOwnHostContext(t),e=getChildHostContextProd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}pop(j),push(j,e)}function popHostContainer(){pop(j),pop(ne),pop(M)}function pushHostContext(e){e.memoizedState!==null&&push(re,e);var t=j.current,n=getChildHostContextProd(t,e.type);t!==n&&(push(ne,e),push(j,n))}function popHostContext(e){ne.current===e&&(pop(j),pop(ne)),re.current===e&&(pop(re),Ii._currentValue=ee)}var ie,ae;function describeBuiltInComponentFrame(e){if(ie===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ie=t&&t[1]||``,ae=-1<e.stack.indexOf(`
205    at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
206`+ie+e+ae}var oe=!1;function describeNativeComponentFrame(e,t){if(!e||oe)return``;oe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var Fake=function(){throw Error()};if(Object.defineProperty(Fake.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(Fake,[])}catch(e){var n=e}Reflect.construct(e,[],Fake)}else{try{Fake.call()}catch(e){n=e}e.call(Fake.prototype)}}else{try{throw Error()}catch(e){n=e}(Fake=e())&&typeof Fake.catch==`function`&&Fake.catch(function(){})}}catch(e){if(e&&n&&typeof e.stack==`string`)return[e.stack,n.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var o=r.DetermineComponentFrameRoot(),s=o[0],c=o[1];if(s&&c){var p=s.split(`
207`),m=c.split(`
208`);for(i=r=0;r<p.length&&!p[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<m.length&&!m[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===p.length||i===m.length)for(r=p.length-1,i=m.length-1;1<=r&&0<=i&&p[r]!==m[i];)i--;for(;1<=r&&0<=i;r--,i--)if(p[r]!==m[i]){if(r!==1||i!==1)do if(r--,i--,0>i||p[r]!==m[i]){var h=`
209`+p[r].replace(` at new `,` at `);return e.displayName&&h.includes(`<anonymous>`)&&(h=h.replace(`<anonymous>`,e.displayName)),h}while(1<=r&&0<=i);break}}}finally{oe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?describeBuiltInComponentFrame(n):``}function describeFiber(e,t){switch(e.tag){case 26:case 27:case 5:return describeBuiltInComponentFrame(e.type);case 16:return describeBuiltInComponentFrame(`Lazy`);case 13:return e.child!==t&&t!==null?describeBuiltInComponentFrame(`Suspense Fallback`):describeBuiltInComponentFrame(`Suspense`);case 19:return describeBuiltInComponentFrame(`SuspenseList`);case 0:case 15:return describeNativeComponentFrame(e.type,!1);case 11:return describeNativeComponentFrame(e.type.render,!1);case 1:return describeNativeComponentFrame(e.type,!0);case 31:return describeBuiltInComponentFrame(`Activity`);default:return``}}function getStackByFiberInDevAndProd(e){try{var t=``,n=null;do t+=describeFiber(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
210Error generating stack: `+e.message+`
211`+e.stack}}var se=Object.prototype.hasOwnProperty,ce=t.unstable_scheduleCallback,le=t.unstable_cancelCallback,ue=t.unstable_shouldYield,de=t.unstable_requestPaint,fe=t.unstable_now,pe=t.unstable_getCurrentPriorityLevel,me=t.unstable_ImmediatePriority,he=t.unstable_UserBlockingPriority,ge=t.unstable_NormalPriority,_e=t.unstable_LowPriority,ve=t.unstable_IdlePriority,ye=t.log,be=t.unstable_setDisableYieldValue,xe=null,Se=null;function setIsStrictModeForDevtools(e){if(typeof ye==`function`&&be(e),Se&&typeof Se.setStrictMode==`function`)try{Se.setStrictMode(xe,e)}catch{}}var Ce=Math.clz32?Math.clz32:clz32Fallback,we=Math.log,Te=Math.LN2;function clz32Fallback(e){return e>>>=0,e===0?32:31-(we(e)/Te|0)|0}var Ee=256,De=262144,Oe=4194304;function getHighestPriorityLanes(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function getNextLanes(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,o=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var c=r&134217727;return c===0?(c=r&~o,c===0?s===0?n||(n=r&~e,n!==0&&(i=getHighestPriorityLanes(n))):i=getHighestPriorityLanes(s):i=getHighestPriorityLanes(c)):(r=c&~o,r===0?(s&=c,s===0?n||(n=c&~e,n!==0&&(i=getHighestPriorityLanes(n))):i=getHighestPriorityLanes(s)):i=getHighestPriorityLanes(r)),i===0?0:t!==0&&t!==i&&(t&o)===0&&(o=i&-i,n=t&-t,o>=n||o===32&&n&4194048)?t:i}function checkIfRootIsPrerendering(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function computeExpirationTime(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function claimNextRetryLane(){var e=Oe;return Oe<<=1,!(Oe&62914560)&&(Oe=4194304),e}function createLaneMap(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function markRootUpdated$1(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function markRootFinished(e,t,n,r,i,o){var s=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var c=e.entanglements,p=e.expirationTimes,m=e.hiddenUpdates;for(n=s&~n;0<n;){var h=31-Ce(n),g=1<<h;c[h]=0,p[h]=-1;var _=m[h];if(_!==null)for(m[h]=null,h=0;h<_.length;h++){var v=_[h];v!==null&&(v.lane&=-536870913)}n&=~g}r!==0&&markSpawnedDeferredLane(e,r,0),o!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=o&~(s&~t))}function markSpawnedDeferredLane(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ce(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function markRootEntangled(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ce(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function getBumpedLaneForHydration(e,t){var n=t&-t;return n=n&42?1:getBumpedLaneForHydrationByLane(n),(n&(e.suspendedLanes|t))===0?n:0}function getBumpedLaneForHydrationByLane(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function lanesToEventPriority(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function resolveUpdatePriority(){var e=k.p;return e===0?(e=window.event,e===void 0?32:getEventPriority(e.type)):e}function runWithPriority(e,t){var n=k.p;try{return k.p=e,t()}finally{k.p=n}}var ke=Math.random().toString(36).slice(2),Ae=`__reactFiber$`+ke,je=`__reactProps$`+ke,Me=`__reactContainer$`+ke,Ne=`__reactEvents$`+ke,Pe=`__reactListeners$`+ke,Fe=`__reactHandles$`+ke,Ie=`__reactResources$`+ke,Le=`__reactMarker$`+ke;function detachDeletedInstance(e){delete e[Ae],delete e[je],delete e[Ne],delete e[Pe],delete e[Fe]}function getClosestInstanceFromNode(e){var t=e[Ae];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Me]||n[Ae]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=getParentHydrationBoundary(e);e!==null;){if(n=e[Ae])return n;e=getParentHydrationBoundary(e)}return t}e=n,n=e.parentNode}return null}function getInstanceFromNode(e){if(e=e[Ae]||e[Me]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function getNodeFromInstance(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(formatProdErrorMessage(33))}function getResourcesFromRoot(e){var t=e[Ie];return t||=e[Ie]={hoistableStyles:new Map,hoistableScripts:new Map},t}function markNodeAsHoistable(e){e[Le]=!0}var Re=new Set,ze={};function registerTwoPhaseEvent(e,t){registerDirectEvent(e,t),registerDirectEvent(e+`Capture`,t)}function registerDirectEvent(e,t){for(ze[e]=t,e=0;e<t.length;e++)Re.add(t[e])}var Be=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u
211037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Ve={},He={};function isAttributeNameSafe(e){return se.call(He,e)?!0:se.call(Ve,e)?!1:Be.test(e)?He[e]=!0:(Ve[e]=!0,!1)}function setValueForAttribute(e,t,n){if(isAttributeNameSafe(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function setValueForKnownAttribute(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function setValueForNamespacedAttribute(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function getToStringValue(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function isCheckable(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function trackValueOnNode(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function track(e){if(!e._valueTracker){var t=isCheckable(e)?`checked`:`value`;e._valueTracker=trackValueOnNode(e,t,``+e[t])}}function updateValueIfChanged(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=isCheckable(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function getActiveElement(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Ue=/[\n"\\]/g;function escapeSelectorAttributeValueInsideDoubleQuotes(e){return e.replace(Ue,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function updateInput(e,t,n,r,i,o,s,c){e.name=``,s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.type=s:e.removeAttribute(`type`),t==null?s!==`submit`&&s!==`reset`||e.removeAttribute(`value`):s===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+getToStringValue(t)):e.value!==``+getToStringValue(t)&&(e.value=``+getToStringValue(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):setDefaultValue(e,s,getToStringValue(n)):setDefaultValue(e,s,getToStringValue(t)),i==null&&o!=null&&(e.defaultChecked=!!o),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),c!=null&&typeof c!=`function`&&typeof c!=`symbol`&&typeof c!=`boolean`?e.name=``+getToStringValue(c):e.removeAttribute(`name`)}function initInput(e,t,n,r,i,o,s,c){if(o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.type=o),t!=null||n!=null){if(!(o!==`submit`&&o!==`reset`||t!=null)){track(e);return}n=n==null?``:``+getToStringValue(n),t=t==null?n:``+getToStringValue(t),c||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=c?e.checked:!!r,e.defaultChecked=!!r,s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`&&(e.name=s),track(e)}function setDefaultValue(e,t,n){t===`number`&&getActiveElement(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function updateOptions(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;
vendor: 11,015 bytes, line 211
211n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+getToStringValue(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function updateTextarea(e,t,n){if(t!=null&&(t=``+getToStringValue(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+getToStringValue(n)}function initTextarea(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(formatProdErrorMessage(92));if(D(r)){if(1<r.length)throw Error(formatProdErrorMessage(93));r=r[0]}n=r}n??=``,t=n}n=getToStringValue(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),track(e)}function setTextContent(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var We=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function setValueForStyle(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||We.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function setValueForStyles(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(formatProdErrorMessage(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&setValueForStyle(e,i,r)}else for(var o in t)t.hasOwnProperty(o)&&setValueForStyle(e,o,t[o])}function isCustomElement(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Ge=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Ke=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function sanitizeURL(e){return Ke.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function noop$1(){}var qe=null;function getEventTarget(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Je=null,Ye=null;function restoreStateOfTarget(e){var t=getInstanceFromNode(e);if(t&&(e=t.stateNode)){var n=e[je]||null;a:switch(e=t.stateNode,t.type){case`input`:if(updateInput(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+escapeSelectorAttributeValueInsideDoubleQuotes(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[je]||null;if(!i)throw Error(formatProdErrorMessage(90));updateInput(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&updateValueIfChanged(r)}break a;case`textarea`:updateTextarea(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&updateOptions(e,!!n.multiple,t,!1)}}}var Xe=!1;function batchedUpdates$1(e,t,n){if(Xe)return e(t,n);Xe=!0;try{return e(t)}finally{if(Xe=!1,(Je!==null||Ye!==null)&&(flushSyncWork$1(),Je&&(t=Je,e=Ye,Ye=Je=null,restoreStateOfTarget(t),e)))for(t=0;t<e.length;t++)restoreStateOfTarget(e[t])}}function getListener(e,t){var n=e.stateNode;if(n===null)return null;var r=n[je]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(formatProdErrorMessage(231,t,typeof n));return n}var Ze=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),Qe=!1;if(Ze)try{var $e={};Object.defineProperty($e,"passive",{get:function(){Qe=!0}}),window.addEventListener(`test`,$e,$e),window.removeEventListener(`test`,$e,$e)}catch{Qe=!1}var et=null,tt=null,nt=null;function getData(){if(nt)return nt;var e,t=tt,n=t.length,r,i=`value`in et?et.value:et.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===i[o-r];r++);return nt=i.slice(e,1<r?1-r:void 0)}function getEventCharCode(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function functionThatReturnsTrue(){return!0}function functionThatReturnsFalse(){return!1}function createSyntheticEvent(e){function SyntheticBaseEvent(t,n,r,i,o){for(var s in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(s)&&(t=e[s],this[s]=t?t(i):i[s]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?functionThatReturnsTrue:functionThatReturnsFalse,this.isPropagationStopped=functionThatReturnsFalse,this}return i(SyntheticBaseEvent.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=functionThatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=functionThatReturnsTrue)},persist:function(){},isPersistent:functionThatReturnsTrue}),SyntheticBaseEvent}var rt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},it=createSyntheticEvent(rt),at=i({},rt,{view:0,detail:0}),ot=createSyntheticEvent(at),st,ct,ut,dt=i({},at,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:getEventModifierState,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==ut&&(ut&&e.type===`mousemove`?(st=e.screenX-ut.screenX,ct=e.screenY-ut.screenY):ct=st=0,ut=e),st)},movementY:function(e){return`movementY`in e?e.movementY:ct}}),ft=createSyntheticEvent(dt),pt=createSyntheticEvent(i({},dt,{dataTransfer:0})),mt=createSyntheticEvent(i({},at,{relatedTarget:0})),ht=createSyntheticEvent(i({},rt,{animationName:0,elapsedTime:0,pseudoElement:0})),_t=createSyntheticEvent(i({},rt,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),vt=createSyntheticEvent(i({},rt,{data:0})),yt={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},N={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F
2115`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},xt={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function modifierStateGetter(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=xt[e])?!!t[e]:!1}function getEventModifierState(){return modifierStateGetter}var St=createSyntheticEvent(i({},at,{key:function(e){if(e.key){var t=yt[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=getEventCharCode(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?N[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:getEventModifierState,charCode:function(e){return e.type===`keypress`?getEventCharCode(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?getEventCharCode(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Ct=createSyntheticEvent(i({},dt,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),wt=createSyntheticEvent(i({},at,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:getEventModifierState})),Tt=createSyntheticEvent(i({},rt,{propertyName:0,elapsedTime:0,pseudoElement:0})),Et=createSyntheticEvent(i({},dt,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Dt=createSyntheticEvent(i({},rt,{newState:0,oldState:0})),Ot=[9,13,27,32],kt=Ze&&`CompositionEvent`in window,At=null;Ze&&`documentMode`in document&&(At=document.documentMode);var jt=Ze&&`TextEvent`in window&&!At,Mt=Ze&&(!kt||At&&8<At&&11>=At),Nt=` `,Pt=!1;function isFallbackCompositionEnd(e,t){switch(e){case`keyup`:return Ot.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function getDataFromCustomEvent(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Ft=!1;function getNativeBeforeInputChars(e,t){switch(e){case`compositionend`:return getDataFromCustomEvent(t);case`keypress`:return t.which===32?(Pt=!0,Nt):null;case`textInput`:return e=t.data,e===Nt&&Pt?null:e;default:return null}}function getFallbackBeforeInputChars(e,t){if(Ft)return e===`compositionend`||!kt&&isFallbackCompositionEnd(e,t)?(e=getData(),nt=tt=et=null,Ft=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Mt&&t.locale!==`ko`?null:t.data;default:return null}}var It={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function isTextInputElement(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!It[e.type]:t===`textarea`}function createAndAccumulateChangeEvent(e,t,n,r){Je?Ye?Ye.push(r):Ye=[r]:Je=r,t=accumulateTwoPhaseListeners(t,`onChange`),0<t.length&&(n=new it(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Lt=null,Rt=null;function runEventInBatch(e){processDispatchQueue(e,0)}function getInstIfValueChanged(e){if(updateValueIfChanged(getNodeFromInstance(e)))return e}function getTargetInstForChangeEvent(e,t){if(e===`change`)return t}var zt=!1;if(Ze){var Bt;if(Ze){var Vt=`oninput`in document;if(!Vt){var Ht=document.createElement(`div`);Ht.setAttribute(`oninput`,`return;`),Vt=typeof Ht.oninput==`function`}Bt=Vt}else Bt=!1;zt=Bt&&(!document.documentMode||9<document.documentMode)}function stopWatchingForValueChange(){Lt&&(Lt.detachEvent(`onpropertychange`,handlePropertyChange),Rt=Lt=null)}function handlePropertyChange(e){if(e.propertyName===`value`&&getInstIfValueChanged(Rt)){var t=[];createAndAccumulateChangeEvent(t,Rt,e,getEventTarget(e)),batchedUpdates$1(runEventInBatch,t)}}function handleEventsForInputEventPolyfill(e,t,n){e===`focusin`?(stopWatchingForValueChange(),Lt=t,Rt=n,Lt.attachEvent(`onpropertychange`,handlePropertyChange)):e===`focusout`&&stopWatchingForValueChange()}function getTargetInstForInputEventPolyfill(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return getInstIfValueChanged(Rt)}function getTargetInstForClickEvent(e,t){if(e===`click`)return getInstIfValueChanged(t)}function getTargetInstForInputOrChangeEvent(e,t){if(e===`input`||e===`change`)return getInstIfValueChanged(t)}function is(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Ut=typeof Object.is==`function`?Object.is:is;function shallowEqual(e,t){if(Ut(e,t))return!0;
vendor: 135,911 bytes, line 211
211if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!se.call(t,i)||!Ut(e[i],t[i]))return!1}return!0}function getLeafNode(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function getNodeForCharacterOffset(e,t){var n=getLeafNode(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=getLeafNode(n)}}function containsNode(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?containsNode(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function getActiveElementDeep(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=getActiveElement(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=getActiveElement(e.document)}return t}function hasSelectionCapabilities(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Wt=Ze&&`documentMode`in document&&11>=document.documentMode,Gt=null,Kt=null,qt=null,Jt=!1;function constructSelectEvent(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Jt||Gt==null||Gt!==getActiveElement(r)||(r=Gt,`selectionStart`in r&&hasSelectionCapabilities(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),qt&&shallowEqual(qt,r)||(qt=r,r=accumulateTwoPhaseListeners(Kt,`onSelect`),0<r.length&&(t=new it(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Gt)))}function makePrefixMap(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Yt={animationend:makePrefixMap(`Animation`,`AnimationEnd`),animationiteration:makePrefixMap(`Animation`,`AnimationIteration`),animationstart:makePrefixMap(`Animation`,`AnimationStart`),transitionrun:makePrefixMap(`Transition`,`TransitionRun`),transitionstart:makePrefixMap(`Transition`,`TransitionStart`),transitioncancel:makePrefixMap(`Transition`,`TransitionCancel`),transitionend:makePrefixMap(`Transition`,`TransitionEnd`)},Xt={},Zt={};Ze&&(Zt=document.createElement(`div`).style,`AnimationEvent`in window||(delete Yt.animationend.animation,delete Yt.animationiteration.animation,delete Yt.animationstart.animation),`TransitionEvent`in window||delete Yt.transitionend.transition);function getVendorPrefixedEventName(e){if(Xt[e])return Xt[e];if(!Yt[e])return e;var t=Yt[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Zt)return Xt[e]=t[n];return e}var Qt=getVendorPrefixedEventName(`animationend`),$t=getVendorPrefixedEventName(`animationiteration`),en=getVendorPrefixedEventName(`animationstart`),tn=getVendorPrefixedEventName(`transitionrun`),nn=getVendorPrefixedEventName(`transitionstart`),rn=getVendorPrefixedEventName(`transitioncancel`),an=getVendorPrefixedEventName(`transitionend`),on=new Map,sn=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);sn.push(`scrollEnd`);function registerSimpleEvent(e,t){on.set(e,t),registerTwoPhaseEvent(t,[e])}var cn=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ln=[],un=0,dn=0;function finishQueueingConcurrentUpdates(){for(var e=un,t=dn=un=0;t<e;){var n=ln[t];ln[t++]=null;var r=ln[t];ln[t++]=null;var i=ln[t];ln[t++]=null;var o=ln[t];if(ln[t++]=null,r!==null&&i!==null){var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}o!==0&&markUpdateLaneFromFiberToRoot(n,i,o)}}function enqueueUpdate$1(e,t,n,r){ln[un++]=e,ln[un++]=t,ln[un++]=n,ln[un++]=r,dn|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function enqueueConcurrentHookUpdate(e,t,n,r){return enqueueUpdate$1(e,t,n,r),getRootForUpdatedFiber(e)}function enqueueConcurrentRenderForLane(e,t){return enqueueUpdate$1(e,null,null,t),getRootForUpdatedFiber(e)}function markUpdateLaneFromFiberToRoot(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,o=e.return;o!==null;)o.childLanes|=n,r=o.alternate,r!==null&&(r.childLanes|=n),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(i=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,i&&t!==null&&(i=31-Ce(n),e=o.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),o):null}function getRootForUpdatedFiber(e){if(50<oi)throw oi=0,si=null,Error(formatProdErrorMessage(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var fn={};function FiberNode(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function createFiberImplClass(e,t,n,r){return new FiberNode(e,t,n,r)}function shouldConstruct(e){return e=e.prototype,!(!e||!e.isReactComponent)}function createWorkInProgress(e,t){var n=e.alternate;return n===null?(n=createFiberImplClass(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function resetWorkInProgress(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function createFiberFromTypeAndProps(e,t,n,r,i,o){var s=0;if(r=e,typeof e==`function`)shouldConstruct(e)&&(s=1);else if(typeof e==`string`)s=isHostHoistableType(e,n,j.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case C:return e=createFiberImplClass(31,n,t,i),e.elementType=C,e.lanes=o,e;case p:return createFiberFromFragment(n.children,i,o,t);case m:s=8,i|=24;break;case h:return e=createFiberImplClass(12,n,t,i|2),e.elementType=h,e.lanes=o,e;case y:return e=createFiberImplClass(13,n,t,i),e.elementType=y,e.lanes=o,e;case b:return e=createFiberImplClass(19,n,t,i),e.elementType=b,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case _:s=10;break a;case g:s=9;break a;case v:s=11;break a;case x:s=14;break a;case S:s=16,r=null;break a}s=29,n=Error(formatProdErrorMessage(130,e===null?`null`:typeof e,``)),r=null}return t=createFiberImplClass(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function createFiberFromFragment(e,t,n,r){return e=createFiberImplClass(7,e,r,t),e.lanes=n,e}function createFiberFromText(e,t,n){return e=createFiberImplClass(6,e,null,t),e.lanes=n,e}function createFiberFromDehydratedFragment(e){var t=createFiberImplClass(18,null,null,0);return t.stateNode=e,t}function createFiberFromPortal(e,t,n){return t=createFiberImplClass(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var pn=new WeakMap;function createCapturedValueAtFiber(e,t){if(typeof e==`object`&&e){var n=pn.get(e);return n===void 0?(t={value:e,source:t,stack:getStackByFiberInDevAndProd(t)},pn.set(e,t),t):n}return{value:e,source:t,stack:getStackByFiberInDevAndProd(t)}}var mn=[],hn=0,gn=null,_n=0,vn=[],yn=0,bn=null,xn=1,Sn=``;function pushTreeFork(e,t){mn[hn++]=_n,mn[hn++]=gn,gn=e,_n=t}function pushTreeId(e,t,n){vn[yn++]=xn,vn[yn++]=Sn,vn[yn++]=bn,bn=e;var r=xn;e=Sn;var i=32-Ce(r)-1;r&=~(1<<i),n+=1;var o=32-Ce(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,xn=1<<32-Ce(t)+i|n<<i|r,Sn=o+e}else xn=1<<o|n<<i|r,Sn=e}function pushMaterializedTreeId(e){e.return!==null&&(pushTreeFork(e,1),pushTreeId(e,1,0))}function popTreeContext(e){for(;e===gn;)gn=mn[--hn],mn[hn]=null,_n=mn[--hn],mn[hn]=null;for(;e===bn;)bn=vn[--yn],vn[yn]=null,Sn=vn[--yn],vn[yn]=null,xn=vn[--yn],vn[yn]=null}function restoreSuspendedTreeContext(e,t){vn[yn++]=xn,vn[yn++]=Sn,vn[yn++]=bn,xn=t.id,Sn=t.overflow,bn=e}var Cn=null,P=null,wn=!1,Tn=null,En=!1,Dn=Error(formatProdErrorMessage(519));function throwOnHydrationMismatch(e){throw queueHydrationError(createCapturedValueAtFiber(Error(formatProdErrorMessage(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Dn}function prepareToHydrateHostInstance(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ae]=e,t[je]=r,n){case`dialog`:listenToNonDelegatedEvent(`cancel`,t),listenToNonDelegatedEvent(`close`,t);break;case`iframe`:case`object`:case`embed`:listenToNonDelegatedEvent(`load`,t);break;case`video`:case`audio`:for(n=0;n<gi.length;n++)listenToNonDelegatedEvent(gi[n],t);break;case`source`:listenToNonDelegatedEvent(`error`,t);break;case`img`:case`image`:case`link`:listenToNonDelegatedEvent(`error`,t),listenToNonDelegatedEvent(`load`,t);break;case`details`:listenToNonDelegatedEvent(`toggle`,t);break;case`input`:listenToNonDelegatedEvent(`invalid`,t),initInput(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:listenToNonDelegatedEvent(`invalid`,t);break;case`textarea`:listenToNonDelegatedEvent(`invalid`,t),initTextarea(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||checkForUnmatchedText(t.textContent,n)?(r.popover!=null&&(listenToNonDelegatedEvent(`beforetoggle`,t),listenToNonDelegatedEvent(`toggle`,t)),r.onScroll!=null&&listenToNonDelegatedEvent(`scroll`,t),r.onScrollEnd!=null&&listenToNonDelegatedEvent(`scrollend`,t),r.onClick!=null&&(t.onclick=noop$1),t=!0):t=!1,t||throwOnHydrationMismatch(e,!0)}function popToNextHostParent(e){for(Cn=e.return;Cn;)switch(Cn.tag){case 5:case 31:case 13:En=!1;return;case 27:case 3:En=!0;return;default:Cn=Cn.return}}function popHydrationState(e){if(e!==Cn)return!1;if(!wn)return popToNextHostParent(e),wn=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||shouldSetTextContent(e.type,e.memoizedProps)),n=!n),n&&P&&throwOnHydrationMismatch(e),popToNextHostParent(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(formatProdErrorMessage(317));P=getNextHydratableInstanceAfterHydrationBoundary(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(formatProdErrorMessage(317));P=getNextHydratableInstanceAfterHydrationBoundary(e)}else t===27?(t=P,isSingletonScope(e.type)?(e=Oi,Oi=null,P=e):P=t):P=Cn?getNextHydratable(e.stateNode.nextSibling):null;return!0}function resetHydrationState(){P=Cn=null,wn=!1}function upgradeHydrationErrorsToRecoverable(){var e=Tn;return e!==null&&(Kr===null?Kr=e:Kr.push.apply(Kr,e),Tn=null),e}function queueHydrationError(e){Tn===null?Tn=[e]:Tn.push(e)}var On=createCursor(null),kn=null,An=null;function pushProvider(e,t,n){push(On,t._currentValue),t._currentValue=n}function popProvider(e){e._currentValue=On.current,pop(On)}function scheduleContextWorkOnParentPath(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function propagateContextChanges(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var p=0;p<t.length;p++)if(c.context===t[p]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),scheduleContextWorkOnParentPath(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(formatProdErrorMessage(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),scheduleContextWorkOnParentPath(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function propagateParentContextChanges(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(formatProdErrorMessage(387));if(s=s.memoizedProps,s!==null){var c=i.type;Ut(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===re.current){if(s=i.alternate,s===null)throw Error(formatProdErrorMessage(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[Ii]:e.push(Ii))}i=i.return}e!==null&&propagateContextChanges(t,e,n,r),t.flags|=262144}function checkIfContextChanged(e){for(e=e.firstContext;e!==null;){if(!Ut(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function prepareToReadContext(e){kn=e,An=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function readContext(e){return readContextForConsumer(kn,e)}function readContextDuringReconciliation(e,t){return kn===null&&prepareToReadContext(e),readContextForConsumer(e,t)}function readContextForConsumer(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},An===null){if(e===null)throw Error(formatProdErrorMessage(308));An=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else An=An.next=t;return n}var jn=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Mn=t.unstable_scheduleCallback,Nn=t.unstable_NormalPriority,Pn={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function createCache(){return{controller:new jn,data:new Map,refCount:0}}function releaseCache(e){e.refCount--,e.refCount===0&&Mn(Nn,function(){e.controller.abort()})}var Fn=null,In=0,Ln=0,Rn=null;function entangleAsyncAction(e,t){if(Fn===null){var n=Fn=[];In=0,Ln=requestTransitionLane(),Rn={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return In++,t.then(pingEngtangledActionScope,pingEngtangledActionScope),t}function pingEngtangledActionScope(){if(--In===0&&Fn!==null){Rn!==null&&(Rn.status=`fulfilled`);var e=Fn;Fn=null,Ln=0,Rn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function chainThenableValue(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var zn=O.S;O.S=function(e,t){Yr=fe(),typeof t==`object`&&t&&typeof t.then==`function`&&entangleAsyncAction(e,t),zn!==null&&zn(e,t)};var Bn=createCursor(null);function peekCacheFromPool(){var e=Bn.current;return e===null?Mr.pooledCache:e}function pushTransition(e,t){t===null?push(Bn,Bn.current):push(Bn,t.pool)}function getSuspendedCache(){var e=peekCacheFromPool();return e===null?null:{parent:Pn._currentValue,pool:e}}var Vn=Error(formatProdErrorMessage(460)),Hn=Error(formatProdErrorMessage(474)),Un=Error(formatProdErrorMessage(542)),Wn={then:function(){}};function isThenableResolved(e){return e=e.status,e===`fulfilled`||e===`rejected`}function trackUsedThenable(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(noop$1,noop$1),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,checkIfUseWrappedInAsyncCatch(e),e;default:if(typeof t.status==`string`)t.then(noop$1,noop$1);else{if(e=Mr,e!==null&&100<e.shellSuspendCounter)throw Error(formatProdErrorMessage(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,checkIfUseWrappedInAsyncCatch(e),e}throw Gn=t,Vn}}function resolveLazy(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Gn=e,Vn):e}}var Gn=null;function getSuspendedThenable(){if(Gn===null)throw Error(formatProdErrorMessage(459));var e=Gn;return Gn=null,e}function checkIfUseWrappedInAsyncCatch(e){if(e===Vn||e===Un)throw Error(formatProdErrorMessage(483))}var Kn=null,qn=0;function unwrapThenable(e){var t=qn;return qn+=1,Kn===null&&(Kn=[]),trackUsedThenable(Kn,e,t)}function coerceRef(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function throwOnInvalidObjectTypeImpl(e,t){throw t.$$typeof===o?Error(formatProdErrorMessage(525)):(e=Object.prototype.toString.call(t),Error(formatProdErrorMessage(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function createChildReconciler(e){function deleteChild(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function deleteRemainingChildren(t,n){if(!e)return null;for(;n!==null;)deleteChild(t,n),n=n.sibling;return null}function mapRemainingChildren(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function useFiber(e,t){return e=createWorkInProgress(e,t),e.index=0,e.sibling=null,e}function placeChild(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function placeSingleChild(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function updateTextNode(e,t,n,r){return t===null||t.tag!==6?(t=createFiberFromText(n,e.mode,r),t.return=e,t):(t=useFiber(t,n),t.return=e,t)}function updateElement(e,t,n,r){var i=n.type;return i===p?updateFragment(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===S&&resolveLazy(i)===t.type)?(t=useFiber(t,n.props),coerceRef(t,n),t.return=e,t):(t=createFiberFromTypeAndProps(n.type,n.key,n.props,null,e.mode,r),coerceRef(t,n),t.return=e,t)}function updatePortal(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=createFiberFromPortal(n,e.mode,r),t.return=e,t):(t=useFiber(t,n.children||[]),t.return=e,t)}function updateFragment(e,t,n,r,i){return t===null||t.tag!==7?(t=createFiberFromFragment(n,e.mode,r,i),t.return=e,t):(t=useFiber(t,n),t.return=e,t)}function createChild(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=createFiberFromText(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case s:return n=createFiberFromTypeAndProps(t.type,t.key,t.props,null,e.mode,n),coerceRef(n,t),n.return=e,n;case c:return t=createFiberFromPortal(t,e.mode,n),t.return=e,t;case S:return t=resolveLazy(t),createChild(e,t,n)}if(D(t)||getIteratorFn(t))return t=createFiberFromFragment(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return createChild(e,unwrapThenable(t),n);if(t.$$typeof===_)return createChild(e,readContextDuringReconciliation(e,t),n);throwOnInvalidObjectTypeImpl(e,t)}return null}function updateSlot(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?updateTextNode(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case s:return n.key===i?updateElement(e,t,n,r):null;case c:return n.key===i?updatePortal(e,t,n,r):null;case S:return n=resolveLazy(n),updateSlot(e,t,n,r)}if(D(n)||getIteratorFn(n))return i===null?updateFragment(e,t,n,r,null):null;if(typeof n.then==`function`)return updateSlot(e,t,unwrapThenable(n),r);if(n.$$typeof===_)return updateSlot(e,t,readContextDuringReconciliation(e,n),r);throwOnInvalidObjectTypeImpl(e,n)}return null}function updateFromMap(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,updateTextNode(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case s:return e=e.get(r.key===null?n:r.key)||null,updateElement(t,e,r,i);case c:return e=e.get(r.key===null?n:r.key)||null,updatePortal(t,e,r,i);case S:return r=resolveLazy(r),updateFromMap(e,t,n,r,i)}if(D(r)||getIteratorFn(r))return e=e.get(n)||null,updateFragment(t,e,r,i,null);if(typeof r.then==`function`)return updateFromMap(e,t,n,unwrapThenable(r),i);if(r.$$typeof===_)return updateFromMap(e,t,n,readContextDuringReconciliation(t,r),i);throwOnInvalidObjectTypeImpl(t,r)}return null}function reconcileChildrenArray(t,n,r,i){for(var o=null,s=null,c=n,p=n=0,m=null;c!==null&&p<r.length;p++){c.index>p?(m=c,c=null):m=c.sibling;var h=updateSlot(t,c,r[p],i);if(h===null){c===null&&(c=m);break}e&&c&&h.alternate===null&&deleteChild(t,c),n=placeChild(h,n,p),s===null?o=h:s.sibling=h,s=h,c=m}if(p===r.length)return deleteRemainingChildren(t,c),wn&&pushTreeFork(t,p),o;if(c===null){for(;p<r.length;p++)c=createChild(t,r[p],i),c!==null&&(n=placeChild(c,n,p),s===null?o=c:s.sibling=c,s=c);return wn&&pushTreeFork(t,p),o}for(c=mapRemainingChildren(c);p<r.length;p++)m=updateFromMap(c,t,p,r[p],i),m!==null&&(e&&m.alternate!==null&&c.delete(m.key===null?p:m.key),n=placeChild(m,n,p),s===null?o=m:s.sibling=m,s=m);return e&&c.forEach(function(e){return deleteChild(t,e)}),wn&&pushTreeFork(t,p),o}function reconcileChildrenIterator(t,n,r,i){if(r==null)throw Error(formatProdErrorMessage(151));for(var o=null,s=null,c=n,p=n=0,m=null,h=r.next();c!==null&&!h.done;p++,h=r.next()){c.index>p?(m=c,c=null):m=c.sibling;var g=updateSlot(t,c,h.value,i);if(g===null){c===null&&(c=m);break}e&&c&&g.alternate===null&&deleteChild(t,c),n=placeChild(g,n,p),s===null?o=g:s.sibling=g,s=g,c=m}if(h.done)return deleteRemainingChildren(t,c),wn&&pushTreeFork(t,p),o;if(c===null){for(;!h.done;p++,h=r.next())h=createChild(t,h.value,i),h!==null&&(n=placeChild(h,n,p),s===null?o=h:s.sibling=h,s=h);return wn&&pushTreeFork(t,p),o}for(c=mapRemainingChildren(c);!h.done;p++,h=r.next())h=updateFromMap(c,t,p,h.value,i),h!==null&&(e&&h.alternate!==null&&c.delete(h.key===null?p:h.key),n=placeChild(h,n,p),s===null?o=h:s.sibling=h,s=h);return e&&c.forEach(function(e){return deleteChild(t,e)}),wn&&pushTreeFork(t,p),o}function reconcileChildFibersImpl(e,t,n,r){if(typeof n==`object`&&n&&n.type===p&&n.key===null&&(n=n.props.children),typeof n==`object`&&n){switch(n.$$typeof){case s:a:{for(var i=n.key;t!==null;){if(t.key===i){if(i=n.type,i===p){if(t.tag===7){deleteRemainingChildren(e,t.sibling),r=useFiber(t,n.props.children),r.return=e,e=r;break a}}else if(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===S&&resolveLazy(i)===t.type){deleteRemainingChildren(e,t.sibling),r=useFiber(t,n.props),coerceRef(r,n),r.return=e,e=r;break a}deleteRemainingChildren(e,t);break}deleteChild(e,t),t=t.sibling}n.type===p?(r=createFiberFromFragment(n.props.children,e.mode,r,n.key),r.return=e,e=r):(r=createFiberFromTypeAndProps(n.type,n.key,n.props,null,e.mode,r),coerceRef(r,n),r.return=e,e=r)}return placeSingleChild(e);case c:a:{for(i=n.key;t!==null;){if(t.key===i){if(t.tag===4&&t.stateNode.containerInfo===n.containerInfo&&t.stateNode.implementation===n.implementation){deleteRemainingChildren(e,t.sibling),r=useFiber(t,n.children||[]),r.return=e,e=r;break a}deleteRemainingChildren(e,t);break}deleteChild(e,t),t=t.sibling}r=createFiberFromPortal(n,e.mode,r),r.return=e,e=r}return placeSingleChild(e);case S:return n=resolveLazy(n),reconcileChildFibersImpl(e,t,n,r)}if(D(n))return reconcileChildrenArray(e,t,n,r);if(getIteratorFn(n)){if(i=getIteratorFn(n),typeof i!=`function`)throw Error(formatProdErrorMessage(150));return n=i.call(n),reconcileChildrenIterator(e,t,n,r)}if(typeof n.then==`function`)return reconcileChildFibersImpl(e,t,unwrapThenable(n),r);if(n.$$typeof===_)return reconcileChildFibersImpl(e,t,readContextDuringReconciliation(e,n),r);throwOnInvalidObjectTypeImpl(e,n)}return typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`?(n=``+n,t!==null&&t.tag===6?(deleteRemainingChildren(e,t.sibling),r=useFiber(t,n),r.return=e,e=r):(deleteRemainingChildren(e,t),r=createFiberFromText(n,e.mode,r),r.return=e,e=r),placeSingleChild(e)):deleteRemainingChildren(e,t)}return function(e,t,n,r){try{qn=0;var i=reconcileChildFibersImpl(e,t,n,r);return Kn=null,i}catch(t){if(t===Vn||t===Un)throw t;var o=createFiberImplClass(29,t,null,e.mode);return o.lanes=r,o.return=e,o}}}var Jn=createChildReconciler(!0),Yn=createChildReconciler(!1),Xn=!1;function initializeUpdateQueue(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function cloneUpdateQueue(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function createUpdate(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function enqueueUpdate(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,jr&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=getRootForUpdatedFiber(e),markUpdateLaneFromFiberToRoot(e,null,n),t}return enqueueUpdate$1(e,r,t,n),getRootForUpdatedFiber(e)}function entangleTransitions(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,markRootEntangled(e,n)}}function enqueueCapturedUpdate(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Zn=!1;function suspendIfUpdateReadFromEntangledAsyncAction(){if(Zn){var e=Rn;if(e!==null)throw e}}function processUpdateQueue(e,t,n,r){Zn=!1;var o=e.updateQueue;Xn=!1;var s=o.firstBaseUpdate,c=o.lastBaseUpdate,p=o.shared.pending;if(p!==null){o.shared.pending=null;var m=p,h=m.next;m.next=null,c===null?s=h:c.next=h,c=m;var g=e.alternate;g!==null&&(g=g.updateQueue,p=g.lastBaseUpdate,p!==c&&(p===null?g.firstBaseUpdate=h:p.next=h,g.lastBaseUpdate=m))}if(s!==null){var _=o.baseState;c=0,g=h=m=null,p=s;do{var v=p.lane&-536870913,y=v!==p.lane;if(y?(Pr&v)===v:(r&v)===v){v!==0&&v===Ln&&(Zn=!0),g!==null&&(g=g.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});a:{var b=e,x=p;v=t;var S=n;switch(x.tag){case 1:if(b=x.payload,typeof b==`function`){_=b.call(S,_,v);break a}_=b;break a;case 3:b.flags=b.flags&-65537|128;case 0:if(b=x.payload,v=typeof b==`function`?b.call(S,_,v):b,v==null)break a;_=i({},_,v);break a;case 2:Xn=!0}}v=p.callback,v!==null&&(e.flags|=64,y&&(e.flags|=8192),y=o.callbacks,y===null?o.callbacks=[v]:y.push(v))}else y={lane:v,tag:p.tag,payload:p.payload,callback:p.callback,next:null},g===null?(h=g=y,m=_):g=g.next=y,c|=v;if(p=p.next,p===null){if(p=o.shared.pending,p===null)break;y=p,p=y.next,y.next=null,o.lastBaseUpdate=y,o.shared.pending=null}}while(1);g===null&&(m=_),o.baseState=m,o.firstBaseUpdate=h,o.lastBaseUpdate=g,s===null&&(o.shared.lanes=0),z|=c,e.lanes=c,e.memoizedState=_}}function callCallback(e,t){if(typeof e!=`function`)throw Error(formatProdErrorMessage(191,e));e.call(t)}function commitCallbacks(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)callCallback(n[e],t)}var Qn=createCursor(null),$n=createCursor(0);function pushHiddenContext(e,t){e=zr,push($n,e),push(Qn,t),zr=e|t.baseLanes}function reuseHiddenContextOnStack(){push($n,zr),push(Qn,Qn.current)}function popHiddenContext(){zr=$n.current,pop(Qn),pop($n)}var er=createCursor(null),tr=null;function pushPrimaryTreeSuspenseHandler(e){var t=e.alternate;push(nr,nr.current&1),push(er,e),tr===null&&(t===null||Qn.current!==null||t.memoizedState!==null)&&(tr=e)}function pushDehydratedActivitySuspenseHandler(e){push(nr,nr.current),push(er,e),tr===null&&(tr=e)}function pushOffscreenSuspenseHandler(e){e.tag===22?(push(nr,nr.current),push(er,e),tr===null&&(tr=e)):reuseSuspenseHandlerOnStack(e)}function reuseSuspenseHandlerOnStack(){push(nr,nr.current),push(er,er.current)}function popSuspenseHandler(e){pop(er),tr===e&&(tr=null),pop(nr)}var nr=createCursor(0);function findFirstSuspended(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||isSuspenseInstancePending(n)||isSuspenseInstanceFallback(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var rr=0,F=null,I=null,ir=null,ar=!1,sr=!1,cr=!1,lr=0,ur=0,dr=null,fr=0;function throwInvalidHookError(){throw Error(formatProdErrorMessage(321))}function areHookInputsEqual(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ut(e[n],t[n]))return!1;return!0}function renderWithHooks(e,t,n,r,i,o){return rr=o,F=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?mr:hr,cr=!1,o=n(r,i),cr=!1,sr&&(o=renderWithHooksAgain(t,n,r,i)),finishRenderingHooks(e),o}function finishRenderingHooks(e){O.H=pr;var t=I!==null&&I.next!==null;if(rr=0,ir=I=F=null,ar=!1,ur=0,dr=null,t)throw Error(formatProdErrorMessage(300));e===null||yr||(e=e.dependencies,e!==null&&checkIfContextChanged(e)&&(yr=!0))}function renderWithHooksAgain(e,t,n,r){F=e;var i=0;do{if(sr&&(dr=null),ur=0,sr=!1,25<=i)throw Error(formatProdErrorMessage(301));if(i+=1,ir=I=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}O.H=gr,o=t(n,r)}while(sr);return o}function TransitionAwareHostComponent(){var e=O.H,t=e.useState()[0];return t=typeof t.then==`function`?useThenable(t):t,e=e.useState()[0],(I===null?null:I.memoizedState)!==e&&(F.flags|=1024),t}function checkDidRenderIdHook(){var e=lr!==0;return lr=0,e}function bailoutHooks(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function resetHooksOnUnwind(e){if(ar){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ar=!1}rr=0,ir=I=F=null,sr=!1,ur=lr=0,dr=null}function mountWorkInProgressHook(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ir===null?F.memoizedState=ir=e:ir=ir.next=e,ir}function updateWorkInProgressHook(){if(I===null){var e=F.alternate;e=e===null?null:e.memoizedState}else e=I.next;var t=ir===null?F.memoizedState:ir.next;if(t!==null)ir=t,I=e;else{if(e===null)throw F.alternate===null?Error(formatProdErrorMessage(467)):Error(formatProdErrorMessage(310));I=e,e={memoizedState:I.memoizedState,baseState:I.baseState,baseQueue:I.baseQueue,queue:I.queue,next:null},ir===null?F.memoizedState=ir=e:ir=ir.next=e}return ir}function createFunctionComponentUpdateQueue(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function useThenable(e){var t=ur;return ur+=1,dr===null&&(dr=[]),e=trackUsedThenable(dr,e,t),t=F,(ir===null?t.memoizedState:ir.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?mr:hr),e}function use(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return useThenable(e);if(e.$$typeof===_)return readContext(e)}throw Error(formatProdErrorMessage(438,String(e)))}function useMemoCache(e){var t=null,n=F.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=F.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=createFunctionComponentUpdateQueue(),F.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=w;return t.index++,n}function basicStateReducer(e,t){return typeof t==`function`?t(e):t}function updateReducer(e){return updateReducerImpl(updateWorkInProgressHook(),I,e)}function updateReducerImpl(e,t,n){var r=e.queue;if(r===null)throw Error(formatProdErrorMessage(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,p=null,m=t,h=!1;do{var g=m.lane&-536870913;if(g===m.lane?(rr&g)===g:(Pr&g)===g){var _=m.revertLane;if(_===0)p!==null&&(p=p.next={lane:0,revertLane:0,gesture:null,action:m.action,hasEagerState:m.hasEagerState,eagerState:m.eagerState,next:null}),g===Ln&&(h=!0);else if((rr&_)===_){m=m.next,_===Ln&&(h=!0);continue}else g={lane:0,revertLane:m.revertLane,gesture:null,action:m.action,hasEagerState:m.hasEagerState,eagerState:m.eagerState,next:null},p===null?(c=p=g,s=o):p=p.next=g,F.lanes|=_,z|=_;g=m.action,cr&&n(o,g),o=m.hasEagerState?m.eagerState:n(o,g)}else _={lane:g,revertLane:m.revertLane,gesture:m.gesture,action:m.action,hasEagerState:m.hasEagerState,eagerState:m.eagerState,next:null},p===null?(c=p=_,s=o):p=p.next=_,F.lanes|=g,z|=g;m=m.next}while(m!==null&&m!==t);if(p===null?s=o:p.next=c,!Ut(o,e.memoizedState)&&(yr=!0,h&&(n=Rn,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=p,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function rerenderReducer(e){var t=updateWorkInProgressHook(),n=t.queue;if(n===null)throw Error(formatProdErrorMessage(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);Ut(o,t.memoizedState)||(yr=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function updateSyncExternalStore(e,t,n){var r=F,i=updateWorkInProgressHook(),o=wn;if(o){if(n===void 0)throw Error(formatProdErrorMessage(407));n=n()}else n=t();var s=!Ut((I||i).memoizedState,n);if(s&&(i.memoizedState=n,yr=!0),i=i.queue,updateEffect(subscribeToStore.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||ir!==null&&ir.memoizedState.tag&1){if(r.flags|=2048,pushSimpleEffect(9,{destroy:void 0},updateStoreInstance.bind(null,r,i,n,t),null),Mr===null)throw Error(formatProdErrorMessage(349));o||rr&127||pushStoreConsistencyCheck(r,t,n)}return n}function pushStoreConsistencyCheck(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=F.updateQueue,t===null?(t=createFunctionComponentUpdateQueue(),F.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function updateStoreInstance(e,t,n,r){t.value=n,t.getSnapshot=r,checkIfSnapshotChanged(t)&&forceStoreRerender(e)}function subscribeToStore(e,t,n){return n(function(){checkIfSnapshotChanged(t)&&forceStoreRerender(e)})}function checkIfSnapshotChanged(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ut(e,n)}catch{return!0}}function forceStoreRerender(e){var t=enqueueConcurrentRenderForLane(e,2);t!==null&&scheduleUpdateOnFiber(t,e,2)}function mountStateImpl(e){var t=mountWorkInProgressHook();if(typeof e==`function`){var n=e;if(e=n(),cr){setIsStrictModeForDevtools(!0);try{n()}finally{setIsStrictModeForDevtools(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:basicStateReducer,lastRenderedState:e},t}function updateOptimisticImpl(e,t,n,r){return e.baseState=n,updateReducerImpl(e,I,typeof r==`function`?r:basicStateReducer)}function dispatchActionState(e,t,n,r,i){if(isRenderPhaseUpdate(e))throw Error(formatProdErrorMessage(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};O.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,runActionStateAction(t,o)):(o.next=n.next,t.pending=n.next=o)}}function runActionStateAction(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var o=O.T,s={};O.T=s;try{var c=n(i,r),p=O.S;p!==null&&p(s,c),handleActionReturnValue(e,t,c)}catch(n){onActionError(e,t,n)}finally{o!==null&&s.types!==null&&(o.types=s.types),O.T=o}}else try{o=n(i,r),handleActionReturnValue(e,t,o)}catch(n){onActionError(e,t,n)}}function handleActionReturnValue(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){onActionSuccess(e,t,n)},function(n){return onActionError(e,t,n)}):onActionSuccess(e,t,n)}function onActionSuccess(e,t,n){t.status=`fulfilled`,t.value=n,notifyActionListeners(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,runActionStateAction(e,n)))}function onActionError(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,notifyActionListeners(t),t=t.next;while(t!==r)}e.action=null}function notifyActionListeners(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function actionStateReducer(e,t){return t}function mountActionState(e,t){if(wn){var n=Mr.formState;if(n!==null){a:{var r=F;if(wn){if(P){b:{for(var i=P,o=En;i.nodeType!==8;){if(!o){i=null;break b}if(i=getNextHydratable(i.nextSibling),i===null){i=null;break b}}o=i.data,i=o===`F!`||o===`F`?i:null}if(i){P=getNextHydratable(i.nextSibling),r=i.data===`F!`;break a}}throwOnHydrationMismatch(r)}r=!1}r&&(t=n[0])}}return n=mountWorkInProgressHook(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:actionStateReducer,lastRenderedState:t},n.queue=r,n=dispatchSetState.bind(null,F,r),r.dispatch=n,r=mountStateImpl(!1),o=dispatchOptimisticSetState.bind(null,F,!1,r.queue),r=mountWorkInProgressHook(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=dispatchActionState.bind(null,F,i,o,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function updateActionState(e){return updateActionStateImpl(updateWorkInProgressHook(),I,e)}function updateActionStateImpl(e,t,n){if(t=updateReducerImpl(e,t,actionStateReducer)[0],e=updateReducer(basicStateReducer)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=useThenable(t)}catch(e){throw e===Vn?Un:e}else r=t;t=updateWorkInProgressHook();var i=t.queue,o=i.dispatch;return n!==t.memoizedState&&(F.flags|=2048,pushSimpleEffect(9,{destroy:void 0},actionStateActionEffect.bind(null,i,n),null)),[r,o,e]}function actionStateActionEffect(e,t){e.action=t}function rerenderActionState(e){var t=updateWorkInProgressHook(),n=I;if(n!==null)return updateActionStateImpl(t,n,e);updateWorkInProgressHook(),t=t.memoizedState,n=updateWorkInProgressHook();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function pushSimpleEffect(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=F.updateQueue,t===null&&(t=createFunctionComponentUpdateQueue(),F.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function updateRef(){return updateWorkInProgressHook().memoizedState}function mountEffectImpl(e,t,n,r){var i=mountWorkInProgressHook();F.flags|=e,i.memoizedState=pushSimpleEffect(1|t,{destroy:void 0},n,r===void 0?null:r)}function updateEffectImpl(e,t,n,r){var i=updateWorkInProgressHook();r=r===void 0?null:r;var o=i.memoizedState.inst;I!==null&&r!==null&&areHookInputsEqual(r,I.memoizedState.deps)?i.memoizedState=pushSimpleEffect(t,o,n,r):(F.flags|=e,i.memoizedState=pushSimpleEffect(1|t,o,n,r))}function mountEffect(e,t){mountEffectImpl(8390656,8,e,t)}function updateEffect(e,t){updateEffectImpl(2048,8,e,t)}function useEffectEventImpl(e){F.flags|=4;var t=F.updateQueue;if(t===null)t=createFunctionComponentUpdateQueue(),F.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function updateEvent(e){var t=updateWorkInProgressHook().memoizedState;return useEffectEventImpl({ref:t,nextImpl:e}),function(){if(jr&2)throw Error(formatProdErrorMessage(440));return t.impl.apply(void 0,arguments)}}function updateInsertionEffect(e,t){return updateEffectImpl(4,2,e,t)}function updateLayoutEffect(e,t){return updateEffectImpl(4,4,e,t)}function imperativeHandleEffect(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function updateImperativeHandle(e,t,n){n=n==null?null:n.concat([e]),updateEffectImpl(4,4,imperativeHandleEffect.bind(null,t,e),n)}function mountDebugValue(){}function updateCallback(e,t){var n=updateWorkInProgressHook();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&areHookInputsEqual(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function updateMemo(e,t){var n=updateWorkInProgressHook();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&areHookInputsEqual(t,r[1]))return r[0];if(r=e(),cr){setIsStrictModeForDevtools(!0);try{e()}finally{setIsStrictModeForDevtools(!1)}}return n.memoizedState=[r,t],r}function mountDeferredValueImpl(e,t,n){return n===void 0||rr&1073741824&&!(Pr&261930)?e.memoizedState=t:(e.memoizedState=n,e=requestDeferredLane(),F.lanes|=e,z|=e,n)}function updateDeferredValueImpl(e,t,n,r){return Ut(n,t)?n:Qn.current===null?!(rr&42)||rr&1073741824&&!(Pr&261930)?(yr=!0,e.memoizedState=n):(e=requestDeferredLane(),F.lanes|=e,z|=e,t):(e=mountDeferredValueImpl(e,n,r),Ut(e,t)||(yr=!0),e)}function startTransition(e,t,n,r,i){var o=k.p;k.p=o!==0&&8>o?o:8;var s=O.T,c={};O.T=c,dispatchOptimisticSetState(e,!1,t,n);try{var p=i(),m=O.S;m!==null&&m(c,p),typeof p==`object`&&p&&typeof p.then==`function`?dispatchSetStateInternal(e,t,chainThenableValue(p,r),requestUpdateLane(e)):dispatchSetStateInternal(e,t,r,requestUpdateLane(e))}catch(n){dispatchSetStateInternal(e,t,{then:function(){},status:`rejected`,reason:n},requestUpdateLane())}finally{k.p=o,s!==null&&c.types!==null&&(s.types=c.types),O.T=s}}function noop(){}function startHostTransition(e,t,n,r){if(e.tag!==5)throw Error(formatProdErrorMessage(476));var i=ensureFormComponentIsStateful(e).queue;startTransition(e,i,t,ee,n===null?noop:function(){return requestFormReset$1(e),n(r)})}function ensureFormComponentIsStateful(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:basicStateReducer,lastRenderedState:ee},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:basicStateReducer,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function requestFormReset$1(e){var t=ensureFormComponentIsStateful(e);t.next===null&&(t=e.alternate.memoizedState),dispatchSetStateInternal(e,t.next.queue,{},requestUpdateLane())}function useHostTransitionStatus(){return readContext(Ii)}function updateId(){return updateWorkInProgressHook().memoizedState}function updateRefresh(){return updateWorkInProgressHook().memoizedState}function refreshCache(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=requestUpdateLane();e=createUpdate(n);var r=enqueueUpdate(t,e,n);r!==null&&(scheduleUpdateOnFiber(r,t,n),entangleTransitions(r,t,n)),t={cache:createCache()},e.payload=t;return}t=t.return}}function dispatchReducerAction(e,t,n){var r=requestUpdateLane();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},isRenderPhaseUpdate(e)?enqueueRenderPhaseUpdate(t,n):(n=enqueueConcurrentHookUpdate(e,t,n,r),n!==null&&(scheduleUpdateOnFiber(n,e,r),entangleTransitionUpdate(n,t,r)))}function dispatchSetState(e,t,n){dispatchSetStateInternal(e,t,n,requestUpdateLane())}function dispatchSetStateInternal(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(isRenderPhaseUpdate(e))enqueueRenderPhaseUpdate(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,c=o(s,n);if(i.hasEagerState=!0,i.eagerState=c,Ut(c,s))return enqueueUpdate$1(e,t,i,0),Mr===null&&finishQueueingConcurrentUpdates(),!1}catch{}if(n=enqueueConcurrentHookUpdate(e,t,i,r),n!==null)return scheduleUpdateOnFiber(n,e,r),entangleTransitionUpdate(n,t,r),!0}return!1}function dispatchOptimisticSetState(e,t,n,r){if(r={lane:2,revertLane:requestTransitionLane(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},isRenderPhaseUpdate(e)){if(t)throw Error(formatProdErrorMessage(479))}else t=enqueueConcurrentHookUpdate(e,n,r,2),t!==null&&scheduleUpdateOnFiber(t,e,2)}function isRenderPhaseUpdate(e){var t=e.alternate;return e===F||t!==null&&t===F}function enqueueRenderPhaseUpdate(e,t){sr=ar=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function entangleTransitionUpdate(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,markRootEntangled(e,n)}}var pr={readContext,use,useCallback:throwInvalidHookError,useContext:throwInvalidHookError,useEffect:throwInvalidHookError,useImperativeHandle:throwInvalidHookError,useLayoutEffect:throwInvalidHookError,useInsertionEffect:throwInvalidHookError,useMemo:throwInvalidHookError,useReducer:throwInvalidHookError,useRef:throwInvalidHookError,useState:throwInvalidHookError,useDebugValue:throwInvalidHookError,useDeferredValue:throwInvalidHookError,useTransition:throwInvalidHookError,useSyncExternalStore:throwInvalidHookError,useId:throwInvalidHookError,useHostTransitionStatus:throwInvalidHookError,useFormState:throwInvalidHookError,useActionState:throwInvalidHookError,useOptimistic:throwInvalidHookError,useMemoCache:throwInvalidHookError,useCacheRefresh:throwInvalidHookError};pr.useEffectEvent=throwInvalidHookError;var mr={readContext,use,useCallback:function(e,t){return mountWorkInProgressHook().memoizedState=[e,t===void 0?null:t],e},useContext:readContext,useEffect:mountEffect,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),mountEffectImpl(4194308,4,imperativeHandleEffect.bind(null,t,e),n)},useLayoutEffect:function(e,t){return mountEffectImpl(4194308,4,e,t)},useInsertionEffect:function(e,t){mountEffectImpl(4,2,e,t)},useMemo:function(e,t){var n=mountWorkInProgressHook();t=t===void 0?null:t;var r=e();if(cr){setIsStrictModeForDevtools(!0);try{e()}finally{setIsStrictModeForDevtools(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=mountWorkInProgressHook();if(n!==void 0){var i=n(t);if(cr){setIsStrictModeForDevtools(!0);try{n(t)}finally{setIsStrictModeForDevtools(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=dispatchReducerAction.bind(null,F,e),[r.memoizedState,e]},useRef:function(e){var t=mountWorkInProgressHook();return e={current:e},t.memoizedState=e},useState:function(e){e=mountStateImpl(e);var t=e.queue,n=dispatchSetState.bind(null,F,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:mountDebugValue,useDeferredValue:function(e,t){return mountDeferredValueImpl(mountWorkInProgressHook(),e,t)},useTransition:function(){var e=mountStateImpl(!1);return e=startTransition.bind(null,F,e.queue,!0,!1),mountWorkInProgressHook().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=F,i=mountWorkInProgressHook();if(wn){if(n===void 0)throw Error(formatProdErrorMessage(407));n=n()}else{if(n=t(),Mr===null)throw Error(formatProdErrorMessage(349));Pr&127||pushStoreConsistencyCheck(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,mountEffect(subscribeToStore.bind(null,r,o,e),[e]),r.flags|=2048,pushSimpleEffect(9,{destroy:void 0},updateStoreInstance.bind(null,r,o,n,t),null),n},useId:function(){var e=mountWorkInProgressHook(),t=Mr.identifierPrefix;if(wn){var n=Sn,r=xn;n=(r&~(1<<32-Ce(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=lr++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=fr++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus,useFormState:mountActionState,useActionState:mountActionState,useOptimistic:function(e){var t=mountWorkInProgressHook();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=dispatchOptimisticSetState.bind(null,F,!0,n),n.dispatch=t,[e,t]},useMemoCache,useCacheRefresh:function(){return mountWorkInProgressHook().memoizedState=refreshCache.bind(null,F)},useEffectEvent:function(e){var t=mountWorkInProgressHook(),n={impl:e};return t.memoizedState=n,function(){if(jr&2)throw Error(formatProdErrorMessage(440));return n.impl.apply(void 0,arguments)}}},hr={readContext,use,useCallback:updateCallback,useContext:readContext,useEffect:updateEffect,useImperativeHandle:updateImperativeHandle,useInsertionEffect:updateInsertionEffect,useLayoutEffect:updateLayoutEffect,useMemo:updateMemo,useReducer:updateReducer,useRef:updateRef,useState:function(){return updateReducer(basicStateReducer)},useDebugValue:mountDebugValue,useDeferredValue:function(e,t){return updateDeferredValueImpl(updateWorkInProgressHook(),I.memoizedState,e,t)},useTransition:function(){var e=updateReducer(basicStateReducer)[0],t=updateWorkInProgressHook().memoizedState;return[typeof e==`boolean`?e:useThenable(e),t]},useSyncExternalStore:updateSyncExternalStore,useId:updateId,useHostTransitionStatus,useFormState:updateActionState,useActionState:updateActionState,useOptimistic:function(e,t){return updateOptimisticImpl(updateWorkInProgressHook(),I,e,t)},useMemoCache,useCacheRefresh:updateRefresh};hr.useEffectEvent=updateEvent;var gr={readContext,use,useCallback:updateCallback,useContext:readContext,useEffect:updateEffect,useImperativeHandle:updateImperativeHandle,useInsertionEffect:updateInsertionEffect,useLayoutEffect:updateLayoutEffect,useMemo:updateMemo,useReducer:rerenderReducer,useRef:updateRef,useState:function(){return rerenderReducer(basicStateReducer)},useDebugValue:mountDebugValue,useDeferredValue:function(e,t){var n=updateWorkInProgressHook();return I===null?mountDeferredValueImpl(n,e,t):updateDeferredValueImpl(n,I.memoizedState,e,t)},useTransition:function(){var e=rerenderReducer(basicStateReducer)[0],t=updateWorkInProgressHook().memoizedState;return[typeof e==`boolean`?e:useThenable(e),t]},useSyncExternalStore:updateSyncExternalStore,useId:updateId,useHostTransitionStatus,useFormState:rerenderActionState,useActionState:rerenderActionState,useOptimistic:function(e,t){var n=updateWorkInProgressHook();return I===null?(n.baseState=e,[e,n.queue.dispatch]):updateOptimisticImpl(n,I,e,t)},useMemoCache,useCacheRefresh:updateRefresh};gr.useEffectEvent=updateEvent;function applyDerivedStateFromProps(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:i({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var _r={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=requestUpdateLane(),i=createUpdate(r);i.payload=t,n!=null&&(i.callback=n),t=enqueueUpdate(e,i,r),t!==null&&(scheduleUpdateOnFiber(t,e,r),entangleTransitions(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=requestUpdateLane(),i=createUpdate(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=enqueueUpdate(e,i,r),t!==null&&(scheduleUpdateOnFiber(t,e,r),entangleTransitions(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=requestUpdateLane(),r=createUpdate(n);r.tag=2,t!=null&&(r.callback=t),t=enqueueUpdate(e,r,n),t!==null&&(scheduleUpdateOnFiber(t,e,n),entangleTransitions(t,e,n))}};function checkShouldComponentUpdate(e,t,n,r,i,o,s){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,o,s):t.prototype&&t.prototype.isPureReactComponent?!shallowEqual(n,r)||!shallowEqual(i,o):!0}function callComponentWillReceiveProps(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&_r.enqueueReplaceState(t,t.state,null)}function resolveClassComponentProps(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var o in n===t&&(n=i({},n)),e)n[o]===void 0&&(n[o]=e[o]);return n}function defaultOnUncaughtError(e){cn(e)}function defaultOnCaughtError(e){console.error(e)}function defaultOnRecoverableError(e){cn(e)}function logUncaughtError(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function logCaughtError(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function createRootErrorUpdate(e,t,n){return n=createUpdate(n),n.tag=3,n.payload={element:null},n.callback=function(){logUncaughtError(e,t)},n}function createClassErrorUpdate(e){return e=createUpdate(e),e.tag=3,e}function initializeClassErrorUpdate(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var o=r.value;e.payload=function(){return i(o)},e.callback=function(){logCaughtError(t,n,r)}}var s=n.stateNode;s!==null&&typeof s.componentDidCatch==`function`&&(e.callback=function(){logCaughtError(t,n,r),typeof i!=`function`&&(Qr===null?Qr=new Set([this]):Qr.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function throwException(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&propagateParentContextChanges(t,n,i,!0),n=er.current,n!==null){switch(n.tag){case 31:case 13:return tr===null?renderDidSuspendDelayIfPossible():n.alternate===null&&Br===0&&(Br=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Wn?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),attachPingListener(e,r,i)),!1;case 22:return n.flags|=65536,r===Wn?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),attachPingListener(e,r,i)),!1}throw Error(formatProdErrorMessage(435,n.tag))}return attachPingListener(e,r,i),renderDidSuspendDelayIfPossible(),!1}if(wn)return t=er.current,t===null?(r!==Dn&&(t=Error(formatProdErrorMessage(423),{cause:r}),queueHydrationError(createCapturedValueAtFiber(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=createCapturedValueAtFiber(r,n),i=createRootErrorUpdate(e.stateNode,r,i),enqueueCapturedUpdate(e,i),Br!==4&&(Br=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Dn&&(e=Error(formatProdErrorMessage(422),{cause:r}),queueHydrationError(createCapturedValueAtFiber(e,n)))),!1;var o=Error(formatProdErrorMessage(520),{cause:r});if(o=createCapturedValueAtFiber(o,n),Gr===null?Gr=[o]:Gr.push(o),Br!==4&&(Br=2),t===null)return!0;r=createCapturedValueAtFiber(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=createRootErrorUpdate(n.stateNode,r,e),enqueueCapturedUpdate(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Qr===null||!Qr.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=createClassErrorUpdate(i),initializeClassErrorUpdate(i,e,n,r),enqueueCapturedUpdate(n,i),!1}n=n.return}while(n!==null);return!1}var vr=Error(formatProdErrorMessage(461)),yr=!1;function reconcileChildren(e,t,n,r){t.child=e===null?Yn(t,null,n,r):Jn(t,e.child,n,r)}function updateForwardRef(e,t,n,r,i){n=n.render;var o=t.ref;if(`ref`in r){var s={};for(var c in r)c!==`ref`&&(s[c]=r[c])}else s=r;return prepareToReadContext(t),r=renderWithHooks(e,t,n,s,o,i),c=checkDidRenderIdHook(),e!==null&&!yr?(bailoutHooks(e,t,i),bailoutOnAlreadyFinishedWork(e,t,i)):(wn&&c&&pushMaterializedTreeId(t),t.flags|=1,reconcileChildren(e,t,r,i),t.child)}function updateMemoComponent(e,t,n,r,i){if(e===null){var o=n.type;return typeof o==`function`&&!shouldConstruct(o)&&o.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=o,updateSimpleMemoComponent(e,t,o,r,i)):(e=createFiberFromTypeAndProps(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!checkScheduledUpdateOrContext(e,i)){var s=o.memoizedProps;if(n=n.compare,n=n===null?shallowEqual:n,n(s,r)&&e.ref===t.ref)return bailoutOnAlreadyFinishedWork(e,t,i)}return t.flags|=1,e=createWorkInProgress(o,r),e.ref=t.ref,e.return=t,t.child=e}function updateSimpleMemoComponent(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(shallowEqual(o,r)&&e.ref===t.ref){if(yr=!1,t.pendingProps=r=o,checkScheduledUpdateOrContext(e,i))e.flags&131072&&(yr=!0);else return t.lanes=e.lanes,bailoutOnAlreadyFinishedWork(e,t,i)}}return updateFunctionComponent(e,t,n,r,i)}function updateOffscreenComponent(e,t,n,r){var i=r.children,o=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(o=o===null?n:o.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~o}else r=0,t.child=null;return deferHiddenOffscreenComponent(e,t,o,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&pushTransition(t,o===null?null:o.cachePool),o===null?reuseHiddenContextOnStack():pushHiddenContext(t,o),pushOffscreenSuspenseHandler(t);else return r=t.lanes=536870912,deferHiddenOffscreenComponent(e,t,o===null?n:o.baseLanes|n,n,r)}else o===null?(e!==null&&pushTransition(t,null),reuseHiddenContextOnStack(),reuseSuspenseHandlerOnStack(t)):(pushTransition(t,o.cachePool),pushHiddenContext(t,o),reuseSuspenseHandlerOnStack(t),t.memoizedState=null);return reconcileChildren(e,t,i,n),t.child}function bailoutOffscreenComponent(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function deferHiddenOffscreenComponent(e,t,n,r,i){var o=peekCacheFromPool();return o=o===null?null:{parent:Pn._currentValue,pool:o},t.memoizedState={baseLanes:n,cachePool:o},e!==null&&pushTransition(t,null),reuseHiddenContextOnStack(),pushOffscreenSuspenseHandler(t),e!==null&&propagateParentContextChanges(e,t,r,!0),t.childLanes=i,null}function mountActivityChildren(e,t){return t=mountWorkInProgressOffscreenFiber({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function retryActivityComponentWithoutHydrating(e,t,n){return Jn(t,e.child,null,n),e=mountActivityChildren(t,t.pendingProps),e.flags|=2,popSuspenseHandler(t),t.memoizedState=null,e}function updateActivityComponent(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(wn){if(r.mode===`hidden`)return e=mountActivityChildren(t,r),t.lanes=536870912,bailoutOffscreenComponent(null,e);if(pushDehydratedActivitySuspenseHandler(t),(e=P)?(e=canHydrateHydrationBoundary(e,En),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bn===null?null:{id:xn,overflow:Sn},retryLane:536870912,hydrationErrors:null},n=createFiberFromDehydratedFragment(e),n.return=t,t.child=n,Cn=t,P=null)):e=null,e===null)throw throwOnHydrationMismatch(t);return t.lanes=536870912,null}return mountActivityChildren(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(pushDehydratedActivitySuspenseHandler(t),i){if(t.flags&256)t.flags&=-257,t=retryActivityComponentWithoutHydrating(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(formatProdErrorMessage(558))}else if(yr||propagateParentContextChanges(e,t,n,!1),i=(n&e.childLanes)!==0,yr||i){if(r=Mr,r!==null&&(s=getBumpedLaneForHydration(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,enqueueConcurrentRenderForLane(e,s),scheduleUpdateOnFiber(r,e,s),vr;renderDidSuspendDelayIfPossible(),t=retryActivityComponentWithoutHydrating(e,t,n)}else e=o.treeContext,P=getNextHydratable(s.nextSibling),Cn=t,wn=!0,Tn=null,En=!1,e!==null&&restoreSuspendedTreeContext(t,e),t=mountActivityChildren(t,r),t.flags|=4096;return t}return e=createWorkInProgress(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function markRef(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(formatProdErrorMessage(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function updateFunctionComponent(e,t,n,r,i){return prepareToReadContext(t),n=renderWithHooks(e,t,n,r,void 0,i),r=checkDidRenderIdHook(),e!==null&&!yr?(bailoutHooks(e,t,i),bailoutOnAlreadyFinishedWork(e,t,i)):(wn&&r&&pushMaterializedTreeId(t),t.flags|=1,reconcileChildren(e,t,n,i),t.child)}function replayFunctionComponent(e,t,n,r,i,o){return prepareToReadContext(t),t.updateQueue=null,n=renderWithHooksAgain(t,r,n,i),finishRenderingHooks(e),r=checkDidRenderIdHook(),e!==null&&!yr?(bailoutHooks(e,t,o),bailoutOnAlreadyFinishedWork(e,t,o)):(wn&&r&&pushMaterializedTreeId(t),t.flags|=1,reconcileChildren(e,t,n,o),t.child)}function updateClassComponent(e,t,n,r,i){if(prepareToReadContext(t),t.stateNode===null){var o=fn,s=n.contextType;typeof s==`object`&&s&&(o=readContext(s)),o=new n(r,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=_r,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=r,o.state=t.memoizedState,o.refs={},initializeUpdateQueue(t),s=n.contextType,o.context=typeof s==`object`&&s?readContext(s):fn,o.state=t.memoizedState,s=n.getDerivedStateFromProps,typeof s==`function`&&(applyDerivedStateFromProps(t,n,s,r),o.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof o.getSnapshotBeforeUpdate==`function`||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(s=o.state,typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount(),s!==o.state&&_r.enqueueReplaceState(o,o.state,null),processUpdateQueue(t,r,o,i),suspendIfUpdateReadFromEntangledAsyncAction(),o.state=t.memoizedState),typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){o=t.stateNode;var c=t.memoizedProps,p=resolveClassComponentProps(n,c);o.props=p;var m=o.context,h=n.contextType;s=fn,typeof h==`object`&&h&&(s=readContext(h));var g=n.getDerivedStateFromProps;h=typeof g==`function`||typeof o.getSnapshotBeforeUpdate==`function`,c=t.pendingProps!==c,h||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(c||m!==s)&&callComponentWillReceiveProps(t,o,r,s),Xn=!1;var _=t.memoizedState;o.state=_,processUpdateQueue(t,r,o,i),suspendIfUpdateReadFromEntangledAsyncAction(),m=t.memoizedState,c||_!==m||Xn?(typeof g==`function`&&(applyDerivedStateFromProps(t,n,g,r),m=t.memoizedState),(p=Xn||checkShouldComponentUpdate(t,n,p,r,_,m,s))?(h||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=s,r=p):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,cloneUpdateQueue(e,t),s=t.memoizedProps,h=resolveClassComponentProps(n,s),o.props=h,g=t.pendingProps,_=o.context,m=n.contextType,p=fn,typeof m==`object`&&m&&(p=readContext(m)),c=n.getDerivedStateFromProps,(m=typeof c==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==g||_!==p)&&callComponentWillReceiveProps(t,o,r,p),Xn=!1,_=t.memoizedState,o.state=_,processUpdateQueue(t,r,o,i),suspendIfUpdateReadFromEntangledAsyncAction();var v=t.memoizedState;s!==g||_!==v||Xn||e!==null&&e.dependencies!==null&&checkIfContextChanged(e.dependencies)?(typeof c==`function`&&(applyDerivedStateFromProps(t,n,c,r),v=t.memoizedState),(h=Xn||checkShouldComponentUpdate(t,n,h,r,_,v,p)||e!==null&&e.dependencies!==null&&checkIfContextChanged(e.dependencies))?(m||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,v,p),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,v,p)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),o.props=r,o.state=v,o.context=p,r=h):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),r=!1)}return o=r,markRef(e,t),r=!!(t.flags&128),o||r?(o=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:o.render(),t.flags|=1,e!==null&&r?(t.child=Jn(t,e.child,null,i),t.child=Jn(t,null,n,i)):reconcileChildren(e,t,n,i),t.memoizedState=o.state,e=t.child):e=bailoutOnAlreadyFinishedWork(e,t,i),e}function mountHostRootWithoutHydrating(e,t,n,r){return resetHydrationState(),t.flags|=256,reconcileChildren(e,t,n,r),t.child}var br={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mountSuspenseOffscreenState(e){return{baseLanes:e,cachePool:getSuspendedCache()}}function getRemainingWorkInPrimaryTree(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Ur),e}function updateSuspenseComponent(e,t,n){var r=t.pendingProps,i=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(nr.current&2)),s&&(i=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(wn){if(i?pushPrimaryTreeSuspenseHandler(t):reuseSuspenseHandlerOnStack(t),(e=P)?(e=canHydrateHydrationBoundary(e,En),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bn===null?null:{id:xn,overflow:Sn},retryLane:536870912,hydrationErrors:null},n=createFiberFromDehydratedFragment(e),n.return=t,t.child=n,Cn=t,P=null)):e=null,e===null)throw throwOnHydrationMismatch(t);return isSuspenseInstanceFallback(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,i?(reuseSuspenseHandlerOnStack(t),i=t.mode,c=mountWorkInProgressOffscreenFiber({mode:`hidden`,children:c},i),r=createFiberFromFragment(r,i,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=mountSuspenseOffscreenState(n),r.childLanes=getRemainingWorkInPrimaryTree(e,s,n),t.memoizedState=br,bailoutOffscreenComponent(null,r)):(pushPrimaryTreeSuspenseHandler(t),mountSuspensePrimaryChildren(t,c))}var p=e.memoizedState;if(p!==null&&(c=p.dehydrated,c!==null)){if(o)t.flags&256?(pushPrimaryTreeSuspenseHandler(t),t.flags&=-257,t=retrySuspenseComponentWithoutHydrating(e,t,n)):t.memoizedState===null?(reuseSuspenseHandlerOnStack(t),c=r.fallback,i=t.mode,r=mountWorkInProgressOffscreenFiber({mode:`visible`,children:r.children},i),c=createFiberFromFragment(c,i,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Jn(t,e.child,null,n),r=t.child,r.memoizedState=mountSuspenseOffscreenState(n),r.childLanes=getRemainingWorkInPrimaryTree(e,s,n),t.memoizedState=br,t=bailoutOffscreenComponent(null,r)):(reuseSuspenseHandlerOnStack(t),t.child=e.child,t.flags|=128,t=null);else if(pushPrimaryTreeSuspenseHandler(t),isSuspenseInstanceFallback(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var m=s.dgst;s=m,r=Error(formatProdErrorMessage(419)),r.stack=``,r.digest=s,queueHydrationError({value:r,source:null,stack:null}),t=retrySuspenseComponentWithoutHydrating(e,t,n)}else if(yr||propagateParentContextChanges(e,t,n,!1),s=(n&e.childLanes)!==0,yr||s){if(s=Mr,s!==null&&(r=getBumpedLaneForHydration(s,n),r!==0&&r!==p.retryLane))throw p.retryLane=r,enqueueConcurrentRenderForLane(e,r),scheduleUpdateOnFiber(s,e,r),vr;isSuspenseInstancePending(c)||renderDidSuspendDelayIfPossible(),t=retrySuspenseComponentWithoutHydrating(e,t,n)}else isSuspenseInstancePending(c)?(t.flags|=192,t.child=e.child,t=null):(e=p.treeContext,P=getNextHydratable(c.nextSibling),Cn=t,wn=!0,Tn=null,En=!1,e!==null&&restoreSuspendedTreeContext(t,e),t=mountSuspensePrimaryChildren(t,r.children),t.flags|=4096);return t}return i?(reuseSuspenseHandlerOnStack(t),c=r.fallback,i=t.mode,p=e.child,m=p.sibling,r=createWorkInProgress(p,{mode:`hidden`,children:r.children}),r.subtreeFlags=p.subtreeFlags&65011712,m===null?(c=createFiberFromFragment(c,i,n,null),c.flags|=2):c=createWorkInProgress(m,c),c.return=t,r.return=t,r.sibling=c,t.child=r,bailoutOffscreenComponent(null,r),r=t.child,c=e.child.memoizedState,c===null?c=mountSuspenseOffscreenState(n):(i=c.cachePool,i===null?i=getSuspendedCache():(p=Pn._currentValue,i=i.parent===p?i:{parent:p,pool:p}),c={baseLanes:c.baseLanes|n,cachePool:i}),r.memoizedState=c,r.childLanes=getRemainingWorkInPrimaryTree(e,s,n),t.memoizedState=br,bailoutOffscreenComponent(e.child,r)):(pushPrimaryTreeSuspenseHandler(t),n=e.child,e=n.sibling,n=createWorkInProgress(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function mountSuspensePrimaryChildren(e,t){return t=mountWorkInProgressOffscreenFiber({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function mountWorkInProgressOffscreenFiber(e,t){return e=createFiberImplClass(22,e,null,t),e.lanes=0,e}function retrySuspenseComponentWithoutHydrating(e,t,n){return Jn(t,e.child,null,n),e=mountSuspensePrimaryChildren(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function scheduleSuspenseWorkOnFiber(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),scheduleContextWorkOnParentPath(e.return,t,n)}function initSuspenseListRenderState(e,t,n,r,i,o){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:o}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i,s.treeForkCount=o)}function updateSuspenseListComponent(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;r=r.children;var s=nr.current,c=!!(s&2);if(c?(s=s&1|2,t.flags|=128):s&=1,push(nr,s),reconcileChildren(e,t,r,n),r=wn?_n:0,!c&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&scheduleSuspenseWorkOnFiber(e,n,t);else if(e.tag===19)scheduleSuspenseWorkOnFiber(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&findFirstSuspended(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),initSuspenseListRenderState(t,!1,i,n,o,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&findFirstSuspended(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}initSuspenseListRenderState(t,!0,n,null,o,r);break;case`together`:initSuspenseListRenderState(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function bailoutOnAlreadyFinishedWork(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),z|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(propagateParentContextChanges(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(formatProdErrorMessage(153));if(t.child!==null){for(e=t.child,n=createWorkInProgress(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=createWorkInProgress(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function checkScheduledUpdateOrContext(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&checkIfContextChanged(e)))}function attemptEarlyBailoutIfNoScheduledUpdate(e,t,n){switch(t.tag){case 3:pushHostContainer(t,t.stateNode.containerInfo),pushProvider(t,Pn,e.memoizedState.cache),resetHydrationState();break;case 27:case 5:pushHostContext(t);break;case 4:pushHostContainer(t,t.stateNode.containerInfo);break;case 10:pushProvider(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,pushDehydratedActivitySuspenseHandler(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(pushPrimaryTreeSuspenseHandler(t),e=bailoutOnAlreadyFinishedWork(e,t,n),e===null?null:e.sibling):updateSuspenseComponent(e,t,n):(pushPrimaryTreeSuspenseHandler(t),t.flags|=128,null);pushPrimaryTreeSuspenseHandler(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(propagateParentContextChanges(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return updateSuspenseListComponent(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),push(nr,nr.current),r)break;return null;case 22:return t.lanes=0,updateOffscreenComponent(e,t,n,t.pendingProps);case 24:pushProvider(t,Pn,e.memoizedState.cache)}return bailoutOnAlreadyFinishedWork(e,t,n)}function beginWork(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)yr=!0;else{if(!checkScheduledUpdateOrContext(e,n)&&!(t.flags&128))return yr=!1,attemptEarlyBailoutIfNoScheduledUpdate(e,t,n);yr=!!(e.flags&131072)}}else yr=!1,wn&&t.flags&1048576&&pushTreeId(t,_n,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=resolveLazy(t.elementType),t.type=e,typeof e==`function`)shouldConstruct(e)?(r=resolveClassComponentProps(e,r),t.tag=1,t=updateClassComponent(null,t,e,r,n)):(t.tag=0,t=updateFunctionComponent(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===v){t.tag=11,t=updateForwardRef(null,t,e,r,n);break a}if(i===x){t.tag=14,t=updateMemoComponent(null,t,e,r,n);break a}}throw t=getComponentNameFromType(e)||e,Error(formatProdErrorMessage(306,t,``))}}return t;case 0:return updateFunctionComponent(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=resolveClassComponentProps(r,t.pendingProps),updateClassComponent(e,t,r,i,n);case 3:a:{if(pushHostContainer(t,t.stateNode.containerInfo),e===null)throw Error(formatProdErrorMessage(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,cloneUpdateQueue(e,t),processUpdateQueue(t,r,null,n);var s=t.memoizedState;if(r=s.cache,pushProvider(t,Pn,r),r!==o.cache&&propagateContextChanges(t,[Pn],n,!0),suspendIfUpdateReadFromEntangledAsyncAction(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=mountHostRootWithoutHydrating(e,t,r,n);break a}if(r!==i){i=createCapturedValueAtFiber(Error(formatProdErrorMessage(424)),t),queueHydrationError(i),t=mountHostRootWithoutHydrating(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(P=getNextHydratable(e.firstChild),Cn=t,wn=!0,Tn=null,En=!0,n=Yn(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(resetHydrationState(),r===i){t=bailoutOnAlreadyFinishedWork(e,t,n);break a}reconcileChildren(e,t,r,n)}t=t.child}return t;case 26:return markRef(e,t),e===null?(n=getResource(t.type,null,t.pendingProps,null))?t.memoizedState=n:wn||(n=t.type,e=t.pendingProps,r=getOwnerDocumentFromRootContainer(M.current).createElement(n),r[Ae]=t,r[je]=e,setInitialProperties(r,n,e),markNodeAsHoistable(r),t.stateNode=r):t.memoizedState=getResource(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return pushHostContext(t),e===null&&wn&&(r=t.stateNode=resolveSingletonInstance(t.type,t.pendingProps,M.current),Cn=t,En=!0,i=P,isSingletonScope(t.type)?(Oi=i,P=getNextHydratable(r.firstChild)):P=i),reconcileChildren(e,t,t.pendingProps.children,n),markRef(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&wn&&((i=r=P)&&(r=canHydrateInstance(r,t.type,t.pendingProps,En),r===null?i=!1:(t.stateNode=r,Cn=t,P=getNextHydratable(r.firstChild),En=!1,i=!0)),i||throwOnHydrationMismatch(t)),pushHostContext(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,shouldSetTextContent(i,o)?r=null:s!==null&&shouldSetTextContent(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=renderWithHooks(e,t,TransitionAwareHostComponent,null,null,n),Ii._currentValue=i),markRef(e,t),reconcileChildren(e,t,r,n),t.child;case 6:return e===null&&wn&&((e=n=P)&&(n=canHydrateTextInstance(n,t.pendingProps,En),n===null?e=!1:(t.stateNode=n,Cn=t,P=null,e=!0)),e||throwOnHydrationMismatch(t)),null;case 13:return updateSuspenseComponent(e,t,n);case 4:return pushHostContainer(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Jn(t,null,r,n):reconcileChildren(e,t,r,n),t.child;case 11:return updateForwardRef(e,t,t.type,t.pendingProps,n);case 7:return reconcileChildren(e,t,t.pendingProps,n),t.child;case 8:return reconcileChildren(e,t,t.pendingProps.children,n),t.child;case 12:return reconcileChildren(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,pushProvider(t,t.type,r.value),reconcileChildren(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,prepareToReadContext(t),i=readContext(i),r=r(i),t.flags|=1,reconcileChildren(e,t,r,n),t.child;case 14:return updateMemoComponent(e,t,t.type,t.pendingProps,n);case 15:return updateSimpleMemoComponent(e,t,t.type,t.pendingProps,n);case 19:return updateSuspenseListComponent(e,t,n);case 31:return updateActivityComponent(e,t,n);case 22:return updateOffscreenComponent(e,t,n,t.pendingProps);case 24:return prepareToReadContext(t),r=readContext(Pn),e===null?(i=peekCacheFromPool(),i===null&&(i=Mr,o=createCache(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},initializeUpdateQueue(t),pushProvider(t,Pn,i)):((e.lanes&n)!==0&&(cloneUpdateQueue(e,t),processUpdateQueue(t,null,null,n),suspendIfUpdateReadFromEntangledAsyncAction()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,pushProvider(t,Pn,r),r!==i.cache&&propagateContextChanges(t,[Pn],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),pushProvider(t,Pn,r))),reconcileChildren(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(formatProdErrorMessage(156,t.tag))}function markUpdate(e){e.flags|=4}function preloadInstanceAndSuspendIfNeeded(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(shouldRemainOnPreviousScreen())e.flags|=8192;else throw Gn=Wn,Hn}}else e.flags&=-16777217}function preloadResourceAndSuspendIfNeeded(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!preloadResource(t)){if(shouldRemainOnPreviousScreen())e.flags|=8192;else throw Gn=Wn,Hn}}function scheduleRetryEffect(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:claimNextRetryLane(),e.lanes|=t,Wr|=t)}function cutOffTailIfNeeded(e,t){if(!wn)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function bubbleProperties(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function completeWork(e,t,n){var r=t.pendingProps;switch(popTreeContext(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bubbleProperties(t),null;case 1:return bubbleProperties(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),popProvider(Pn),popHostContainer(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(popHydrationState(t)?markUpdate(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,upgradeHydrationErrorsToRecoverable())),bubbleProperties(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(markUpdate(t),o===null?(bubbleProperties(t),preloadInstanceAndSuspendIfNeeded(t,i,null,r,n)):(bubbleProperties(t),preloadResourceAndSuspendIfNeeded(t,o))):o?o===e.memoizedState?(bubbleProperties(t),t.flags&=-16777217):(markUpdate(t),bubbleProperties(t),preloadResourceAndSuspendIfNeeded(t,o)):(e=e.memoizedProps,e!==r&&markUpdate(t),bubbleProperties(t),preloadInstanceAndSuspendIfNeeded(t,i,e,r,n)),null;case 27:if(popHostContext(t),n=M.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&markUpdate(t);else{if(!r){if(t.stateNode===null)throw Error(formatProdErrorMessage(166));return bubbleProperties(t),null}e=j.current,popHydrationState(t)?prepareToHydrateHostInstance(t,e):(e=resolveSingletonInstance(i,r,n),t.stateNode=e,markUpdate(t))}return bubbleProperties(t),null;case 5:if(popHostContext(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&markUpdate(t);else{if(!r){if(t.stateNode===null)throw Error(formatProdErrorMessage(166));return bubbleProperties(t),null}if(o=j.current,popHydrationState(t))prepareToHydrateHostInstance(t,o);else{var s=getOwnerDocumentFromRootContainer(M.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[Ae]=t,o[je]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(setInitialProperties(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&markUpdate(t)}}return bubbleProperties(t),preloadInstanceAndSuspendIfNeeded(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&markUpdate(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(formatProdErrorMessage(166));if(e=M.current,popHydrationState(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Cn,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Ae]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||checkForUnmatchedText(e.nodeValue,n)),e||throwOnHydrationMismatch(t,!0)}else e=getOwnerDocumentFromRootContainer(e).createTextNode(r),e[Ae]=t,t.stateNode=e}return bubbleProperties(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=popHydrationState(t),n!==null){if(e===null){if(!r)throw Error(formatProdErrorMessage(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(formatProdErrorMessage(557));e[Ae]=t}else resetHydrationState(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;bubbleProperties(t),e=!1}else n=upgradeHydrationErrorsToRecoverable(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(popSuspenseHandler(t),t):(popSuspenseHandler(t),null);if(t.flags&128)throw Error(formatProdErrorMessage(558))}return bubbleProperties(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=popHydrationState(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(formatProdErrorMessage(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(formatProdErrorMessage(317));i[Ae]=t}else resetHydrationState(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;bubbleProperties(t),i=!1}else i=upgradeHydrationErrorsToRecoverable(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(popSuspenseHandler(t),t):(popSuspenseHandler(t),null)}return popSuspenseHandler(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),scheduleRetryEffect(t,t.updateQueue),bubbleProperties(t),null);case 4:return popHostContainer(),e===null&&listenToAllSupportedEvents(t.stateNode.containerInfo),bubbleProperties(t),null;case 10:return popProvider(t.type),bubbleProperties(t),null;case 19:if(pop(nr),r=t.memoizedState,r===null)return bubbleProperties(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)cutOffTailIfNeeded(r,!1);else{if(Br!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=findFirstSuspended(e),o!==null){for(t.flags|=128,cutOffTailIfNeeded(r,!1),e=o.updateQueue,t.updateQueue=e,scheduleRetryEffect(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)resetWorkInProgress(n,e),n=n.sibling;return push(nr,nr.current&1|2),wn&&pushTreeFork(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&fe()>Xr&&(t.flags|=128,i=!0,cutOffTailIfNeeded(r,!1),t.lanes=4194304)}}else{if(!i){if(e=findFirstSuspended(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,scheduleRetryEffect(t,e),cutOffTailIfNeeded(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!wn)return bubbleProperties(t),null}else 2*fe()-r.renderingStartTime>Xr&&n!==536870912&&(t.flags|=128,i=!0,cutOffTailIfNeeded(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(bubbleProperties(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=fe(),e.sibling=null,n=nr.current,push(nr,i?n&1|2:n&1),wn&&pushTreeFork(t,r.treeForkCount),e);case 22:case 23:return popSuspenseHandler(t),popHiddenContext(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(bubbleProperties(t),t.subtreeFlags&6&&(t.flags|=8192)):bubbleProperties(t),n=t.updateQueue,n!==null&&scheduleRetryEffect(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&pop(Bn),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),popProvider(Pn),bubbleProperties(t),null;case 25:return null;case 30:return null}throw Error(formatProdErrorMessage(156,t.tag))}function unwindWork(e,t){switch(popTreeContext(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return popProvider(Pn),popHostContainer(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return popHostContext(t),null;case 31:if(t.memoizedState!==null){if(popSuspenseHandler(t),t.alternate===null)throw Error(formatProdErrorMessage(340));resetHydrationState()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(popSuspenseHandler(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(formatProdErrorMessage(340));resetHydrationState()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pop(nr),null;case 4:return popHostContainer(),null;case 10:return popProvider(t.type),null;case 22:case 23:return popSuspenseHandler(t),popHiddenContext(),e!==null&&pop(Bn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return popProvider(Pn),null;case 25:return null;default:return null}}function unwindInterruptedWork(e,t){switch(popTreeContext(t),t.tag){case 3:popProvider(Pn),popHostContainer();break;case 26:case 27:case 5:popHostContext(t);break;case 4:popHostContainer();break;case 31:t.memoizedState!==null&&popSuspenseHandler(t);break;case 13:popSuspenseHandler(t);break;case 19:pop(nr);break;case 10:popProvider(t.type);break;case 22:case 23:popSuspenseHandler(t),popHiddenContext(),e!==null&&pop(Bn);break;case 24:popProvider(Pn)}}function commitHookEffectListMount(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var o=n.create,s=n.inst;r=o(),s.destroy=r}n=n.next}while(n!==i)}}catch(e){captureCommitPhaseError(t,t.return,e)}}function commitHookEffectListUnmount(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var o=i.next;r=o;do{if((r.tag&e)===e){var s=r.inst,c=s.destroy;if(c!==void 0){s.destroy=void 0,i=t;var p=n,m=c;try{m()}catch(e){captureCommitPhaseError(i,p,e)}}}r=r.next}while(r!==o)}}catch(e){captureCommitPhaseError(t,t.return,e)}}function commitClassCallbacks(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{commitCallbacks(t,n)}catch(t){captureCommitPhaseError(e,e.return,t)}}}function safelyCallComponentWillUnmount(e,t,n){n.props=resolveClassComponentProps(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){captureCommitPhaseError(e,t,n)}}function safelyAttachRef(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){captureCommitPhaseError(e,t,n)}}function safelyDetachRef(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){captureCommitPhaseError(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){captureCommitPhaseError(e,t,n)}else n.current=null}}function commitHostMount(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){captureCommitPhaseError(e,e.return,t)}}function commitHostUpdate(e,t,n){try{var r=e.stateNode;updateProperties(r,e.type,n,t),r[je]=t}catch(t){captureCommitPhaseError(e,e.return,t)}}function isHostParent(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&isSingletonScope(e.type)||e.tag===4}function getHostSibling(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||isHostParent(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&isSingletonScope(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function insertOrAppendPlacementNodeIntoContainer(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=noop$1));else if(r!==4&&(r===27&&isSingletonScope(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(insertOrAppendPlacementNodeIntoContainer(e,t,n),e=e.sibling;e!==null;)insertOrAppendPlacementNodeIntoContainer(e,t,n),e=e.sibling}function insertOrAppendPlacementNode(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&isSingletonScope(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(insertOrAppendPlacementNode(e,t,n),e=e.sibling;e!==null;)insertOrAppendPlacementNode(e,t,n),e=e.sibling}function commitHostSingletonAcquisition(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);setInitialProperties(t,r,n),t[Ae]=e,t[je]=n}catch(t){captureCommitPhaseError(e,e.return,t)}}var xr=!1,Sr=!1,Cr=!1,wr=typeof WeakSet==`function`?WeakSet:Set,Tr=null;function commitBeforeMutationEffects(e,t){if(e=e.containerInfo,xi=Li,e=getActiveElementDeep(e),hasSelectionCapabilities(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,p=-1,m=0,h=0,g=e,_=null;b:for(;;){for(var v;g!==n||i!==0&&g.nodeType!==3||(c=s+i),g!==o||r!==0&&g.nodeType!==3||(p=s+r),g.nodeType===3&&(s+=g.nodeValue.length),(v=g.firstChild)!==null;)_=g,g=v;for(;;){if(g===e)break b;if(_===n&&++m===i&&(c=s),_===o&&++h===r&&(p=s),(v=g.nextSibling)!==null)break;g=_,_=g.parentNode}g=v}n=c===-1||p===-1?null:{start:c,end:p}}else n=null}n||={start:0,end:0}}else n=null;for(Si={focusedElem:e,selectionRange:n},Li=!1,Tr=t;Tr!==null;)if(t=Tr,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Tr=e;else for(;Tr!==null;){switch(t=Tr,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,i=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var y=resolveClassComponentProps(n.type,i);e=r.getSnapshotBeforeUpdate(y,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){captureCommitPhaseError(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)clearContainerSparingly(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:clearContainerSparingly(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(formatProdErrorMessage(163))}if(e=t.sibling,e!==null){e.return=t.return,Tr=e;break}Tr=t.return}}function commitLayoutEffectOnFiber(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:recursivelyTraverseLayoutEffects(e,n),r&4&&commitHookEffectListMount(5,n);break;case 1:if(recursivelyTraverseLayoutEffects(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){captureCommitPhaseError(n,n.return,e)}else{var i=resolveClassComponentProps(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){captureCommitPhaseError(n,n.return,e)}}}r&64&&commitClassCallbacks(n),r&512&&safelyAttachRef(n,n.return);break;case 3:if(recursivelyTraverseLayoutEffects(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{commitCallbacks(e,t)}catch(e){captureCommitPhaseError(n,n.return,e)}}break;case 27:t===null&&r&4&&commitHostSingletonAcquisition(n);case 26:case 5:recursivelyTraverseLayoutEffects(e,n),t===null&&r&4&&commitHostMount(n),r&512&&safelyAttachRef(n,n.return);break;case 12:recursivelyTraverseLayoutEffects(e,n);break;case 31:recursivelyTraverseLayoutEffects(e,n),r&4&&commitActivityHydrationCallbacks(e,n);break;case 13:recursivelyTraverseLayoutEffects(e,n),r&4&&commitSuspenseHydrationCallbacks(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=retryDehydratedSuspenseBoundary.bind(null,n),registerSuspenseInstanceRetry(e,n))));break;case 22:if(r=n.memoizedState!==null||xr,!r){t=t!==null&&t.memoizedState!==null||Sr,i=xr;var o=Sr;xr=r,(Sr=t)&&!o?recursivelyTraverseReappearLayoutEffects(e,n,!!(n.subtreeFlags&8772)):recursivelyTraverseLayoutEffects(e,n),xr=i,Sr=o}break;case 30:break;default:recursivelyTraverseLayoutEffects(e,n)}}function detachFiberAfterEffects(e){var t=e.alternate;t!==null&&(e.alternate=null,detachFiberAfterEffects(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&detachDeletedInstance(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var L=null,Er=!1;function recursivelyTraverseDeletionEffects(e,t,n){for(n=n.child;n!==null;)commitDeletionEffectsOnFiber(e,t,n),n=n.sibling}function commitDeletionEffectsOnFiber(e,t,n){if(Se&&typeof Se.onCommitFiberUnmount==`function`)try{Se.onCommitFiberUnmount(xe,n)}catch{}switch(n.tag){case 26:Sr||safelyDetachRef(n,t),recursivelyTraverseDeletionEffects(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Sr||safelyDetachRef(n,t);var r=L,i=Er;isSingletonScope(n.type)&&(L=n.stateNode,Er=!1),recursivelyTraverseDeletionEffects(e,t,n),releaseSingletonInstance(n.stateNode),L=r,Er=i;break;case 5:Sr||safelyDetachRef(n,t);case 6:if(r=L,i=Er,L=null,recursivelyTraverseDeletionEffects(e,t,n),L=r,Er=i,L!==null){if(Er)try{(L.nodeType===9?L.body:L.nodeName===`HTML`?L.ownerDocument.body:L).removeChild(n.stateNode)}catch(e){captureCommitPhaseError(n,t,e)}else try{L.removeChild(n.stateNode)}catch(e){captureCommitPhaseError(n,t,e)}}break;case 18:L!==null&&(Er?(e=L,clearHydrationBoundary(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),retryIfBlockedOn(e)):clearHydrationBoundary(L,n.stateNode));break;case 4:r=L,i=Er,L=n.stateNode.containerInfo,Er=!0,recursivelyTraverseDeletionEffects(e,t,n),L=r,Er=i;break;case 0:case 11:case 14:case 15:commitHookEffectListUnmount(2,n,t),Sr||commitHookEffectListUnmount(4,n,t),recursivelyTraverseDeletionEffects(e,t,n);break;case 1:Sr||(safelyDetachRef(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&safelyCallComponentWillUnmount(n,t,r)),recursivelyTraverseDeletionEffects(e,t,n);break;case 21:recursivelyTraverseDeletionEffects(e,t,n);break;case 22:Sr=(r=Sr)||n.memoizedState!==null,recursivelyTraverseDeletionEffects(e,t,n),Sr=r;break;default:recursivelyTraverseDeletionEffects(e,t,n)}}function commitActivityHydrationCallbacks(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{retryIfBlockedOn(e)}catch(e){captureCommitPhaseError(t,t.return,e)}}}function commitSuspenseHydrationCallbacks(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{retryIfBlockedOn(e)}catch(e){captureCommitPhaseError(t,t.return,e)}}function getRetryCache(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new wr),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new wr),t;default:throw Error(formatProdErrorMessage(435,e.tag))}}function attachSuspenseRetryListeners(e,t){var n=getRetryCache(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=resolveRetryWakeable.bind(null,e,t);t.then(r,r)}})}function recursivelyTraverseMutationEffects(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(isSingletonScope(c.type)){L=c.stateNode,Er=!1;break a}break;case 5:L=c.stateNode,Er=!1;break a;case 3:case 4:L=c.stateNode.containerInfo,Er=!0;break a}c=c.return}if(L===null)throw Error(formatProdErrorMessage(160));commitDeletionEffectsOnFiber(o,s,i),L=null,Er=!1,o=i.alternate,o!==null&&(o.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)commitMutationEffectsOnFiber(t,e),t=t.sibling}var Dr=null;function commitMutationEffectsOnFiber(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:recursivelyTraverseMutationEffects(t,e),commitReconciliationEffects(e),r&4&&(commitHookEffectListUnmount(3,e,e.return),commitHookEffectListMount(3,e),commitHookEffectListUnmount(5,e,e.return));break;case 1:recursivelyTraverseMutationEffects(t,e),commitReconciliationEffects(e),r&512&&(Sr||n===null||safelyDetachRef(n,n.return)),r&64&&xr&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=Dr;if(recursivelyTraverseMutationEffects(t,e),commitReconciliationEffects(e),r&512&&(Sr||n===null||safelyDetachRef(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;b:switch(r){case`title`:o=i.getElementsByTagName(`title`)[0],(!o||o[Le]||o[Ae]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=i.createElement(r),i.head.insertBefore(o,i.querySelector(`head > title`))),setInitialProperties(o,r,n),o[Ae]=e,markNodeAsHoistable(o),r=o;break a;case`link`:var s=getHydratableHoistableCache(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=i.createElement(r),setInitialProperties(o,r,n),i.head.appendChild(o);break;case`meta`:if(s=getHydratableHoistableCache(`meta`,`content`,i).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=i.createElement(r),setInitialProperties(o,r,n),i.head.appendChild(o);break;default:throw Error(formatProdErrorMessage(468,r))}o[Ae]=e,markNodeAsHoistable(o),r=o}e.stateNode=r}else mountHoistable(i,e.type,e.stateNode)}else e.stateNode=acquireResource(i,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&commitHostUpdate(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?mountHoistable(i,e.type,e.stateNode):acquireResource(i,r,e.memoizedProps))}break;case 27:recursivelyTraverseMutationEffects(t,e),commitReconciliationEffects(e),r&512&&(Sr||n===null||safelyDetachRef(n,n.return)),n!==null&&r&4&&commitHostUpdate(e,e.memoizedProps,n.memoizedProps);break;case 5:if(recursivelyTraverseMutationEffects(t,e),commitReconciliationEffects(e),r&512&&(Sr||n===null||safelyDetachRef(n,n.return)),e.flags&32){i=e.stateNode;try{setTextContent(i,``)}catch(t){captureCommitPhaseError(e,e.return,t)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,commitHostUpdate(e,i,n===null?i:n.memoizedProps)),r&1024&&(Cr=!0);break;case 6:if(recursivelyTraverseMutationEffects(t,e),commitReconciliationEffects(e),r&4){if(e.stateNode===null)throw Error(formatProdErrorMessage(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){captureCommitPhaseError(e,e.return,t)}}break;case 3:if(Ni=null,i=Dr,Dr=getHoistableRoot(t.containerInfo),recursivelyTraverseMutationEffects(t,e),Dr=i,commitReconciliationEffects(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{retryIfBlockedOn(t.containerInfo)}catch(t){captureCommitPhaseError(e,e.return,t)}Cr&&(Cr=!1,recursivelyResetForms(e));break;case 4:r=Dr,Dr=getHoistableRoot(e.stateNode.containerInfo),recursivelyTraverseMutationEffects(t,e),commitReconciliationEffects(e),Dr=r;break;case 12:recursivelyTraverseMutationEffects(t,e),commitReconciliationEffects(e);break;case 31:recursivelyTraverseMutationEffects(t,e),commitReconciliationEffects(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,attachSuspenseRetryListeners(e,r)));break;case 13:recursivelyTraverseMutationEffects(t,e),commitReconciliationEffects(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Jr=fe()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,attachSuspenseRetryListeners(e,r)));break;case 22:i=e.memoizedState!==null;var p=n!==null&&n.memoizedState!==null,m=xr,h=Sr;if(xr=m||i,Sr=h||p,recursivelyTraverseMutationEffects(t,e),Sr=h,xr=m,commitReconciliationEffects(e),r&8192)a:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||p||xr||Sr||recursivelyTraverseDisappearLayoutEffects(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){p=n=t;try{if(o=p.stateNode,i)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=p.stateNode;var g=p.memoizedProps.style,_=g!=null&&g.hasOwnProperty(`display`)?g.display:null;c.style.display=_==null||typeof _==`boolean`?``:(``+_).trim()}}catch(e){captureCommitPhaseError(p,p.return,e)}}}else if(t.tag===6){if(n===null){p=t;try{p.stateNode.nodeValue=i?``:p.memoizedProps}catch(e){captureCommitPhaseError(p,p.return,e)}}}else if(t.tag===18){if(n===null){p=t;try{var v=p.stateNode;i?hideOrUnhideDehydratedBoundary(v,!0):hideOrUnhideDehydratedBoundary(p.stateNode,!1)}catch(e){captureCommitPhaseError(p,p.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,attachSuspenseRetryListeners(e,n))));break;case 19:recursivelyTraverseMutationEffects(t,e),commitReconciliationEffects(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,attachSuspenseRetryListeners(e,r)));break;case 30:break;case 21:break;default:recursivelyTraverseMutationEffects(t,e),commitReconciliationEffects(e)}}function commitReconciliationEffects(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(isHostParent(r)){n=r;break}r=r.return}if(n==null)throw Error(formatProdErrorMessage(160));switch(n.tag){case 27:var i=n.stateNode;insertOrAppendPlacementNode(e,getHostSibling(e),i);break;case 5:var o=n.stateNode;n.flags&32&&(setTextContent(o,``),n.flags&=-33),insertOrAppendPlacementNode(e,getHostSibling(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;insertOrAppendPlacementNodeIntoContainer(e,getHostSibling(e),s);break;default:throw Error(formatProdErrorMessage(161))}}catch(t){captureCommitPhaseError(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function recursivelyResetForms(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;recursivelyResetForms(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function recursivelyTraverseLayoutEffects(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)commitLayoutEffectOnFiber(e,t.alternate,t),t=t.sibling}function recursivelyTraverseDisappearLayoutEffects(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:commitHookEffectListUnmount(4,t,t.return),recursivelyTraverseDisappearLayoutEffects(t);break;case 1:safelyDetachRef(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&safelyCallComponentWillUnmount(t,t.return,n),recursivelyTraverseDisappearLayoutEffects(t);break;case 27:releaseSingletonInstance(t.stateNode);case 26:case 5:safelyDetachRef(t,t.return),recursivelyTraverseDisappearLayoutEffects(t);break;case 22:t.memoizedState===null&&recursivelyTraverseDisappearLayoutEffects(t);break;case 30:recursivelyTraverseDisappearLayoutEffects(t);break;default:recursivelyTraverseDisappearLayoutEffects(t)}e=e.sibling}}function recursivelyTraverseReappearLayoutEffects(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,o=t,s=o.flags;switch(o.tag){case 0:case 11:case 15:recursivelyTraverseReappearLayoutEffects(i,o,n),commitHookEffectListMount(4,o);break;case 1:if(recursivelyTraverseReappearLayoutEffects(i,o,n),r=o,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){captureCommitPhaseError(r,r.return,e)}if(r=o,i=r.updateQueue,i!==null){var c=r.stateNode;try{var p=i.shared.hiddenCallbacks;if(p!==null)for(i.shared.hiddenCallbacks=null,i=0;i<p.length;i++)callCallback(p[i],c)}catch(e){captureCommitPhaseError(r,r.return,e)}}n&&s&64&&commitClassCallbacks(o),safelyAttachRef(o,o.return);break;case 27:commitHostSingletonAcquisition(o);case 26:case 5:recursivelyTraverseReappearLayoutEffects(i,o,n),n&&r===null&&s&4&&commitHostMount(o),safelyAttachRef(o,o.return);break;case 12:recursivelyTraverseReappearLayoutEffects(i,o,n);break;case 31:recursivelyTraverseReappearLayoutEffects(i,o,n),n&&s&4&&commitActivityHydrationCallbacks(i,o);break;case 13:recursivelyTraverseReappearLayoutEffects(i,o,n),n&&s&4&&commitSuspenseHydrationCallbacks(i,o);break;case 22:o.memoizedState===null&&recursivelyTraverseReappearLayoutEffects(i,o,n),safelyAttachRef(o,o.return);break;case 30:break;default:recursivelyTraverseReappearLayoutEffects(i,o,n)}t=t.sibling}}function commitOffscreenPassiveMountEffects(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&releaseCache(n))}function commitCachePassiveMountEffect(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&releaseCache(e))}function recursivelyTraversePassiveMountEffects(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)commitPassiveMountOnFiber(e,t,n,r),t=t.sibling}function commitPassiveMountOnFiber(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:recursivelyTraversePassiveMountEffects(e,t,n,r),i&2048&&commitHookEffectListMount(9,t);break;case 1:recursivelyTraversePassiveMountEffects(e,t,n,r);break;case 3:recursivelyTraversePassiveMountEffects(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&releaseCache(e)));break;case 12:if(i&2048){recursivelyTraversePassiveMountEffects(e,t,n,r),e=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){captureCommitPhaseError(t,t.return,e)}}else recursivelyTraversePassiveMountEffects(e,t,n,r);break;case 31:recursivelyTraversePassiveMountEffects(e,t,n,r);break;case 13:recursivelyTraversePassiveMountEffects(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?o._visibility&2?recursivelyTraversePassiveMountEffects(e,t,n,r):(o._visibility|=2,recursivelyTraverseReconnectPassiveEffects(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):o._visibility&2?recursivelyTraversePassiveMountEffects(e,t,n,r):recursivelyTraverseAtomicPassiveEffects(e,t),i&2048&&commitOffscreenPassiveMountEffects(s,t);break;case 24:recursivelyTraversePassiveMountEffects(e,t,n,r),i&2048&&commitCachePassiveMountEffect(t.alternate,t);break;default:recursivelyTraversePassiveMountEffects(e,t,n,r)}}function recursivelyTraverseReconnectPassiveEffects(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var o=e,s=t,c=n,p=r,m=s.flags;switch(s.tag){case 0:case 11:case 15:recursivelyTraverseReconnectPassiveEffects(o,s,c,p,i),commitHookEffectListMount(8,s);break;case 23:break;case 22:var h=s.stateNode;s.memoizedState===null?(h._visibility|=2,recursivelyTraverseReconnectPassiveEffects(o,s,c,p,i)):h._visibility&2?recursivelyTraverseReconnectPassiveEffects(o,s,c,p,i):recursivelyTraverseAtomicPassiveEffects(o,s),i&&m&2048&&commitOffscreenPassiveMountEffects(s.alternate,s);break;case 24:recursivelyTraverseReconnectPassiveEffects(o,s,c,p,i),i&&m&2048&&commitCachePassiveMountEffect(s.alternate,s);break;default:recursivelyTraverseReconnectPassiveEffects(o,s,c,p,i)}t=t.sibling}}function recursivelyTraverseAtomicPassiveEffects(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:recursivelyTraverseAtomicPassiveEffects(n,r),i&2048&&commitOffscreenPassiveMountEffects(r.alternate,r);break;case 24:recursivelyTraverseAtomicPassiveEffects(n,r),i&2048&&commitCachePassiveMountEffect(r.alternate,r);break;default:recursivelyTraverseAtomicPassiveEffects(n,r)}t=t.sibling}}var Or=8192;function recursivelyAccumulateSuspenseyCommit(e,t,n){if(e.subtreeFlags&Or)for(e=e.child;e!==null;)accumulateSuspenseyCommitOnFiber(e,t,n),e=e.sibling}function accumulateSuspenseyCommitOnFiber(e,t,n){switch(e.tag){case 26:recursivelyAccumulateSuspenseyCommit(e,t,n),e.flags&Or&&e.memoizedState!==null&&suspendResource(n,Dr,e.memoizedState,e.memoizedProps);break;case 5:recursivelyAccumulateSuspenseyCommit(e,t,n);break;case 3:case 4:var r=Dr;Dr=getHoistableRoot(e.stateNode.containerInfo),recursivelyAccumulateSuspenseyCommit(e,t,n),Dr=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Or,Or=16777216,recursivelyAccumulateSuspenseyCommit(e,t,n),Or=r):recursivelyAccumulateSuspenseyCommit(e,t,n));break;default:recursivelyAccumulateSuspenseyCommit(e,t,n)}}function detachAlternateSiblings(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function recursivelyTraversePassiveUnmountEffects(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Tr=r,commitPassiveUnmountEffectsInsideOfDeletedTree_begin(r,e)}detachAlternateSiblings(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)commitPassiveUnmountOnFiber(e),e=e.sibling}function commitPassiveUnmountOnFiber(e){switch(e.tag){case 0:case 11:case 15:recursivelyTraversePassiveUnmountEffects(e),e.flags&2048&&commitHookEffectListUnmount(9,e,e.return);break;case 3:recursivelyTraversePassiveUnmountEffects(e);break;case 12:recursivelyTraversePassiveUnmountEffects(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,recursivelyTraverseDisconnectPassiveEffects(e)):recursivelyTraversePassiveUnmountEffects(e);break;default:recursivelyTraversePassiveUnmountEffects(e)}}function recursivelyTraverseDisconnectPassiveEffects(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Tr=r,commitPassiveUnmountEffectsInsideOfDeletedTree_begin(r,e)}detachAlternateSiblings(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:commitHookEffectListUnmount(8,t,t.return),recursivelyTraverseDisconnectPassiveEffects(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,recursivelyTraverseDisconnectPassiveEffects(t));break;default:recursivelyTraverseDisconnectPassiveEffects(t)}e=e.sibling}}function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(e,t){for(;Tr!==null;){var n=Tr;switch(n.tag){case 0:case 11:case 15:commitHookEffectListUnmount(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:releaseCache(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Tr=r;else a:for(n=e;Tr!==null;){r=Tr;var i=r.sibling,o=r.return;if(detachFiberAfterEffects(r),r===n){Tr=null;break a}if(i!==null){i.return=o,Tr=i;break a}Tr=o}}}var kr={getCacheForType:function(e){var t=readContext(Pn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return readContext(Pn).controller.signal}},Ar=typeof WeakMap==`function`?WeakMap:Map,jr=0,Mr=null,Nr=null,Pr=0,Fr=0,Ir=null,Lr=!1,R=!1,Rr=!1,zr=0,Br=0,z=0,Vr=0,Hr=0,Ur=0,Wr=0,Gr=null,Kr=null,qr=!1,Jr=0,Yr=0,Xr=1/0,Zr=null,Qr=null,$r=0,ei=null,ti=null,ni=0,ri=0,ii=null,ai=null,oi=0,si=null;function requestUpdateLane(){return jr&2&&Pr!==0?Pr&-Pr:O.T===null?resolveUpdatePriority():requestTransitionLane()}function requestDeferredLane(){if(Ur===0){if(!(Pr&536870912)||wn){var e=De;De<<=1,!(De&3932160)&&(De=262144),Ur=e}else Ur=536870912}return e=er.current,e!==null&&(e.flags|=32),Ur}function scheduleUpdateOnFiber(e,t,n){(e===Mr&&(Fr===2||Fr===9)||e.cancelPendingCommit!==null)&&(prepareFreshStack(e,0),markRootSuspended(e,Pr,Ur,!1)),markRootUpdated$1(e,n),(!(jr&2)||e!==Mr)&&(e===Mr&&(!(jr&2)&&(Vr|=n),Br===4&&markRootSuspended(e,Pr,Ur,!1)),ensureRootIsScheduled(e))}function performWorkOnRoot(e,t,n){if(jr&6)throw Error(formatProdErrorMessage(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||checkIfRootIsPrerendering(e,t),i=r?renderRootConcurrent(e,t):renderRootSync(e,t,!0),o=r;do{if(i===0){R&&!r&&markRootSuspended(e,t,0,!1);break}if(n=e.current.alternate,o&&!isRenderConsistentWithExternalStores(n)){i=renderRootSync(e,t,!1),o=!1;continue}if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=Gr;var p=c.current.memoizedState.isDehydrated;if(p&&(prepareFreshStack(c,s).flags|=256),s=renderRootSync(c,s,!1),s!==2){if(Rr&&!p){c.errorRecoveryDisabledLanes|=o,Vr|=o,i=4;break a}o=Kr,Kr=i,o!==null&&(Kr===null?Kr=o:Kr.push.apply(Kr,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){prepareFreshStack(e,0),markRootSuspended(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(formatProdErrorMessage(345));case 4:if((t&4194048)!==t)break;case 6:markRootSuspended(r,t,Ur,!Lr);break a;case 2:Kr=null;break;case 3:case 5:break;default:throw Error(formatProdErrorMessage(329))}if((t&62914560)===t&&(i=Jr+300-fe(),10<i)){if(markRootSuspended(r,t,Ur,!Lr),getNextLanes(r,0,!0)!==0)break a;ni=t,r.timeoutHandle=wi(commitRootWhenReady.bind(null,r,n,Kr,Zr,qr,t,Ur,Vr,Wr,Lr,o,`Throttled`,-0,0),i);break a}commitRootWhenReady(r,n,Kr,Zr,qr,t,Ur,Vr,Wr,Lr,o,null,-0,0)}break}while(1);ensureRootIsScheduled(e)}function commitRootWhenReady(e,t,n,r,i,o,s,c,p,m,h,g,_,v){if(e.timeoutHandle=-1,g=t.subtreeFlags,g&8192||(g&16785408)==16785408){g={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:noop$1},accumulateSuspenseyCommitOnFiber(t,o,g);var y=(o&62914560)===o?Jr-fe():(o&4194048)===o?Yr-fe():0;if(y=waitForCommitToBeReady(g,y),y!==null){ni=o,e.cancelPendingCommit=y(commitRoot.bind(null,e,t,o,n,r,i,s,c,p,h,g,null,_,v)),markRootSuspended(e,o,s,!m);return}}commitRoot(e,t,o,n,r,i,s,c,p)}function isRenderConsistentWithExternalStores(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!Ut(o(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function markRootSuspended(e,t,n,r){t&=~Hr,t&=~Vr,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var o=31-Ce(i),s=1<<o;r[o]=-1,i&=~s}n!==0&&markSpawnedDeferredLane(e,n,t)}function flushSyncWork$1(){return jr&6?!0:(flushSyncWorkAcrossRoots_impl(0,!1),!1)}function resetWorkInProgressStack(){if(Nr!==null){if(Fr===0)var e=Nr.return;else e=Nr,An=kn=null,resetHooksOnUnwind(e),Kn=null,qn=0,e=Nr;for(;e!==null;)unwindInterruptedWork(e.alternate,e),e=e.return;Nr=null}}function prepareFreshStack(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Ti(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ni=0,resetWorkInProgressStack(),Mr=e,Nr=n=createWorkInProgress(e.current,null),Pr=t,Fr=0,Ir=null,Lr=!1,R=checkIfRootIsPrerendering(e,t),Rr=!1,Wr=Ur=Hr=Vr=z=Br=0,Kr=Gr=null,qr=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ce(r),o=1<<i;t|=e[i],r&=~o}return zr=t,finishQueueingConcurrentUpdates(),n}function handleThrow(e,t){F=null,O.H=pr,t===Vn||t===Un?(t=getSuspendedThenable(),Fr=3):t===Hn?(t=getSuspendedThenable(),Fr=4):Fr=t===vr?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Ir=t,Nr===null&&(Br=1,logUncaughtError(e,createCapturedValueAtFiber(t,e.current)))}function shouldRemainOnPreviousScreen(){var e=er.current;return e===null?!0:(Pr&4194048)===Pr?tr===null:(Pr&62914560)===Pr||Pr&536870912?e===tr:!1}function pushDispatcher(){var e=O.H;return O.H=pr,e===null?pr:e}function pushAsyncDispatcher(){var e=O.A;return O.A=kr,e}function renderDidSuspendDelayIfPossible(){Br=4,Lr||(Pr&4194048)!==Pr&&er.current!==null||(R=!0),!(z&134217727)&&!(Vr&134217727)||Mr===null||markRootSuspended(Mr,Pr,Ur,!1)}function renderRootSync(e,t,n){var r=jr;jr|=2;var i=pushDispatcher(),o=pushAsyncDispatcher();(Mr!==e||Pr!==t)&&(Zr=null,prepareFreshStack(e,t)),t=!1;var s=Br;a:do try{if(Fr!==0&&Nr!==null){var c=Nr,p=Ir;switch(Fr){case 8:resetWorkInProgressStack(),s=6;break a;case 3:case 2:case 9:case 6:er.current===null&&(t=!0);var m=Fr;if(Fr=0,Ir=null,throwAndUnwindWorkLoop(e,c,p,m),n&&R){s=0;break a}break;default:m=Fr,Fr=0,Ir=null,throwAndUnwindWorkLoop(e,c,p,m)}}workLoopSync(),s=Br;break}catch(t){handleThrow(e,t)}while(1);return t&&e.shellSuspendCounter++,An=kn=null,jr=r,O.H=i,O.A=o,Nr===null&&(Mr=null,Pr=0,finishQueueingConcurrentUpdates()),s}function workLoopSync(){for(;Nr!==null;)performUnitOfWork(Nr)}function renderRootConcurrent(e,lanes){var t=jr;jr|=2;var n=pushDispatcher(),r=pushAsyncDispatcher();Mr!==e||Pr!==lanes?(Zr=null,Xr=fe()+500,prepareFreshStack(e,lanes)):R=checkIfRootIsPrerendering(e,lanes);a:do try{if(Fr!==0&&Nr!==null){lanes=Nr;var i=Ir;b:switch(Fr){case 1:Fr=0,Ir=null,throwAndUnwindWorkLoop(e,lanes,i,1);break;case 2:case 9:if(isThenableResolved(i)){Fr=0,Ir=null,replaySuspendedUnitOfWork(lanes);break}lanes=function(){Fr!==2&&Fr!==9||Mr!==e||(Fr=7),ensureRootIsScheduled(e)},i.then(lanes,lanes);break a;case 3:Fr=7;break a;case 4:Fr=5;break a;case 7:isThenableResolved(i)?(Fr=0,Ir=null,replaySuspendedUnitOfWork(lanes)):(Fr=0,Ir=null,throwAndUnwindWorkLoop(e,lanes,i,7));break;case 5:var o=null;switch(Nr.tag){case 26:o=Nr.memoizedState;case 5:case 27:var s=Nr;if(o?preloadResource(o):s.stateNode.complete){Fr=0,Ir=null;var c=s.sibling;if(c!==null)Nr=c;else{var p=s.return;p===null?Nr=null:(Nr=p,completeUnitOfWork(p))}break b}}Fr=0,Ir=null,throwAndUnwindWorkLoop(e,lanes,i,5);break;case 6:Fr=0,Ir=null,throwAndUnwindWorkLoop(e,lanes,i,6);break;case 8:resetWorkInProgressStack(),Br=6;break a;default:throw Error(formatProdErrorMessage(462))}}workLoopConcurrentByScheduler();break}catch(t){handleThrow(e,t)}while(1);return An=kn=null,O.H=n,O.A=r,jr=t,Nr===null?(Mr=null,Pr=0,finishQueueingConcurrentUpdates(),Br):0}function workLoopConcurrentByScheduler(){for(;Nr!==null&&!ue();)performUnitOfWork(Nr)}function performUnitOfWork(e){var t=beginWork(e.alternate,e,zr);e.memoizedProps=e.pendingProps,t===null?completeUnitOfWork(e):Nr=t}function replaySuspendedUnitOfWork(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=replayFunctionComponent(n,t,t.pendingProps,t.type,void 0,Pr);break;case 11:t=replayFunctionComponent(n,t,t.pendingProps,t.type.render,t.ref,Pr);break;case 5:resetHooksOnUnwind(t);default:unwindInterruptedWork(n,t),t=Nr=resetWorkInProgress(t,zr),t=beginWork(n,t,zr)}e.memoizedProps=e.pendingProps,t===null?completeUnitOfWork(e):Nr=t}function throwAndUnwindWorkLoop(e,t,n,r){An=kn=null,resetHooksOnUnwind(t),Kn=null,qn=0;var i=t.return;try{if(throwException(e,i,t,n,Pr)){Br=1,logUncaughtError(e,createCapturedValueAtFiber(n,e.current)),Nr=null;return}}catch(t){if(i!==null)throw Nr=i,t;Br=1,logUncaughtError(e,createCapturedValueAtFiber(n,e.current)),Nr=null;return}t.flags&32768?(wn||r===1?e=!0:R||Pr&536870912?e=!1:(Lr=e=!0,(r===2||r===9||r===3||r===6)&&(r=er.current,r!==null&&r.tag===13&&(r.flags|=16384))),unwindUnitOfWork(t,e)):completeUnitOfWork(t)}function completeUnitOfWork(e){var t=e;do{if(t.flags&32768){unwindUnitOfWork(t,Lr);return}e=t.return;var n=completeWork(t.alternate,t,zr);if(n!==null){Nr=n;return}if(t=t.sibling,t!==null){Nr=t;return}Nr=t=e}while(t!==null);Br===0&&(Br=5)}function unwindUnitOfWork(e,t){do{var n=unwindWork(e.alternate,e);if(n!==null){n.flags&=32767,Nr=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Nr=e;return}Nr=e=n}while(e!==null);Br=6,Nr=null}function commitRoot(e,t,n,r,i,o,s,c,p){e.cancelPendingCommit=null;do flushPendingEffects();while($r!==0);if(jr&6)throw Error(formatProdErrorMessage(327));if(t!==null){if(t===e.current)throw Error(formatProdErrorMessage(177));if(o=t.lanes|t.childLanes,o|=dn,markRootFinished(e,n,o,s,c,p),e===Mr&&(Nr=Mr=null,Pr=0),ti=t,ei=e,ni=n,ri=o,ii=i,ai=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,scheduleCallback$1(ge,function(){return flushPassiveEffects(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=O.T,O.T=null,i=k.p,k.p=2,s=jr,jr|=4;try{commitBeforeMutationEffects(e,t,n)}finally{jr=s,k.p=i,O.T=r}}$r=1,flushMutationEffects(),flushLayoutEffects(),flushSpawnedWork()}}function flushMutationEffects(){if($r===1){$r=0;var e=ei,t=ti,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=O.T,O.T=null;var r=k.p;k.p=2;var i=jr;jr|=4;try{commitMutationEffectsOnFiber(t,e);var o=Si,s=getActiveElementDeep(e.containerInfo),c=o.focusedElem,p=o.selectionRange;if(s!==c&&c&&c.ownerDocument&&containsNode(c.ownerDocument.documentElement,c)){if(p!==null&&hasSelectionCapabilities(c)){var m=p.start,h=p.end;if(h===void 0&&(h=m),`selectionStart`in c)c.selectionStart=m,c.selectionEnd=Math.min(h,c.value.length);else{var g=c.ownerDocument||document,_=g&&g.defaultView||window;if(_.getSelection){var v=_.getSelection(),y=c.textContent.length,b=Math.min(p.start,y),x=p.end===void 0?b:Math.min(p.end,y);!v.extend&&b>x&&(s=x,x=b,b=s);var S=getNodeForCharacterOffset(c,b),C=getNodeForCharacterOffset(c,x);if(S&&C&&(v.rangeCount!==1||v.anchorNode!==S.node||v.anchorOffset!==S.offset||v.focusNode!==C.node||v.focusOffset!==C.offset)){var w=g.createRange();w.setStart(S.node,S.offset),v.removeAllRanges(),b>x?(v.addRange(w),v.extend(C.node,C.offset)):(w.setEnd(C.node,C.offset),v.addRange(w))}}}}for(g=[],v=c;v=v.parentNode;)v.nodeType===1&&g.push({element:v,left:v.scrollLeft,top:v.scrollTop});for(typeof c.focus==`function`&&c.focus(),c=0;c<g.length;c++){var T=g[c];T.element.scrollLeft=T.left,T.element.scrollTop=T.top}}Li=!!xi,Si=xi=null}finally{jr=i,k.p=r,O.T=n}}e.current=t,$r=2}}function flushLayoutEffects(){if($r===2){$r=0;var e=ei,t=ti,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=O.T,O.T=null;var r=k.p;k.p=2;var i=jr;jr|=4;try{commitLayoutEffectOnFiber(e,t.alternate,t)}finally{jr=i,k.p=r,O.T=n}}$r=3}}function flushSpawnedWork(){if($r===4||$r===3){$r=0,de();var e=ei,t=ti,n=ni,r=ai;t.subtreeFlags&10256||t.flags&10256?$r=5:($r=0,ti=ei=null,releaseRootPooledCache(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Qr=null),lanesToEventPriority(n),t=t.stateNode,Se&&typeof Se.onCommitFiberRoot==`function`)try{Se.onCommitFiberRoot(xe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=O.T,i=k.p,k.p=2,O.T=null;try{for(var o=e.onRecoverableError,s=0;s<r.length;s++){var c=r[s];o(c.value,{componentStack:c.stack})}}finally{O.T=t,k.p=i}}ni&3&&flushPendingEffects(),ensureRootIsScheduled(e),i=e.pendingLanes,n&261930&&i&42?e===si?oi++:(oi=0,si=e):oi=0,flushSyncWorkAcrossRoots_impl(0,!1)}}function releaseRootPooledCache(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,releaseCache(t)))}function flushPendingEffects(){return flushMutationEffects(),flushLayoutEffects(),flushSpawnedWork(),flushPassiveEffects()}function flushPassiveEffects(){if($r!==5)return!1;var e=ei,t=ri;ri=0;var n=lanesToEventPriority(ni),r=O.T,i=k.p;try{k.p=32>n?32:n,O.T=null,n=ii,ii=null;var o=ei,s=ni;if($r=0,ti=ei=null,ni=0,jr&6)throw Error(formatProdErrorMessage(331));var c=jr;if(jr|=4,commitPassiveUnmountOnFiber(o.current),commitPassiveMountOnFiber(o,o.current,s,n),jr=c,flushSyncWorkAcrossRoots_impl(0,!1),Se&&typeof Se.onPostCommitFiberRoot==`function`)try{Se.onPostCommitFiberRoot(xe,o)}catch{}return!0}finally{k.p=i,O.T=r,releaseRootPooledCache(e,t)}}function captureCommitPhaseErrorOnRoot(e,t,n){t=createCapturedValueAtFiber(n,t),t=createRootErrorUpdate(e.stateNode,t,2),e=enqueueUpdate(e,t,2),e!==null&&(markRootUpdated$1(e,2),ensureRootIsScheduled(e))}function captureCommitPhaseError(e,t,n){if(e.tag===3)captureCommitPhaseErrorOnRoot(e,e,n);else for(;t!==null;){if(t.tag===3){captureCommitPhaseErrorOnRoot(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Qr===null||!Qr.has(r))){e=createCapturedValueAtFiber(n,e),n=createClassErrorUpdate(2),r=enqueueUpdate(t,n,2),r!==null&&(initializeClassErrorUpdate(n,r,t,e),markRootUpdated$1(r,2),ensureRootIsScheduled(r));break}}t=t.return}}function attachPingListener(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ar;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Rr=!0,i.add(n),e=pingSuspendedRoot.bind(null,e,t,n),t.then(e,e))}function pingSuspendedRoot(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Mr===e&&(Pr&n)===n&&(Br===4||Br===3&&(Pr&62914560)===Pr&&300>fe()-Jr?!(jr&2)&&prepareFreshStack(e,0):Hr|=n,Wr===Pr&&(Wr=0)),ensureRootIsScheduled(e)}function retryTimedOutBoundary(e,t){t===0&&(t=claimNextRetryLane()),e=enqueueConcurrentRenderForLane(e,t),e!==null&&(markRootUpdated$1(e,t),ensureRootIsScheduled(e))}function retryDehydratedSuspenseBoundary(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),retryTimedOutBoundary(e,n)}function resolveRetryWakeable(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(formatProdErrorMessage(314))}r!==null&&r.delete(t),retryTimedOutBoundary(e,n)}function scheduleCallback$1(e,t){return ce(e,t)}var B=null,li=null,ui=!1,di=!1,fi=!1,pi=0;function ensureRootIsScheduled(e){e!==li&&e.next===null&&(li===null?B=li=e:li=li.next=e),di=!0,ui||(ui=!0,scheduleImmediateRootScheduleTask())}function flushSyncWorkAcrossRoots_impl(e,t){if(!fi&&di){fi=!0;do for(var n=!1,r=B;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var o=0;else{var s=r.suspendedLanes,c=r.pingedLanes;o=(1<<31-Ce(42|e)+1)-1,o&=i&~(s&~c),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,performSyncWorkOnRoot(r,o))}else o=Pr,o=getNextLanes(r,r===Mr?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(o&3)||checkIfRootIsPrerendering(r,o)||(n=!0,performSyncWorkOnRoot(r,o))}r=r.next}while(n);fi=!1}}function processRootScheduleInImmediateTask(){processRootScheduleInMicrotask()}function processRootScheduleInMicrotask(){di=ui=!1;var e=0;pi!==0&&shouldAttemptEagerTransition()&&(e=pi);for(var t=fe(),n=null,r=B;r!==null;){var i=r.next,o=scheduleTaskForRootDuringMicrotask(r,t);o===0?(r.next=null,n===null?B=i:n.next=i,i===null&&(li=n)):(n=r,(e!==0||o&3)&&(di=!0)),r=i}$r!==0&&$r!==5||flushSyncWorkAcrossRoots_impl(e,!1),pi!==0&&(pi=0)}function scheduleTaskForRootDuringMicrotask(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var s=31-Ce(o),c=1<<s,p=i[s];p===-1?((c&n)===0||(c&r)!==0)&&(i[s]=computeExpirationTime(c,t)):p<=t&&(e.expiredLanes|=c),o&=~c}if(t=Mr,n=Pr,n=getNextLanes(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Fr===2||Fr===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&le(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||checkIfRootIsPrerendering(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&le(r),lanesToEventPriority(n)){case 2:case 8:n=he;break;case 32:n=ge;break;case 268435456:n=ve;break;default:n=ge}return r=performWorkOnRootViaSchedulerTask.bind(null,e),n=ce(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&le(r),e.callbackPriority=2,e.callbackNode=null,2}function performWorkOnRootViaSchedulerTask(e,t){if($r!==0&&$r!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(flushPendingEffects()&&e.callbackNode!==n)return null;var r=Pr;return r=getNextLanes(e,e===Mr?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(performWorkOnRoot(e,r,t),scheduleTaskForRootDuringMicrotask(e,fe()),e.callbackNode!=null&&e.callbackNode===n?performWorkOnRootViaSchedulerTask.bind(null,e):null)}function performSyncWorkOnRoot(e,t){if(flushPendingEffects())return null;performWorkOnRoot(e,t,!0)}function scheduleImmediateRootScheduleTask(){Di(function(){jr&6?ce(me,processRootScheduleInImmediateTask):processRootScheduleInMicrotask()})}function requestTransitionLane(){if(pi===0){var e=Ln;e===0&&(e=Ee,Ee<<=1,!(Ee&261888)&&(Ee=256)),pi=e}return pi}function coerceFormActionProp(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:sanitizeURL(``+e)}function createFormDataWithSubmitter(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function extractEvents$1(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var o=coerceFormActionProp((i[je]||null).action),s=r.submitter;s&&(t=(t=s[je]||null)?coerceFormActionProp(t.formAction):s.getAttribute(`formAction`),t!==null&&(o=t,s=null));var c=new it(`action`,`action`,null,r,i);e.push({event:c,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(pi!==0){var e=s?createFormDataWithSubmitter(i,s):new FormData(i);startHostTransition(n,{pending:!0,data:e,method:i.method,action:o},null,e)}}else typeof o==`function`&&(c.preventDefault(),e=s?createFormDataWithSubmitter(i,s):new FormData(i),startHostTransition(n,{pending:!0,data:e,method:i.method,action:o},o,e))},currentTarget:i}]})}}for(var mi=0;mi<sn.length;mi++){var hi=sn[mi];registerSimpleEvent(hi.toLowerCase(),`on`+(hi[0].toUpperCase()+hi.slice(1)))}registerSimpleEvent(Qt,`onAnimationEnd`),registerSimpleEvent($t,`onAnimationIteration`),registerSimpleEvent(en,`onAnimationStart`),registerSimpleEvent(`dblclick`,`onDoubleClick`),registerSimpleEvent(`focu
211sin`,`onFocus`),registerSimpleEvent(`focusout`,`onBlur`),registerSimpleEvent(tn,`onTransitionRun`),registerSimpleEvent(nn,`onTransitionStart`),registerSimpleEvent(rn,`onTransitionCancel`),registerSimpleEvent(an,`onTransitionEnd`),registerDirectEvent(`onMouseEnter`,[`mouseout`,`mouseover`]),registerDirectEvent(`onMouseLeave`,[`mouseout`,`mouseover`]),registerDirectEvent(`onPointerEnter`,[`pointerout`,`pointerover`]),registerDirectEvent(`onPointerLeave`,[`pointerout`,`pointerover`]),registerTwoPhaseEvent(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),registerTwoPhaseEvent(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),registerTwoPhaseEvent(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),registerTwoPhaseEvent(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),registerTwoPhaseEvent(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),registerTwoPhaseEvent(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var gi=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),_i=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(gi));function processDispatchQueue(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var o=void 0;if(t)for(var s=r.length-1;0<=s;s--){var c=r[s],p=c.instance,m=c.currentTarget;if(c=c.listener,p!==o&&i.isPropagationStopped())break a;o=c,i.currentTarget=m;try{o(i)}catch(e){cn(e)}i.currentTarget=null,o=p}else for(s=0;s<r.length;s++){if(c=r[s],p=c.instance,m=c.currentTarget,c=c.listener,p!==o&&i.isPropagationStopped())break a;o=c,i.currentTarget=m;try{o(i)}catch(e){cn(e)}i.currentTarget=null,o=p}}}}function listenToNonDelegatedEvent(e,t){var n=t[Ne];n===void 0&&(n=t[Ne]=new Set);var r=e+`__bubble`;n.has(r)||(addTrappedEventListener(t,e,2,!1),n.add(r))}function listenToNativeEvent(e,t,n){var r=0;t&&(r|=4),addTrappedEventListener(n,e,r,t)}var vi=`_reactListening`+Math.random().toString(36).slice(2);function listenToAllSupportedEvents(e){if(!e[vi]){e[vi]=!0,Re.forEach(function(t){t!==`selectionchange`&&(_i.has(t)||listenToNativeEvent(t,!1,e),listenToNativeEvent(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[vi]||(t[vi]=!0,listenToNativeEvent(`selectionchange`,!1,t))}}function addTrappedEventListener(e,t,n,r){switch(getEventPriority(t)){case 2:var i=dispatchDiscreteEvent;break;case 8:i=dispatchContinuousEvent;break;default:i=dispatchEvent}n=i.bind(null,t,n,e),i=void 0,!Qe||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function dispatchEventForPluginEventSystem(e,t,n,r,i){var o=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var p=s.tag;if((p===3||p===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=getClosestInstanceFromNode(c),s===null)return;if(p=s.tag,p===5||p===6||p===26||p===27){r=o=s;continue a}c=c.parentNode}}r=r.return}batchedUpdates$1(function(){var r=o,i=getEventTarget(n),s=[];a:{var c=on.get(e);if(c!==void 0){var p=it,m=e;switch(e){case`keypress`:if(getEventCharCode(n)===0)break a;case`keydown`:case`keyup`:p=St;break;case`focusin`:m=`focus`,p=mt;break;case`focusout`:m=`blur`,p=mt;break;case`beforeblur`:case`afterblur`:p=mt;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:p=ft;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:p=pt;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:p=wt;break;case Qt:case $t:case en:p=ht;break;case an:p=Tt;break;case`scroll`:case`scrollend`:p=ot;break;case`wheel`:p=Et;break;case`copy`:case`cut`:case`paste`:p=_t;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:p=Ct;break;case`toggle`:case`beforetoggle`:p=Dt}var h=!!(t&4),g=!h&&(e===`scroll`||e===`scrollend`),_=h?c===null?null:c+`Capture`:c;h=[];for(var v=r,y;v!==null;){var b=v;if(y=b.stateNode,b=b.tag,b!==5&&b!==26&&b!==27||y===null||_===null||(b=getListener(v,_),b!=null&&h.push(createDispatchListener(v,b,y))),g)break;v=v.return}0<h.length&&(c=new p(c,m,null,n,i),s.push({event:c,listeners:h}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,p=e===`mouseout`||e===`pointerout`,c&&n!==qe&&(m=n.relatedTarget||n.fromElement)&&(getClosestInstanceFromNode(m)||m[Me]))break a;if((p||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=r,m=m?getClosestInstanceFromNode(m):null,m!==null&&(g=getNearestMountedFiber(m),h=m.tag,m!==g||h!==5&&h!==27&&h!==6)&&(m=null)):(p=null,m=r),p!==m)){if(h=ft,b=`onMouseLeave`,_=`onMouseEnter`,v=`mouse`,(e===`pointerout`||e===`pointerover`)&&(h=Ct,b=`onPointerLeave`,_=`onPointerEnter`,v=`pointer`),g=p==null?c:getNodeFromInstance(p),y=m==null?c:getNodeFromInstance(m),c=new h(b,v+`leave`,p,n,i),c.target=g,c.relatedTarget=y,b=null,getClosestInstanceFromNode(i)===r&&(h=new h(_,v+`enter`,m,n,i),h.target=y,h.relatedTarget=g,b=h),g=b,p&&m)b:{for(h=getParent,_=p,v=m,y=0,b=_;b;b=h(b))y++;b=0;for(var x=v;x;x=h(x))b++;for(;0<y-b;)_=h(_),y--;for(;0<b-y;)v=h(v),b--;for(;y--;){if(_===v||v!==null&&_===v.alternate){h=_;break b}_=h(_),v=h(v)}h=null}else h=null;p!==null&&accumulateEnterLeaveListenersForEvent(s,c,p,h,!1),m!==null&&g!==null&&accumulateEnterLeaveListenersForEvent(s,g,m,h,!0)}}a:{if(c=r?getNodeFromInstance(r):window,p=c.nodeName&&c.nodeName.toLowerCase(),p===`select`||p===`input`&&c.type===`file`)var S=getTargetInstForChangeEvent;else if(isTextInputElement(c)){if(zt)S=getTargetInstForInputOrChangeEvent;else{S=getTargetInstForInputEventPolyfill;var C=handleEventsForInputEventPolyfill}}else p=c.nodeName,!p||p.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&isCustomElement(r.elementType)&&(S=getTargetInstForChangeEvent):S=getTargetInstForClickEvent;if(S&&=S(e,r)){createAndAccumulateChangeEvent(s,S,n,i);break a}C&&C(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&setDefaultValue(c,`number`,c.value)}switch(C=r?getNodeFromInstance(r):window,e){case`focusin`:(isTextInputElement(C)||C.contentEditable===`true`)&&(Gt=C,Kt=r,qt=null);break;case`focusout`:qt=Kt=Gt=null;break;case`mousedown`:Jt=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Jt=!1,constructSelectEvent(s,n,i);break;case`selectionchange`:if(Wt)break;case`keydown`:case`keyup`:constructSelectEvent(s,n,i)}var w;if(kt)b:{switch(e){case`compositionstart`:var T=`onCompositionStart`;break b;case`compositionend`:T=`onCompositionEnd`;break b;case`compositionupdate`:T=`onCompositionUpdate`;break b}T=void 0}else Ft?isFallbackCompositionEnd(e,n)&&(T=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(T=`onCompositionStart`);T&&(Mt&&n.locale!==`ko`&&(Ft||T!==`onCompositionStart`?T===`onCompositionEnd`&&Ft&&(w=getData()):(et=i,tt=`value`in et?et.value:et.textContent,Ft=!0)),C=accumulateTwoPhaseListeners(r,T),0<C.length&&(T=new vt(T,e,null,n,i),s.push({event:T,listeners:C}),w?T.data=w:(w=getDataFromCustomEvent(n),w!==null&&(T.data=w)))),(w=jt?getNativeBeforeInputChars(e,n
vendor: 4,524 bytes, lines 211-212
211):getFallbackBeforeInputChars(e,n))&&(T=accumulateTwoPhaseListeners(r,`onBeforeInput`),0<T.length&&(C=new vt(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:C,listeners:T}),C.data=w)),extractEvents$1(s,e,r,n,i)}processDispatchQueue(s,t)})}function createDispatchListener(e,t,n){return{instance:e,listener:t,currentTarget:n}}function accumulateTwoPhaseListeners(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,o=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||o===null||(i=getListener(e,n),i!=null&&r.unshift(createDispatchListener(e,i,o)),i=getListener(e,t),i!=null&&r.push(createDispatchListener(e,i,o))),e.tag===3)return r;e=e.return}return[]}function getParent(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function accumulateEnterLeaveListenersForEvent(e,t,n,r,i){for(var o=t._reactName,s=[];n!==null&&n!==r;){var c=n,p=c.alternate,m=c.stateNode;if(c=c.tag,p!==null&&p===r)break;c!==5&&c!==26&&c!==27||m===null||(p=m,i?(m=getListener(n,o),m!=null&&s.unshift(createDispatchListener(n,m,p))):i||(m=getListener(n,o),m!=null&&s.push(createDispatchListener(n,m,p)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var yi=/\r\n?/g,bi=/\u0000|\uFFFD/g;function normalizeMarkupForTextOrAttribute(e){return(typeof e==`string`?e:``+e).replace(yi,`
212`).replace(bi,``)}function checkForUnmatchedText(e,t){return t=normalizeMarkupForTextOrAttribute(t),normalizeMarkupForTextOrAttribute(e)===t}function setProp(e,t,n,r,i,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||setTextContent(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&setTextContent(e,``+r);break;case`className`:setValueForKnownAttribute(e,`class`,r);break;case`tabIndex`:setValueForKnownAttribute(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:setValueForKnownAttribute(e,n,r);break;case`style`:setValueForStyles(e,r,o);break;case`data`:if(t!==`object`){setValueForKnownAttribute(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=sanitizeURL(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&setProp(e,t,`name`,i.name,i,null),setProp(e,t,`formEncType`,i.formEncType,i,null),setProp(e,t,`formMethod`,i.formMethod,i,null),setProp(e,t,`formTarget`,i.formTarget,i,null)):(setProp(e,t,`encType`,i.encType,i,null),setProp(e,t,`method`,i.method,i,null),setProp(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=sanitizeURL(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=noop$1);break;case`onScroll`:r!=null&&listenToNonDelegatedEvent(`scroll`,e);break;case`onScrollEnd`:r!=null&&listenToNonDelegatedEvent(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(formatProdErrorMessage(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(formatProdErrorMessage(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=sanitizeURL(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInl
212ine`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:listenToNonDelegatedEvent(`beforetoggle`,e),listenToNonDelegatedEvent(`toggle`,e),setValueForAttribute(e,`popover`,r);break;case`xlinkActuate`:setValueForNamespacedAttribute(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:setValueForNamespacedAttribute(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:setValueForNamespacedAttribute(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:setValueForNamespacedAttribute(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:setValueForNamespacedAttribute(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:setValueForNamespacedAttribute(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:setValueForNamespacedAttribute(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:setValueForNamespacedAttribute(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:setValueForNamespacedAttribute(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:setValueForAttribute(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Ge.get(n)||n,setValueForAttribute(e,n,r))}}function setPropOnCustomElement(e,t,n,r,i,o){switch(n){case`style`:setValueForStyles(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(formatProdErrorMessage(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(formatProdErrorMessage(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?setTextContent(e,r):(typeof r==`number`||typeof r==`bigint`)&&setTextContent(e,``+r);break;case`onScroll`:r!=null&&listenToNonDelegatedEvent(`scroll`,e);break;case`onScrollEnd`:r!=null&&listenToNonDelegatedEvent(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=noop$1);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!ze.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),o=e[je]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,i),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):setValueForAttribute(e,n,r)}}}function setInitialProperties(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:listenToNonDelegatedEvent(`error`,e),listenToNonDelegatedEvent(`load`,e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(formatProdErrorMessage(137,t));default:setProp(e,t,o,s,n,null)}}i&&setProp(e,t,`srcSet`,n.srcSet,n,null),r&&setProp(e,t,`src`,n.src,n,null);return;case`input`:listenToNonDelegatedEvent(`invalid`,e);var c=o=s=i=null,p=null,m=null;for(r in n)if(n.hasOwnProperty(r)){var h=n[r];if(h!=null)switch(r){case`name`:i=h;break;case`type`:s=h;break;case`checked`:p=h;break;case`defaultChecked`:m=h;break;case`value`:o=h;break;case`defaultValue`:c=h;break;case`children`:case`dangerouslySetInnerHTML`:if(h!=null)throw Error(formatProdErrorMessage(137,t));break;default:setProp(e,t,r,h,n,null)}}initInput(e,o,c,p,m,s,i,!1);return;case`select`:for(i in listenToNonDelegatedEvent(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:setProp(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&updateOptions(e,!!r,n,!0):updateOptions(e,!!r,t,!1);return;case`textarea`:for(s in listenToNonDelegatedEvent(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(formatProdErrorMessage(91));break;default:setProp(e,t,s,c,n,null)}initTextarea(e,r,i,o);return;case`option`:for(p in n)if(n.hasOwnProperty(p)&&(r=n[p],r!=null))switch(p){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:setProp(e,t,p,r,n,null)}return;case`dialog`:listenToNonDelegatedEvent(`beforetoggle`,e),listenToNonDelegatedEvent(`toggle`,e),listenToNonDelegatedEvent(`cancel`,e),listenToNonDelegatedEvent(`close`,e);break;case`iframe`:case`object`:listenToNonDelegatedEvent(`load`,e);break;case`video`:case`audio`:for(r=0;r<gi.length;r++)listenToNonDelegatedEvent(gi[r],e);break;case`image`:listenToNonDelegatedEvent(`error`,e),listenToNonDelegatedEvent(`load`,e);break;case`details`:listenToNonDelegatedEvent(`toggle`,e);break;case`embed`:case`source`:case`link`:listenToNonDelegatedEvent(`error`,e),listenToNonDelegatedEvent(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(m in n)if(n.hasOwnProperty(m)&&(r=n[m],r!=null))switch(m){case`children`:case`dangerouslySetInnerHTML`:throw Error(formatProdErrorMessage(137,t));default:setProp(e,t,m,r,n,null)}return;default:if(isCustomElement(t)){for(h in n)n.hasOwnProperty(h)&&(r=n[h],r!==void 0&&setPropOnCustomElement(e,t,h,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&setProp(e,t,c,r,n,null))}function updateProperties(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,o=null,s=null,c=null,p=null,m=null,h=null;for(v in n){var g=n[v];if(n.hasOwnProperty(v)&&g!=null)switch(v){case`checked`:break;case`value`:break;case`defaultValue`:p=g;default:r.hasOwnProperty(v)||setProp(e,t,v,null,r,g)}}for(var _ in r){var v=r[_];if(g=n[_],r.hasOwnProperty(_)&&(v!=null||g!=null))switch(_){case`type`:o=v;break;case`name`:i=v;break;case`checked`:m=v;break;case`defaultChecked`:h=v;break;case`value`:s=v;break;case`defaultValue`:c=v;break;case`children`:case`dangerouslySetInnerHTML`:if(v!=null)throw Error(formatProdErrorMessage(137,t));break;default:v!==g&&setProp(e,t,_,v,r,g)}}updateInput(e,s,c,p,m,h,o,i);return;case`select`:for(o in v=s=c=_=null,n)if(p=n[o],n.hasOwnProperty(o)&&p!=null)switch(o){case`value`:break;case`multiple`:v=p;default:r.hasOwnProperty(o)||setProp(e,t,o,null,r,p)}
vendor: 30,676 bytes, line 212
212for(i in r)if(o=r[i],p=n[i],r.hasOwnProperty(i)&&(o!=null||p!=null))switch(i){case`value`:_=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==p&&setProp(e,t,i,o,r,p)}t=c,n=s,r=v,_==null?!!r!=!!n&&(t==null?updateOptions(e,!!n,n?[]:``,!1):updateOptions(e,!!n,t,!0)):updateOptions(e,!!n,_,!1);return;case`textarea`:for(c in v=_=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:setProp(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:_=i;break;case`defaultValue`:v=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(formatProdErrorMessage(91));break;default:i!==o&&setProp(e,t,s,i,r,o)}updateTextarea(e,_,v);return;case`option`:for(var y in n)if(_=n[y],n.hasOwnProperty(y)&&_!=null&&!r.hasOwnProperty(y))switch(y){case`selected`:e.selected=!1;break;default:setProp(e,t,y,null,r,_)}for(p in r)if(_=r[p],v=n[p],r.hasOwnProperty(p)&&_!==v&&(_!=null||v!=null))switch(p){case`selected`:e.selected=_&&typeof _!=`function`&&typeof _!=`symbol`;break;default:setProp(e,t,p,_,r,v)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var b in n)_=n[b],n.hasOwnProperty(b)&&_!=null&&!r.hasOwnProperty(b)&&setProp(e,t,b,null,r,_);for(m in r)if(_=r[m],v=n[m],r.hasOwnProperty(m)&&_!==v&&(_!=null||v!=null))switch(m){case`children`:case`dangerouslySetInnerHTML`:if(_!=null)throw Error(formatProdErrorMessage(137,t));break;default:setProp(e,t,m,_,r,v)}return;default:if(isCustomElement(t)){for(var x in n)_=n[x],n.hasOwnProperty(x)&&_!==void 0&&!r.hasOwnProperty(x)&&setPropOnCustomElement(e,t,x,void 0,r,_);for(h in r)_=r[h],v=n[h],!r.hasOwnProperty(h)||_===v||_===void 0&&v===void 0||setPropOnCustomElement(e,t,h,_,r,v);return}}for(var S in n)_=n[S],n.hasOwnProperty(S)&&_!=null&&!r.hasOwnProperty(S)&&setProp(e,t,S,null,r,_);for(g in r)_=r[g],v=n[g],!r.hasOwnProperty(g)||_===v||_==null&&v==null||setProp(e,t,g,_,r,v)}function isLikelyStaticResource(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function estimateBandwidth(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],o=i.transferSize,s=i.initiatorType,c=i.duration;if(o&&c&&isLikelyStaticResource(s)){for(s=0,c=i.responseEnd,r+=1;r<n.length;r++){var p=n[r],m=p.startTime;if(m>c)break;var h=p.transferSize,g=p.initiatorType;h&&isLikelyStaticResource(g)&&(p=p.responseEnd,s+=h*(p<c?1:(c-m)/(p-m)))}if(--r,t+=8*(o+s)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var xi=null,Si=null;function getOwnerDocumentFromRootContainer(e){return e.nodeType===9?e:e.ownerDocument}function getOwnHostContext(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function getChildHostContextProd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function shouldSetTextContent(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ci=null;function shouldAttemptEagerTransition(){var e=window.event;return e&&e.type===`popstate`?e!==Ci&&(Ci=e,!0):(Ci=null,!1)}var wi=typeof setTimeout==`function`?setTimeout:void 0,Ti=typeof clearTimeout==`function`?clearTimeout:void 0,Ei=typeof Promise==`function`?Promise:void 0,Di=typeof queueMicrotask==`function`?queueMicrotask:Ei===void 0?wi:function(e){return Ei.resolve(null).then(e).catch(handleErrorInNextTick)};function handleErrorInNextTick(e){setTimeout(function(){throw e})}function isSingletonScope(e){return e===`head`}function clearHydrationBoundary(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),retryIfBlockedOn(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)releaseSingletonInstance(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,releaseSingletonInstance(n);for(var o=n.firstChild;o;){var s=o.nextSibling,c=o.nodeName;o[Le]||c===`SCRIPT`||c===`STYLE`||c===`LINK`&&o.rel.toLowerCase()===`stylesheet`||n.removeChild(o),o=s}}else n===`body`&&releaseSingletonInstance(e.ownerDocument.body)}n=i}while(n);retryIfBlockedOn(t)}function hideOrUnhideDehydratedBoundary(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function clearContainerSparingly(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:clearContainerSparingly(n),detachDeletedInstance(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function canHydrateInstance(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var o=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===o)return e}else return e}else if(!e[Le])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(o=e.getAttribute(`rel`),o===`stylesheet`&&e.hasAttribute(`data-precedence`)||o!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(o=e.getAttribute(`src`),(o!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&o&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=getNextHydratable(e.nextSibling),e===null)break}return null}function canHydrateTextInstance(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=getNextHydratable(e.nextSibling),e===null))return null;return e}function canHydrateHydrationBoundary(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=getNextHydratable(e.nextSibling),e===null))return null;return e}function isSuspenseInstancePending(e){return e.data===`$?`||e.data===`$~`}function isSuspenseInstanceFallback(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function registerSuspenseInstanceRetry(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var listener=function(){t(),n.removeEventListener(`DOMContentLoaded`,listener)};n.addEventListener(`DOMContentLoaded`,listener),e._reactRetry=listener}}function getNextHydratable(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var Oi=null;function getNextHydratableInstanceAfterHydrationBoundary(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return getNextHydratable(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function getParentHydrationBoundary(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function resolveSingletonInstance(e,t,n){switch(t=getOwnerDocumentFromRootContainer(n),e){case`html`:if(e=t.documentElement,!e)throw Error(formatProdErrorMessage(452));return e;case`head`:if(e=t.head,!e)throw Error(formatProdErrorMessage(453));return e;case`body`:if(e=t.body,!e)throw Error(formatProdErrorMessage(454));return e;default:throw Error(formatProdErrorMessage(451))}}function releaseSingletonInstance(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);detachDeletedInstance(e)}var ki=new Map,Ai=new Set;function getHoistableRoot(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ji=k.d;k.d={f:flushSyncWork,r:requestFormReset,D:prefetchDNS,C:preconnect,L:preload,m:preloadModule,X:preinitScript,S:preinitStyle,M:preinitModuleScript};function flushSyncWork(){var e=ji.f(),t=flushSyncWork$1();return e||t}function requestFormReset(e){var t=getInstanceFromNode(e);t!==null&&t.tag===5&&t.type===`form`?requestFormReset$1(t):ji.r(e)}var Mi=typeof document>`u`?null:document;function preconnectAs(e,t,n){var r=Mi;if(r&&typeof t==`string`&&t){var i=escapeSelectorAttributeValueInsideDoubleQuotes(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Ai.has(i)||(Ai.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),setInitialProperties(t,`link`,e),markNodeAsHoistable(t),r.head.appendChild(t)))}}function prefetchDNS(e){ji.D(e),preconnectAs(`dns-prefetch`,e,null)}function preconnect(e,t){ji.C(e,t),preconnectAs(`preconnect`,e,t)}function preload(e,t,n){ji.L(e,t,n);var r=Mi;if(r&&e&&t){var o=`link[rel="preload"][as="`+escapeSelectorAttributeValueInsideDoubleQuotes(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(o+=`[imagesrcset="`+escapeSelectorAttributeValueInsideDoubleQuotes(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(o+=`[imagesizes="`+escapeSelectorAttributeValueInsideDoubleQuotes(n.imageSizes)+`"]`)):o+=`[href="`+escapeSelectorAttributeValueInsideDoubleQuotes(e)+`"]`;var s=o;switch(t){case`style`:s=getStyleKey(e);break;case`script`:s=getScriptKey(e)}ki.has(s)||(e=i({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),ki.set(s,e),r.querySelector(o)!==null||t===`style`&&r.querySelector(getStylesheetSelectorFromKey(s))||t===`script`&&r.querySelector(getScriptSelectorFromKey(s))||(t=r.createElement(`link`),setInitialProperties(t,`link`,e),markNodeAsHoistable(t),r.head.appendChild(t)))}}function preloadModule(e,t){ji.m(e,t);var n=Mi;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,o=`link[rel="modulepreload"][as="`+escapeSelectorAttributeValueInsideDoubleQuotes(r)+`"][href="`+escapeSelectorAttributeValueInsideDoubleQuotes(e)+`"]`,s=o;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:s=getScriptKey(e)}if(!ki.has(s)&&(e=i({rel:`modulepreload`,href:e},t),ki.set(s,e),n.querySelector(o)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(getScriptSelectorFromKey(s)))return}r=n.createElement(`link`),setInitialProperties(r,`link`,e),markNodeAsHoistable(r),n.head.appendChild(r)}}}function preinitStyle(e,t,n){ji.S(e,t,n);var r=Mi;if(r&&e){var o=getResourcesFromRoot(r).hoistableStyles,s=getStyleKey(e);t||=`default`;var c=o.get(s);if(!c){var p={loading:0,preload:null};if(c=r.querySelector(getStylesheetSelectorFromKey(s)))p.loading=5;else{e=i({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=ki.get(s))&&adoptPreloadPropsForStylesheet(e,n);var m=c=r.createElement(`link`);markNodeAsHoistable(m),setInitialProperties(m,`link`,e),m._p=new Promise(function(e,t){m.onload=e,m.onerror=t}),m.addEventListener(`load`,function(){p.loading|=1}),m.addEventListener(`error`,function(){p.loading|=2}),p.loading|=4,insertStylesheet(c,t,r)}c={type:`stylesheet`,instance:c,count:1,state:p},o.set(s,c)}}}function preinitScript(e,t){ji.X(e,t);var n=Mi;if(n&&e){var r=getResourcesFromRoot(n).hoistableScripts,o=getScriptKey(e),s=r.get(o);s||(s=n.querySelector(getScriptSelectorFromKey(o)),s||(e=i({src:e,async:!0},t),(t=ki.get(o))&&adoptPreloadPropsForScript(e,t),s=n.createElement(`script`),markNodeAsHoistable(s),setInitialProperties(s,`link`,e),n.head.appendChild(s)),s={type:`script`,instance:s,count:1,state:null},r.set(o,s))}}function preinitModuleScript(e,t){ji.M(e,t);var n=Mi;if(n&&e){var r=getResourcesFromRoot(n).hoistableScripts,o=getScriptKey(e),s=r.get(o);s||(s=n.querySelector(getScriptSelectorFromKey(o)),s||(e=i({src:e,async:!0,type:`module`},t),(t=ki.get(o))&&adoptPreloadPropsForScript(e,t),s=n.createElement(`script`),markNodeAsHoistable(s),setInitialProperties(s,`link`,e),n.head.appendChild(s)),s={type:`script`,instance:s,count:1,state:null},r.set(o,s))}}function getResource(e,t,n,r){var i=(i=M.current)?getHoistableRoot(i):null;if(!i)throw Error(formatProdErrorMessage(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=getStyleKey(n.href),n=getResourcesFromRoot(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=getStyleKey(n.href);var o=getResourcesFromRoot(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(getStylesheetSelectorFromKey(e)))&&!o._p&&(s.instance=o,s.state.loading=5),ki.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ki.set(e,n),o||preloadStylesheet(i,e,n,s.state))),t&&r===null)throw Error(formatProdErrorMessage(528,``));return s}if(t&&r!==null)throw Error(formatProdErrorMessage(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=getScriptKey(n),n=getResourcesFromRoot(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(formatProdErrorMessage(444,e))}}function getStyleKey(e){return`href="`+escapeSelectorAttributeValueInsideDoubleQuotes(e)+`"`}function getStylesheetSelectorFromKey(e){return`link[rel="stylesheet"][`+e+`]`}function stylesheetPropsFromRawProps(e){return i({},e,{"data-precedence":e.precedence,precedence:null})}function preloadStylesheet(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),setInitialProperties(t,`link`,n),markNodeAsHoistable(t),e.head.appendChild(t))}function getScriptKey(e){return`[src="`+escapeSelectorAttributeValueInsideDoubleQuotes(e)+`"]`}function getScriptSelectorFromKey(e){return`script[async]`+e}function acquireResource(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+escapeSelectorAttributeValueInsideDoubleQuotes(n.href)+`"]`);if(r)return t.instance=r,markNodeAsHoistable(r),r;var o=i({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),markNodeAsHoistable(r),setInitialProperties(r,`style`,o),insertStylesheet(r,n.precedence,e),t.instance=r;case`stylesheet`:o=getStyleKey(n.href);var s=e.querySelector(getStylesheetSelectorFromKey(o));if(s)return t.state.loading|=4,t.instance=s,markNodeAsHoistable(s),s;r=stylesheetPropsFromRawProps(n),(o=ki.get(o))&&adoptPreloadPropsForStylesheet(r,o),s=(e.ownerDocument||e).createElement(`link`),markNodeAsHoistable(s);var c=s;return c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),setInitialProperties(s,`link`,r),t.state.loading|=4,insertStylesheet(s,n.precedence,e),t.instance=s;case`script`:return s=getScriptKey(n.src),(o=e.querySelector(getScriptSelectorFromKey(s)))?(t.instance=o,markNodeAsHoistable(o),o):(r=n,(o=ki.get(s))&&(r=i({},n),adoptPreloadPropsForScript(r,o)),e=e.ownerDocument||e,o=e.createElement(`script`),markNodeAsHoistable(o),setInitialProperties(o,`link`,r),e.head.appendChild(o),t.instance=o);case`void`:return null;default:throw Error(formatProdErrorMessage(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,insertStylesheet(r,n.precedence,e));return t.instance}function insertStylesheet(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,o=i,s=0;s<r.length;s++){var c=r[s];if(c.dataset.precedence===t)o=c;else if(o!==i)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function adoptPreloadPropsForStylesheet(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function adoptPreloadPropsForScript(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Ni=null;function getHydratableHoistableCache(e,t,n){if(Ni===null){var r=new Map,i=Ni=new Map;i.set(n,r)}else i=Ni,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var o=n[i];if(!(o[Le]||o[Ae]||e===`link`&&o.getAttribute(`rel`)===`stylesheet`)&&o.namespaceURI!==`http://www.w3.org/2000/svg`){var s=o.getAttribute(t)||``;s=e+s;var c=r.get(s);c?c.push(o):r.set(s,[o])}}return r}function mountHoistable(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function isHostHoistableType(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function preloadResource(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function suspendResource(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=getStyleKey(r.href),o=t.querySelector(getStylesheetSelectorFromKey(i));if(o){t=o._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=onUnsuspend.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,markNodeAsHoistable(o);return}o=t.ownerDocument||t,r=stylesheetPropsFromRawProps(r),(i=ki.get(i))&&adoptPreloadPropsForStylesheet(r,i),o=o.createElement(`link`),markNodeAsHoistable(o);var s=o;s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),setInitialProperties(o,`link`,r),n.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=onUnsuspend.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Pi=0;function waitForCommitToBeReady(e,t){return e.stylesheets&&e.count===0&&insertSuspendedStylesheets(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&insertSuspendedStylesheets(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Pi===0&&(Pi=62500*estimateBandwidth());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&insertSuspendedStylesheets(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Pi?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function onUnsuspend(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)insertSuspendedStylesheets(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Fi=null;function insertSuspendedStylesheets(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Fi=new Map,t.forEach(insertStylesheetIntoRoot,e),Fi=null,onUnsuspend.call(e))}function insertStylesheetIntoRoot(e,t){if(!(t.state.loading&4)){var n=Fi.get(e);if(n)var r=n.get(null);else{n=new Map,Fi.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),o=0;o<i.length;o++){var s=i[o];(s.nodeName===`LINK`||s.getAttribute(`media`)!==`not all`)&&(n.set(s.dataset.precedence,s),r=s)}r&&n.set(null,r)}i=t.instance,s=i.getAttribute(`data-precedence`),o=n.get(s)||r,o===r&&n.set(null,i),n.set(s,i),this.count++,r=onUnsuspend.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),o?o.parentNode.insertBefore(i,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Ii={$$typeof:_,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function FiberRootNode(e,t,n,r,i,o,s,c,p){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=createLaneMap(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=createLaneMap(0),this.hiddenUpdates=createLaneMap(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=o,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=p,this.incompleteTransitions=new Map}function createFiberRoot(e,t,n,r,i,o,s,c,p,m,h,g){return e=new FiberRootNode(e,t,n,s,p,m,h,g,c),t=1,!0===o&&(t|=24),o=createFiberImplClass(3,null,null,t),e.current=o,o.stateNode=e,t=createCache(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:r,isDehydrated:n,cache:t},initializeUpdateQueue(o),e}function getContextForSubtree(e){return e?(e=fn,e):fn}function updateContainerImpl(e,t,n,r,i,o){i=getContextForSubtree(i),r.context===null?r.context=i:r.pendingContext=i,r=createUpdate(t),r.payload={element:n},o=o===void 0?null:o,o!==null&&(r.callback=o),n=enqueueUpdate(e,r,t),n!==null&&(scheduleUpdateOnFiber(n,e,t),entangleTransitions(n,e,t))}function markRetryLaneImpl(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function markRetryLaneIfNotHydrated(e,t){markRetryLaneImpl(e,t),(e=e.alternate)&&markRetryLaneImpl(e,t)}function attemptContinuousHydration(e){if(e.tag===13||e.tag===31){var t=enqueueConcurrentRenderForLane(e,67108864);t!==null&&scheduleUpdateOnFiber(t,e,67108864),markRetryLaneIfNotHydrated(e,67108864)}}function attemptHydrationAtCurrentPriority(e){if(e.tag===13||e.tag===31){var t=requestUpdateLane();t=getBumpedLaneForHydrationByLane(t);var n=enqueueConcurrentRenderForLane(e,t);n!==null&&scheduleUpdateOnFiber(n,e,t),markRetryLaneIfNotHydrated(e,t)}}var Li=!0;function dispatchDiscreteEvent(e,t,n,r){var i=O.T;O.T=null;var o=k.p;try{k.p=2,dispatchEvent(e,t,n,r)}finally{k.p=o,O.T=i}}function dispatchContinuousEvent(e,t,n,r){var i=O.T;O.T=null;var o=k.p;try{k.p=8,dispatchEvent(e,t,n,r)}finally{k.p=o,O.T=i}}function dispatchEvent(e,t,n,r){if(Li){var i=findInstanceBlockingEvent(r);if(i===null)dispatchEventForPluginEventSystem(e,t,r,Ri,n),clearIfContinuousEvent(e,r);else if(queueIfContinuousEvent(i,e,t,n,r))r.stopPropagation();else if(clearIfContinuousEvent(e,r),t&4&&-1<Gi.indexOf(e)){for(;i!==null;){var o=getInstanceFromNode(i);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var s=getHighestPriorityLanes(o.pendingLanes);if(s!==0){var c=o;for(c.pendingLanes|=2,c.entangledLanes|=2;s;){var p=1<<31-Ce(s);c.entanglements[1]|=p,s&=~p}ensureRootIsScheduled(o),!(jr&6)&&(Xr=fe()+500,flushSyncWorkAcrossRoots_impl(0,!1))}}break;case 31:case 13:c=enqueueConcurrentRenderForLane(o,2),c!==null&&scheduleUpdateOnFiber(c,o,2),flushSyncWork$1(),markRetryLaneIfNotHydrated(o,2)}if(o=findInstanceBlockingEvent(r),o===null&&dispatchEventForPluginEventSystem(e,t,r,Ri,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else dispatchEventForPluginEventSystem(e,t,r,null,n)}}function findInstanceBlockingEvent(e){return e=getEventTarget(e),findInstanceBlockingTarget(e)}var Ri=null;function findInstanceBlockingTarget(e){if(Ri=null,e=getClosestInstanceFromNode(e),e!==null){var t=getNearestMountedFiber(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=getSuspenseInstanceFromFiber(t),e!==null)return e;e=null}else if(n===31){if(e=getActivityInstanceFromFiber(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ri=e,null}function getEventPriority(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(pe()){case me:return 2;case he:return 8;case ge:case _e:return 32;case ve:return 268435456;default:return 32}default:return 32}}var zi=!1,Bi=null,Vi=null,Hi=null,Ui=new Map,V=new Map,Wi=[],Gi=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function clearIfContinuousEvent(e,t){switch(e){case`focusin`:case`focusout`:Bi=null;break;case`dragenter`:case`dragleave`:Vi=null;break;case`mouseover`:case`mouseout`:Hi=null;break;case`pointerover`:case`pointerout`:Ui.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:V.delete(t.pointerId)}}function accumulateOrCreateContinuousQueuedReplayableEvent(e,t,n,r,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},t!==null&&(t=getInstanceFromNode(t),t!==null&&attemptContinuousHydration(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function queueIfContinuousEvent(e,t,n,r,i){switch(t){case`focusin`:return Bi=accumulateOrCreateContinuousQueuedReplayableEvent(Bi,e,t,n,r,i),!0;case`dragenter`:return Vi=accumulateOrCreateContinuousQueuedReplayableEvent(Vi,e,t,n,r,i),!0;case`mouseover`:return Hi=accumulateOrCreateContinuousQueuedReplayableEvent(Hi,e,t,n,r,i),!0;case`pointerover`:var o=i.pointerId;return Ui.set(o,accumulateOrCreateContinuousQueuedReplayableEvent(Ui.get(o)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return o=i.pointerId,V.set(o,accumulateOrCreateContinuousQueuedReplayableEvent(V.get(o)||null,e,t,n,r,i)),!0}return!1}function attemptExplicitHydrationTarget(e){var t=getClosestInstanceFromNode(e.target);if(t!==null){var n=getNearestMountedFiber(t);if(n!==null){if(t=n.tag,t===13){if(t=getSuspenseInstanceFromFiber(n),t!==null){e.blockedOn=t,runWithPriority(e.priority,function(){attemptHydrationAtCurrentPriority(n)});return}}else if(t===31){if(t=getActivityInstanceFromFiber(n),t!==null){e.blockedOn=t,runWithPriority(e.priority,function(){attemptHydrationAtCurrentPriority(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function attemptReplayContinuousQueuedEvent(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=findInstanceBlockingEvent(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);qe=r,n.target.dispatchEvent(r),qe=null}else return t=getInstanceFromNode(n),t!==null&&attemptContinuousHydration(t),e.blockedOn=n,!1;t.shift()}return!0}function attemptReplayContinuousQueuedEventInMap(e,t,n){attemptReplayContinuousQueuedEvent(e)&&n.delete(t)}function replayUnblockedEvents(){zi=!1,Bi!==null&&attemptReplayContinuousQueuedEvent(Bi)&&(Bi=null),Vi!==null&&attemptReplayContinuousQueuedEvent(Vi)&&(Vi=null),Hi!==null&&attemptReplayContinuousQueuedEvent(Hi)&&(Hi=null),Ui.forEach(attemptReplayContinuousQueuedEventInMap),V.forEach(attemptReplayContinuousQueuedEventInMap)}function scheduleCallbackIfUnblocked(e,n){e.blockedOn===n&&(e.blockedOn=null,zi||(zi=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,replayUnblockedEvents)))}var Ki=null;function scheduleReplayQueueIfNeeded(e){Ki!==e&&(Ki=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Ki===e&&(Ki=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(findInstanceBlockingTarget(r||n)===null)continue;break}var o=getInstanceFromNode(n);o!==null&&(e.splice(t,3),t-=3,startHostTransition(o,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function retryIfBlockedOn(e){function unblock(t){return scheduleCallbackIfUnblocked(t,e)}Bi!==null&&scheduleCallbackIfUnblocked(Bi,e),Vi!==null&&scheduleCallbackIfUnblocked(Vi,e),Hi!==null&&scheduleCallbackIfUnblocked(Hi,e),Ui.forEach(unblock),V.forEac
212h(unblock);for(var t=0;t<Wi.length;t++){var n=Wi[t];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Wi.length&&(t=Wi[0],t.blockedOn===null);)attemptExplicitHydrationTarget(t),t.blockedOn===null&&Wi.shift();if(t=(e.ownerDocument||e).$$reactFormReplay,t!=null)for(n=0;n<t.length;n+=3){var r=t[n],i=t[n+1],o=r[je]||null;if(typeof i==`function`)o||scheduleReplayQueueIfNeeded(t);else if(o){var s=null;if(i&&i.hasAttribute(`formAction`)){if(r=i,o=i[je]||null)s=o.formAction;else if(findInstanceBlockingTarget(r)!==null)continue}else s=o.action;typeof s==`function`?t[n+1]=s:(t.splice(n,3),n-=3),scheduleReplayQueueIfNeeded(t)}}}function defaultOnDefaultTransitionIndicator(){function handleNavigate(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return t=e})},focusReset:`manual`,scroll:`manual`})}function handleNavigateComplete(){t!==null&&(t(),t=null),e||setTimeout(startFakeNavigation,20)}function startFakeNavigation(){if(!e&&!navigation.transition){var t=navigation.currentEntry;t&&t.url!=null&&navigation.navigate(t.url,{state:t.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var e=!1,t=null;return navigation.addEventListener(`navigate`,handleNavigate),navigation.addEventListener(`navigatesuccess`,handleNavigateComplete),navigation.addEventListener(`navigateerror`,handleNavigateComplete),setTimeout(startFakeNavigation,100),function(){e=!0,navigation.removeEventListener(`navigate`,handleNavigate),navigation.removeEventListener(`navigatesuccess`,handleNavigateComplete),navigation.removeEventListener(`navigateerror`,handleNavigateComplete),t!==null&&(t(),t=null)}}}function ReactDOMRoot(e){this._internalRoot=e}ReactDOMHydrationRoot.prototype.render=ReactDOMRoot.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(formatProdErrorMessage(409));var n=t.current;updateContainerImpl(n,requestUpdateLane(),e,t,null,null)},ReactDOMHydrationRoot.prototype.unmount=ReactDOMRoot.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;updateContainerImpl(e.current,2,null,e,null,null),flushSyncWork$1(),t[Me]=null}};function ReactDOMHydrationRoot(e){this._internalRoot=e}ReactDOMHydrationRoot.prototype.unstable_scheduleHydration=function(e){if(e){var t=resolveUpdatePriority();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Wi.length&&t!==0&&t<Wi[n].priority;n++);Wi.splice(n,0,e),n===0&&attemptExplicitHydrationTarget(e)}};var qi=n.version;if(qi!==`19.2.4`)throw Error(formatProdErrorMessage(527,qi,`19.2.4`));k.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(formatProdErrorMessage(188)):(e=Object.keys(e).join(`,`),Error(formatProdErrorMessage(268,e)));return e=findCurrentFiberUsingSlowPath(t),e=e===null?null:findCurrentHostFiberImpl(e),e=e===null?null:e.stateNode,e};var Ji={bundleType:0,version:`19.2.4`,rendererPackageName:`react-dom`,currentDispatcherRef:O,reconcilerVersion:`19.2.4`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Yi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yi.isDisabled&&Yi.supportsFiber)try{xe=Yi.inject(Ji),Se=Yi}catch{}}e.createRoot=function(e,t){if(!isValidContainer(e))throw Error(formatProdErrorMessage(299));var n=!1,r=``,i=defaultOnUncaughtError,o=defaultOnCaughtError,s=defaultOnRecoverableError;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=createFiberRoot(e,1,!1,null,null,n,r,null,i,o,s,defaultOnDefaultTransitionIndicator),e[Me]=t.current,listenToAllSupportedEvents(e),new ReactDOMRoot(t)}})),zS=r(((e,t)=>{function checkDCE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(e){console.error(e)}}checkDCE(),t.exports=RS()})),AbstractSessionsManager=class{getLatestSessionData(){return null}getSessionDataByName(e){return null}getSessionIdsToInvalidate(){return[]}removeExpiredSessionsData(){}setOktaAuthData(e){}getOktaAuthData(){return null}removeOktaAuthData(){}};function safeJsonParse(e){return JSON.parse(e,(e,t,n)=>Number.isInteger(t)&&!Number.isSafeInteger(t)?n?.source??t:t)}var BS=n(bi()),VS=n(Dr());BS.default.extend(VS.default);var HS=10,US=15e3,WS=15e3,GS=1e3,KS=1e4,qS=1e4,Connection=class{ws=null;connected=new du;timer=new Pe;messageId=1;wsDeferreds={};lastWsMessageTime=0;callbacks={};errorLogs=[];reconnectAttempts=0;suppressReconnect=!1;details={wsEndpoint:``,restEndpoint:``,type:`public`,name:``};logger;loggerName=`Connection`;requestQueue=[];firstDisconnection=!0;usingFallback=!1;fallbackAttempted=!1;keepAliveConfig;
212getConnectionDetails=async()=>this.details;constructor(e){this.wsOnOpen=this.wsOnOpen.bind(this),this.wsOnClose=this.wsOnClose.bind(this),this.wsOnMessage=this.wsOnMessage.bind(this),this.logger=e}log(e){this.logger&&this.logger(new Date,`[${this.loggerName}][${this.details.wsEndpoint?this.details.type:`unknown`}] ${e}`)}init({callbacks:e,getConnectionDetails:t,keepAlive:n}){this.getConnectionDetails=t,this.callbacks=e,this.keepAliveConfig=n}getWsState(){return this.ws?.readyState}getWsName(){return this.details.name}getWsEndpoint(){return this.details.wsEndpoint}getWsFallbackEndpoint(){return this.details.wsFallbackEndpoint}getType(){return this.details.type}getParams(){return this.details}getErrorLogs(){return[...this.errorLogs]}logError(e){this.errorLogs=[e,...this.errorLogs.slice(0,100)]}getNextMessageId(){return this.messageId+=1,this.messageId}wsOnOpen(){this.log(`wsOnOpen()`),this.setKeepAlive(this.keepAliveConfig?.heartbeatIntervalSeconds,this.keepAliveConfig?.reconnectSilentApiMs),this.connected.resolve(!0),this.callbacks.onConnect?.({details:this.details})}wsOnClose(e){if(this.log(`wsOnClose()`),e.code===1006){if(!this.usingFallback&&!this.fallbackAttempted&&this.details.wsFallbackEndpoint&&this.details.wsFallbackEndpoint!==this.details.wsEndpoint){this.log(`Switching to fallback endpoint`),this.usingFallback=!0,this.fallbackAttempted=!0,this.onDisconnect(e.reason,!0);return}this.usingFallback&&=(this.log(`Reverting to primary endpoint`),!1)}this.connected.isFulfilled()||this.connected.reject(`Connection has been closed due to - code: ${e.code}, it ${e.wasClean?`was`:`was not`} clean close`),this.onDisconnect(e.reason)}wsOnMessage(e){let t=safeJsonParse(e.data);if(this.lastWsMessageTime=Date.now(),`id`in t){let{deferred:e,message:n,options:r}=this.wsDeferreds[t.id];e&&(t.error?(e.reject(t.error),this.callbacks.onRequestError?.({details:this.details,response:t,message:n,options:r})):e.resolve(t.result),delete this.wsDeferreds[t.id])}else switch(t.method){case`heartbeat`:this.handleHeartbeatMessage(t);break;case`subscription`:this.callbacks.onSubscriptionData?.(this.details,t.params);break;case`subscriptions`:t.params.events.forEach(([e,t])=>{this.callbacks.onSubscriptionData?.(this.details,{channel:e,data:t})})}}reconnect(){if(this.log(`reconnect() ${this.reconnectAttempts}`),this.suppressReconnect)return;let e=Math.min(this.reconnectAttempts*2e3,1e4);this.timer.set(`reconnect-${this.details.type}`,`timeout`,async()=>{this.reconnectAttempts+=1;try{await this.doConnect(),this.reconnectAttempts=0}catch{}},e)}onDisconnect(e,t=!1){this.log(`onDisconnect()`),this.timer.clearAll(),this.ws&&=(this.removeWsHandlers(this.ws),this.rejectDeferreds(e),this.ws.readyState===WebSocket.OPEN&&this.ws.close(),null),(this.connected.isFulfilled()||this.firstDisconnection&&!t)&&(this.firstDisconnection=!1,this.callbacks.onDisconnect?.(this.details,e)),e!==`over_limit`&&this.reconnect()}async updateConnectionDetails(){try{this.details=await this.getConnectionDetails()}catch(e){console.log(`updateDetails error`,e)}}connect(){return this.log(`connect()`),this.doConnect()}async doConnect(){this.log(`doConnect()`),this.connected=new du,await this.updateConnectionDetails();let e=this.usingFallback&&this.details.wsFallbackEndpoint?this.details.wsFallbackEndpoint:this.details.wsEndpoint;return this.ws=new WebSocket(e),this.ws.onopen=()=>this.wsOnOpen(),this.ws.onmessage=e=>this.wsOnMessage(e),this.ws.onclose=e=>this.wsOnClose(e),this.ws.onerror=e=>{this.log(`ws.onerror()`),console.log(`websocket error`,e)},this.timer.set(`connecting-timeout`,`timeout`,()=>{this.connected.isFulfilled()||(this.log(`connecting-timeout`),this.disconnect(),this.connected.reject(`Connection timeout`))},KS),this.connected.promise}disconnect(){this.log(`disconnect()`);try{this.onDisconnect(`disconnect() called`)}catch(e){console.log(e,`disconnect - ws close error`)}}clean(){this.suppressReconnect=!0,this.disconnect(),this.wsDeferreds={}}removeWsHandlers(e){e.onopen=()=>{},e.onmessage=()=>{},e.onerror=()=>{},e.onclose=()=>{}}
212rejectDeferreds(e){Object.values(this.wsDeferreds).forEach(({deferred:t})=>{t.reject(e)}),this.wsDeferreds={}}addRequestToQueue(e){this.requestQueue.push({message:e,timestamp:Date.now()})}sendWaitingRequests(){for(;this.requestQueue.length>0;){let e=this.requestQueue.shift();if(e){let{message:t,timestamp:n}=e,r=this.wsDeferreds[t.id]?.deferred;r&&(Date.now()-n<qS?this.wsSend(e?.message):(r.reject(`waitingRequest timeout - method ${t.method}`),delete this.wsDeferreds[t.id]))}}}async initiateOAuth(e){let t=await this.sendMessage(`public/get_oauth_redirect_url`,e);return{provider:e.provider,...t}}async sendMessage(e,t={},n){let r=this.getNextMessageId(),i={jsonrpc:`2.0`,id:r,method:e,params:t},o=new du;this.wsDeferreds[i.id]={message:i,deferred:o,options:n};let s=o.promise,c=n?.timeout||WS;if(c){this.timer.set(`request_${r}`,`timeout`,()=>{o.isFulfilled()||o.reject(`WebSocket API response timeout: ${r}`)},c);let e=(0,BS.default)().utc(),t={wsDetails:this.details,request:i,requestOptions:n,requestTimestamp:e.unix(),requestTime:e.format(`HH:mm:ss.SSS  DD-MM-YYYY`)};o.promise.catch(e=>{t.response=e;let n=(0,BS.default)().utc();t.responseTimestamp=n.unix(),t.responseTime=n.format(`HH:mm:ss.SSS  DD-MM-YYYY`),this.logError(t)}).finally(()=>{this.timer.clear(`request_${r}`)})}let p=n?.postponeSending||this.ws?.readyState!==WebSocket.OPEN;try{p?this.addRequestToQueue(i):this.wsSend(i,n)}catch(e){delete this.wsDeferreds[i.id],o.reject(e)}return s}wsSend(e,t){this.ws?.send(JSON.stringify(e))}async setKeepAlive(e=HS,t=US){try{await this.sendMessage(`public/set_heartbeat`,{interval:e})}catch(e){console.log(e,`set heartbeat error`)}this.timer.set(`keep-alive`,`interval`,()=>{this.lastWsMessageTime&&this.lastWsMessageTime+t<Date.now()&&(console.log(`keep alive timeout, connection: ${this.details.name||``} of type: ${this.details.type}`),this.log(`keep alive timeout`),this.disconnect())},GS)}async handleHeartbeatMessage(e){`method`in e&&e.method===`heartbeat`&&e.params.type===`test_request`&&(this.log(`heartbeat test_request`),await this.sendMessage(`public/test`))}async fetch(e){let{params:t,failSilently:n=!1,...r}=e,{path:i,baseUrl:o=``,method:s=`get`}=e,c={jsonrpc:`2.0`,method:i,params:t,id:this.getNextMessageId()},p=BS.default.utc(),m={wsDetails:this.details,request:c,requestOptions:r,requestTimestamp:p.unix(),requestTime:p.format(`HH:mm:ss.SSS  DD-MM-YYYY`)};try{let e=await(await fetch(`${o}${i}`,{...r,body:s===`get`?void 0:JSON.stringify(c),method:s,headers:{...r.headers,"Content-Type":`application/json`}})).json();if(e!==void 0&&`error`in(e||{})){n===!1&&this.callbacks.onRequestError?.({details:this.details,message:{...c,id:-1},response:e,options:{}});let t=BS.default.utc();m.response=e,m.responseTimestamp=t.unix(),m.responseTime=t.format(`HH:mm:ss.SSS  DD-MM-YYYY`),this.logError(m)}return e}catch(e){let t=BS.default.utc();m.response=e.message,m.responseTimestamp=t.unix(),m.responseTime=t.format(`HH:mm:ss.SSS  DD-MM-YYYY`),this.logError(m)}}};function assertConnectionTypeIsMainOrPublic(e){if(e!==`main`&&e!==`public`)throw Error(`Invalid connection type. Only "main" or "public" are allowed.`)}var FakeSessionsManager=class extends AbstractSessionsManager{getCurrentSessionData(){return null}removeSessionData(e){}removeSessionsData(){}setSessionData(e,t){}},JS=r(((e,t)=>{(function(e,t){function assert(e,t){if(!e)throw Error(t||`Assertion failed`)}function inherits(e,t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype,e.prototype=new TempCtor,e.prototype.constructor=e}function BN(e,t,n){if(BN.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,e!==null&&((t===`le`||t===`be`)&&(n=t,t=10),this._init(e||0,t||10,n||`be`))}typeof e==`object`?e.exports=BN:t.BN=BN,BN.BN=BN,BN.wordSize=26;var n;try{n=typeof window<`u`&&window.Buffer!==void 0?window.Buffer:Xe().Buffer}catch{}BN.isBN=function isBN(e){return e instanceof BN||typeof e==`object`&&!!e&&e.constructor.wordSize===BN.wordSize&&Array.isArray(e.words)},BN.max=function max(e,t){return e.cmp(t)>0?e:t},BN.min=function min(e,t){return e.cmp(t)<0?e:t},BN.prototype._init=function init(e,t,n){if(typeof e==`number`)return this._initNumber(e,t,n);if(typeof e==`object`)return this._initArray(e,t,n);t===`hex`&&(t=16),assert(t===(t|0)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,``);var r=0;e[0]===`-`&&(r++,this.negative=1),r<e.length&&(t===16?this._parseHex(e,r,n):(this._parseBase(e,t,r),n===`le`&&this._initArray(this.toArray(),t,n)))},BN.prototype._initNumber=function _initNumber(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[e&67108863],this.length=1):e<4503599627370496?(this.words=[e&67108863,e/67108864&67108863],this.length=2):(assert(e<9007199254740992),this.words=[e&67108863,e/67108864&67108863,1],this.length=3),n===`le`&&this._initArray(this.toArray(),t,n)},BN.prototype._initArray=function _initArray(e,t,n){if(assert(typeof e.length==`number`),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,o,s=0;if(n===`be`)for(r=e.length-1,i=0;r>=0;r-=3)o=e[r]|e[r-1]<<8|e[r-2]<<16,this.words[i]|=o<<s&67108863,this.words[i+1]=o>>>
21226-s&67108863,s+=24,s>=26&&(s-=26,i++);else if(n===`le`)for(r=0,i=0;r<e.length;r+=3)o=e[r]|e[r+1]<<8|e[r+2]<<16,this.words[i]|=o<<s&67108863,this.words[i+1]=o>>>26-s&67108863,s+=24,s>=26&&(s-=26,i++);return this._strip()};function parseHex4Bits(e,t){var n=e.charCodeAt(t);if(n>=48&&n<=57)return n-48;if(n>=65&&n<=70)return n-55;if(n>=97&&n<=102)return n-87;assert(!1,`Invalid character in `+e)}function parseHexByte(e,t,n){var r=parseHex4Bits(e,n);return n-1>=t&&(r|=parseHex4Bits(e,n-1)<<4),r}BN.prototype._parseHex=function _parseHex(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i=0,o=0,s;if(n===`be`)for(r=e.length-1;r>=t;r-=2)s=parseHexByte(e,t,r)<<i,this.words[o]|=s&67108863,i>=18?(i-=18,o+=1,this.words[o]|=s>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)s=parseHexByte(e,t,r)<<i,this.words[o]|=s&67108863,i>=18?(i-=18,o+=1,this.words[o]|=s>>>26):i+=8;this._strip()};function parseBase(e,t,n,r){for(var i=0,o=0,s=Math.min(e.length,n),c=t;c<s;c++){var p=e.charCodeAt(c)-48;i*=r,o=p>=49?p-49+10:p>=17?p-17+10:p,assert(p>=0&&o<r,`Invalid character`),i+=o}return i}BN.prototype._parseBase=function _parseBase(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,s=o%r,c=Math.min(o,o-s)+n,p=0,m=n;m<c;m+=r)p=parseBase(e,m,m+r,t),this.imuln(i),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p);if(s!==0){var h=1;for(p=parseBase(e,m,e.length,t),m=0;m<s;m++)h*=t;this.imuln(h),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p)}this._strip()},BN.prototype.copy=function copy(e){e.words=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};function move(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(BN.prototype._move=function _move(e){move(e,this)},BN.prototype.clone=function clone(){var e=new BN(null);return this.copy(e),e},BN.prototype._expand=function _expand(e){for(;this.length<e;)this.words[this.length++]=0;return this},BN.prototype._strip=function strip(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},BN.prototype._normSign=function _normSign(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<`u`&&typeof Symbol.for==`function`)try{BN.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=inspect}catch{BN.prototype.inspect=inspect}else BN.prototype.inspect=inspect;function inspect(){return(this.red?`<BN-R: `:`<BN: `)+this.toString(16)+`>`}var r=`.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`.split(`.`),i=[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],o=[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];BN.prototype.toString=function toString(e,t){e||=10,t=t|0||1;var n;if(e===16||e===`hex`){n=``;for(var s=0,c=0,p=0;p<this.length;p++){var m=this.words[p],h=((m<<s|c)&16777215).toString(16);c=m>>>24-s&16777215,s+=2,s>=26&&(s-=26,p--),n=c!==0||p!==this.length-1?r[6-h.length]+h+n:h+n}for(c!==0&&(n=c.toString(16)+n);n.length%t!==0;)n=`0`+n;return this.negative!==0&&(n=`-`+n),n}if(e===(e|0)&&e>=2&&e<=36){var g=i[e],_=o[e];n=``;var v=this.clone();for(v.negative=0;!v.isZero();){var y=v.modrn(_).toString(e);v=v.idivn(_),n=v.isZero()?y+n:r[g-y.length]+y+n}for(this.isZero()&&(n=`0`+n);n.length%t!==0;)n=`0`+n;return this.negative!==0&&(n=`-`+n),n}assert(!1,`Base should be between 2 and 36`)},BN.prototype.toNumber=function toNumber(){var e=this.words[0];return this.length===2?e+=this.words[1]*67108864:this.length===3&&this.words[2]===1?e+=4503599627370496+this.words[1]*67108864:this.length>2&&assert(!1,`Number can only safely store up to 53 bits`),this.negative===0?e:-e},BN.prototype.toJSON=function toJSON(){return this.toString(16,2)},n&&(BN.prototype.toBuffer=function toBuffer(e,t){return this.toArrayLike(n,e,t)}),BN.prototype.toArray=function toArray(e,t){return this.toArrayLike(Array,e,t)};var s=function allocate(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)};BN.prototype.toArrayLike=function toArrayLike(e,t,n){this._strip();var r=this.byteLength(),i=n||Math.max(1,r);assert(r<=i,`byte array longer than desired length`),assert(i>0,`Requested array length <= 0`);var o=s(e,i),c=t===`le`?`LE`:`BE`;return this[`_toArrayLike`+c](o,r),o},BN.prototype._toArrayLikeLE=function _toArrayLikeLE(e,t){for(var n=0,r=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|r;e[n++]=s&255,n<e.length&&(e[n++]=s>>8&255),n<e.length&&(e[n++]=s>>16&255),o===6?(n<e.length&&(e[n++]=s>>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n<e.length)for(e[n++]=r;n<e.length;)e[n++]=0},BN.prototype._toArrayLikeBE=function _toArrayLikeBE(e,t){for(var n=e.length-1,r=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|r;e[n--]=s&255,n>=0&&(e[n--]=s>>8&255),n>=0&&(e[n--]=s>>16&255),o===6?(n>=0&&(e[n--]=s>>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?BN.prototype._countBits=function _countBits(e){return 32-Math.clz32(e)}:BN.prototype._countBits=function _countBits(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},BN.prototype._zeroBits=function _zeroBits(e){if(e===0)return 26;var t=e,n=0;return t&8191||(n+=13,t>>>=13),t&127||(n+=7,t>>>=7),t&15||(n+=4,t>>>=4),t&3||(n+=2,t>>>=2),t&1||n++,n},BN.prototype.bitLength=function bitLength(){var e=this.words[this.length-1],t=this._countBits(e);return(this.length-1)*26+t};function toBitArray(e){for(var t=Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,i=n%26;t[n]=e.words[r]>>>i&1}return t}BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,n!==26)break}return e},BN.prototype.byteLength=function byteLength(){return Math.ceil(this.bitLength()/8)},BN.prototype.toTwos=function toTwos(e){return this.negative===0?this.clone():this.abs().inotn(e).iaddn(1)},BN.prototype.fromTwos=function fromTwos(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},BN.prototype.isNeg=function isNeg(){return this.negative!==0},BN.prototype.neg=function neg(){return this.clone().ineg()},BN.prototype.ineg=function ineg(){return this.isZero()||(this.negative^=1),this},BN.prototype.iuor=function iuor(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()},BN.prototype.ior=function ior(e){return assert((this.negative|e.negative)===0),this.iuor(e)},BN.prototype.or=function or(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},BN.prototype.uor=function uor(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},BN.prototype.iuand=function iuand(e){for(var t=this.length>e.length?e:this,n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this._strip()},BN.prototype.iand=function iand(e){return assert((this.negative|e.negative)===0),this.iuand(e)},BN.prototype.and=function and(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},BN.prototype.uand=function uand(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},BN.prototype.iuxor=function iuxor(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this._strip()},BN.prototype.ixor=function ixor(e){return assert((this.negative|e.negative)===0),this.iuxor(e)},BN.prototype.xor=function xor(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},BN.prototype.uxor=function uxor(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},BN.prototype.inotn=function inotn(e){assert(typeof e==`number`&&e>=0);var t=Math.ceil(e/26)|0,n=e%26;this._expand(t),n>0&&t--;for(var r=0;r<t;r++)this.words[r]=~this.words[r]&67108863;return n>0&&(this.words[r]=~this.words[r]&67108863>>26-n),this._strip()},BN.prototype.notn=function notn(e){return this.clone().inotn(e)},BN.prototype.setn=function setn(e,t){assert(typeof e==`number`&&e>=0);var n=e/26|0,r=e%26;return this._expand(n+1),t?this.words[n]=this.words[n]|1<<r:this.words[n]=this.words[n]&~(1<<r),this._strip()},BN.prototype.iadd=function iadd(e){var t;if(this.negative!==0&&e.negative===0)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(this.negative===0&&e.negative!==0)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();var n,r;this.length>e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o<r.length;o++)t=(n.words[o]|0)+(r.words[o]|0)+i,this.words[o]=t&67108863,i=t>>>26;for(;i!==0&&o<n.length;o++)t=(n.words[o]|0)+i,this.words[o]=t&67108863,i=t>>>26;if(this.length=n.length,i!==0)this.words[this.length]=i,this.length++;else if(n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this},BN.prototype.add=function add(e){var t;return e.negative!==0&&this.negative===0?(e.negative=0,t=this.sub(e),e.negative^=1,t):e.negative===0&&this.negative!==0?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},BN.prototype.isub=function isub(e){if(e.negative!==0){e.negative=0;
212var t=this.iadd(e);return e.negative=1,t._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n=this.cmp(e);if(n===0)return this.negative=0,this.length=1,this.words[0]=0,this;var r,i;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,s=0;s<i.length;s++)t=(r.words[s]|0)-(i.words[s]|0)+o,o=t>>26,this.words[s]=t&67108863;for(;o!==0&&s<r.length;s++)t=(r.words[s]|0)+o,o=t>>26,this.words[s]=t&67108863;if(o===0&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},BN.prototype.sub=function sub(e){return this.clone().isub(e)};function smallMulTo(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=e.words[0]|0,o=t.words[0]|0,s=i*o,c=s&67108863,p=s/67108864|0;n.words[0]=c;for(var m=1;m<r;m++){for(var h=p>>>26,g=p&67108863,_=Math.min(m,t.length-1),v=Math.max(0,m-e.length+1);v<=_;v++){var y=m-v|0;i=e.words[y]|0,o=t.words[v]|0,s=i*o+g,h+=s/67108864|0,g=s&67108863}n.words[m]=g|0,p=h|0}return p===0?n.length--:n.words[m]=p|0,n._strip()}var c=function comb10MulTo(e,t,n){var r=e.words,i=t.words,o=n.words,s=0,c,p,m,h=r[0]|0,g=h&8191,_=h>>>13,v=r[1]|0,y=v&8191,b=v>>>13,x=r[2]|0,S=x&8191,C=x>>>13,w=r[3]|0,T=w&8191,E=w>>>13,D=r[4]|0,O=D&8191,k=D>>>13,ee=r[5]|0,te=ee&8191,A=ee>>>13,j=r[6]|0,ne=j&8191,M=j>>>13,re=r[7]|0,ie=re&8191,ae=re>>>13,oe=r[8]|0,se=oe&8191,ce=oe>>>13,le=r[9]|0,ue=le&8191,de=le>>>13,fe=i[0]|0,pe=fe&8191,me=fe>>>13,he=i[1]|0,ge=he&8191,_e=he>>>13,ve=i[2]|0,ye=ve&8191,be=ve>>>13,xe=i[3]|0,Se=xe&8191,Ce=xe>>>13,we=i[4]|0,Te=we&8191,Ee=we>>>13,De=i[5]|0,Oe=De&8191,ke=De>>>13,Ae=i[6]|0,je=Ae&8191,Me=Ae>>>13,Ne=i[7]|0,Pe=Ne&8191,Fe=Ne>>>13,Ie=i[8]|0,Le=Ie&8191,Re=Ie>>>13,ze=i[9]|0,Be=ze&8191,Ve=ze>>>13;n.negative=e.negative^t.negative,n.length=19,c=Math.imul(g,pe),p=Math.imul(g,me),p=p+Math.imul(_,pe)|0,m=Math.imul(_,me);var He=(s+c|0)+((p&8191)<<13)|0;s=(m+(p>>>13)|0)+(He>>>26)|0,He&=67108863,c=Math.imul(y,pe),p=Math.imul(y,me),p=p+Math.imul(b,pe)|0,m=Math.imul(b,me),c=c+Math.imul(g,ge)|0,p=p+Math.imul(g,_e)|0,p=p+Math.imul(_,ge)|0,m=m+Math.imul(_,_e)|0;var Ue=(s+c|0)+((p&8191)<<13)|0;s=(m+(p>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,c=Math.imul(S,pe),p=Math.imul(S,me),p=p+Math.imul(C,pe)|0,m=Math.imul(C,me),c=c+Math.imul(y,ge)|0,p=p+Math.imul(y,_e)|0,p=p+Math.imul(b,ge)|0,m=m+Math.imul(b,_e)|0,c=c+Math.imul(g,ye)|0,p=p+Math.imul(g,be)|0,p=p+Math.imul(_,ye)|0,m=m+Math.imul(_,be)|0;var We=(s+c|0)+((p&8191)<<13)|0;s=(m+(p>>>13)|0)+(We>>>26)|0,We&=67108863,c=Math.imul(T,pe),p=Math.imul(T,me),p=p+Math.imul(E,pe)|0,m=Math.imul(E,me),c=c+Math.imul(S,ge)|0,p=p+Math.imul(S,_e)|0,p=p+Math.imul(C,ge)|0,m=m+Math.imul(C,_e)|0,c=c+Math.imul(y,ye)|0,p=p+Math.imul(y,be)|0,p=p+Math.imul(b,ye)|0,m=m+Math.imul(b,be)|0,c=c+Math.imul(g,Se)|0,p=p+Math.imul(g,Ce)|0,p=p+Math.imul(_,Se)|0,m=m+Math.imul(_,Ce)|0;var Ge=(s+c|0)+((p&8191)<<13)|0;s=(m+(p>>>13)|0)+(Ge>>>26)|0,Ge&=67108863,c=Math.imul(O,pe),p=Math.imul(O,me),p=p+Math.imul(k,pe)|0,m=Math.imul(k,me),c=c+Math.imul(T,ge)|0,p=p+Math.imul(T,_e)|0,p=p+Math.imul(E,ge)|0,m=m+Math.imul(E,_e)|0,c=c+Math.imul(S,ye)|0,p=p+Math.imul(S,be)|0,p=p+Math.imul(C,ye)|0,m=m+Math.imul(C,be)|0,c=c+Math.imul(y,Se)|0,p=p+Math.imul(y,Ce)|0,p=p+Math.imul(b,Se)|0,m=m+Math.imul(b,Ce)|0,c=c+Math.imul(g,Te)|0,p=p+Math.imul(g,Ee)|0,p=p+Math.imul(_,Te)|0,m=m+Math.imul(_,Ee)|0;var Ke=(s+c|0)+((p&8191)<<13)|0;s=(m+(p>>>13)|0)+(Ke>>>26)|0,Ke&=67108863,c=Math.imul(te,pe),p=Math.imul(te,me),p=p+Math.imul(A,pe)|0,m=Math.imul(A,me),c=c+Math.imul(O,ge)|0,p=p+Math.imul(O,_e)|0,p=p+Math.imul(k,ge)|0,m=m+Math.imul(k,_e)|0,c=c+Math.imul(T,ye)|0,p=p+Math.imul(T,be)|0,p=p+Math.imul(E,ye)|0,m=m+Math.imul(E,be)|0,c=c+Math.imul(S,Se)|0,p=p+Math.imul(S,Ce)|0,p=p+Math.imul(C,Se)|0,m=m+Math.imul(C,Ce)|0,c=c+Math.imul(y,Te)|0,p=p+Math.imul(y,Ee)|0,p=p+Math.imul(b,Te)|0,m=m+Math.imul(b,Ee)|0,c=c+Math.imul(g,Oe)|0,p=p+Math.imul(g,ke)|0,p=p+Math.imul(_,Oe)|0,m=m+Math.imul(_,ke)|0;var qe=(s+c|0)+((p&8191)<<13)|0;s=(m+(p>>>13)|0)+(qe>>>26)|0,qe&=67108863,c=Math.imul(ne,pe),p=Math.imul(ne,me),p=p+Math.imul(M,pe)|0,m=Math.imul(M,me),c=c+Math.imul(te,ge)|0,p=p+Math.imul(te,_e)|0,p=p+Math.imul(A,ge)|0,m=m+Math.imul(A,_e)|0,c=c+Math.imul(O,ye)|0,p=
212p+Math.imul(O,be)|0,p=p+Math.imul(k,ye)|0,m=m+Math.imul(k,be)|0,c=c+Math.imul(T,Se)|0,p=p+Math.imul(T,Ce)|0,p=p+Math.imul(E,Se)|0,m=m+Math.imul(E,Ce)|0,c=c+Math.imul(S,Te)|0,p=p+Math.imul(S,Ee)|0,p=p+Math.imul(C,Te)|0,m=m+Math.imul(C,Ee)|0,c=c+Math.imul(y,Oe)|0,p=p+Math.imul(y,ke)|0,p=p+Math.imul(b,Oe)|0,m=m+Math.imul(b,ke)|0,c=c+Math.imul(g,je)|0,p=p+Math.imul(g,Me)|0,p=p+Math.imul(_,je)|0,m=m+Math.imul(_,Me)|0;var Je=(s+c|0)+((p&8191)<<13)|0;s=(m+(p>>>13)|0)+(Je>>>26)|0,Je&=67108863,c=Math.imul(ie,pe),p=Math.imul(ie,me),p=p+Math.imul(ae,pe)|0,m=Math.imul(ae,me),c=c+Math.imul(ne,ge)|0,p=p+Math.imul(ne,_e)|0,p=p+Math.imul(M,ge)|0,m=m+Math.imul(M,_e)|0,c=c+Math.imul(te,ye)|0,p=p+Math.imul(te,be)|0,p=p+Math.imul(A,ye)|0,m=m+Math.imul(A,be)|0,c=c+Math.imul(O,Se)|0,p=p+Math.imul(O,Ce)|0,p=p+Math.imul(k,Se)|0,m=m+Math.imul(k,Ce)|0,c=c+Math.imul(T,Te)|0,p=p+Math.imul(T,Ee)|0,p=p+Math.imul(E,Te)|0,m=m+Math.imul(E,Ee)|0,c=c+Math.imul(S,Oe)|0,p=p+Math.imul(S,ke)|0,p=p+Math.imul(C,Oe)|0,m=m+Math.imul(C,ke)|0,c=c+Math.imul(y,je)|0,p=p+Math.imul(y,Me)|0,p=p+Math.imul(b,je)|0,m=m+Math.imul(b,Me)|0,c=c+Math.imul(g,Pe)|0,p=p+Math.imul(g,Fe)|0,p=p+Math.imul(_,Pe)|0,m=m+Math.imul(_,Fe)|0;var Ye=(s+c|0)+((p&8191)<<13)|0;s=(m+(p>>>13)|0)+(Ye>>>26)|0,Ye&=67108863,c=Math.imul(se,pe),p=Math.imul(se,me),p=p+Math.imul(ce,pe)|0,m=Math.imul(ce,me),c=c+Math.imul(ie,ge)|0,p=p+Math.imul(ie,_e)|0,p=p+Math.imul(ae,ge)|0,m=m+Math.imul(ae,_e)|0,c=c+Math.imul(ne,ye)|0,p=p+Math.imul(ne,be)|0,p=p+Math.imul(M,ye)|0,m=m+Math.imul(M,be)|0,c=c+Math.imul(te,Se)|0,p=p+Math.imul(te,Ce)|0,p=p+Math.imul(A,Se)|0,m=m+Math.imul(A,Ce)|0,c=c+Math.imul(O,Te)|0,p=p+Math.imul(O,Ee)|0,p=p+Math.imul(k,Te)|0,m=m+Math.imul(k,Ee)|0,c=c+Math.imul(T,Oe)|0,p=p+Math.imul(T,ke)|0,p=p+Math.imul(E,Oe)|0,m=m+Math.imul(E,ke)|0,c=c+Math.imul(S,je)|0,p=p+Math.imul(S,Me)|0,p=p+Math.imul(C,je)|0,m=m+Math.imul(C,Me)|0,c=c+Math.imul(y,Pe)|0,p=p+Math.imul(y,Fe)|0,p=p+Math.imul(b,Pe)|0,m=m+Math.imul(b,Fe)|0,c=c+Math.imul(g,Le)|0,p=p+Math.imul(g,Re)|0,p=p+Math.imul(_,Le)|0,m=m+Math.imul(_,Re)|0;var Xe=(s+c|0)+((p&8191)<<13)|0;s=(m+(p>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,c=Math.imul(ue,pe),p=Math.imul(ue,me),p=p+Math.imul(de,pe)|0,m=Math.imul(de,me),c=c+Math.imul(se,ge)|0,p=p+Math.imul(se,_e)|0,p=p+Math.imul(ce,ge)|0,m=m+Math.imul(ce,_e)|0,c=c+Math.imul(ie,ye)|0,p=p+Math.imul(ie,be)|0,p=p+Math.imul(ae,ye)|0,m=m+Math.imul(ae,be)|0,c=c+Math.imul(ne,Se)|0,p=p+Math.imul(ne,Ce)|0,p=p+Math.imul(M,Se)|0,m=m+Math.imul(M,Ce)|0,c=c+Math.imul(te,Te)|0,p=p+Math.imul(te,Ee)|0,p=p+Math.imul(A,Te)|0,m=m+Math.imul(A,Ee)|0,c=c+Math.imul(O,Oe)|0,p=p+Math.imul(O,ke)|0,p=p+Math.imul(k,Oe)|0,m=m+Math.imul(k,ke)|0,c=c+Math.imul(T,je)|0,p=
212p+Math.imul(T,Me)|0,p=p+Math.imul(E,je)|0,m=m+Math.imul(E,Me)|0,c=c+Math.imul(S,Pe)|0,p=p+Math.imul(S,Fe)|0,p=p+Math.imul(C,Pe)|0,m=m+Math.imul(C,Fe)|0,c=c+Math.imul(y,Le)|0,p=p+Math.imul(y,Re)|0,p=p+Math.imul(b,Le)|0,m=m+Math.imul(b,Re)|0,c=c+Math.imul(g,Be)|0,p=p+Math.imul(g,Ve)|0,p=p+Math.imul(_,Be)|0,m=m+Math.imul(_,Ve)|0;var Ze=(s+c|0)+((p&8191)<<13)|0;s=(m+(p>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,c=Math.imul(ue,ge),p=Math.imul(ue,_e),p=p+Math.imul(de,ge)|0,m=Math.imul(de,_e),c=c+Math.imul(se,ye)|0,p=p+Math.imul(se,be)|0,p=p+Math.imul(ce,ye)|0,m=m+Math.imul(ce,be)|0,c=c+Math.imul(ie,Se)|0,p=p+Math.imul(ie,Ce)|0,p=p+Math.imul(ae,Se)|0,m=m+Math.imul(ae,Ce)|0,c=c+Math.imul(ne,Te)|0,p=p+Math.imul(ne,Ee)|0,p=p+Math.imul(M,Te)|0,m=m+Math.imul(M,Ee)|0,c=c+Math.imul(te,Oe)|0,p=p+Math.imul(te,ke)|0,p=p+Math.imul(A,Oe)|0,m=m+Math.imul(A,ke)|0,c=c+Math.imul(O,je)|0,p=p+Math.imul(O,Me)|0,p=p+Math.imul(k,je)|0,m=m+Math.imul(k,Me)|0,c=c+Math.imul(T,Pe)|0,p=p+Math.imul(T,Fe)|0,p=p+Math.imul(E,Pe)|0,m=m+Math.imul(E,Fe)|0,c=c+Math.imul(S,Le)|0,p=p+Math.imul(S,Re)|0,p=p+Math.imul(C,Le)|0,m=m+Math.imul(C,Re)|0,c=c+Math.imul(y,Be)|0,p=p+Math.imul(y,Ve)|0,p=p+Math.imul(b,Be)|0,m=m+Math.imul(b,Ve)|0;var Qe=(s+c|0)+((p&8191)<<13)|0;s=(m+(p>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,c=Math.imul(ue,ye),p=Math.imul(ue,be),p=p+Math.imul(de,ye)|0,m=Math.imul(de,be),c=c+Math.imul(se,Se)|0,p=p+Math.imul(se,Ce)|0,p=p+Math.imul(ce,Se)|0,m=m+Math.imul(ce,Ce)|0,c=c+Math.imul(ie,Te)|0,p=p+Math.imul(ie,Ee)|0,p=p+Math.imul(ae,Te)|0,m=m+Math.imul(ae,Ee)|0,c=c+Math.imul(ne,Oe)|0,p=p+Math.imul(ne,ke)|0,p=p+Math.imul(M,Oe)|0,m=m+Math.imul(M,ke)|0,c=c+Math.imul(te,je)|0,p=p+Math.imul(te,Me)|0,p=p+Math.imul(A,je)|0,m=m+Math.imul(A,Me)|0,c=c+Math.imul(O,Pe)|0,p=p+Math.imul(O,Fe)|0,p=p+Math.imul(k,Pe)|0,m=m+Math.imul(k,Fe)|0,c=c+Math.imul(T,Le)|0,p=
212p+Math.imul(T,Re)|0,p=p+Math.imul(E,Le)|0,m=m+Math.imul(E,Re)|0,c=c+Math.imul(S,Be)|0,p=p+Math.imul(S,Ve)|0,p=p+Math.imul(C,Be)|0,m=m+Math.imul(C,Ve)|0;var $e=(s+c|0)+((p&8191)<<13)|0;s=(m+(p>>>13)|0)+($e>>>26)|0,$e&=67108863,c=Math.imul(ue,Se),p=Math.imul(ue,Ce),p=p+Math.imul(de,Se)|0,m=Math.imul(de,Ce),c=c+Math.imul(se,Te)|0,p=p+Math.imul(se,Ee)|0,p=p+Math.imul(ce,Te)|0,m=m+Math.imul(ce,Ee)|0,c=c+Math.imul(ie,Oe)|0,p=p+Math.imul(ie,ke)|0,p=p+Math.imul(ae,Oe)|0,m=m+Math.imul(ae,ke)|0,c=c+Math.imul(ne,je)|0,p=p+Math.imul(ne,Me)|0,p=p+Math.imul(M,je)|0,m=m+Math.imul(M,Me)|0,c=c+Math.imul(te,Pe)|0,p=p+Math.imul(te,Fe)|0,p=p+Math.imul(A,Pe)|0,m=m+Math.imul(A,Fe)|0,c=c+Math.imul(O,Le)|0,p=p+Math.imul(O,Re)|0,p=p+Math.imul(k,Le)|0,m=m+Math.imul(k,Re)|0,c=c+Math.imul(T,Be)|0,p=p+Math.imul(T,Ve)|0,p=p+Math.imul(E,Be)|0,m=m+Math.imul(E,Ve)|0;var et=(s+c|0)+((p&8191)<<13)|0;s=(m+(p>>>13)|0)+(et>>>26)|0,et&=67108863,c=Math.imul(ue,Te),p=Math.imul(ue,Ee),p=p+Math.imul(de,Te)|0,m=Math.imul(de,Ee),c=c+Math.imul(se,Oe)|0,p=p+Math.imul(se,ke)|0,p=p+Math.imul(ce,Oe)|0,m=m+Math.imul(ce,ke)|0,c=c+Math.imul(ie,je)|0,p=p+Math.imul(ie,Me)|0,p=p+Math.imul(ae,je)|0,m=m+Math.imul(ae,Me)|0,c=c+Math.imul(ne,Pe)|0,p=p+Math.imul(ne,Fe)|0,p=p+Math.imul(M,Pe)|0,m=m+Math.imul(M,Fe)|0,c=c+Math.imul(te,Le)|0,p=p+Math.imul(te,Re)|0,p=p+Math.imul(A,Le)|0,m=m+Math.imul(A,Re)|0,c=c+Math.imul(O,Be)|0,p=p+Math.imul(O,Ve)|0,p=p+Math.imul(k,Be)|0,m=m+Math.imul(k,Ve)|0;var tt=(s+c|0)+((p&8191)<<13)|0;s=(m+(p>>>13)|0)+(tt>>>26)|0,tt&=67108863,c=Math.imul(ue,Oe),p=Math.imul(ue,ke),p=p+Math.imul(de,Oe)|0,m=Math.imul(de,ke),c=c+Math.imul(se,je)|0,p=p+Math.imul(se,Me)|0,p=p+Math.imul(ce,je)|0,m=m+Math.imul(ce,Me)|0,c=c+Math.imul(ie,Pe)|0,p=p+Math.imul(ie,Fe)|0,p=p+Math.imul(ae,Pe)|0,m=m+Math.imul(ae,Fe)|0,c=c+Math.imul(ne,Le)|0,p=p+Math.imul(ne,Re)|0,p=p+Math.imul(M,Le)|0,m=m+Math.imul(M,Re)|0,c=c+Math.imul(te,Be)|0,p=p+Math.imul(te,Ve)|0,p=p+Math.imul(A,Be)|0,m=m+Math.imul(A,Ve)|0;var nt=(s+c|0)+((p&8191)<<13)|0;s=(m+(p>>>13)|0)+(nt>>>26)|0,nt&=67108863,c=Math.imul(ue,je),p=Math.imul(ue,Me),p=p+Math.imul(de,je)|0,m=Math.imul(de,Me),c=c+Math.imul(se,Pe)|0,p=p+Math.imul(se,Fe)|0,p=p+Math.imul(ce,Pe)|0,m=m+Math.imul(ce,Fe)|0,c=c+Math.imul(ie,Le)|0,p=p+Math.imul(ie,Re)|0,p=p+Math.imul(ae,Le)|0,m=m+Math.imul(ae,Re)|0,c=c+Math.imul(ne,Be)|0,p=p+Math.imul(ne,Ve)|0,p=p+Math.imul(M,Be)|0,m=m+Math.imul(M,Ve)|0;var rt=(s+c|0)+((p&8191)<<13)|0;s=(m+(p>>>13)|0)+(rt>>>26)|0,rt&=67108863,c=Math.imul(ue,Pe),p=Math.imul(ue,Fe),p=p+Math.imul(de,Pe)|0,m=Math.imul(de,Fe),c=c+Math.imul(se,Le)|0,p=p+Math.imul(se,Re)|0,p=p+Math.imul(ce,Le)|0,m=m+Math.imul(ce,Re)|0,c=c+Math.imul(ie,Be)|0,p=p+Math.imul(ie,Ve)|0,p=p+Math.imul(ae,Be)|0,m=m+Math.imul(ae,Ve)|0;var it=(s+c|0)+((p&8191)<<13)|0;s=(m+(p>>>13)|0)+(it>>>26)|0,it&=67108863,c=Math.imul(ue,Le),p=Math.imul(ue,Re),p=p+Math.imul(de,Le)|0,m=Math.imul(de,Re),c=c+Math.imul(se,Be)|0,p=p+Math.imul(se,Ve)|0,p=p+Math.imul(ce,Be)|0,m=m+Math.imul(ce,Ve)|0;var at=(s+c|0)+((p&8191)<<13)|0;s=(m+(p>>>13)|0)+(at>>>26)|0,at&=67108863,c=Math.imul(ue,Be),p=Math.imul(ue,Ve),p=p+Math.imul(de,Be)|0,m=Math.imul(de,Ve);var ot=(s+c|0)+((p&8191)<<13)|0;return s=(m+(p>>>13)|0)+(ot>>>26)|0,ot&=67108863,o[0]=He,o[1]=Ue,o[2]=We,o[3]=Ge,o[4]=Ke,o[5]=qe,o[6]=Je,o[7]=Ye,o[8]=Xe,o[9]=Ze,o[10]=Qe,o[11]=$e,o[12]=et,o[13]=tt,o[14]=nt,o[15]=rt,o[16]=it,o[17]=at,o[18]=ot,s!==0&&(o[19]=s,n.length++),n};Math.imul||(c=smallMulTo);function bigMulTo(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o<n.length-1;o++){var s=i;i=0;for(var c=r&67108863,p=Math.min(o,t.length-1),m=Math.max(0,o-e.length+1);m<=p;m++){var h=o-m,g=(e.words[h]|0)*(t.words[m]|0),_=g&67108863;s=s+(g/67108864|0)|0,_=_+c|0,c=_&67108863,s=s+(_>>>26)|0,i+=s>>>26,s&=67108863}n.words[o]=c,r=s,s=i}return r===0?n.length--:n.words[o]=r,n._strip()}function jumboMulTo(e,t,n){return bigMulTo(e,t,n)}BN.prototype.mulTo=function mulTo(e,t){var n,r=this.length+e.length;return n=this.length===10&&e.length===10?c(this,e,t):r<63?smallMulTo(this,e,t):r<1024?bigMulTo(this,e,t):jumboMulTo(this,e,t),n};function FFTM(e,t){this.x=e,this.y=t}FFTM.prototype.makeRBT=function makeRBT(e){for(var t=Array(e),n=BN.prototype._countBits(e)-1,r=0;r<e;r++)t[r]=this.revBin(r,n,e);return t},FFTM.prototype.revBin=function revBin(e,t,n){if(e===0||e===n-1)return e;for(var r=0,i=0;i<t;i++)r|=(e&1)<<t-i-1,e>>=1;return r},FFTM.prototype.permute=function permute(e,t,n,r,i,o){for(var s=0;s<o;s++)r[s]=t[e[s]],i[s]=n[e[s]]},FFTM.prototype.transform=function transform(e,t,n,r,i,o){this.permute(o,e,t,n,r,i);for(var s=1;s<i;s<<=1)for(var c=s<<1,p=Math.cos(2*Math.PI/c),m=Math.sin(2*Math.PI/c),h=0;h<i;h+=c)for(var g=p,_=m,v=0;v<s;v++){var y=n[h+v],b=r[h+v],x=n[h+v+s],S=r[h+v+s],C=g*x-_*S;S=g*S+_*x,x=C,n[h+v]=y+x,r[h+v]=b+S,n[h+v+s]=y-x,r[h+v+s]=b-S,v!==c&&(C=p*g-m*_,_=p*_+m*g,g=C)}},FFTM.prototype.guessLen13b=function guessLen13b(e,t){var n=Math.max(t,e)|1,r=n&1,i=0;for(n=n/2|0;n;n>>>=1)i++;return 1<<i+1+r},FFTM.prototype.conjugate=function conjugate(e,t,n){if(!(n<=1))for(var r=0;r<n/2;r++){var i=e[r];e[r]=e[n-r-1],e[n-r-1]=i,i=t[r],t[r]=-t[n-r-1],t[n-r-1]=-i}},FFTM.prototype.normalize13b=function normalize13b(e,t){for(var n=0,r=0;r<t/2;r++){var i=Math.round(e[2*r+1]/t)*8192+Math.round(e[2*r]/t)+n;e[r]=i&67108863,n=i<67108864?0:i/67108864|0}return e},FFTM.prototype.convert13b=function convert13b(e,t,n,r){for(var i=0,o=0;o<t;o++)i+=e[o]|0,n[2*o]=i&8191,i>>>=13,n[2*o+1]=i&8191,i>>>=13;for(o=2*t;o<r;++o)n[o]=0;assert(i===0),assert(!(i&-8192))},FFTM.prototype.stub=function stub(e){for(var t=Array(e),n=0;n<e;n++)t[n]=0;return t},FFTM.prototype.mulp=function mulp(e,t,n){var r=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(r),o=this.stub(r),s=Array(r),c=Array(r),p=Array(r),m=Array(r),h=Array(r),g=Array(r),_=n.words;_.length=r,this.convert13b(e.words,e.length,s,r),this.convert13b(t.words,t.length,m,r),this.transform(s,o,c,p,r,i),this.transform(m,o,h,g,r,i);for(var v=0;v<r;v++){var y=c[v]*h[v]-p[v]*g[v];p[v]=c[v]*g[v]+p[v]*h[v],c[v]=y}return this.conjugate(c,p,r),this.transform(c,p,_,o,r,i),this.conjugate(_,o,r),this.normalize13b(_,r),n.negative=e.negative^t.negative,n.length=e.length+t.length,n._strip()},BN.prototype.mul=function mul(e){var t=new BN(null);return t.words=Array(this.length+e.length),this.mulTo(e,t)},BN.prototype.mulf=function mulf(e){var t=new BN(null);return t.words=Array(this.length+e.length),jumboMulTo(this,e,t)},BN.prototype.imul=function imul(e){return this.clone().mulTo(e,this)},BN.prototype.imuln=function imuln(e){var t=e<0;t&&(e=-e),assert(typeof e==`number`),assert(e<67108864);for(var n=0,r=0;r<this.length;r++){var i=(this.words[r]|0)*e,o=(i&67108863)+(n&67108863);n>>=26,n+=i/67108864|0,n+=o>>>26,this.words[r]=o&67108863}return n!==0&&(this.words[r]=n,this.length++),t?this.ineg():this},BN.prototype.muln=function muln(e){return this.clone().imuln(e)},BN.prototype.sqr=function sqr(){return this.mul(this)},BN.prototype.isqr=function isqr(){return this.imul(this.clone())},BN.prototype.pow=function pow(e){var t=toBitArray(e);if(t.length===0)return new BN(1);for(var n=this,r=0;r<t.length&&t[r]===0;r++,n=n.sqr());if(++r<t.length)for(var i=n.sqr();r<t.length;r++,i=i.sqr())t[r]!==0&&(n=n.mul(i));return n},BN.prototype.iushln=function iushln(e){assert(typeof e==`number`&&e>=0);var t=e%26,n=(e-t)/26,r=67108863>>>26-t<<26-t,i;if(t!==0){var o=0;for(i=0;i<this.length;i++){var s=this.words[i]&r,c=(this.words[i]|0)-s<<t;this.words[i]=c|o,o=s>>>26-t}o&&(this.words[i]=o,this.length++)}if(n!==0){for(i=this.length-1;i>=0;i--)this.words[i+n]=this.words[i];for(i=0;i<n;i++)this.words[i]=0;this.length+=n}return this._strip()},BN.prototype.ishln=function ishln(e){return assert(this.negative===0),this.iushln(e)}
212,BN.prototype.iushrn=function iushrn(e,t,n){assert(typeof e==`number`&&e>=0);var r=t?(t-t%26)/26:0,i=e%26,o=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<<i,c=n;if(r-=o,r=Math.max(0,r),c){for(var p=0;p<o;p++)c.words[p]=this.words[p];c.length=o}if(o!==0){if(this.length>o)for(this.length-=o,p=0;p<this.length;p++)this.words[p]=this.words[p+o];else this.words[0]=0,this.length=1}var m=0;for(p=this.length-1;p>=0&&(m!==0||p>=r);p--){var h=this.words[p]|0;this.words[p]=m<<26-i|h>>>i,m=h&s}return c&&m!==0&&(c.words[c.length++]=m),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},BN.prototype.ishrn=function ishrn(e,t,n){return assert(this.negative===0),this.iushrn(e,t,n)},BN.prototype.shln=function shln(e){return this.clone().ishln(e)},BN.prototype.ushln=function ushln(e){return this.clone().iushln(e)},BN.prototype.shrn=function shrn(e){return this.clone().ishrn(e)},BN.prototype.ushrn=function ushrn(e){return this.clone().iushrn(e)},BN.prototype.testn=function testn(e){assert(typeof e==`number`&&e>=0);var t=e%26,n=(e-t)/26,r=1<<t;return this.length<=n?!1:!!(this.words[n]&r)},BN.prototype.imaskn=function imaskn(e){assert(typeof e==`number`&&e>=0);var t=e%26,n=(e-t)/26;if(assert(this.negative===0,`imaskn works only with positive numbers`),this.length<=n)return this;if(t!==0&&n++,this.length=Math.min(n,this.length),t!==0){var r=67108863^67108863>>>t<<t;this.words[this.length-1]&=r}return this._strip()},BN.prototype.maskn=function maskn(e){return this.clone().imaskn(e)},BN.prototype.iaddn=function iaddn(e){return assert(typeof e==`number`),assert(e<67108864),e<0?this.isubn(-e):this.negative===0?this._iaddn(e):this.length===1&&(this.words[0]|0)<=e?(this.words[0]=e-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this)},BN.prototype._iaddn=function _iaddn(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},BN.prototype.isubn=function isubn(e){if(assert(typeof e==`number`),assert(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&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];return this._strip()},BN.prototype.addn=function addn(e){return this.clone().iaddn(e)},BN.prototype.subn=function subn(e){return this.clone().isubn(e)},BN.prototype.iabs=function iabs(){return this.negative=0,this},BN.prototype.abs=function abs(){return this.clone().iabs()},BN.prototype._ishlnsubmul=function _ishlnsubmul(e,t,n){var r=e.length+n,i;this._expand(r);var o,s=0;for(i=0;i<e.length;i++){o=(this.words[i+n]|0)+s;var c=(e.words[i]|0)*t;o-=c&67108863,s=(o>>26)-(c/67108864|0),this.words[i+n]=o&67108863}for(;i<this.length-n;i++)o=(this.words[i+n]|0)+s,s=o>>26,this.words[i+n]=o&67108863;if(s===0)return this._strip();for(assert(s===-1),s=0,i=0;i<this.length;i++)o=-(this.words[i]|0)+s,s=o>>26,this.words[i]=o&67108863;return this.negative=1,this._strip()},BN.prototype._wordDiv=function _wordDiv(e,t){var n=this.length-e.length,r=this.clone(),i=e,o=i.words[i.length-1]|0;n=26-this._countBits(o),n!==0&&(i=i.ushln(n),r.iushln(n),o=i.words[i.length-1]|0);var s=r.length-i.length,c;if(t!==`mod`){c=new BN(null),c.length=s+1,c.words=Array(c.length);for(var p=0;p<c.length;p++)c.words[p]=0}var m=r.clone()._ishlnsubmul(i,1,s);m.negative===0&&(r=m,c&&(c.words[s]=1));for(var h=s-1;h>=0;h--){var g=(r.words[i.length+h]|0)*67108864+(r.words[i.length+h-1]|0);for(g=Math.min(g/o|0,67108863),r._ishlnsubmul(i,g,h);r.negative!==0;)g--,r.negative=0,r._ishlnsubmul(i,1,h),r.isZero()||(r.negative^=1);c&&(c.words[h]=g)}return c&&c._strip(),r._strip(),t!==`div`&&n!==0&&r.iushrn(n),{div:c||null,mod:r}},BN.prototype.divmod=function divmod(e,t,n){if(assert(!e.isZero()),this.isZero())return{div:new BN(0),mod:new BN(0)};var r,i,o;return this.negative!==0&&e.negative===0?(o=this.neg().divmod(e,t),t!==`mod`&&(r=o.div.neg()),t!==`div`&&(i=o.mod.neg(),n&&i.negative!==0&&i.iadd(e)),{div:r,mod:i}):this.negative===0&&e.negative!==0?(o=this.divmod(e.neg(),t),t!==`mod`&&(r=o.div.neg()),{div:r,mod:o.mod}):(this.negative&e.negative)===0?e.length>this.length||this.cmp(e)<0?{div:new BN(0),mod:this}:e.length===1?t===`div`?{div:this.divn(e.words[0]),mod:null}:t===`mod`?{div:null,mod:new BN(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new BN(this.modrn(e.words[0]))}:this._wordDiv(e,t):(o=this.neg().divmod(e.neg(),t),t!==`div`&&(i=o.mod.neg(),n&&i.negative!==0&&i.isub(e)),{div:o.div,mod:i})},BN.prototype.div=function div(e){return this.divmod(e,`div`,!1).div},BN.prototype.mod=function mod(e){return this.divmod(e,`mod`,!1).mod},BN.prototype.umod=function umod(e){return this.divmod(e,`mod`,!0).mod},BN.prototype.divRound=function divRound(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=t.div.negative===0?t.mod:t.mod.isub(e),r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||i===1&&o===0?t.div:t.div.negative===0?t.div.iaddn(1):t.div.isubn(1)},BN.prototype.modrn=function modrn(e){var t=e<0;t&&(e=-e),assert(e<=67108863);for(var n=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(n*r+(this.words[i]|0))%e;return t?-r:r},BN.prototype.modn=function modn(e){return this.modrn(e)},BN.prototype.idivn=function idivn(e){var t=e<0;t&&(e=-e),assert(e<=67108863);for(var n=0,r=this.length-1;r>=0;r--){var i=(this.words[r]|0)+n*67108864;this.words[r]=i/e|0,n=i%e}return this._strip(),t?this.ineg():this},BN.prototype.divn=function divn(e){return this.clone().idivn(e)},BN.prototype.egcd=function egcd(e){assert(e.negative===0),assert(!e.isZero());var t=this,n=e.clone();t=t.negative===0?t.clone():t.umod(e);for(var r=new BN(1),i=new BN(0),o=new BN(0),s=new BN(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var p=n.clone(),m=t.clone();!t.isZero();){for(var h=0,g=1;(t.words[0]&g)===0&&h<26;++h,g<<=1);if(h>0)for(t.iushrn(h);h-->0;)(r.isOdd()||i.isOdd())&&(r.iadd(p),i.isub(m)),r.iushrn(1),i.iushrn(1);for(var _=0,v=1;(n.words[0]&v)===0&&_<26;++_,v<<=1);if(_>0)for(n.iushrn(_);_-->0;)(o.isOdd()||s.isOdd())&&(o.iadd(p),s.isub(m)),o.iushrn(1),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),r.isub(o),i.isub(s)):(n.isub(t),o.isub(r),s.isub(i))}return{a:o,b:s,gcd:n.iushln(c)}},BN.prototype._invmp=function _invmp(e){assert(e.negative===0),assert(!e.isZero());var t=this,n=e.clone();t=t.negative===0?t.clone():t.umod(e);for(var r=new BN(1),i=new BN(0),o=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var s=0,c=1;(t.words[0]&c)===0&&s<26;++s,c<<=1);if(s>0)for(t.iushrn(s);s-->0;
vendor: 9,431 bytes, line 212
212)r.isOdd()&&r.iadd(o),r.iushrn(1);for(var p=0,m=1;(n.words[0]&m)===0&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-->0;)i.isOdd()&&i.iadd(o),i.iushrn(1);t.cmp(n)>=0?(t.isub(n),r.isub(i)):(n.isub(t),i.isub(r))}var h=t.cmpn(1)===0?r:i;return h.cmpn(0)<0&&h.iadd(e),h},BN.prototype.gcd=function gcd(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);do{for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(i===0||n.cmpn(1)===0)break;t.isub(n)}while(!0);return n.iushln(r)},BN.prototype.invm=function invm(e){return this.egcd(e).a.umod(e)},BN.prototype.isEven=function isEven(){return!(this.words[0]&1)},BN.prototype.isOdd=function isOdd(){return(this.words[0]&1)==1},BN.prototype.andln=function andln(e){return this.words[0]&e},BN.prototype.bincn=function bincn(e){assert(typeof e==`number`);var t=e%26,n=(e-t)/26,r=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=r,this;for(var i=r,o=n;i!==0&&o<this.length;o++){var s=this.words[o]|0;s+=i,i=s>>>26,s&=67108863,this.words[o]=s}return i!==0&&(this.words[o]=i,this.length++),this},BN.prototype.isZero=function isZero(){return this.length===1&&this.words[0]===0},BN.prototype.cmpn=function cmpn(e){var t=e<0;if(this.negative!==0&&!t)return-1;if(this.negative===0&&t)return 1;this._strip();var n;if(this.length>1)n=1;else{t&&(e=-e),assert(e<=67108863,`Number is too big`);var r=this.words[0]|0;n=r===e?0:r<e?-1:1}return this.negative===0?n:-n|0},BN.prototype.cmp=function cmp(e){if(this.negative!==0&&e.negative===0)return-1;if(this.negative===0&&e.negative!==0)return 1;var t=this.ucmp(e);return this.negative===0?t:-t|0},BN.prototype.ucmp=function ucmp(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=this.words[n]|0,i=e.words[n]|0;if(r!==i){r<i?t=-1:r>i&&(t=1);break}}return t},BN.prototype.gtn=function gtn(e){return this.cmpn(e)===1},BN.prototype.gt=function gt(e){return this.cmp(e)===1},BN.prototype.gten=function gten(e){return this.cmpn(e)>=0},BN.prototype.gte=function gte(e){return this.cmp(e)>=0},BN.prototype.ltn=function ltn(e){return this.cmpn(e)===-1},BN.prototype.lt=function lt(e){return this.cmp(e)===-1},BN.prototype.lten=function lten(e){return this.cmpn(e)<=0},BN.prototype.lte=function lte(e){return this.cmp(e)<=0},BN.prototype.eqn=function eqn(e){return this.cmpn(e)===0},BN.prototype.eq=function eq(e){return this.cmp(e)===0},BN.red=function red(e){return new Red(e)},BN.prototype.toRed=function toRed(e){return assert(!this.red,`Already a number in reduction context`),assert(this.negative===0,`red works only with positives`),e.convertTo(this)._forceRed(e)},BN.prototype.fromRed=function fromRed(){return assert(this.red,`fromRed works only with numbers in reduction context`),this.red.convertFrom(this)},BN.prototype._forceRed=function _forceRed(e){return this.red=e,this},BN.prototype.forceRed=function forceRed(e){return assert(!this.red,`Already a number in reduction context`),this._forceRed(e)},BN.prototype.redAdd=function redAdd(e){return assert(this.red,`redAdd works only with red numbers`),this.red.add(this,e)},BN.prototype.redIAdd=function redIAdd(e){return assert(this.red,`redIAdd works only with red numbers`),this.red.iadd(this,e)},BN.prototype.redSub=function redSub(e){return assert(this.red,`redSub works only with red numbers`),this.red.sub(this,e)},BN.prototype.redISub=function redISub(e){return assert(this.red,`redISub works only with red numbers`),this.red.isub(this,e)},BN.prototype.redShl=function redShl(e){return assert(this.red,`redShl works only with red numbers`),this.red.shl(this,e)},BN.prototype.redMul=function redMul(e){return assert(this.red,`redMul works only with red numbers`),this.red._verify2(this,e),this.red.mul(this,e)},BN.prototype.redIMul=function redIMul(e){return assert(this.red,`redMul works only with red numbers`),this.red._verify2(this,e),this.red.imul(this,e)},BN.prototype.redSqr=function redSqr(){return assert(this.red,`redSqr works only with red numbers`),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function redISqr(){return assert(this.red,`redISqr works only with red numbers`),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function redSqrt(){return assert(this.red,`redSqrt works only with red numbers`),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function redInvm(){return assert(this.red,`redInvm works only with red numbers`),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function redNeg(){return assert(this.red,`redNeg works only with red numbers`),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function redPow(e){return assert(this.red&&!e.red,`redPow(normalNum)`),this.red._verify1(this),this.red.pow(this,e)};var p={k256:null,p224:null,p192:null,p25519:null};function MPrime(e,t){this.name=e,this.p=new BN(t,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}MPrime.prototype._tmp=function _tmp(){var e=new BN(null);return e.words=Array(Math.ceil(this.n/13)),e},MPrime.prototype.ireduce=function ireduce(e){var t=e,n;do this.split(t,this.tmp),t=this.imulK(t),t=t.iadd(this.tmp),n=t.bitLength();while(n>this.n);var r=n<this.n?-1:t.ucmp(this.p);return r===0?(t.words[0]=0,t.length=1):r>0?t.isub(this.p):t.strip===void 0?t._strip():t.strip(),t},MPrime.prototype.split=function split(e,t){e.iushrn(this.n,0,t)},MPrime.prototype.imulK=function imulK(e){return e.imul(this.k)};function K256(){MPrime.call(this,`k256`,`ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f`)}inherits(K256,MPrime),K256.prototype.split=function split(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9){e.words[0]=0,e.length=1;return}var o=e.words[9];for(t.words[t.length++]=o&n,i=10;i<e.length;i++){var s=e.words[i]|0;e.words[i-10]=(s&n)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,o===0&&e.length>10?e.length-=10:e.length-=9},K256.prototype.imulK=function imulK(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=e.words[n]|0;t+=r*977,e.words[n]=t&67108863,t=r*64+(t/67108864|0)}return e.words[e.length-1]===0&&(e.length--,e.words[e.length-1]===0&&e.length--),e};function P224(){MPrime.call(this,`p224`,`ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001`)}inherits(P224,MPrime);function P192(){MPrime.call(this,`p192`,`ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff`)}inherits(P192,MPrime);function P25519(){MPrime.call(this,`25519`,`7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed`)}inherits(P25519,MPrime),P25519.prototype.imulK=function imulK(e){for(var t=0,n=0;n<e.length;n++){var r=(e.words[n]|0)*19+t,i=r&67108863;r>>>=26,e.words[n]=i,t=r}return t!==0&&(e.words[e.length++]=t),e},BN._prime=function prime(e){if(p[e])return p[e];var t;if(e===`k256`)t=new K256;else if(e===`p224`)t=new P224;else if(e===`p192`)t=new P192;else if(e===`p25519`)t=new P25519;else throw Error(`Unknown prime `+e);return p[e]=t,t};function Red(e){if(typeof e==`string`){var t=BN._prime(e);this.m=t.p,this.prime=t}else assert(e.gtn(1),`modulus must be greater than 1`),this.m=e,this.prime=null}Red.prototype._verify1=function _verify1(e){assert(e.negative===0,`red works only with positives`),assert(e.red,`red works only with red numbers`)},Red.prototype._verify2=function _verify2(e,t){assert((e.negative|t.negative)===0,`red works only with positives`),assert(e.red&&e.red===t.red,`red works only with red numbers`)},Red.prototype.imod=function imod(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(move(e,e.umod(this.m)._forceRed(this)),e)},Red.prototype.neg=function neg(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},Red.prototype.add=function add(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},Red.prototype.iadd=function iadd(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},Red.prototype.sub=function sub(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},Red.prototype.isub=function isub(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},Red.prototype.shl=function shl(e,t){return this._verify1(e),this.imod(e.ushln(t))},Red.prototype.imul=function imul(e,t){return this._verify2(e,t),this.imod(e.imul(t))},Red.prototype.mul=function mul(e,t){return this._verify2(e,t),this.imod(e.mul(t))},Red.prototype.isqr=function isqr(e){return this.imul(e,e.clone())},Red.prototype.sqr=function sqr(e){return this.mul(e,e)},Red.prototype.sqrt=function sqrt(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(assert(t%2==1),t===3){var n=this.m.add(new BN(1)).iushrn(2);return this.pow(e,n)}for(var r=this.m.subn(1),i=0;!r.isZero()&&r.andln(1)===0;)i++,r.iushrn(1);assert(!r.isZero());var o=new BN(1).toRed(this),s=o.redNeg(),c=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new BN(2*p*p).toRed(this);this.pow(p,c).cmp(s)!==0;)p.redIAdd(s);for(var m=this.pow(p,r),h=this.pow(e,r.addn(1).iushrn(1)),g=this.pow(e,r),_=i;g.cmp(o)!==0;){for(var v=g,y=0;v.cmp(o)!==0;y++)v=v.redSqr();assert(y<_);var b=this.pow(m,new BN(1).iushln(_-y-1));h=h.redMul(b),m=b.redSqr(),g=g.redMul(m),_=y}
212return h},Red.prototype.invm=function invm(e){var t=e._invmp(this.m);return t.negative===0?this.imod(t):(t.negative=0,this.imod(t).redNeg())},Red.prototype.pow=function pow(e,t){if(t.isZero())return new BN(1).toRed(this);if(t.cmpn(1)===0)return e.clone();var n=4,r=Array(1<<n);r[0]=new BN(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var o=r[0],s=0,c=0,p=t.bitLength()%26;for(p===0&&(p=26),i=t.length-1;i>=0;i--){for(var m=t.words[i],h=p-1;h>=0;h--){var g=m>>h&1;if(o!==r[0]&&(o=this.sqr(o)),g===0&&s===0){c=0;continue}s<<=1,s|=g,c++,(c===n||i===0&&h===0)&&(o=this.mul(o,r[s]),c=0,s=0)}p=26}return o},Red.prototype.convertTo=function convertTo(e){var t=e.umod(this.m);return t===e?t.clone():t},Red.prototype.convertFrom=function convertFrom(e){var t=e.clone();return t.red=null,t},BN.mont=function mont(e){return new Mont(e)};function Mont(e){Red.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(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)}inherits(Mont,Red),Mont.prototype.convertTo=function convertTo(e){return this.imod(e.ushln(this.shift))},Mont.prototype.convertFrom=function convertFrom(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},Mont.prototype.imul=function imul(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},Mont.prototype.mul=function mul(e,t){if(e.isZero()||t.isZero())return new BN(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},Mont.prototype.invm=function invm(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}})(t===void 0||t,e)})),YS=r(((e,t)=>{(function(){var e=`input is invalid type`,n=typeof window==`object`,r=n?window:{};
212r.JS_SHA1_NO_WINDOW&&(n=!1);var i=!n&&typeof self==`object`,o=!r.JS_SHA1_NO_NODE_JS&&typeof process==`object`&&process.versions&&process.versions.node;o?r=global:i&&(r=self);var s=!r.JS_SHA1_NO_COMMON_JS&&typeof t==`object`&&t.exports,c=typeof define==`function`&&define.amd,p=!r.JS_SHA1_NO_ARRAY_BUFFER&&typeof ArrayBuffer<`u`,m=`0123456789abcdef`.split(``),h=[-2147483648,8388608,32768,128],g=[24,16,8,0],_=[`hex`,`array`,`digest`,`arrayBuffer`],v=[],isArray=Array.isArray;(r.JS_SHA1_NO_NODE_JS||!isArray)&&(isArray=function(e){return Object.prototype.toString.call(e)===`[object Array]`});var isView=ArrayBuffer.isView;p&&(r.JS_SHA1_NO_ARRAY_BUFFER_IS_VIEW||!isView)&&(isView=function(e){return typeof e==`object`&&e.buffer&&e.buffer.constructor===ArrayBuffer});var formatMessage=function(t){var n=typeof t;if(n===`string`)return[t,!0];if(n!==`object`||t===null)throw Error(e);if(p&&t.constructor===ArrayBuffer)return[new Uint8Array(t),!1];if(!isArray(t)&&!isView(t))throw Error(e);return[t,!1]},createOutputMethod=function(e){return function(t){return new Sha1(!0).update(t)[e]()}},createMethod=function(){var e=createOutputMethod(`hex`);o&&(e=nodeWrap(e)),e.create=function(){return new Sha1},e.update=function(t){return e.create().update(t)};for(var t=0;t<_.length;++t){var n=_[t];e[n]=createOutputMethod(n)}return e},nodeWrap=function(t){var n=Xe(),i=Xe().Buffer,o=i.from&&!r.JS_SHA1_NO_BUFFER_FROM?i.from:function(e){return new i(e)},nodeMethod=function(r){if(typeof r==`string`)return n.createHash(`sha1`).update(r,`utf8`).digest(`hex`);if(r==null)throw Error(e);return r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),isArray(r)||isView(r)||r.constructor===i?n.createHash(`sha1`).update(o(r)).digest(`hex`):t(r)};return nodeMethod},createHmacOutputMethod=function(e){return function(t,n){return new HmacSha1(t,!0).update(n)[e]()}},createHmacMethod=function(){var e=createHmacOutputMethod(`hex`);e.create=function(e){return new HmacSha1(e)},e.update=function(t,n){return e.create(t).update(n)};for(var t=0;t<_.length;++t){var n=_[t];e[n]=createHmacOutputMethod(n)}return e};function Sha1(e){e?(v[0]=v[16]=v[1]=v[2]=v[3]=v[4]=v[5]=v[6]=v[7]=v[8]=v[9]=v[10]=v[11]=v[12]=v[13]=v[14]=v[15]=0,this.blocks=v):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=1732584193,this.h1=4023233417,this.h2=2562383102,this.h3=271733878,this.h4=3285377520,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}Sha1.prototype.update=function(e){if(this.finalized)throw Error(`finalize already called`);var t=formatMessage(e);e=t[0];for(var n=t[1],r,i=0,o,s=e.length||0,c=this.blocks;i<s;){if(this.hashed&&(this.hashed=!1,c[0]=this.block,this.block=c[16]=c[1]=c[2]=c[3]=c[4]=c[5]=c[6]=c[7]=c[8]=c[9]=c[10]=c[11]=c[12]=c[13]=c[14]=c[15]=0),n)for(o=this.start;i<s&&o<64;++i)r=e.charCodeAt(i),r<128?c[o>>>2]|=r<<g[o++&3]:r<2048?(c[o>>>2]|=(192|r>>>6)<<g[o++&3],c[o>>>2]|=(128|r&63)<<g[o++&3]):r<55296||r>=57344?(c[o>>>2]|=(224|r>>>12)<<g[o++&3],c[o>>>2]|=(128|r>>>6&63)<<g[o++&3],c[o>>>2]|=(128|r&63)<<g[o++&3]):(r=65536+((r&1023)<<10|e.charCodeAt(++i)&1023),c[o>>>2]|=(240|r>>>18)<<g[o++&3],c[o>>>2]|=(128|r>>>12&63)<<g[o++&3],c[o>>>2]|=(128|r>>>6&63)<<g[o++&3],c[o>>>2]|=(128|r&63)<<g[o++&3]);else for(o=this.start;i<s&&o<64;++i)c[o>>>2]|=e[i]<<g[o++&3];this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=c[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes%=4294967296),this},Sha1.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=h[t&3],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},Sha1.prototype.hash=function(){var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4,o,s,c,p=this.blocks;for(s=16;s<80;++s)c=p[s-3]^p[s-8]^p[s-14]^p[s-16],p[s]=c<<1|c>>>31;for(s=0;s<20;s+=5)o=t&n|~t&r,c=e<<5|e>>>27,i=c+o+i+1518500249+p[s]<<0,t=t<<30|t>>>2,o=e&t|~e&n,c=i<<5|i>>>27,r=c+o+r+1518500249+p[s+1]<<0,e=e<<30|e>>>2,o=i&e|~i&t,c=r<<5|r>>>27,n=c+o+n+1518500249+p[s+2]<<0,i=i<<30|i>>>2,o=r&i|~r&e,c=n<<5|n>>>27,t=c+o+t+1518500249+p[s+3]<<0,r=r<<30|r>>>2,o=n&r|~n&i,c=t<<5|t>>>27,e=c+o+e+1518500249+p[s+4]<<0,n=n<<30|n>>>2;for(;s<40;s+=5)o=t^n^r,c=e<<5|e>>>27,i=c+o+i+1859775393+p[s]<<0,t=t<<30|t>>>2,o=e^t^n,c=i<<5|i>>>27,r=c+o+r+1859775393+p[s+1]<<0,e=e<<30|e>>>2,o=i^e^t,c=r<<5|r>>>27,n=c+o+n+1859775393+p[s+2]<<0,i=i<<30|i>>>2,o=r^i^e,c=n<<5|n>>>27,t=c+o+t+1859775393+p[s+3]<<0,r=r<<30|r>>>2,o=n^r^i,c=t<<5|t>>>27,e=c+o+e+1859775393+p[s+4]<<0,n=n<<30|n>>>2;for(;s<60;s+=5)o=t&n|t&r|n&r,c=e<<5|e>>>27,i=c+o+i-1894007588+p[s]<<0,t=t<<30|t>>>2,o=e&t|e&n|t&n,c=i<<5|i>>>27,r=c+o+r-1894007588+p[s+1]<<0,e=e<<30|e>>>2,o=i&e|i&t|e&t,c=r<<5|r>>>27,n=c+o+n-1894007588+p[s+2]<<0,i=i<<30|i>>>2,o=r&i|r&e|i&e,c=n<<5|n>>>27,t=c+o+t-1894007588+p[s+3]<<0,r=r<<30|r>>>2,o=n&r|n&i|r&i,c=t<<5|t>>>27,e=c+o+e-1894007588+p[s+4]<<0,n=n<<30|n>>>2;for(;s<80;s+=5)o=t^n^r,c=e<<5|e>>>27,i=c+o+i-899497514+p[s]<<0,t=t<<30|t>>>2,o=e^t^n,c=i<<5|i>>>27,r=c+o+r-899497514+p[s+1]<<0,e=e<<30|e>>>2,o=i^e^t,c=r<<5|r>>>27,n=c+o+n-899497514+p[s+2]<<0,i=i<<30|i>>>2,o=r^i^e,c=n<<5|n>>>27,t=c+o+t-899497514+p[s+3]<<0,r=r<<30|r>>>2,o=n^r^i,c=t<<5|t>>>27,e=c+o+e-899497514+p[s+4]<<0,n=n<<30|n>>>2;this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+r<<0,this.h4=this.h4+i<<0},Sha1.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4;return m[e>>>28&15]+m[e>>>24&15]+m[e>>>20&15]+m[e>>>16&15]+m[e>>>12&15]+m[e>>>8&15]+m[e>>>4&15]+m[e&15]+m[t>>>28&15]+m[t>>>
21224&15]+m[t>>>20&15]+m[t>>>16&15]+m[t>>>12&15]+m[t>>>8&15]+m[t>>>4&15]+m[t&15]+m[n>>>28&15]+m[n>>>24&15]+m[n>>>20&15]+m[n>>>16&15]+m[n>>>12&15]+m[n>>>8&15]+m[n>>>4&15]+m[n&15]+m[r>>>28&15]+m[r>>>24&15]+m[r>>>20&15]+m[r>>>16&15]+m[r>>>12&15]+m[r>>>8&15]+m[r>>>4&15]+m[r&15]+m[i>>>28&15]+m[i>>>24&15]+m[i>>>20&15]+m[i>>>16&15]+m[i>>>12&15]+m[i>>>8&15]+m[i>>>4&15]+m[i&15]},Sha1.prototype.toString=Sha1.prototype.hex,Sha1.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4;return[e>>>24&255,e>>>16&255,e>>>8&255,e&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255]},Sha1.prototype.array=Sha1.prototype.digest,Sha1.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(20),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),e};function HmacSha1(e,t){var n,r=formatMessage(e);if(e=r[0],r[1]){var i=[],o=e.length,s=0,c;for(n=0;n<o;++n)c=e.charCodeAt(n),c<128?i[s++]=c:c<2048?(i[s++]=192|c>>>6,i[s++]=128|c&63):c<55296||c>=57344?(i[s++]=224|c>>>12,i[s++]=128|c>>>6&63,i[s++]=128|c&63):(c=65536+((c&1023)<<10|e.charCodeAt(++n)&1023),i[s++]=240|c>>>18,i[s++]=128|c>>>12&63,i[s++]=128|c>>>6&63,i[s++]=128|c&63);e=i}e.length>64&&(e=new Sha1(!0).update(e).array());var p=[],m=[];for(n=0;n<64;++n){var h=e[n]||0;p[n]=92^h,m[n]=54^h}Sha1.call(this,t),this.update(m),this.oKeyPad=p,this.inner=!0,this.sharedMemory=t}HmacSha1.prototype=new Sha1,HmacSha1.prototype.finalize=function(){if(Sha1.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();Sha1.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(e),Sha1.prototype.finalize.call(this)}};var y=createMethod();y.sha1=y,y.sha1.hmac=createHmacMethod(),s?t.exports=y:(r.sha1=y,c&&define(function(){return y}))})()})),XS=n(JS()),ZS=YS(),QS={generateClientKeys(e,t,n,r,i,o){let s=new XS.default(o,16),c=new XS.default(n,16);if(s.mod(c).isZero())throw Error(`B == 0 mod N`);let p=new XS.default(r,16),m=new XS.default(i,16),h=XS.default.red(c),g=p.toRed(h),_=new XS.default(random()),v=g.redPow(_).fromRed(),y=new XS.default(SHA1(concat(pad(v,c),pad(s,c))));if(y.isZero())throw Error(`u == 0`);let b=new XS.default(derive(m,e,t)),x=new XS.default(SHA1(concat(c,pad(p,c)))).toRed(h),S=pad(s.toRed(h).redSub(x.redMul(g.redPow(b))).redPow(_.add(y.mul(b))).fromRed(),c),C=new XS.default(SHA1(concat(v,concat(s,S))));return{A:v.toString(16,2),M1:C.toString(16,2),K:new XS.default(S).toString(16,2)}}};function textEncode(e){if(TextEncoder)return new TextEncoder().encode(e);let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function SHA1(e){typeof e==`string`&&(e=textEncode(e)),XS.default.isBN(e)&&(e=Uint8Array.from(e.toArray(`be`)));let t=ZS.sha1.array(e);return new Uint8Array(t)}function concat(e,t,n){XS.default.isBN(e)&&(e=n?Uint8Array.from(e.toArray(`be`,32)):Uint8Array.from(e.toArray(`be`))),XS.default.isBN(t)&&(t=Uint8Array.from(t.toArray(`be`)));let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function concatSalt(e,t){return concat(e,t,!0)}function pad(e,t){return Uint8Array.from(e.toArray(`be`,t.byteLength()))}function derive(e,t,n){return SHA1(concatSalt(e,SHA1(`${t}:${n}`)))}function random(){return crypto.getRandomValues(new Uint8Array(32))}function toHex(e){return Buffer.from(e).toString(`hex`)}function calcSaltAndVerifier({N:e,g:t,I:n,password:r}){let i=new XS.default(e,16),o=new XS.default(t,16),s=n,c=random(),p=XS.default.red(i),m=o.toRed(p),h=SHA1(`${s}:${r}`),g=new XS.default(SHA1(concatSalt(c,h))),_=pad(m.redPow(g),i);return{salt:toHex(c),verifier:toHex(_)}}var $S=`refresh_auth_token`,AuthenticatedConnection=class extends Connection{authData=null;sessionsManager=new FakeSessionsManager;sessionName=``;originalAuthConCallbacks={};logoutDeferred=new du;loggerName=`AuthenticatedConnection`;init({callbacks:e,getConnectionDetails:t,plugins:n,keepAlive:r}
212){this.getConnectionDetails=t,this.originalAuthConCallbacks=e,this.sessionsManager=n.sessionsManager,this.keepAliveConfig=r,this.callbacks={...e,onDisconnect:this.onDisconnectCallback.bind(this),onRequestError:this.onRequestError.bind(this)}}onDisconnectCallback(e,t){this.log(`onDisconnectCallback() ${t}`),this.clearAuthData(),this.originalAuthConCallbacks.onDisconnect?.(this.details,t),(t===`logout`||t===`session_drop`||t===`Stream end encountered`)&&(this.logoutDeferred.resolve(!0),this.originalAuthConCallbacks.onLogout?.(t))}async onLogin(e){this.log(`onLogin()`),this.originalAuthConCallbacks.onLogin?.(this.details)}onLoginToSubaccount(){this.originalAuthConCallbacks.onLoginToSubaccount?.(this.details)}onAnonymous(e){this.log(`onAnonymous()`),this.originalAuthConCallbacks.onAnonymous?.(this.details)}async onUnauthorized(e,t){let n;try{n=await this.originalAuthConCallbacks.onUnauthorized?.(this.details,t)}catch(e){console.log(`onUnauthorizedError callback error: `,e)}finally{(n===void 0||!n?.stayLoggedIn)&&await this.logoutOnUnauthorized(t)}}onRequestError(e){e.response?.error?.code===13009&&this.onUnauthorized?.(this.details,e.response.error),this.originalAuthConCallbacks.onRequestError?.({...e,details:this.details})}getAuthData=()=>this.authData;getRestApiEndpoint(){return this.details.restEndpoint}clearAuthData=()=>{this.authData=null};getScopeStringFromAuthData=()=>this.authData?.scope?this.authData.scope:null;async restoreSession(e){this.log(`restoreSession()`);let t=null,n=null;try{t=e?await this.sessionsManager.getSessionDataByName(e):await this.sessionsManager.getCurrentSessionData(),n=await this.sessionsManager.getLatestSessionData()}catch(e){console.log(`restoreSession error`,e)}if(t)try{this.sessionName=t[0];let n=await this.refreshAuthToken(t[1]);return await this.handleTokens(n,{sessionNameToSet:e}),{sessionRestored:!0,sessionRecreated:!1,error:``}}catch(e){console.log(`current session`,e)}if(n)try{let e=await this.forkTokens(n[1].refresh_token);return await this.handleTokens(e),{sessionRecreated:!0,sessionRestored:!1,error:``}}catch(e){console.log(`latest other session`,e)}return{sessionRestored:!1,sessionRecreated:!1,error:`no session to restore nor recreate or invalid refresh_token`}}loginRest(e){return fetch(this.getRestApiEndpoint(),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({method:`public/login`,params:{...e}})}).then(e=>e.json()).then(e=>{if(e?.error)throw e.error;return e.result})}sendMessage(e,t,n){let r=e.includes(`private`)&&this.getAuthData()===null;return super.sendMessage(e,t,{...n,postponeSending:r})}async login(e){return this.sendMessage(`public/login`,e)}loginHello(e){return this.loginRest({request:`hello`,...e})}async loginAuthenticate(e){this.sessionName=Ue();let t=`session:${this.sessionName}`,n={scope:e.scope?`${t} ${e.scope}`:t,request:`authenticate`,challenge:e.challenge};if(e.lsk&&(n.lsk=e.lsk),e.authorization_data&&(n.authorization_data=e.authorization_data),e.type===`password`)n.password=e.password;else{let{I:t,password:r,N:i,g:o,s,B:c}=e,{A:p,M1:m}=QS.generateClientKeys(t,r,i,o,s,c);Object.assign(n,{A:p,M1:m})}try{let e=await this.loginRest({...n});if(`refresh_token`in e)return await this.handleTokens(e,{callOnLogin:!0}),`ok`;console.log(`unexpected reponse`,e)}catch(e){return Promise.reject(e)}}async loginByApiKey(e){this.sessionName=Ue();let t=`session:${this.sessionName}`,n={...e,grant_type:`client_credentials`,scope:e.scope?`${t} ${e.scope}`:t};try{let e=await this.sendMessage(`public/auth`,n);if(!e.scope.includes(`account:read`))throw Error(`insufficient_scopes`);await this.handleTokens(e,{callOnLogin:!0})}catch(e){throw console.log(e,`refresh auth token failed`),e}}async loginProxy(e){this.sessionName=Ue();let t=`session:${this.sessionName}`,n={...e,grant_type:`client_credentials`,scope:e.scope?`${t} ${e.scope}`:t};try{let e=await this.sendMessage(`public/auth`,n);if(!e.scope.includes(`account:read`))throw Error(`insufficient_scopes`);await this.handleTokens(e,{callOnLogin:!0})}catch(e){throw console.log(e,`refresh auth token failed`),e}}async getOktaRedirectUrl(e){try{let t=await this.sendMessage(`public/get_identity_provider_redirect_url`,e);return this.sessionsManager.setOktaAuthData({pkce_code:t.pkce_code,state_code:t.state_code,provider:e.provider}),t.redirect_url}catch(e){throw console.error(e),e}}async authByOkta(e){this.sessionName=Ue();let t=`session:${this.sessionName}`;try{let n=this.sessionsManager.getOktaAuthData();if(!n||e.state_code!==n.state_code)throw Error(`Authorization failed`);let r=await this.sendMessage(`public/get_identity_provider_oauth_token`,{pkce_code:n.pkce_code,authorization_code:e.authorization_code,scope:e.scope?`${t} ${e.scope}`:t,provider:n.provider});if(!r)return{success:!1};console.log(`login by okta`),this.handleTokens(r,{callOnLogin:!0})}catch(e){throw console.error(e),Error(`Authorization failed`,{cause:e})}finally{this.sessionsManager.removeOktaAuthData()}}async loginWithRatGateway(e,t=`coinbase_session`){let n=await this.sendMessage(`public/auth`,{grant_type:t,token:e});if(n.scope){let e=new Set(n.scope.split(` `)),t=[];e.has(`wallet:buys:create`)&&t.push(`trade:read_write`),e.has(`wallet:accounts:read`)&&t.push(`account:read`),n.scope=t.join(` `)}this.authData=n,this.onLogin(this.details)}async getOAuthToken(e){try{this.sessionName=Ue();let t=`session:${this.sessionName}`,n=await this.sendMessage(`public/get_oauth_token`,{...e,scope:e.scope?`${t} ${e.scope}`:t});return n.access_token&&await this.handleTokens(n,{callOnLogin:!0}),n}catch(e){throw console.error(e),e}}async registerViaOAuth(e){this.sessionName=Ue();let t=`session:${this.sessionName}`;return await this.sendMessage(`public/register_via_oauth`,{...e,scope:e.scope?`${t} ${e.scope}`:t})}logout(){return this.doLogout()}async doLogout(){this.logoutDeferred=new du;let e=[];try{e=await this.sessionsManager.getSessionIdsToInvalidate(),await this.sessionsManager.removeSessionsData()}catch(e){console.log(`_logout, sessionsManager error`,e)}return this.authData?(this.sendMessage(`private/logout`,{session_names:e},{timeout:0}).then(()=>{this.originalAuthConCallbacks.onLogout?.(`logout`)}).catch(e=>{this.logoutDeferred.reject(e)}),this.logoutDeferred.promise):Promise.resolve(!0)}async logoutOnUnauthorized({data:e}){let t=e?.reason;if(this.log(`logoutOnUnauthorized() ${t??`-`}
212`),t===`session_not_found`||t===`invalid_token`){console.log(`%c = unauthorized logout =`,`color: darkorange`,{reason:e?.reason});try{await this.sessionsManager.removeSessionData(this.sessionName)}catch(e){console.log(`removeSessionData error`,e)}this.originalAuthConCallbacks.onLogout?.(),this.disconnect()}}async forkTokens(e){this.log(`forkTokens()`);try{await this.sessionsManager.removeExpiredSessionsData()}catch(e){console.log(`removeExpiredSessionsData error`,e)}return this.sessionName=Ue(),this.sendMessage(`public/fork_token`,{session_name:this.sessionName,refresh_token:e})}async handleTokens(e,{callOnLogin:t,callOnLoginToSubaccount:n,sessionNameToSet:r}={}){if(this.log(`handleTokens()`),e?.access_token){try{let t=r??this.sessionName;await this.sessionsManager.setSessionData(t,e)}catch(e){console.log(`setSessionData error`,e)}this.authData=e;try{await this.sendMessage(`public/bind_access_token`,{access_token:this.authData.access_token}),this.timer.set($S,`interval`,async()=>{if(this.authData){let e=await this.refreshAuthToken(this.authData);this.handleTokens(e)}},Math.min(this.authData.expires_in/2*1e3,216e5)),t&&this.onLogin(this.details),n&&this.onLoginToSubaccount()}catch(e){console.log(`handleTokens error`,e)}}}async refreshAuthToken(e){return this.log(`refreshAuthToken()`),this.timer.clear($S),this.refreshToken(e.refresh_token)}async loginToSubaccount({accountId:e}){try{let t=this.authData?.refresh_token;if(t){let n=await this.exchangeToken(t,e);this.handleTokens(n,{callOnLoginToSubaccount:!0})}}catch(e){console.log(e,`exchange token failed`)}}async refreshToken(e){return this.sendMessage(`public/auth`,{grant_type:`refresh_token`,refresh_token:e})}async exchangeToken(e,t){return this.sendMessage(`public/exchange_token`,{refresh_token:e,subject_id:t})}async activateSecurityKey(e){let t=await this.sendMessage(`private/activate_security_key`,e,{timeout:1e4});return t?.refresh_token&&this.handleTokens(t),t}async activateSecurityKeyForOAuthRegistration(e){return await this.sendMessage(`public/activate_security_key_for_oauth_registration`,e,{timeout:1e4})}async changePassword(e){let t=await this.sendMessage(`private/change_password`,e);return t.challenge||await this.handleTokens(t),t}async fetch(e){return super.fetch({baseUrl:this.getRestApiEndpoint(),headers:{Authorization:`Bearer ${this.getAuthData()?.access_token||``}`},...e})}},eC=`incremental_ticker.`,IncrementalTickerHandler=class{mergedTickers={};process({channel:e,data:t}){let n=this.getInstrument(e),r=this.mergedTickers[n],i=t.type===`change`;if(!r&&i)return;let o=bf(r||{},t);return this.mergedTickers[n]=o,this.mergedTickers[n]}getForInstrument(e){return this.mergedTickers[e]}remove(e){if(!e.startsWith(eC))return;let t=this.getInstrument(e);delete this.mergedTickers[t]}clear(){this.mergedTickers={}}getInstrument(e){return e.split(`.`)[1]}},SubscriptionOrderBookHandler=class{orderBooks={};process(e){let{channel:t,data:n}=e;this.orderBooks[t]||(this.orderBooks[t]={bids:Ff(),asks:Ff(),prevChangeId:n.prev_change_id,changeId:n.change_id,aggregatedVolumes:Nf()});let r=this.orderBooks[t];if(!n.prev_change_id)r.asks=Ff(n.asks.map(e=>e.slice(1,3)),(e,t)=>e>t?1:e<t?-1:0),r.bids=Ff(n.bids.map(e=>e.slice(1,3)),(e,t)=>e>t?-1:+(e<t));else if(r.changeId===n.prev_change_id)[`bids`,`asks`].forEach(e=>{n[e]&&n[e].length>0&&n[e].forEach(([t,n,i])=>{t===`delete`?r[e]=r[e].delete(n):r[e]=r[e].set(n,i)})});else throw console.log({channel:t,data:n,currentOrderBook:r,orderBooks:this.orderBooks}),Error(`Wrong Frame`);let i=0,o=r.bids.map(e=>(i+=e,i));i=0;let s=r.asks.map(e=>(i+=e,i));return r.aggregatedVolumes=o.merge(s),r.prevChangeId=n.prev_change_id,r.changeId=n.change_id,{...r}}remove(e){delete this.orderBooks[e]}clear(){this.orderBooks={}}},tC=`AGGREGATE_SUB_UNSUB`,nC=10,rC=`incremental_ticker.`;function isIncrementalTickerChannel(e){return e.startsWith(rC)}var SubscriptionManager=class{requiredSubscriptions={};channelsPendingToSubscribe=new Set;channelsPendingToUnsubscribe=new Set;channelsBeingUnsubscribed=new Set;channelsAlreadySubscribed=new Set;connection;subscriptionOrderBookHandler;incrementalTickerHandler;timer=new Pe;cache={};constructor(e){this.connection=e,this.subscriptionOrderBookHandler=new SubscriptionOrderBookHandler,this.incrementalTickerHandler=new IncrementalTickerHandler,this.subscribe=this.subscribe.bind(this),this.unsubscribe=this.unsubscribe.bind(this)}getState(){return{requiredSubscriptions:this.requiredSubscriptions,channelsPendingToSubscribe:this.channelsPendingToSubscribe,channelsPendingToUnsubscribe:this.channelsPendingToUnsubscribe,channelsAlreadySubscribed:this.channelsAlreadySubscribed}}clearCache(){this.channelsAlreadySubscribed=new Set,this.channelsBeingUnsubscribed=new Set,this.cache={},this.subscriptionOrderBookHandler.clear(),this.incrementalTickerHandler.clear(),this.timer.clear(tC)}isConnectionAuthenticated(){return`getAuthData`in this.connection&&!!this.connection.getAuthData()}async subscribeApi(e){if(e.length>0){let t=uu(e,400);return Promise.all(t.map(e=>this.connection.sendMessage(this.isConnectionAuthenticated()?`private/subscribe`:`public/subscribe`,{channels:e}))).then(e=>e.flatMap(e=>e.map(e=>
212({channel:e,wsDetails:this.connection.getParams()}))))}return Promise.resolve([])}unsubscribeApi(e){if(e.length>0){let t=uu(e,400);return Promise.all(t.map(e=>this.connection.sendMessage(this.isConnectionAuthenticated()?`private/unsubscribe`:`public/unsubscribe`,{channels:e}))).then(e=>e.flatMap(e=>e.map(e=>({channel:e,wsDetails:this.connection.getParams()}))))}return Promise.resolve([])}async forceResubscribe(e){console.log(`Forcing resubscribe to: "${e}"`),await this.unsubscribeApi([e]),await this.subscribeApi([e])}handleSubscribeAggregation(e,t){t===`subscribe`&&(this.requiredSubscriptions[e].length>0&&!this.channelsAlreadySubscribed.has(e)&&this.channelsPendingToSubscribe.add(e),this.channelsPendingToUnsubscribe.delete(e)),t===`unsubscribe`&&(!this.requiredSubscriptions[e]||this.requiredSubscriptions[e]?.length===0)&&(this.channelsPendingToSubscribe.has(e)?this.channelsPendingToSubscribe.delete(e):this.channelsAlreadySubscribed.has(e)&&this.channelsPendingToUnsubscribe.add(e)),this.timer.exists(tC)||this.timer.set(tC,`timeout`,async()=>{this.timer.clear(tC);let e=new Set(this.channelsPendingToSubscribe),t=new Set(this.channelsPendingToUnsubscribe);this.channelsPendingToSubscribe=new Set,this.channelsPendingToUnsubscribe=new Set,[...e].forEach(e=>{this.channelsAlreadySubscribed.add(e)}),[...t].forEach(e=>{this.channelsAlreadySubscribed.delete(e),this.channelsBeingUnsubscribed.add(e),this.subscriptionOrderBookHandler.remove(e),this.incrementalTickerHandler.remove(e),delete this.cache[e]});try{let[n]=await Promise.all([this.subscribeApi(Array.from(e)),this.unsubscribeApi(Array.from(t))]),r=new Set(n.map(({channel:e})=>e));e.forEach(e=>{r.has(e)||isIncrementalTickerChannel(e)||this.channelsAlreadySubscribed.delete(e)})}catch(e){console.log(e)}finally{t.forEach(e=>this.channelsBeingUnsubscribed.delete(e))}},nC)}subscribe(e,t,n={}){return this.requiredSubscriptions[e]||(this.requiredSubscriptions[e]=[]),this.requiredSubscriptions[e].includes(t)||(this.requiredSubscriptions[e].push(t),this.cache[e]&&!n.suppressFirstCache&&t(this.cache[e])),this.handleSubscribeAggregation(e,`subscribe`),this.unsubscribe.bind(this,e,t)}unsubscribe(e,t,n={}){this.requiredSubscriptions[e]&&(this.requiredSubscriptions[e]=this.requiredSubscriptions[e].filter(e=>e!==t),this.requiredSubscriptions[e].length===0&&delete this.requiredSubscriptions[e]),this.handleSubscribeAggregation(e,`unsubscribe`)}resubscribe(){for(let e in this.requiredSubscriptions)rd(e)&&!this.isConnectionAuthenticated()?delete this.requiredSubscriptions[e]:this.handleSubscribeAggregation(e,`subscribe`)}handleSubscriptions(e,t){let{channel:n}=t;if(this.channelsBeingUnsubscribed.has(n)&&!this.requiredSubscriptions[n]?.length)return;let r=t,i=n.split(`.`),o=i[0]===`book`&&i.length===3,s=isIncrementalTickerChannel(n);if(o)try{r={data:this.subscriptionOrderBookHandler.process(r),channel:n}}catch(e){console.warn(e),this.forceResubscribe(n);return}else if(s){let e=this.incrementalTickerHandler.process(r);if(!e)return;r={data:e,channel:n}}this.requiredSubscriptions[n]&&(this.channelsAlreadySubscribed.add(n),this.requiredSubscriptions[n].forEach(e=>{e(r)})),this.cache[n]=r}},SubscriptionManagers=class{mainConnection;publicSubConnection;mainManager;publicSubManager;constructor({mainConnection:e,publicSubConnection:t}){this.mainConnection=e,this.publicSubConnection=t,this.mainManager=new SubscriptionManager(this.mainConnection),this.publicSubManager=new SubscriptionManager(this.publicSubConnection)}clearCache({type:e}){switch(e){case`main`:this.mainManager.clearCache();break;case`public`:this.publicSubManager.clearCache()}}subscribe(e,t,n={}){return od(e)?this.publicSubManager.subscribe(e,t,n):this.mainManager.subscribe(e,t,n)}unsubscribe(e,t,n={}){od(e)?this.publicSubManager.unsubscribe(e,t,n):this.mainManager.unsubscribe(e,t,n)}resubscribe({type:e}){switch(e){case`main`:this.mainManager.resubscribe();break;case`public`:this.publicSubManager.resubscribe()}}handleSubscriptions(e,t){let{channel:n}=t;od(n)?this.publicSubManager.handleSubscriptions(e,t):this.mainManager.handleSubscriptions(e,t)}check(){let e=this.mainManager.getState(),t=this.publicSubManager.getState(),n=new Set;
212e.channelsAlreadySubscribed.forEach(e=>n.add(e)),t.channelsAlreadySubscribed.forEach(e=>n.add(e));let r=new Set;e.channelsPendingToSubscribe.forEach(e=>r.add(e)),t.channelsPendingToSubscribe.forEach(e=>r.add(e));let i=new Set;e.channelsPendingToUnsubscribe.forEach(e=>i.add(e)),t.channelsPendingToUnsubscribe.forEach(e=>i.add(e));let o={...e.requiredSubscriptions,...t.requiredSubscriptions},s=new Set(Object.keys(o));return{channelsAlreadySubscribed:n,requiredSubscriptionChannels:s,requiredSubscriptions:o,"PROBLEM-notSubscribedButShould":new Set(bu(Array.from(s),Array.from(n))),"PROBLEM-subscribedButShouldNOT":new Set(bu(Array.from(n),Array.from(s))),channelsPendingToSubscribe:r,channelsPendingToUnsubscribe:i}}},DeribitClient=class{timer=new Pe;mainConnection;publicConnection;subscriptionManagers;originalClientCallbacks={};clientDetails;callLoggedIn=!1;country;connectionState={main:!1,public:!1};onConnectCalled=!1;logger;skipRestoreSession=!1;constructor(e){this.logger=e,this.mainConnection=new AuthenticatedConnection(e),this.publicConnection=new Connection(e),this.subscriptionManagers=new SubscriptionManagers({mainConnection:this.mainConnection,publicSubConnection:this.publicConnection})}log(e){this.logger&&this.logger(new Date,`[DeribitClient] ${e}`)}async fetchConnectionsParams({forceInsecureProtocols:e,apiHost:t}){let n=await(await fetch(`${e?`http://`:`https://`}${t}/api/v2/public/services`)).json();if(n.result)return n.result;throw n.error}closeAllConnections(){this.mainConnection.disconnect(),this.publicConnection.disconnect()}getErrorLogs(){return[...this.mainConnection.getErrorLogs(),...this.publicConnection.getErrorLogs()].sort((e,t)=>(e.requestTimestamp||0)-(t.requestTimestamp||0))}init({callbacks:e,getConnectionDetails:t,plugins:n,clientDetails:r,skipRestoreSession:i=!1,keepAlive:o}){this.log(`init()`),this.originalClientCallbacks=e,this.clientDetails=r,this.skipRestoreSession=i;let s={...e,onSubscriptionData:this.subscriptionManagers.handleSubscriptions.bind(this.subscriptionManagers),onDisconnect:this.onDisconnect.bind(this),onConnect:this.onConnect.bind(this)};this.mainConnection.init({callbacks:s,getConnectionDetails:()=>t(`main`),plugins:n,keepAlive:o}),this.publicConnection.init({callbacks:s,getConnectionDetails:()=>t(`public`),keepAlive:o})}async connect(e=[`main`,`public`]){this.log(`connect()`);let t=await Promise.all(e.map(e=>{switch(e){case`main`:return this.mainConnection.connect();case`public`:return this.publicConnection.connect();default:return!0}}));return e.reduce((e,n,r)=>(e.isConnected=e.isConnected&&t[r],e.details={...e.details,[n]:t[r]},e),{isConnected:!0,details:{}})}sendWaitingRequests({type:e}){e===`main`?this.mainConnection.sendWaitingRequests():this.publicConnection.sendWaitingRequests()}restoreSession(e){return this.mainConnection.restoreSession(e)}resubscribe(e){return this.subscriptionManagers.resubscribe(e)}async onConnect({details:e}){this.log(`onConnect()`);try{assertConnectionTypeIsMainOrPublic(e.type);let t=await this.hello(this.clientDetails,e.type);if(e.type===`main`&&!this.skipRestoreSession){let e=await this.restoreSession();this.callLoggedIn=e.sessionRecreated||e.sessionRestored,this.country=t?.country}this.resubscribe(e),this.sendWaitingRequests(e),this.connectionState[e.type]=!0,this.connectionState.main&&this.connectionState.public&&!this.onConnectCalled&&(this.log(`onConnect() - onConnectCalled = true`),this.onConnectCalled=!0,await this.originalClientCallbacks.onConnect?.({details:e,country:this.country}),this.callLoggedIn?(this.callLoggedIn=!1,await this.mainConnection.onLogin?.(e)):this.mainConnection.onAnonymous?.(e))}catch(e){console.log(e,`onConnect error!!!`)}}clean(){this.timer.clearAll(),this.mainConnection.clean(),this.publicConnection.clean()}onDisconnect(e,t){assertConnectionTypeIsMainOrPublic(e.type),this.connectionState[e.type]=!1,this.onConnectCalled=!1,this.subscriptionManagers.clearCache(e),this.originalClientCallbacks.onDisconnect?.(e,t)}getAuthData(){return this.mainConnection.getAuthData()}getScopeStringFromAuthData(){return this.mainConnection.getScopeStringFromAuthData()}getEnabledFeaturesFromAuthData(){return this.getAuthData()?.enabled_features}subscribe(e,t,n={}){return id(e,this.getAuthData())?()=>{}:this.subscriptionManagers.subscribe(e,t,n)}unsubscribe(e,t,n={}){return this.subscriptionManagers.unsubscribe(e,t,n)}logout(){return this.mainConnection.logout()}loginHello(e){return this.mainConnection.loginHello(e)}async loginAuthenticate(e){return this.mainConnection.loginAuthenticate(e)}loginByApiKey(e){return this.mainConnection.loginByApiKey(e)}loginProxy(e){return this.mainConnection.loginProxy(e)}loginWithRatGateway(e,t=`coinbase_session`){return this.mainConnection.loginWithRatGateway(e,t)}loginToSubaccount(e){return this.mainConnection.loginToSubaccount(e)}initiateOAuth(e){return this.mainConnection.initiateOAuth(e)}getOAuthToken(e){return this.mainConnection.getOAuthToken(e)}registerOAuth(e){return this.mainConnection.registerViaOAuth(e)}getOktaRedirectUrl(e){return this.mainConnection.getOktaRedirectUrl({provider:e})}authByOkta(e){return this.mainConnection.authByOkta(e)}hello(e,t){return t===`public`?this.publicConnection.sendMessage(`public/hello`,e):this.mainConnection.sendMessage(`public/hello`,e)}test(){return this.mainConnection.sendMessage(`public/test`)}send(e,t,n){return this.mainConnection.sendMessage(e,t,n)}fetch(e){return this.mainConnection.fetch(e)}async getServerStatus(){let e=new AbortController,t=setTimeout(()=>e.abort(),3e3),n=await fetch(`${this.mainConnection.getRestApiEndpoint()}/public/test`,{signal:e.signal});clearTimeout(t);let r=await n.json();return{status:n.status,resp:r}}register_deprecated(e){return this.mainConnection.sendMessage(`public/register`,e)}async register(e){let{password:t,...n}=e,r=await this.registerInitial(n),{salt:i,verifier:o}=calcSaltAndVerifier({...r,password:t});return this.registerFinal({s:i,V:o,code:r.code,email:e.email})}registerInitial(e){return this.mainConnection.sendMessage(`public/register`,e)}registerFinal(e){return this.mainConnection.sendMessage(`public/final_register`,e)}getCurrencies(e){return this.mainConnection.sendMessage(`public/get_currencies`,e)}getAvailableCurrencies(){return this.mainConnection.sendMessage(`private/get_available_currencies`)}getInstruments(e){return this.mainConnection.sendMessage(`public/get_instruments`,e)}async fetchInstruments(e){let t=await this.mainConnection.fetch({path:`/public/get_instruments`,params:e});return!t||t.error?(t&&console.log(t.error),this.getInstruments(e)):t.result}getOptionsTradeVolumes(e){return this.mainConnection.sendMessage(`public/get_options_trade_volumes`,e)}getLastTradesByCurrency(e){return this.mainConnection.sendMessage(`public/get_last_trades_by_currency`,e)}getLastTradesByCurrencyAndTime(e){return this.mainConnection.sendMessage(`public/get_last_trades_by_currency_and_time`,e)}getLastTradesByInstrument(e){return this.mainConnection.sendMessage(`public/get_last_trades_by_instrument`,e)}getTradingviewChartData(e){return this.mainConnection.sendMessage(`public/get_tradingview_chart_data`,e)}getTradingviewChartMarkprice(e){return this.publicConnection.sendMessage(`public/get_markprice_chart_data`,e)}getTicker(e){return this.mainConnection.sendMessage(`public/ticker`,e)}askForPasswordReset(e){return this.mainConnection.sendMessage(`public/ask_for_password_reset`,e)}deleteAccountRequest(){return this.mainConnection.sendMessage(`private/request_account_removal`)}deleteAccount(e){return this.mainConnection.sendMessage(`private/remove_account`,e)}getBlockRfqLimits(e){return this.mainConnection.sendMessage(`private/get_block_rfq_account_quote_limits`,e)}setBlockRfqLimits(e){return this.mainConnection.sendMessage(`private/set_block_rfq_account_quote_limits`,e)}removeBlockRfqLimits(e){return this.mainConnection.sendMessage(`private/set_block_rfq_account_quote_limits`,{...e,allowed:!0})}resetPassword_deprecated(e){return this.mainConnection.sendMessage(`public/reset_password`,e)}resetPassword(e){return this.mainConnection.sendMessage(`public/reset_password`,e)}resetPasswordCodeValidation(e){return this.mainConnection.sendMessage(`public/reset_password_code_validation`,e)}getIndexChartData(e){return this.mainConnection.sendMessage(`public/get_index_chart_data`,e)}getIndexPriceByTime(e){return this.mainConnection.sendMessage(`public/get_index_price_by_time`,e)}getVolatilityIndexData(e){return this.mainConnection.sendMessage(`public/get_volatility_index_data`,e)}getFundingChartData(e){return this.mainConnection.sendMessage(`public/get_funding_chart_data`,e)}getFundingRateHistory(e){return this.mainConnection.sendMessage(`public/get_funding_rate_history`,e)}getDeliveryPrices(e){return this.mainConnection.sendMessage(`public/get_delivery_prices`,e)}getTime(){return this.mainConnection.sendMessage(`public/get_time`)}getTradeVolumes(e){return this.mainConnection.sendMessage(`public/get_trade_volumes`,e)}getInsuranceData(e){return this.mainConnection.sendMessage(`public/get_insurance_data`,e)}getAnnouncements(e){return this.mainConnection.sendMessage(`public/get_announcements`,e)}getHistoricalVolatility(e){return this.mainConnection.sendMessage(`public/get_historical_volatility`,e)}getInsuranceChartData(e){return this.mainConnection.sendMessage(`public/get_insurance_chart_data`,e)}activateAccount(e){return this.mainConnection.sendMessage(`public/activate_account`,e)}confirmWithdrawal(e){return this.mainConnection.sendMessage(`public/confirm_withdrawal`,e)}confirmTransfer(e){return this.mainConnection.sendMessage(`public/confirm_transfer`,e)}getWithdrawal(e){return this.mainConnection.sendMessage(`public/get_withdrawal`,e)}getTransfer(e){return this.mainConnection.sendMessage(`public/get_transfer`,e)}confirmSecurityKeysReset(e){return this.mainConnection.sendMessage(`public/confirm_security_keys_reset`,e)}cancelSecurityKeysReset(e){return this.mainConnection.sendMessage(`public/cancel_security_keys_reset`,e)}getIndexPriceNames(e){return this.mainConnection.sendMessage(`public/get_index_price_names`,e)}getIndexPrice(e){return this.mainConnection.sendMessage(`public/get_index_price`,e)}getAffiliate(e){return this.mainConnection.sendMessage(`public/get_affiliate`,e)}getFiats(e){return this.mainConnection.sendMessage(`public/fiat/get_fiats`,e)}getCoins(e){return this.mainConnection.sendMessage(`public/fiat/get_coins`,e)}getPaymentMethods(e){return this.mainConnection.sendMessage(`public/fiat/get_payment_methods`,e)}getPrices(e){return this.mainConnection.sendMessage(`public/fiat/get_prices`,e)}getQuote(e){return this.mainConnection.fetch({path:`/private/fiat/get_quote`,method:`post`,params:e})}
212getCouponDetails(e){return this.mainConnection.sendMessage(`public/get_coupon_details`,e)}tickersByExpiration(e){return this.mainConnection.sendMessage(`public/tickers_by_expiration`,e)}tickersByCurrency(e){return this.mainConnection.sendMessage(`public/tickers_by_currency`,e)}getIndexPriceSources(e){return this.mainConnection.sendMessage(`public/get_index_price_sources`,e)}priceIndexRanking(e){return this.mainConnection.sendMessage(`public/price_index_ranking`,e)}async getComboDetails(e){return this.mainConnection.sendMessage(`public/get_combo_details`,{combo_id:e})}async getComboDetailsList(e){return this.mainConnection.sendMessage(`public/get_combos`,{currency:e})}lockAccountCodeValidation(e){return this.mainConnection.sendMessage(`public/lock_account_code_validation`,e)}lockAccount(e){return this.mainConnection.sendMessage(`public/lock_account`,e)}getKYCEnums(){return this.mainConnection.sendMessage(`public/ui/kyc/get_enums`)}getSupportedIndexNames(e){return this.mainConnection.sendMessage(`public/get_supported_index_names`,e)}listAffiliateRestrictedCountries(){return this.mainConnection.sendMessage(`public/list_affiliate_restricted_countries`)}listBannedCountries(e){return this.mainConnection.sendMessage(`public/list_banned_countries`,e)}getBlockRfqTrades(e){return this.mainConnection.sendMessage(`public/get_block_rfq_trades`,e)}listExemptedZoneCountries(){return this.mainConnection.sendMessage(`public/list_exempted_zone_countries`)}getUserPortfolio(e){return this.mainConnection.sendMessage(`private/get_user_portfolio`,e)}getAccountSummaryByCurrency(e){return this.mainConnection.sendMessage(`private/get_account_summary`,e)}getAccountSummaries(e){return this.mainConnection.sendMessage(`private/get_account_summaries`,e)}getSubaccounts(e){return this.mainConnection.sendMessage(`private/get_subaccounts`,e)}getRetailBrokerSubaccounts(e){return this.mainConnection.sendMessage(`private/get_retail_broker_subaccounts`,e)}getRetailBrokerSubaccountsDetails(e){return this.mainConnection.sendMessage(`private/get_retail_broker_subaccounts_details`,e)}changeSubaccountName(e){return this.mainConnection.sendMessage(`private/change_subaccount_name`,e)}setDisabledTradingProducts(e){return this.mainConnection.sendMessage(`private/set_disabled_trading_products`,e)}getPositionByInstrument(e){return this.mainConnection.sendMessage(`private/get_position`,e)}getPositionsByCurrency(e){return this.mainConnection.sendMessage(`private/get_positions`,e)}getListCustodyAccounts(e){return this.mainConnection.sendMessage(`/private/list_custody_accounts`,e)}setCustodyAutoDeposit(e){return this.mainConnection.sendMessage(`/private/set_custody_auto_deposit`,e)}getCustodyLogs(e){return this.mainConnection.sendMessage(`/private/list_custody_logs`,e)}custodyDeposit(e){return this.mainConnection.sendMessage(`/private/custody_deposit`,e)}custodyWithdraw(e){return this.mainConnection.sendMessage(`/private/custody_withdraw`,e)}setCustodyClientId(e){return this.mainConnection.sendMessage(`/private/set_custody_client_id`,e)}cancelPendingCustodyWithdrawals(e){return this.mainConnection.sendMessage(`/private/cancel_pending_custody_withdrawals`,e)}setCustodyWithdrawalAddress(e){return this.mainConnection.sendMessage(`/private/set_custody_withdrawal_address`,e)}cancelCustodyWithdrawalAddress_change(e){return this.mainConnection.sendMessage(`/private/cancel_custody_withdrawal_address_change`,e)}generateCustodyDepositAddress(e){return this.mainConnection.sendMessage(`/private/generate_custody_deposit_address`,e)}makeOrder(e){return this.mainConnection.sendMessage(`private/${e.direction}`,e)}makeOrders(e){return Promise.all(e.map(e=>this.makeOrder(e)))}editOrder(e){return this.mainConnection.sendMessage(`private/edit`,e)}simulateTrade(e){return this.mainConnection.sendMessage(`private/simulate_trade`,e)}editOrders(e){return Promise.all(e.map(e=>this.editOrder(e)))}cancelOrder(e){return this.mainConnection.sendMessage(`private/cancel`,e)}cancelOrders({order_ids:e}){return Promise.all(e.map(e=>this.cancelOrder({order_id:e})))}cancelAllOrders(e){return this.mainConnection.sendMessage(`private/cancel_all`,e)}cancelAllOrdersByInstrument(e){return this.mainConnection.sendMessage(`private/cancel_all_by_instrument`,e)}cancelAllOrdersByCurrency(e){return this.mainConnection.sendMessage(`private/cancel_all_by_currency`,e)}closePosition({instrument_name:e,price:t,type:n,isolated:r,placement_source:i}){let o={instrument_name:e,price:t,type:n||(t?`limit`:`market`),...r&&{isolated:r},...i&&{placement_source:i}};return this.mainConnection.sendMessage(`private/close_position`,o)}getMargins(e){return this.mainConnection.sendMessage(`private/get_margins`,e)}simulatePortfolio(e){return this.mainConnection.sendMessage(`private/simulate_portfolio`,e)}
212pmeSimulate(e){return this.mainConnection.sendMessage(`private/pme/simulate`,e)}getOpenOrdersByCurrency(e){return this.mainConnection.sendMessage(`private/get_open_orders_by_currency`,e)}getOpenOrders(e){return this.mainConnection.sendMessage(`private/get_open_orders`,{kind:e?.kind,include_isolated:e?.include_isolated})}getMarginLoans(e){return this.mainConnection.sendMessage(`private/get_margin_loans`,e)}getStarbasePtrMargin(){return this.mainConnection.sendMessage(`private/get_starbase_ptr_margin`)}getMarginLoanTerms(e){return this.mainConnection.sendMessage(`private/get_margin_loan_terms`,e)}borrow(e){return this.mainConnection.sendMessage(`private/borrow`,e)}repay(e){return this.mainConnection.sendMessage(`private/repay`,e)}getMarginLoanAutoRepay(){return this.mainConnection.sendMessage(`private/get_margin_loan_auto_repay`)}setMarginLoanAutoRepay(e){return this.mainConnection.sendMessage(`private/set_margin_loan_auto_repay`,e)}getMaxBuyingPower(e){return this.mainConnection.sendMessage(`private/get_max_buying_power`,e)}getMaxOrderSize(e){return this.mainConnection.sendMessage(`private/get_max_order_size`,e)}getMaxPosition(e){return this.mainConnection.sendMessage(`private/get_max_position`,e)}getOpenOrdersByInstrument(e){return this.mainConnection.sendMessage(`private/get_open_orders_by_instrument`,{instrument_name:e})}getStarbaseOpenOrders(){return this.mainConnection.sendMessage(`private/get_starbase_open_orders`)}getOrderMarginByIds(e){return this.mainConnection.sendMessage(`private/get_order_margin_by_ids`,e)}getOrderHistoryByCurrency(e){return this.mainConnection.sendMessage(`private/get_order_history_by_currency`,e)}getOrderHistoryByInstrument(e){return this.mainConnection.sendMessage(`private/get_order_history_by_instrument`,e)}getTriggerOrderHistory(e){return this.mainConnection.sendMessage(`private/get_trigger_order_history`,e)}getOrderState(e){return this.mainConnection.sendMessage(`private/get_order_state`,e)}getUserTradesByCurrency(e){return this.mainConnection.sendMessage(`private/get_user_trades_by_currency`,e)}getUserTradesByInstrument(e){return this.mainConnection.sendMessage(`private/get_user_trades_by_instrument`,e)}getUserTradesByInstrumentAndTime(e){return this.mainConnection.sendMessage(`private/get_user_trades_by_instrument_and_time`,e)}getUserTradesByOrder(e){return this.mainConnection.sendMessage(`private/get_user_trades_by_order`,e)}getLastBlockTradesByCurrency(e){return this.mainConnection.sendMessage(`private/get_last_block_trades_by_currency`,e)}getPendingBlockTrades(){return this.mainConnection.sendMessage(`private/get_pending_block_trades`)}async getBlockRfqUserInfo(){return this.mainConnection.sendMessage(`private/get_block_rfq_user_info`)}getBlockRfq(e){return this.mainConnection.sendMessage(`private/get_block_rfq`,e)}async getBlockRfqs(e){return this.mainConnection.sendMessage(`private/get_block_rfqs`,e)}async getBlockRfqQuotes(e){return this.mainConnection.sendMessage(`private/get_block_rfq_quotes`,e)}async cancelBlockRfq(e){return this.mainConnection.sendMessage(`private/cancel_block_rfq`,e)}async tradeBlockRfq(e){return this.mainConnection.sendMessage(`private/trade_block_rfq`,e)}async makeBlockRfqOrder(e){return this.mainConnection.sendMessage(`private/accept_block_rfq`,e)}async cancelBlockRfqTriggerOrder(e){return this.mainConnection.sendMessage(`private/cancel_block_rfq_trigger`,e)}async addBlockRfqQuote(e){return this.mainConnection.sendMessage(`private/add_block_rfq_quote`,e)}async editBlockRfqQuote(e){return this.mainConnection.sendMessage(`private/edit_block_rfq_quote`,e)}async cancelBlockRfqQuote(e){return this.mainConnection.sendMessage(`private/cancel_block_rfq_quote`,e)}async getLegPrices(e){return this.mainConnection.sendMessage(`private/get_leg_prices`,e)}async cancelAllBlockRfqQuotes(e){return this.mainConnection.sendMessage(`private/cancel_all_block_rfq_quotes`,e)}async getBlockRfqMakers(){return this.mainConnection.sendMessage(`private/get_block_rfq_makers`)}async createBlockRfq(e){return this.mainConnection.sendMessage(`private/create_block_rfq`,e)}getBrokerProfile(){return this.mainConnection.sendMessage(`private/get_broker_profile`)}getBrokerClients(e){return this.mainConnection.sendMessage(`private/get_broker_clients`,e)}createBrokerClient(e){return this.mainConnection.sendMessage(`private/create_broker_client`,e)}editBrokerClient(e){return this.mainConnection.sendMessage(`private/edit_broker_client`,e)}editBrokerClientLink(e){return this.mainConnection.sendMessage(`private/edit_broker_client_link`,e)}deleteBrokerClient(e){return this.mainConnection.sendMessage(`private/delete_broker_client`,e)}deleteBrokerClientLink(e){return this.mainConnection.sendMessage(`private/delete_broker_client_link`,e)}editLinkedBroker(e){return this.mainConnection.sendMessage(`private/edit_broker_link`,e)}toggleBrokerCorporateIdentityVisibility(e){return this.mainConnection.sendMessage(`private/toggle_broker_corporate_identity_visibility`,e)}getLinkedBrokers(){return this.mainConnection.sendMessage(`private/get_broker_links`)}getBrokerHistory(e){return this.mainConnection.sendMessage(`private/get_brokers_history`,e)}getBrokerClientHistory(e){return this.mainConnection.sendMessage(`private/get_broker_clients_history`,e)}getBrokerTradeRequests(e){return this.mainConnection.sendMessage(`private/get_broker_trade_requests`,e)}
212cancelBrokerTradeRequest(e){return this.mainConnection.sendMessage(`private/cancel_broker_trade_request`,e)}getBrokerTrades(e){return this.mainConnection.sendMessage(`private/get_broker_trades`,e)}createBrokerageTrade(e){return this.mainConnection.sendMessage(`private/execute_broker_trade`,e)}getCurrentDepositAddress(e){return this.mainConnection.sendMessage(`private/get_current_deposit_address`,e)}getAccountSettings(){return this.mainConnection.sendMessage(`private/account_settings`)}setAccountSettings(e){return this.mainConnection.sendMessage(`private/account_settings`,e)}getEmailLanguage(){return this.mainConnection.sendMessage(`private/get_email_language`)}setEmailLanguage(e){return this.mainConnection.sendMessage(`private/set_email_language`,e)}getSecondaryEmail(){return this.mainConnection.sendMessage(`private/get_secondary_email`)}setSecondaryEmail(e){return this.mainConnection.sendMessage(`private/set_secondary_email`,e)}setSecondaryEmailConfirm(e){return this.mainConnection.sendMessage(`public/set_secondary_email_confirm`,e)}removeSecondaryEmail(e){return this.mainConnection.sendMessage(`private/remove_secondary_email`,e)}removeSecondaryEmailConfirm(e){return this.mainConnection.sendMessage(`public/remove_secondary_email_confirm`,e)}getSecondaryEmailChangeStatus(){return this.mainConnection.sendMessage(`private/get_secondary_email_change_status`)}getAccessLog(e){return this.mainConnection.sendMessage(`private/get_access_log`,e)}activateSecurityKey(e){return this.mainConnection.activateSecurityKey(e)}activateSecurityKeyForOAuthRegistration(e){return this.mainConnection.activateSecurityKeyForOAuthRegistration(e)}generateTransactionLogExportUrl(e){return this.mainConnection.sendMessage(`private/generate_transaction_log_export_url`,e)}getSecurityKeysResetData(e){return this.mainConnection.sendMessage(`private/get_security_keys_reset_data`,e)}deactivateSecurityKey(e){return this.mainConnection.sendMessage(`private/deactivate_security_key`,e)}listSecurityKeys(){return this.mainConnection.sendMessage(`private/list_security_keys`)}getSecurityKeyStatus(){return this.mainConnection.sendMessage(`private/get_security_keys_status`)}changeSecurityKeyAssignment(e){return this.mainConnection.sendMessage(`private/change_security_key_assignment`,e)}changeSecurityKeyMode(e){return this.mainConnection.sendMessage(`private/change_security_key_mode`,e)}disableSecurityKeysForSubaccount(e){return this.mainConnection.sendMessage(`private/disable_security_keys_for_subaccount`,e)}getSecurityKeysActivationData(e){let t=`private/get_security_key_activation_data`;return e.provider&&(t=`public/get_security_key_activation_data_for_oauth_registration`),this.mainConnection.sendMessage(t,e)}listApiKeys(e){return this.mainConnection.sendMessage(`private/list_api_keys`,e)}getAuthorizedApps(){return this.mainConnection.sendMessage(`private/get_authorized_apps`)}revokeAccess(e){return this.mainConnection.sendMessage(`private/revoke_access`,e)}setAppKeyState(e){return this.mainConnection.sendMessage(`private/set_app_key_state`,e)}enableApiKey(e){return this.mainConnection.sendMessage(`private/enable_api_key`,e)}disableApiKey(e){return this.mainConnection.sendMessage(`private/disable_api_key`,e)}disableCancelOnDisconnect(e){return this.mainConnection.sendMessage(`private/disable_cancel_on_disconnect`,e)}enableCancelOnDisconnect(e){return this.mainConnection.sendMessage(`private/enable_cancel_on_disconnect`,e)}getCancelOnDisconnect(e){return this.mainConnection.sendMessage(`private/get_cancel_on_disconnect`,e)}resetApiKey(e){return this.mainConnection.sendMessage(`private/reset_api_key`,e)}removeApiKey(e){return this.mainConnection.sendMessage(`private/remove_api_key`,e)}changeScopeInApiKey(e){return this.mainConnection.sendMessage(`private/change_scope_in_api_key`,e)}createApiKey(e){return this.mainConnection.sendMessage(`private/create_api_key`,e)}changeApiKeyName(e){return this.mainConnection.sendMessage(`private/change_api_key_name`,e)}editApiKey(e){return this.mainConnection.sendMessage(`private/edit_api_key`,e)}editAppKey(e){return this.mainConnection.sendMessage(`private/edit_app_key`,e)}setAppKeyScope(e){return this.mainConnection.sendMessage(`private/set_app_key_scope`,e)}createDepositAddress(e){return this.mainConnection.sendMessage(`private/create_deposit_address`,e)}getDeposits(e){return this.mainConnection.sendMessage(`private/get_deposits`,e)}setClearanceOriginator(e){return this.mainConnection.sendMessage(`private/set_clearance_originator`,e)}getTransactionLog(e){return this.mainConnection.sendMessage(`private/get_transaction_log`,e,{timeout:2e4})}getBannedCountryState(){return this.mainConnection.sendMessage(`private/get_banned_country_state`)}getAddressBook(e){return this.mainConnection.sendMessage(`private/get_address_book`,e)}addToAddressBook_deprecated(e){return this.mainConnection.sendMessage(`private/add_to_address_book`,e)}addToAddressBook(e){return this.mainConnection.sendMessage(`private/add_to_address_book`,e)}async getAddressOwner(e){let t=await this.mainConnection.sendMessage(`private/address_ownership`,e);if(t===`error`)throw Error(`Unknown server error`);return t}updateInAddressBook(e){return this.mainConnection.sendMessage(`private/update_in_address_book`,e)}
212getVasps(e){return this.mainConnection.sendMessage(`private/vasps`,{subsidiaries:e?.includeSubsidiaries})}getCoinbaseVasps(){return this.mainConnection.sendMessage(`private/vasps`)}cancelTransferById(e){return this.mainConnection.sendMessage(`private/cancel_transfer_by_id`,e)}submitTransferBetweenSubaccounts(e){return this.mainConnection.sendMessage(`private/submit_transfer_between_subaccounts`,e)}submitTransferToUser(e){return this.mainConnection.sendMessage(`private/submit_transfer_to_user`,e)}getTransfers(e){return this.mainConnection.sendMessage(`private/get_transfers`,e)}moveImpliedEquity(e){return this.mainConnection.sendMessage(`private/move_implied_equity`,e)}moveExternalEquity(e){return this.mainConnection.sendMessage(`private/move_external_equity`,e)}getExternalEquityCustodians(){return this.mainConnection.sendMessage(`private/get_external_equity_custodians`)}getWithdrawals(e){return this.mainConnection.sendMessage(`private/get_withdrawals`,e)}editNote(e){return this.mainConnection.sendMessage(`private/edit_note`,e)}removeFromAddressBook(e){return this.mainConnection.sendMessage(`private/remove_from_address_book`,e)}setAddressRequiresConfirmation(e){return this.mainConnection.sendMessage(`private/set_address_requires_confirmation`,e)}cancelChangeWithdrawalsConfirmations(e){return this.mainConnection.sendMessage(`private/cancel_change_withdrawals_confirmations`,e)}confirmChangeWithdrawalsConfirmations(e){return this.mainConnection.sendMessage(`private/confirm_change_withdrawals_confirmations`,e)}getWithdrawalDelay(){return this.mainConnection.sendMessage(`private/get_withdrawal_delay`)}getCoinbaseEstimatedWithdrawalFee(e){return this.mainConnection.sendMessage(`private/coinbase/estimate_withdrawal_fee`,e)}withdraw(e){return this.mainConnection.sendMessage(`private/withdraw`,e)}cancelWithdrawal(e){return this.mainConnection.sendMessage(`private/cancel_withdrawal`,e)}setWithdrawalDelay(e){return this.mainConnection.sendMessage(`private/set_withdrawal_delay`,e)}setAnnouncementAsRead(e){return this.mainConnection.sendMessage(`private/set_announcement_as_read`,e)}getNewAnnouncements(){return this.mainConnection.sendMessage(`private/get_new_announcements`)}getAffiliateProgramInfo(){return this.mainConnection.sendMessage(`private/get_affiliate_program_info`)}changePassword(e){return this.mainConnection.changePassword(e)}resendActivationMail(e){return this.mainConnection.sendMessage(`public/resend_activation_mail`,e)}getPmeParams(e){return this.mainConnection.sendMessage(`private/get_pme_params`,e)}getStats(e){return this.mainConnection.sendMessage(`private/get_stats`,e)}listMonthlySummaries(e){return this.mainConnection.sendMessage(`private/list_monthly_summaries`,e)}getMonthlySummary(e){return this.mainConnection.sendMessage(`private/get_monthly_summary`,e)}setPasswordForSubaccount_deprecated(e){return this.mainConnection.sendMessage(`private/set_password_for_subaccount`,e)}setPasswordForSubaccount(e){return this.mainConnection.sendMessage(`private/set_password_for_subaccount`,e)}createSubaccount(){return this.mainConnection.sendMessage(`private/create_subaccount`)}getSubaccountDetails(e){return this.mainConnection.sendMessage(`private/get_subaccount_details`,e)}getSubaccountsDetails(e){return this.mainConnection.sendMessage(`private/get_subaccounts_details`,e)}removeSubaccount(e){return this.mainConnection.sendMessage(`private/remove_subaccount`,e)}setEmailForSubaccount(e){return this.mainConnection.sendMessage(`private/set_email_for_subaccount`,e)}toggleNotificationsFromSubaccount(e){return this.mainConnection.sendMessage(`private/toggle_notifications_from_subaccount`,e)}toggleSubaccountLogin(e){return this.mainConnection.sendMessage(`private/toggle_subaccount_login`,e)}saveInvestorExperience(e){return this.mainConnection.sendMessage(`private/save_investor_experience`,e)}submitIndividualForm(e){return md(e)?Promise.reject(Error(`Calling submitIndividualForm with empty params is not allowed`)):this.mainConnection.sendMessage(`private/submit_individual_form`,e)}async submitKYCFile(e){let t=await this.mainConnection.fetch({path:`/private/submit_kyc_file`,method:`post`,params:e});return!t||t.error?Promise.reject(t?.error):t.result}async setEligibilityBlocker(e){return this.mainConnection.sendMessage(`private/set_eligibility_blocker`,e)}async getKYCInformation(){return this.mainConnection.sendMessage(`private/get_user_kyc_information`)}async submitFinancialProofs(e){let getParams=t=>({method:`POST`,body:JSON.stringify({params:e,method:t}),headers:{Authorization:`bearer ${this.mainConnection.getAuthData()?.access_token||``}`,"Content-Type":`application/json`}}),t=this.mainConnection.getRestApiEndpoint(),n;try{n=await fetch(`${t}/private/submit_individual_proofs`,getParams(`/private/submit_individual_proofs`))}catch(e){if(pd(e))n=await fetch(`${t}/private/submit_financial_proofs`,getParams(`/private/submit_financial_proofs`));else throw e}return n.ok?(await n.json()).result:Promise.reject(n)}cancelVerification(e){return this.mainConnection.sendMessage(`private/cancel_verification`,e)}initializeVerification(e){return this.mainConnection.sendMessage(`private/initialize_verification`,e)}initializeUboVerification(e){return this.mainConnection.sendMessage(`private/initialize_ubo_verification`,e)}async submitCorporateForm(e){let t=await this.mainConnection.fetch({path:`/private/submit_corporate_form`,method:`post`,params:e});return t===void 0?Promise.reject():t.error?Promise.reject(t.error):t.result}setAccountType(e){return this.mainConnection.sendMessage(`private/set_account_type`,e)}getCorporateUbos(){return this.mainConnection.sendMessage(`private/get_corporate_ubos`)}async saveUbo(e){let t=JSON.stringify({params:e,method:`private/save_ubo`}),n=await fetch(`${this.mainConnection.getRestApiEndpoint()}/private/save_ubo`,{method:`POST`,body:t,headers:{Authorization:`bearer ${this.mainConnection.getAuthData()?.access_token||``}`,"Content-Type":`application/json`}});return n.ok?(await n.json()).result:Promise.reject(n)}removeUbo(e){return this.mainConnection.sendMessage(`private/remove_ubo`,e)}deactivateUbo(e){return this.mainConnection.sendMessage(`private/deactivate_ubo`,e)}startCorporateVerification(){return this.mainConnection.sendMessage(`private/start_corporate_verification`)}getUserLegalInfo(){return this.mainConnection.sendMessage(`private/get_user_legal_info`)}getLegalDocumentInfo(){return this.mainConnection.sendMessage(`public/get_legal_document_info`)}getAcceptedLegalDocuments(){return this.mainConnection.sendMessage(`private/get_accepted_tos`)}acceptLegalDocuments(e,t){return this.mainConnection.sendMessage(`private/set_accepted_tos`,{entity:e,terms:t})}getDeribitEntity(){return this.mainConnection.sendMessage(`private/get_deribit_entity`)}getEligibleEntities(){return this.mainConnection.sendMessage(`private/get_eligible_entities`)}getCurrentLegalDocuments(e,t){return this.mainConnection.sendMessage(`public/get_current_terms_of_service`,{entity:e,type:t})}getLatestLegalDocuments(e,t){return this.mainConnection.sendMessage(`public/get_latest_terms_of_service`,{entity:e,type:t})}setConsent(e){return this.mainConnection.sendMessage(`private/set_consent`,e)}pmeGetParams(e){return this.mainConnection.sendMessage(`public/pme/get_params`,e)}enableAffiliateProgram(){return this.mainConnection.sendMessage(`private/enable_affiliate_program`)}verifyBlockTrade(e){return this.mainConnection.sendMessage(`private/verify_block_trade`,e)}invalidateBlockTradeSignature(e){return this.mainConnection.sendMessage(`private/invalidate_block_trade_signature`,e)}approvePendingBlockTrade(e){return this.mainConnection.sendMessage(`private/approve_block_trade`,e)}rejectPendingBlockTrade(e){return this.mainConnection.sendMessage(`private/reject_block_trade`,e)}executeBlockTrade(e){return this.mainConnection.sendMessage(`private/execute_block_trade`,e)}getBlockTrade(e){return this.mainConnection.sendMessage(`private/get_block_trade`,e)}getBlockTrades(e){return this.mainConnection.sendMessage(`private/get_block_trades`,e)}getBlockTradeRequests(e){return this.mainConnection.sendMessage(`private/get_block_trade_requests`,e)}swapAuth(e){return this.mainConnection.sendMessage(`private/swap_auth`,{},{suppressError:e})}getImpersonateSettings(){return this.mainConnection.sendMessage(`private/get_impersonate_settings`)}setImpersonateSettings(e){return this.mainConnection.sendMessage(`private/set_impersonate_settings`,e)}getDailyWithdrawalLimit(e){return this.mainConnection.sendMessage(`private/get_daily_withdrawal_limit`,e)}setDailyWithdrawalLimit(e){return this.mainConnection.sendMessage(`private/set_daily_withdrawal_limit`,e)}createOrder(e){return this.mainConnection.sendMessage(`private/fiat/create_order`,e)}getOrder(e){return this.mainConnection.sendMessage(`private/fiat/get_order`,e)}getOrders(e){return this.mainConnection.sendMessage(`private/fiat/get_orders`,e)}removeOrder(e){return this.mainConnection.sendMessage(`private/fiat/remove_order`,e)}checkApp(e){return this.mainConnection.fetch({path:`/private/check_app`,method:`post`,params:{...e}})}authorizeApp(e){return this.mainConnection.sendMessage(`private/authorize_app`,e)}chatGetAccountSummary(){return this.mainConnection.sendMessage(`private/chat_get_account_summary`)}chatSetNick(e){return this.mainConnection.sendMessage(`private/chat_set_nick`,e)}activateCoupon(e){return this.mainConnection.sendMessage(`private/activate_coupon`,e)}transferFeeBalance(e){return this.mainConnection.sendMessage(`private/transfer_fee_balance`,e)}togglePortfolioMargining(e){return this.mainConnection.sendMessage(`private/toggle_portfolio_margining`,e)}changeMarginModel(e){return this.mainConnection.sendMessage(`private/change_margin_model`,e)}setLeverage(e){return this.mainConnection.sendMessage(`private/set_leverage`,e)}getLeverage(e){return this.mainConnection.sendMessage(`private/get_leverage`,e)}movePositions(e){return this.mainConnection.sendMessage(`private/move_positions`,e)}createCombo(e){return this.mainConnection.sendMessage(`private/create_combo`,e)}getTradingLimits(e){return this.mainConnection.sendMessage(`private/get_trading_limits`,e)}getRiskProfile(){return this.mainConnection.sendMessage(`private/get_risk_profile`)}getUserLocks(){return this.mainConnection.sendMessage(`private/get_user_locks`)}cancelAllByKindOrType(e){return this.mainConnection.sendMessage(`private/cancel_all_by_kind_or_type`,e)}getMmpConfig(e){return this.mainConnection.sendMessage(`private/get_mmp_config`,e)}setMmpConfig(e){return this.mainConnection.sendMessage(`private/set_mmp_config`,e)}resetMmp(e){return this.mainConnection.sendMessage(`private/reset_mmp`,e)}setSelfTradingRejectMode(e){return this.mainConnection.sendMessage(`private/set_self_trading_config`,e)}getBuyCryptoInfo(){return this.mainConnection.fetch({path:`/private/fiat/get_info`})}getVerificationStatus(){return this.mainConnection.fetch({path:`/private/get_verification_status`})}async getKycCountry(){return this.mainConnection.sendMessage(`/private/get_kyc_country`)}
212transferKycDetails(e){return this.mainConnection.fetch({path:`/private/fiat/transfer_kyc_details`,method:`post`,params:e})}getWidgetProps(e){return this.mainConnection.fetch({path:`/private/fiat/get_widget_props`,method:`post`,params:e})}async getFromKeyValueStore(e,t={ignoreNotFound:!0}){try{let t=await this.mainConnection.sendMessage(`/private/kv/get`,e);return typeof t==`string`?JSON.parse(t):Object.fromEntries(Object.keys(t).map(e=>[e,JSON.parse(t[e])]))}catch(e){if(!t.ignoreNotFound||!dd(e)||e.message!==`not_found`)throw e}}async saveToKeyValueStore(e,t){return(await this.mainConnection.fetch({path:`/private/kv/put`,method:`post`,params:{key:e,value:JSON.stringify(t)}}))?.result}async deleteFromKeyValueStore(e){return this.mainConnection.sendMessage(`/private/kv/delete`,e)}listAllKeysFromKeyValueStore(){return this.mainConnection.sendMessage(`/private/kv/list`)}async deleteAllKeysFromKeyValueStore(){let e=await this.listAllKeysFromKeyValueStore();return this.deleteFromKeyValueStore({keys:e})}async getAllFromKeyValueStore(){let e=await this.listAllKeysFromKeyValueStore();return this.getFromKeyValueStore({keys:e})}getRememberedSecureDevices(){return this.mainConnection.sendMessage(`/private/get_remembered_secure_devices`)}forgetSecureDevices(e){return this.mainConnection.sendMessage(`/private/forget_secure_devices`,e)}getMissingInfoDepositsCurrencies(){return this.mainConnection.sendMessage(`private/get_missing_info_deposits_currencies`)}getZendeskJwt(){return this.mainConnection.sendMessage(`private/get_jwt`,{recipient:`zendesk_messaging`})}getRewardEligibility(){return this.mainConnection.sendMessage(`private/get_reward_eligibility`)}getListMinEquities(e){return this.mainConnection.sendMessage(`private/list_minimum_equities`,e)}getPopupMessage(){return this.mainConnection.sendMessage(`private/get_popup_message`)}startEtdQuiz(){return this.mainConnection.sendMessage(`private/start_etd_quiz`)}submitEtdQuiz(e){return this.mainConnection.sendMessage(`private/submit_etd_quiz`,e)}getMembers(){return this.mainConnection.sendMessage(`private/get_members`)}setMember(e){return this.mainConnection.sendMessage(`private/set_member`,e)}deleteMember(e){return this.mainConnection.sendMessage(`private/delete_member`,e)}},DesktopSessionsManager=class extends AbstractSessionsManager{storageKey;sessionStorageKey;backendPanelStorageKey;oktaStorageKey;localStorage;sessionStorage;constructor(e=localStorage,t=sessionStorage){super(),this.localStorage=e,this.sessionStorage=t,this.storageKey=`deribitClientTokens`,this.sessionStorageKey=`deribitCurrentSession`,this.backendPanelStorageKey=`deribitBackendSessions`,this.oktaStorageKey=`oktaAuth`}getSessionsData(){return JSON.parse(this.localStorage.getItem(this.storageKey)||`{}`)}getBackendSessionIds(){return JSON.parse(this.localStorage.getItem(this.backendPanelStorageKey)||`[]`)}getSessionIdsToInvalidate(){let e=this.getSessionsData();return[...Object.values(e).map(e=>e.sid).filter(e=>e!=null),...this.getBackendSessionIds()]}getSessionData(e){return this.getSessionsData()[e]}setSessionData(e,t){let n=this.getSessionsData();n[e]={...t,creationTimestamp:Date.now()},wd(t.scope).impersonated||this.localStorage.setItem(this.storageKey,JSON.stringify(n)),this.sessionStorage.setItem(this.sessionStorageKey,JSON.stringify({[e]:n[e]}))}removeSessionFromLS(e){let t=this.getSessionsData();delete t[e],this.localStorage.setItem(this.storageKey,JSON.stringify(t))}removeSessionData(e){this.removeSessionFromLS(e),this.sessionStorage.removeItem(this.sessionStorageKey)}removeSessionsData(){this.localStorage.removeItem(this.storageKey),this.localStorage.removeItem(this.backendPanelStorageKey),this.sessionStorage.removeItem(this.sessionStorageKey)}getLatestSessionData(){let e=this.getSessionsData(),t={creationTimestamp:0},n=``;return Object.keys(e).forEach(r=>{let i=e[r];i.creationTimestamp>t.creationTimestamp&&(t=i,n=r)}),`refresh_token`in t?[n,t]:null}getCurrentSessionData(){let e=this.sessionStorage.getItem(this.sessionStorageKey)||`null`,t=JSON.parse(e),n=t;return t&&(n=Object.entries(t)[0]),n}removeExpiredSessionsData(){let e=this.getSessionsData();Object.keys(e).forEach(t=>{let n=e[t].refresh_token.split(`.`)[0];Number(n)<Date.now()&&this.removeSessionFromLS(t)})}setOktaAuthData(e){this.localStorage.setItem(this.oktaStorageKey,JSON.stringify(e))}getOktaAuthData(){let e=this.localStorage.getItem(this.oktaStorageKey);return e?JSON.parse(e):null}removeOktaAuthData(){this.localStorage.removeItem(this.oktaStorageKey)}},HistoryClient=class{endpoint=null;deribitClient;config;constructor(e,t){this.deribitClient=e,this.config=t}init(e){this.endpoint=e}getParams=e=>!e||typeof e!=`object`?``:`?${Object.entries(e).filter(([,e])=>e!==void 0).map(([e,t])=>`${e}=${t}`).join(`&`)}`;fetch=async(e,t)=>{let n;return e.includes(`private/`)&&(n={headers:{Authorization:`bearer ${this.deribitClient.getAuthData()?.access_token||``}`,"Content-Type":`application/json`}}),(await(await fetch(`${this.endpoint||``}${e}${this.getParams(t)}`,n)).json()).result};async getTradingviewChartData(e){return this.endpoint?this.fetch(`/
212public/get_tradingview_chart_data`,e):this.deribitClient.getTradingviewChartData(e)}async getLastTradesByCurrency(e){let{end_id:t,kind:n}=e||{},r=t||[`future_combo`,`option_combo`,`combo`].includes(n??``);return this.endpoint&&this.config.isHistoryClientLastTradesEnabled&&r?this.fetch(`/public/get_last_trades_by_currency`,e):this.deribitClient.getLastTradesByCurrency(e)}async getLastTradesByCurrencyAndTime(e){return this.endpoint&&this.config.isHistoryClientLastTradesEnabled?this.fetch(`/public/get_last_trades_by_currency_and_time`,e):this.deribitClient.getLastTradesByCurrencyAndTime(e)}async getLastTradesByInstrument(e){let{end_seq:t}=e||{};return this.endpoint&&this.config.isHistoryClientLastTradesEnabled&&t?this.fetch(`/public/get_last_trades_by_instrument`,e):this.deribitClient.getLastTradesByInstrument(e)}async getUserTradesByCurrency(e){return this.endpoint&&this.config.isHistoryClientUserTradesEnabled?this.fetch(`/private/get_user_trades_by_currency`,e):this.deribitClient.getUserTradesByCurrency(e)}async getUserTradesByInstrument(e){return this.endpoint&&this.config.isHistoryClientUserTradesEnabled?this.fetch(`/private/get_user_trades_by_instrument`,e):this.deribitClient.getUserTradesByInstrument(e)}async getInstrument(e){return this.fetch(`/public/get_instrument`,{instrument_name:e})}},iC=zS();function applyLevel(e,t,n){let r=parseFloat(t),i=parseFloat(n);return i===0?e.delete(r):e.set(r,i)}var createBids=()=>Ff(void 0,(e,t)=>t-e),createAsks=()=>Ff();function createOrderBookMessageHandler(e,t){let n=t?.data.bids||createBids(),r=t?.data.asks||createAsks();return t=>{t.type===`snapshot`?(n=createBids(),r=createAsks(),t.bids.forEach(([e,t])=>{n=applyLevel(n,e,t)}),t.asks.forEach(([e,t])=>{r=applyLevel(r,e,t)}
212)):t.type===`l2update`&&t.changes.forEach(([e,t,i])=>{e===`buy`?n=applyLevel(n,t,i):r=applyLevel(r,t,i)}),e({data:{bids:n,asks:r,prevChangeId:null,changeId:null,aggregatedVolumes:Nf()}})}}function createTickerMessageHandler(e){return t=>{if(t.type!==`ticker`)return;let n=parseFloat(t.price),r=parseFloat(t.open_24h),i=parseFloat(t.volume_24h);e({data:{instrument_name:t.product_id.replace(`-`,`_`).replace(/USD$/,`USDC`),last_price:n,index_price:0,mark_price:0,best_bid_price:parseFloat(t.best_bid),best_ask_price:parseFloat(t.best_ask),best_bid_amount:parseFloat(t.best_bid_size),best_ask_amount:parseFloat(t.best_ask_size),open_interest:0,funding_8h:0,max_price:0,min_price:0,state:`open`,timestamp:new Date(t.time).getTime(),stats:{high:parseFloat(t.high_24h),low:parseFloat(t.low_24h),price_change:r&&yn(Xt(Kn(n,r),r),100),volume:i,volume_usd:yn(i,n)}}})}}function createChartBarMessageHandler(e,t,n){let r=e*1e3,i=n;return e=>{if(e.type!==`match`)return;let n=parseFloat(e.price),o=parseFloat(e.size),s=new Date(e.time).getTime(),c=Math.floor(s/r)*r;!i||c>i.time?i={time:c,open:n,high:n,low:n,close:n,volume:o}:c===i.time&&(i={...i,high:Math.max(i.high,n),low:Math.min(i.low,n),close:n,volume:i.volume+o}),t(i)}}function createTradeRow(e,t){return{trade_seq:e.trade_id,price:parseFloat(e.price),amount:parseFloat(e.size),direction:e.side===`buy`?`sell`:`buy`,timestamp:new Date(e.time).getTime(),instrument_name:t}}function createTradesMessageHandler(e,t){return n=>{n.type===`match`&&t(createTradeRow(n,e))}}var aC=class CbeClient{static TYPE_TO_CHANNEL_DICTIONARY={snapshot:`level2_batch`,l2update:`level2_batch`,match:`matches`,last_match:`matches`};static PRODUCT_IDS_WITHOUT_QUOTE_MAPPING=new Set([`EURC-USDC`]);static formatProductId(e){let t=e.replace(`_`,`-`);return CbeClient.PRODUCT_IDS_WITHOUT_QUOTE_MAPPING.has(t)?t:t.replace(`USDC`,`USD`)}apiUrl;wsUrl;ws;handlers=new Map;lastSequences=new Map;lastOrderBooks=new Map;lastTickers=new Map;reconnectTimeout;inactivityTimeout;heartbeatSubscribed=!1;constructor(e,t){this.apiUrl=e,this.wsUrl=t}async getProductCandles(e){let t=this.createEndpointUrl(e.product_id,`candles`);return e.start&&t.searchParams.set(`start`,e.start),e.end&&t.searchParams.set(`end`,e.end),t.searchParams.set(`granularity`,String(e.granularity)),(await this.request(t)).json()}async getProductTrades(e){let t=this.createEndpointUrl(e.product_id,`trades`);e.limit&&t.searchParams.set(`limit`,String(e.limit)),e.after&&t.searchParams.set(`after`,e.after);let n=await this.request(t);return{trades:(await n.json()).map(t=>createTradeRow(t,e.product_id)),after:n.headers.get(`CB-AFTER`)||void 0}}createEndpointUrl(e,t){let n=CbeClient.formatProductId(e);return new URL(`/products/${encodeURIComponent(n)}/${t}`,this.apiUrl)}async request(e){let t=await fetch(e.toString());if(!t.ok)throw Error(`CBE request failed: ${t.status} ${t.statusText} (${e.pathname})`);return t}subscribeOrderBook(e,t,n=100){let r=CbeClient.formatProductId(e),i=this.lastOrderBooks.get(r);i&&t(i);let o=Li(t,n),s=this.subscribe(`level2_batch`,[r],createOrderBookMessageHandler(e=>{this.lastOrderBooks.set(r,e),o(e)},i));return()=>{o.cancel(),s()}}subscribeTicker(e,t){let n=CbeClient.formatProductId(e),r=this.lastTickers.get(n);return r&&t(r),this.subscribe(`ticker`,[n],createTickerMessageHandler(e=>{this.lastTickers.set(n,e),t(e)}))}subscribeChartBars(e,t,n,r){return this.subscribe(`matches`,[CbeClient.formatProductId(e)],createChartBarMessageHandler(t,n,r))}subscribeTrades(e,t,n=100){let r=[],flushRows=()=>{r.length!==0&&(t({data:r}),r=[])},i=Li(flushRows,n),o=this.subscribe(`matches`,[CbeClient.formatProductId(e)],createTradesMessageHandler(e,e=>{r.push(e),i()}));return()=>{i.cancel(),o()}}subscribe(e,t,n){let r=this.handlers.get(e);r||(r=new Map,this.handlers.set(e,r));let i=[];for(let e of t){let t=r.get(e);t||(t=new Set,r.set(e,t),i.push(e)),t.add(n)}return i.length>0&&(this.ws?.readyState===WebSocket.OPEN?this.sendSubscribeMessage(e,i):this.connect()),()=>this.unsubscribe(e,t,n)}unsubscribe(e,t,n){let r=this.handlers.get(e);if(!r)return;let i=[];for(let o of t){let t=r.get(o);t&&(t.delete(n),t.size===0&&(r.delete(o),this.lastSequences.get(e)?.delete(o),e===`level2_batch`&&this.lastOrderBooks.delete(o),i.push(o)))}r.size===0&&this.handlers.delete(e),i.length>0&&this.ws?.readyState===WebSocket.OPEN&&this.sendUnsubscribeMessage(e,i)}connect(){if(this.ws&&(this.ws.readyState!==WebSocket.CLOSED||this.reconnectTimeout))return;let e=new WebSocket(this.wsUrl);this.ws=e,this.resetInactivityWatchdog(),e.onopen=()=>{this.lastSequences.clear(),this.heartbeatSubscribed=!1;for(let[e,t]of this.handlers)this.sendSubscribeMessage(e,[...t.keys()])},e.onmessage=e=>{let t=JSON.parse(e.data),n=`product_id`in t?String(t.product_id):void 0;if(!n||t.type===`subscriptions`)return;this.resetInactivityWatchdog(),this.heartbeatSubscribed||(this.heartbeatSubscribed=!0,this.sendSubscribeMessage(`heartbeat`,[n]));let r=CbeClient.TYPE_TO_CHANNEL_DICTIONARY[t.type]||t.type;this.isOutOfOrderMessage(r,n,t)||this.handlers.get(r)?.get(n)?.forEach(e
212=>e(t))},e.onclose=()=>{this.clearInactivityWatchdog(),this.handlers.size>0&&this.scheduleReconnect()},e.onerror=()=>{e.close()}}resetInactivityWatchdog(){this.clearInactivityWatchdog(),this.inactivityTimeout=setTimeout(()=>{this.inactivityTimeout=void 0,this.ws?.close()},1e4)}clearInactivityWatchdog(){this.inactivityTimeout&&=(clearTimeout(this.inactivityTimeout),void 0)}isOutOfOrderMessage(e,t,n){if(!(`sequence`in n))return!1;let r=this.lastSequences.get(e);r||(r=new Map,this.lastSequences.set(e,r));let i=r.get(t);return i!==void 0&&n.sequence<=i||(r.set(t,n.sequence),!1)}scheduleReconnect(){this.reconnectTimeout||=setTimeout(()=>{this.reconnectTimeout=void 0,this.connect()},3e3)}sendSubscribeMessage(e,t){this.sendMessage(e,t,`subscribe`)}sendUnsubscribeMessage(e,t){this.sendMessage(e,t,`unsubscribe`)}sendMessage(e,t,n){let r={type:n,channels:[{name:e,product_ids:t}]};this.ws?.send(JSON.stringify(r))}},assetsHelper=e=>{let t={},n={},r={},i={},o={},s=new Set,c=new Set;e.forEach(e=>{let{instrument_name:p,kind:m,settlement_currency:h}=e;if(t[p]=e,m===`option`){n[p]=e,s.add(h);let{currency:t,currencyPair:r=t,expiration:i,strike:c,option_type:m,isLinear:g}=Ki.extendInstrumentData(e),_=g?r:t,v=o[_]||{},y=v[i]||[];m===`call`&&y.push(+c),v[i]=y,o[_]=v}else m===`future`?(r[p]=e,s.add(h)):m===`spot`&&(i[p]=e,c.add(e.counter_currency),c.add(e.base_currency))}),s.forEach(e=>c.add(e));for(let e in o){let t=o[e];for(let e in t)t[e].sort((e,t)=>+e-t)}return{instruments:t,options:n,futures:r,spots:i,optionExpirations:o,settlementCurrencySymbols:Array.from(s).sort(),tradeCurrencySymbols:Array.from(c).sort()}},currenciesHelper=(e,t)=>{let n={},r=[];e.forEach(e=>{n[e.currency]=e,r.push(e.currency)}),r.sort(xr.currencies);let i=[...Object.keys(t||{}).reduce((e,t)=>{let{currencyPair:n}=Ki.splitInstrument(t)||{};return n&&e.add(n),e},new Set)];return i.sort(),{currencies:n,currencySymbols:r,currencyPairs:i}};function indicesHelper(e){return e.reduce((e,t)=>{let[n,r]=t.split(`_`),i=r===`usd`?n:r;return i=i.toUpperCase(),e[i]||(e[i]=[]),e[i].includes(t)||e[i].push(t),e},{})}var oC=Nn({name:`inventory`,initialState:{instruments:{},futures:{},options:{},spots:{},allCurrencies:{},allCurrencySymbols:[],currencies:{},currencyPairs:[],currencySymbols:[],settlementCurrencySymbols:[],tradeCurrencySymbols:[],optionExpirations:{},indexPriceNames:{},comboIndexNames:{futures:[],options:[]},isConnected:!1,combosDetails:{}},reducers:{setInventory:(e,t)=>{let{instruments:n,options:r,futures:i,spots:o,optionExpirations:s,settlementCurrencySymbols:c,tradeCurrencySymbols:p}=assetsHelper(t.payload.instruments),{currencies:m,currencySymbols:h,currencyPairs:g}=currenciesHelper(t.payload.currencies,r),{currencies:_,currencySymbols:v}=currenciesHelper(t.payload.allCurrencies);Zi.setInstruments(yu(n)),e.indexPriceNames=indicesHelper(t.payload.indexPriceNames),e.comboIndexNames=t.payload.comboIndexNames,e.allCurrencies=_,e.allCurrencySymbols=v,e.currencies=m,e.currencyPairs=g,e.currencySymbols=h,e.tradeCurrencySymbols=p,e.settlementCurrencySymbols=c,e.instruments=n,e.futures=i,e.options=r,e.spots=o,e.optionExpirations=s},removeInstrument:(e,t)=>{let n=t.payload,r=Ki.splitInstrument(n);if(Zi.removeInstrument(n),r){let{currency:t,expiration:i,expirationHour:o,strike:s,isOption:c}=r;if(c){let n=o?`_${o}`:``,r=`${t}-${i}${n}-${s}-P`,c=`${t}-${i}${n}-${s}-C`;delete e.instruments[r],delete e.options[r],delete e.instruments[c],delete e.options[c],e.optionExpirations?.[t]?.[i]&&(e.optionExpirations[t][i]=e.optionExpirations[t][i].filter(e=>e!==+s)),e.optionExpirations?.[t]?.[i]?.length===0&&delete e.optionExpirations[t][i],Object.keys(e.optionExpirations[t]||{}).length===0&&delete e.optionExpirations[t]}else delete e.instruments[n],delete e.futures[n]}},updateInstrumentsList:(e,t)=>{let n=t.payload,{instruments:r,options:i,futures:o,spots:s,optionExpirations:c,settlementCurrencySymbols:p,tradeCurrencySymbols:m}=assetsHelper(n);Zi.setInstruments(yu(r)),e.instruments=r,e.futures=o,e.options=i,e.spots=s,e.optionExpirations=c,e.settlementCurrencySymbols=p,e.tradeCurrencySymbols=m},setConnectionState:(e,t)=>
212{e.isConnected=t.payload},setArrayComboDetails:(e,t)=>{e.combosDetails=vu(t.payload,e=>e.instrumentName)},setComboDetails:(e,t)=>{e.combosDetails[t.payload.instrumentName]=t.payload},removeComboDetails:(e,t)=>{delete e.combosDetails[t.payload]}}}),sC=oC.actions,cC=oC.reducer,lC={members:null},uC=Ut(`starbase/fetchMembers`,async(e,t)=>{let{deribitClient:n}=t.extra;return(await n.getMembers()).members}),dC=Nn({name:`starbase`,initialState:lC,reducers:{},extraReducers:e=>{e.addCase(nd.clearUserData.type,()=>lC).addCase(uC.fulfilled,(e,t)=>{e.members=t.payload}).addCase(uC.rejected,e=>{e.members=[]})}}),fC={fetchMembers:uC},pC=dC.reducer;_r(),Bn();function mapEventPropToEvent(e){return e.substring(2).toLowerCase()}function clickedRootScrollbar(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function ClickAwayListener(e){let{children:t,disableReactTree:n=!1,mouseEvent:r=`onClick`,onClickAway:i,touchEvent:o=`onTouchEnd`}=e,s=$.useRef(!1),c=$.useRef(null),p=$.useRef(!1),m=$.useRef(!1);$.useEffect(()=>(setTimeout(()=>{p.current=!0},0),()=>{p.current=!1}),[]);let h=Ft(Dt(t),c),g=nn(e=>{let t=m.current;m.current=!1;let r=zn(c.current);if(!p.current||!c.current||`clientX`in e&&clickedRootScrollbar(e,r))return;if(s.current){s.current=!1;return}let o;o=e.composedPath?e.composedPath().indexOf(c.current)>-1:!r.documentElement.contains(e.target)||c.current.contains(e.target),!o&&(n||!t)&&i(e)}),createHandleSynthetic=e=>n=>{m.current=!0;let r=t.props[e];r&&r(n)},_={ref:h};return o!==!1&&(_[o]=createHandleSynthetic(o)),$.useEffect(()=>{if(o!==!1){let e=mapEventPropToEvent(o),t=zn(c.current),handleTouchMove=()=>{s.current=!0};return t.addEventListener(e,g),t.addEventListener(`touchmove`,handleTouchMove),()=>{t.removeEventListener(e,g),t.removeEventListener(`touchmove`,handleTouchMove)}}},[g,o]),r!==!1&&(_[r]=createHandleSynthetic(r)),$.useEffect(()=>{if(r!==!1){let e=mapEventPropToEvent(r),t=zn(c.current);return t.addEventListener(e,g),()=>{t.removeEventListener(e,g)}}},[g,r]),(0,X.jsx)($.Fragment,{children:$.cloneElement(t,_)})}yi(),sr();var html=(e,t)=>Er({WebkitFontSmoothing:`antialiased`,MozOsxFontSmoothing:`grayscale`,boxSizing:`border-box`,WebkitTextSizeAdjust:`100%`},t&&!e.vars&&{colorScheme:e.palette.mode}),body=e=>Er({color:(e.vars||e).palette.text.primary},e.typography.body1,{backgroundColor:(e.vars||e).palette.background.default,"@media print":{backgroundColor:(e.vars||e).palette.common.white}}),styles=(e,t=!1)=>{var n;let r={};t&&e.colorSchemes&&Object.entries(e.colorSchemes).forEach(([t,n])=>{r[e.getColorSchemeSelector(t).replace(/\s*&/,``)]={colorScheme:n.palette?.mode}});let i=Er({html:html(e,t),"*, *::before, *::after":{boxSizing:`inherit`},"strong, b":{fontWeight:e.typography.fontWeightBold},body:Er({margin:0},body(e),{"&::backdrop":{backgroundColor:(e.vars||e).palette.background.default}})},r),o=(n=e.components)==null||(n=n.MuiCssBaseline)==null?void 0:n.styleOverrides;return o&&(i=[i,o]),i};function CssBaseline(e){let{children:t,enableColorScheme:n=!1}=dn({props:e,name:`MuiCssBaseline`});return(0,X.jsxs)($.Fragment,{children:[(0,X.jsx)(Un,{styles:e=>styles(e,n)}),t]})}ea(),wr();function getFormGroupUtilityClass(e){return Ji(`MuiFormGroup`,e)}Yn(`MuiFormGroup`,[`root`,`row`,`error`]),ri(),yi(),di(),Xi(),Br(),sr();var mC=[`className`,`row`],hC=e(e=>{let{classes:t,row:n,error:r}=e;return Qn({root:[`root`,n&&`row`,r&&`error`]},getFormGroupUtilityClass,t)},`useUtilityClasses`),gC=Hi(`div`,{name:`MuiFormGroup`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.row&&t.row]}})(({ownerState:e})=>Er({display:`flex`,flexDirection:`column`,flexWrap:`wrap`},e.row&&{flexDirection:`row`})),_C=$.forwardRef(function FormGroup(e,t){let n=dn({props:e,name:`MuiFormGroup`}),{className:r,row:i=!1}=n,o=Ni(n,mC),s=kt(),c=zr({props:n,muiFormControl:s,states:[`error`]}),p=Er({},n,{row:i,error:c.error}),m=hC(p);return(0,X.jsx)(gC,Er({className:xi(m.root,r),ownerState:p,ref:t},o))});yi(),_r(),Wi();function useSnackbar(e={}){let{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:r,open:i,resumeHideDuration:o}=e,s=vn();$.useEffect(()=>{if(!i)return;function handleKeyDown(e){e.defaultPrevented||(e.key===`Escape`||e.key===`Esc`)&&r?.(e,`escapeKeyDown`)}
212return document.addEventListener(`keydown`,handleKeyDown),()=>{document.removeEventListener(`keydown`,handleKeyDown)}},[i,r]);let c=nn((e,t)=>{r?.(e,t)}),p=nn(e=>{!r||e==null||s.start(e,()=>{c(null,`timeout`)})});$.useEffect(()=>(i&&p(t),s.clear),[i,t,p,s]);let handleClickAway=e=>{r?.(e,`clickaway`)},m=s.clear,h=$.useCallback(()=>{t!=null&&p(o??t*.5)},[t,o,p]),createHandleBlur=e=>t=>{let n=e.onBlur;n?.(t),h()},createHandleFocus=e=>t=>{let n=e.onFocus;n?.(t),m()},createMouseEnter=e=>t=>{let n=e.onMouseEnter;n?.(t),m()},createMouseLeave=e=>t=>{let n=e.onMouseLeave;n?.(t),h()};$.useEffect(()=>{if(!n&&i)return window.addEventListener(`focus`,h),window.addEventListener(`blur`,m),()=>{window.removeEventListener(`focus`,h),window.removeEventListener(`blur`,m)}},[n,i,h,m]);let getRootProps=(t={})=>{let n=Er({},Pr(e),Pr(t));return Er({role:`presentation`},t,n,{onBlur:createHandleBlur(n),onFocus:createHandleFocus(n),onMouseEnter:createMouseEnter(n),onMouseLeave:createMouseLeave(n)})};return{getRootProps,onClickAway:handleClickAway}}ea(),wr();function getSnackbarContentUtilityClass(e){return Ji(`MuiSnackbarContent`,e)}var vC=Yn(`MuiSnackbarContent`,[`root`,`message`,`action`]);ri(),yi(),di(),Xi();var yC=Qr();Br(),sr();var bC=[`action`,`className`,`message`,`role`],xC=e(e=>{let{classes:t}=e;return Qn({root:[`root`],action:[`action`],message:[`message`]},getSnackbarContentUtilityClass,t)},`useUtilityClasses`),SC=Hi(Fr,{name:`MuiSnackbarContent`,slot:`Root`,overridesResolver:(e,t)=>t.root})(({theme:e})=>{let t=e.palette.mode===`light`?.8:.98,n=(0,yC.emphasize)(e.palette.background.default,t);return Er({},e.typography.body2,{color:e.vars?e.vars.palette.SnackbarContent.color:e.palette.getContrastText(n),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:n,display:`flex`,alignItems:`center`,flexWrap:`wrap`,padding:`6px 16px`,borderRadius:(e.vars||e).shape.borderRadius,flexGrow:1,[e.breakpoints.up(`sm`)]:{flexGrow:`initial`,minWidth:288}})}),CC=Hi(`div`,{name:`MuiSnackbarContent`,slot:`Message`,overridesResolver:(e,t)=>t.message})({padding:`8px 0`}),wC=Hi(`div`,{name:`MuiSnackbarContent`,slot:`Action`,overridesResolver:(e,t)=>t.action})({display:`flex`,alignItems:`center`,marginLeft:`auto`,paddingLeft:16,marginRight:-8}),TC=$.forwardRef(function SnackbarContent(e,t){let n=dn({props:e,name:`MuiSnackbarContent`}),{action:r,className:i,message:o,role:s=`alert`}=n,c=Ni(n,bC),p=n,m=xC(p);return(0,X.jsxs)(SC,Er({role:s,square:!0,elevation:6,className:xi(m.root,i),ownerState:p,ref:t},c,{children:[(0,X.jsx)(CC,{className:m.message,ownerState:p,children:o}),r?(0,X.jsx)(wC,{className:m.action,ownerState:p,children:r}):null]}))});ea(),wr();function getSnackbarUtilityClass(e){return Ji(`MuiSnackbar`,e)}Yn(`MuiSnackbar`,[`root`,`anchorOriginTopCenter`,`anchorOriginBottomCenter`,`anchorOriginTopRight`,`anchorOriginBottomRight`,`anchorOriginTopLeft`,`anchorOriginBottomLeft`]),ri(),yi(),Xi(),zi(),Br(),sr(),fr();var EC=[`onEnter`,`onExited`],DC=[`action`,`anchorOrigin`,`autoHideDuration`,`children`,`className`,`ClickAwayListenerProps`,`ContentProps`,`disableWindowBlurListener`,`message`,`onBlur`,`onClose`,`onFocus`,`onMouseEnter`,`onMouseLeave`,`open`,`resumeHideDuration`,`TransitionComponent`,`transitionDuration`,`TransitionProps`],useUtilityClasses=e=>{let{classes:t,anchorOrigin:n}=e,r={root:[`root`,`anchorOrigin${hr(n.vertical)}${hr(n.horizontal)}`]};return Qn(r,getSnackbarUtilityClass,t)},OC=Hi(`div`,{name:`MuiSnackbar`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`anchorOrigin${hr(n.anchorOrigin.vertical)}${hr(n.anchorOrigin.horizontal)}`]]}})(({theme:e,ownerState:t})=>{let n={left:`50%`,right:`auto`,transform:`translateX(-50%)`};return Er({zIndex:(e.vars||e).zIndex.snackbar,position:`fixed`,display:`flex`,left:8,right:8,justifyContent:`center`,alignItems:`center`},t.anchorOrigin.vertical===`top`?{top:8}:{bottom:8},t.anchorOrigin.horizontal===`left`&&{justifyContent:`flex-start`},t.anchorOrigin.horizontal===`right`&&{justifyContent:`flex-end`},{[e.breakpoints.up(`sm`)]:Er({},t.anchorOrigin.vertical===`top`?{top:24}:{bottom:24},t.anchorOrigin.horizontal===`center`&&n,t.anchorOrigin.horizontal===`left`&&{left:24,right:`auto`},t.anchorOrigin.horizontal===`right`&&{right:24,left:`auto`})})}),kC=$.forwardRef(function Snackbar(e,t){let n=dn({props:e,name:`MuiSnackbar`}),r=Fi(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{action:o,anchorOrigin:{vertical:s,horizontal:c}={vertical:`bottom`,horizontal:`left`},autoHideDuration:p=null,children:m,className:h,ClickAwayListenerProps:g,ContentProps:_,disableWindowBlurListener:v=!1,message:y,open:b,TransitionComponent:x=Vt,transitionDuration:S=i,TransitionProps:{onEnter:C,onExited:w}={}}=n,T=Ni(n.TransitionProps,EC),E=Ni(n,DC),D=Er({},n,{anchorOrigin:{vertical:s,horizontal:c},autoHideDuration:p,disableWindowBlurListener:v,TransitionComponent:x,transitionDuration:S}
212),O=useUtilityClasses(D),{getRootProps:k,onClickAway:ee}=useSnackbar(Er({},D)),[te,A]=$.useState(!0),j=Ai({elementType:OC,getSlotProps:k,externalForwardedProps:E,ownerState:D,additionalProps:{ref:t},className:[O.root,h]}),handleExited=e=>{A(!0),w&&w(e)},handleEnter=(e,t)=>{A(!1),C&&C(e,t)};return!b&&te?null:(0,X.jsx)(ClickAwayListener,Er({onClickAway:ee},g,{children:(0,X.jsx)(OC,Er({},j,{children:(0,X.jsx)(x,Er({appear:!0,in:b,timeout:S,direction:s===`top`?`down`:`up`,onEnter:handleEnter,onExited:handleExited},T,{children:m||(0,X.jsx)(TC,Er({message:y,action:o},_))}))}))}))}),createConfig=e=>{let t=getEnvironmentVariables();validateEnvironmentVariables(t);let n=t.REACT_APP_DERIBIT_API,r=t.REACT_APP_FORCE_INSECURE_PROTOCOLS===`true`?`http`:`https`;return{featureToggles:{isCustomPagesEnabled:!0,isTvChartIdleTimerEnabled:!1,isHistoryClientLastTradesEnabled:!0,isHistoryClientUserTradesEnabled:!1,isKeyValueStoreEnabled:t.REACT_APP_FEATURE_TOGGLE_KEY_VALUE_STORE===`true`,isNotesComponentEnabled:!0,isMarginBufferEnabled:!0,isPasswordSaltingEnabled:!0,isSpotEnabled:!0,isPutCallRatioChartEnabled:t.REACT_APP_DERIBIT_IS_TEST===`true`,isOptionWizardEnabled:!0,isSpotPdfReportEnabled:t.REACT_APP_DERIBIT_IS_TEST===`true`,isEconomicCalendarEnabled:!0,isPriceLadderEnabled:!0,isDashboardEnabled:!0,isHeaderDashboardButtonEnabled:!0,isFuturesSpreadsMatrixEnabled:!0,isTakeProfitStopLossEnabled:!0,isTravelRuleEnabled:!0,isSciChartEnabled:!1,isDashboardAcademyEnabled:!0,isSharePositionEnabled:!0,isMarketMetricsEnabled:!0,isBlockTradeApprovalEnabled:!0,isOptionsMarketOrderTypeEnabled:!0,isUAEReduceOnlyEnabled:!0,isLiquidationsChartEnabled:!0,isOptionsChartEnabled:t.REACT_APP_OPTIONS_CHART_ENABLED===`true`,isMarketOrderValidationEnabled:!1,isGoogleLoginEnabled:t.REACT_APP_IS_GOOGLE_LOGIN_ENABLED===`true`,isAppleLoginEnabled:t.REACT_APP_IS_APPLE_LOGIN_ENABLED===`true`,isWithdrawalClearanceEnabled:t.REACT_APP_WITHDRAWAL_CLEARANCE_ENABLED===`true`,isSecurityPageV2Enabled:!0,isZendeskChatEnabled:!!t.REACT_APP_ZENDESK_CHAT_KEY,isKycEddChangesEnabled:!0,isCurrencyRewardEnabled:t.REACT_APP_DERIBIT_IS_TEST===`true`,isTaxInformationStepEnabled:!1,isEtdQuizEnabled:t.REACT_APP_DERIBIT_IS_TEST===`true`,isCategorizationStepEnabled:!0,isVatCountryEnabled:!0,isMultiNationalitiesEnabled:!0,isMultiLegEnabled:t.REACT_APP_DERIBIT_IS_TEST===`true`,isUpdatedVaraOnboardingEnabled:!0,isExtraFilesArrayEnabled:t.REACT_APP_DERIBIT_IS_TEST===`true`,isLegendTradingEnabled:!0,isMarkPriceChartEnabled:!1,isCoinbaseSignUpRedirectEnabled:t.REACT_APP_COINBASE_SIGN_UP_REDIRECT_ENABLED===`true`,isNewRegisterFlowEnabled:t.REACT_APP_NEW_REGISTER_FLOW_ENABLED===`true`,isUbo2RegisterRedirectEnabled:t.REACT_APP_UBO2_REGISTER_REDIRECT_ENABLED===`true`},deribitClient:{clientVersion:t.REACT_APP_GIT_COMMIT_SHA,isLocalInstance:t.REACT_APP_DERIBIT_LOCAL_INSTANCE===`true`,forceInsecureProtocols:t.REACT_APP_FORCE_INSECURE_PROTOCOLS===`true`,publicHost:t.REACT_APP_DERIBIT_API_PUBLIC,publicHostFallback:t.REACT_APP_DERIBIT_API_PUBLIC_FALLBACK,publicStreamPath:t.REACT_APP_DERIBIT_API_PUBLIC_STREAM_PATH,publicStreamPathFallback:t.REACT_APP_DERIBIT_API_PUBLIC_STREAM_PATH_FALLBACK,historyHost:t.REACT_APP_DERIBIT_API_HISTORY,apiHost:n},metricsApi:{apiUrl:t.REACT_APP_METRICS_API||``},sentry:{dsn:t.REACT_APP_SENTRY_DSN,environment:t.REACT_APP_SENTRY_ENVIRONMENT,release:t.REACT_APP_GIT_COMMIT_SHA},apiConsole:{host:t.REACT_APP_DERIBIT_API_CONSOLE||`${r}://${n}`},news:{apiUrl:t.REACT_APP_NEWS_API||``},env:{isTest:t.REACT_APP_DERIBIT_IS_TEST===`true`,isCookieProtectionEnabled:t.REACT_APP_IS_COOKIE_PROTECTION_ENABLED===`true`,testDomain:t.REACT_APP_DERIBIT_TEST_DOMAIN||``,environment:t.NODE_ENV||`production`},sandbox:{sandboxUrl:t.REACT_APP_SANDBOX_URL||``,sandboxPath:t.REACT_APP_SANDBOX_PATH,sandboxParentOrigin:t.REACT_APP_SANDBOX_PARENT_ORIGIN},publicUrl:t.PUBLIC_URL||window.location.origin,globalDomain:t.REACT_APP_DOMAIN_GLOBAL,coinbaseSignUpUrl:t.REACT_APP_COINBASE_SIGN_UP_URL||`https://login.coinbase.com/signup`,analytics:{projectToken:t.REACT_APP_ANALYTICS_PROJECT_TOKEN||``,apiHost:t.REACT_APP_ANALYTICS_API_HOST,debug:t.REACT_APP_ANALYTICS_DEBUG===`true`},landingPage:{apiUrl:t.REACT_APP_LANDING_PAGE_API||``,isUnavailable:t.REACT_APP_LANDING_PAGE_IS_UNAVAILABLE===`true`},dataApi:{apiUrl:t.REACT_APP_DATA_API||``},cbeApi:{apiUrl:t.REACT_APP_CBE_API_URL||``,wsUrl:t.REACT_APP_CBE_WS_URL||``},whitelistApi:{usycUrl:t.REACT_APP_USYC_API||``,buidlUrl:t.REACT_APP_BUIDL_API||``},platformConfig:e}};function getEnvironmentVariables(){return{REACT_APP_CSP_ENABLED:`true`,REACT_APP_DERIBIT_TEST_DOMAIN:`test.deribit.com`,REACT_APP_DOMAIN_GLOBAL:`deribit.com`,REACT_APP_GIT_COMMIT_SHA:`3dcc281a8e79fff17adf3e75579634b27b7debb6`,REACT_APP_IS_APPLE_LOGIN_ENABLED:`true`,REACT_APP_IS_GOOGLE_LOGIN_ENABLED:`true`,REACT_APP_WITHDRAWAL_CLEARANCE_ENABLED:`false`,REACT_APP_BUIDL_API:`https://public-feed.securitize.io`,REACT_APP_CBE_API_URL:`https://api.exchange.coinbase.com`,REACT_APP_CBE_WS_URL:`wss://ws-feed.exchange.coinbase.com`,REACT_APP_DATA_API:`https://data.deribit.com`,REACT_APP_DERIBIT_IS_TEST:`false`,REACT_APP_LANDING_PAGE_API:`https://landing-page-backend.deribit.com`,REACT_APP_METRICS_API:`https://metrics.deribit.com`,REACT_APP_NEWS_API:`https://newsfeed.deribit.com`,REACT_APP_USYC_API:`https://api.hashnote.com`,REACT_APP_TRAVEL_RULE_ENABLED:`false`,REACT_APP_GOOGLE_TAG_ID:`GTM-TNQCFF86`,REACT_APP_PROOF_OF_RESERVES_API:`https://por.deribit.com`,REACT_APP_SENTRY_DSN:`https://[email protected]/6454438`,REACT_APP_SENTRY_ENVIRONMENT:`production`,REACT_APP_SANDBOX_PARENT_ORIGIN:`https://www.deribit.com`,REACT_APP_DERIBIT_API_PUBLIC_FALLBACK:`www.deribit.com`,REACT_APP_CONTRACT_MULTIPLIERS_ENABLED:`false`,REACT_APP_IS_COOKIE_PROTECTION_ENABLED:`true`,REACT_APP_SANDBOX_URL:`https://assets.deribit.com`,REACT_APP_DERIBIT_API:`www.deribit.com`,REACT_APP_MATOMO_SITE_ID:`1`,NODE_ENV:`production`,PUBLIC_URL:`https://assets.deribit.com`}.REACT_APP_DERIBIT_ENV===`true`&&window.__DERIBIT_ENV?{REACT_APP_CSP_ENABLED:`true`,REACT_APP_DERIBIT_TEST_DOMAIN:`test.deribit.com`,REACT_APP_DOMAIN_GLOBAL:`deribit.com`,REACT_APP_GIT_COMMIT_SHA:`3dcc281a8e79fff17adf3e75579634b27b7debb6`,REACT_APP_IS_APPLE_LOGIN_ENABLED:`true`,REACT_APP_IS_GOOGLE_LOGIN_ENABLED:`true`,REACT_APP_WITHDRAWAL_CLEARANCE_ENABLED:`false`,REACT_APP_BUIDL_API:`https://public-feed.securitize.io`,REACT_APP_CBE_API_URL:`https://api.exchange.coinbase.com`,REACT_APP_CBE_WS_URL:`wss://ws-feed.exchange.coinbase.com`,REACT_APP_DATA_API:`https://data.deribit.com`,REACT_APP_DERIBIT_IS_TEST:`false`,REACT_APP_LANDING_PAGE_API:`https://landing-page-backend.deribit.com`,REACT_APP_METRICS_API:`https://metrics.deribit.com`,REACT_APP_NEWS_API:`https://newsfeed.deribit.com`,REACT_APP_USYC_API:`https://api.hashnote.com`,REACT_APP_TRAVEL_RULE_ENABLED:`false`,REACT_APP_GOOGLE_TAG_ID:`GTM-TNQCFF86`,REACT_APP_PROOF_OF_RESERVES_API:`https://por.deribit.com`,REACT_APP_SENTRY_DSN:`https://[email protected]/6454438`,REACT_APP_SENTRY_ENVIRONMENT:`production`,REACT_APP_SANDBOX_PARENT_ORIGIN:`https://www.deribit.com`,REACT_APP_DERIBIT_API_PUBLIC_FALLBACK:`www.deribit.com`,REACT_APP_CONTRACT_MULTIPLIERS_ENABLED:`false`,REACT_APP_IS_COOKIE_PROTECTION_ENABLED:`true`,REACT_APP_SANDBOX_URL:`https://assets.deribit.com`,REACT_APP_DERIBIT_API:`www.deribit.com`,REACT_APP_MATOMO_SITE_ID:`1`,NODE_ENV:`production`,PUBLIC_URL:`https://assets.deribit.com`,...window.__DERIBIT_ENV}:{REACT_APP_CSP_ENABLED:`true`,REACT_APP_DERIBIT_TEST_DOMAIN:`test.deribit.com`,REACT_APP_DOMAIN_GLOBAL:`deribit.com`,REACT_APP_GIT_COMMIT_SHA:`3dcc281a8e79fff17adf3e75579634b27b7debb6`,REACT_APP_IS_APPLE_LOGIN_ENABLED:`true`,REACT_APP_IS_GOOGLE_LOGIN_ENABLED:`true`,REACT_APP_WITHDRAWAL_CLEARANCE_ENABLED:`false`,REACT_APP_BUIDL_API:`https://public-feed.securitize.io`,REACT_APP_CBE_API_URL:`https://api.exchange.coinbase.com`,REACT_APP_CBE_WS_URL:`wss://ws-feed.exchange.coinbase.com`,REACT_APP_DATA_API:`https://data.deribit.com`,REACT_APP_DERIBIT_IS_TEST:`false`,REACT_APP_LANDING_PAGE_API:`https://landing-page-backend.deribit.com`,REACT_APP_METRICS_API:`https://metrics.deribit.com`,REACT_APP_NEWS_API:`https://newsfeed.deribit.com`,REACT_APP_USYC_API:`https://api.hashnote.com`,REACT_APP_TRAVEL_RULE_ENABLED:`false`,REACT_APP_GOOGLE_TAG_ID:`GTM-TNQCFF86`,REACT_APP_PROOF_OF_RESERVES_API:`https://por.deribit.com`,REACT_APP_SENTRY_DSN:`https://[email protected]/6454438`,REACT_APP_SENTRY_ENVIRONMENT:`production`,REACT_APP_SANDBOX_PARENT_ORIGIN:`https://www.deribit.com`,REACT_APP_DERIBIT_API_PUBLIC_FALLBACK:`www.deribit.com`,REACT_APP_CONTRACT_MULTIPLIERS_ENABLED:`false`,REACT_APP_IS_COOKIE_PROTECTION_ENABLED:`true`,REACT_APP_SANDBOX_URL:`https://assets.deribit.com`,REACT_APP_DERIBIT_API:`www.deribit.com`,REACT_APP_MATOMO_SITE_ID:`1`,NODE_ENV:`production`,PUBLIC_URL:`https://assets.deribit.com`}}function validateEnvironmentVariables(e){e.NODE_ENV!==`test`&&(e.REACT_APP_DOMAIN_GLOBAL||console.error(`Environment variable REACT_APP_DOMAIN_GLOBAL is not defined.`),e.REACT_APP_DERIBIT_IS_TEST===`true`&&!e.REACT_APP_DERIBIT_TEST_DOMAIN&&console.error(`Environment variable REACT_APP_DERIBIT_TEST_DOMAIN is not defined.`),e.REACT_APP_DERIBIT_API||console.error(`Environment variable REACT_APP_DERIBIT_API is not defined.`),e.REACT_APP_LANDING_PAGE_API||console.error(`Environment variable REACT_APP_LANDING_PAGE_API is not defined.`))}oa();var AC=Gn((0,X.jsx)(`path`,{d:`m10 17 5-5-5-5z`}),`ArrowRight`);oa();var jC=Gn([(0,X.jsx)(`path`,{d:`M21 19.1H3V5h18zM21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2`},`0`),(0,X.jsx)(`path`,{d:`M14.59 8 12 10.59 9.41 8 8 9.41 10.59 12 8 14.59 9.41 16 12 13.41 14.59 16 16 14.59 13.41 12 16 9.41z`},`1`)],`CancelPresentation`);oa();var MC=Gn((0,X.jsx)(`path`,{d:`M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z`}),`ChevronLeft`);oa();var NC=Gn((0,X.jsx)(`path`,{d:`M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z`}),`ChevronRight`);oa();var PC=Gn((0,X.jsx)(`path`,{d:`M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z`}),`Warning`),FC=3e4,IC={fetchStatus:`idle`,saveStatus:`idle`,saveError:null,error:null,activeNoteId:null,notes:null,notesCache:null},LC=Ut(`notes/fetchNotes`,async({userId:e},t)=>await t.extra.appStorageService.get({userId:e,key:`notes`})),RC=Ut(`notes/saveNotes`,async({userId:e,notes:t,force:n=!1},r)=>{let{notesCache:i}=r.getState().notes,o;for(let e of Object.values(t))if(!i||!(e.id in i)||i[e.id].value!==e.value){o=e.id;break}if(!o)return r.rejectWithValue({reason:`noteIdNotFound`});if(t[o].value.length>FC)return r.rejectWithValue({reason:`lengthLimitExceeded`,details:{lengthLimit:FC}});let s=await r.extra.appStorageService.get({userId:e,key:`notes`}),c=i?.[o],p=s?.[o];return!n&&c&&p&&c.value!==p.value?r.rejectWithValue({reason:`conflict`,details:{remoteNoteValue:p.value}}):(await r.extra.appStorageService.save({userId:e,key:`notes`,value:t}),t)},{condition:({notes:e},{getState:t})=>{let{notesCache:n}=t().notes;if(!n)return;let isNoteEqual=e=>Du(Nr(e,[`savedAt`]),Nr(n[e.id],[`savedAt`]));if(Object.values(e).every(isNoteEqual))return!1},dispatchConditionRejection:!0}
212),zC=Nn({name:`notes`,initialState:IC,reducers:{setActiveNoteId(e,{payload:t}){e.activeNoteId=t},setSaveStatus(e,{payload:t}){e.saveStatus=t,e.saveError=null},saveNote(e,{payload:{id:t,name:n,value:r}}){e.notes||={},e.notes[t]={id:t,name:n,value:r,savedAt:new Date().toISOString()}}},extraReducers:e=>{e.addCase(nd.clearUserData.type,()=>IC),e.addCase(LC.pending,e=>{e.fetchStatus=`fetching`,e.saveStatus=`idle`,e.saveError=null,e.error=null}),e.addCase(LC.fulfilled,(e,t)=>{e.notes=t.payload,e.notesCache=t.payload,e.fetchStatus=`fetched`}),e.addCase(LC.rejected,(e,t)=>{e.fetchStatus=`error`,e.error=t.error}),e.addCase(RC.pending,e=>{e.saveStatus=`saving`,e.saveError=null,e.error=null}),e.addCase(RC.fulfilled,(e,t)=>{e.notesCache=t.payload,e.saveStatus=`saved`}),e.addCase(RC.rejected,(e,t)=>{if(t.meta.condition){e.saveStatus=`saved`;return}e.saveStatus=`error`,e.saveError=t.payload??null,e.error=t.error})}}),BC=zC.actions,VC={fetchNotes:LC,saveNotes:RC},HC=zC.reducer,UC=Cn({user:cd,inventory:cC,starbase:pC,settings:Wu,notes:HC,theme:sf}),setupStore=({deribitClient:e,preloadedState:t,userSettingsService:n,appStorageService:r})=>{let i={deribitClient:e,userSettingsService:n,appStorageService:r};return Jt({reducer:UC,middleware:e=>e({thunk:{extraArgument:i}}),preloadedState:t,devTools:!1})};V();var WC=vd(({palette:e})=>({label:{textAlign:`right`,color:e.text.secondary}})),GC=P(`div`)(({theme:e})=>z`
213    display: flex;
214    gap: ${e.spacing(2)};
215    max-width: 600px;
216    align-items: flex-start;
217
218    p:first-of-type {
219      margin-top: 0;
220    }
221
222    a {
223      font-weight: bold;
224      text-decoration: underline;
225    }
226
227    strong {
228      color: ${e.palette.primary.main};
229      font-weight: bold;
230    }
231
232    ${e.breakpoints.down(`sm`)} {
233      flex-direction: column-reverse;
234      align-items: center;
235    }
236  `),KC=mi(aa),qC=P(KC)`
237  flex: 1 0 98px;
238  width: 98px;
239`,JC=P(wp)`
240  flex: 1 0 100%;
241
242  .${on.root} {
243    svg {
244      font-size: 1.25rem;
245    }
246  }
247
248  .${_p.label} {
249    font-size: 14px;
250  }
251`,activateAccount=async(e,t)=>{let n,r=!1;try{await t.activateAccount({code:e}),n=(0,X.jsx)(N,{id:`landingScreen.common.yourAccountHasBeenConfirmed`})}catch(e){r=!0,n=(0,X.jsx)(N,{id:`landingScreen.common.yourAccountHasNotBeenActivated`}),console.log(e)}Y.notify({isError:r,message:n})},editLinkedBroker=async(e,t)=>{try{await t(xd.editLinkedBroker({broker_code:e,state:`pending`}))}catch(e){let t=(0,X.jsx)(N,{id:`tradeScreen.phoneBrokers.brokenLink`});Y.notify({isError:!0,message:t}),console.error(e)}},getFormattedAmount=(e,t)=>sa(Lt(t,$t(e),Math.round),e),YC=e(e=>dd(e)?e.data===`invalid_code`||e.data?.param===`code`?(0,X.jsx)(N,{id:`commonScreen.common.invalidOrExpiredCode`}):e.message:R._({id:`commonScreen.common.somethingWentWrong`}),`getErrorMessage`),XC=e(({dialogHeader:e,labelsValuesInfo:t})=>{let n=WC();return(0,X.jsxs)($i,{container:!0,justifyContent:`center`,spacing:2,style:{maxWidth:`700px`},children:[(0,X.jsx)($i,{container:!0,item:!0,xs:12,justifyContent:`center`,children:(0,X.jsx)(`h3`,{children:e})}),t?.map(e=>(0,X.jsxs)($.Fragment,{children:[(0,X.jsx)($i,{className:n.label,item:!0,xs:6,children:e.label}),(0,X.jsx)($i,{item:!0,xs:6,children:e.value})]},e.value))]})},`Content`),LockAccountContent=({email:e,onDisableApiKeys:t})=>(0,X.jsxs)(GC,{children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(N,{values:{email:e},components:{0:(0,X.jsx)(`p`,{}),1:(0,X.jsx)(`strong`,{}),2:(0,X.jsx)(`p`,{}),3:(0,X.jsx)(`a`,{href:`mailto:[email protected]`}),4:(0,X.jsx)(`p`,{})},id:`commonScreen.common.securityKeysReset.areYouSureThatYouWantToLockAccessToAccountWithEmail`}),(0,X.jsx)(JC,{control:(0,X.jsx)(vp,{onChange:(e,n)=>{t(n)},color:`primary`,defaultChecked:!0}),label:R._({id:`commonScreen.common.disableApiKeys`})})]}),(0,X.jsx)(qC,{name:`lock-account`})]}),handleActionWithExtraConfirmation=async({deribitClient:e,queryParams:t,currency:n,suppressNotification:r,onConfirmCallback:i})=>{let{action:o,code:s,address:c,id:p}=t,{decimals:m}=Or(n);if(s){let t,h=!1,onConfirm,g,_,v,y;switch(o){case`withdraw`:onConfirm=()=>e.confirmWithdrawal({code:s,approve:!0}),t=(0,X.jsx)(N,{id:`accountScreen.withdraw.yourRequestToWithdraw
251HasBeenConfirmed`}),g=(0,X.jsx)(N,{id:`accountScreen.withdraw.withdrawalDetails`});try{let{email:t,address:r,amount:i,fee:o,network_display_name:c,destination_tag:p}=await e.getWithdrawal({code:s}),h=`${getFormattedAmount(m.transfers,i)} ${n}`;v=[{label:(0,X.jsx)(N,{id:`commonScreen.common.account`}),value:t},{label:(0,X.jsx)(N,{id:`accountScreen.common.address`}),value:r}],c!=null&&v.push({label:(0,X.jsx)(N,{id:`accountScreen.common.network`}),value:c}),p!=null&&v.push({label:(0,X.jsx)(N,{id:`accountScreen.common.tag`}),value:p}),v.push({label:(0,X.jsx)(N,{id:`accountScreen.common.amount`}),value:h}),o!=null&&v.push({label:(0,X.jsx)(N,{id:`accountScreen.withdraw.estimatedFee`}),value:`${getFormattedAmount(m.transfers,o)} ${n}`})}catch(e){h=!0,t=YC(e),console.log(e)}break;case`disable_withdrawal_mail_confirmation`:n&&c&&(onConfirm=()=>e.confirmChangeWithdrawalsConfirmations({address:c,currency:n,type:`withdrawal`,code:s,...p?{id:p}:{}}),t=(0,X.jsx)(N,{values:{address:c},id:`accountScreen.common.emailConfirmationsTurnedOff`}),g=(0,X.jsx)(N,{values:{currency:n,address:c},id:`accountScreen.withdraw.disableEmailConfirmationsOnWithdrawalsToAddress`}));break;case`transfer`:onConfirm=()=>e.confirmTransfer({code:s,approve:!0}),t=(0,X.jsx)(N,{id:`accountScreen.transfer.yourRequestToTransferHasBeenConfirmed`}),g=(0,X.jsx)(N,{id:`accountScreen.transfer.transferDetails`});try{let t=await e.getTransfer({code:s});v=[{label:(0,X.jsx)(N,{id:`accountScreen.common.address`}),value:t.other_side_address},{label:(0,X.jsx)(N,{id:`accountScreen.common.amount`}),value:`${t.amount} ${t.currency}`}]}catch(e){h=!0,t=YC(e),console.log(e)}break;case`transfer_cancel`:onConfirm=()=>e.confirmTransfer({code:s,approve:!1}),t=(0,X.jsx)(N,{id:`accountScreen.transfer.yourTransferRequestHasBeenCancelled`}),g=(0,X.jsx)(N,{id:`accountScreen.transfer.cancelTheTransfer`});break;case`disable_transfer_mail_confirmation`:n&&c&&(onConfirm=()=>e.confirmChangeWithdrawalsConfirmations({address:c,currency:n,type:`transfer`,code:s,...p?{id:p}:{}}),t=(0,X.jsx)(N,{values:{address:c},id:`accountScreen.common.emailConfirmationsTurnedOff`}),g=(0,X.jsx)(N,{values:{currency:n,otherSideAddress:c},id:`accountScreen.transfer.disableEmailConfirmationsOnTransfersToAddress`}))}y||=(0,X.jsx)(XC,{labelsValuesInfo:v,dialogHeader:g}),h?r||Y.notify({isError:!0,message:t}):Zu.open({type:Mu.confirm,contentProps:{onCancel:()=>{Zu.close()},onConfirm:async()=>{try{await onConfirm(),Zu.close(),i&&i()}catch(e){console.log(e),h=!0,t=YC(e)}r||Y.notify({isError:h,message:t})},content:y,dialogTitle:_}})}},useLinkActionHandling=e=>{let t=yt(),n=St(),r=hu(),i=Ti(),o=Pn(),s=B(ji),c=Ou(n.search),[p,m]=(0,$.useState)(null);return(0,$.useEffect)(()=>{switch(c.action){case`link_broker`:editLinkedBroker(c.code,o),t(ht(si.accountLinkedPhoneBrokers,{currency:r})),m(!0);return;case`confirm_account`:activateAccount(c.code,i),m(!1);return;case`reset_password_confirmation`:t(`/reset_password`,{state:c.code,replace:!0}),m(!0);return;case`resend_activation_mail`:t(`/resend_activation_email`,{replace:!0}),m(!0);return;case`set_secondary_email_confirm`:t(`/confirm_secondary_email`,{state:{code:c.code,mode:`set`},replace:!0}),m(!0);return;case`remove_secondary_email_confirm`:t(`/confirm_secondary_email`,{state:{code:c.code,mode:`remove`},replace:!0}),m(!0);return;case`account_removal`:t(`/close_account`,{state:{code:c.code},replace:!0}),m(!0);return;case`disable_withdrawal_mail_confirmation`:case`disable_transfer_mail_confirmation`:if(!s){let e=ht(c.action===`disable_withdrawal_mail_confirmation`?si.accountWithdraw:si.accountTransfer,{[jn.currency]:r});t(`${e}${n.search}`,{replace:!0}),m(!0);return}handleActionWithExtraConfirmation({deribitClient:i,queryParams:c,currency:r,onConfirmCallback:e}),m(!1);return;case`withdraw`:case`transfer`:case`transfer_cancel`:handleActionWithExtraConfirmation({deribitClient:i,queryParams:c,currency:r,onConfirmCallback:e}),m(!1);return;case`security_key_reset_confirm`:case`security_key_reset_cancel`:case`lock_account`:case`withdraw_cancel`:handleAction(c,i),m(!1);return;case`onboard`:t(`/set_password`,{state:{code:c.code,email:c.email},replace:!0}),m(!0);return}m(!1)},[]),p};async function getModalData(e,t){let onConfirm=()=>{},onCancel=()=>{},n,r,i,o,s;switch(e.action){case`security_key_reset_confirm`:onConfirm=async()=>{try{await t.confirmSecurityKeysReset({code:e.code}),Y.notify({message:R._({id:`commonScreen.common.securityKeysReset`})})}catch(e){console.log(e)}finally{Zu.close()}},onCancel=()=>{Zu.close()},n=R._({id:`commonScreen.common.securityKeysReset.confirm`});break;case`security_key_reset_cancel`:onConfirm=async()=>{try{await t.cancelSecurityKeysReset({code:e.code}),Y.notify({message:R._({id:`commonScreen.common.yourSecurityKeysCancelRequestHasBeenCancelled`})})}catch(e){console.log(e)}finally{Zu.close()}},onCancel=()=>{Zu.close()},n=R._({id:`commonScreen.common.securityKeysReset.cancel`});break;case`lock_account`:let c=!0;try{let{email:o}=await t.lockAccountCodeValidation({code:e.code});r=R._({id:`commonScreen.common.securityKeysReset.lockAccountTitle`}),i=R._({id:`commonScreen.common.securityKeysReset.lockAccountConfirm`}
251),s=`error`,n=(0,X.jsx)(LockAccountContent,{email:o,onDisableApiKeys:e=>{c=e}})}catch(e){throw e}onConfirm=async()=>{try{await t.lockAccount({code:e.code,disable_api_keys:c}),Y.notify({message:R._({id:`commonScreen.common.accessToTheAccountHasBeenLocked`})})}catch(e){Y.notify({isError:!0,message:YC(e)})}finally{Zu.close()}},onCancel=()=>{Zu.close()};break;case`withdraw_cancel`:onConfirm=async()=>{try{await t.getWithdrawal({code:e.code}),t.confirmWithdrawal({code:e.code,approve:!1}),Y.notify({message:R._({id:`accountScreen.withdraw.yourWithdrawalRequestHasBeenCancelled`})})}catch(e){Y.notify({isError:!0,message:YC(e)})}finally{Zu.close()}},onCancel=()=>{Zu.close()},r=R._({id:`accountScreen.withdraw.withdrawalCancellation`}),n=R._({id:`accountScreen.withdraw.areYouSureThatYouWantToCancelThisWithdrawal`}),i=R._({id:`accountScreen.withdraw.cancelWithdrawal`}),o=R._({id:`commonScreen.common.back`})}return{onConfirm,onCancel,content:n,dialogTitle:r,confirmLabel:i,cancelLabel:o,confirmColor:s}}async function handleAction(e,t){try{let{onCancel:n,onConfirm:r,content:i,dialogTitle:o,confirmLabel:s,cancelLabel:c,confirmColor:p}=await getModalData(e,t);Zu.open({type:Mu.confirm,contentProps:{onCancel:n,onConfirm:r,content:i,dialogTitle:o,confirmLabel:s,cancelLabel:c,confirmColor:p}})}catch(e){Y.notify({isError:!0,message:YC(e)})}}var getCookieValue=e=>{let t=document.cookie.split(`;`);for(let n=0;n<t.length;n++){let[r,i]=t[n].split(`=`);
251if(Ge(r)===e)return Ge(i)}return``},getAffiliate=()=>{let e=JSON.parse(localStorage.getItem(`affiliate`)||`null`);return e&&new Date().getTime()<e.expireTimestamp?e.value||``:getCookieValue(`d-aff`)},storeAffiliate=e=>{let t=new Date;t.setDate(t.getDate()+7),localStorage.setItem(`affiliate`,JSON.stringify({value:e,expireTimestamp:t.getTime()}))},createAffiliate=async({reg:e,q:t},n,r)=>{try{if(storeAffiliate(await n.getAffiliate({reg:e})),!t)return r(`/register`,{state:{reg:e}}),!0}catch(e){console.log(e)}return!1},useCreateAffiliate=e=>{let t=Ti(),n=yt(),r=nf(),[i,o]=(0,$.useState)(null);return(0,$.useEffect)(()=>{async function doTask(){if(r.reg&&!e){let e=await createAffiliate(r,t,n);o(e)}else o(!1)}doTask()},[r,e,n,t]),i},LandingPage=()=>{let e=B(ji);useCreateAffiliate(e),useLinkActionHandling();let t=Oi();return e?(0,X.jsx)(xt,{to:`/futures/BTC-PERPETUAL`,replace:!0}):t.env.environment===`development`||t.landingPage.isUnavailable?(0,X.jsx)(xt,{to:`/login`,replace:!0}):(window.location.href=`/`,null)},ZC=`/assets/linkedin-CGVUk34s.svg`,QC=`/assets/reddit-C33K_kXY.svg`,$C=`/assets/telegram-BcsBJtEs.svg`,ew=`/assets/twitter-exg73cx7.svg`;Ur();var tw=[[`X`,`https://x.com/DeribitOfficial`,ew],[`Telegram`,`/redirect?to=${Sn}`,$C],[`LinkedIn`,`https://linkedin.com/company/deribit`,ZC],[`Reddit`,`https://www.reddit.com/r/DeribitExchange/`,QC]],nw=Gi(Lr(tn));Hn();var rw=vd(e=>({wrapper:{display:`flex`,flexDirection:`column`,minHeight:`100vh`,backgroundColor:`#000`,color:`#fff`,justifyContent:`space-between`},header:{display:`flex`,flexWrap:`wrap`,justifyContent:`center`,alignItems:`center`,paddingTop:`35px`},main:{display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,padding:`0px 20px 0px 20px`},content:{flex:`1 1 100%`,flexDirection:`column`},title:{fontWeight:300,fontSize:`40px`,color:`#fff`,paddingBottom:`24px`,textAlign:`center`},subtitle:{color:`#fff`,fontWeight:400,fontSize:`20px`,paddingBottom:`44px`},footer:{display:`flex`,margin:`0px 40px 0px 40px`,padding:`22px 0px 22px 0px`,borderTop:`1px solid #fff`,justifyContent:`space-between`},footerMobile:{display:`flex`,margin:`40px 20px 0px 20px`,padding:`22px 0px 22px 0px`,borderTop:`1px solid #fff`,justifyContent:`space-between`},footerText:{fontSize:`12px`},footerTextMobile:{maxWidth:`30%`},list:{display:`flex`,width:`100%`,justifyContent:`center`,padding:`0px`,margin:`0px`,flexWrap:`wrap`,flexDirection:`row`,listStyleType:`none`,"& li > a":{color:e.palette.common.contrastText,marginLeft:`20px`,padding:`0px`,"&:hover":{color:e.palette.primary.main}}},button:{color:e.palette.common.white}})),iw=(0,X.jsx)(kr,{href:Ap,target:`_blank`,children:(0,X.jsx)(N,{id:`errorScreen.notFound.helpDocumentation`})}),aw=(0,X.jsx)(kr,{href:`/`,children:(0,X.jsx)(N,{id:`commonScreen.common.home`})}),ow=e(()=>({notFound:{title:R._({id:`errorScreen.notFound.title`}),subtitle:(0,X.jsx)(N,{values:{docsLink:iw,homeLink:aw},id:`errorScreen.notFound.subtitle`}),icon:(0,X.jsx)(jC,{style:{fontSize:`150px`}})},overLimit:{title:R._({id:`errorScreen.overLimit.title`}),subtitle:R._({id:`errorScreen.overLimit.subtitle`}),icon:(0,X.jsx)(jC,{style:{fontSize:`150px`}})}}),`getMessages`),ErrorPageContent=({type:e})=>{let t=rw(),{globalDomain:n}=Oi(),r=ow();return(0,X.jsx)(vr,{injectFirst:!0,children:(0,X.jsx)(Et,{theme:nw,children:(0,X.jsxs)($i,{className:t.content,container:!0,alignItems:`center`,justifyContent:`center`,item:!0,xs:!0,children:[r[e].icon,(0,X.jsx)($i,{item:!0,className:t.title,children:r[e].title}),(0,X.jsx)($i,{item:!0,className:t.subtitle,children:r[e].subtitle}),(0,X.jsx)($i,{item:!0,children:(0,X.jsx)(Dd,{variant:`contained`,color:`primary`,target:`_blank`,rel:`noopener noreferrer`,href:`https://insights.${n}/contact-us/`,className:t.button,children:R._({id:`maintenanceScreen.primaryButton`})})})]})})})},ErrorPage=({type:e})=>{let t=rw(),n=Gt();return(0,X.jsx)(vr,{injectFirst:!0,children:(0,X.jsx)(Et,{theme:nw,children:(0,X.jsxs)(I,{className:t.wrapper,children:[(0,X.jsx)(I,{className:t.header,children:(0,X.jsx)(sn,{width:128,forceDarkTheme:!0})}),(0,X.jsx)(I,{className:t.main,children:(0,X.jsx)(ErrorPageContent,{type:e})}),(0,X.jsxs)(I,{className:n?t.footerMobile:t.footer,children:[(0,X.jsxs)(I,{className:n?t.footerTextMobile:t.footerText,children:[R._({id:`maintenanceScreen.footer.copyright`}),` `,`© `,new Date().getFullYear(),` Deribit.`,` `,R._({id:`maintenanceScreen.footer.allRightsReserved`}),`.`]}),(0,X.jsx)(I,{children:(0,X.jsx)(`ul`,{className:t.list,children:tw.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsx)(`a`,{href:e[1],target:`_blank`,rel:`noopener noreferrer`,children:(0,X.jsx)(`img`,{src:e[2],alt:e[0],height:`25px`})})},`footer-list-menu-item-${e[1]}`))})})]})]})})})},RootErrorPage=()=>{throw wt()},ShortOptionRouteGuard=({children:e,redirectTo:t})=>Uu(yr)?(0,X.jsx)(X.Fragment,{children:e}):t?(0,X.jsx)(xt,{to:t,replace:!0}):(0,X.jsx)(ErrorPage,{type:`notFound`}),sw=`login-form.oauth-state`,useOAuthData=()=>{let[e,t,n]=df(sw,null);return(0,$.useMemo)(()=>({oAuthData:e,setOAuthData:t,removeOAuthData:n}),[e,n,t])},RegisterRedirectGuard=({children:e})=>{let{featureToggles:{isCoinbaseSignUpRedirectEnabled:t,isNewRegisterFlowEnabled:n},coinbaseSignUpUrl:r}=Oi(),i=B(Ln),{state:o}=St(),{couponCode:s}=vt(),{oAuthData:c}=useOAuthData(),p=oe({isRedirectEnabled:t&&!n,isLoggedIn:i,affiliateCode:getAffiliate(),hasOAuthRouteState:!!o?.authCodeParam,isOAuthSignUpSession:c?.type===`signUp`,hasCouponCode:!!s});return(0,$.useEffect)(()=>{p&&window.location.replace(r)},[p,r]),p?null:(0,X.jsx)(X.Fragment,{children:e})},cw=n(r(((e,t)=>{(function(){function polyfill(){var e=window,t=document;if(`scrollBehavior`in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;var n=e.HTMLElement||e.Element,r=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||scrollElement,scrollIntoView:n.prototype.scrollIntoView},o=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function isMicrosoftBrowser(e){return new RegExp([`MSIE `,`Trident/`,`Edge/`].join(`|`)).test(e)}var s=+!!isMicrosoftBrowser(e.navigator.userAgent);function scrollElement(e,t){this.scrollLeft=e,this.scrollTop=t}function ease(e){return .5*(1-Math.cos(Math.PI*e))}function shouldBailOut(e){if(typeof e!=`object`||!e||e.behavior===void 0||e.behavior===`auto`||e.behavior===`instant`)return!0;
251if(typeof e==`object`&&e.behavior===`smooth`)return!1;throw TypeError(`behavior member of ScrollOptions `+e.behavior+` is not a valid value for enumeration ScrollBehavior.`)}function hasScrollableSpace(e,t){if(t===`Y`)return e.clientHeight+s<e.scrollHeight;if(t===`X`)return e.clientWidth+s<e.scrollWidth}function canOverflow(t,n){var r=e.getComputedStyle(t,null)[`overflow`+n];return r===`auto`||r===`scroll`}function isScrollable(e){var t=hasScrollableSpace(e,`Y`)&&canOverflow(e,`Y`),n=hasScrollableSpace(e,`X`)&&canOverflow(e,`X`);return t||n}function findScrollableParent(e){for(;e!==t.body&&isScrollable(e)===!1;)e=e.parentNode||e.host;return e}function step(t){var n=o(),i,s,c,p=(n-t.startTime)/r;p=p>1?1:p,i=ease(p),s=t.startX+(t.x-t.startX)*i,c=t.startY+(t.y-t.startY)*i,t.method.call(t.scrollable,s,c),(s!==t.x||c!==t.y)&&e.requestAnimationFrame(step.bind(e,t))}function smoothScroll(n,r,s){var c,p,m,h,g=o();n===t.body?(c=e,p=e.scrollX||e.pageXOffset,m=e.scrollY||e.pageYOffset,h=i.scroll):(c=n,p=n.scrollLeft,m=n.scrollTop,h=scrollElement),step({scrollable:c,method:h,startTime:g,startX:p,startY:m,x:r,y:s})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(shouldBailOut(arguments[0])===!0){i.scroll.call(e,arguments[0].left===void 0?typeof arguments[0]==`object`?e.scrollX||e.pageXOffset:arguments[0]:arguments[0].left,arguments[0].top===void 0?arguments[1]===void 0?e.scrollY||e.pageYOffset:arguments[1]:arguments[0].top);return}smoothScroll.call(e,t.body,arguments[0].left===void 0?e.scrollX||e.pageXOffset:~~arguments[0].left,arguments[0].top===void 0?e.scrollY||e.pageYOffset:~~arguments[0].top)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(shouldBailOut(arguments[0])){i.scrollBy.call(e,arguments[0].left===void 0?typeof arguments[0]==`object`?0:arguments[0]:arguments[0].left,arguments[0].top===void 0?arguments[1]===void 0?0:arguments[1]:arguments[0].top);return}smoothScroll.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},n.prototype.scroll=n.prototype.scrollTo=function(){if(arguments[0]!==void 0){if(shouldBailOut(arguments[0])===!0){if(typeof arguments[0]==`number`&&arguments[1]===void 0)throw SyntaxError(`Value could not be converted`);i.elementScroll.call(this,arguments[0].left===void 0?typeof arguments[0]==`object`?this.scrollLeft:~~arguments[0]:~~arguments[0].left,arguments[0].top===void 0?arguments[1]===void 0?this.scrollTop:~~arguments[1]:~~arguments[0].top);return}var e=arguments[0].left,t=arguments[0].top;smoothScroll.call(this,this,e===void 0?this.scrollLeft:~~e,t===void 0?this.scrollTop:~~t)}},n.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(shouldBailOut(arguments[0])===!0){i.elementScroll.call(this,arguments[0].left===void 0?~~arguments[0]+this.scrollLeft:~~arguments[0].left+this.scrollLeft,arguments[0].top===void 0?~~arguments[1]+this.scrollTop:~~arguments[0].top+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},n.prototype.scrollIntoView=function(){if(shouldBailOut(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0||arguments[0]);return}var n=findScrollableParent(this),r=n.getBoundingClientRect(),o=this.getBoundingClientRect();n===t.body?e.scrollBy({left:o.left,top:o.top,behavior:`smooth`}):(smoothScroll.call(this,n,n.scrollLeft+o.left-r.left,n.scrollTop+o.top-r.top),e.getComputedStyle(n).position!==`fixed`&&e.scrollBy({left:r.left,top:r.top,behavior:`smooth`}))}}typeof e==`object`&&t!==void 0?t.exports={polyfill}:polyfill()})()}))()),lw=`/assets/maintenance-B8yH8TTV.svg`;F();function Linkedin(){return(0,X.jsx)(It,{width:`20`,height:`20`,viewBox:`0 0 20 20`,xmlns:`http://www.w3.org/2000/svg`,children:(0,X.jsx)(`g`,{id:`Deribit - Crypto Options and Futures Exchange for Bitcoin, Ethereum, Solana and more.-51`,children:(0,X.jsx)(`path`,{id:`Vector`,d:`M15.8333 2.5C16.2754 2.5 16.6993 2.67559 17.0118 2.98816C17.3244 3.30072 17.5 3.72464 17.5 4.16667V15.8333C17.5 16.2754 17.3244 16.6993 17.0118 17.0118C16.6993 17.3244 16.2754 17.5 15.8333 17.5H4.16667C3.72464 17.5 3.30072 17.3244 2.98816 17.0118C2.67559 16.6993 2.5 16.2754 2.5 15.8333V4.16667C2.5 3.72464 2.67559 3.30072 2.98816 2.98816C3.30072 2.67559 3.72464 2.5 4.16667 2.5H15.8333ZM15.4167 15.4167V11C15.4167 10.2795 15.1304 9.5885 14.621 9.07903C14.1115 8.56955 13.4205 8.28333 12.7 8.28333C11.9917 8.28333 11.1667 8.71667 10.7667 9.36667V8.44167H8.44167V15.4167H10.7667V11.3083C10.7667 10.6667 11.2833 10.1417 11.925 10.1417C12.2344 10.1417 12.5312 10.2646 12.75 10.4834C12.9688 10.7022 
25113.0917 10.9989 13.0917 11.3083V15.4167H15.4167ZM5.73333 7.13333C6.10464 7.13333 6.46073 6.98583 6.72328 6.72328C6.98583 6.46073 7.13333 6.10464 7.13333 5.73333C7.13333 4.95833 6.50833 4.325 5.73333 4.325C5.35982 4.325 5.0016 4.47338 4.73749 4.73749C4.47338 5.0016 4.325 5.35982 4.325 5.73333C4.325 6.50833 4.95833 7.13333 5.73333 7.13333ZM6.89167 15.4167V8.44167H4.58333V15.4167H6.89167Z`})})})}F();function Reddit(){return(0,X.jsx)(It,{width:`20`,height:`20`,viewBox:`0 0 20 20`,xmlns:`http://www.w3.org/2000/svg`,children:(0,X.jsx)(`g`,{id:`Deribit - Crypto Options and Futures Exchange for Bitcoin, Ethereum, Solana and more.-55`,children:(0,X.jsx)(`path`,{id:`Vector`,d:`M18.3341 10.1166C18.333 9.75894 18.2269 9.40949 18.0289 9.11167C17.8309 8.81384 17.5497 8.58076 17.2204 8.44138C16.891 8.30199 16.5279 8.26246 16.1763 8.32768C15.8246 8.39291 15.4999 8.56001 15.2424 8.80824C13.7974 7.83203 12.1025 7.29116 10.3591 7.24991L11.1924 3.33324L13.9174 3.92491C13.9314 4.24114 14.0602 4.54141 14.2798 4.76941C14.4994 4.9974 14.7946 5.13745 15.1101 5.16329C15.4256 5.18912 15.7396 5.09897 15.9934 4.90973C16.2471 4.7205 16.4231 4.44519 16.4883 4.13544C16.5535 3.8257 16.5035 3.5028 16.3476 3.22732C16.1917 2.95185 15.9406 2.74272 15.6415 2.63916C15.3424 2.53561 15.0157 2.54475 14.7229 2.66486C14.43 2.78498 14.191 3.00781 14.0508 3.29158L11.0174 2.64991C10.9258 2.63324 10.8341 2.64991 10.7758 2.69991C10.7008 2.74158 10.6591 2.81658 10.6424 2.91658L9.71745 7.26658C7.77578 7.32491 6.02578 7.91658 4.75911 8.81658C4.41416 8.49953 3.96092 8.32658 3.49245 8.33324C3.0726 8.32115 2.66175 8.45626 2.33102 8.71518C2.0003 8.9741 1.77054 9.34053 1.68152 9.751C1.5925 10.1615 1.64983 10.5902 1.84358 10.9628C2.03734 11.3355 2.35531 11.6287 2.74245 11.7916C2.7117 11.9732 2.69775 12.1574 2.70078 12.3416C2.70078 15.1499 5.96745 17.4416 10.0008 17.4416C14.0341 17.4416 17.3008 15.1666 17.3008 12.3416C17.3008 12.1666 17.2924 11.9749 17.2591 11.7916C17.5799 11.6447 17.8518 11.4087 18.0424 11.1118C18.2329 10.8149 18.3342 10.4694 18.3341 10.1166ZM5.83411 11.4166C5.83411 10.6999 6.40078 10.1166 7.11745 10.1166C7.83411 10.1166 8.41745 10.6999 8.41745 11.4166C8.41745 11.7614 8.28048 12.092 8.03669 12.3358C7.79289 12.5796 7.46223 12.7166 7.11745 12.7166C6.40078 12.7332 5.83411 12.1332 5.83411 11.4166ZM13.0924 14.8666C12.1924 15.7666 10.4924 15.8332 10.0008 15.8332C9.49245 15.8332 7.79245 15.7499 6.90911 14.8666C6.87762 14.8356 6.85261 14.7986 6.83554 14.7578C6.81846 14.717 6.80967 14.6733 6.80967 14.6291C6.80967 14.5849 6.81846 14.5411 6.83554 14.5003C6.85261 14.4596 6.87762 14.4226 6.90911 14.3916C6.94013 14.3601 6.9771 14.3351 7.01788 14.318C7.05865 14.3009 7.10241 14.2921 7.14661 14.2921C7.19082 14.2921 7.23458 14.3009 7.27535 14.318C7.31613 14.3351 7.3531 14.3601 7.38411 14.3916C7.95078 14.9582 9.16745 15.1499 10.0008 15.1499C10.8341 15.1499 12.0591 14.9582 12.6174 14.3916C12.6485 14.3601 12.6854 14.3351 12.7262 14.318C12.767 14.3009 12.8107 14.2921 12.8549 14.2921C12.8992 14.2921 12.9429 14.3009 12.9837 14.318C13.0245 14.3351 13.0614 14.3601 13.0924 14.3916C13.2091 14.5249 13.2091 14.7332 13.0924 14.8666ZM12.8508 12.7332C12.1341 12.7332 11.5508 12.1499 11.5508 11.4332C11.5508 11.0885 11.6877 10.7578 11.9315 10.514C12.1753 10.2702 12.506 10.1332 12.8508 10.1332C13.5674 10.1332 14.1674 10.7166 14.1674 11.4332C14.1588 11.7782 14.0169 12.1064 13.7713 12.3488C13.5258 12.5912 13.1958 12.729 12.8508 12.7332Z`})})})}F();function Telegram(){return(0,X.jsxs)(It,{width:`21`,height:`20`,viewBox:`0 0 21 20`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,X.jsx)(`g`,{id:`Deribit - Crypto Options and Futures Exchange for Bitcoin, Ethereum, Solana and more.-53`,clipPath:`url(#clip0_6046_528)`,children:(0,X.jsxs)(`g`,{id:`Clip path group`,children:[(0,X.jsx)(`mask`,{id:`mask0_6046_528`,maskUnits:`userSpaceOnUse`,x:`0`,y:`0`,width:`21`,height:`20`,children:(0,X.jsx)(`g`,{id:`clip0_13_23462`,children:(0,X.jsx)(`path`,{id:`Vector`,d:`M0.5 0H20.5V20H0.5V0Z`,fill:`white`})})}),(0,X.jsx)(`g`,{mask:`url(#mask0_6046_528)`,children:(0,X.jsx)(`g`,{id:`Group`,children:(0,X.jsx)(`path`,{id:`Vector_2`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M20.5 10C20.5 15.5225 16.0225 20 10.5 20C4.9775 20 0.5 15.5225 0.5 10C0.5 4.4775 4.9775 0 10.5 0C16.0225 0 20.5 4.4775 20.5 10ZM10.8583 7.3825C9.88583 7.78667 7.94167 8.62417 5.02667 9.89417C4.55333 10.0825 4.305 10.2667 4.2825 10.4467C4.24417 10.7517 4.62583 10.8717 5.14417 11.0342C5.215 11.0567 5.28833 11.0792 5.36333 11.1042C5.87417 11.27 6.56083 11.4642 6.9175 11.4717C7.24167 11.4783 7.60333 11.345 8.0025 11.0717C10.7258 9.2325 12.1317 8.30333 12.22 8.28333C12.2825 8.26917 12.3692 8.25083 12.4275 8.30333C12.4858 8.355 12.48 8.45333 12.4742 8.48C12.4358 8.64083 10.9408 10.0317 10.1658 10.7517C9.92417 10.9758 9.75333 11.135 9.71833 11.1717C9.64 11.2525 9.56 11.33 9.48333 11.4042C9.00833 11.8608 8.65333 12.2042 9.50333 12.7642C9.91167 13.0333 10.2383 13.2558 10.5642 13.4775C10.92 13.72 11.275 13.9617 11.735 14.2633C11.8517 14.34 11.9633 14.4192 12.0725 14.4967C12.4867 14.7925 12.8592 15.0575 13.3192 15.0158C13.5858 14.9908 13.8625 14.74 14.0025 13.9908C14.3333 12.2192 14.985 8.3825 15.1358 6.80083C15.1449 6.66951 15.1393 6.53758 15.1192 6.4075C15.107 6.30244 15.0559 6.20578 14.9758 6.13667C14.8567 6.03917 14.6717 6.01833 14.5883 6.02C14.2125 6.02667 13.6358 6.2275 10.8583 7.3825Z`})})})]})}),(0,X.jsx)(`defs`,{children:(0,X.jsx)(`clipPath`,{id:`clip0_6046_528`,children:(0,X.jsx)(`rect`,{width:`20`,he
251ight:`20`,fill:`white`,transform:`translate(0.5)`})})})]})}F();function Twitter(){return(0,X.jsx)(It,{width:`20`,height:`20`,viewBox:`0 0 20 20`,xmlns:`http://www.w3.org/2000/svg`,children:(0,X.jsx)(`g`,{id:`X Twitter Social Icon`,children:(0,X.jsx)(`path`,{id:`Vector`,d:`M15.0086 1.58667H17.6793L11.8447 8.60625L18.7087 18.1583H13.3342L9.12477 12.365L4.3082 18.1583H1.63592L7.87663 10.6501L1.29199 1.58667H6.80287L10.6078 6.88195L15.0086 1.58667ZM14.0713 16.4757H15.5512L5.99876 3.18095H4.41073L14.0713 16.4757Z`})})})}F();function Youtube(){return(0,X.jsx)(It,{width:`20`,height:`20`,viewBox:`0 0 20 20`,xmlns:`http://www.w3.org/2000/svg`,children:(0,X.jsx)(`g`,{id:`Deribit - Crypto Options and Futures Exchange for Bitcoin, Ethereum, Solana and more.-54`,children:(0,X.jsx)(`path`,{id:`Vector`,d:`M8.33171 12.4998L12.6567 9.99984L8.33171 7.49984V12.4998ZM17.965 5.97484C18.0734 6.3665 18.1484 6.8915 18.1984 7.55817C18.2567 8.22484 18.2817 8.79984 18.2817 9.29984L18.3317 9.99984C18.3317 11.8248 18.1984 13.1665 17.965 14.0248C17.7567 14.7748 17.2734 15.2582 16.5234 15.4665C16.1317 15.5748 15.415 15.6498 14.315 15.6998C13.2317 15.7582 12.24 15.7832 11.3234 15.7832L9.99837 15.8332C6.50671 15.8332 4.33171 15.6998 3.47337 15.4665C2.72337 15.2582 2.24004 14.7748 2.03171 14.0248C1.92337 13.6332 1.84837 13.1082 1.79837 12.4415C1.74004 11.7748 1.71504 11.1998 1.71504 10.6998L1.66504 9.99984C1.66504 8.17484 1.79837 6.83317 2.03171 5.97484C2.24004 5.22484 2.72337 4.7415 3.47337 4.53317C3.86504 4.42484 4.58171 4.34984 5.68171 4.29984C6.76504 4.2415 7.75671 4.2165 8.67337 4.2165L9.99837 4.1665C13.49 4.1665 15.665 4.29984 16.5234 4.53317C17.2734 4.7415 17.7567 5.22484 17.965 5.97484Z`})})})}var uw=r(((e,t)=>{function _interopDefault(e){return e&&typeof e==`object`&&`default`in e?e.default:e}var n=bt(),r=_interopDefault(n);function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var i=!!(typeof window<`u`&&window.document&&window.document.createElement);function withSideEffect(e,t,o){if(typeof e!=`function`)throw Error(`Expected reducePropsToState to be a function.`);if(typeof t!=`function`)throw Error(`Expected handleStateChangeOnClient to be a function.`);if(o!==void 0&&typeof o!=`function`)throw Error(`Expected mapStateOnServer to either be undefined or a function.`);function getDisplayName(e){return e.displayName||e.name||`Component`}return function wrap(s){if(typeof s!=`function`)throw Error(`Expected WrappedComponent to be a React component.`);var c=[],p;function emitChange(){p=e(c.map(function(e){return e.props})),m.canUseDOM?t(p):o&&(p=o(p))}var m=function(e){_inheritsLoose(SideEffect,e);function SideEffect(){return e.apply(this,arguments)||this}SideEffect.peek=function peek(){return p},SideEffect.rewind=function rewind(){if(SideEffect.canUseDOM)throw Error(`You may only call rewind() on the server. Call peek() to read the current state.`);var e=p;return p=void 0,c=[],e};var t=SideEffect.prototype;return t.UNSAFE_componentWillMount=function UNSAFE_componentWillMount(){c.push(this),emitChange()},t.componentDidUpdate=function componentDidUpdate(){emitChange()},t.componentWillUnmount=function componentWillUnmount(){var e=c.indexOf(this);c.splice(e,1),emitChange()},t.render=function render(){return r.createElement(s,this.props)},SideEffect}(n.PureComponent);return _defineProperty(m,`displayName`,`SideEffect(`+getDisplayName(s)+`)`),_defineProperty(m,`canUseDOM`,i),m}}t.exports=withSideEffect})),dw=r(((e,t)=>{var n=typeof Element<`u`,r=typeof Map==`function`,i=typeof Set==`function`,o=typeof ArrayBuffer==`function`&&!!ArrayBuffer.isView;function equal(e,t){if(e===t)return!0;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(e.constructor!==t.constructor)return!1;var s,c,p;if(Array.isArray(e)){if(s=e.length,s!=t.length)return!1;for(c=s;c--!==0;)if(!equal(e[c],t[c]))return!1;return!0}var m;if(r&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(m=e.entries();!(c=m.next()).done;)if(!t.has(c.value[0]))return!1;for(m=e.entries();!(c=m.next()).done;)if(!equal(c.value[1],t.get(c.value[0])))return!1;return!0}if(i&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(m=e.entries();!(c=m.next()).done;)if(!t.has(c.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(s=e.length,s!=t.length)return!1;for(c=s;c--!==0;)if(e[c]!==t[c])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf==`function`&&typeof t.valueOf==`function`)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString==`function`&&typeof t.toString==`function`)return e.toString()===t.toString();if(p=Object.keys(e),s=p.length,s!==Object.keys(t).length)return!1;for(c=s;c--!==0;)if(!Object.prototype.hasOwnProperty.call(t,p[c]))return!1;if(n&&e instanceof Element)return!1;for(c=s;c--!==0;)if(!((p[c]===`_owner`||p[c]===`__v`||p[c]===`__o`)&&e.$$typeof)&&!equal(e[p[c]],t[p[c]]))return!1;return!0}return e!==e&&t!==t}t.exports=function isEqual(e,t){try{return equal(e,t)}catch(e){if((e.message||``).match(/stack|recursion/i))return console.warn(`react-fast-compare cannot handle circular refs`),!1;throw e}}})),fw=r(((e,t)=>{var n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function toObject(e){if(e==null)throw TypeError(`Object.assign cannot be called with null or undefined`);return Object(e)}function shouldUseNative(){try{if(!Object.assign)return!1;var e=new String(`abc`);
251if(e[5]=`de`,Object.getOwnPropertyNames(e)[0]===`5`)return!1;for(var t={},n=0;n<10;n++)t[`_`+String.fromCharCode(n)]=n;if(Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(``)!==`0123456789`)return!1;var r={};return`abcdefghijklmnopqrst`.split(``).forEach(function(e){r[e]=e}),Object.keys(Object.assign({},r)).join(``)===`abcdefghijklmnopqrst`}catch{return!1}}t.exports=shouldUseNative()?Object.assign:function(e,t){for(var o,s=toObject(e),c,p=1;p<arguments.length;p++){for(var m in o=Object(arguments[p]),o)r.call(o,m)&&(s[m]=o[m]);if(n){c=n(o);for(var h=0;h<c.length;h++)i.call(o,c[h])&&(s[c[h]]=o[c[h]])}}return s}})),pw=n(Ot()),mw=n(uw()),hw=n(dw()),gw=n(fw()),_w={BODY:`bodyAttributes`,HTML:`htmlAttributes`,TITLE:`titleAttributes`},vw={BASE:`base`,BODY:`body`,HEAD:`head`,HTML:`html`,LINK:`link`,META:`meta`,NOSCRIPT:`noscript`,SCRIPT:`script`,STYLE:`style`,TITLE:`title`};Object.keys(vw).map(function(e){return vw[e]});var yw={CHARSET:`charset`,CSS_TEXT:`cssText`,HREF:`href`,HTTPEQUIV:`http-equiv`,INNER_HTML:`innerHTML`,ITEM_PROP:`itemprop`,NAME:`name`,PROPERTY:`property`,REL:`rel`,SRC:`src`,TARGET:`target`},bw={accesskey:`accessKey`,charset:`charSet`,class:`className`,contenteditable:`contentEditable`,contextmenu:`contextMenu`,"http-equiv":`httpEquiv`,itemprop:`itemProp`,tabindex:`tabIndex`},xw={DEFAULT_TITLE:`defaultTitle`,DEFER:`defer`,ENCODE_SPECIAL_CHARACTERS:`encodeSpecialCharacters`,ON_CHANGE_CLIENT_STATE:`onChangeClientState`,TITLE_TEMPLATE:`titleTemplate`},Sw=Object.keys(bw).reduce(function(e,t){return e[bw[t]]=t,e},{}),Cw=[vw.NOSCRIPT,vw.SCRIPT,vw.STYLE],ww=`data-react-helmet`,Tw=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},classCallCheck=function(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)},Ew=function(){function defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&defineProperties(e.prototype,t),n&&defineProperties(e,n),e}}(),Dw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},inherits=function(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},objectWithoutProperties=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},possibleConstructorReturn=function(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e},Ow=function encodeSpecialCharacters(e){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)===!1?String(e):String(e).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#x27;`)},kw=function getTitleFromPropsList(e){var t=Pw(e,vw.TITLE),n=Pw(e,xw.TITLE_TEMPLATE);if(n&&t)return n.replace(/%s/g,function(){return Array.isArray(t)?t.join(``):t});var r=Pw(e,xw.DEFAULT_TITLE);return t||r||void 0},Aw=function getOnChangeClientState(e){return Pw(e,xw.ON_CHANGE_CLIENT_STATE)||function(){}},jw=function getAttributesFromPropsList(e,t){return t.filter(function(t){return t[e]!==void 0}).map(function(t){return t[e]}).reduce(function(e,t){return Dw({},e,t)},{})},Mw=function getBaseTagFromPropsList(e,t){return t.filter(function(e){return e[vw.BASE]!==void 0}).map(function(e){return e[vw.BASE]}).reverse().reduce(function(t,n){if(!t.length)for(var r=Object.keys(n),i=0;i<r.length;i++){var o=r[i].toLowerCase();if(e.indexOf(o)!==-1&&n[o])return t.concat(n)}return t},[])},Nw=function getTagsFromPropsList(e,t,n){var r={};return n.filter(function(t){return Array.isArray(t[e])?!0:(t[e]!==void 0&&Bw(`Helmet: `+e+` should be of type "Array". Instead found type "`+Tw(t[e])+`"`),!1)}).map(function(t){return t[e]}).reverse().reduce(function(e,n){var i={};n.filter(function(e){for(var n=void 0,o=Object.keys(e),s=0;s<o.length;s++){var c=o[s],p=c.toLowerCase();t.indexOf(p)!==-1&&(n!==yw.REL||e[n].toLowerCase()!==`canonical`)&&(p!==yw.REL||e[p].toLowerCase()!==`stylesheet`)&&(n=p),t.indexOf(c)!==-1&&(c===yw.INNER_HTML||c===yw.CSS_TEXT||c===yw.ITEM_PROP)&&(n=c)}if(!n||!e[n])return!1;var m=e[n].toLowerCase();return r[n]||(r[n]={}),i[n]||(i[n]={}),!r[n][m]&&(i[n][m]=!0,!0)}
251).reverse().forEach(function(t){return e.push(t)});for(var o=Object.keys(i),s=0;s<o.length;s++){var c=o[s];r[c]=(0,gw.default)({},r[c],i[c])}return e},[]).reverse()},Pw=function getInnermostProperty(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.hasOwnProperty(t))return r[t]}return null},Fw=function reducePropsToState(e){return{baseTag:Mw([yw.HREF,yw.TARGET],e),bodyAttributes:jw(_w.BODY,e),defer:Pw(e,xw.DEFER),encode:Pw(e,xw.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:jw(_w.HTML,e),linkTags:Nw(vw.LINK,[yw.REL,yw.HREF],e),metaTags:Nw(vw.META,[yw.NAME,yw.CHARSET,yw.HTTPEQUIV,yw.PROPERTY,yw.ITEM_PROP],e),noscriptTags:Nw(vw.NOSCRIPT,[yw.INNER_HTML],e),onChangeClientState:Aw(e),scriptTags:Nw(vw.SCRIPT,[yw.SRC,yw.INNER_HTML],e),styleTags:Nw(vw.STYLE,[yw.CSS_TEXT],e),title:kw(e),titleAttributes:jw(_w.TITLE,e)}},Iw=function(){var e=Date.now();return function(t){var n=Date.now();n-e>16?(e=n,t(n)):setTimeout(function(){Iw(t)},0)}}(),Lw=function cafPolyfill(e){return clearTimeout(e)},Rw=typeof window<`u`?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||Iw:global.requestAnimationFrame||Iw,zw=typeof window<`u`?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||Lw:global.cancelAnimationFrame||Lw,Bw=function warn(e){return console&&typeof console.warn==`function`&&console.warn(e)},Vw=null,Hw=function handleClientStateChange(e){Vw&&zw(Vw),e.defer?Vw=Rw(function(){Uw(e,function(){Vw=null})}):(Uw(e),Vw=null)},Uw=function commitTagChanges(e,t){var n=e.baseTag,r=e.bodyAttributes,i=e.htmlAttributes,o=e.linkTags,s=e.metaTags,c=e.noscriptTags,p=e.onChangeClientState,m=e.scriptTags,h=e.styleTags,g=e.title,_=e.titleAttributes;Kw(vw.BODY,r),Kw(vw.HTML,i),Gw(g,_);var v={baseTag:qw(vw.BASE,n),linkTags:qw(vw.LINK,o),metaTags:qw(vw.META,s),noscriptTags:qw(vw.NOSCRIPT,c),scriptTags:qw(vw.SCRIPT,m),styleTags:qw(vw.STYLE,h)},y={},b={};Object.keys(v).forEach(function(e){var t=v[e],n=t.newTags,r=t.oldTags;n.length&&(y[e]=n),r.length&&(b[e]=v[e].oldTags)}),t&&t(),p(e,y,b)},Ww=function flattenArray(e){return Array.isArray(e)?e.join(``):e},Gw=function updateTitle(e,t){e!==void 0&&document.title!==e&&(document.title=Ww(e)),Kw(vw.TITLE,t)},Kw=function updateAttributes(e,t){var n=document.getElementsByTagName(e)[0];if(n){for(var r=n.getAttribute(ww),i=r?r.split(`,`):[],o=[].concat(i),s=Object.keys(t),c=0;c<s.length;c++){var p=s[c],m=t[p]||``;n.getAttribute(p)!==m&&n.setAttribute(p,m),i.indexOf(p)===-1&&i.push(p);var h=o.indexOf(p);h!==-1&&o.splice(h,1)}for(var g=o.length-1;g>=0;g--)n.removeAttribute(o[g]);i.length===o.length?n.removeAttribute(ww):n.getAttribute(ww)!==s.join(`,`)&&n.setAttribute(ww,s.join(`,`))}},qw=function updateTags(e,t){var n=document.head||document.querySelector(vw.HEAD),r=n.querySelectorAll(e+`[`+ww+`]`),i=Array.prototype.slice.call(r),o=[],s=void 0;return t&&t.length&&t.forEach(function(t){var n=document.createElement(e);for(var r in t)if(t.hasOwnProperty(r)){if(r===yw.INNER_HTML)n.innerHTML=t.innerHTML;else if(r===yw.CSS_TEXT)n.styleSheet?n.styleSheet.cssText=t.cssText:n.appendChild(document.createTextNode(t.cssText));else{var c=t[r]===void 0?``:t[r];n.setAttribute(r,c)}}n.setAttribute(ww,`true`),i.some(function(e,t){return s=t,n.isEqualNode(e)})?i.splice(s,1):o.push(n)}
251),i.forEach(function(e){return e.parentNode.removeChild(e)}),o.forEach(function(e){return n.appendChild(e)}),{oldTags:i,newTags:o}},Jw=function generateElementAttributesAsString(e){return Object.keys(e).reduce(function(t,n){var r=e[n]===void 0?``+n:n+`="`+e[n]+`"`;return t?t+` `+r:r},``)},Yw=function generateTitleAsString(e,t,n,r){var i=Jw(n),o=Ww(t);return i?`<`+e+` `+ww+`="true" `+i+`>`+Ow(o,r)+`</`+e+`>`:`<`+e+` `+ww+`="true">`+Ow(o,r)+`</`+e+`>`},Xw=function generateTagsAsString(e,t,n){return t.reduce(function(t,r){var i=Object.keys(r).filter(function(e){return e!==yw.INNER_HTML&&e!==yw.CSS_TEXT}).reduce(function(e,t){var i=r[t]===void 0?t:t+`="`+Ow(r[t],n)+`"`;return e?e+` `+i:i},``),o=r.innerHTML||r.cssText||``,s=Cw.indexOf(e)===-1;return t+`<`+e+` `+ww+`="true" `+i+(s?`/>`:`>`+o+`</`+e+`>`)},``)},Zw=function convertElementAttributestoReactProps(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(e).reduce(function(t,n){return t[bw[n]||n]=e[n],t},t)},Qw=function convertReactPropstoHtmlAttributes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(e).reduce(function(t,n){return t[Sw[n]||n]=e[n],t},t)},$w=function generateTitleAsReactComponent(e,t,n){var r,i=Zw(n,(r={key:t},r[ww]=!0,r));return[$.createElement(vw.TITLE,i,t)]},eT=function generateTagsAsReactComponent(e,t){return t.map(function(t,n){var r,i=(r={key:n},r[ww]=!0,r);return Object.keys(t).forEach(function(e){var n=bw[e]||e;n===yw.INNER_HTML||n===yw.CSS_TEXT?i.dangerouslySetInnerHTML={__html:t.innerHTML||t.cssText}:i[n]=t[e]}),$.createElement(e,i)})},tT=function getMethodsForTag(e,t,n){switch(e){case vw.TITLE:return{toComponent:function toComponent(){return $w(e,t.title,t.titleAttributes,n)},toString:function toString(){return Yw(e,t.title,t.titleAttributes,n)}};case _w.BODY:case _w.HTML:return{toComponent:function toComponent(){return Zw(t)},toString:function toString(){return Jw(t)}};default:return{toComponent:function toComponent(){return eT(e,t)},toString:function toString(){return Xw(e,t,n)}}}},nT=function mapStateOnServer(e){var t=e.baseTag,n=e.bodyAttributes,r=e.encode,i=e.htmlAttributes,o=e.linkTags,s=e.metaTags,c=e.noscriptTags,p=e.scriptTags,m=e.styleTags,h=e.title,g=h===void 0?``:h,_=e.titleAttributes;return{base:tT(vw.BASE,t,r),bodyAttributes:tT(_w.BODY,n,r),htmlAttributes:tT(_w.HTML,i,r),link:tT(vw.LINK,o,r),meta:tT(vw.META,s,r),noscript:tT(vw.NOSCRIPT,c,r),script:tT(vw.SCRIPT,p,r),style:tT(vw.STYLE,m,r),title:tT(vw.TITLE,{title:g,titleAttributes:_},r)}},rT=function Helmet(e){var t,n;return n=t=function(t){inherits(HelmetWrapper,t);function HelmetWrapper(){return classCallCheck(this,HelmetWrapper),possibleConstructorReturn(this,t.apply(this,arguments))}return HelmetWrapper.prototype.shouldComponentUpdate=function shouldComponentUpdate(e){return!(0,hw.default)(this.props,e)},HelmetWrapper.prototype.mapNestedChildrenToProps=function mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case vw.SCRIPT:case vw.NOSCRIPT:return{innerHTML:t};case vw.STYLE:return{cssText:t}}throw Error(`<`+e.type+` /> elements are self-closing and can not contain children. Refer to our API for more information.`)},HelmetWrapper.prototype.flattenArrayTypeChildren=function flattenArrayTypeChildren(e){var t,n=e.child,r=e.arrayTypeChildren,i=e.newChildProps,o=e.nestedChildren;return Dw({},r,(t={},t[n.type]=[].concat(r[n.type]||[],[Dw({},i,this.mapNestedChildrenToProps(n,o))]),t))},HelmetWrapper.prototype.mapObjectTypeChildren=function mapObjectTypeChildren(e){var t,n,r=e.child,i=e.newProps,o=e.newChildProps,s=e.nestedChildren;switch(r.type){case vw.TITLE:return Dw({},i,(t={},t[r.type]=s,t.titleAttributes=Dw({},o),t));case vw.BODY:return Dw({},i,{bodyAttributes:Dw({},o)});case vw.HTML:return Dw({},i,{htmlAttributes:Dw({},o)})}return Dw({},i,(n={},n[r.type]=Dw({},o),n))},HelmetWrapper.prototype.mapArrayTypeChildrenToProps=function mapArrayTypeChildrenToProps(e,t){var n=Dw({},t);return Object.keys(e).forEach(function(t){var r;n=Dw({},n,(r={},r[t]=e[t],r))}),n}
251,HelmetWrapper.prototype.warnOnInvalidChildren=function warnOnInvalidChildren(e,t){return!0},HelmetWrapper.prototype.mapChildrenToProps=function mapChildrenToProps(e,t){var n=this,r={};return $.Children.forEach(e,function(e){if(!(!e||!e.props)){var i=e.props,o=i.children,s=Qw(objectWithoutProperties(i,[`children`]));switch(n.warnOnInvalidChildren(e,o),e.type){case vw.LINK:case vw.META:case vw.NOSCRIPT:case vw.SCRIPT:case vw.STYLE:r=n.flattenArrayTypeChildren({child:e,arrayTypeChildren:r,newChildProps:s,nestedChildren:o});break;default:t=n.mapObjectTypeChildren({child:e,newProps:t,newChildProps:s,nestedChildren:o})}}}),t=this.mapArrayTypeChildrenToProps(r,t),t},HelmetWrapper.prototype.render=function render(){var t=this.props,n=t.children,r=Dw({},objectWithoutProperties(t,[`children`]));return n&&(r=this.mapChildrenToProps(n,r)),$.createElement(e,r)},Ew(HelmetWrapper,null,[{key:`canUseDOM`,set:function set$$1(t){e.canUseDOM=t}}]),HelmetWrapper}($.Component),t.propTypes={base:pw.default.object,bodyAttributes:pw.default.object,children:pw.default.oneOfType([pw.default.arrayOf(pw.default.node),pw.default.node]),defaultTitle:pw.default.string,defer:pw.default.bool,encodeSpecialCharacters:pw.default.bool,htmlAttributes:pw.default.object,link:pw.default.arrayOf(pw.default.object),meta:pw.default.arrayOf(pw.default.object),noscript:pw.default.arrayOf(pw.default.object),onChangeClientState:pw.default.func,script:pw.default.arrayOf(pw.default.object),style:pw.default.arrayOf(pw.default.object),title:pw.default.string,titleAttributes:pw.default.object,titleTemplate:pw.default.string},t.defaultProps={defer:!0,encodeSpecialCharacters:!0},t.peek=e.peek,t.rewind=function(){var t=e.rewind();return t||=nT({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:``,titleAttributes:{}}),t},n}((0,mw.default)(Fw,Hw,nT)(function NullComponent(){return null}));rT.renderStatic=rT.rewind;var setDocumentTitleSuffix=e=>e?`${e} - Deribit by Coinbase`:`Deribit by Coinbase`,DocumentTitle=({title:e})=>(0,X.jsx)(rT,{defer:!1,children:(0,X.jsx)(`title`,{children:setDocumentTitleSuffix(e)})});V();var iT=ld(`div`)(({theme:e})=>z`
252    display: flex;
253    flex-direction: column;
254    align-items: center;
255    justify-content: center;
256    height: 100vh;
257    width: 100vw;
258    background: ${e.palette.dsColors.darkGray[200]}
259      linear-gradient(179deg, rgba(0, 0, 0, 0) 1.11%, #040506 55.81%);
260    color: ${e.palette.dsColors.lightGray[0]};
261  `),aT=ld(`div`)(()=>z`
262    display: flex;
263    align-items: center;
264    flex-direction: column;
265    position: relative;
266    width: 1050px;
267
268    &::before {
269      content: '';
270      position: absolute;
271      left: 0;
272      top: 0;
273      width: 100%;
274      height: 100%;
275      background: linear-gradient(
276        89deg,
277        rgba(0, 16, 51, 0.4) 15.9%,
278        rgba(87, 139, 250, 0.18) 103.78%
279      );
280      filter: blur(125px);
281      z-index: 0;
282      border-radius: 100px;
283    }
284    @media only screen and (max-width: 1050px) {
285      width: auto;
286    }
287  `),oT=ld(`div`)(({theme:e})=>z`
288    display: flex;
289    flex-direction: column;
290    gap: ${e.spacing(2)};
291    align-items: center;
292    z-index: 1;
293    position: relative;
294    max-width: 980px;
295  `),sT=ld(`div`)(()=>z`
296    text-wrap: pretty;
297  `),cT=ld(L)(({theme:e})=>z`
298    text-align: center;
299    font-size: 3rem;
300    margin-bottom: ${e.spacing(2)};
301    line-height: normal;
302    @media only screen and (max-width: 896px) {
303      font-size: 32px;
304    }
305  `),lT=ld(`div`)(({theme:e})=>z`
306    position: relative;
307    display: flex;
308    flex-direction: column;
309    align-items: center;
310    gap: ${e.spacing(3)};
311    margin-top: ${e.spacing(6)};
312
313    &::before {
314      content: '';
315      display: block;
316      width: 322px;
317      height: 1px;
318      background-color: ${e.palette.dsColors.darkGray[10]};
319    }
320  `);function ServiceScreen({icon:e,iconHeight:t,title:n,description:r,children:i}){return(0,X.jsxs)(iT,{children:[(0,X.jsx)(DocumentTitle,{title:n}),(0,X.jsxs)(aT,{style:{marginTop:-t},children:[(0,X.jsxs)(oT,{children:[e,(0,X.jsxs)(sT,{children:[(0,X.jsx)(cT,{children:n}),r]})]}),i&&(0,X.jsx)(lT,{children:i})]})]})}var uT=mi(ServiceScreen);V();var dT=ld(`img`)`
321  height: 180px;
322`,fT=ld(`div`)(({theme:e})=>z`
323    text-align: center;
324    color: ${e.palette.dsColors.lightGray[80]};
325  `),pT=ld(`div`)(()=>z`
326    width: 322px;
327    display: flex;
328    flex-direction: row;
329    justify-content: space-between;
330    align-items: center;
331  `),mT=ld(`div`)(({theme:e})=>z`
332    display: flex;
333    flex-direction: row;
334    gap: ${e.spacing(3)};
335  `),hT=ld(`a`)(({theme:e})=>z`
336    font-size: 0;
337
338    svg {
339      color: ${e.palette.dsColors.lightGray[200]};
340      height: 20px;
341      width: 20px;
342    }
343
344    &:hover {
345      svg {
346        color: ${e.palette.common.white};
347      }
348    }
349  `),gT=ld(H)(({theme:e})=>z`
350    height: 24px;
351    padding: ${e.spacing(0,1)} !important;
352    background-color: ${e.palette.dsColors.darkGray[40]} !important;
353    border-radius: 5px !important;
354  `),_T=[[Linkedin,`https://linkedin.com/company/deribit`],[Twitter,`https://x.com/DeribitOfficial`],[Telegram,Sn],[Youtube,`https://www.youtube.com/@Deribit`],[Reddit,`https://www.reddit.com/r/DeribitExchange/`]],vT=e(e=>({title:e?R._({id:`maintenanceScreen.serviceUnavailable.title`}):R._({id:`maintenanceScreen.title`}),description:e?R._({id:`maintenanceScreen.serviceUnavailable.subtitle`}):R._({id:`maintenanceScreen.subtitle`})}),`getContent`);function MaintenanceScreen({connectionFailed:e}){let{globalDomain:t}=Oi(),n=Qi(`(max-width:896px)`)?`body3`:`body2`,{title:r,description:i}=vT(e);return(0,X.jsx)(uT,{icon:(0,X.jsx)(dT,{src:lw,alt:`Back soon`}),iconHeight:0,title:r,description:(0,X.jsxs)(fT,{children:[(0,X.jsx)(L,{variant:n,component:`p`,children:i}),(0,X.jsx)(L,{variant:n,component:`p`,children:(0,X.jsx)(N,{id:`maintenanceScreen.subtitle.checkBack`})})]}),children:(0,X.jsxs)(pT,{children:[(0,X.jsx)(gT,{component:`a`,variant:`gray`,target:`_blank`,rel:`noopener noreferrer`,href:`https://insights.${t}/contact-us/`,children:(0,X.jsx)(L,{variant:`body4`,fontWeight:600,children:(0,X.jsx)(N,{id:`maintenanceScreen.primaryButton`})})}),(0,X.jsx)(mT,{children:_T.map(([e,t])=>(0,X.jsx)(hT,{target:`_blank`,rel:`noopener noreferrer`,href:t,children:(0,X.jsx)(e,{})},t))})]})})}var yT=mi(MaintenanceScreen),bT=e(()=>Rp().shape({email:Fp().email(R._({id:`loginScreen.loginForm.error.invalidEmail`})).required(R._({id:`loginScreen.loginForm.error.required`})),password:Fp().required(R._({id:`loginScreen.loginForm.error.required`})),tfaMethod:Fp().oneOf([`passkey`,`code`]),tfaCode:Fp().when(`tfaMethod`,{is:`code`,then:Fp().length(6,R._({id:`loginScreen.loginForm.error.tfaCode`}))})}),`getLoginValidationSchema`),getLoginByApiKeyValidationSchema=()=>Rp().shape({accessKey:Fp().required(R._({id:`loginScreen.loginForm.error.required`})),accessSecret:Fp().required(R._({id:`loginScreen.loginForm.error.required`}))}),xT=e(e=>{let t=Pn(),n=yt(),{analyticsService:r}=Ru(),i=St(),[o,s]=lf(`tfaMethod`,`code`),[c]=lf(`didSkipTFASetup`,null),{deribitClient:{apiHost:p}}=Oi(),{loginByPassword:m,loginByApiKey:h,initiateOAuthLogin:g}=qu(),{setOAuthData:_}=useOAuthData(),[v,y]=lf(`loginformemail`,``),[b,x]=(0,$.useState)(`password`),S=qs({initialValues:{email:v,password:``,accessKey:``,accessSecret:``,isLoginPending:!1,tfaMethod:o??`code`,tfaCode:``},validationSchema:b===`password`?bT():getLoginByApiKeyValidationSchema(),onSubmit:async o=>{await S.setFieldValue(`isLoginPending`,!0),S.setSubmitting(!0);let g;if(g=b===`password`&&o.email?await m({email:o.email,password:o.password,tfa:o.tfaMethod===`code`?o.tfaCode:void 0,usePasskey:o.tfaMethod===`passkey`}):await h({accessKey:o.accessKey,accessSecret:o.accessSecret}),g?.success){t(nd.setShowWelcomeMessage(!0)),t(nd.setShowSecurityMessage(!0)),t(nd.setShowVerificationMessage(!0)),r.trackEvent(`user_logged_in`),s(o.tfaMethod),await S.setFieldValue(`tfa`,``),o.email&&y(o.email);let m=o.tfaMethod===`code`&&!o.tfaCode.length;if(b===`password`&&m&&!c&&p!==`localhost`){let e=encodeURIComponent(`${i.pathname}${i.search}`);n(`../tfa_setup?returnUrl=${e}`)}e?.onClose&&e.onClose()}else Y.notify({isError:!0,message:g?.errorMessage});await S.setFieldValue(`isLoginPending`,!1)}}),onOAuth=async(e,t)=>{await S.setFieldValue(`isLoginPending`,!0);let n=await g({provider:t});await S.setFieldValue(`isLoginPending`,!1),n&&(_({...n,type:e}),window.location.href=n.redirect_url)};return{onSubmit:S.submitForm,setGrantType:x,formik:S,onOAuth}},`useLoginForm`);V();var ST=P(`div`)(({theme:e})=>z`
355    display: flex;
356    flex-direction: column;
357    gap: ${e.spacing(1)};
358  `),CT=P(Pi)(({theme:e})=>z`
359    border-radius: 4px;
360    align-self: start;
361    transform: rotate(-90deg);
362    left: -${e.spacing(3)};
363    top: -${e.spacing(3)};
364    margin-bottom: -${e.spacing(3)};
365
366    @media (max-width: 540px) {
367      left: 0;
368    }
369  `),wT=e(e=>{switch(e){case`login`:return R._({id:`loginForm.action.login`});case`loginByApi`:return R._({id:`loginForm.action.loginApi`});case`resetPassword`:return R._({id:`loginForm.action.resetPassword`});case`emailConfirmation`:return R._({id:`loginForm.action.emailConfirmation`});case`signUp`:case`signUpStep2`:case`coinbaseSignUp`:return R._({id:`loginForm.action.signUp`});case`forgotPassword`:return R._({id:`loginForm.action.forgotPassword`});case`setupPassword`:return R._({id:`loginForm.action.setUpPassword`});case`resendActivationLink`:return R._({id:`loginForm.action.resendActivationLink`})}},`getActionTranslation`),TT=e(({actionName:e,onArrowClick:t})=>{let{analyticsService:n}=Ru();return(0,X.jsxs)(ST,{children:[t&&(0,X.jsx)(CT,{onClick:()=>{n.trackEvent(`auth_back_button_click`),t()},children:(0,X.jsx)(Ir,{name:`arrowUp`})}),(0,X.jsx)(L,{variant:`h2`,textAlign:`center`,children:wT(e)})]})},`LoginFormTitle`);V();var ET=P(`div`)(({theme:e})=>z`
370    display: grid;
371    grid-template-columns: 50px 1fr;
372    position: relative;
373    align-items: center;
374    gap: ${e.spacing(2)};
375    background-color: ${e.palette.dsColors.darkGray[60]};
376    overflow: hidden;
377    padding: ${e.spacing(2)};
378    border-radius: ${e.shape.borderRadius}px;
379  `),DT=P(`div`)(({theme:e})=>z`
380    display: flex;
381    flex-direction: column;
382    gap: ${e.spacing(1)};
383    max-width: 300px;
384  `),OT=P(L)`
385  font-weight: 600;
386`,kT=P(`div`)`
387  display: flex;
388  align-items: center;
389  justify-content: center;
390`,AT=P(`div`,ai([`variant`]))(({variant:e})=>z`
391    position: absolute;
392    z-index: 0;
393    left: -21px;
394    bottom: -9px;
395    width: 101px;
396    height: 105px;
397    border-radius: 25%;
398    background-color: ${e===`success`?`rgba(7,182,110,0.4)`:`rgba(245, 54, 97, 0.23)`};
399    filter: blur(44px);
400  `),LoginInfoCard=({variant:e=`success`,title:t,description:n,illustrationName:r})=>(0,X.jsxs)(ET,{children:[(0,X.jsx)(AT,{variant:e}),(0,X.jsx)(kT,{children:(0,X.jsx)(aa,{name:r})}),(0,X.jsxs)(DT,{children:[(0,X.jsx)(OT,{variant:`body3`,children:t}),(0,X.jsx)(L,{variant:`body4`,children:n})]})]});V();var jT=P(`div`)(({theme:e})=>z`
401    display: flex;
402    align-items: center;
403    gap: ${e.spacing(1)};
404    padding: ${e.spacing(1)};
405  `),MT=mi(jT);function StyledDropdownSelect(){return P(tr(_n,{slotProps:{listbox:{style:{minWidth:`unset`,maxHeight:400}},popper:{style:{zIndex:46}}}}))(({theme:e})=>z`
406      min-width: unset;
407      white-space: nowrap;
408      font-size: ${e.typography.body4.fontSize};
409      line-height: ${e.typography.body4.lineHeight};
410      height: unset;
411      padding: ${e.spacing(3/8,4,3/8,1)};
412      background: ${e.palette.mode===`light`?e.palette.dsColors.lightGray[0]:``};
413      border-color: ${e.palette.mode===`light`?e.palette.dsColors.lightGray[200]:e.palette.dsColors.darkGray[10]};
414      border-radius: 5px;
415    `)}var NT=P(an)(({theme:e})=>z`
416    min-width: unset;
417    background: ${e.palette.mode===`light`?e.palette.dsColors.lightGray[0]:``};
418
419    font-size: ${e.typography.body4.fontSize};
420    line-height: ${e.typography.body4.lineHeight};
421  `),PT=P(Tt)(()=>z`
422    button:last-of-type {
423      margin-right: 0 !important;
424    }
425  `),FT=P(Vr)(({theme:e})=>{let{background:t,color:n,border:r,hoverBackground:i,selected:o}={dark:{selected:{background:e.palette.dsColors.lightGray[20],color:e.palette.dsColors.darkGray[200],border:e.palette.dsColors.darkGray[200],hoverBackground:e.palette.dsColors.lightGray[80]},background:e.palette.dsColors.darkGray[200],color:`currentColor`,border:e.palette.dsColors.darkGray[10],hoverBackground:e.palette.dsColors.darkGray[40]},light:{selected:{background:e.palette.dsColors.darkGray[200],color:e.palette.dsColors.lightGray[0],border:e.palette.dsColors.darkGray[200],hoverBackground:e.palette.dsColors.darkGray[200]},background:e.palette.dsColors.lightGray[100],color:`currentColor`,border:e.palette.dsColors.lightGray[100],hoverBackground:e.palette.dsColors.lightGray[200]}}[e.palette.mode];return z`
426    padding: ${e.spacing(3/8,1.5)} !important;
427    font-weight: ${e.typography.body4.fontWeight};
428    font-size: ${e.typography.body4.fontSize};
429    line-height: ${e.typography.body4.lineHeight};
430    border-radius: 5px !important;
431
432    background-color: ${t} !important;
433    border: 1px solid ${r};
434    color: ${n};
435    text-transform: none;
436
437    &:hover {
438      border: 1px solid initial !important;
439      background: ${i} !important;
440    }
441
442    &.${bn.selected} {
443      background-color: ${o.background} !important;
444      border: 1px solid ${o.border} !important;
445      color: ${o.color};
446
447      &:hover {
448        border-color: initial;
449        background: ${o.hoverBackground} !important;
450      }
451    }
452  `});function FiltersBar({filters:e,onChange:t,selectedValue:n,selectedValues:r,disabled:i,variant:o=`tabs`,size:s=`xs`,tabsVariant:c=`standard`,...p}){let m=rr(),h=(0,$.useMemo)(()=>StyledDropdownSelect(),[]);return(0,X.jsxs)(Et,{theme:m,children:[o===`tabs`&&(0,X.jsx)(yp,{size:s,value:n,variant:c,scrollButtons:c===`scrollable`?`auto`:void 0,onChange:r?void 0:t,...p,children:e.map(({label:e,value:n,isCurrency:o,dataId:s})=>o?(0,X.jsx)(vc,{disabled:i,value:n,currency:e,"data-id":s},String(n)):(0,X.jsx)(gp,{disabled:i,label:e,value:n,"data-id":s,className:r?.includes(n)?`Mui-selected`:void 0,onClick:r?e=>t(e,n):void 0},String(n)))}),o===`dropdown`&&(0,X.jsx)(h,{value:n,onChange:(e,n)=>t(void 0,n),...p,children:e.map(({label:e,value:t,dataId:n})=>(0,X.jsx)(NT,{value:t,"data-id":n,children:e},t))}),o===`buttons`&&(0,X.jsx)(PT,{onChange:(e,n)=>t(void 0,n),value:n,exclusive:!0,...p,children:e.map(({label:e,value:t,dataId:n})=>(0,X.jsx)(FT,{value:t,"data-id":n,children:e},t))})]})}var IT=new RegExp(/^\d*\.?\d*$/),LT=new RegExp(/^\d*$/),isNumericString=(e,t)=>
452t?IT.test(e):LT.test(e),useOAuthLogin=()=>{let e=Ti(),t=yt(),n=Uu(ji),r=(0,$.useRef)(!1),[i]=Mn(),{state:o}=St(),s=o?.authCodeParam,c=o?.stateParam,{oAuthData:p,setOAuthData:m,removeOAuthData:h}=useOAuthData(),{getOAuthToken:g,initiateOAuthLogin:_}=qu(),[v,y]=(0,$.useState)(!1);return(0,$.useEffect)(()=>{(async()=>{if(c&&s&&!n&&!r.current&&p&&p.state_code===c&&p.provider){r.current=!0,y(!0);try{(await Np(g.bind(e),[{authorization_code:s,state_code:c,provider:p.provider}])).access_token&&(h(),t(`/dashboard`))}catch(e){if(dd(e)){if(e.message===`security_key_setup_required`){let e=await _({provider:p.provider});if(e){m({type:`tfaSetup`,...e}),window.location.href=e.redirect_url;return}}if(e.message===`unauthorized`){let t=p.provider===`coinbase`?R._({id:`common.oAuthError.noAccountFoundCoinbase`}):R._({id:`common.oAuthError.noAccountFound`});Y.notify({isError:!0,message:e.data?.reason===`oauth_disabled`?R._({id:`common.oAuthError.oAuthDisabled`,values:{0:_u(p.provider)}}):t})}h()}}y(!1)}})()},[e,g,i,n,t,p,m,h,_,c,s]),{isOAuthLoading:v}};V();var RT=P(`div`)(({theme:e})=>z`
453    display: flex;
454    gap: ${e.spacing(1)};
455
456    &[data-fill-row='true'] {
457      width: 100%;
458
459      & > * {
460        flex: 1;
461      }
462    }
463  `),zT=P(H)(({theme:e})=>z`
464    padding: ${e.spacing(1.125)};
465  `),OAuthButtons=({authType:e,variant:t})=>{let{featureToggles:{isGoogleLoginEnabled:n,isAppleLoginEnabled:r}}=Oi(),{onOAuth:i}=xT(),{analyticsService:o}=Ru(),s=e===`login`&&t===`coinbase`,c=t===`socials`&&n,p=t===`socials`&&r;if(!c&&!p&&!s)return null;let trackButtonClick=t=>{o.trackEvent(e===`login`?`auth_oauth_login_button_click`:`auth_oauth_sign_up_button_click`,{provider:t})},m=e===`signUp`;return(0,X.jsxs)(RT,{"data-fill-row":m?`true`:void 0,children:[c&&(0,X.jsx)(zT,{"aria-label":R._({id:`loginForm.action.loginWithGoogle`}),onClick:()=>{trackButtonClick(`google`),i(e,`google`)},variant:`gray`,"data-id":`signInGoogle`,startIcon:m?(0,X.jsx)(Ir,{name:`googleLogo`}):void 0,children:m?(0,X.jsx)(N,{id:`loginForm.action.login`}):(0,X.jsx)(Ir,{name:`googleLogo`})}),p&&(0,X.jsx)(zT,{"aria-label":R._({id:`loginForm.action.loginWithApple`}),onClick:()=>{trackButtonClick(`apple`),i(e,`apple`)},variant:`gray`,"data-id":`signInApple`,startIcon:m?(0,X.jsx)(Ir,{name:`appleLogo`}):void 0,children:m?(0,X.jsx)(N,{id:`loginForm.action.login`}):(0,X.jsx)(Ir,{name:`appleLogo`})}),s&&(0,X.jsx)(H,{onClick:()=>{trackButtonClick(`coinbase`),i(e,`coinbase`)},variant:`gray`,"data-id":`signInCoinbase`,fullWidth:!0,startIcon:(0,X.jsx)(Ir,{name:`coinbaseLogo`}),children:(0,X.jsx)(N,{id:`loginForm.action.signInWithCoinbaseAccount`})})]})};V();var BT=P(`form`)(({theme:e})=>z`
466    display: flex;
467    flex-direction: column;
468    gap: ${e.spacing(2)};
469  `),VT=P(`div`)(({theme:e})=>z`
470    display: flex;
471    flex-direction: column;
472    gap: ${e.spacing(2)};
473  `),HT=P(`div`)(({theme:e})=>z`
474    display: flex;
475    justify-content: center;
476    gap: ${e.spacing(4)};
477  `),UT=P(`div`)(({theme:e})=>z`
478    display: flex;
479    justify-content: center;
480    gap: ${e.spacing(.5)};
481  `),WT=P(H)(({theme:e})=>z`
482    margin-top: ${e.spacing(2)};
483  `),GT=P(`div`)(({theme:e})=>z`
484    display: flex;
485    gap: ${e.spacing(1)};
486  `),KT=P(H)`
487  flex: 1;
488`,qT=P(`span`)(({theme:e})=>z`
489    flex: 1;
490    height: 1px;
491    background-color: ${e.palette.dsColors.lightGray[300]};
492  `),JT=P(`span`)(({theme:e})=>z`
493    color: ${e.palette.dsColors.lightGray[300]};
494    font-size: ${e.typography.caption.fontSize};
495    line-height: ${e.typography.caption.lineHeight};
496  `),getTfaFilters=()=>[{label:R._({id:`loginForm.passkey`}),value:`passkey`,dataId:`passkeyBtn`},{label:R._({id:`loginForm.twoFACode`}),value:`code`,dataId:`tfaBtn`}],YT=e(({onClose:e})=>{let t=yt(),n=St(),{analyticsService:r}=Ru(),i=(0,$.useMemo)(()=>getTfaFilters(),[]),{isOAuthLoading:o}=useOAuthLogin(),{formik:s,onSubmit:c,setGrantType:p}=xT({onClose:e}),m=ut(),handleApiLogin=()=>{t(`../login_api`),r.trackEvent(`auth_api_login_button_click`),e?.()},handleSubmit=e=>{e.preventDefault(),c()},handleInput=e=>{p(`password`),s.handleChange(e)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(up,{isLoading:o}),(0,X.jsx)(TT,{actionName:`login`}),n.state?.resetPasswordRequested&&(0,X.jsx)(LoginInfoCard,{variant:`success`,illustrationName:`message-alt-primary`,title:R._({id:`loginForm.checkEmail`}),description:R._({id:`loginScreen.forgotPassword.sentAnEmailToResetPassword`})}),(0,X.jsxs)(BT,{onSubmit:handleSubmit,children:[(0,X.jsx)(OAuthButtons,{authType:`login`,variant:`coinbase`}),(0,X.jsxs)(I,{display:`flex`,alignItems:`center`,gap:1.5,children:[(0,X.jsx)(qT,{}),(0,X.jsx)(JT,{children:(0,X.jsx)(N,{id:`commonScreen.common.or`})}),(0,X.jsx)(qT,{})]}),(0,X.jsxs)(GT,{children:[(0,X.jsx)(OAuthButtons,{authType:`login`,variant:`socials`}),(0,X.jsx)(KT,{variant:`gray`,onClick:handleApiLogin,children:(0,X.jsx)(N,{id:`loginForm.apiSignIn`})})]}),(0,X.jsx)(Mi,{label:R._({id:`loginForm.email`}
496),"data-id":`email`,inputMode:`email`,name:`email`,autoFocus:!0,autoComplete:`email`,value:s.values.email,onChange:handleInput,hint:s.touched.email?s.errors.email:void 0,error:!!(s.touched.email&&s.errors.email),inputProps:{id:`email`}}),(0,X.jsx)(Mi,{type:`password`,label:R._({id:`loginForm.password`}),"data-id":`password`,autoComplete:`current-password`,name:`password`,value:s.values.password,onChange:handleInput,hint:s.touched.password?s.errors.password:void 0,error:!!(s.touched.password&&s.errors.password),inputProps:{id:`password`}}),(0,X.jsx)(FiltersBar,{filters:i,onChange:(e,t)=>{t&&(s.setFieldValue(`tfaMethod`,t),r.trackEvent(`auth_tfa_method_switch`,{tfaMethod:t}))},selectedValue:s.values.tfaMethod}),s.values.tfaMethod===`code`&&(0,X.jsx)(Mi,{placeholder:R._({id:`loginForm.enterTfaCode`}),"data-id":`tfaCode`,autoComplete:`one-time-code`,name:`tfaCode`,value:s.values.tfaCode,onChange:e=>{(isNumericString(e.target.value)||e.target.value===``)&&handleInput(e)},onBlur:s.handleBlur,hint:s.touched.tfaCode?s.errors.tfaCode:void 0,error:!!(s.touched.tfaCode&&s.errors.tfaCode),inputProps:{id:`tfaCode`,maxLength:6}}),(0,X.jsx)(WT,{type:`submit`,variant:`filled`,children:(0,X.jsx)(N,{id:`loginForm.continue`})})]}),(0,X.jsxs)(VT,{children:[(0,X.jsxs)(UT,{children:[(0,X.jsx)(L,{children:(0,X.jsx)(N,{id:`loginForm.dontHaveAccount`})}),(0,X.jsx)(Wt,{isRouter:!m.isExternal,variant:`subtitle1`,to:m.url,onClick:e,children:(0,X.jsx)(N,{id:`loginForm.register`})})]}),(0,X.jsxs)(HT,{children:[(0,X.jsx)(Wt,{isRouter:!0,to:`../resend_activation_email`,onClick:()=>{e?.(),r.trackEvent(`auth_resend_activation_link_click`)},children:(0,X.jsx)(N,{id:`loginForm.resendActivationLink`})}),(0,X.jsx)(Wt,{isRouter:!0,to:`../forgot_password`,onClick:e,children:(0,X.jsx)(N,{id:`loginForm.forgotPassword`})})]})]})]})},`LoginForm`),LabeledDivider=({label:e,muted:t})=>{let n=Dn(),r=n.palette.mode===`dark`?n.palette.dsColors.lightGray[60]:n.palette.dsColors.darkGray[60];return(0,X.jsxs)($i,{container:!0,alignItems:`center`,width:`100%`,children:[(0,X.jsx)($i,{item:!0,xs:!0,children:(0,X.jsx)(Cp,{})}),(0,X.jsx)($i,{item:!0,px:2,children:(0,X.jsx)(L,{variant:t?`caption`:`body2`,component:`span`,whiteSpace:`nowrap`,color:t?r:void 0,children:e})}),(0,X.jsx)($i,{item:!0,xs:!0,children:(0,X.jsx)(Cp,{})})]})},OrDivider=()=>(0,X.jsx)(LabeledDivider,{label:(0,X.jsx)(N,{id:`commonScreen.common.or`})}),XT=`couponDetails`,openRegistrationSuccessModal=()=>{Zu.open({type:Mu.confirm,contentProps:{onConfirm:Zu.close,confirmLabel:R._({id:`commonScreen.common.close`}),content:(0,X.jsxs)(`div`,{style:{maxWidth:`400px`},children:[(0,X.jsx)(`p`,{children:(0,X.jsx)(N,{components:{0:(0,X.jsx)(`br`,{}),1:(0,X.jsx)(`br`,{})},id:`registerScreen.registerForm.registrationSuccessMessage`})}),(0,X.jsx)(`b`,{children:(0,X.jsx)(N,{id:`registerScreen.registerForm.verifyYourEmail`})})]}),dialogTitle:(0,X.jsx)(N,{id:`registerScreen.registerForm.accountCreatedSuccessfully`})}})},RegisterLink=({navigate:e})=>{let{getArticleUrl:t}=jp();return(0,X.jsx)(bp,{component:`button`,onClick:()=>e(t(`deribit-restricted-countries`)),children:(0,X.jsx)(N,{id:`registerScreen.registerForm.restrictedCountries`})})},register=async({values:e,applicationParam:t,utmParams:n,deribitClient:r,navigate:i,setSubmitting:o,isPasswordSaltingEnabled:s,shouldShowSuccessModal:c=!1})=>{let p=localStorage.getItem(XT);try{let i;if(i=s?await r.register({username:e.username,email:e.email,password:e.password,country:e.country.alt_code,subscribed_to_marketing_emails:e.subscribeToMarketingEmails,lang:localStorage.getItem(`deribit.lang`)||`en`,affiliate:getAffiliate(),coupon:p?JSON.parse(p).code:void 0,referrer:document.referrer||``,...t&&{application:t},...n?.utm_source&&{utm_source:n.utm_source},...n?.utm_medium&&{utm_medium:n.utm_medium},...n?.utm_campaign&&{utm_campaign:n.utm_campaign}}):await r.register_deprecated({username:e.username,email:e.email,password:e.password,country:e.country.alt_code,subscribed_to_marketing_emails:e.subscribeToMarketingEmails,lang:localStorage.getItem(`deribit.lang`)||`en`,affiliate:getAffiliate(),coupon:p?JSON.parse(p).code:void 0,referrer:document.referrer||``,...t&&{application:t},...n?.utm_source&&{utm_source:n.utm_source},...n?.utm_medium&&{utm_medium:n.utm_medium},...n?.utm_campaign&&{utm_campaign:n.utm_campaign}}),i===`ok`)return c&&openRegistrationSuccessModal(),localStorage.removeItem(XT),i}catch(e){o(!1);let t=e.message;if(e.data&&e.data.errors){let n=e.data.errors[0];n&&(e.code===11049&&n[0]===`country`&&n[1]===`not_allowed`?t=(0,X.jsx)(`div`,{children:(0,X.jsx)(N,{values:{restrictedCountries:(0,X.jsx)(RegisterLink,{navigate:i})},id:`registerScreen.registerForm.countryNotAllowed`})}
496):e.code===11049?e.data.errors.forEach(e=>{if(e[0]===`username`&&e[1]===`forbidden`)t=R._({id:`registerScreen.registerForm.usernameForbidden`});else if(e[0]===`username`&&e[1]===`only_alphanumeric`)t=R._({id:`registerScreen.registerForm.usernameAlphaNumeric`});else if(e[0]===`email`&&e[1]===`max_accounts_per_mailbox`)t=R._({id:`registerScreen.registerForm.emailMaximumMailboxExceeded`});else if(e[0]===`email`&&e[1]===`too_long`){let n=e[2];t=R._({id:`registerScreen.registerForm.emailTooLong`,values:{maxEmailLength:n}})}else e[0]===`email`&&e[1]===`invalid_domain`?t=R._({id:`registerScreen.registerForm.invalidDomain`}):e[0]===`email`&&e[1]===`blocked`?t=R._({id:`registerScreen.registerForm.blockedDomain`}):e[0]===`username`&&e[1]===`already_taken`?t=R._({id:`registerScreen.registerForm.userAlreadyTaken`}):e[0]===`username`&&e[1]===`too_short`&&(t=R._({id:`registerScreen.registerForm.userTooShort`}))}):t=`${n[0].charAt(0).toUpperCase()+n[0].slice(1)} ${n[1].replace(`_`,` `)}`)}e.code!==12004&&e.code!==13025&&Y.notify({isError:!0,message:t}),console.log(e)}};function useQuery(){let{search:e}=St();return(0,$.useMemo)(()=>new URLSearchParams(e),[e])}function useAffiliateRestrictedCountries(){let e=Ti(),[t,n]=(0,$.useState)(null);return(0,$.useEffect)(()=>{let fetchAffiliateRestrictedCountries=async()=>{try{n(await e.listAffiliateRestrictedCountries())}catch(e){console.error(e)}};fetchAffiliateRestrictedCountries()},[e]),t}var getEmailValidationSchema=()=>Rp().shape({email:Fp().required(R._({id:`commonScreen.email.required`})).email(R._({id:`commonScreen.email.invalid`}))}),getRegisterFirstStepSchema=()=>getEmailValidationSchema().concat(Rp().shape({country:Rp().shape({alt_code:Fp().required(R._({id:`registerScreen.registerForm.selectCountry`}))}),isAcceptTermsAndPolicy:Lp().oneOf([!0],R._({id:`registerScreen.registerForm.agreeTermsOfServiceAndPrivacyPolicy`}))})),getRegisterSecondStepSchema=()=>getRegisterFirstStepSchema().concat(Rp().shape({username:Fp().required(R._({id:`registerScreen.registerForm.usernameIsRequired`})).min(5).matches(/^[a-zA-Z0-9]+$/),password:Fp().required(R._({id:`registerScreen.registerForm.passwordIsRequired`})).matches(cf),confirmedPassword:Fp().required(R._({id:`registerScreen.registerForm.confirmPasswordIsRequired`})).oneOf([Ip(`password`)],R._({id:`commonScreen.common.passwordsDoNotMatch`}))})),getOAuthSignUpSchema=()=>Rp().shape({username:Fp().required(R._({id:`registerScreen.registerForm.usernameIsRequired`})).min(5).matches(/^[a-zA-Z0-9]+$/),country:Rp().shape({alt_code:Fp().required(R._({id:`registerScreen.registerForm.selectCountry`}))}),isAcceptTermsAndPolicy:Lp().oneOf([!0],R._({id:`registerScreen.registerForm.agreeTermsOfServiceAndPrivacyPolicy`}))});V();var ZT=P(L)(({theme:e})=>z`
497    color: ${e.getColor({default:`error.200`})};
498  `),getRegisterErrorMessage=e=>{let t=e.message;if(e.data?.reason===`already_taken`&&e.data?.param===`email`&&(t=R._({id:`registerScreen.registerForm.emailAlreadyTaken`})),e.data&&e.data.errors){let n=e.data.errors[0];n&&(e.code===11049&&n[0]===`country`&&n[1]===`not_allowed`?t=(0,X.jsx)(`div`,{children:(0,X.jsx)(N,{values:{restrictedCountries:(0,X.jsx)(wc,{article:`deribit-restricted-countries`,newTab:!0,children:(0,X.jsx)(N,{id:`registerScreen.registerForm.restrictedCountries`})})},id:`registerScreen.registerForm.countryNotAllowed`})}):e.code===11049?e.data.errors.forEach(e=>{if(e[0]===`username`&&e[1]===`forbidden`)t=R._({id:`registerScreen.registerForm.usernameForbidden`});else if(e[0]===`username`&&e[1]===`only_alphanumeric`)t=R._({id:`registerScreen.registerForm.usernameAlphaNumeric`});else if(e[0]===`email`&&e[1]===`max_accounts_per_mailbox`)t=R._({id:`registerScreen.registerForm.emailMaximumMailboxExceeded`});else if(e[0]===`email`&&e[1]===`too_long`){let n=e[2];t=R._({id:`registerScreen.registerForm.emailTooLong`,values:{maxEmailLength:n}})}else e[0]===`email`&&e[1]===`invalid_domain`?t=R._({id:`registerScreen.registerForm.invali
498dDomain`}):e[0]===`email`&&e[1]===`blocked`?t=R._({id:`registerScreen.registerForm.blockedDomain`}):e[0]===`email`&&e[1]===`already_taken`?t=R._({id:`registerScreen.registerForm.emailAlreadyTaken`}):e[0]===`username`&&e[1]===`already_taken`?t=R._({id:`registerScreen.registerForm.userAlreadyTaken`}):e[0]===`username`&&e[1]===`too_short`?t=R._({id:`registerScreen.registerForm.userTooShort`}):e===`authorization_code`&&(t=R._({id:`registerScreen.registerForm.oAuthCodeIsInvalid`}))}):t=`${n[0].charAt(0).toUpperCase()+n[0].slice(1)} ${n[1].replace(`_`,` `)}`)}return t},QT=[`RUS`,`BLR`],$T=[`ARE`,`PAN`],getRestrictedCountryHint=e=>{let t={RUS:`restrictions-for-russians`,BLR:`restrictions-for-belarusians`}[e];return(0,X.jsx)(N,{values:{knowledgeBaseProhibitedRussiansLink:(0,X.jsx)(wc,{article:t,target:`_blank`,rel:`noopener noreferrer`,children:(0,X.jsx)(N,{id:`accountScreen.verification.knowledgeBase`})})},id:`registerScreen.registerForm.prohibitedRussians`})},getRetailRestrictedCountryHint=()=>(0,X.jsx)(N,{components:{0:(0,X.jsx)(wc,{article:`investor-classification`,newTab:!0}),1:(0,X.jsx)(wc,{article:`investor-classification`,newTab:!0})},id:`registerScreen.registerForm.retailRestrictedCountry`}),getCountryError=(e,t)=>{switch(e){case`restricted-country`:return{title:R._({id:`registerScreen.registerForm.countryRestricted.title`}),hint:getRestrictedCountryHint(t),body:getRestrictedCountryHint(t)};case`retail-restricted-country`:{let e=(0,X.jsx)(ZT,{children:(0,X.jsx)(N,{id:`registerScreen.registerForm.retailRestrictedCountry.hint`})}),n,r;return t===`GBR`?(n=R._({id:`registerScreen.registerForm.specialCriteriaApply`}),r=(0,X.jsx)(N,{components:{0:(0,X.jsx)(wc,{article:`uk-client-categorisation`,newTab:!0})},id:`registerScreen.registerForm.ukRetailRestrictedCountry`})):$T.includes(t)?(n=R._({id:`registerScreen.registerForm.specialCriteriaApply`}),r=(0,X.jsx)(N,{components:{0:(0,X.jsx)(wc,{article:`deribit-restricted-countries`,newTab:!0})},id:`registerScreen.registerForm.specificOnboardingCriteria`})):(n=R._({id:`registerScreen.registerForm.countryRestricted.title`}),r=getRetailRestrictedCountryHint()),{title:n,hint:e,body:r}}}},eE=`utms`,parseUtmParams=e=>{try{return JSON.parse(e)}catch{return null}},useUtmParams=()=>{let e=yt(),t=St(),{analyticsService:n}=Ru(),[r,i,o]=lf(eE,``);(0,$.useEffect)(()=>{let r=new URLSearchParams(t.search),o=r.get(`utm_source`),s=r.get(`utm_medium`),c=r.get(`utm_campaign`);if(o||s||c){let p={utm_source:o,utm_medium:s,utm_campaign:c};n.trackEvent(`campaign_register_started`,p),i(JSON.stringify(p)),r.delete(`utm_source`),r.delete(`utm_medium`),r.delete(`utm_campaign`);let m=r.toString(),h=`${t.pathname}${m?`?${m}`:``}${t.hash}`;e(h,{replace:!0})}},[n,t,e,i]);let s=parseUtmParams(r),c=(0,$.useCallback)(()=>{s&&n.trackEvent(`campaign_register_completed`,s),o()},[n,o,s]);return(0,$.useMemo)(()=>({utmParams:s,utmParamsCleanUp:c}),[c,s])},tE=[`individual`,`corporate`],parseAccountType=e=>tE.find(t=>t===e),useCoinbaseSignUpParams=()=>{let e=useQuery(),t=Tu(),n=e.get(`email`)?.trim()||null,r=e.get(`country`)?.trim().toUpperCase()||null,i=e.get(`account_type`)?.trim().toLowerCase()||null,o=(0,$.useMemo)(()=>Pu(t,r),[t,r]);return(0,$.useMemo)(()=>{let e=!!(n&&getEmailValidationSchema().isValidSync({email:n}));return{email:n,country:o,accountType:parseAccountType(i),isValid:e&&!!o}},[n,o,i])},nE=`defaultKYCMode`,rE=`${nE}_ttl`,iE=`${nE}_email`,aE=7,isVerificationType=e=>e===`individual`||e===`corporate`,useDefaultKYCMode=e=>{let[t,n,r]=lf(nE,null),[i,o,s]=lf(rE,null),[c,p,m]=lf(iE,null),h=(0,$.useCallback)((e,t)=>{let r=new Date;r.setDate(r.getDate()+aE),n(e),o(r.getTime()),p(t.toLowerCase())},[n,o,p]),g=(0,$.useCallback)(()=>{r(),s(),m()},[r,s,m]);return{defaultKYCMode:isVerificationType(t)&&typeof i==`number`&&new Date().getTime()<i&&typeof c==`string`&&e&&c===e?.toLowerCase()?t:null,storeDefaultKYCMode:h,clearDefaultKYCMode:g}},useSignUpForm=(e,{isCoinbaseSignUp:t=!1}={})=>{let n=useQuery().get(`application`),r=Ti(),{state:i}=St(),{featureToggles:{isPasswordSaltingEnabled:o}}
498=Oi(),s=getAffiliate(),{utmParams:c,utmParamsCleanUp:p}=useUtmParams(),m=useCoinbaseSignUpParams(),h=t?m:void 0,{storeDefaultKYCMode:g}=useDefaultKYCMode(),{oAuthData:_}=useOAuthData(),v=i?.authCodeParam,y=i?.stateParam,b=!!i?.authCodeParam,[x,S]=(0,$.useState)(void 0),C=(0,$.useRef)(i?.reg||``),w=yt(),{isPasswordCompromised:T,checkIfPasswordCompromised:E}=rf(),getValidationSchema=()=>b?getOAuthSignUpSchema():e===1?getRegisterFirstStepSchema():getRegisterSecondStepSchema(),D=qs({initialValues:{email:h?.email??``,username:``,password:``,confirmedPassword:``,country:h?.country??{code:``,name:``,alt_code:``},referralCode:C.current,subscribeToMarketingEmails:!1,isAcceptTermsAndPolicy:!1},validationSchema:getValidationSchema(),async onSubmit(t){if(T){D.setSubmitting(!1);return}D.setSubmitting(!0);let shouldContinue=()=>{if(b)return!!(D.values.username&&D.values.country.alt_code);if(e===2)return!!(D.values.username&&D.values.password&&D.values.confirmedPassword)};if(shouldContinue()){if(b&&_?.provider&&v)try{await r.registerOAuth({username:t.username,country:t.country.alt_code,lang:localStorage.getItem(`deribit.lang`)||`en`,affiliate:s,referrer:document.referrer||``,authorization_code:v,state_code:y,provider:_.provider,subscribed_to_marketing_emails:t.subscribeToMarketingEmails,...c?.utm_source&&{utm_source:c.utm_source},...c?.utm_medium&&{utm_medium:c.utm_medium},...c?.utm_campaign&&{utm_campaign:c.utm_campaign}})&&(Y.notify({isSuccess:!0,message:R._({id:`registerScreen.registerForm.accountCreated`})}),p(),w(`../tfa_setup`,{state:i}));return}catch(e){if(dd(e)){let t=getRegisterErrorMessage(e);Y.notify({isError:!0,message:t})}else console.error(e);return}await register({values:t,applicationParam:n,utmParams:c,deribitClient:r,navigate:w,setSubmitting:D.setSubmitting,isPasswordSaltingEnabled:o})===`ok`&&(p(),h?.accountType&&h.email&&g(h.accountType,h.email),w(`../email_confirmation`,{state:{email:t.email}}))}}}),O=useAffiliateRestrictedCountries()?.includes(D.values.country.code),k=(s||x)&&!O,ee=!t&&(C.current||!s)&&!O,applyReferralCode=async e=>{S(void 0);let t=await r.getAffiliate({reg:e});if(!t){S(!1);return}S(!0),C.current=e,storeAffiliate(t),await D.setFieldValue(`referralCode`,e)};return{formik:D,shouldShowAffiliateDiscountMessage:k,shouldShowReferralCodeField:ee,checkIfPasswordCompromised:E,applyReferralCode,affiliate:s,isAffiliateCountryRestricted:O,isValidReferralCode:x,isPasswordCompromised:T,isOAuthSignUp:b,isCoinbaseSignUp:t}},useLegalDocumentInfo=()=>{let e=Ti(),[t,n]=(0,$.useState)(),[r,i]=(0,$.useState)();(0,$.useEffect)(()=>{let getLegalDocumentInfo=async()=>{try{i(void 0);let t=await e.getLegalDocumentInfo();n(t)}catch(e){i(e)}};getLegalDocumentInfo()},[e]);let getCurrent=(e,n)=>t?.[e]?.current?.[n],getLatest=(e,n)=>t?.[e]?.latest?.[n],getAllCurrentDocuments=e=>Object.values(t?.[e]?.current??{}),getAllLatestDocuments=e=>Object.values(t?.[e]?.latest??{});return{getAllCurrentDocuments,getAllLatestDocuments,getCurrent,getLatest,error:r}};V();var oE=ld(mp)(({theme:e})=>z`
499    width: 20px;
500    height: 20px;
501    padding: ${e.spacing(1)};
502    margin-right: ${e.spacing(1)};
503    margin-top: ${e.spacing(.5)};
504  `),sE=ld(wp)`
505  align-items: start;
506  margin-right: 0;
507  margin-left: 0;
508`,SignUpCheckbox=({value:e,onChange:t,error:n,label:r,name:i})=>(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(sE,{onChange:()=>t(!e),control:(0,X.jsx)(oE,{name:i,"data-id":i,checked:e,color:`primary`}),label:r}),n&&(0,X.jsx)(hi,{error:!0,children:n})]}),TermsOfService=({value:e,onChange:t,error:n})=>{let{getCurrent:r,error:i}=useLegalDocumentInfo(),o=r(`panama`,`general_terms`),s=(0,X.jsx)(wc,{newTab:!0,article:`fees`,children:(0,X.jsx)(N,{id:`registerScreen.registerForm.agreeTermsAndPolicy.fees`})}),c=(0,X.jsx)(Wt,{newTab:!0,to:o?.urls.html||`/`,children:(0,X.jsx)(N,{id:`registerScreen.registerForm.agreeTermsAndPolicy.termsOfService`})}),p=(0,X.jsx)(wc,{newTab:!0,article:`privacy-policy`,children:(0,X.jsx)(N,{id:`registerScreen.registerForm.agreeTermsAndPolicy.privacyNotice`})});return(0,$.useEffect)(()=>{i&&(console.error(i),Oe(i instanceof Error?i:Error(`Terms of Service fetch error`,i)))},[i]),(0,X.jsx)(X.Fragment,{children:(0,X.jsx)(SignUpCheckbox,{onChange:t,name:`tos`,error:n,value:e,label:(0,X.jsx)(N,{values:{linkTermsOfService:c,linkPrivacyPolicy:p,linkFees:s},id:`registerScreen.registerForm.agreeTermsAndPolicy`})})})};
508function getCouponDetailsDefs({type:e,current_usages:t,maximal_usages:n,value:r,currency:i,expiration_timestamp:o}){let s=[{key:R._({id:`commonScreen.coupon.type`}),value:e===`single_use`?`single use`:`multiple use`}];return t!==void 0&&s.push({key:R._({id:`commonScreen.coupon.currentUsages`}),value:t.toString()}),n!==void 0&&s.push({key:R._({id:`commonScreen.coupon.maximalUsages`}),value:n?n.toString():`No limit`}),s.push({key:R._({id:`commonScreen.coupon.value`}),value:`${r} ${i}`}),o&&s.push({key:R._({id:`commonScreen.coupon.validTo`}),value:Fl(o)}),s}var SignUpBanner=({shouldShowAffiliateDiscountMessage:e,couponDetails:t,isAffiliateCountryRestricted:n,isValidReferralCode:r,isValidCoupon:i})=>n||r===!1||i===!1?(0,X.jsx)(LoginInfoCard,{variant:`error`,title:n?R._({id:`commonScreen.common.affiliateIsNotAvailable`}):R._({id:`registerScreen.registerForm.refferalIsNotValid`}),description:n?R._({id:`commonScreen.common.affiliateIsNotAvailableInResidenceCountry`}):R._({id:`commonScreen.common.referralCodeIsNotValid`}),illustrationName:`negative-badge`}):e?(0,X.jsx)(LoginInfoCard,{variant:`success`,title:R._({id:`registerScreen.registerForm.referralCodeApplied`}),description:R._({id:`registerScreen.registerForm.discountInfo`}),illustrationName:`positive-badge`}):t?.for_registration?(0,X.jsx)(LoginInfoCard,{variant:`success`,title:R._({id:`registerScreen.registerForm.refferalCodeApplied`}),description:(0,X.jsxs)(X.Fragment,{children:[!t.description&&R._({id:`registerScreen.registerForm.couponDetails`}),t.description?(0,X.jsx)(`div`,{dangerouslySetInnerHTML:{__html:t.description},style:{overflow:`auto`,maxWidth:`300px`}}):getCouponDetailsDefs(t).map(({key:e,value:t})=>(0,X.jsxs)(`div`,{children:[e,`: `,t]},e))]}),illustrationName:`positive-badge`}):null,cE=`couponDetails`,useCoupon=()=>{let{couponCode:e}=vt(),t=Ti(),[n,r]=(0,$.useState)(),[i,o]=(0,$.useState)(),[s,c,p]=lf(cE,null);return(0,$.useEffect)(()=>{let initCoupon=async e=>{try{let n=await t.getCouponDetails({code:e});r(n),o(!0),c(n)}catch(e){if(dd(e)&&e.code===11050)o(!1),p();else throw e}};e?initCoupon(e):s&&initCoupon(s.code)},[e,s,t,p,c]),{couponDetails:n,isValidCoupon:i}};V();var lE=ld(L,ai([`isValid`]))(({theme:e,isValid:t})=>z`
509    color: ${t?e.palette.dsColors.success[200]:e.palette.dsColors.error[200]};
510  `),uE=e(({isValid:e,text:t})=>(0,X.jsxs)(lE,{isValid:e,variant:`body3`,children:[e?`✓`:`✗`,` `,t]}),`ValidationItem`),dE=e(({password:e})=>{let t=new RegExp(/\W/).test(e),n=new RegExp(/[A-Z]/).test(e),r=new RegExp(/[0-9]/).test(e),i=new RegExp(/^.{12,}$/).test(e);return(0,X.jsxs)(I,{display:`flex`,gap:2,children:[(0,X.jsx)(uE,{isValid:i,text:R._({id:`loginForm.password.characters`})}),(0,X.jsx)(uE,{isValid:r,text:R._({id:`loginForm.password.digit`})}),(0,X.jsx)(uE,{isValid:n,text:R._({id:`loginForm.password.uppercaseLetter`})}),(0,X.jsx)(uE,{isValid:t,text:R._({id:`loginForm.password.symbol`})})]})},`PasswordValidation`),fE=ld(Pi)`
511  height: 20px;
512  width: 24px;
513  border-radius: 4px;
514
515  svg {
516    width: 20px;
517    height: 20px;
518  }
519`,pE=(0,$.memo)(({allowRevealPassword:e,...t})=>{let n=(0,$.useRef)(null),[r,i]=(0,$.useState)(!1),onClick=()=>{i(e=>!e),n.current?.focus()};return(0,X.jsx)(Mi,{inputRef:n,type:r?`text`:`password`,endAdornment:e?(0,X.jsx)(Ui,{title:r?R._({id:`loginForm.hidePassword`}):R._({id:`loginForm.showPassword`}),children:(0,X.jsx)(fE,{onClick,children:(0,X.jsx)(Ir,{name:r?`crossedEye`:`eye`})})}):void 0,...t})}),MarketingEmails=({value:e,onChange:t})=>(0,X.jsx)(SignUpCheckbox,{onChange:t,name:`subscribeToMarketingEmails`,value:e,label:(0,X.jsx)(N,{id:`registerScreen.registerForm.subscribeToMarketingEmails`})});V();var mE=P(`form`)(({theme:e})=>z`
520    display: flex;
521    flex-direction: column;
522    gap: ${e.spacing(2)};
523  `),hE=P(`div`)(({theme:e})=>z`
524    display: flex;
525    justify-content: center;
526    gap: ${e.spacing(.5)};
527  `),gE=P(`div`)`
528  width: 100%;
529`,_E=P(H)(({theme:e})=>z`
530    margin-top: ${e.spacing(2)};
531  `),SignUpForm=({isCoinbaseSignUp:e=!1})=>{let[t,n]=(0,$.useState)(1),{formik:r,checkIfPasswordCompromised:i,applyReferralCode:o,affiliate:s,shouldShowAffiliateDiscountMessage:c,shouldShowReferralCodeField:p,isAffiliate
531CountryRestricted:m,isValidReferralCode:h,isPasswordCompromised:g,isOAuthSignUp:_}=useSignUpForm(t,{isCoinbaseSignUp:e}),{couponDetails:v,isValidCoupon:y}=useCoupon(),b=ku(),x=(0,$.useMemo)(()=>b.map(e=>e.name),[b]),S=(0,$.useMemo)(()=>b.find(({code:e})=>e===r.values.country.code)?.name??``,[b,r.values.country.code]),handleContinue=()=>{r.submitForm(),t===1&&!_&&!(r.errors.email||r.errors.country||r.errors.referralCode||!r.values.isAcceptTermsAndPolicy)&&(r.setFieldTouched(`username`,!1),r.setFieldTouched(`password`,!1),r.setFieldTouched(`confirmedPassword`,!1),n(2))},C=(0,$.useMemo)(()=>QT.includes(r.values.country.code)?`restricted-country`:Gd(r.values.country.code)?`retail-restricted-country`:null,[r.values.country.code]),w=C?getCountryError(C,r.values.country.code):void 0;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(TT,{actionName:`signUp`,onArrowClick:t===2?()=>n(1):void 0}),(0,X.jsxs)(mE,{onSubmit:e=>{e.preventDefault(),handleContinue()},children:[(t===1||_)&&(0,X.jsx)(SignUpBanner,{isAffiliateCountryRestricted:m,shouldShowAffiliateDiscountMessage:c,couponDetails:v,isValidReferralCode:h,isValidCoupon:y}),t===1&&w&&(0,X.jsx)(LoginInfoCard,{variant:`error`,illustrationName:`negative-badge`,title:w?.title,description:w?.body}),!_&&!e&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(OAuthButtons,{authType:`signUp`,variant:`socials`}),(0,X.jsx)(OrDivider,{})]}),t===1&&(0,X.jsxs)(X.Fragment,{children:[_?(0,X.jsx)(Mi,{"data-id":`username`,label:R._({id:`loginForm.username`}),name:`username`,autoComplete:`username`,autoFocus:!0,value:r.values.username,onChange:r.handleChange,hint:r.touched.username&&r.errors.username?R._({id:`registerScreen.registerForm.usernameRequirements`}):void 0,error:!!(r.touched.username&&r.errors.username),inputProps:{id:`username`}}):(0,X.jsx)(Mi,{label:R._({id:`loginForm.email`}),"data-id":`email`,inputMode:`email`,name:`email`,autoFocus:!e,autoComplete:`email`,disabled:e,value:r.values.email,onChange:r.handleChange,hint:r.touched.email?r.errors.email:void 0,error:!!(r.touched.email&&r.errors.email),inputProps:{id:`email`}}),e?(0,X.jsx)(Mi,{label:R._({id:`loginForm.countryOfResidence`}),"data-id":`country`,name:`country`,size:`lg`,disabled:!0,value:S,hint:w?.hint,inputProps:{id:`country`}}):(0,X.jsx)(Sp,{id:`country`,"data-id":`country`,size:`small`,options:x,disableClearable:!0,openOnFocus:!0,value:x.find(e=>e===r.values.country.name)||``,onChange:(e,t)=>
531{t!==``&&r.setFieldValue(`country`,b.find(({name:e})=>e===t))},renderInput:({InputProps:e,InputLabelProps:t,size:n,...i})=>(0,X.jsx)(Mi,{label:R._({id:`loginForm.countryOfResidence`}),endAdornment:e.endAdornment,ref:e.ref,hint:w?.hint||(r.touched.country?r.errors.country?.alt_code:void 0),error:!!(r.touched.country&&r.errors.country?.alt_code),...i,size:`lg`})}),p&&(0,X.jsxs)(I,{display:`flex`,alignItems:`flex-end`,flexGrow:1,gap:1,children:[(0,X.jsx)(gE,{children:(0,X.jsx)(Mi,{label:R._({id:`loginForm.referralCode`}),"data-id":`referralCode`,type:`text`,name:`referralCode`,fullWidth:!0,value:r.values.referralCode,onChange:r.handleChange,hint:r.touched.referralCode?r.errors.referralCode:void 0,error:!!(r.touched.referralCode&&r.errors.referralCode),disabled:!!s,inputProps:{id:`referralCode`}})}),(0,X.jsx)(H,{disabled:!!s||!r.values.referralCode,variant:`plain`,onClick:()=>o(r.values.referralCode),children:(0,X.jsx)(N,{id:`loginForm.apply`})})]}),(0,X.jsx)(TermsOfService,{value:r.values.isAcceptTermsAndPolicy,onChange:e=>r.setFieldValue(`isAcceptTermsAndPolicy`,e),error:r.touched.isAcceptTermsAndPolicy?r.errors.isAcceptTermsAndPolicy:void 0}),(0,X.jsx)(MarketingEmails,{value:r.values.subscribeToMarketingEmails,onChange:e=>r.setFieldValue(`subscribeToMarketingEmails`,e)})]}),t===2&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Mi,{label:R._({id:`loginForm.username`}),"data-id":`username`,name:`username`,autoComplete:`username`,autoFocus:!0,value:r.values.username,onChange:r.handleChange,hint:r.touched.username&&r.errors.username?R._({id:`registerScreen.registerForm.usernameRequirements`}):void 0,error:!!(r.touched.username&&r.errors.username),inputProps:{id:`username`}}),(0,X.jsx)(pE,{allowRevealPassword:!0,"data-id":`password`,name:`password`,autoComplete:`new-password`,label:R._({id:`loginForm.password`}),value:r.values.password,onChange:e=>{r.handleChange(e),i(e.target.value)},hint:(()=>{if(g)return R._({id:`commonScreen.common.passwordCompromised`});if(r.values.password)return(0,X.jsx)(dE,{password:r.values.password})})(),error:g,inputProps:{id:`password`}}),(0,X.jsx)(pE,{allowRevealPassword:!0,label:R._({id:`loginForm.confirmPassword`}),"data-id":`confirmedPassword`,name:`confirmedPassword`,autoComplete:`new-password`,value:r.values.confirmedPassword,onChange:r.handleChange,hint:r.touched.confirmedPassword?r.errors.confirmedPassword:void 0,error:!!(r.touched.confirmedPassword&&r.errors.confirmedPassword),inputProps:{id:`confirmedPassword`}})]}),(0,X.jsx)(_E,{type:`submit`,variant:`filled`,children:(0,X.jsx)(N,{id:`loginForm.continue`})})]}),(0,X.jsxs)(hE,{children:[(0,X.jsx)(L,{children:(0,X.jsx)(N,{id:`loginForm.alreadyHaveAnAccount`})}),(0,X.jsx)(Wt,{isRouter:!0,to:`../login`,children:(0,X.jsx)(N,{id:`loginForm.login`})})]})]})};V();var vE=P(`form`)(({theme:e})=>z`
532    display: flex;
533    flex-direction: column;
534    gap: ${e.spacing(2)};
535  `),yE=P(`div`)(({theme:e})=>z`
536    display: flex;
537    justify-content: center;
538    gap: ${e.spacing(.5)};
539  `),bE=P(H)(({theme:e})=>z`
540    margin-top: ${e.spacing(2)};
541  `),ApiLoginForm=()=>{let e=yt(),{formik:t,onSubmit:n,setGrantType:r}=xT(),i=ut(),handleSubmit=e=>{e.preventDefault(),n()},handleInput=e=>{r(`apiKey`),t.handleChange(e)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(TT,{actionName:`loginByApi`,onArrowClick:()=>e(`../login`)}),(0,X.jsxs)(vE,{onSubmit:handleSubmit,children:[(0,X.jsx)(Mi,{label:R._({id:`loginForm.clientId`}),value:t.values.accessKey,name:`accessKey`,onChange:handleInput,autoFocus:!0,hint:t.touched.accessKey?t.errors.accessKey:void 0,error:!!(t.touched.accessKey&&t.errors.accessKey),inputProps:{id:`accessKey`}}),(0,X.jsx)(Mi,{type:`password`,label:R._({id:`loginForm.clientSecret`}),value:t.values.accessSecret,name:`accessSecret`,onChange:handleInput,hint:t.touched.accessSecret?t.errors.accessSecret:void 0,error:!!(t.touched.accessSecret&&t.errors.accessSecret),inputProps:{id:`accessSecret`}}),(0,X.jsx)(bE,{type:`submit`,variant:`filled`,children:(0,X.jsx)(N,{id:`loginForm.continue`})})]}),(0,X.jsxs)(yE,{children:[(0,X.jsx)(L,{children:(0,X.jsx)(N,{id:`loginForm.dontHaveAccount`})}),(0,X.jsx)(Wt,{isRouter:!i.isExternal,to:i.url,children:(0,X.jsx)(N,{id:`loginForm.register`})})]})]})},useForgotPassword=()=>{let e=Ti(),t=qs({initialValues:{email:``,status:``},validationSchema:getEmailValidationSchema(),onSubmit:async n=>{t.setSubmitting(!0);try{await e.askForPasswordReset({email:n.email}),t.setFieldValue(`status`,`success`)}catch(e){console.error(e),t.setFieldValue(`status`,`error`)}}});return{formik:t,onSubmit:t.handleSubmit}};V();var xE=P(`form`)(({theme:e})=>z`
542    display: flex;
543    flex-direction: column;
544    gap: ${e.spacing(2)};
545  `),SE=P(H)(({theme:e})=>z`
546    margin-top: ${e.spacing(2)};
547  `),ForgotPasswordForm=()=>{let e=yt(),{formik:t,onSubmit:n}=useForgotPassword(),handleSubmit=e=>{e.preventDefault(),n()};return t.values.status===`success`&&e(`../login`,{state:{resetPasswordRequested:!0}}),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(TT,{actionName:`forgotPassword`,onArrowClick:()=>e(`../login`)}),(0,X.jsxs)(xE,{onSubmit:handleSubmit,children:[(0,X.jsx)(Mi,{label:R._({id:`loginForm.email`}
547),value:t.values.email,name:`email`,inputMode:`email`,autoFocus:!0,autoComplete:`email`,onChange:t.handleChange,hint:t.touched.email?t.errors.email:void 0,error:!!(t.touched.email&&t.errors.email),inputProps:{id:`email`}}),(0,X.jsx)(SE,{type:`submit`,variant:`filled`,children:(0,X.jsx)(N,{id:`loginForm.continue`})})]})]})},getResetPasswordSchema=()=>Rp().shape({newPassword:Fp().required(R._({id:`commonScreen.resetPasswordForm.passwordIsRequired`})).matches(cf),confirmedPassword:Fp().required(R._({id:`commonScreen.resetPasswordForm.confirmPasswordIsRequired`})).oneOf([Ip(`newPassword`)],R._({id:`commonScreen.resetPasswordForm.passwordsDoNotMatch`}))}),useSetupPassword=()=>{let e=Ti(),{featureToggles:t}=Oi(),{isPasswordSaltingEnabled:n}=t,{isPasswordCompromised:r,checkIfPasswordCompromised:i}=rf(),o=(0,$.useRef)(null),s=yt(),c=St(),[p]=Mn(),m=p.get(`code`),h=c.state,g=(0,$.useCallback)(()=>{s(`/login`)},[s]),_=qs({initialValues:{newPassword:``,confirmedPassword:``},validationSchema:getResetPasswordSchema(),onSubmit:async t=>{if(r)return;let i;try{if(n){if(o.current?.valid){let{N:n,g:r,I:i}=o.current,{salt:s,verifier:c}=calcSaltAndVerifier({N:n,g:r,I:i,password:t.newPassword});await Np(e.resetPassword.bind(e),[{s,V:c,code:h}])}else throw Error(`invalid code`)}i=R._({id:`commonScreen.common.passwordChanged`}),g()}catch(e){e===`session_drop`?g():console.log(e)}i&&Y.notify({isError:!1,message:i})}}),v=(0,$.useCallback)(async()=>{let t=!0;try{o.current=await e.resetPasswordCodeValidation({code:h}),t=o.current.valid}catch(e){console.log(e),t=!(dd(e)&&e.data.param===`code`&&e.data.reason===`invalid code`)}finally{t||(Y.notify({isError:!0,message:R._({id:`commonScreen.common.invalidOrExpiredCode`})}),g())}},[e,h,g]);return(0,$.useEffect)(()=>{m&&s(``,{state:m,replace:!0})},[m,s]),(0,$.useEffect)(()=>{v()},[v]),{formik:_,checkIfPasswordCompromised:i,isPasswordCompromised:r}};V();var CE=P(`form`)(({theme:e})=>z`
548    display: flex;
549    flex-direction: column;
550    gap: ${e.spacing(2)};
551  `),wE=P(H)(({theme:e})=>z`
552    margin-top: ${e.spacing(2)};
553  `),SetupPassword=()=>{let{formik:e,checkIfPasswordCompromised:t,isPasswordCompromised:n}=useSetupPassword();return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(TT,{actionName:`setupPassword`}),(0,X.jsxs)(CE,{onSubmit:t=>{t.preventDefault(),e.submitForm()},children:[(0,X.jsx)(pE,{allowRevealPassword:!0,autoFocus:!0,"data-id":`newPassword`,name:`newPassword`,autoComplete:`new-password`,label:R._({id:`setupPasswordForm.newPassword`}),value:e.values.newPassword,onChange:n=>{e.handleChange(n),t(n.target.value)},hint:(()=>{if(n)return R._({id:`commonScreen.common.passwordCompromised`});if(e.values.newPassword)return(0,X.jsx)(dE,{password:e.values.newPassword})})(),error:n,inputProps:{id:`newPassword`}}),(0,X.jsx)(pE,{allowRevealPassword:!0,label:R._({id:`loginForm.confirmPassword`}),"data-id":`confirmedPassword`,name:`confirmedPassword`,autoComplete:`new-password`,value:e.values.confirmedPassword,onChange:e.handleChange,hint:e.touched.confirmedPassword?e.errors.confirmedPassword:void 0,error:!!(e.touched.confirmedPassword&&e.errors.confirmedPassword),inputProps:{id:`confirmedPassword`}}),(0,X.jsx)(wE,{type:`submit`,variant:`filled`,children:(0,X.jsx)(N,{id:`loginForm.continue`})})]})]})},useResendActivationLink=()=>{let e=Ti(),t=yt(),n=qs({initialValues:{email:``},validationSchema:getEmailValidationSchema(),onSubmit:async r=>{await n.setSubmitting(!0);let i,o=!1;try{await e.resendActivationMail({email:r.email}),i=R._({id:`loginScreen.resendActivationMailForm.weSentAnEmailWithActivationLink`}),t(`/login`)}catch(e){e?.data?.reason===`invalid format`&&(i=R._({id:`loginScreen.loginForm.error.invalidEmail`}),o=!0),console.log(e)}i&&Y.notify({message:i,isError:o})}});return{formik:n}};V();var TE=P(`form`)(({theme:e})=>z`
554    display: flex;
555    flex-direction: column;
556    gap: ${e.spacing(2)};
557  `),EE=P(H)(({theme:e})=>z`
558    margin-top: ${e.spacing(2)};
559  `),ResendActivationLinkForm=()=>{let{formik:e}=useResendActivationLink(),t=yt();return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(TT,{actionName:`resendActivationLink`,onArrowClick:()=>t(`../login`)}),(0,X.jsxs)(TE,{onSubmit:e.handleSubmit,children:[(0,X.jsx)(Mi,{label:R._({id:`loginForm.email`}
559),value:e.values.email,name:`email`,inputMode:`email`,autoFocus:!0,autoComplete:`email`,onChange:e.handleChange,hint:e.touched.email?e.errors.email:void 0,error:!!(e.touched.email&&e.errors.email),inputProps:{id:`email`}}),(0,X.jsx)(EE,{type:`submit`,variant:`filled`,children:(0,X.jsx)(N,{id:`loginForm.continue`})})]})]})},useSecurityKeyActivation=()=>{let e=Ti();return{activateSecurityKey:(0,$.useCallback)(async(t,n,r)=>r?Np(e.activateSecurityKeyForOAuthRegistration.bind(e),[{...t,...n,provider:r}]):(await Np(e.activateSecurityKey.bind(e),[{...t,...n}]),e.getSecurityKeyStatus()),[e])}},DE=300,OE=(0,$.createContext)(null),isTFACodeError=e=>dd(e)&&[-32602,13668,13667].includes(e.code),validateParams=(e,t,n)=>{if(!t.name||t.name.length===0)return{name:`empty`};if(!/^[0-9A-Za-z_-]+$/.test(t.name))return{name:`incorrect-format`};if(e===`tfa`&&n===`wait-for-challenge`){if(!t.tfaConfirmation||t.tfaConfirmation.length===0)return{tfaConfirmation:`empty`};if(t.tfaConfirmation.length!==6)return{tfaConfirmation:`length-too-short`}}return{}},getDefaultMethodParams=(e=``)=>({name:e,tfaConfirmation:``}),useParamValidation=(e,t)=>{let[n,r]=(0,$.useState)(getDefaultMethodParams()),[i,o]=(0,$.useState)({}),[s,c]=(0,$.useState)(!1),p=(0,$.useCallback)(()=>{if(!e)return;let r=validateParams(e,n,t);o(r),c(Object.values(r).length===0)},[n,e,t]),onChangeParams=e=>{r(t=>({...t,...e}))};return(0,$.useEffect)(()=>{p()},[p,n]),{methodParams:n,methodParamsErrors:i,areParamsValid:s,checkParams:p,onChangeParams}},SecurityKeySetupProvider=({preselectedMethod:e,defaultName:t,oAuthProvider:n,children:r})=>{let[i,o]=(0,$.useState)(`fill-method-params`),[s,c]=(0,$.useState)(),[p,m]=(0,$.useState)(e),[h,g]=(0,$.useState)(),{activateSecurityKey:_}=useSecurityKeyActivation(),{areParamsValid:v,checkParams:y,methodParams:b,methodParamsErrors:x,onChangeParams:S}=useParamValidation(p,i),C=Ti(),w=B(fi),{start:E,stop:D,reset:O,time:k,counter:ee}=T(DE),{state:te}=St(),A=te?.authCodeParam,j=(0,$.useCallback)(e=>{D(),O(),o(`failure`),c(e),y()},[D,O,y]),ne=(0,$.useCallback)(()=>{o(`fill-method-params`),m(void 0),S(getDefaultMethodParams()),g(void 0),c(void 0),O(),D()},[S,O,D]),M=(0,$.useCallback)(e=>{e!==p&&(m(e),o(`fill-method-params`),c(void 0),S(getDefaultMethodParams()),g(void 0))},[S,p]),re=(0,$.useCallback)(async e=>{let t={...e,provider:n,authorization_code:A};return await C.getSecurityKeysActivationData(t)},[C,A,n]),ie=(0,$.useCallback)(async e=>{if(!(!b||!v||!p)){o(`wait-for-activation-params`),c(void 0);try{let t=await re({name:b.name,type:p,...e??{}});if(!t){j(`activation-params-failure`);return}g(e=>({...e,...t})),O(),E(),o(`wait-for-challenge`)}catch(e){console.error(e),j(`generic-failure`)}}},[v,re,b,j,O,p,E]),ae=(0,$.useCallback)(async()=>{c(void 0);try{if(!h){j(`register-failure`);return}let e,t={forLogin:!0,forAccount:!0,forWallet:!0,forAdmin:w};if(h.type===`u2f`){o(`wait-for-register`);try{let t=await Au({...h.data});if(t)e={type:`u2f`,name:b.name,activation_challenge:h.activation_challenge,...t};else{j(`register-failure`),qe(`navigator.credentials.create() returned null during registering a security key`);return}}catch(e){j(`register-failure`),Oe(e);return}}else h.type===`tfa`&&(e={type:`tfa`,name:b.name,tfa_confirmation:b.tfaConfirmation,activation_challenge:h?.activation_challenge});if(o(`wait-for-activation`),!e){j(`unsupported-method-failure`);return}await _(e,t,n)?o(`completed`):j(`activation-failure`)}catch(e){if(dd(e)&&isTFACodeError(e)&&e.data?.param===`tfa_confirmation`)return ie({generate_new_secret:!1});typeof e==`string`&&e===`SecurityKey confirmation cancelled`||isTFACodeError(e)?o(`wait-for-challenge`):(j(`generic-failure`),console.error(e));return}},[h,w,_,n,j,b.name,b.tfaConfirmation,ie]);(0,$.useEffect)(()=>{i===`wait-for-challenge`&&p===`u2f`&&ae()},[ae,i,p]),(0,$.useEffect)(()=>{ee!==void 0&&ee===0&&j(`timeout`)},[ee,j,D]),(0,$.useEffect)(()=>{t&&b.name===``&&S(getDefaultMethodParams(t))},[S,b.name,t]);let oe=(0,$.useMemo)(()=>({method:p,changeMethod:M,methodParams:b,methodParamsErrors:x,changeMethodParams:S,areParamsValid:v,onReset:ne,startSecurityKeySetup:ie,processStatus:i,authProcessRemainingTime:i===`fill-method-params`?void 0:k,processError:s,activationData:h,activateSecurityKey:ae}),[p,M,b,x,S,v,ne,ie,i,k,s,h,ae]);return(0,X.jsx)(OE.Provider,{value:oe,children:r})},useSecurityKeySetup=()=>{let e=(0,$.useContext)(OE);if(!e)throw Error(`useSecurityKeySetupState must be used inside a SecurityKeySetupProvider`);return e};V();var kE=P(`div`)(({theme:e})=>z`
560    display: flex;
561    flex-direction: column;
562    gap: ${e.spacing(1)};
563  `),AE=P(L)(({theme:e})=>z`
564    color: ${e.palette.mode===`dark`?e.palette.dsColors.lightGray[80]:e.palette.dsColors.darkGray[60]};
565  `),NameContent=()=>{let{methodParams:e,changeMethodParams:t,methodParamsErrors:n}=useSecurityKeySetup();return(0,X.jsxs)(kE,{children:[(0,X.jsx)(Mi,{label:(0,X.jsx)(N,{id:`commonScreen.security.securityKeySetup.nameLabel.securityKey`}),error:n.name===`incorrect-format`,hint:n.name===`incorrect-format`&&(0,X.jsx)(N,{id:`commonScreen.security.securityKeySetup.nameFormatError`}),autoFocus:!0,name:`name`,placeholder:`Name`,value:e.name,endAdornment:(0,X.jsxs)(L,{fontWeight:600,variant:`body4`,children:[e.name.length,`/16`]}),onChange:e=>{t({name:truncate(e.target.value,{length:16,omission:``})})},inputProps:{id:`key-name`}}),(0,X.jsx)(AE,{variant:`body1`,children:(0,X.jsx)(N,{id:`commonScreen.security.securityKeySetup.nameHint`})})]})},TimeLeft=()=>{let{authProcessRemainingTime:e}=useSecurityKeySetup();return e?(0,X.jsx)(L,{children:(0,X.jsx)(N,{values:{authProcessRemainingTime:e},components:{0:(0,X.jsx)(`b`,{})},id:`commonScreen.security.securityKeySetup.activationTimeRemaining`})}):null};V();var jE=P(`div`)(({theme:e})=>z`
566    margin-top: ${e.spacing(3)};
567    width: 100%;
568    display: flex;
569    flex-direction: column;
570  `),PasskeyCard=({shouldHideNameInput:e})=>{let{method:t,changeMethod:n,processStatus:r}=useSecurityKeySetup();return(0,X.jsx)(Wr,{title:R._({id:`commonScreen.security.securityKeySetup.options.u2f.title`}),description:R._({id:`commonScreen.security.securityKeySetup.options.u2f.description`}),label:R._({id:`commonScreen.common.recommended`}),labelVariant:`secondary`,illustration:`2fa-passkey`,isHighlighted:t===`u2f`,onSelect:()=>{n(`u2f`)},children:t===`u2f`&&(0,X.jsxs)(jE,{children:[!e&&(0,X.jsx)(NameContent,{}),r!==`failure`&&r!==`fill-method-params`&&(0,X.jsx)(TimeLeft,{})]})})},CopyableContent=({children:e,value:t})=>{let[n,r]=(0,$.useState)(!1),copyToClipboard=async e=>{try{await navigator.clipboard.writeText(e),r(!0)}catch(e){console.log(e)}};return(0,X.jsx)(_d,{placement:`bottom`,disableFocusListener:!0,onClose:()=>r(!1),disableInteractive:!0,title:n?R._({id:`accountScreen.deposit.copied`}):R._({id:`accountScreen.deposit.copyToClipboard`}),children:(0,X.jsx)(`div`,{role:`button`,style:{cursor:`pointer`,lineHeight:`initial`},onClickCapture:e=>{e.stopPropagation(),copyToClipboard(String(t))},children:e})})};V();var ME=P(H)(({theme:e})=>z`
571    height: ${e.spacing(3)};
572    width: ${e.spacing(3)};
573    min-width: 0;
574    > div {
575      display: flex;
576    }
577    svg {
578      font-size: 16px;
579    }
580  `),NE=P(L)(()=>z`
581    width: fit-content;
582    cursor: text;
583  `),PE=P(`div`)(({theme:e})=>z`
584    display: flex;
585    align-items: center;
586    gap: ${e.spacing(1.5)};
587  `),CodeCopy=()=>{let e=Dn(),{activationData:t}=useSecurityKeySetup();return t?.type===`tfa`?(0,X.jsxs)(PE,{children:[(0,X.jsx)(NE,{fontWeight:700,fontSize:{xs:12,md:`inherit`},color:e.palette.mode===`dark`?`white`:e.palette.dsColors.darkGray[200],onClick:e=>e.stopPropagation(),children:t.secret}),(0,X.jsx)(CopyableContent,{value:t.secret,children:(0,X.jsx)(ME,{variant:`gray`,size:`xs`,children:(0,X.jsx)(Ir,{name:`copy2`})})})]}):null},generateQRCodeFromActivationData=(e,t)=>t.type===`tfa`?`otpauth://totp/${t.issuer}-${e}:${t.account}?secret=${t.secret}&issuer=${t.issuer}-${e}`:null;V();var FE=P($r)(({theme:e})=>z`
588    box-shadow: ${e.dsShadows.medium};
589  `),IE=P(`div`)(({theme:e})=>z`
590    background-color: ${e.getColor({default:`lightGray.0`})};
591    width: fit-content;
592    padding: 13px;
593    box-shadow: ${e.dsShadows.medium};
594    border-radius: 11px;
595    margin-bottom: ${e.spacing(1)};
596  `),QRCodeWithActivationData=()=>{let{methodParams:e,activationData:t}=useSecurityKeySetup();if(!t)return null;let n=generateQRCodeFromActivationData(e.name,t);return n?(0,X.jsx)(IE,{children:(0,X.jsx)(FE,{value:n,size:180,level:`H`})}):null},QRSection=()=>(0,X.jsxs)(I,{display:`flex`,flexDirection:`column`,alignItems:`center`,children:[(0,X.jsx)(QRCodeWithActivationData,{}),(0,X.jsx)(TimeLeft,{})]});V();var LE=P(`div`)(({theme:e})=>z`
597    margin-top: ${e.spacing(3)};
598    width: 100%;
599    display: flex;
600    flex-direction: column;
601  `),RE=P(`div`)(({theme:e})=>z`
602    margin-top: ${e.spacing(3)};
603    display: flex;
604  `),zE=P(`div`,ai([`variant`]))(({theme:e,variant:t})=>z`
605    grid-area: tfa-input;
606    display: flex;
607    flex-direction: column;
608    margin-top: ${e.spacing(1.5)};
609    margin-bottom: ${e.spacing(2)};
610
611    ${t===`compact`?`
612				align-items: center;
613				>  {
614					width: 100%;
615				}
616			`:``}
617  `),BE=P(`div`,ai([`variant`]))(({variant:e,theme:t})=>z`
618    display: grid;
619    flex: 1;
620    grid-template-rows: auto;
621    grid-template-areas:
622      'explanation qr'
623      'tfa-input qr'
624      'copy-code qr';
625
626    ${e===`compact`?`
627			gap: ${t.spacing(3)};
628			grid-template-areas:
629				'explanation'
630				'qr'
631				'copy-code'
632				'tfa-input';
633		`:``}
634  `),VE=P(`div`,ai([`variant`]))(({variant:e})=>z`
635    grid-area: copy-code;
636    display: flex;
637    align-items: flex-end;
638
639    ${e===`compact`?`
640				justify-content: center
641			`:``}
642  `),HE=P(`div`,ai([`variant`]))(({variant:e,theme:t})=>z`
643    grid-area: explanation;
644    margin-top: ${t.spacing(2)};
645    ${e===`compact`?`margin-top: 0;`:``};
646  `),CopyAuthenticatorCode=()=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(L,{children:(0,X.jsx)(N,{id:`commonScreen.security.securityKeySetup.qrCodeAlternative`})}),(0,X.jsx)(CodeCopy,{})]}),TfaCard=({variant:e=`extended`,shouldHideNameInput:t})=>{let n=Dn(),r=Gt(),{method:i,changeMethod:o,changeMethodParams:s,processStatus:c}=useSecurityKeySetup(),p=(0,$.useCallback)(e=>{s({tfaConfirmation:e})},[s]),m=c===`fill-method-params`||c===`failure`;return(0,X.jsx)(Wr,{title:R._({id:`commonScreen.security.securityKeySetup.options.2fa.title`}),description:R._({id:`commonScreen.security.securityKeySetup.options.2fa.description`}),illustration:`2fa`,isHighlighted:i===`tfa`,onSelect:()=>o(`tfa`),children:i===`tfa`&&(0,X.jsxs)(LE,{children:[m&&!t&&(0,X.jsx)(NameContent,{}),!m&&(0,X.jsx)(RE,{children:(0,X.jsxs)(BE,{variant:e,children:[(0,X.jsx)(HE,{variant:e,children:(0,X.jsx)(L,{variant:`body1`,children:(0,X.jsx)(N,{id:`commonScreen.security.securityKeySetup.appConfigureBody`})})}),(0,X.jsxs)(zE,{variant:e,children:[(0,X.jsx)(I,{marginBottom:n.spacing(2),children:(0,X.jsx)(L,{variant:`body1`,children:(0,X.jsx)(N,{id:`commonScreen.security.securityKeySetup.sixDigitCodeHintText`})})}),(0,X.jsx)(pi,{size:r?`small`:`medium`,onChange:p})]}),(0,X.jsx)(I,{gridArea:`qr`,display:`flex`,justifyContent:`center`,children:(0,X.jsx)(QRSection,{})}),(0,X.jsx)(VE,{variant:e,children:(0,X.jsx)(CopyAuthenticatorCode,{})})]})})]})})},getErrorString=e=>{if(!e)return null;switch(e){case`timeout`:return R._({id:`commonScreen.security.errors.timeout`});case`register-failure`:return R._({id:`commonScreen.security.errors.registerFailure`});case`activation-failure`:return R._({id:`commonScreen.security.errors.activationFailure`});case`activation-params-failure`:return R._({id:`commonScreen.security.errors.activationParamsFailure`});case`unsupported-method-failure`:return R._({id:`commonScreen.security.errors.unsupportedMethodFailure`});default:return R._({id:`commonScreen.security.errors.genericFailure`})}};V();var UE=P(`div`)(({theme:e})=>z`
647    display: flex;
648    flex-direction: column;
649    width: 100%;
650    gap: ${e.spacing(2)};
651  `),SecurityKeySetupSelector=({tfaVariant:e,shouldHideNameInput:t})=>{let{method:n,processError:r}=useSecurityKeySetup(),i=yt(),{oAuthData:o,removeOAuthData:s}=useOAuthData();return(0,$.useEffect)(()=>
651{if(r===`register-failure`&&n===`u2f`){Y.notify({message:R._({id:`accountScreen.security.newToken.addingPasskeyFailed`}),isError:!0});return}let e=getErrorString(r);e&&(Y.notify({isError:!0,message:e}),o?.type===`tfaSetup`&&(s(),i(`/login`)))},[n,i,o,r,s]),(0,X.jsxs)(UE,{children:[(0,X.jsx)(PasskeyCard,{shouldHideNameInput:t}),(0,X.jsx)(TfaCard,{variant:e,shouldHideNameInput:t})]})},useSecurityKeySelectorBaseLogic=()=>{let{processStatus:e,areParamsValid:t,startSecurityKeySetup:n,activateSecurityKey:r}=useSecurityKeySetup(),i=(e===`fill-method-params`||e===`wait-for-challenge`||e===`failure`)&&!t,o=(0,$.useCallback)(()=>{i||(e===`fill-method-params`||e===`failure`?n():e===`wait-for-challenge`&&r())},[r,i,e,n]),s=e===`wait-for-activation`||e===`wait-for-activation-params`||e===`wait-for-register`;return(0,$.useEffect)(()=>{let onKeyUp=e=>{e.key===`Enter`&&o()};return window.addEventListener(`keyup`,onKeyUp),()=>{window.removeEventListener(`keyup`,onKeyUp)}},[o]),{onContinue:o,isLoading:s,isContinueDisabled:i}};V();var WE=P(br)(()=>z`
652    max-width: 450px;
653    min-width: 300px;
654    width: auto;
655
656    @media (max-width: 500px) {
657      width: 90%;
658    }
659  `),SkipTfaModal=({setSkipModalOpen:e,setSkipTfa:t,skipModalOpen:n})=>{let r=yt(),i=nf(),{analyticsService:o}=Ru(),s=Gt();return(0,X.jsx)(WE,{open:n,title:(0,X.jsxs)(I,{display:`flex`,alignItems:`center`,gap:1,children:[(0,X.jsx)(Ir,{name:`verificationFailed`}),(0,X.jsx)(L,{variant:`h5`,children:(0,X.jsx)(N,{id:`loginForm.tfa.skip.question`})})]}),actions:[],children:(0,X.jsxs)(I,{children:[(0,X.jsx)(L,{children:(0,X.jsx)(N,{id:`loginForm.tfa.skip.body`})}),(0,X.jsxs)(I,{display:`flex`,gap:1.25,marginTop:4,flexDirection:s?`column`:`row`,children:[(0,X.jsx)(H,{variant:`gray`,fullWidth:!0,onClick:()=>{e(!1),o.trackEvent(`auth_skip_tfa_setup_click`),r(i.returnUrl?decodeURIComponent(i.returnUrl):`/`),t(!0)},children:R._({id:`commonScreen.common.skip`})}),(0,X.jsx)(H,{variant:`filled`,fullWidth:!0,onClick:()=>e(!1),children:R._({id:`commonScreen.common.addNow`})})]})]})})},SecurityKeySetupForm=()=>{let e=Dn(),{processStatus:t}=useSecurityKeySetup(),n=yt(),r=nf(),i=Gt(),{oAuthData:o,removeOAuthData:s}=useOAuthData(),{isContinueDisabled:c,isLoading:p,onContinue:m}=useSecurityKeySelectorBaseLogic(),[,h]=lf(`didSkipTFASetup`,null),[g,_]=(0,$.useState)(!1),v=o?.type===`signUp`||o?.type===`tfaSetup`;return(0,$.useEffect)(()=>{t===`completed`&&(o&&s(),Y.notify({isSuccess:!0,message:R._({id:`loginForm.securityKeyAdded`})}),n(r.returnUrl?decodeURIComponent(r.returnUrl):`/`))},[t,n,s,o,r.returnUrl]),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(L,{variant:i?`h5`:`h2`,textAlign:`center`,children:(0,X.jsx)(N,{id:`accountScreen.common.twoFactorAuth`})}),(0,X.jsx)(I,{marginTop:e.spacing(5),marginBottom:e.spacing(2),children:(0,X.jsx)(L,{children:(0,X.jsx)(N,{id:`loginForm.tfa.enableMessage`})})}),(0,X.jsx)(SecurityKeySetupSelector,{tfaVariant:`compact`,shouldHideNameInput:v}),(0,X.jsxs)(I,{display:`flex`,flexDirection:`column`,marginTop:e.spacing(4),children:[(0,X.jsx)(Cr,{variant:`filled`,onClick:m,disabled:c,loading:p,children:R._({id:`commonScreen.common.continue`})}),!v&&(0,X.jsx)(H,{variant:`plain`,onClick:()=>_(!0),children:R._({id:`commonScreen.common.skip`})})]}),(0,X.jsx)(SkipTfaModal,{setSkipTfa:h,setSkipModalOpen:_,skipModalOpen:g})]})},ContextAwareSecurityKeySetupForm=()=>{let{oAuthData:e}=useOAuthData(),t=e?.type===`signUp`||e?.type===`tfaSetup`;return(0,X.jsx)(SecurityKeySetupProvider,{preselectedMethod:`u2f`,oAuthProvider:e?.provider,defaultName:t?`main`:void 0,children:(0,X.jsx)(SecurityKeySetupForm,{})})};V();var GE=P(Cr)(({theme:e})=>z`
660    padding-left: ${e.spacing(.5)};
661  `),EmailConfirmation=()=>{let e=yt(),[t,n]=(0,$.useState)(!1),r=St()?.state?.email,i=Dn(),o=Ti(),onResendLink=async()=>{if(r){n(!0);try{await o.resendActivationMail({email:r}),Y.notify({isSuccess:!0,message:R._({id:`registerScreen.confirmEmail.resendSuccess`})})}catch(e){dd(e)||Y.notify({isError:!0,message:R._({id:`registerScreen.confirmEmail.resendFailure`})}),console.error(e)}finally{n(!1)}}};return(0,$.useEffect)(()=>{r||e(`../login`)},[r,e]),(0,X.jsxs)(I,{display:`flex`,flexDirection:`column`,alignItems:`center`,children:[(0,X.jsx)(L,{variant:`h2`,marginBottom:i.spacing(4),children:(0,X.jsx)(N,{id:`registerScreen.confirmEmail.formTitle`})}),(0,X.jsx)(aa,{name:`message-alt-primary`,size:12.25}),(0,X.jsx)(L,{marginTop:i.spacing(1),marginBottom:i.spacing(2),variant:`body2`,fontWeight:600,children:(0,X.jsx)(N,{id:`registerScreen.confirmEmail.subTitle`})}),(0,X.jsx)(L,{marginBottom:i.spacing(1),textAlign:`center`,children:(0,X.jsx)(N,{id:`registerScreen.confirmEmail.desc1`})}),(0,X.jsx)(L,{textAlign:`center`,children:(0,X.jsx)(N,{id:`registerScreen.confirmEmail.desc2`})}),(0,X.jsx)(I,{marginTop:i.spacing(3),marginBottom:i.spacing(3),children:(0,X.jsx)(Tp,{severity:`warning`,children:(0,X.jsx)(N,{id:`registerScreen.confirmEmail.warning`})})}),(0,X.jsxs)(I,{display:`flex`,alignItems:`center`,children:[(0,X.jsx)(L,{children:(0,X.jsx)(N,{id:`registerScreen.confirmEmail.resendLinkQuestion`})}),(0,X.jsx)(GE,{size:`sm`,variant:`plain`,onClick:onResendLink,loading:t,children:(0,X.jsx)(N,{id:`registerScreen.confirmEmail.resendLinkButton`})})]}),(0,X.jsxs)(I,{display:`flex`,alignItems:`center`,gap:.5,children:[(0,X.jsx)(L,{children:(0,X.jsx)(N,{id:`registerScreen.confirmEmail.goToLogInPreamble`})}),(0,X.jsx)(Wt,{to:`./login`,children:(0,X.jsx)(N,{id:`registerScreen.confirmEmail.goToLoginLink`})})]})]})};V();var KE=P(`div`)(({theme:e})=>z`
662    display: flex;
663    flex-direction: column;
664    flex-grow: 1;
665    max-width: 512px;
666    background-color: ${e.palette.dsColors.darkGray[200]};
667    border: 1px solid ${e.palette.dsColors.darkGray[60]};
668    border-radius: calc(${e.shape.borderRadius}px * 2);
669    padding: ${e.spacing(7)};
670    gap: ${e.spacing(4)};
671    z-index: 2;
672
673    @media (max-width: 540px) {
674      margin: ${e.spacing(0,2)};
675      padding: ${e.spacing(5,2)};
676    }
677  `),qE=e(({action:e,onClose:t})=>(0,X.jsxs)(KE,{children:[e===`login`&&(0,X.jsx)(YT,{onClose:t}),e===`signUp`&&(0,X.jsx)(SignUpForm,{}),e===`coinbaseSignUp`&&(0,X.jsx)(SignUpForm,{isCoinbaseSignUp:!0}),e===`loginByApi`&&(0,X.jsx)(ApiLoginForm,{}),e===`forgotPassword`&&(0,X.jsx)(ForgotPasswordForm,{}),e===`setupTFA`&&(0,X.jsx)(ContextAwareSecurityKeySetupForm,{}),e===`emailConfirmation`&&(0,X.jsx)(EmailConfirmation,{}),e===`setupPassword`&&(0,X.jsx)(SetupPassword,{}),e===`resendActivationLink`&&(0,X.jsx)(ResendActivationLinkForm,{})]}),`LoginFactory`),JE=e(()=>{let[e,t]=(0,$.useState)(!1),{lang:n}=Ep(),r=pf.find(({code:e})=>e===n);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(H,{size:`sm`,variant:`tinted`,onClick:()=>t(!0),startIcon:(0,X.jsx)(Ir,{name:`language`}),children:r?.nativeName??`English`}),(0,X.jsx)(Yd,{open:e,onClose:()=>t(!1)})]})},`LanguageSelect`);V();var YE=P(Tp)(({theme:e})=>z`
678    border-radius: 0;
679    background-color: ${e.getColor({default:`lightGray.0`})};
680    color: ${e.getColor({default:`darkGray.200`})};
681    font-weight: 500;
682  `),CoinbaseOnboardingNotice=()=>(0,X.jsx)(YE,{severity:`warning`,children:(0,X.jsxs)(I,{display:`flex`,flexDirection:`column`,rowGap:1,children:[(0,X.jsx)(L,{variant:`inherit`,children:(0,X.jsx)(N,{id:`registerScreen.coinbaseSignUp.notice.onboarding`})}),(0,X.jsx)(L,{variant:`inherit`,children:(0,X.jsx)(N,{id:`registerScreen.coinbaseSignUp.notice.ownership`})}),(0,X.jsx)(L,{variant:`inherit`,children:(0,X.jsx)(N,{id:`registerScreen.coinbaseSignUp.notice.regulatory`})})]})}),XE=`/assets/background-CuVKxNR2.svg`,ZE=`/assets/background-logo-CMI4pURJ.svg`;V();var QE=P(`div`)(({theme:e})=>z`
683    display: flex;
684    flex-direction: column;
685    background:
686      url(${XE}),
687      url(${ZE}) left bottom no-repeat,
688      center no-repeat;
689    background-size: cover, 55%;
690    width: 100vw;
691    min-height: 100vh;
692    overflow: auto;
693    background-color: ${e.palette.dsColors.darkGray[80]};
694    color: white;
695
696    @media (max-width: 950px) {
697      background-size: cover, 100%;
698    }
699
700    @media (max-width: 450px) {
701      padding-top: ${e.spacing(3)};
702    }
703  `),$E=P(`div`)(({theme:e})=>z`
704    display: flex;
705    justify-content: space-between;
706    align-items: center;
707    padding: ${e.spacing(4,5)};
708
709    @media (max-width: 450px) {
710      padding: ${e.spacing(0,2)};
711    }
712  `),eD=P(`div`)(({theme:e})=>z`
713    display: grid;
714    grid-template-columns: 1fr 1fr;
715    align-items: center;
716    justify-content: center;
717
718    @media (max-width: 950px) {
719      grid-template-columns: 1fr;
720      margin-top: ${e.spacing(2)};
721    }
722  `),tD=P(`div`)(({theme:e})=>z`
723    display: flex;
724    flex-direction: column;
725    align-items: center;
726    height: 100%;
727    z-index: 2;
728    padding: ${e.spacing(25,2,0,2)};
729
730    @media (max-width: 950px) {
731      display: none;
732    }
733  `),nD=P(`div`)(({theme:e})=>z`
734    display: flex;
735    justify-content: center;
736    align-items: center;
737    height: 100%;
738    padding-right: ${e.spacing(1)};
739  `),rD=P(`div`)(({theme:e})=>z`
740    display: flex;
741    flex-direction: column;
742    max-width: 530px;
743    gap: ${e.spacing(3.125)};
744    text-wrap: pretty;
745  `),iD=P(`footer`)(({theme:e})=>z`
746    display: flex;
747    justify-content: space-between;
748    padding: ${e.spacing(3,5)};
749    margin-top: auto;
750  `),aD=P(`a`)(({theme:e})=>z`
751    display: flex;
752    align-items: center;
753    justify-content: space-between;
754    gap: ${e.spacing(1)};
755    font-size: ${e.typography.body1.fontSize};
756    line-height: ${e.typography.body1.lineHeight};
757
758    svg {
759      font-size: 16px;
760      position: relative;
761      top: 1px;
762    }
763  `),oD=P(Pi)(({theme:e})=>z`
764    padding: 0 ${e.spacing(.75)};
765    border-radius: 4px;
766
767    svg {
768      width: 20px;
769      height: 20px;
770      color: ${e.palette.dsColors.lightGray[100]};
771    }
772  `),sD=P(`div`)`
773  cursor: pointer;
774`,cD=mi(({action:e,onClose:t})=>{let n=yt(),r=B(Ln),{analyticsService:i}=Ru(),o=B(ia),[s,c]=(0,$.useState)(o===`GB`),p=e===`setupTFA`||e===`setupPassword`;return(0,$.useEffect)(()=>{!p&&r&&(t?t():n(si.dashboard,{replace:!0}))},[p,r,n,t]),(0,X.jsxs)(QE,{children:[e===`coinbaseSignUp`&&(0,X.jsx)(CoinbaseOnboardingNotice,{}),s&&(0,X.jsx)(YE,{severity:`warning`,onClose:()=>c(!1),children:`Please note that you are entering the website of Deribit, which is operated by Deribit FZE in the UAE, and DRB Panama Inc. in Panama. Deribit FZE has an Exchange Services license from the Virtual Assets Regulatory Authority (VARA) in Dubai. Deribit is not authorised in the UK to provide investment services. By using this website, you agree to waive the protection afforded under FCA rules and acknowledge that you wish to continue to open/use an account with us at your own initiative. UK retail clients cannot open an account.`}),(0,X.jsxs)($E,{children:[(0,X.jsx)(sD,{onClick:()=>n(`/`),children:(0,X.jsx)(sn,{forceDarkTheme:!0,width:128})}),(0,X.jsxs)(I,{display:`flex`,gap:5,children:[(0,X.jsx)(JE,{}),e!==`setupTFA`&&(0,X.jsx)(oD,{"aria-label":R._({id:`commonScreen.common.close`}),onClick:()=>{t?t():n(ht(si.futures,{instrument:`BTC-PERPETUAL`})),i.trackEvent(`auth_close_login_page`,{page:e})},children:(0,X.jsx)(Ir,{name:`close`})})]})]}),(0,X.jsxs)(eD,{children:[(0,X.jsxs)(tD,{children:[[`login`,`signUp`,`signUpStep2`,`coinbaseSignUp`].includes(e)&&o===`GB`&&(0,X.jsx)(rD,{children:(0,X.jsx)(L,{variant:`h1`,textAlign:`center`,children:(0,X.jsx)(N,{id:`login.promoTitle.gb`})})}),[`signUp`,`signUpStep2`,`coinbaseSignUp`].includes(e)&&o!==`GB`&&(0,X.jsxs)(rD,{children:[(0,X.jsx)(L,{variant:`h1`,textAlign:`center`,children:(0,X.jsx)(N,{id:`login.promoTitle`})}),(0,X.jsx)(L,{variant:`body2`,textAlign:`center`,children:(0,X.jsx)(N,{id:`login.promoDescription`})})]})]}),(0,X.jsx)(nD,{children:(0,X.jsx)(qE,{action:e,onClose:t})})]}),(0,X.jsxs)(iD,{children:[(0,X.jsxs)(L,{children:[`© Deribit `,(0,BS.default)().year()]}),(0,X.jsxs)(aD,{href:`mailto:[email protected]`,onClick:()=>{i.trackEvent(`auth_login_support_link_click`)},children:[(0,X.jsx)(Ir,{name:`mail`,fontSize:`inherit`}),(0,X.jsx)(L,{children:`[email protected]`})]})]})]})}),lD=e(e=>(0,X.jsx)(ir,{forceTheme:`dark`,children:(0,X.jsx)(cD,{...e})}),`LoginScreenWithTheme`),getLoginValidationSchema=()=>Rp().shape({email:Fp().email(R._({id:`loginScreen.loginForm.error.invalidEmail`})).required(R._({id:`loginScreen.loginForm.error.required`})),password:Fp().required(R._({id:`loginScreen.loginForm.error.required`}))}),useLoginForm=e=>{let t=Pn(),{loginProxy:n}=qu(),[r,i]=lf(`loginformemail`,``),o=qs({initialValues:{email:r,password:``},validationSchema:getLoginValidationSchema(),onSubmit:async r=>{let o;r.email&&(o=await n({email:r.email,password:r.password})),o?.success?(t(nd.setShowWelcomeMessage(!0)),t(nd.setShowSecurityMessage(!0)),t(nd.setShowVerificationMessage(!0)),r.email&&i(r.email),e?.onClose&&e.onClose()):Y.notify({isError:!0,message:o?.errorMessage})}});return{onSubmit:o.submitForm,formik:o}};V();var uD=P(`div`)(({theme:e})=>z`
775    display: flex;
776    flex-direction: column;
777    gap: ${e.spacing(1)};
778  `),dD=P(Pi)(({theme:e})=>z`
779    border-radius: 4px;
780    align-self: start;
781    transform: rotate(-90deg);
782    left: -${e.spacing(3)};
783    top: -${e.spacing(3)};
784    margin-bottom: -${e.spacing(3)};
785
786    @media (max-width: 540px) {
787      left: 0;
788    }
789  `),getActionTranslation=e=>{switch(e){case`login`:return R._({id:`loginForm.action.login`});case`setPassword`:return R._({id:`loginForm.action.setPassword`})}},LoginFormTitle=({actionName:e,onArrowClick:t})=>(0,X.jsxs)(uD,{children:[t&&(0,X.jsx)(dD,{onClick:()=>{t()},children:(0,X.jsx)(Ir,{name:`arrowUp`})}),(0,X.jsx)(L,{variant:`h2`,textAlign:`center`,children:getActionTranslation(e)})]});V();var fD=P(`form`)(({theme:e})=>z`
790    display: flex;
791    flex-direction: column;
792    gap: ${e.spacing(2)};
793  `),pD=P(`div`)(({theme:e})=>z`
794    display: flex;
795    flex-direction: column;
796    gap: ${e.spacing(2)};
797  `),mD=P(`div`)(({theme:e})=>z`
798    display: flex;
799    justify-content: center;
800    gap: ${e.spacing(.5)};
801  `),hD=P(Kr)(({theme:e})=>z`
802    margin-top: ${e.spacing(2)};
803  `),LoginForm=({onClose:e})=>{let{formik:t,onSubmit:n}=useLoginForm({onClose:e}),{platformConfig:r}=Oi(),i=r.isRouteEnabled(`register`),o=ut(),handleSubmit=e=>{e.preventDefault(),n()};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(LoginFormTitle,{actionName:`login`}),(0,X.jsxs)(fD,{onSubmit:handleSubmit,children:[(0,X.jsx)(Mi,{label:R._({id:`loginForm.email`}
803),"data-id":`email`,inputMode:`email`,name:`email`,autoFocus:!0,autoComplete:`email`,value:t.values.email,onChange:t.handleChange,hint:t.touched.email?t.errors.email:void 0,error:!!(t.touched.email&&t.errors.email),inputProps:{id:`email`}}),(0,X.jsx)(Mi,{type:`password`,label:R._({id:`loginForm.password`}),"data-id":`password`,autoComplete:`current-password`,name:`password`,value:t.values.password,onChange:t.handleChange,hint:t.touched.password?t.errors.password:void 0,error:!!(t.touched.password&&t.errors.password),inputProps:{id:`password`}}),(0,X.jsx)(hD,{type:`submit`,children:(0,X.jsx)(N,{id:`loginForm.continue`})})]}),i&&(0,X.jsx)(pD,{children:(0,X.jsxs)(mD,{children:[(0,X.jsx)(L,{children:(0,X.jsx)(N,{id:`loginForm.dontHaveAccount`})}),(0,X.jsx)(Wt,{isRouter:!o.isExternal,variant:`subtitle1`,to:o.url,onClick:e,children:(0,X.jsx)(N,{id:`loginForm.register`})})]})})]})};V();var gD=ld(L,ai([`isValid`]))(({theme:e,isValid:t})=>z`
804    color: ${t?e.palette.dsColors.success[200]:e.palette.dsColors.error[200]};
805  `),ValidationItem=({isValid:e,text:t})=>(0,X.jsxs)(gD,{isValid:e,variant:`body3`,children:[e?`✓`:`✗`,` `,t]}),PasswordValidation=({password:e})=>{let t=new RegExp(/\W/).test(e),n=new RegExp(/[A-Z]/).test(e),r=new RegExp(/[0-9]/).test(e),i=new RegExp(/^.{12,}$/).test(e);return(0,X.jsxs)(I,{display:`flex`,gap:2,children:[(0,X.jsx)(ValidationItem,{isValid:i,text:R._({id:`loginForm.password.characters`})}),(0,X.jsx)(ValidationItem,{isValid:r,text:R._({id:`loginForm.password.digit`})}),(0,X.jsx)(ValidationItem,{isValid:n,text:R._({id:`loginForm.password.uppercaseLetter`})}),(0,X.jsx)(ValidationItem,{isValid:t,text:R._({id:`loginForm.password.symbol`})})]})},getSetPasswordValidationSchema=()=>Rp().shape({password:Fp().required(R._({id:`registerScreen.registerForm.passwordIsRequired`})).matches(cf),confirmedPassword:Fp().required(R._({id:`registerScreen.registerForm.confirmPasswordIsRequired`})).oneOf([Ip(`password`)],R._({id:`commonScreen.common.passwordsDoNotMatch`}))}),useSetPasswordForm=(e=``)=>{let{deribitClient:t}=Oi(),n=yt(),{isPasswordCompromised:r,checkIfPasswordCompromised:i}=rf();(0,$.useEffect)(()=>{e||n(`../login`,{replace:!0})},[e,n]);let o=(0,$.useCallback)(async e=>{let n=`${t.forceInsecureProtocols?`http://`:`https://`}${t.apiHost}/api/onboard`,r=await fetch(n,{method:`POST`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}});if(!r.ok)throw Error(`Failed to set password`);return r.json()},[t]),s=qs({initialValues:{password:``,confirmedPassword:``},validationSchema:getSetPasswordValidationSchema(),async onSubmit(t){if(r){s.setSubmitting(!1);return}try{let r=await o({token:e,password:t.password}),i=`result`in r,c=`error`in r;Y.notify({isSuccess:i,isError:c,message:`result`in r?r.result:r.error.message}),i?(s.setSubmitting(!1),n(`../login`)):s.setSubmitting(!1)}catch(e){s.setSubmitting(!1),console.error(e),Y.notify({isError:!0,message:R._({id:`loginForm.error.setPassword`})})}}});return{formik:s,checkIfPasswordCompromised:i,isPasswordCompromised:r}},_D=ld(Pi)`
806  height: 20px;
807  width: 24px;
808  border-radius: 4px;
809
810  svg {
811    width: 20px;
812    height: 20px;
813  }
814`,vD=(0,$.memo)(({allowRevealPassword:e,...t})=>{let n=(0,$.useRef)(null),[r,i]=(0,$.useState)(!1),onClick=()=>{i(e=>!e),n.current?.focus()};return(0,X.jsx)(Mi,{inputRef:n,type:r?`text`:`password`,endAdornment:e?(0,X.jsx)(Ui,{title:r?R._({id:`loginForm.hidePassword`}):R._({id:`loginForm.showPassword`}),children:(0,X.jsx)(_D,{onClick,children:(0,X.jsx)(Ir,{name:r?`crossedEye`:`eye`})})}):void 0,...t})});V();var yD=P(`form`)(({theme:e})=>z`
815    display: flex;
816    flex-direction: column;
817    gap: ${e.spacing(2)};
818  `),bD=P(Kr)(({theme:e})=>z`
819    margin-top: ${e.spacing(2)};
820  `),SetPasswordForm=()=>{let{state:e}=St(),t=decodeURIComponent(e?.email??``),{formik:n,checkIfPasswordCompromised:r,isPasswordCompromised:i}=useSetPasswordForm(e?.code),handleContinue=()=>{n.submitForm()};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(LoginFormTitle,{actionName:`setPassword`}),(0,X.jsxs)(yD,{onSubmit:e=>{e.preventDefault(),handleContinue()},children:[(0,X.jsx)(Mi,{label:R._({id:`loginForm.email`}),"data-id":`email`,inputMode:`email`,value:t,inputProps:{id:`email`},disabled:!0}),(0,X.jsx)(vD,{allowRevealPassword:!0,"data-id":`password`,name:`password`,autoComplete:`new-password`,label:R._({id:`loginForm.password`}),value:n.values.password,onChange:e=>{n.handleChange(e),r(e.target.value)},hint:(()=>
820{if(i)return R._({id:`commonScreen.common.passwordCompromised`});if(n.values.password)return(0,X.jsx)(PasswordValidation,{password:n.values.password})})(),error:i,inputProps:{id:`password`}}),(0,X.jsx)(vD,{allowRevealPassword:!0,label:R._({id:`loginForm.confirmPassword`}),"data-id":`confirmedPassword`,name:`confirmedPassword`,autoComplete:`new-password`,value:n.values.confirmedPassword,onChange:n.handleChange,hint:n.touched.confirmedPassword?n.errors.confirmedPassword:void 0,error:!!(n.touched.confirmedPassword&&n.errors.confirmedPassword),inputProps:{id:`confirmedPassword`}}),(0,X.jsx)(bD,{type:`submit`,children:(0,X.jsx)(N,{id:`loginForm.continue`})})]})]})};V();var xD=P(`div`)(({theme:e})=>z`
821    display: flex;
822    flex-direction: column;
823    flex-grow: 1;
824    max-width: 512px;
825    background-color: ${e.palette.dsColors.darkGray[200]};
826    border: 1px solid ${e.palette.dsColors.darkGray[60]};
827    border-radius: calc(${e.shape.borderRadius}px * 2);
828    padding: ${e.spacing(7)};
829    gap: ${e.spacing(4)};
830    z-index: 2;
831
832    @media (max-width: 540px) {
833      margin: ${e.spacing(0,2)};
834      padding: ${e.spacing(5,2)};
835    }
836  `),LoginFactory=({action:e,onClose:t})=>(0,X.jsxs)(xD,{children:[e===`login`&&(0,X.jsx)(LoginForm,{onClose:t}),e===`setPassword`&&(0,X.jsx)(SetPasswordForm,{})]}),LanguageSelect=()=>{let[e,t]=(0,$.useState)(!1),{lang:n}=Ep(),r=pf.find(({code:e})=>e===n);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Kr,{size:`sm`,variant:`tinted`,onClick:()=>t(!0),startIcon:(0,X.jsx)(Ir,{name:`language`}),children:r?.nativeName??`English`}),(0,X.jsx)(Yd,{open:e,onClose:()=>t(!1)})]})},SD=`/assets/background-CuVKxNR2.svg`;V();var CD=P(`div`)(({theme:e})=>z`
837    position: relative;
838    display: flex;
839    flex-direction: column;
840    background: url(${SD}) left bottom no-repeat;
841    background-size: cover, 55%;
842    width: 100vw;
843    min-height: 100vh;
844    overflow: auto;
845    background-color: ${e.palette.dsColors.darkGray[80]};
846    color: white;
847
848    @media (max-width: 950px) {
849      background-size: cover, 100%;
850    }
851
852    @media (max-width: 450px) {
853      padding-top: ${e.spacing(3)};
854    }
855  `),wD=P(`div`)(({theme:e})=>z`
856    position: absolute;
857    top: 0;
858    left: 0;
859    right: 0;
860    display: flex;
861    justify-content: space-between;
862    align-items: center;
863    padding: ${e.spacing(4,5)};
864
865    @media (max-width: 450px) {
866      padding: ${e.spacing(0,2)};
867    }
868  `),TD=P(`div`)(({theme:e})=>z`
869    display: flex;
870    justify-content: center;
871    align-items: center;
872    flex: 1;
873    padding-right: ${e.spacing(1)};
874  `),ED=P(Pi)(({theme:e})=>z`
875    padding: 0 ${e.spacing(.75)};
876    border-radius: 4px;
877
878    svg {
879      width: 20px;
880      height: 20px;
881      color: ${e.palette.dsColors.lightGray[100]};
882    }
883  `),DD=P(`div`)`
884  cursor: pointer;
885`,OD=mi(({action:e,onClose:t})=>{let n=yt(),r=B(Ln),{platformConfig:i}=Oi(),{mainPath:o}=i;return(0,$.useEffect)(()=>{r&&(t?t():n(si.dashboard,{replace:!0}))},[r,n,t]),(0,X.jsxs)(CD,{children:[(0,X.jsxs)(wD,{children:[(0,X.jsx)(DD,{onClick:()=>n(`/`),children:(0,X.jsx)(sn,{forceDarkTheme:!0,width:128})}),(0,X.jsxs)(I,{display:`flex`,gap:5,children:[(0,X.jsx)(LanguageSelect,{}),(0,X.jsx)(ED,{onClick:()=>t?t():n(o),children:(0,X.jsx)(Ir,{name:`close`})})]})]}),(0,X.jsx)(TD,{children:(0,X.jsx)(LoginFactory,{action:e,onClose:t})})]})}),LoginScreenWithTheme=e=>(0,X.jsx)(ir,{forceTheme:`dark`,children:(0,X.jsx)(OD,{...e})}),getOrderTypeDisplayName=(e,t)=>t?vf()[t]?.displayName:Cf()[e]?.displayName;function useOrderConfirmationTheme(){let e=Dn();return e.palette.mode===`dark`?{modal:{backgroundColor:e.palette.dsColors.darkGray[40]},backgroundColor:e.palette.dsColors.darkGray[100],dividerColor:e.palette.dsColors.darkGray[10],infoTable:{oddBackgroundColor:e.palette.dsColors.darkGray[80],labelColor:e.palette.dsColors.lightGray[80],valueColor:e.palette.dsColors.lightGray[0],direction:{buy:e.palette.dsColors.success[200],sell:e.palette.dsColors.error[200]}},tag:{borderColor:e.palette.dsColors.secondary[80]}}:{modal:{backgroundColor:e.palette.dsColors.lightGray[0]},backgroundColor:e.palette.dsColors.lightGray[20],dividerColor:e.palette.dsColors.lightGray[100],infoTable:{oddBackgroun
885dColor:e.palette.dsColors.lightGray[40],labelColor:e.palette.dsColors.darkGray[60],valueColor:e.palette.dsColors.darkGray[200],direction:{buy:e.palette.dsColors.success[200],sell:e.palette.dsColors.error[200]}},tag:{borderColor:e.palette.dsColors.secondary[100]}}}V();var kD=P(`div`)(({theme:e})=>z`
886    display: flex;
887    gap: ${e.spacing(.5)};
888  `),TagGroup=({orderSpec:e})=>{let t=rr(),{tag:n}=useOrderConfirmationTheme();return(0,X.jsxs)(kD,{children:[e.display_amount&&(0,X.jsx)(An,{borderColor:n.borderColor,color:`inherit`,backgroundColor:`transparent`,label:R._({id:`commonScreen.common.iceberg`}),hasBorder:!0}),e.post_only&&(0,X.jsx)(An,{borderColor:n.borderColor,color:`inherit`,backgroundColor:`transparent`,label:R._({id:`commonScreen.common.post`}),hasBorder:!0}),e.reduce_only&&(0,X.jsx)(An,{borderColor:n.borderColor,color:`inherit`,backgroundColor:`transparent`,label:R._({id:`commonScreen.common.reduce`}),hasBorder:!0}),(0,X.jsx)(An,{"data-id":`direction`,color:t.palette.mode===`dark`?`inherit`:t.palette.dsColors.lightGray[0],backgroundColor:e.direction===`buy`?t.palette.dsColors.success[200]:t.palette.dsColors.error[200],label:_u(e.direction)})]})};V();var AD=P(`div`)(({theme:e})=>z`
889    font-weight: 600;
890    font-size: ${e.typography.body3.fontSize};
891  `),jD=P(Ir)`
892  grid-row: 1 / span 2;
893  width: 24px;
894`,MD=P(`div`)(({theme:e})=>z`
895    padding: ${e.spacing(2)};
896    display: inline-grid;
897    grid-template-columns: min-content 1fr min-content;
898    grid-gap: 0 ${e.spacing(1.5)};
899    align-items: center;
900    white-space: nowrap;
901  `),OrderTitle=({orderSpec:e})=>{let{base_currency:t=``}=Ki.splitInstrument(e.instrument_name)??{};return(0,X.jsxs)(MD,{children:[(0,X.jsx)(jD,{currency:t.toLowerCase()}),(0,X.jsx)(AD,{"data-id":`intrument_name`,children:Ri(e.instrument_name)}),(0,X.jsx)(TagGroup,{orderSpec:e})]})};V();var ND=P(`div`)(({theme:e})=>{let t=useOrderConfirmationTheme();return z`
902    display: flex;
903    justify-content: space-between;
904    padding: ${e.spacing(.5,2)};
905    font-size: ${e.typography.caption.fontSize};
906
907    & > span:nth-of-type(1) {
908      color: ${t.infoTable.labelColor};
909    }
910  `}),PD=P(`span`,ai([`direction`]))(({direction:e})=>{let t=useOrderConfirmationTheme();return z`
911    font-weight: 600;
912    color: ${e?t.infoTable.direction[e]:t.infoTable.valueColor};
913  `}),InfoRow=({label:e,value:t,id:n})=>(0,X.jsxs)(ND,{children:[(0,X.jsx)(`span`,{"data-id":n,children:e}),(0,X.jsx)(PD,{"data-id":`${n}_value`,children:t})]}),getUnit=(e,t)=>e.advanced===`usd`?` USD`:e.advanced===`implv`?`% IV`:` ${t}`,getYesOrNoTextFromBoolean=e=>e?R._({id:`tradeScreen.orderForm.confirmation.yes`}):R._({id:`tradeScreen.orderForm.confirmation.no`});V();var FD=P(`span`,ai([`direction`]))(({theme:e,direction:t})=>z`
914    text-align: right;
915    color: ${t===`buy`?e.palette.dsColors.success[200]:e.palette.dsColors.error[200]};
916  `),ComboLegs=({orderSpec:e})=>{let t=Bt(e.instrument_name)??[];return(0,X.jsx)(X.Fragment,{children:t.map((t,n)=>(0,X.jsx)(InfoRow,{label:R._({id:`commonScreen.common.leg`,values:{0:n+1}}),value:(0,X.jsx)(FD,{"data-id":`leg_${n+1}`,direction:e.direction===`buy`&&t.amount<0||e.direction===`sell`&&t.amount>0?`sell`:`buy`,children:t.instrument_name})},t.instrument_name))})};V();var ID=P(`div`)(({theme:e})=>{let t=useOrderConfirmationTheme();return z`
917    background-color: ${t.backgroundColor};
918    display: flex;
919    flex-grow: 1;
920    flex-basis: 0;
921    flex-direction: column;
922    border-radius: ${e.shape.borderRadius}px;
923  `});V();var LD=P(`div`)(({theme:e})=>{let t=useOrderConfirmationTheme();return z`
924    display: flex;
925    justify-content: space-between;
926    border-top: 1px solid ${t.dividerColor};
927    padding: ${e.spacing(1,0)};
928    @media (max-width: 600px) {
929      flex-direction: column;
930    }
931  `}),RD=P(`div`)(({theme:e})=>{let t=useOrderConfirmationTheme();return z`
932    width: 100%;
933
934    & > div:nth-of-type(odd) {
935      background-color: ${t.infoTable.oddBackgroundColor};
936    }
937
938    @media (min-width: 600px) {
939      &:first-of-type:not(:last-of-type) > div {
940        padding-right: ${e.spacing(4.5)};
941      }
942
943      &:last-of-type:not(:first-of-type) > div {
944        padding-left: ${e.spacing(4.5)};
945      }
946    }
947  `});function isTrailingOrder(e){let t=typeof e==`string`?e:e.order_type;return t===`trailing_stop`||t===`trailing_take`}function formatOrderTrigger(e){switch(e){case`mark_price`:return`Mark Price`;case`index_price`:return`Index Price`;case`last_price`:return`Last Price`;default:return`-`}}
947function triggerFormatter(e){let{value:t}=e;return t==null?`-`:formatOrderTrigger(t)}var zD={good_til_cancelled:`GTC`,fill_or_kill:`FOK`,immediate_or_cancel:`IOC`,good_til_day:`GTD`},PrimaryOrderSection=({orderSpec:e})=>{let{featureToggles:{isTakeProfitStopLossEnabled:t}}=Oi(),{quote_currency:n=``,isSpot:r,isOptionCombo:i,isFuture:o,isFutureCombo:s}=Ki.splitInstrument(e.instrument_name)??{},c=e.type?Sf(e.type):!1,p=S(e.instrument_name),m=c?p?.mark_price??null:e.price??null,h=Pf({instrument:e.instrument_name,orderAmount:e.amount,orderPrice:m}),{sizeDecimals:g,priceDecimals:_}=ui(e.instrument_name),v=(0,$.useMemo)(()=>{let{amount:t,contracts:n,instrument_name:r}=e;return fd({instrument:r})?ki(n||0,En(n||0)):ki(t||0,g)},[e,g]),y=(0,$.useMemo)(()=>{let{amount:t,instrument_name:n}=e,{base_currency:r,isOption:i}=Ki.getInstrumentData(n)||{};if(!i||!r)return;let{sizeDecimals:o}=ui(n);return`${ki(t||0,o)} ${r}`},[e]),getFormattedPrice=(t,r=!1)=>`${e.advanced?t?.toFixed(2):sa(t,_)} ${r?getUnit(e,n):n}`,b=c?R._({id:`commonScreen.common.marketPrice`}):getFormattedPrice(e.price,!0),x=e.linked_order_type===`one_triggers_other`||e.linked_order_type===`one_triggers_one_cancels_other`,C=e.linked_order_type===`one_cancels_other`||e.linked_order_type===`one_triggers_one_cancels_other`,w=h?.[`${e.direction}_maker_fee`],T=h?.[`${e.direction}_taker_fee`];return(0,X.jsxs)(ID,{children:[(0,X.jsx)(OrderTitle,{orderSpec:e}),(0,X.jsxs)(LD,{children:[(0,X.jsxs)(RD,{children:[(0,X.jsx)(InfoRow,{id:`order_type`,label:R._({id:`tradeScreen.orderForm.confirmation.orderType`}),value:getOrderTypeDisplayName(e.type,e.advanced)}),(0,X.jsx)(InfoRow,{id:`amount`,label:R._({id:`tradeScreen.orderForm.confirmation.amount`}),value:v}),e?.display_amount&&(0,X.jsx)(InfoRow,{id:`displayAmount`,label:R._({id:`tradeScreen.orderForm.confirmation.displayAmount`}),value:ki(e.display_amount,g)}),y&&(0,X.jsx)(InfoRow,{id:`baseAmount`,label:R._({id:`commonScreen.common.baseAmount`}),value:y}),e.type&&!isTrailingOrder(e.type)&&(0,X.jsx)(InfoRow,{label:R._({id:`tradeScreen.orderForm.confirmation.price`}),value:b}),e.type&&Gr(e.type)&&(0,X.jsxs)(X.Fragment,{children:[e.type&&isTrailingOrder(e.type)?(0,X.jsx)(InfoRow,{id:`trigger_offset`,label:R._({id:`tradeScreen.orderForm.confirmation.triggerOffset`}),value:getFormattedPrice(e.trigger_offset)}):(0,X.jsx)(InfoRow,{label:R._({id:`tradeScreen.orderForm.confirmation.triggerPrice`}),value:getFormattedPrice(e.trigger_price)}),(0,X.jsx)(InfoRow,{label:R._({id:`tradeScreen.orderForm.confirmation.trigger`}),value:e.trigger?formatOrderTrigger(e.trigger):`-`})]}),(i||s)&&(0,X.jsx)(InfoRow,{label:R._({id:`tradeScreen.orderForm.confirmation.TIF`}),value:e.time_in_force?zD[e.time_in_force]:`-`}),w===T?(0,X.jsx)(InfoRow,{id:`fee`,label:R._({id:`tradeScreen.orderForm.confirmation.fee`}),value:Of(w)}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(InfoRow,{id:`fee_taker`,label:R._({id:`tradeScreen.orderForm.confirmation.feeTaker`}),value:Of(T)}),(0,X.jsx)(InfoRow,{id:`fee_maker`,label:R._({id:`tradeScreen.orderForm.confirmation.feeMaker`}),value:Of(w)})]})]}),(0,X.jsxs)(RD,{children:[!(i||s)&&(0,X.jsx)(InfoRow,{label:R._({id:`tradeScreen.orderForm.confirmation.TIF`}),value:e.time_in_force?zD[e.time_in_force]:`-`}),t&&(r||o)&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(InfoRow,{label:R._({id:`tradeScreen.orderForm.confirmation.oto`}),value:getYesOrNoTextFromBoolean(x)}),(0,X.jsx)(InfoRow,{label:R._({id:`tradeScreen.orderForm.confirmation.OCO`}),value:getYesOrNoTextFromBoolean(C)})]}),(i||s)&&(0,X.jsx)(ComboLegs,{orderSpec:e})]})]})]})};V();var BD=P(`div`)(({theme:e})=>z`
948    display: flex;
949    justify-content: flex-end;
950    gap: ${e.spacing(1)};
951  `),VD=P(`div`)(z`
952  display: flex;
953  justify-content: space-between;
954`),OrderActions=({onConfirm:e,onCancel:t})=>{let{interfaceSettings:n,setInterfaceSettings:r}=td(),i=n.disableMakeOrderConfirmation;return(0,X.jsxs)(VD,{children:[(0,X.jsx)(wp,{size:`small`,label:R._({id:`tradeScreen.confirmation.dontShowMeAgain`}),control:(0,X.jsx)(mp,{size:`small`,"data-id":`dontShowAgainCheckbox`,checked:i,onChange:()=>{r(e=>({...e,disableMakeOrderConfirmation:!e.disableMakeOrderConfirmation}))},color:`primary`})}),(0,X.jsxs)(BD,{children:[(0,X.jsx)(H,{variant:`gray`,onClick:t,"data-id":`cancelButton`,children:(0,X.jsx)(N,{id:`commonScreen.common.cancel`})}),(0,X.jsx)(H,{variant:`filled`,onClick:e,"data-id":`createOrderButton`,children:(0,X.jsx)(N,{id:`tradeScreen.orderForm.confirmation.createOrder`})})]})]})};V();var HD=P(`span`,ai([`flow`]))(({theme:e,flow:t})=>{let n=t===`debit`?e.palette.dsColors.error[200]:e.palette.dsColors.success[200];return z`
955    display: flex;
956    align-items: center;
957    margin-left: ${e.spacing(.5)};
958    padding: ${e.spacing(.25,.5)};
959    font-size: ${e.typography.helperText.fontSize};
960    line-height: ${e.typography.helperText.lineHeight};
961    border: 1px solid ${n};
962    border-radius: 10px;
963  `}),PriceDescription=({orderSpec:e})=>{let t=e?.price||0,n=e.direction===`buy`&&t>0||e.direction===`sell`&&t<0;return(0,X.jsx)(HD,{flow:n?`debit`:`credit`,"data-id":`totalPrice_flowDirection`,children:n?(0,X.jsx)(N,{id:`commonScreen.common.debit`}):(0,X.jsx)(N,{id:`commonScreen.common.credit`})})}
963,UD=P(`div`)(({theme:e})=>{let t=useOrderConfirmationTheme();return z`
964    display: flex;
965    justify-content: flex-end;
966    font-size: ${e.typography.subtitle1.fontSize};
967    font-weight: 600;
968
969    & > span:nth-of-type(1) {
970      color: ${t.infoTable.labelColor};
971      margin-right: ${e.spacing(1)};
972    }
973  `}),WD=P(`span`)(({theme:e})=>{let t=useOrderConfirmationTheme();return z`
974    margin-right: ${e.spacing(.3)};
975    font-weight: 600;
976    color: ${t.infoTable.valueColor};
977  `}),TotalPrice=({orderSpec:e})=>{let{quote_currency:t=``,isOption:n,isOptionCombo:r,isSpot:i}=Ki.splitInstrument(e.instrument_name)??{},{priceDecimals:o}=ui(e.instrument_name),s=n||r,c=e.type&&(Sf(e.type)||isTrailingOrder(e.type)),p=s&&e.advanced===`implv`,m=e?.price||0,h=sa(Math.abs(yn(e.amount,m)),o);return(s||i)&&!c&&!p?(0,X.jsxs)(UD,{children:[(0,X.jsxs)(`span`,{children:[(0,X.jsx)(N,{id:`commonScreen.common.totalPriceExcludingFees`}),`:`]}),(0,X.jsx)(WD,{"data-id":`totalPrice_amount`,children:h}),(0,X.jsx)(`span`,{"data-id":`totalPrice_currency`,children:getUnit(e,t)}),s&&(0,X.jsx)(PriceDescription,{orderSpec:e})]}):null};V();var GD=P(`div`)(({theme:e})=>z`
978    font-weight: ${e.typography.fontWeightBold};
979    font-size: ${e.typography.body3.fontSize};
980  `),KD=P(`div`)(({theme:e})=>z`
981    display: flex;
982    justify-content: space-between;
983    padding: ${e.spacing(1.5,2)};
984    align-items: center;
985  `),qD=P(`div`)(({theme:e})=>z`
986    display: flex;
987    gap: ${e.spacing(.5)};
988  `),SecondaryOrderTitle=({title:e,direction:t,reduceOnly:n})=>{let r=rr(),{tag:i}=useOrderConfirmationTheme();return(0,X.jsxs)(KD,{children:[(0,X.jsx)(GD,{children:e.toUpperCase()}),(0,X.jsxs)(qD,{children:[!!n&&(0,X.jsx)(An,{borderColor:i.borderColor,color:`inherit`,backgroundColor:`transparent`,label:R._({id:`commonScreen.common.reduce`}),hasBorder:!0}),(0,X.jsx)(An,{color:r.palette.common.white,backgroundColor:t===`buy`?r.palette.dsColors.success[200]:r.palette.dsColors.error[200],label:t===`buy`?R._({id:`commonScreen.notificationTags.buy`}):R._({id:`commonScreen.notificationTags.sell`})})]})]})};V();var JD=P(`span`,ai([`isPositive`]))(({isPositive:e})=>{let{infoTable:{direction:t}}=useOrderConfirmationTheme(),n=e?t.buy:t.sell;return z`
989    color: ${n};
990  `}),SecondaryOrderSection=({secondaryOrderType:e,primaryOrderSpec:t,secondaryOrderSpec:n})=>{let{amount:r,price:i,trigger_price:o,direction:s,trigger_offset:c,trigger:p}=n,{instrument_name:m}=t,{quote_currency:h=``,isFutureCombo:g}=Ki.splitInstrument(m)??{},_=S(m),{sizeDecimals:v,priceDecimals:y}=ui(m),b=n.type&&Sf(n.type)?R._({id:`commonScreen.common.marketPrice`}):`${sa(i,y)} ${h}`,x=sa(r||0,v),C=Ef(t,n,_?.mark_price||0),w=!!(C&&C>0);return(0,X.jsxs)(ID,{children:[(0,X.jsx)(SecondaryOrderTitle,{title:e===`takeProfit`?R._({id:`tradeScreen.confirmation.takeProfit`}):R._({id:`tradeScreen.confirmation.stopLoss`}),reduceOnly:n.reduce_only,direction:s}),(0,X.jsx)(LD,{children:(0,X.jsxs)(RD,{children:[(0,X.jsx)(InfoRow,{label:R._({id:`tradeScreen.orderForm.confirmation.orderType`}),value:getOrderTypeDisplayName(n.type)}),(0,X.jsx)(InfoRow,{label:R._({id:`tradeScreen.orderForm.confirmation.amount`}),value:x}),!isTrailingOrder(n.type)&&(0,X.jsx)(InfoRow,{label:R._({id:`tradeScreen.orderForm.confirmation.price`}),value:b}),Gr(n.type)&&(0,X.jsxs)(X.Fragment,{children:[isTrailingOrder(n.type)?(0,X.jsx)(InfoRow,{id:`trigger_offset`,label:R._({id:`tradeScreen.orderForm.confirmation.triggerOffset`}),value:`${sa(c,y)} ${h}`}):(0,X.jsx)(InfoRow,{label:R._({id:`tradeScreen.orderForm.confirmation.triggerPrice`}),value:`${sa(o)} ${h}`}),(0,X.jsx)(InfoRow,{label:R._({id:`tradeScreen.orderForm.confirmation.trigger`}),value:p?formatOrderTrigger(p):`-`})]}),!g&&(0,X.jsx)(InfoRow,{label:w?R._({id:`tradeScreen.orderForm.estimatedProfit`}):R._({id:`tradeScreen.orderForm.estimatedLoss`}),value:(0,X.jsxs)(JD,{isPositive:w,children:[C?ki(Math.abs(C),2):0,` `,h]})})]})})]})};V();var YD=P(On)`
991  @keyframes backdropAnimation {
992    0% {
993      backdrop-filter: blur(0);
994    }
995    100% {
996      backdrop-filter: blur(1.5px);
997    }
998  }
999  animation: backdropAnimation 3s;
1000  animation-fill-mode: forwards;
1001`,XD=P(`div`)(({theme:e})=>{let{modal:t}=useOrderConfirmationTheme();return z`
1002    position: absolute;
1003    top: 50%;
1004    left: 50%;
1005    transform: translate(-50%, -50%);
1006    display: flex;
1007    background-color: ${t.backgroundColor};
1008    padding: ${e.spacing(3)};
1009    border-radius: 8px;
1010    filter: ${e.dsShadows.xLarge};
1011    width: 100%;
1012    max-width: 544px;
1013    gap: ${e.spacing(1)};
1014    flex-direction: column;
1015  `}),ZD=P(`div`)(({theme:e})=>z`
1016    display: flex;
1017    justify-content: space-between;
1018    gap: ${e.spacing(1)};
1019  `),QD=P(oi)(({theme:e})=>{let{dividerColor:t}=useOrderConfirmationTheme();return z`
1020    border-color: ${t};
1021    border-width: 1px;
1022    border-radius: 2px;
1023    margin: ${e.spacing(1,0)};
1024  `}),OrderConfirmation=({orderSpec:e,onConfirm:t,onCancel:n,stopLossOrderSpec:r,takeProfitOrderSpec:i,...o})=>(0,X.jsx)(YD,{...o,children:(0,X.jsxs)(XD,{children:[(0,X.jsx)(PrimaryOrderSection,{orderSpec:e}),(r||i)&&(0,X.jsxs)(ZD,{children:[i&&(0,X.jsx)(SecondaryOrderSection,{primaryOrderSpec:e,secondaryOrderSpec:i,secondaryOrderType:`takeProfit`}),r&&(0,X.jsx)(SecondaryOrderSection,{primaryOrderSpec:e,secondaryOrderSpec:r,secondaryOrderType:`stopLoss`})]}),(0,X.jsx)(TotalPrice,{orderSpec:e}),(0,X.jsx)(QD,{}),(0,X.jsx)(OrderActions,{onConfirm:t,onCancel:n})]})}),ConfirmCancelButtons=({onCancel:e,onConfirm:t,cancelLabel:n,confirmLabel:r,confirmColor:i=`primary`})=>(0,X.jsxs)(I,{display:`flex`,justifyContent:`flex-end`,paddingTop:4,gap:2,children:[e&&(0,X.jsx)(H,{variant:`gray`,onClick:e,"data-id":`cancelButton`,children:n||(0,X.jsx)(N,{id:`commonScreen.common.cancel`})}),(0,X.jsx)(H,{variant:`filled`,color:i,onClick:t,"data-id":`confirmButton`,children:r||(0,X.jsx)(N,{id:`commonScreen.common.confirm`})})]}),$D=mi(ConfirmCancelButtons),PlaceOrderDeepIntoMarketConfirmation=({orderSpec:e,tickerData:t,onCancel:n,onConfirm:r})=>{let{interfaceSettings:i,setInterfaceSettings:o}=td(),s=i.disablePlaceOrderDeepIntoTheMarketConfirmation,{amount:c,instrument_name:p,direction:m,price:h,advanced:g,contracts:_}=e,{isOption:v,isFutureCombo:y,isOptionCombo:b,isCombo:x,currency:S}=Ki.splitInstrument(p)||{},{mark_price:C,best_ask_price:w,best_bid_price:T,interest_rate:E,index_price:D,underlying_price:O}=t,k=fd({instrument:p}),ee=Vp(p),te=h||C;if(g&&ee&&h&&O&&E!=null){let e=zp({instrumentObj:ee,price:h,advanced:g,interestRate:E,indexPrice:D,underlyingPrice:O});e&&(te=e.priceCrypto)}let A=te,j=v||b?`${A} ${S}`:`$${A}`,ne=(0,X.jsx)(`span`,{"data-id":`markPrice`,children:y?`$${cr(C,4)}`:`${cr(C,4)} ${S}`}),M=(0,X.jsx)(`span`,{"data-id":`bestBid`,children:`$${T}`}),re=(0,X.jsx)(`span`,{"data-id":`bestAsk`,children:`$${w}`}),ie=v||x?Bp(A,C)*100:Hp(m,A,T,w)*100,ae=(0,X.jsx)(`span`,{"data-id":`percentageDifference`,children:cr(ie,1)}),oe=(0,$.useCallback)(()=>{o(e=>({...e,disablePlaceOrderDeepIntoTheMarketConfirmation:!e.disablePlaceOrderDeepIntoTheMarketConfirmation}))}
1024,[o]);return(0,X.jsxs)(`div`,{style:{padding:`10px`,textAlign:`left`},"data-component":`deepExecutionWarningDialog`,children:[(0,X.jsxs)(`p`,{style:{marginTop:`0px`},children:[(0,X.jsx)(N,{id:`tradeScreen.orderForm.confirmation.didYouIntendToPlaceThisOrder`}),(0,X.jsx)(`br`,{}),(0,X.jsx)(N,{id:`tradeScreen.orderForm.confirmation.priceOfTheOrderPlacesItDeepIntoTheMarket`}),(0,X.jsx)(`br`,{}),(0,X.jsx)(N,{id:`tradeScreen.orderForm.confirmation.itWillProbablyBeExecutedImmediately`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(N,{id:`tradeScreen.orderForm.confirmation.yourOrder`}),`: `,(0,X.jsx)(`span`,{"data-id":`direction`,children:m.toUpperCase()}),` `,(0,X.jsx)(`span`,{"data-id":`instrumentName`,children:p}),` x`,` `,(0,X.jsx)(`span`,{"data-id":`amount`,children:k?_:c}),` @`,` `,(0,X.jsx)(`span`,{"data-id":`price`,children:j})]}),(0,X.jsx)(`div`,{children:v||x?(0,X.jsx)(N,{values:{displayedMarkPrice:ne},id:`tradeScreen.orderForm.confirmation.currentMarkPriceIs`}):m===`buy`?(0,X.jsx)(N,{values:{displayedBestBid:M},id:`tradeScreen.orderForm.confirmation.currentBestBidIs`}):(0,X.jsx)(N,{values:{displayedBestAsk:re},id:`tradeScreen.orderForm.confirmation.currentBestAskIs`})}),ie>0&&m===`buy`?(0,X.jsx)(`div`,{children:(0,X.jsx)(N,{values:{percentageDifference:ae},id:`tradeScreen.orderForm.confirmation.orderWillBePlacedAboveIt`})}):(0,X.jsx)(`div`,{children:(0,X.jsx)(N,{values:{percentageDifference:ae},id:`tradeScreen.orderForm.confirmation.orderWillBePlacedBelowIt`})}),(0,X.jsx)(`p`,{children:(0,X.jsx)(N,{id:`tradeScreen.orderForm.confirmation.pleaseConfirmTheOrder`})}),(0,X.jsx)(I,{mt:2,children:(0,X.jsx)(hp,{control:(0,X.jsx)(vp,{"data-id":`dontShowAgainCheckbox`,size:`small`,checked:s,onChange:()=>{oe()},name:`dontShowMeAgain`,color:`primary`}),label:R._({id:`tradeScreen.confirmation.dontShowMeAgain`})})}),(0,X.jsx)($D,{onCancel:n,onConfirm:r})]})},ConfirmationMessage=({scope:e=`displayed`,source:t=`table`})=>t===`widget`?e===`all`?(0,X.jsx)(N,{id:`tradeScreen.common.wouldYouLikeToCancelAllYourOpenOrdersIncludingStarbase`}):(0,X.jsx)(N,{id:`tradeScreen.common.wouldYouLikeToCancelAllOpenOrders`}):e===`all`?(0,X.jsx)(N,{id:`tradeScreen.common.wouldYouLikeToCancelAllOpenOrdersIncludingStarbase`}):(0,X.jsx)(N,{id:`tradeScreen.common.wouldYouLikeToCancelAllTheCurrentlyShownOrders`}),CancelAllOrdersConfirmation=({onCancel:e,onConfirm:t,scope:n=`displayed`,source:r=`table`})=>(0,X.jsxs)(I,{minWidth:`300px`,children:[(0,X.jsx)(ConfirmationMessage,{scope:n,source:r}),(0,X.jsx)($D,{onCancel:e,onConfirm:t})]}),eO=vd(()=>({container:{minWidth:`350px`},instrument:{paddingBottom:`8px`,marginLeft:`8px`},table:{margin:`auto`,marginBottom:`16px`},changeContainer:{textTransform:`capitalize`,"& td":{padding:`6px 0 6px 0`,"&:first-of-type":{textAlign:`end`,paddingRight:`24px`}}},parameter:{marginRight:`8px`},arrowIcon:{display:`flex`,paddingLeft:`8px`,paddingRight:`8px`}})),formatSelector=(e,t)=>e+t.split(` `).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``),EditOrderConfirmation=({onCancel:e,onConfirm:t,order:n,changedParams:r})=>{let i=eO(),o=n.instrument_name,{interfaceSettings:s,setInterfaceSettings:c}=td(),p=s.disableEditOrderConfirmation,toggleDisableEditOrderConfirmation=()=>{c(e=>({...e,disableEditOrderConfirmation:!e.disableEditOrderConfirmation}))};return(0,X.jsxs)(I,{className:i.container,children:[(0,X.jsx)(I,{className:i.instrument,children:o&&Ri(o)}),(0,X.jsx)(`table`,{className:i.table,children:(0,X.jsx)(`tbody`,{children:Object.keys(r).filter(e=>e!==`instrument_name`).map(e=>{let t;switch(e){case`implv`:t=`IV`;break;case`usd`:t=`USD`;break;default:t=e.replace(`_`,` `)}return n[e]===r[e]?null:(0,X.jsxs)(`tr`,{className:i.changeContainer,children:[(0,X.jsx)(`td`,{className:i.parameter,children:t}),(0,X.jsx)(`td`,{"data-id":formatSelector(`editConfirmDialogStarting`,t),children:n[e]}),(0,X.jsx)(`td`,{className:i.arrowIcon,children:(0,X.jsx)(AC,{fontSize:`small`})}),(0,X.jsx)(`td`,{"data-id":formatSelector(`editConfirmDialogFinal`,t),children:(0,X.jsx)(`strong`,{children:r[e]})})]},t)})})}),(0,X.jsx)(hp,{control:(0,X.jsx)(vp,{size:`small`,checked:p,onChange:toggleDisableEditOrderConfirmation,name:`dontShowMeAgain`,color:`primary`}),label:R._({id:`tradeScreen.confirmation.dontShowMeAgain`})}),(0,X.jsx)($D,{onCancel:e,onConfirm:t})]})},CancelAllOrdersByKindConfirmation=({onCancel:e,onConfirm:t,body:n})=>(0,X.jsxs)(I,{minWidth:`300px`,children:[n,(0,X.jsx)($D,{onCancel:e,onConfirm:t})]});V();var tO=ld(`span`,{shouldForwardProp:e=>e!==`value`})(({theme:e,value:t})=>z`
1025    color: ${t>=100?e.palette.asks:t>90?e.palette.orange:void 0};
1026  `);function MarginsConfirmation({onCancel:e,onConfirm:t,portfolio:n,estimatedMargins:r,orderSpec:i}){let o=Math.round(r.initial/n.margin_balance*100),s=Math.round(r.maintenance/n.margin_balance*100),c=fd({instrument:i.instrument_name}),{currency:p,isReversedFuture:m}=Ki.splitInstrument(i.instrument_name)||{};return(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{children:(0,X.jsx)(N,{id:`tradeScreen.orderForm.confirmation.didYouIntendToPlaceThisOrder`})}),r.initial>n.margin_balance&&(0,X.jsx)(`div`,{children:(0,X.jsx)(N,{id:`tradeScreen.orderForm.confirmation.initialMarginWillExceedMarginBalance`})}),r.maintenance>n.margin_balance&&(0,X.jsx)(`div`,{children:(0,X.jsx)(N,{id:`tradeScreen.orderForm.confirmation.maintenanceMarginWillExceedMarginBalance`})}),(0,X.jsx)(`br`,{}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(N,{id:`tradeScreen.orderForm.confirmation.yourOrder`}),`: `,i.direction.toUpperCase(),` `,i.instrument_name,` x`,` `,c?i.contracts:i.amount,` @ `,` `,i.price===void 0?(0,X.jsx)(N,{id:`commonScreen.common.marketPrice`}):`${m?`$`:``}${i.price} ${m?``:p}`]}),(0,X.jsx)(`br`,{}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(N,{id:`tradeScreen.orderForm.confirmation.currentMarginBalance`}),`: `,n.margin_balance,` `,n.currency]}),r.initial>n.margin_balance&&(0,X.jsxs)(`div`,{children:[(0,X.jsx)(N,{id:`tradeScreen.orderForm.confirmation.currentInitialMargin`}),`: `,n.initial_margin,` `,n.currency]}),r.maintenance>n.margin_balance&&(0,X.jsxs)(`div`,{children:[(0,X.jsx)(N,{id:`tradeScreen.orderForm.confirmation.currentMaintenanceMargin`}),`: `,n.maintenance_margin,` `,n.currency]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(N,{id:`tradeScreen.orderForm.confirmation.estimatedInitialMargin`}),`:`,` `,(0,X.jsxs)(tO,{value:o,children:[o,`%`]})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(N,{id:`tradeScreen.orderForm.confirmation.estimatedMaintenanceMargin`}),`:`,` `,(0,X.jsxs)(tO,{value:s,children:[s,`%`]})]}),(0,X.jsx)($D,{onCancel:e,onConfirm:t})]})}V();var nO=P(`div`)(()=>z`
1027    max-width: 712px;
1028  `),SecurityKeysSetup=({onCancel:e,onConfirm:t})=>{let n=tf(`(max-width: 900px)`),r=Dn(),{processStatus:i,onReset:o}=useSecurityKeySetup(),{isContinueDisabled:s,isLoading:c,onContinue:p}=useSecurityKeySelectorBaseLogic();return(0,$.useEffect)(()=>{i===`completed`&&(Y.notify({isSuccess:!0,message:R._({id:`commonScreen.security.securityKeySetup.addSuccessMessage`})}),t())},[t,i]),(0,X.jsxs)(nO,{children:[(0,X.jsx)(SecurityKeySetupSelector,{tfaVariant:n?`compact`:`extended`}),(0,X.jsxs)(I,{display:`flex`,justifyContent:`flex-end`,marginTop:r.spacing(2),gap:r.spacing(2),children:[(0,X.jsx)(H,{variant:`gray`,onClick:()=>{o(),e?.()},children:R._({id:`commonScreen.common.cancel`})}),(0,X.jsx)(Cr,{variant:`filled`,onClick:p,disabled:s,loading:c,children:R._({id:`commonScreen.common.continue`})})]})]})},ContextAwareSecurityKeysSetup=({preselectedMethod:e,...t})=>(0,X.jsx)(SecurityKeySetupProvider,{preselectedMethod:e,children:(0,X.jsx)(SecurityKeysSetup,{...t})}),rO=mi(ContextAwareSecurityKeysSetup);V();var iO=P(`div`)(()=>{let{typography:{h5:{fontSize:e,lineHeight:t,fontWeight:n}}}=rr();return z`
1029    font-size: ${e};
1030    line-height: ${t};
1031    font-weight: ${n};
1032  `}),aO=P(On)`
1033  overflow: auto;
1034`;function getContent(e,t){switch(e){case Mu.confirm:return(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{children:t.content}),(0,X.jsx)($D,{onCancel:t.onCancel,onConfirm:t.onConfirm,confirmLabel:t?.confirmLabel,cancelLabel:t?.cancelLabel,confirmColor:t?.confirmColor})]});case Mu.orderConfirmation:return(0,X.jsx)(OrderConfirmation,{...t});case Mu.orderDeepIntoMarketConfirmation:return(0,X.jsx)(PlaceOrderDeepIntoMarketConfirmation,{...t});case Mu.marginsConfirmation:return(0,X.jsx)(MarginsConfirmation,{...t});case Mu.cancelAllOrdersConfirmation:return(0,X.jsx)(CancelAllOrdersConfirmation,{...t});case Mu.cancelAllOrdersByKindConfirmation:return(0,X.jsx)(CancelAllOrdersByKindConfirmation,{...t});case Mu.editOrderConfirmation:return(0,X.jsx)(EditOrderConfirmation,{...t});case Mu.securityKeySetUp:return(0,X.jsx)(rO,{...t});default:return null}}var oO=vd(e=>({paper:{backgroundColor:e.palette.type===`dark`?`#181A1B`:`#FFFFFF`}})),ModalStaticVersion2=()=>{let[e,t]=(0,$.useReducer)(Eu,Qu),n=rr(),{platformConfig:r}=Oi(),{loginApi:i}=r,o=oO(),s=(0,$.useCallback)(()=>{t({type:$u.close})},[t]);return(0,$.useEffect)(()=>{let openModal=({type:e,contentProps:n})=>{switch(e){case Mu.confirm:t({type:$u.openConfirm,contentProps:n});break;case Mu.orderConfirmation:t({type:$u.openOrderConfirmation,contentProps:n});break;case Mu.orderDeepIntoMarketConfirmation:t({type:$u.openOrderDeepIntoMarketConfirmation,contentProps:n});break;case Mu.marginsConfirmation:t({type:$u.openOrderMarginsConfirmation,contentProps:n});break;case Mu.cancelAllOrdersConfirmation:t({type:$u.openCancelAllOrdersConfirmation,contentProps:{...n,dataComponent:`cancelConfirmDialog`}});break;case Mu.cancelAllOrdersByKindConfirmation:t({type:$u.openCancelAllOrdersByKindConfirmation,contentProps:n});break;case Mu.editOrderConfirmation:t({type:$u.openEditOrderConfirmation,contentProps:{...n,dataComponent:`editConfirmDialog`}});break;case Mu.login:t({type:$u.openLogin,contentProps:n});break;case Mu.securityKeySetUp:t({type:$u.openSecurityKeySetUp,contentProps:n})}};return Tr.on(ti.OPEN_MODAL_STATIC,openModal),Tr.on(ti.CLOSE_MODAL_STATIC,s),()=>{Tr.off(ti.OPEN_MODAL_STATIC,openModal),Tr.off(ti.CLOSE_MODAL_STATIC,s)}},[s]),e.contentName===Mu.login?i===`proxy`?(0,X.jsx)(aO,{open:e.isOpen,children:(0,X.jsx)(`div`,{children:(0,X.jsx)(LoginScreenWithTheme,{action:`login`,onClose:s})})}):(0,X.jsx)(aO,{open:e.isOpen,children:(0,X.jsx)(`div`,{children:(0,X.jsx)(lD,{action:`login`,onClose:s})})}
1034):e.contentName===Mu.orderConfirmation?(0,X.jsx)(Et,{theme:n,children:(0,X.jsx)(OrderConfirmation,{open:e.isOpen,onClose:e.contentProps?.onCancel,"data-component":e.contentProps?.dataComponent,...e.contentProps})}):(0,X.jsx)(Ed,{classes:o,open:e.isOpen,onClose:e.contentProps?.onCancel,transitionDuration:0,title:(0,X.jsx)(iO,{children:e.contentProps?.dialogTitle||(0,X.jsx)(N,{id:`commonScreen.common.confirm`})}),isDraggable:e.isDraggable,PaperProps:{"data-component":e.contentProps?.dataComponent},children:(0,X.jsx)(I,{children:getContent(e.contentName,e.contentProps)})})};function initializeUserData(e=!0){return async function(t,n){await Promise.all([t(xd.fetchOrders()),t(xd.fetchAccountSummary()),t(xd.fetchPositions()),t(xd.fetchScope()),t(xd.fetchEnabledFeatures()),t(xd.fetchEmailLanguage()),t(xd.fetchAccountSettings()),t(xd.fetchLastLoginInfo()),t(xd.fetchUserLocks()),t(xd.fetchWithdrawalDelay()),t(xd.fetchPendingBlockTrades()),t(xd.fetchBrokerTradeRequests()),t(xd.fetchSecurityKeys()),t(xd.fetchBlockRfqs()),t(xd.fetchBlockRfqUserInfo()),t(xd.fetchSubaccounts()),t(xd.fetchRiskProfile()),t(xd.fetchUserLegalInfo()),t(xd.fetchAvailableCurrencies()),...e?[t(xd.fetchBrokerProfile()),t(xd.fetchLinkedBrokers()),t(xd.fetchBrokerHistory()),t(xd.fetchBrokerClients())]:[]]),er(n())&&await t(fC.fetchMembers())}}var addComboDetails=e=>async(t,n,{deribitClient:r})=>{try{let n=await r.getComboDetails(e);t(sC.setComboDetails(transformComboDetails(n)))}catch{}},sO={active:b.active,inactive:b.inactive,rfq:b.rfq,expired:b.expired},transformComboDetails=e=>({instrumentName:e.id,comboState:e.state===`rfq`?b.active:sO[e.state],legs:e.legs,timestamps:{creation:e.creation_timestamp,lastChange:e.state_timestamp},type:Kt(e.id)}),initAllCombos=e=>async(t,n,{deribitClient:r})=>{try{let n=await r.getComboDetailsList(`any`),i=e?n.filter(e):n;t(sC.setArrayComboDetails(i.map(transformComboDetails)))}catch{}},cO=1e4;function useStarbaseOpenOrdersPolling(){let e=Cu(),t=Uu(er),n=Uu(Yi);(0,$.useEffect)(()=>{if(!t||!n)return;e(xd.fetchStarbaseOpenOrders());let r=setInterval(()=>{e(xd.fetchStarbaseOpenOrders())},cO);return()=>{clearInterval(r)}},[t,e,n])}var formatSecondsToReadableTime=e=>{let t=Math.floor(e/3600),n=e-t*3600,r=Math.floor(n/60);return`${t}h ${r}m ${n-r*60}s`},getErrorsDictionary=()=>({1e4:`Authorization issue, invalid or absent signature etc.`,10001:`Some general failure, no public information available.`,10002:`Order quantity is too low.`,10003:R._({id:`commonScreen.error.10003`}),10004:`Attempt to operate with order that can't be found by specified id.`,10005:"Price is too low, `<Limit>` defines current limit for the operation.",10006:"Price is too low for current index, `<Limit>` defines current bottom limit for the operation.",10007:"Price is too high, `<Limit>` defines current up limit for the operation.",10008:"Price is too high for current index, `<Limit>` defines current up limit for the operation.",10009:R._({id:`commonScreen.error.notEnoughFunds`}),10010:`Attempt of doing something with closed order.`,10011:`This price is not allowed for some reason.`,10012:`Operation for instrument which order book had been closed.`,10013:R._({id:`commonScreen.error.10013`}),10014:`Limit of count of futures' open orders has been exceeded, it is applicable for PME users.`,10015:`Limit of count of options' open orders has been exceeded, it is applicable for PME users.`,10016:`Limit of size for futures has been exceeded, it is applicable for PME users.`,10017:`Limit of size for options has been exceeded, it is applicable for PME users.`,10018:`Limit of size for futures has been exceeded, it is applicable for non-PME users.`,10019:`Trading is temporary locked by admin.`,10020:`Instrument name is not valid.`,10021:`Amount is not valid.`,10022:`Quantity was not recognized as a valid number (for API v1).`,10023:`Price was not recognized as a valid number.`,10024:`Parameter was not recognized as a valid number.`,10025:`Order id is missing or its format was not recognized as valid.`,10026:`Extra precision of the price is not supported.`,10027:`Futures contract amount was not recognized as integer.`,10028:`Allowed request rate has been exceeded.`,10029:`Attempt to operate with not own order.`,10030:`REST request where Websocket is expected.`,10031:`Some of arguments are not recognized as valid.`,10032:`Total cost is too low.`,10033:`Method is not implemented yet.`,10034:`Price is too high.`,10035:`Price is too low.`,10036:`Max Show Amount is not val
1034id.`,10037:`Limit of total size for short options positions has been exceeded, it is applicable for non-PME users.`,10038:R._({id:`commonScreen.error.10038`}),10039:R._({id:`commonScreen.error.notEnoughFunds`}),10040:`Request can't be processed right now and should be retried.`,10041:`Settlement is in progress. Every day at settlement time for several seconds, the system calculates user profits and updates balances. That time trading is paused for several seconds till the calculation is completed`,10044:`Stop Price has to be rounded to a certain tick size`,10045:`Liquidation order can't be canceled`,10046:`Liquidation order can't be edited.`,10047:`Reached limit of pending Matching Engine requests for user.`,10048:`The requested operation is not available on this server.`,10055:R._({id:`commonScreen.error.10055`}),10057:R._({id:`commonScreen.error.10057`}),10072:R._({id:`commonScreen.error.10072`}),11008:`This request is not allowed in regards to the filled order`,11020:R._({id:`commonScreen.error.11020`}),11021:R._({id:`commonScreen.error.11021`}),11029:`Some invalid input has been detected`,11035:`Allowed amount of stop orders has been exceeded.`,11036:R._({id:`commonScreen.error.11036`}),11037:`Instrument already not available for trading.`,11038:`Advanced orders are not available for futures.`,11039:`Advanced post-only orders are not supported yet.`,11041:`Advanced order properties can't be set if the order is not advanced.`,11042:`Permission for the operation has been denied.`,11043:`Bad argument has been passed.`,11044:`Attempt to do open order operations with the not open order.`,11045:`Event name has not been recognized.`,11046:`At several minutes to instrument expiration, corresponding advanced implied volatility orders are not allowed.`,11047:`The specified combination of arguments is not supported.`,11048:`Wrong Max Show for options`,11049:`Several bad arguments have been passed.`,11050:`Request has not been parsed properly.`,11051:`System is under maintenance.`,11052:`Subscription error. However, subscription may fail without this error, please check list of subscribed channels returned, as some channels can be not subscribed due to wrong input or lack of permissions.`,11053:`Specified transfer is not found`,11090:`Invalid address`,11091:`Invalid addres for the transfer`,11092:`The address already exists`,11093:`Limit of allowed addresses has been reached.`,11094:`Some unhandled error on server. Please report to admin. The details of the request will help to locate the problem.`,11095:`Deposit address creation has been disabled by admin`,11096:R._({id:`commonScreen.error.11096`}),11098:R._({id:`commonScreen.error.11098`}),12e3:`Wrong 2FA code`,12001:R._({id:`commonScreen.error.12001`}),12002:`Wrong alias, already used`,12998:`Please wait {param} seconds and try again`,12003:`number of failed login attempts is limited`,12004:`The number of registration requests is limited`,12005:`The country is banned (possibly via IP check)`,12006:`Subaccount not removed. You can remove subaccount once in 5min. You need to wait {param} to try again`,12100:`Transfer is not allowed. Possible wrong direction or other mistake`,12999:`2FA code is correct but it is already used. Please, use next code`,13e3:`Login name is invalid (not allowed or it contains wrong characters).`,13001:`Account must be activated.`,13002:`Your account has been blocked. Check your e-mail to find out how to unlock your account`,13003:`This action requires 2FA authentication.`,13004:`Invalid credentials have been used or the current IP does not match the IP Whitelist.`,13005:`Password confirmation error.`,13006:R._({id:`commonScreen.common.invalidOrExpiredCode`}),13007:`User's security code has been changed or wrong.`,13008:`Request failed because of invalid input or internal failure.`,13009:`Wrong or expired authorization token or bad signature. For example, please check scope of the token, "connection" scope cannot be reused for other connections.`,13010:`Invalid input, missing value.`,13011:`Input is too short.`,13012:`Subaccount restrictions.`,13013:`Unsupported or invalid phone number.`,13014:`SMS sending failed -- phone number is wrong.`,13015:`Invalid SMS code.`,13016:`Invalid input.`,13017:`Subscription hailed, invalid subscription parameters.`,13018:`Invalid content type of the request.`,13019:`Closed, expired order book.`,13020:`Instrument is not found, invalid instrument name.`,13021:`Not enough permissions to execute the request, forbidden.`,13023:R._({id:`commonScreen.error.13023`}),13025:`API method temporarily switched off by administrator.`,13028:R._({id:`commonScreen.error.13028`}),13031:R._({id:`commonScreen.error.13031`}),13030:R._({id:`commonScreen.error.13030`}),13033:`Assignment has been already defined`,13034:R._({id:`commonScreen.error.13034`}),13041:R._({id:`commonScreen.error.13041`}),13401:R._({id:`commonScreen.error.13401`}),13667:`Security Key name already in use`,13668:`Incorrect Security Key Authorization`,13671:`Invalid assignments assigned`,13672:`Activation challenge timed out`,13673:R._({id:`commonScreen.error.13673`}),13675:R._({id:`commonScreen.error.13675`}),13676:R._({id:`commonScreen.error.13676`}),13776:R._({id:`commonScreen.error.13776`}),13781:R._({id:`commonScreen.error.13781`}),13791:R._({id:`commonScreen.error.13791`}),13792:R._({id:`commonScreen.error.13792`}),13793:R._({id:`commonScreen.error.13793`}),13800:R._({id:`commonScreen.error.13800`}),13035:R._({id:`commonScreen.error.13035`}),13036:R._({id:`commonScreen.error.13036`}),13815:R._({id:`commonScreen.error.13815`}),13816:R._({id:`commonScreen.error.13816`}),13900:R._({id:`commonScreen.error.13900`}),13905:R._({id:`commonScreen.error.13905`}),13906:R._({id:`commonScreen.error.13906`}),13910:R._({id:`tradeScreen.blockRFQ.crossQuoting`}),13911:R._({id:`commonScreen.error.13911`}),13912:R._({id:`commonScreen.error.13912`}),13913:R._({id:`commonScreen.error.13913`}),13919:R._({id:`commonScreen.error.13919`}),13921:R._({id:`commonScreen.error.13921`}),"-32602":`Invalid params`,"-32601":`Method not found`,"-32700":`Parse error`,"-32000":`Missing params`}),getSpecificErrors=e=>({"10030-close_position":R._({id:`commonScreen.error.10030-close_position`}),"12002-already_taken":R._({id:`accountScreen.account.alreadyUsedUsername`}),"12002-too_short":R._({id:`accountScreen.account.tooShortUsername`}),"12002-wrong_format":R._({id:`accountScreen.account.wrongUsernameFormat`}),"-32602-invalid_iv_price":R._({id:`commonScreen.error.-32602-invalid_iv_price`}),"-32602-too-small-iceberg-amount":R._({id:`commonScreen.error.-32602-too-small-iceberg-amount`}),"-32602-expires_at_exceeds_expiration_time":R._({id:`commonScreen.error.-32602-expires_at_exceeds_expiration_time`}),"-32602-invalid-iceberg-ratio":R._({id:`commonScreen.error.-32602-invalid-iceberg-ratio`}),"-32602-too-small-iceberg-total-amount":R._({id:`commonScreen.error.-32602-too-small-iceberg-total-amount`}),"11030-invalid_reduce_only_order":R._({id:`tradeScreen.common.11030-invalid_reduce_only_order`}),"11030-show_too_small":R._({id:`commonScreen.error.11030-show_too_small`}),"11030-invalid_show_to_total_ratio":R._({id:`commonScreen.error.11030-invalid_show_to_total_ratio`}),"11030-forbidden_by_risk_profile":R._({id:`commonScreen.error.11030-forbidden_by_risk_profile`}),"11030-reduce_only_due_to_anchor_breached":R._({id:`tradeScreen.common.11030-reduce_only_due_to_anchor_breached`}),"11030-insufficient_margin":R._({id:`tradeScreen.common.11030-insufficient_margin`}),"-32602-expired_block_trade_validity":R._({id:`tradeScreen.common.-32602-expired_block_trade_validity`}),"-32602-expired_block_trade_own_signature":R._({id:`tradeScreen.common.-32602-expired_block_trade_own_signature`}),"-32602-wrong_tfa_confirmation":R._({id:`tradeScreen.common.-32602-wrong_tfa_confirmation`}),"-32602-block_rfq_at_least_one_long_leg":R._({id:`tradeScreen.common.-32602-block_rfq_at_least_one_long_leg`}),"-32602-duplicated_block_rfqs":R._({id:`tradeScreen.common.-32602-duplicated_block_rfqs`}),"13671-you_cannot_switch_to_basic_mode":R._({id:`tradeScreen.common.13671-you_cannot_switch_to_basic_mode`}),"13020-invalid_code":R._({id:`tradeScreen.common.13020-invalid_code`}),"11043-subaccount-invalid-email":R._({id:`accountScreen.subaccounts.provideValidEmailAddress`}),"11050-invalid-coupon-code":R._({id:`commonScreen.error.11050-invalid-coupon-code`}),"11050-block_trade_already_cancelled":R._({id:`commonScreen.error.11050-block_trade_already_cancelled`}),"13012-subaccount_without_login_ability":R._({id:`commonScreen.error.13012-subaccount_without_login_ability`}),"13672-invalid_activation_challenge":R._({id:`commonScreen.error.13672-invalid_activation_challenge`}),"11035-no_more_triggers":R._({id:`commonScreen.error.11035-no_more_triggers`}),"13668-challenge_timeout":R._({id:`commonScreen.error.13668-challenge_timeout`}),"13028-too_close_to_settlement":R._({id:`commonScreen.error.13028-too_close_to_settlement`}),"13028-missing_verification_data":R._({id:`commonScreen.error.13028-missing_verification_data`}),"13028-failed_to_cancel_starbase_orders":R._({id:`commonScreen.error.13028-failed_to_cancel_starbase_orders`}),"10028-create_combo_too_many_requests":R._({id:`commonScreen.error.10028-create_combo_too_many_requests`}),"-32602-private_buy_sell_value_too_low":R._({id:`commonScreen.error.-32602-private_buy_sell_value_too_low`}),"-32602-private_buy_sell_value_too_high":R._({id:`commonScreen.error.-32602-private_buy_sell_value_too_high`}),"-32602-private_buy_sell_value_too_large":R._({id:`commonScreen.error.-32602-private_buy_sell_value_too_large`}),"-32602-must_be_multiple_of_minimum_order_size":R._({id:`tradeScreen.orderForm.incorrectAmountError`}),"-32602-used_by_a_different_user":R._({id:`commonScreen.error.-32602-used_by_a_different_user`}),"11031-account_locked":R._({id:`commonScreen.error.11031-account_locked`}),"-32602-must_conform_to_tick_size":R._({id:`commonScreen.error.-32602-must_conform_to_tick_size`}),"-32000-mmp_missing_params":R._({id:`commonScreen.error.-32000-mmp_missing_params`}),"13021-unsatisfied-margin-model-requirements":R._({id:`commonScreen.error.13021-unsatisfied-margin-model-requirements`}),"13021-starbase_member":e.data?.reason?_u(e.data.reason):R._({id:`commonScreen.error.13021-starbase_member`}),"-32602-duplicate_block_rfq":R._({id:`commonScreen.error.-32602-duplicate_block_rfq`}),"11050-failed_to_calculate_leg_prices":R._({id:`commonScreen.error.11050-failed-to-calculate-leg-prices`}),"11050-block_rfq_combo_price_too_low":R._({id:`commonScreen.error.11050-block_rfq_combo_price_too_low`}),"11050-block_rfq_combo_price_too_high":R._({id:`commonScreen.error.11050-block_rfq_combo_price_too_high`}),"11050-company_cannot_be_onboarded_not_regulated_not_exempt":R._({id:`commonScreen.error.11050-company_cannot_be_onboarded_not_regulated_not_exempt`}),"13907-block_rfq_not_fully_filled":R._({id:`commonScreen.error.13907-block_rfq_not_fully_filled`}),"12007-is_linked_to_voice_broker":R._({id:`commonScreen.error.12007-is_linked_to_voice_broker`}),"12007-has_not_zero_equity":R._({id:`commonScreen.error.12007-has_not_zero_equity`}),"12007-has_pending_deposits":R._({id:`commonScreen.error.12007-has_pending_deposits`}),"12007-is_owner_of_app":R._({id:`commonScreen.error.12007-is_owner_of_app`}),"12007-has_active_block_rfq":R._({id:`commonScreen.error.12007-has_active_block_rfq`}),"12007-is_part_of_block_rfq_allocation":R._({id:`commonScreen.error.12007-is_part_of_block_rfq_allocation`}),"-32602-change_margin_model_not_allowed":e.data?.reason?_u(e.data.reason):R._({id:`commonScreen.error.-32602-change_margin_model_not_allowed`}),"-32602-not_allowed_for_direct_access_users":R._({id:`commonScreen.error.-32602-not_allowed_for_direct_access_users`}),"-32602-not_allowed_for_direct_access_users-with-param":(()=>{let{param:t=`unknown`}=e.data??{};return R._({id:`commonScreen.error.-32602-not_allowed_for_direct_access_users-with-param`,values:{param:t}})})()}),lO=[13008,13009,13e3,-32602,11093,11095,12003,11049,13028,-32601,13021,13780,13904],uO=[`private/toggle_subaccount_login`,`public/login`,`public/auth`];
1034function isErrorEnabled(e,t){let{code:n,data:r,message:i}=e;return[`private/get_mmp_config`,`/private/fiat/get_quote`,`private/initialize_verification`].includes(t)&&n===11050||t===`private/address_ownership`&&n===13020&&r?.object===`address_ownership`||t===`public/get_index_price_by_time`&&n===13020&&r?.object===`timestamp`||t===`/private/kv/get`&&i===`not_found`||t===`private/execute_broker_trade`&&[10009,10057,10072,11098].includes(n)||t===`private/create_block_rfq`&&(n===10009||[10057,10072,11098].includes(n)&&(r?.user_id||r?.client_info?.name))||t===`private/get_subaccounts`&&[14021].includes(n)?!1:!lO.includes(n)&&!uO.includes(t)}function getSpecificErrorCodeIfExist(e,t){let{method:n}=t,{code:r}=e;if(n===`private/close_position`&&r===11030)return`10030-close_position`;if(r===12002)return`12002-${e.data.msg?e.data.msg:e.data}`;if(e.data?.reason===`invalid iv price`&&t.params&&typeof t.params==`object`&&`price`in t.params&&typeof t.params.price==`number`&&isFinite(t.params.price))return`-32602-invalid_iv_price`;if(r===-32602&&n===`private/edit_broker_link`&&e.data?.reason===`used by a different user`)return`-32602-used_by_a_different_user`;if(e.data?.reason===`too small iceberg display amount`)return`-32602-too-small-iceberg-amount`;if(e.data?.reason===`invalid show to total ratio`)return`-32602-invalid-iceberg-ratio`;if(e.data?.reason===`too small iceberg total amount`)return`-32602-too-small-iceberg-total-amount`;if(e.data?.reason===`quote expiry can't exceed block rfq lifetime`)return`-32602-expires_at_exceeds_expiration_time`;if(r===11030&&(e?.message.includes(`invalid_reduce_only_order`)||e?.message.includes(`invalid_reduce_only_direction`)))return`11030-invalid_reduce_only_order`;if(r===11030&&e.message.includes(`show_too_small`))return`11030-show_too_small`;if(r===11030&&e.message.includes(`invalid_show_to_total_ratio`))return`11030-invalid_show_to_total_ratio`;if(r===11030&&e.message.includes(`forbidden_by_risk_profile`))return`11030-forbidden_by_risk_profile`;if(r===11030&&e.message.includes(`reduce_only_due_to_anchor_breached`))return`11030-reduce_only_due_to_anchor_breached`;if(r===11030&&e.message.includes(`insufficient_margin`))return`11030-insufficient_margin`;if(r===-32602&&n===`private/execute_block_trade`&&e.data?.param===`timestamp`&&e.data.reason.includes(`provided value is in the past`))return`-32602-expired_block_trade_validity`;if(r===-32602&&n===`private/execute_block_trade`&&e.data.reason.includes(`provided own signature`))return`-32602-expired_block_trade_own_signature`;if(r===11050&&n===`private/execute_block_trade`&&e.data.includes(`already cancelled`))return`11050-block_trade_already_cancelled`;if(r===-32602&&n===`private/activate_security_key`&&e.data.param===`tfa_confirmation`)return`-32602-wrong_tfa_confirmation`;if(r===-32602&&n===`private/create_block_rfq`){if(e?.data?.reason===`at least one long leg required`)return`-32602-block_rfq_at_least_one_long_leg`;if(e?.data?.reason===`duplicate of existing block RFQ`)return`-32602-duplicated_block_rfqs`}if(r===13671&&n===`private/change_security_key_mode`)return`13671-you_cannot_switch_to_basic_mode`;if(r===13020&&(n===`public/cancel_security_keys_reset`||n===`public/confirm_security_keys_reset`))return`13020-invalid_code`;if(n===`private/set_email_for_subaccount`&&e.data===`email_wrong_format`)return`11043-subaccount-invalid-email`;if(n===`public/get_coupon_details`&&r===11050)return`11050-invalid-coupon-code`;if(n.includes(`security_key`)&&r===13012)return`13012-subaccount_without_login_ability`;if(n===`private/activate_security_key`&&r===13672)return`13672-invalid_activation_challenge`;if(r===11035&&e.message===`no_more_triggers`)return`11035-no_more_triggers`;if(r===13668&&e.data?.reason===`invalid_challenge`)return`13668-challenge_timeout`;if(r===13028&&e.data?.reason===`too_close_to_settlement`)return`13028-too_close_to_settlement`;if(r===13028&&e.data?.reason===`missing_verification_data`)return`13028-missing_verification_data`;if(r===13028&&e.data?.reason===`failed to cancel starbase orders`)return`13028-failed_to_cancel_starbase_orders`;if(r===10028&&n===`private/create_combo`&&e.message===`too_many_requests`)return`10028-create_combo_too_many_requests`;if(r===-32602&&[`private/buy`,`private/sell`].includes(n)&&e.data?.reason?.reason===`value too low`)return`-32602-private_buy_sell_value_too_low`;if(r===-32602&&[`private/buy`,`private/sell`].includes(n)&&e.data?.reason?.reason===`value too high`)return`-32602-private_buy_sell_value_too_high`;if(r===-32602&&[`private/buy`,`private/sell`].includes(n)&&e.data?.reason===`value too large`)return`-32602-private_buy_sell_value_too_large`;if(r===-32602&&e.data?.reason===`must be a multiple of the minimum order size`)return`-32602-must_be_multiple_of_minimum_order_size`;if(r===11031&&e.message===`other_error account_locked`)return`11031-account_locked`;if(r===-32602&&e.data?.reason===`must conform to tick size`)return`-32602-must_conform_to_tick_size`;if(n===`private/set_mmp_config`&&r===-32e3)return`-32000-mmp_missing_params`;if(r===13021&&e.data?.reason===`unsatisfied margin model requirements`)return`13021-unsatisfied-margin-model-requirements`;if(r===13021&&n===`private/set_member`)return`13021-starbase_member`;if(r===-32602&&e.data?.reason===`duplicate of existing block RFQ`)return`-32602-duplicate_block_rfq`;if(n===`private/get_leg_prices`&&r===11050)return`11050-failed_to_calculate_leg_prices`;if((n===`private/add_block_rfq_quote`||n===`private/edit_block_rfq_quote`)&&r===11050){if(e?.data===`combo price too low`)return`11050-block_rfq_combo_price_too_low`;if(e?.data===`combo price too high`)return`11050-block_rfq_combo_price_too_high`}return n===`private/start_corporate_verification`&&r===11050&&e?.data===`bad request: company_cannot_be_onboarded_not_regulated_not_exempt`?`11050-company_cannot_be_onboarded_not_regulated_not_exempt`:r===13907&&n===`private/accept_block_rfq`&&e.message===`not_fully_filled`?`13907-block_rfq_not_fully_filled`:r===12007&&n===`private/remove_subaccount`&&e.data?.reason===`is linked to a voice broker`?`12007-is_linked_to_voice_broker`:r===12007&&n===`private/remove_subaccount`&&e.data?.reason===`has not zero equity`?`12007-has_not_zero_equity`:r===12007&&n===`private/remove_subaccount`&&e.data?.reason===`has pending deposits`?`12007-has_pending_deposits`:r===12007&&n===`private/remove_subaccount`&&e.data?.reason===`is owner of app`?`12007-is_owner_of_app`:r===12007&&n===`private/remove_subaccount`&&e.data?.reason===`has active block rfq`?`12007-has_active_block_rfq`:r===12007&&n===`private/remove_subaccount`&&e.data?.reason===`is part of block rfq allocation`?`12007-is_part_of_block_rfq_allocation`:(r===-32602||r===14024)&&(e.data?.reason===`not allowed for direct access users`||e.message===`not_allowed_for_direct_access_users`)?e.data?.param?`-32602-not_allowed_for_direct_access_users-with-param`:`-32602-not_allowed_for_direct_access_users`:r===-32602&&n===`private/change_margin_model`?`-32602-change_margin_model_not_allowed`:``}function getSpecificErrorMessage(e,t){return getSpecificErrors(t)[e]}function getErrorMessageFromDictionary(e){let t=getErrorsDictionary()[e.code]||(e.message?`Unknown error: ${e.message.replaceAll(`_`,` `)}`:`Unknown error`);switch(e.code){case 12998:t.includes(`{param}`)&&(t=t.replace(`{param}`,e.data.wait));break;case 12006:t.includes(`{param}`)&&(t=t.replace(`{param}`,formatSecondsToReadableTime(e.data.wait)));break;case 10005:{let n=e.data?.limit||e.message.split(` `)[1];t=R._({id:`commonScreen.error.10005`,values:{price:n}});break}case 10007:{let n=e.data?.limit||e.message.split(` `)[1];t=R._({id:`commonScreen.error.10007`,values:{price:n}});break}case 10043:if(t=R._({id:`commonScreen.error.10043`}),e.data){let{instrument_name:n,limit:r}=e.data;n&&r&&(t=R._({id:`commonScreen.error.10043extended`,values:{instrument_name:n,limit:r}}))}break;case 11013:{let n=e.data?.currency,r=e.data?.limit;t=R._({id:`commonScreen.error.11013`,values:{currency:n,limit:r}});break}case 11022:if(e.message===`max_spot_order_quantity`){let n=e.data?.currency,r=e.data?.limit;t=R._({id:`commonScreen.error.maxSpotOrderQuantity`,values:{currency:n,limit:r}})}else{let n=e.message.split(` `)[1];t=R._({id:`commonScreen.error.11022`,values:{maxAmount:n}})}break;case 10057:{let[n,r,i]=e.message.split(` `);n===`future_position_size_in_base_currency`&&r&&i&&(t=R._({id:`commonScreen.error.maximumFuturePositionSizeExceeded`,values:{maxAmount:r,instrumentName:i}}));break}case 11031:e.message.includes(`orderbook_disabled`)&&(t=R._({id:`commonScreen.error.11031`}));break;case 13022:e.message.includes(`withdrawals_disabled`)&&(t=R._({id:`commonScreen.error.13022`}));break;case 13901:t=R._({id:`commonScreen.error.13901`,values:{0:e.data?.count}});break;case 11050:typeof e.data==`string`&&(t=_u(e.data)),e.data===`linked orders with incremental trigger fill condition can't be edited`&&(t=R._({id:`commonScreen.error.11050.noIncrementalOTOEditing`}));break;case 13908:e.message===`too_many_open_block_rfqs`&&(t=R._({id:`tradeScreen.blockRfq.tooManyOpenRfqs`}));break;case 13917:if(e.message===`account_quote_limit_crossed`){let n=e.data?.currency_pair,r=n?Is(n):void 0,[i,o]=n?.split(`-`)||[],s=e.data?.kind,c=e.data?.max_amount,p=e.data?.max_spread?e.data.max_spread/100:void 0,m=(s===pr.future&&o===`USD`?o:i).toUpperCase();t=R._({id:`commonScreen.error.13917-account_quote_limit_crossed`,values:{formattedCurrencyPair:r,kind:s}}),c&&(t+=R._({id:`commonScreen.error.13917-account_quote_limit_crossed-max_amount`,values:{maxAmount:c,maxAmountCurrency:m}})),p&&(t+=R._({id:`commonScreen.error.13917-account_quote_limit_crossed-max_spread`,values:{maxSpreadPercentage:p}})),!c&&!p&&(t=R._({id:`commonScreen.error.13917-account_quote_limit_crossed-quote_disabled`,values:{formattedCurrencyPair:r,kind:s}}))}break;case 10039:let n=e.data?.currency;e.message===`not_enough_funds_in_currency`&&n&&(t=R._({id:`commonScreen.error.10039`,values:{currency:n}}))}return t}function getConnectionsParams(e){let t=e.apiHost,n=e.publicHost??e.apiHost,r=e.publicHostFallback,i=e.publicStreamPath??`/ws/api/v2`,o=e.publicStreamPathFallback??`/ws/api/v2`,s=e.historyHost??e.apiHost,c=e.forceInsecureProtocols?`ws://`:`wss://`,p=e.forceInsecureProtocols?`http://`:`https://`;return{main:{restEndpoint:`${p}${t}/api/v2`,wsEndpoint:`${c}${t}/ws/api/v2`},public:{restEndpoint:``,wsEndpoint:`${c}${n}${i}`,wsFallbackEndpoint:r?`${c}${r}${o}`:void 0},history:{restEndpoint:`${p}${s}/api/v2`,wsEndpoint:``}}}function addType(e){return Object.entries(e).reduce((e,[t,n])=>{let r=t;return e[r]={...n,type:r},e},{})}function useConnectionsDetails(e){let t=Ti(),{env:n}=Oi(),r=(0,$.useMemo)(()=>un(async()=>{let r=getConnectionsParams(e),i=r;if(!e.isLocalInstance)try{i=await t.fetchConnectionsParams(e),e.publicHost&&(i.public.wsEndpoint=r.public.wsEndpoint),e.publicHostFallback&&(i.public.wsFallbackEndpoint=r.public.wsFallbackEndpoint),(e.historyHost||n.isTest)&&(i.history.restEndpoint=r.history.restEndpoint)}catch(e){console.log(`cannot fetch connection params - used predefined ones, `,e)}return addType(i)}),[e,n,t]);return(0,$.useCallback)(async e=>(setTimeout(()=>r.cache.clear?.(),200),(await r())[e]),[r])}var dO=[3299,463205,44209,251417,88475,253060,260317],useInitApiConnection=({config:e,notify:t,sessionsManager:n})=>{let[r,i]=(0,$.useState)({initialized:!1,serverStatus:200,requestsOverLimit:!1,connectionFailed:!1}),o=Ti(),s=Pn();useStarbaseOpenOrdersPolling();let c=B(ji),p=B(Bi),m=(0,$.useRef)(c),h=(0,$.useRef)(p),g=useConnectionsDetails(e.deribitClient),{deribitHistoryClient:_,userSettingsService:v}=Ru(),{featureToggles:y,env:b,platformConfig:x}=Oi(),{isSpotEnabled:S,isBlockTradeApprovalEnabled:C}=y,{isTest:w}=b,T=Yu(async()=>{let e=(await g(`history`)).restEndpoint;_.init(e)}),E=(0,$.useRef)(!1),D=(0,$.useRef)({}),O=(0,$.useRef)({}),k=(0,$.useMemo)(()=>Li(()=>{let e=Object.values(D.current),t=Object.values(O.current);s(nd.updateOrders(e)),s(nd.updatePositions(t)),D.current={},O.current={}},500),[s]),ee=(0,$.useCallback)(e=>{let t=ju(e);return t.archived?!1:w?!0:!t.hidden},[w]),te=Yu(e=>w||!e.is_cbe_routed||e.instrument_name!==`SOL_ETH`?!0:dO.includes(p)),A=(0,$.useCallback)(async(e=ee)=>(await o.fetchInstruments({currency:`any`,include_spots:S?!0:void 0})).filter(t=>(w||t.is_active||t.kind.includes(`combo`))&&(e(t.base_currency)||e(t.quote_currency))&&x.isInstrumentEnabled(t.instrument_name)&&te(t)),[o,ee,S,x,te,w]),j=(0,$.useCallback)(async(e=ee)=>{let[t,n]=await Promise.all([o.getCurrencies(),o.getIndexPriceNames({extended:!0})]),{indexPriceNames:r,comboIndexNames:i}=n.reduce((e,{name:t,option_combo_creation_enabled:n,future_combo_creation_enabled:r})=>{let i=t;return e.indexPriceNames.push(i),r&&e.comboIndexNames.futures.push(i),n&&e.comboIndexNames.options.push(i),e},{indexPriceNames:[],comboIndexNames:{futures:[],options:[]}}),s=t.filter(({currency:t})=>e(t)),c=await A(e);return E.current=!0,{allCurrencies:t,currencies:s,instruments:c,indexPriceNames:r,comboIndexNames:i}},[o,A,ee]),ne=(0,$.useCallback)(async()=>{try{let e=await A();s(sC.updateInstrumentsList(e))}catch(e){console.log(`error in fetchAndUpdateInstrumentsList`,e)}},[s,A]);return(0,$.useEffect)(()=>{E.current&&ne()},[ne,p]),(0,$.useEffect)(()=>{let r=ei(ne,500),updateInstruments=({data:e})=>
1034{if(e){let{instrument_name:t,state:n}=e;Tf(n)?s(sC.removeInstrument(t)):n===`open`&&r(),Ki.isComboInstrument(t)&&(Tf(n)?s(sC.removeComboDetails(t)):n===`open`&&x.isInstrumentEnabled(t)&&s(addComboDetails(t)))}},updateUserData=({data:e})=>{e.orders.forEach(e=>{D.current[e.order_id]=e}),e.positions.forEach(e=>{O.current[e.instrument_name]=e}),k()},onConnect=async({country:e})=>{s(sC.setConnectionState(!0)),i(e=>({...e,serverStatus:200,requestsOverLimit:!1,connectionFailed:!1}));try{e&&s(nd.setCountryCode(e));let t=await j();s(sC.setInventory(t)),s(initAllCombos(e=>x.isInstrumentEnabled(e.id))),o.subscribe(`instrument.state.any.any`,updateInstruments)}catch(e){console.log(e)}},onDisconnect=async(e,t)=>{t===`over_limit`&&i(e=>({...e,requestsOverLimit:!0})),s(sC.setConnectionState(!1));try{let e=await o.getServerStatus();T();let t=e.status;t&&i(e=>({...e,serverStatus:t})),i(e=>({...e,connectionFailed:!1}))}catch(e){console.log(e)}},onAnonymous=()=>{i(e=>({...e,initialized:!0}))},updateMarginBuffer=({data:e})=>{s(nd.updateMarginBuffer(e))},updatePositionLocked=({data:e})=>{s(nd.updateIsPositionLocked(e.locked))},updateUserLock=({data:e})=>{s(xd.prepareUserLockedData(e))},updateWalletType=({data:e})=>{s(nd.setWalletType(e))},updateMmpTriggered=({data:e})=>{s(nd.addMmpTrigger(e))},updatePortfolio=({data:e})=>{s(nd.updatePortfolio(e))},updatePendingBlockTrades=({data:e})=>{s(nd.updatePendingBlockTrades(e))},updateBrokerTradeRequests=({data:e})=>{s(nd.updateBrokerTradeRequests(e))},updateBlockRfqs=async({data:e})=>{s(nd.updateBlockRfqs(e))},updateBlockRfqQuotes=async({data:e})=>{s(nd.updateBlockRfqQuotes(e))},handleCommonErrorMessage=({message:e,response:n})=>{let r=n.error,i=getSpecificErrorCodeIfExist(r,e);i?t({isError:!0,message:getSpecificErrorMessage(i,r)}):isErrorEnabled(r,e.method)&&t({isError:!0,message:getErrorMessageFromDictionary(r)})},onLogin=async()=>{await s(initializeUserData()),await s(Bu.fetchUserSettings()),ye({id:String(h.current)}),o.subscribe(`user.changes.any.any.100ms`,updateUserData),o.subscribe(`user.portfolio.any`,updatePortfolio),e.isMarginBufferEnabled&&o.subscribe(`user.account_balance_review`,updateMarginBuffer),o.subscribe(`user.position_lock`,updatePositionLocked),o.subscribe(`user.lock`,updateUserLock),o.subscribe(`user.wallet_type`,updateWalletType),o.subscribe(`user.mmp_trigger.any`,updateMmpTriggered),C&&o.subscribe(`block_trade_confirmations`,updatePendingBlockTrades),o.subscribe(`broker.trade_requests.any`,updateBrokerTradeRequests),o.subscribe(`block_rfq.maker.any`,updateBlockRfqs),o.subscribe(`block_rfq.taker.any`,updateBlockRfqs),o.subscribe(`block_rfq.maker.quotes.any`,updateBlockRfqQuotes),i(e=>({...e,initialized:!0}))},onLoginToSubaccount=()=>{window.location.reload()},onLogout=async e=>{s(nd.clearUserData()),s(Ku.clearSettingsData()),e===`logout`?window.location.assign(`/`):e&&window.location.reload()},c=ei(()=>{onLogout(),Zu.open({type:Mu.login}),t({isError:!0,message:R._({id:`commonScreen.common.scopesOfTheAccountHaveBeenChanged`})})},100),onRequestError=async({message:e,response:t})=>{let n=t.error;n.code===13004&&n.data?.invalid===`scope_or_secret`?m.current&&c():handleCommonErrorMessage({message:e,response:t})},connectDeribit=async()=>{try{o.init({getConnectionDetails:g,callbacks:{onConnect,onDisconnect,onRequestError,onLogin,onLoginToSubaccount,onLogout,onAnonymous},plugins:{sessionsManager:n},clientDetails:{client_name:`Deribit Frontend`,client_version:`deribit-web-v${e.deribitClient.clientVersion||`unknown`}`,extensions:[`subscriptions`,`connection_close_on_session_drop`]},skipRestoreSession:Object.values(Tn).some(e=>window.location.pathname.startsWith(e))}),T(),await o.connect()}catch(e){console.log(`useInitApiConnection, connect() error: `,e),i(e=>({...e,serverStatus:503,connectionFailed:!0}))}};connectDeribit()},[s,o,e.deribitClient,e.isMarginBufferEnabled,t,n,g,T,v,S,C,k,j,A,ne]),(0,$.useEffect)(()=>{m.current=c},[c]),(0,$.useEffect)(()=>{h.current=p},[p]),(0,$.useEffect)(()=>{(async()=>{if(!w&&[3299].includes(p)){let currencyFilter=e=>[3299].includes(p)?!ju(e).archived:ee(e),e=await j(currencyFilter);s(sC.setInventory(e))}})()},[s,j,ee,w,p]),r},ProfileIdentifier=()=>{let{analyticsService:e}=Ru(),t=B(Bi),n=qd(),r=B(Rr);return(0,$.useEffect)(()=>{t&&e.identifyProfile(t.toString())},[t,e]),(0,$.useEffect)(()=>{let n=r.find(e=>e.id===t)?.type;n&&e.setProfileProperties({type:n})},[t,r,e]),(0,$.useEffect)(()=>{let t=n?.type?{accountType:n.type}:void 0;t&&e.setProfileProperties(t)},[e,n?.type]),(0,$.useEffect)(()=>{let t=r.find(e=>e.type===`main`)?.id;t&&e.setMainAccountId(t.toString())},[e,r]),null},buildConsentState=(e,t=`granted`)=>e.reduce((e,n)=>({...e,[n]:t}),{}),grantConsentForGoogleAnalytics=e=>{window.gtag?.(`consent`,`update`,buildConsentState(e,`granted`)),window.dataLayer?.push({event:`consent_update`})},revokeConsentForGoogleAnalytics=e=>{window.gtag?.(`consent`,`update`,buildConsentState(e,`denied`)),window.dataLayer?.push({event:`consent_update`})},getCookieConfig=e=>[{isMandatory:!0,name:R._({id:`commonScreen.cookies.categories.strict.title`}),description:R._({id:`commonScreen.cookies.categories.strict.description`}),cookiesInfo:[{name:`_cfuvid`,description:R._({id:`commonScreen.cookies.categories.strict._cfuvid`}),cookieType:`cookie`,expiry:R._({id:`commonScreen.cookies.expiry.session`}),domain:`.deribit.com`,is3rdParty:!0},{name:`cf_clearance`,description:R._({id:`commonScreen.cookies.categories.strict.cf_clearance`}),cookieType:`cookie`,expiry:R._({id:`commonScreen.cookies.expiry.year`,values:{0:1}}),domain:`www.deribit.com`,is3rdParty:!0},{name:`cid`,description:R._({id:`commonScreen.cookies.categories.strict.cid`}),cookieType:`cookie`,expiry:R._({id:`commonScreen.cookies.expiry.year`,values:{0:1}}),domain:`www.deribit.com`},{name:`cookieConsent`,description:R._({id:`commonScreen.cookies.categories.strict.cookieConsent`}),cookieType:`local-storage`,expiry:R._({id:`commonScreen.cookies.expiry.persistent`}),domain:`www.deribit.com`},{name:`cookieConsentScopes`,description:R._({id:`commonScreen.cookies.categories.strict.cookieConsentScopes`}),cookieType:`local-storage`,expiry:R._({id:`commonScreen.cookies.expiry.persistent`}),domain:`www.deribit.com`},{name:`userSettings`,description:R._({id:`commonScreen.cookies.categories.strict.cookieSettings`}),cookieType:`local-storage`,expiry:R._({id:`commonScreen.cookies.expiry.persistent`}),domain:`www.deribit.com`},{name:`<integrationId>.appUserId`,description:R._({id:`commonScreen.cookies.categories.strict.appUserId`}),expiry:R._({id:`commonScreen.cookies.expiry.persistent`}),domain:`www.deribit.com`,is3rdParty:!0,cookieType:`local-storage`},{name:`<integrationId>.clientId`,description:R._({id:`commonScreen.cookies.categories.strict.clientId`}),expiry:R._({id:`commonScreen.cookies.expiry.persistent`}),domain:`www.deribit.com`,is3rdParty:!0,cookieType:`local-storage`},{name:`<integrationId>.sessionToken`,description:R._({id:`commonScreen.cookies.categories.strict.sessionToken`}),expiry:R._({id:`commonScreen.cookies.expiry.persistent`}),domain:`www.deribit.com`,is3rdParty:!0,cookieType:`local-storage`},{name:`<integrationId>.conversationStartedAt`,description:R._({id:`commonScreen.cookies.categories.strict.conversationStartedAt`}),expiry:R._({id:`commonScreen.cookies.expiry.persistent`}),domain:`www.deribit.com`,is3rdParty:!0,cookieType:`local-storage`},{name:`ZD-widgetOpen`,description:R._({id:`commonScreen.cookies.categories.strict.ZD-widgetOpen`}),expiry:R._({id:`commonScreen.cookies.expiry.persistent`}),domain:`www.deribit.com`,is3rdParty:!0,cookieType:`session-storage`}]},{name:R._({id:`commonScreen.cookies.categories.statistics.title`}),description:R._({id:`commonScreen.cookies.categories.statistics.description`}),scopeName:`allowStatistics`,onConsentGiven:()=>{grantConsentForGoogleAnalytics([`analytics_storage`]),e.optInTracking()},onConsentRevoked:()=>{revokeConsentForGoogleAnalytics([`analytics_storage`]),e.optOutTracking()},cookiesInfo:[{name:`_ga*`,description:R._({id:`commonScreen.cookies.categories.statistics._ga`}),cookieType:`cookie`,expiry:R._({id:`commonScreen.cookies.expiry.year`,values:{0:2}}),domain:`www.deribit.com`,is3rdParty:!0},{name:`mp_*`,description:R._({id:`commonScreen.cookies.categories.statistics.mp`}),cookieType:`cookie`,expiry:R._({id:`commonScreen.cookies.expiry.year`,values:{0:1}}),domain:`www.deribit.com`,is3rdParty:!0},{name:`ZD-suid`,description:R._({id:`commonScreen.cookies.categories.statistics.ZD-su
1034id`}),expiry:R._({id:`commonScreen.cookies.expiry.minute`,values:{0:20}}),domain:`www.deribit.com`,is3rdParty:!0,cookieType:`local-storage`},{name:`ZD-buid`,description:R._({id:`commonScreen.cookies.categories.statistics.ZD-buid`}),expiry:R._({id:`commonScreen.cookies.expiry.persistent`}),domain:`www.deribit.com`,is3rdParty:!0,cookieType:`local-storage`}]},{name:R._({id:`commonScreen.cookies.categories.marketing.title`}),description:R._({id:`commonScreen.cookies.categories.marketing.description`}),scopeName:`allowMarketing`,onConsentGiven:()=>{grantConsentForGoogleAnalytics([`ad_user_data`,`ad_personalization`,`ad_storage`])},onConsentRevoked:()=>{revokeConsentForGoogleAnalytics([`ad_user_data`,`ad_personalization`,`ad_storage`])},cookiesInfo:[{name:`_gcl_au`,description:R._({id:`commonScreen.cookies.categories.marketing._gcl_au`}),cookieType:`cookie`,expiry:R._({id:`commonScreen.cookies.expiry.persistent`}),domain:`www.deribit.com`,is3rdParty:!0},{name:`guest_id*`,description:R._({id:`commonScreen.cookies.categories.marketing.guest_id`}),cookieType:`cookie`,expiry:R._({id:`commonScreen.cookies.expiry.year`,values:{0:2}}),domain:`.twitter.com`,is3rdParty:!0},{name:`muc_ads`,description:R._({id:`commonScreen.cookies.categories.marketing.muc_ads`}),cookieType:`cookie`,expiry:R._({id:`commonScreen.cookies.expiry.year`,values:{0:1}}),domain:`.t.co`,is3rdParty:!0},{name:`personalisation_id`,description:R._({id:`commonScreen.cookies.categories.marketing.personalisation_id`}),cookieType:`cookie`,expiry:R._({id:`commonScreen.cookies.expiry.year`,values:{0:1}}),domain:`.twitter.com`,is3rdParty:!0}]}];V();var fO=P(Md)(({theme:e})=>z`
1035    background-color: ${e.palette.mode===`dark`?e.palette.dsColors.darkGray[60]:e.palette.dsColors.lightGray[60]};
1036  `),pO=P(`div`)(()=>z``),mO=P(`div`)(({theme:e})=>z`
1037    display: flex;
1038    flex-direction: column;
1039    row-gap: ${e.spacing(1)};
1040    flex: 1;
1041  `),hO=P(`div`)(({theme:e})=>z`
1042    display: grid;
1043    align-items: center;
1044    column-gap: ${e.spacing(1.25)};
1045    grid-template-columns: auto 1fr min-content;
1046  `),gO=P(`div`)(({theme:e})=>z`
1047    padding: ${e.spacing(2)};
1048    background-color: ${e.palette.mode===`dark`?e.palette.dsColors.darkGray[40]:e.palette.dsColors.lightGray[20]};
1049    color: ${e.palette.mode===`dark`?e.palette.dsColors.lightGray[20]:e.palette.dsColors.darkGray[200]};
1050    border-radius: ${e.shape.borderRadius}px;
1051    display: flex;
1052    flex-direction: column;
1053  `),_O=P(`div`)(({theme:e})=>z`
1054    width: fit-content;
1055    border-radius: 9999px;
1056    display: flex;
1057    align-items: center;
1058    justify-content: center;
1059    font-size: ${e.typography.helperText.fontSize};
1060    flex-grow: 0;
1061    height: ${e.spacing(1.75)};
1062    padding: ${e.spacing(0,.75)};
1063
1064    background-color: ${e.palette.mode===`dark`?e.palette.dsColors.darkGray[10]:e.palette.dsColors.darkGray[40]};
1065  `),vO=P(jd)(({theme:e})=>z`
1066    flex-direction: row-reverse;
1067    align-items: start;
1068    column-gap: ${e.spacing(1)};
1069
1070    .MuiAccordionSummary-expandIconWrapper,
1071    .MuiAccordionSummary-content {
1072      margin-top: ${e.spacing(2)};
1073    }
1074  `),yO=P(Pd)(({theme:e})=>z`
1075    display: flex;
1076    flex-direction: column;
1077    row-gap: ${e.spacing(1)};
1078  `),bO=P(`div`)(({theme:e})=>z`
1079    margin-bottom: ${e.spacing(1)};
1080  `),xO=P(`ul`)(({theme:e})=>z`
1081    list-style: none;
1082    display: flex;
1083    padding: 0;
1084    margin: 0;
1085    margin-top: ${e.spacing(1)};
1086    gap: ${e.spacing(2)};
1087
1088    li {
1089      padding: 0;
1090      flex: 1;
1091    }
1092  `),getCookieTypeText=e=>{let t=``;switch(e.cookieType){case`cookie`:t=R._({id:`commonScreen.cookies.attributes.type.cookie`});break;case`local-storage`:t=R._({id:`commonScreen.cookies.attributes.type.localStorage`});break;case`session-storage`:t=R._({id:`commonScreen.cookies.attributes.type.sessionStorage`})}let n=e.is3rdParty?R._({id:`commonScreen.cookies.attributes.type.origin.thirdParty`}):R._({id:`commonScreen.cookies.attributes.type.origin.firstParty`});return`${t} (${n})`},CookieCategory=({config:e,onToggle:t,hasConsent:n})=>{let[r,i]=(0,$.useState)(!1),o=(0,X.jsx)(gd,{disabled:e.isMandatory,checked:e.isMandatory??n??!1,onChange:t});return(0,X.jsx)(pO,{children:(0,X.jsxs)(fO,{expanded:r,onChange:()=>i(e=>!e),children:[(0,X.jsx)(vO,{expandIcon:(0,X.jsx)(Ir,{name:`chevronDown`,fontSize:`small`}),children:(0,X.jsxs)(mO,{children:[(0,X.jsxs)(hO,{children:[(0,X.jsx)(L,{variant:`h6`,children:e.name}),(0,X.jsx)(_O,{children:e.cookiesInfo.length??0}),(0,X.jsx)(`div`,{onClick:e=>e.stopPropagation(),children:e.isMandatory?(0,X.jsx)(Mr,{body:R._({id:`commonScreen.cookies.errors.strictCookiesNoDisable`}),children:(0,X.jsx)(`div`,{children:o})}):o})]}),(0,X.jsx)(`div`,{children:(0,X.jsx)(L,{children:e.description})})]})}),(0,X.jsx)(yO,{children:e.cookiesInfo.map(e=>(0,X.jsxs)(gO,{children:[(0,X.jsx)(L,{fontWeight:`fontWeightBold`,children:e.name}),(0,X.jsx)(bO,{children:(0,X.jsx)(L,{children:e.description})}),(0,X.jsx)(oi,{}),(0,X.jsxs)(xO,{children:[(0,X.jsx)(`li`,{children:(0,X.jsxs)(L,{component:`span`,children:[(0,X.jsxs)(`b`,{children:[R._({id:`commonScreen.cookies.attributes.expiry`}),`:`,` `]}),e.expiry]})}),(0,X.jsxs)(`li`,{children:[(0,X.jsx)(L,{component:`span`,children:(0,X.jsxs)(`b`,{children:[R._({id:`commonScreen.cookies.attributes.type`}),`:`,` `]})}),(0,X.jsx)(L,{component:`span`,children:getCookieTypeText(e)}
1092)]}),(0,X.jsxs)(`li`,{children:[(0,X.jsx)(L,{component:`span`,children:(0,X.jsxs)(`b`,{children:[R._({id:`commonScreen.cookies.attributes.domain`}),`:`,` `]})}),(0,X.jsx)(L,{component:`span`,children:e.domain})]})]})]},e.name))})]})})},getCookieConsentState=async({appStorageService:e})=>({isGranted:await e.get({userId:null,key:`cookieConsent`}),scopes:await e.get({userId:null,key:`cookieConsentScopes`})}),acceptPartialCookies=({cookieConfig:e,appStorageService:t,cookieScopeState:n})=>{e.forEach(e=>{e.scopeName&&(n[e.scopeName]?e.onConsentGiven?.():e.onConsentRevoked?.())});let r=Object.keys(n).some(e=>!!n[e]);t.save({userId:null,key:`cookieConsent`,value:r}),t.save({userId:null,key:`cookieConsentScopes`,value:n})},acceptAllCookies=({cookieConfig:e,appStorageService:t})=>{acceptPartialCookies({cookieConfig:e,appStorageService:t,cookieScopeState:{allowMarketing:!0,allowStatistics:!0}})},rejectAllCookies=({cookieConfig:e,appStorageService:t})=>{acceptPartialCookies({cookieConfig:e,appStorageService:t,cookieScopeState:{allowMarketing:!1,allowStatistics:!1}})};V();var SO=P(`div`)(({theme:e})=>z`
1093    display: flex;
1094    flex-direction: column;
1095    flex-grow: 1;
1096    height: 100%;
1097    row-gap: ${e.spacing(3)};
1098  `),CO=P(`div`)(({theme:e})=>z`
1099    display: flex;
1100    flex-grow: 2;
1101    flex-direction: column;
1102    row-gap: ${e.spacing(3)};
1103    overflow-y: scroll;
1104  `),wO=P(`div`)(({theme:e})=>z`
1105    display: flex;
1106    flex-direction: column;
1107    row-gap: ${e.spacing(2)};
1108  `),TO=P(`div`)(({theme:e})=>z`
1109    display: grid;
1110    grid-template-columns: auto 1fr;
1111    gap: ${e.spacing(2)};
1112
1113    > div {
1114      column-gap: ${e.spacing(2)};
1115
1116      &:nth-of-type(2) {
1117        display: flex;
1118        justify-content: flex-end;
1119      }
1120    }
1121
1122    @media (max-width: 600px) {
1123      display: flex;
1124      flex-direction: column;
1125
1126      > div {
1127        display: flex;
1128        &:nth-of-type(2) {
1129          flex-direction: column-reverse;
1130          gap: ${e.spacing(2)};
1131        }
1132
1133        * {
1134          flex-grow: 1;
1135        }
1136      }
1137    }
1138  `),CookieConsentSettingsCenter=({onClose:e})=>{let{appStorageService:t,analyticsService:n}=Ru(),[r,i]=(0,$.useState)({}),o=(0,$.useMemo)(()=>getCookieConfig(n),[n]),s=(0,$.useCallback)(async()=>{let e=await getCookieConsentState({appStorageService:t}),n=!!e?.isGranted;i({allowMarketing:!!(e?.scopes?.allowMarketing??n),allowStatistics:!!(e?.scopes?.allowStatistics??n)})},[t]);(0,$.useEffect)(()=>{s()},[s]);let handleCookieConsentScopesChanged=e=>{Tr.emit(ti.COOKIES_CONSENT_SCOPES_CHANGED,e)},handleAcceptAll=()=>{acceptAllCookies({cookieConfig:o,appStorageService:t}),handleCookieConsentScopesChanged(r),e(`settingsSet`)},handleSavePreferences=()=>{acceptPartialCookies({cookieConfig:o,appStorageService:t,cookieScopeState:r}),handleCookieConsentScopesChanged(r),e(`settingsSet`)},handleRejectAll=()=>{rejectAllCookies({cookieConfig:o,appStorageService:t}),handleCookieConsentScopesChanged(r),e(`settingsSet`)};return(0,X.jsxs)(SO,{children:[(0,X.jsxs)(CO,{children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(L,{children:(0,X.jsx)(N,{id:`commonScreen.cookies.settings.description`})}),(0,X.jsx)(wc,{article:`cookie-notice`,newTab:!0,children:(0,X.jsx)(N,{id:`common.commonScreen.learnMore`})})]}),(0,X.jsx)(oi,{}),(0,X.jsx)(wO,{children:o.map(e=>(0,X.jsx)(CookieCategory,{config:e,hasConsent:e.scopeName?r[e.scopeName]??!1:!0,onToggle:()=>{e.scopeName&&i(t=>({...t,[e.scopeName]:!t[e.scopeName]}))}},e.name))})]}),(0,X.jsxs)(TO,{children:[(0,X.jsx)(`div`,{children:(0,X.jsx)(H,{variant:`filled`,"data-id":`allow-all`,onClick:handleAcceptAll,children:(0,X.jsx)(N,{id:`commonScreen.cookieConsent.actions.allow`})})}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(H,{variant:`gray`,"data-id":`reject-all`,onClick:handleRejectAll,children:(0,X.jsx)(N,{id:`commonScreen.cookieConsent.actions.reject`})}),(0,X.jsx)(H,{variant:`filled`,"data-id":`adjust-preferences`,onClick:handleSavePreferences,children:(0,X.jsx)(N,{id:`commonScreen.cookieConsent.actions.showSettings`})})]})]})]})},EO=`/assets/cookie-dark-BogeTx9N.svg`,DO=`/assets/cookie-light-DCFKKJMA.svg`;V();var OO=P(TC)(({theme:e})=>z`
1139    background-color: ${e.palette.mode===`dark`?e.palette.dsColors.darkGray[80]:e.palette.dsColors.lightGray[20]};
1140    background-image: unset;
1141    box-shadow: ${e.dsShadows.xLarge};
1142    display: flex;
1143    flex-direction: column;
1144    max-width: 500px;
1145    gap: ${e.spacing(3)};
1146    padding: ${e.spacing(3)};
1147
1148    & .MuiSnackbarContent-message {
1149      color: ${e.palette.mode===`dark`?e.palette.dsColors.lightGray[0]:e.palette.dsColors.darkGray[200]};
1150      padding: 0;
1151    }
1152
1153    & .MuiSnackbarContent-action {
1154      align-self: flex-end;
1155      margin: 0;
1156      padding: 0;
1157
1158      @media (max-width: 600px) {
1159        width: 100%;
1160      }
1161    }
1162  `),kO=P(`div`)(({theme:e})=>z`
1163    display: flex;
1164    flex-direction: row-reverse;
1165    gap: ${e.spacing(1)};
1166
1167    @media (max-width: 600px) {
1168      flex-direction: column;
1169      width: 100%;
1170    }
1171  `),AO=P(`div`)(({theme:e})=>({paddingTop:e.spacing(.5)})),jO=P(`div`)(({theme:e})=>z`
1172    display: flex;
1173    gap: ${e.spacing(2)};
1174  `),MO=P(`div`)(({theme:e})=>z`
1175    background: url(${e.palette.mode===`dark`?EO:DO}) -7px
1176      no-repeat;
1177    width: 64px;
1178    height: 64px;
1179    flex: 1 0 auto;
1180  `),NO=P(br)(({theme:e})=>z`
1181    width: 100%;
1182    max-width: 920px;
1183    overflow: hidden;
1184    display: flex;
1185    flex-direction: column;
1186    background-color: ${e.palette.mode===`dark`?e.palette.dsColors.darkGray[100]:e.palette.dsColors.lightGray[20]};
1187
1188    @media (max-width: 600px) {
1189      height: 70vh;
1190    }
1191  `),CookieConsent=()=>{let{appStorageService:e,analyticsService:t}=Ru(),n=B(ji),r=rr(),{hash:i}=St(),o=yt(),[s,c]=(0,$.useState)(!1),[p,m]=(0,$.useState)(!1),h=(0,$.useMemo)(()=>getCookieConfig(t),[t]);(0,$.useEffect)(()=>{i===`#privacySettings`&&m(!0)},[i]),(0,$.useEffect)(()=>{let getCookieConsent=async()=>{let t=await getCookieConsentState({appStorageService:e});
1191c(t?.isGranted===null),t?.isGranted&&acceptPartialCookies({cookieConfig:h,appStorageService:e,cookieScopeState:{allowMarketing:!!(t?.scopes?.allowMarketing??!0),allowStatistics:!!(t?.scopes?.allowStatistics??!0)}})};getCookieConsent()},[n,e,h]);let handleClose=t=>{let n={cookieConfig:h,appStorageService:e};t?acceptAllCookies(n):rejectAllCookies(n),c(!1)},handleAdjustPreferences=()=>{m(!0)},onPrivacyCenterClose=e=>{m(!1),o(`#`),e&&e===`settingsSet`&&c(!1)};return(0,X.jsxs)(Et,{theme:r,children:[(0,X.jsx)(NO,{open:p,onClose:()=>onPrivacyCenterClose(),title:R._({id:`commonScreen.cookies.settings.title`}),hasAction:!1,children:(0,X.jsx)(CookieConsentSettingsCenter,{onClose:onPrivacyCenterClose})}),(0,X.jsx)(kC,{open:s&&!p,children:(0,X.jsx)(OO,{action:(0,X.jsxs)(kO,{children:[(0,X.jsx)(H,{variant:`filled`,onClick:()=>handleClose(!0),children:R._({id:`commonScreen.cookieConsent.accept`})}),(0,X.jsx)(H,{variant:`filled`,onClick:handleAdjustPreferences,children:R._({id:`commonScreen.cookieConsent.check_settings`})}),(0,X.jsx)(H,{variant:`filled`,onClick:()=>handleClose(!1),children:R._({id:`commonScreen.cookieConsent.reject`})})]}),message:(0,X.jsxs)(jO,{children:[(0,X.jsx)(MO,{}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(L,{variant:`body2`,children:(0,X.jsx)(N,{id:`common.commonScreen.cookiesConsentMessage`})}),(0,X.jsx)(AO,{children:(0,X.jsx)(wc,{article:`cookie-notice`,newTab:!0,children:(0,X.jsx)(N,{id:`common.commonScreen.learnMore`})})})]})]})})})]})},PO=3e5,FO=`reload`,fetchAppVersion=async()=>{try{let e=window.location.pathname,t=await fetch(e,{method:`HEAD`,cache:`no-store`,credentials:`same-origin`});return t.ok&&(t.headers.get(`etag`)?.trim()||t.headers.get(`last-modified`)?.trim())||void 0}catch{return}},useAppForceUpdate=()=>{let[e,t]=(0,$.useState)(!1),n=(0,$.useRef)(!1),r=(0,$.useRef)(new BroadcastChannel(`deribit_app_new_version`));return(0,$.useEffect)(()=>{let e,updateAppVersion=async()=>{let n=await fetchAppVersion();e&&n&&e!==n&&t(!0),n&&(e=n)};updateAppVersion();let n=setInterval(updateAppVersion,PO);return()=>{clearInterval(n)}},[]),(0,$.useEffect)(()=>{let t=r.current,scheduleAppReload=t=>{t.data===FO&&e&&(n.current=!0)};return t.addEventListener(`message`,scheduleAppReload),()=>{t.removeEventListener(`message`,scheduleAppReload)}},[e]),(0,$.useEffect)(()=>{let onWindowFocus=()=>{n.current&&window.location.reload()};return document.addEventListener(`focus`,onWindowFocus),()=>{document.removeEventListener(`focus`,onWindowFocus)}},[]),{isNewVersionAvailable:e,reloadApp:(0,$.useCallback)(()=>{r.current.postMessage(FO),window.location.reload()},[])}},useAppForceUpdateTheme=()=>{let{mode:e,dsColors:t}=Dn().palette;return e===`dark`?{backgroundColor:t.darkGray[80],color:t.lightGray[0]}:{backgroundColor:t.lightGray[20],color:t.darkGray[100]}},IO=`/assets/announcement-dark-C6Qzui5u.svg`,LO=`/assets/announcement-light-BHMD_FyU.svg`;V();var RO=P(kC)(({theme:e})=>{let{backgroundColor:t,color:n}=useAppForceUpdateTheme();return z`
1192    .${Hr.root} {
1193      background-color: ${t};
1194      background-image: none;
1195      box-shadow: ${e.dsShadows.xLarge};
1196      color: ${n};
1197      gap: ${e.spacing(4)};
1198      padding: ${e.spacing(3)};
1199      width: 520px;
1200
1201      ${e.breakpoints.down(`sm`)} {
1202        width: auto;
1203      }
1204    }
1205
1206    .${vC.message} {
1207      flex: 1;
1208      padding: 0;
1209    }
1210
1211    .${vC.action} {
1212      margin: 0;
1213      padding: 0;
1214    }
1215  `}),zO=P(`div`)(({theme:e})=>z`
1216    align-items: center;
1217    display: flex;
1218    gap: ${e.spacing(2)};
1219  `),BO=P(`div`)(({theme:e})=>z`
1220    background: url(${e.palette.mode===`dark`?IO:LO})
1221      no-repeat;
1222    flex: 1 0 auto;
1223    width: 64px;
1224    height: 64px;
1225  `),VO=P(H)(({theme:e})=>z`
1226    padding-left: ${e.spacing(2.5)} !important;
1227    padding-right: ${e.spacing(2.5)} !important;
1228  `),AppForceUpdate=()=>{let e=rr(),{isNewVersionAvailable:t,reloadApp:n}=useAppForceUpdate();return(0,X.jsx)(Et,{theme:e,children:(0,X.jsx)(RO,{open:t,action:(0,X.jsx)(VO,{variant:`filled`,onClick:n,size:`sm`,children:R._({id:`commonScreen.appForceUpdate.refresh`})}),message:(0,X.jsxs)(zO,{children:[(0,X.jsx)(BO,{}),(0,X.jsx)(L,{variant:`body2`,children:(0,X.jsx)(N,{id:`common.appForceUpdate.newVersionAvailable`})})]})})})},useBeforeUnload=e=>{(0,$.useEffect)(()=>{let eventListener=t=>{if(e(t),t.defaultPrevented)return t.returnValue=``};return window.addEventListener(`beforeunload`,eventListener),()=>{window.removeEventListener(`beforeunload`,eventListener)}},[e])},HO=li(),notesSelector=e=>e.notes.notes,notesFetchStatusSelector=e=>e.notes.fetchStatus,notesSaveStatusSelector=e=>e.notes.saveStatus,notesSaveErrorSelector=e=>e.notes.saveError,notesErrorSelector=e=>e.notes.error,activeNoteIdSelector=e=>e.notes.activeNoteId,getNoteId=(e,t)=>t,UO=(0,HO.createCachedSelector)(notesSelector,getNoteId,(e,t)=>e?.[t])((e,t)=>t);function useNotesManager(){let e=Pn(),t=B(Bi),n=B(notesSelector),r=wu(n),i=B(notesFetchStatusSelector),o=B(notesSaveStatusSelector),s=(0,$.useRef)(o),c=B(notesSaveErrorSelector),p=B(notesErrorSelector);(0,$.useEffect)(()=>{s.current=o},[o]),useBeforeUnload((0,$.useCallback)(e=>{s.current===`saving`&&e.preventDefault()},[]));let m=(0,$.useCallback)(()=>{t&&e(VC.fetchNotes({userId:t}))},[e,t]),h=(0,$.useCallback)((n,{force:r=!1}={})=>{t&&e(VC.saveNotes({userId:t,notes:n,force:r}))},[e,t]),g=(0,$.useMemo)(()=>ei(h,1e3),[h]);(0,$.useEffect)(()=>{i===`idle`&&m()},[m,i]),(0,$.useEffect)(()=>{!t||!n||!r||Du(n,r)||i!==`fetched`||g(n)},[g,n,r,i,t]),(0,$.useEffect)(()=>{p&&Oe(Error(`Notes: ${JSON.stringify(p,null,2)}`))},[p]);let resolveConflict=e=>{e===`remote`&&m(),e===`local`&&n&&h(n,{force:!0})};return{conflict:c?.reason===`conflict`?{...c.details,resolveConflict}:null}}Br();var WO=Hi(Ed)(()=>({"& .MuiDialogActions-root":{paddingTop:`20px`}}
1228)),GO=Hi(na)(({theme:{spacing:e}})=>({marginTop:e(1)})),NotesConflictDialog=({remoteNoteValue:e,onResolve:t})=>{let n=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Dd,{onClick:()=>t(`local`),children:(0,X.jsx)(N,{id:`commonScreen.notes.conflictDialog.keepLocalVersion`})}),(0,X.jsx)(Dd,{onClick:()=>t(`remote`),variant:`contained`,children:(0,X.jsx)(N,{id:`commonScreen.notes.conflictDialog.useRemoteVersion`})})]});return(0,X.jsxs)(WO,{title:R._({id:`commonScreen.notes.conflictDialog.title`}),actions:n,suppressCloseIconButton:!0,disableBackdropClick:!0,open:!0,children:[(0,X.jsx)(L,{children:(0,X.jsx)(N,{id:`commonScreen.notes.conflictDialog.description`})}),(0,X.jsx)(GO,{htmlFor:`note-conflict-remote-version`,children:(0,X.jsx)(L,{variant:`subtitle1`,children:(0,X.jsx)(N,{id:`commonScreen.notes.conflictDialog.remoteVersion`})})}),(0,X.jsx)(qn,{id:`note-conflict-remote-version`,value:e,inputProps:{readOnly:!0},maxRows:5,multiline:!0,fullWidth:!0})]})},NotesManager=()=>{let{conflict:e}=useNotesManager();if(!e)return null;let{remoteNoteValue:t,resolveConflict:n}=e;return(0,X.jsx)(NotesConflictDialog,{remoteNoteValue:t,onResolve:n})};V();var KO=P(tr(L,{variant:`body3`}))(({theme:e})=>z`
1229    color: ${e.palette.mode===`dark`?e.palette.dsColors.lightGray[20]:e.palette.dsColors.darkGray[100]};
1230  `),qO=P(KO,ai([`direction`]))(({theme:e,direction:t})=>z`
1231    color: ${t===`buy`?e.palette.dsColors.success[200]:e.palette.dsColors.error[200]};
1232  `),JO=P(`div`)`
1233  display: flex;
1234  flex-direction: column;
1235`,getDirectionCell=({direction:e,role:t})=>{if(t===`taker`){let t=e===`sell`?`buy`:`sell`;return(0,X.jsx)(qO,{direction:t,children:_u(t)})}return(0,X.jsx)(qO,{direction:e,children:_u(e)})},getColumnDefs=(e,t)=>{let n={headerName:R._({id:`commonScreen.common.side`}),colId:`side`,type:`numericColumn`,getContent:({direction:e})=>getDirectionCell({direction:e,role:t})};return[{headerName:R._({id:`commonScreen.common.instrument`}),colId:`instrument_name`,getContent:({instrument_name:n,direction:r})=>e?(0,X.jsxs)(JO,{children:[getDirectionCell({direction:r,role:t}),(0,X.jsx)(KO,{children:n})]}):(0,X.jsx)(KO,{children:n})},...e?[]:[n],{headerName:R._({id:`commonScreen.common.quantity`}),colId:`quantity`,type:`numericColumn`,getContent:({instrument_name:e,amount:t})=>{let{sizeDecimals:n}=ui(e);return(0,X.jsx)(KO,{children:sa(t,n)})}},{headerName:R._({id:`commonScreen.common.price`}),colId:`price`,type:`numericColumn`,getContent:({price:e,instrument_name:t})=>{let n=Ki.getInstrumentData(t)?.quote_currency,{priceDecimals:r}=ui(t,{isBlockTrade:!0}),i=sa(e,r),o=n===`USD`?`$${i}`:`${i} ${n??``}`;return(0,X.jsx)(KO,{children:o})}}]},getNetDelta=({instrumentName:e,delta:t,markPrice:n})=>{let{isLinear:r,isFuture:i}=Ki.splitInstrument(e)||{};return!r&&!i?Kn(t,n):t},computeGreeks=({ticker:e,amount:t})=>{if(!e.greeks)return null;let n=e.greeks.delta??0,r=getNetDelta({instrumentName:e.instrument_name,delta:n,markPrice:e.mark_price});return{delta:yn(n,t),netDelta:yn(r,t),gamma:yn(e.greeks.gamma??0,t),rho:yn(e.greeks.rho??0,t),theta:yn(e.greeks.theta??0,t),vega:yn(e.greeks.vega??0,t)}},convertGreeksToNotional=({greeks:e,indexPrice:t,quoteCurrencyIndex:n=1})=>{let r=yn(t,.01);return{delta:yn(e.delta??0,yn(t,n)),netDelta:e.netDelta==null?void 0:yn(e.netDelta,yn(t,n)),gamma:yn(yn(yn(e.gamma??0,.5),yn(r,r)),n),rho:yn(e.rho??0,n),theta:yn(e.theta??0,n),vega:yn(e.vega??0,n)}},getComboConfig=e=>{let t=e&&dr[e];if(!t)return null;let n=t.instrumentsConfig;return n.main.reduce((e,t,r)=>{let i=Math.floor(r/2);return r%2==0?e.push([t]):e[i].push(t,n.types[i],n.amountCoef[i]),e},[]).map(([e,t,n,r])=>({expiration:e,strike:t,kind:n,amountCoef:r}))},getComboInstrumentsList=(e,t,n)=>e.reduce((e,r)=>{let i=n.find(e=>e.includes(t[r.expiration]||``)&&e.includes(String(t[r.strike]))&&e.slice(-1)===r.kind);if(i){let n={instrumentName:i,amountCoef:r.amountCoef};t.comboSize&&(n.size=t.comboSize*r.amountCoef),t.comboDirection&&(n.direction=t.comboDirection),t.comboPrice&&(n.price=0),e.push(n)}return e},[]),getBlockTradeNetDelta=(e,t)=>e.reduce((e,n)=>{let r=n.instrument_name,i=fd({instrument:r}),o=i?Od(r,+n.amount):+n.amount,s=n.direction===`buy`?o:-o,c=t[r]?.mark_price,p=t[r]?.greeks?.delta;return c&&(p===void 0?i||(e+=Xt(s,c)):e+=yn(s,getNetDelta({instrumentName:r,delta:p,markPrice:c}))),e},0),getBlockTradeNetDeltaCounterparty=(e,t)=>e.reduce((e,n)=>{let r=n.instrument_name,i=fd({instrument:r}),o=i?Od(r,+n.amount):+n.amount,s=n.direction===`buy`?-o:o,c=t[r]?.mark_price,p=t[r]?.greeks?.delta;return c&&(p===void 0?i||(e+=Xt(s,c)):e+=yn(s,getNetDelta({instrumentName:r,delta:p,markPrice:c}))),e},0),BlockTradeApprovalNetDelta=({trades:e,role:t})=>{let n=(0,$.useMemo)(()=>e.map(e=>e.instrument_name),[e]),r=O(n),i=t===`taker`?getBlockTradeNetDeltaCounterparty(e,r):getBlockTradeNetDelta(e,r);
1235return(0,X.jsx)(L,{variant:`subtitle1`,children:sa(i,4)})};V();var YO=P(`div`)(({theme:e})=>z`
1236    display: flex;
1237    flex-direction: column;
1238    gap: ${e.spacing(1)};
1239    margin-bottom: -${e.spacing(1)};
1240  `),XO=P(L)(({theme:e})=>z`
1241    color: ${e.palette.mode===`dark`?e.palette.dsColors.lightGray[100]:e.palette.dsColors.darkGray[80]};
1242  `),ZO=P(`div`)(({theme:e})=>z`
1243    display: flex;
1244    align-items: center;
1245    gap: ${e.spacing(2)};
1246
1247    > * {
1248      flex-grow: 1;
1249    }
1250  `),BlockTradesApprovalBottomSection=({trade:e,onApprove:t,onReject:n})=>{let{expires_at:r}=e,{remainingTime:i,formattedRemainingTime:o}=Qd(r);return(0,X.jsx)(YO,{children:i>0?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(XO,{variant:`body1`,children:(0,X.jsx)(N,{values:{formattedRemainingTime:o},id:`tradeScreen.blockTradeApproval.modal.expiration`})}),(0,X.jsxs)(ZO,{children:[(0,X.jsx)(H,{size:`sm`,variant:`gray`,onClick:()=>n(e),children:(0,X.jsx)(N,{id:`commonScreen.common.reject`})}),(0,X.jsx)(H,{size:`sm`,variant:`filled`,onClick:()=>t(e),children:(0,X.jsx)(N,{id:`commonScreen.common.approve`})})]})]}):(0,X.jsx)(Tp,{severity:`error`,children:(0,X.jsx)(N,{id:`tradeScreen.blockTradeApproval.modal.tradeExpired`})})})};V();var QO=P(`div`)(({theme:e})=>z`
1251    display: flex;
1252    flex-direction: column;
1253    gap: ${e.spacing(3)};
1254    margin-top: ${e.spacing(1)};
1255    min-width: 472px;
1256  `),$O=P(`div`,ai([`isMobile`]))(({theme:e,isMobile:t})=>z`
1257    display: grid;
1258    ${t?`grid-template-rows`:`grid-template-columns`}: repeat(3, min-content 1px) min-content;
1259    gap: ${e.spacing(t?1:2)};
1260  `),ek=P(`div`)(()=>z`
1261    display: flex;
1262    flex-direction: column;
1263  `),tk=P(L)(({theme:e})=>z`
1264    color: ${e.palette.mode===`dark`?e.palette.dsColors.lightGray[200]:e.palette.dsColors.darkGray[80]};
1265    white-space: nowrap;
1266  `),nk=P(`div`)(({theme:e})=>{let t=e.palette.mode===`dark`?e.palette.dsColors.darkGray[10]:e.palette.dsColors.lightGray[200];return z`
1267    border-left: 1px solid ${t};
1268    border-bottom: 1px solid ${t};
1269  `}),rk=P(Zn)(({theme:e})=>z`
1270    background: transparent;
1271    .${ln.head} {
1272      font-weight: 400;
1273      background: transparent;
1274    }
1275    .${lr.head} {
1276      background: transparent !important;
1277
1278      th {
1279        color: ${e.palette.mode===`dark`?e.palette.dsColors.lightGray[200]:e.palette.dsColors.darkGray[60]};
1280      }
1281    }
1282
1283    .${lr.root}:nth-of-type(odd) {
1284      background: ${e.palette.mode===`dark`?e.palette.dsColors.darkGray[60]:e.palette.dsColors.lightGray[80]};
1285    }
1286    .${lr.root}:nth-of-type(even) {
1287      background: ${e.palette.mode===`dark`?`transparent`:e.palette.dsColors.lightGray[80]};
1288    }
1289  `),BlockTradeApprovalDialogContent=({trade:e,onApprove:t,onReject:n})=>{let r=Gt(),i=B(Bi),{trades:o,app_name:s,username:c,user_id:p,role:m}=e,h=(0,$.useMemo)(()=>getColumnDefs(r,m),[r,m]);return(0,X.jsxs)(QO,{children:[(0,X.jsxs)($O,{isMobile:r,children:[s&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(ek,{children:[(0,X.jsx)(tk,{variant:`body1`,children:(0,X.jsx)(N,{id:`tradeScreen.blockTradeApproval.modal.tradeInitiatedBy`})}),(0,X.jsx)(L,{variant:`subtitle1`,children:s})]}),(0,X.jsx)(nk,{})]}),i!==p&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(ek,{children:[(0,X.jsx)(tk,{variant:`body1`,children:(0,X.jsx)(N,{id:`tradeScreen.blockTradeApproval.modal.subaccountName`})}),(0,X.jsx)(L,{variant:`subtitle1`,children:c})]}),(0,X.jsx)(nk,{})]}),(0,X.jsxs)(ek,{children:[(0,X.jsx)(tk,{variant:`body1`,children:(0,X.jsx)(N,{id:`tradeScreen.blockTradeApproval.modal.userRole`})}),(0,X.jsx)(L,{variant:`subtitle1`,children:m.toUpperCase()})]}),(0,X.jsx)(nk,{}),(0,X.jsxs)(ek,{children:[(0,X.jsx)(tk,{variant:`body1`,children:(0,X.jsx)(N,{id:`commonScreen.common.netDelta`})}),(0,X.jsx)(BlockTradeApprovalNetDelta,{trades:o,role:m})]})]}),(0,X.jsx)(rk,{columns:h,data:o}),(0,X.jsx)(BlockTradesApprovalBottomSection,{trade:e,onApprove:t,onReject:n})]})};V();var ik=P(br,ai([`isMobile`]))(({theme:e,isMobile:t})=>z`
1290    width: ${t?`90%`:`auto`};
1291    background: ${e.palette.mode===`dark`?e.palette.dsColors.darkGray[80]:e.palette.dsColors.lightGray[0]};
1292  `),ak=P(`div`)`
1293  display: flex;
1294  justify-content: space-between;
1295  align-items: flex-start;
1296`,ok=P(`div`)`
1297  display: flex;
1298  align-items: center;
1299`,sk=P(Pi)(({theme:e})=>z`
1300    padding: ${e.spacing(.25,.25)};
1301    margin-right: ${e.spacing(1)};
1302  `),BlockTradeApprovalDialogTitle=({numberOfTrades:e,selectedIndex:t,onIndexChange:n})=>(0,X.jsxs)(ak,{children:[(0,X.jsxs)(L,{variant:`h5`,children:[(0,X.jsx)(N,{id:`tradeScreen.blockTradeApproval.modal.title`}),e>1&&` (${t+1}/${e})`]}),e>1&&(0,X.jsxs)(ok,{children:[(0,X.jsx)(sk,{disabled:t===0,onClick:()=>n(t-1),children:(0,X.jsx)(MC,{})}),(0,X.jsx)(sk,{disabled:t===e-1,onClick:()=>n(t+1),children:(0,X.jsx)(NC,{})})]})]}),BlockTradeApprovalDialog=({open:e,pendingBlockTrades:t,onClose:n,initialIndex:r})=>{let i=Ti(),o=Gt(),[s,c]=(0,$.useState)(r||0);(0,$.useEffect)(()=>{s>=t.length&&c(t.length-1)},[s,t]);let onReject=async({role:e,timestamp:t,nonce:n})=>{try{await i.rejectPendingBlockTrade({role:e,timestamp:t,nonce:n}),c(0)}catch(e){console.error(e)}},onApprove=async({role:e,timestamp:t,nonce:n})=>{try{await i.approvePendingBlockTrade({role:e,timestamp:t,nonce:n}),c(0)}catch(e){dd(e)&&Y.notify({isError:!0,message:getErrorMessageFromDictionary(e)}),console.error(e)}};return(0,X.jsx)(ik,{open:e,hasAction:!1,hasCloseButton:!0,hasTitleDivider:!1,actionRequired:!1,isMobile:o,onClose:n,title:(0,X.jsx)(BlockTradeApprovalDialogTitle,{numberOfTrades:t.length,selectedIndex:s,onIndexChange:c}),children:(0,X.jsx)(BlockTradeApprovalDialogContent,{trade:s<t.length?t[s]:t[t.length-1],onReject,onApprove})})},ck=mi($.memo(BlockTradeApprovalDialog)),lk=e(()=>({rejected:R._({id:`notification.pendingBlockTrade.rejected`}),counterpartyRejected:R._({id:`notification.pendingBlockTrade.counterpartyRejected`}),approved:R._({id:`notification.pendingBlockTrade.approved`}),counterpartyApproved:R._({id:`notification.pendingBlockTrade.counterpartyApproved`})}),`getMessages`);function getTradesStates(e){return e.reduce((e,t)=>
1302{let n=Ud(t);return e[n]={state:t.state.value,counterparty_state:t.counterparty_state?.value},e},{})}function getChanges(e,t){if(t.state!==`initial`&&t.state!==e.state)return{user:!0,state:t.state};if(t.counterparty_state&&t.counterparty_state!==`initial`&&t.counterparty_state!==e.counterparty_state)return{user:!1,state:t.counterparty_state}}function useBlockTradeNotifications(e){let t=(0,$.useRef)(getTradesStates(e));(0,$.useEffect)(()=>{let n=getTradesStates(e);Object.entries(n).forEach(([e,n])=>{if(!t.current[e])return;let r=getChanges(t.current[e],n);if(!r)return;let i=lk();switch(r.state){case`approved`:return Y.notify({message:r.user?i.approved:i.counterpartyApproved});case`rejected`:return Y.notify({isError:!0,message:r.user?i.rejected:i.counterpartyRejected})}}),t.current=n},[e])}function BlockTradeApproval(){let e=B(en),t=B(Fn);useBlockTradeNotifications(e);let n=(0,$.useMemo)(()=>e.filter(e=>sd(e)&&Xd(e)),[e]),r=(0,$.useRef)(null),[i,o]=(0,$.useState)(!1),[s,c]=(0,$.useState)(),closeDialog=()=>{o(!1),c(void 0)};return(0,$.useEffect)(()=>{let e=n.length>(r.current??0);if(r.current=n.length,!e)return;let i=n.findIndex(e=>sd(e)&&Xd(e));!t?.includes(`block_trade_approval`)&&i>-1&&(o(!0),c(i))},[t,n]),(0,$.useEffect)(()=>{let openDialog=e=>{c(e),o(!0)};return Tr.on(ti.OPEN_BLOCK_TRADE_APPROVAL_DIALOG,openDialog),()=>{Tr.off(ti.OPEN_BLOCK_TRADE_APPROVAL_DIALOG,openDialog)}},[]),!n.length||!i?null:(0,X.jsx)(ck,{open:!0,pendingBlockTrades:n,initialIndex:s,onClose:closeDialog})}var useMissingInfoDepositCurrencies=()=>{let e=Ti(),[t,n]=(0,$.useState)([]);return(0,$.useEffect)(()=>{let fetchCurrenciesWithMissingDeposit=async()=>{try{let t=await e.getMissingInfoDepositsCurrencies();n(t)}catch(e){console.log(e)}};fetchCurrenciesWithMissingDeposit()},[e]),t},uk=`/assets/dark-CmOHcDHX.svg`,dk=`/assets/light-DaHEU7YT.svg`;V();var getGradient=(e,t)=>{switch(e){case`warning`:return t?`linear-gradient(84deg, rgba(76, 61, 0, 0.50) 30.72%, rgba(255, 204, 0, 0.20) 101.77%)`:`linear-gradient(84deg, rgba(255, 235, 153, 0.5) 30.72%, rgba(229, 184, 0, 0.2) 101.77%)`;case`error`:return t?`linear-gradient(180deg, rgba(245, 54, 97, 0.2) 0.85%, rgba(245, 54, 97, 0) 53.17%)`:`linear-gradient(180deg, rgba(225, 44, 97, 0.2) 0.85%, rgba(225, 44, 97, 0) 53.17%)`;default:return`initial`}},fk=P(br,ai([`isMobile`,`modalGradient`]))(({theme:e,isMobile:t,modalGradient:n=`none`})=>z`
1303    max-width: ${t?`90%`:`450px`};
1304    width: ${t?`100%`:`auto`};
1305    overflow: hidden;
1306
1307    background: ${n===`none`?``:`${getGradient(n,e.palette.mode===`dark`)}, `}
1308      ${e.palette.mode===`dark`?e.palette.dsColors.darkGray[80]:e.palette.dsColors.lightGray[0]};
1309
1310    > div:nth-of-type(2) {
1311      height: 100%;
1312      overflow: hidden;
1313      flex: 1;
1314      padding: 0;
1315      display: flex;
1316      flex-direction: column;
1317    }
1318  `),pk=P(`div`)(({theme:e})=>z`
1319    display: inline-block;
1320    background: url(${e.palette.mode===`dark`?dk:uk});
1321    background-position: center;
1322    background-size: contain;
1323    width: 64px;
1324    height: 64px;
1325    margin-bottom: ${e.spacing(2)};
1326  `),mk=P(`div`)(({theme:e})=>z`
1327    text-align: center;
1328    font-size: 0;
1329    height: 100%;
1330    overflow: scroll;
1331    padding: 0 ${e.spacing(4)};
1332  `),hk=P(I)(({theme:e})=>z`
1333    display: flex;
1334    justify-content: center;
1335    flex-direction: row;
1336    gap: ${e.spacing(1.5)};
1337    height: fit-content;
1338    padding: 0 ${e.spacing(2)} ${e.spacing(2)} ${e.spacing(2)};
1339  `);V();var gk=P(`div`)(({theme:e})=>z`
1340    display: flex;
1341    flex-direction: column;
1342    gap: ${e.spacing(.5)};
1343  `),_k=tr(L,{variant:`h5`}),vk={open:!1,type:`kycRefresh`},AccountActionAlert=()=>{let e=Gt(),t=yt(),{pathname:n}=St(),r=hu(),[i,o]=(0,$.useState)(!1),s=B(Ci)===`main`,c=B(Yt),{interfaceSettings:p}=td(),m=Rd(),{needsToAccept:h}=Up(),g=useMissingInfoDepositCurrencies(),{getCurrent:_}=useLegalDocumentInfo(),v=_(`panama`,`general_terms`),y=Ti(),b=ht(si.accountVerification,{currency:r}),x=ht(si.accountLegal,{currency:r}),S=[b,x,`/statistics`,`/kb`,`/redirect`,`/tfa_setup`,`/oauth`,`/verification_error`,`/residence_verification_error`,`/app_authorization`,`/coupon`,`/confirm_secondary_email`,`/close_account`,`/action`,`/reset_password`],[C,w]=(0,$.useState)(vk),onReset=()=>{w(vk)},onNavigate=e=>{t(e),onReset()},T=S.some(e=>
1343n.startsWith(e)),E=m?.status===`pending`&&m?.ic_refresh&&!m.ic_refresh.completed_on&&!m.ic_refresh.decision,D=!c&&s&&m?.status===`pending`&&m.kyc_refresh?.started_at&&!m.kyc_refresh.completed_on,O=!c&&s&&!T&&E,k=s&&!T&&h(`dubai`,`general_terms`)&&!p.disableDeribitFZEMigrationPopup,ee=!T&&![si.accountWallet,si.accountDeposit,si.accountWithdraw].some(e=>mt(e,n))&&g.length>0,te=!c&&s&&!!m?.ic_refresh&&m?.ic_refresh?.completed_on!==void 0&&m.ic_refresh.decision===`retail_investor_and_panama_migration`&&m.ic_refresh.consent===`needed`,A=m?.status===void 0,j=(0,$.useRef)(!1);if((0,$.useEffect)(()=>{if(A||j.current)return;let e=null;te?e=`icRefreshForcedMigration`:O?e=`icRefresh`:D?e=`kycRefresh`:k?e=`legalDocs`:ee&&(e=`missingDeposit`),e&&(w({open:!0,type:e}),j.current=!0)},[k,A,ee,O,te,D]),!C.type)return null;let onSwitchToSpotOnly=()=>{Zu.open({type:Mu.confirm,contentProps:{onCancel:()=>{Zu.close()},onConfirm:()=>{y.setConsent({value:!1,action:`investor_classification_refresh`}),onReset(),Zu.close()},dialogTitle:(0,X.jsxs)(I,{display:`flex`,flexDirection:`row`,gap:1,alignItems:`center`,children:[(0,X.jsx)(Ir,{name:`verificationFailed`}),(0,X.jsx)(L,{variant:`h6`,children:(0,X.jsx)(N,{id:`accountScreen.verification.icRefresh.consent.popup.switch.title`})})]}),confirmLabel:R._({id:`accountScreen.verification.icRefresh.consent.popup.switch`}),cancelLabel:R._({id:`common.commonScreen.cancel`}),content:(0,X.jsx)(L,{children:(0,X.jsx)(N,{components:{0:(0,X.jsx)(`br`,{}),1:(0,X.jsx)(`br`,{})},id:`accountScreen.verification.icRefresh.consent.switchToSpotOnly.description`})})}})},{gradient:ne,image:M,title:re,content:ie,buttons:ae,canSkip:oe}={missingDeposit:{image:(0,X.jsx)(I,{display:`flex`,justifyContent:`center`,marginBottom:2,marginTop:4,children:(0,X.jsx)(aa,{name:`update-documents`,size:8})}),title:(0,X.jsx)(N,{id:`accountScreen.verification.missingDeposit.alert.title`}),content:(0,X.jsx)(I,{marginBottom:2,children:(0,X.jsx)(L,{children:(0,X.jsx)(N,{id:`accountScreen.verification.missingDeposit.alert`})})}),buttons:(0,X.jsxs)(I,{display:`flex`,gap:2,mt:2,children:[(0,X.jsx)(H,{variant:`gray`,onClick:onReset,children:(0,X.jsx)(N,{id:`commonScreen.common.skip`})}),(0,X.jsx)(H,{variant:`filled`,onClick:()=>onNavigate(g.length===1?ht(si.accountDeposit,{currency:g[0]}):ht(si.accountWallet,{currency:r})),children:(0,X.jsx)(N,{id:`accountScreen.verification.missingDeposit.alert.verify`})})]}),canSkip:!0},icRefresh:{image:(0,X.jsx)(pk,{}),title:(0,X.jsx)(N,{id:`accountScreen.verification.icRefresh.alert.title`}),content:(0,X.jsx)(L,{children:(0,X.jsx)(N,{id:`accountScreen.verification.icRefresh.alert`})}),buttons:(0,X.jsx)(I,{mt:2,children:(0,X.jsx)(H,{variant:`filled`,onClick:()=>onNavigate(b),children:(0,X.jsx)(N,{id:`accountScreen.verification.kycRefresh.alert.finish`})})}),canSkip:!1},kycRefresh:{image:(0,X.jsx)(pk,{}),content:(0,X.jsxs)(I,{children:[(0,X.jsx)(L,{mb:1.5,variant:`h4`,children:(0,X.jsx)(N,{id:`accountScreen.verification.kycRefresh.alert.title`})}),(0,X.jsx)(L,{mb:1,children:(0,X.jsx)(N,{id:`accountScreen.verification.kycRefresh.alert`})})]}),buttons:(0,X.jsx)(I,{mt:2,children:(0,X.jsx)(H,{variant:`filled`,onClick:()=>onNavigate(b),children:(0,X.jsx)(N,{id:`accountScreen.verification.kycRefresh.alert.verify`})})}),canSkip:!0},legalDocs:{image:(0,X.jsx)(pk,{}),title:(0,X.jsx)(N,{id:`accountScreen.legal.alert.title`}),content:(0,X.jsx)(L,{children:(0,X.jsx)(N,{id:`accountScreen.legal.dubai.alert`})}),buttons:(0,X.jsx)(I,{mt:2,children:(0,X.jsx)(H,{variant:`filled`,onClick:()=>onNavigate(x),children:(0,X.jsx)(N,{id:`accountScreen.legal.alert.review`})})}),canSkip:!1},icRefreshForcedMigration:{image:(0,X.jsx)(I,{display:`flex`,justifyContent:`center`,marginBottom:2,children:(0,X.jsx)(aa,{name:`globe-with-warning`,size:16})}),title:(0,X.jsx)(N,{id:`accountScreen.verification.icRefreshForcedMigration.alert.title`}),content:(0,X.jsx)(I,{textAlign:`left`,marginBottom:2,children:(0,X.jsx)(L,{children:(0,X.jsx)(N,{values:{0:v?.urls.pdf&&(0,X.jsx)(Wt,{to:v.urls.pdf,target:`_blank`,children:`here`})},components:{0:(0,X.jsx)(`br`,{}),1:(0,X.jsx)(`br`,{}),2:(0,X.jsx)(`br`,{}),3:(0,X.jsx)(`br`,{}),4:(0,X.jsx)(`br`,{}),5:(0,X.jsx)(`br`,{})},id:`accountScreen.verification.icRefreshForcedMigration.alert`})})}),buttons:(0,X.jsxs)(I,{width:`100%`,children:[(0,X.jsx)(oi,{}),(0,X.jsx)(I,{alignItems:`flex-start`,mt:2,ml:2,children:(0,X.jsx)(_C,{children:(0,X.jsx)(hp,{label:R._({id:`accountScreen.verification.icRefreshForcedMigration.alert.termsOfService`}),control:(0,X.jsx)(mp,{checked:i,onChange:()=>o(!i)})})})}),(0,X.jsxs)(I,{display:`flex`,gap:2,mt:2,children:[(0,X.jsx)(H,{fullWidth:!0,variant:`gray`,onClick:()=>{onSwitchToSpotOnly()},children:(0,X.jsx)(N,{id:`accountScreen.verification.icRefreshForcedMigration.alert.switchToSpot`})}),(0,X.jsx)(H,{fullWidth:!0,variant:`filled`,onClick:()=>{y.setConsent({value:!0,action:`investor_classification_refresh`}),onReset()},disabled:!i,children:(0,X.jsx)(N,{id:`accountScreen.verification.icRefreshForcedMigration.alert.accept`})})]})]}),gradient:`error`,canSkip:!0}}[C.type];return(0,X.jsxs)(fk,{modalGradient:ne,open:C.open,hasAction:!1,hasTitleDivider:!1,isMobile:e,onClose:oe?onReset:void 0,title:oe?(0,X.jsx)(L,{variant:`h5`,children:re}):void 0,hasCloseButton:oe,children:[(0,X.jsxs)(mk,{children:[M,(0,X.jsxs)(gk,{children:[!
1343oe&&(0,X.jsx)(_k,{children:re}),ie]})]}),(0,X.jsx)(hk,{children:ae})]})},yk=mi(AccountActionAlert);V();var bk=P(Ed)(()=>{let{palette:e}=rr(),t=e.mode===`dark`?`${e.dsColors.darkGray[80]}`:`inherit`;return z`
1344    .MuiPaper-root {
1345      border-radius: 16px;
1346    }
1347    .MuiDialogContent-root {
1348      background-color: ${t};
1349    }
1350    .MuiDialogTitle-root {
1351      background-color: ${t};
1352    }
1353  `});V();var xk=P(`div`)(({theme:e})=>z`
1354    color: ${e.palette.dsColors.error[200]};
1355    margin-top: ${e.spacing(1)};
1356  `),Sk=P(`div`)(({theme:e})=>{let{fontSize:t,lineHeight:n,fontWeight:r}=e.typography.subtitle1;return z`
1357    font-size: ${t};
1358    font-weight: ${r};
1359    line-height: ${n};
1360    padding: ${e.spacing(.5,0)};
1361  `}),Ck=P(`div`)(({theme:e})=>z`
1362    display: flex;
1363    gap: ${e.spacing(2)};
1364    flex-direction: column;
1365    width: 312px;
1366  `),wk=P(`div`)(({theme:e})=>z`
1367    display: flex;
1368    gap: ${e.spacing(1.5)};
1369    flex-direction: column;
1370  `),Tk=P(`div`)(({theme:e})=>z`
1371    display: flex;
1372    flex-wrap: wrap;
1373    gap: ${e.spacing(1)};
1374    padding-bottom: ${e.spacing(.5)};
1375  `),Ek=P(`div`)(({theme:e})=>{let{fontSize:t,lineHeight:n}=e.typography.helperText,{mode:r,dsColors:i}=e.palette;return z`
1376    display: flex;
1377    align-items: center;
1378    gap: ${e.spacing(.25)};
1379    font-size: ${t};
1380    line-height: ${n};
1381    color: ${r===`light`?i.darkGray[200]:i.primary[200]};
1382    border: 1px solid ${i.primary[200]};
1383    border-radius: ${e.shape.borderRadius}px;
1384    padding: ${e.spacing(.25,.5)};
1385  `}),Dk=P(Ir)(({theme:e})=>z`
1386    width: 12px;
1387    height: 12px;
1388    fill: ${e.palette.mode===`light`?e.palette.dsColors.darkGray[200]:e.palette.dsColors.lightGray[0]};
1389  `),SecurityKeyConfirmation=({onAccept:e,onError:t,securityKeyRequirement:n,authorizationError:r})=>{let i=(0,$.useRef)(null),o=n.security_keys.filter(e=>e.type===`tfa`),s=!!o.length,c=n.security_keys.filter(e=>e.type===`u2f`),p=!!c.length,onAcceptTfaClick=t=>{t.preventDefault(),e({challenge:n.challenge,authorization_data:i.current?.value||``})},usePasskey=async()=>{try{let t=Iu({challenge:n.challenge,rpId:n.rp_id,credential_ids:c.map(e=>e.credential_id)}),r=await navigator.credentials.get(t);if(r){let t=Xu(r);e({challenge:n.challenge,authorization_data:t})}}catch(e){let n=R._({id:`loginScreen.loginForm.yubiKeyError`});Y.notify({message:n,isError:!0}),t(e)}},m=``;if(r)switch(r.code){case 13668:m=R._({id:`commonScreen.securityKeyConfirmation.error.invalidTfaCode`});break;case 12998:m=R._({id:`commonScreen.securityKeyConfirmation.error.tooManyTfaAttempts`,values:{0:r.data.wait}})}return(0,X.jsxs)(Ck,{children:[p&&(0,X.jsxs)(wk,{children:[(0,X.jsx)(Sk,{children:(0,X.jsx)(N,{id:`commonScreen.securityKeyConfirmation.useYourPasskey`})}),(0,X.jsx)(Tk,{children:c.map(({name:e})=>(0,X.jsxs)(Ek,{children:[(0,X.jsx)(Dk,{name:Si.key}),e]},e))}),(0,X.jsx)(H,{variant:`filled`,onClick:usePasskey,size:`md`,children:R._({id:`commonScreen.securityKeyConfirmation.confirmWithPasskey`})})]}),s&&p&&(0,X.jsx)(I,{width:`100%`,children:(0,X.jsx)(OrDivider,{})}),s&&(0,X.jsxs)(wk,{children:[(0,X.jsx)(Sk,{children:(0,X.jsx)(N,{id:`commonScreen.securityKeyConfirmation.pleaseProvide2faFromOneOfYourKeys`})}),(0,X.jsx)(Tk,{children:o.map(({name:e})=>(0,X.jsxs)(Ek,{children:[(0,X.jsx)(Dk,{name:Si.key}),e]},e))}),r&&(0,X.jsx)(xk,{children:m}),(0,X.jsx)(I,{marginBottom:p?0:.5,children:(0,X.jsx)(`form`,{onSubmit:onAcceptTfaClick,children:(0,X.jsx)(Mi,{id:`tfaCode`,inputRef:i,autoFocus:!0,autoComplete:`off`,inputProps:{maxLength:6},placeholder:R._({id:`commonScreen.securityKeyConfirmation.enter2faCode`})})})}),(0,X.jsx)(H,{variant:`filled`,onClick:onAcceptTfaClick,size:`md`,children:R._({id:`commonScreen.common.accept2fa`})})]})]})},SecurityKeyConfirmationModal=()=>{let[e,t]=(0,$.useState)(!1),[n,r]=(0,$.useState)(null),onClose=()=>{n?.onCancel(),o()},i=(0,$.useCallback)(e=>{r(e),t(!0)},[]),o=(0,$.useCallback)(()=>{t(!1),r(null)},[]);return(0,$.useEffect)(()=>(Tr.on(ti.OPEN_SECURITY_KEY_CONFIRMATION,i),Tr.on(ti.CLOSE_SECURITY_KEY_CONFIRMATION,o),()=>{Tr.off(ti.OPEN_SECURITY_KEY_CONFIRMATION,i),Tr.off(ti.CLOSE_SECURITY_KEY_CONFIRMATION,o)}),[i,o]),(0,X.jsx)(bk,{open:e,onClose,transitionDuration:0,disableBackdropClick:!0,title:(0,X.jsx)(L,{variant:`h5`,children:(0,X.jsx)(N,{id:`commonScreen.securityKeyConfirmation.title`})}),children:n&&(0,X.jsx)(SecurityKeyConfirmation,{...n})})},Ok=mi(SecurityKeyConfirmationModal),ToastContainer=()=>{let e=B(xu);return(0,X.jsx)(Sd,{className:`notifications_container`,position:e.notificationPosition??`top-right`,autoClose:4e3,hideProgressBar:!0,newestOnTop:!0,closeOnClick:!0,rtl:!1,pauseOnFocusLoss:!1,draggable:!1,pauseOnHover:!1,closeButton:!1,transition:hd({enter:`notiEnter`,exit:`notiExit`})})};ii();var allBlockRfqs=e=>e.user.blockRfq,blockRfqQuotes=e=>e.user.blockRfq.quotes,blockRfqIsMaker=e=>e.user.isBlockRfqMaker,blockRfqUserInfoSelector=e=>e.user.blockRfqUserInfo,kk=Nt(blockRfqUserInfoSelector,Bi,(e,t)=>({...e?.parent,...e?.users.find(e=>e.user_id===t)})),Ak=Nt(allBlockRfqs,(e,t)=>t,(e,t)=>e.open.block_rfqs.find(e=>e.block_rfq_id===t)),jk=(0,HO.createCachedSelector)(blockRfqQuotes,(e,t)=>t,(e,t)=>e[t]||[])((e,t)=>t),Mk=(0,HO.createCachedSelector)(allBlockRfqs,(e,t)=>t,e=>e.open.block_rfqs)((e,t)=>t),Nk=(0,HO.createCachedSelector)(Mk,(e,t,n)=>n,(e,t)=>[...e].sort((e,n)=>t===`oldestFirst`?e.expiration_timestamp-n.expiration_timestamp:n.expiration_timestamp-e.expiration_timestamp))((e,t,n)=>`${t}:${n}`),Pk=(0,HO.createCachedSelector)(Nk,(e,t,n,r)=>r,(e,t)=>t===`all`?e:e.filter(e=>e.legs.find(e=>e.instrument_name.includes(t))))((e,t,n,r)=>`${t}:${n}:${r}`),Fk=(0,HO.createCachedSelector)(Pk,(e,t,n,r,i)=>i,(e,t)=>t===`showAll`?e:e.filter(e=>t===`myRfqs`?e.role===`taker`:e.role!==`taker`))((e,t,n,r,i)=>`${t}:${n}:${r}:${i}
1389`),Ik=(0,HO.createCachedSelector)(Fk,(e,t,n,r,i,o)=>o,(e,t)=>t===`showAll`?e:e.filter(e=>e.state===`filled`&&(e.role===`taker`||e.role===`maker`&&e.trades?.some(e=>e.maker))))((e,t,n,r,i,o)=>`${t}:${n}:${r}:${i}:${o}`),Lk=(0,HO.createCachedSelector)(Ik,blockRfqQuotes,(e,t,n,r,i,o,s)=>s,(e,t,n)=>e.filter(e=>{let t=n.toLowerCase();return e.legs.find(e=>e.instrument_name.toLowerCase().includes(t))||e.state.toLowerCase().includes(t)}).map(e=>{if(t[e.block_rfq_id]){let getBidsAsks=n=>t[e.block_rfq_id].filter(e=>e.direction===n).map(e=>({...e,makers:[]})).sort((e,t)=>n===`buy`?t.price-e.price:e.price-t.price);return{...e,bids:getBidsAsks(`buy`),asks:getBidsAsks(`sell`),numberOfQuotes:t[e.block_rfq_id]?.length}}return e}))((e,t,n,r,i,o,s)=>`${t}:${n}:${r}:${i}:${o}:${s}`),getQuotesWithYieldValue=({quotes:e,hedge:t})=>{let n=t?Ki.getInstrumentData(t.instrument_name):null;return!t||!n?e:e?.map(e=>{let r=n.isPerpetual?Kn(t.price,e.price):sp(t.price,e.price,n.expiration_timestamp),i=ki(r,2,n.isPerpetual,!0),o=n?.isPerpetual?``:`%`;return{...e,yield:`${i}${o}`}})},useGetOpenBlockRFQData=(e,t,n)=>{let r=B(r=>Lk(r,`open`,n,e,`showAll`,`showAll`,t)),{blocks:i,transformedTickers:o}=ep(r);return{blockRfqs:i.map(e=>{let t=Vf(e.legs,e.hedge,e.amount);if(t)return{...e,bids:getQuotesWithYieldValue({quotes:e.bids,hedge:e.hedge}),asks:getQuotesWithYieldValue({quotes:e.asks,hedge:e.hedge}),isBasisTrade:t};let n=Ki.isLinearInstrument(e.hedge?.instrument_name??``)?e.greeks?.delta:e.greeks?.netDelta,r=o?.[e.hedge?.instrument_name??``]?.indexPrice,i=Kf({instrumentNames:e.legs.map(e=>e.instrument_name),hedgeAmount:e.hedge?.amount,hedgeDirection:e.hedge?.direction,hedgeLegInstrumentName:e.hedge?.instrument_name,hedgeIndexPrice:r,delta:n});return{...e,isBasisTrade:t,feeDiscount:i}})}},Rk={positionProportions:{x:.008,y:.85},isDialogExpanded:!0},useFloatingWidget=()=>{let e=Ti(),{analyticsService:t}=Ru(),{componentSettings:{positionProportions:n,isDialogExpanded:r},setComponentSettings:i}=Wp({componentId:zu.BlockRfq,initialState:Rk}),o=ne(),c=A(),p=s(),m=Fe(),h=Gt(),g=!!(o||c||p||m)&&!h,{setInterfaceSettings:_,interfaceSettings:v}=td(),[y,b]=(0,$.useState)(!1),x=v.disableShowCancelBlockRfqConfirmationDialog,toggleDisableCancelBlockRfqConfirmationDialog=()=>{_(e=>({...e,disableShowCancelBlockRfqConfirmationDialog:!e.disableShowCancelBlockRfqConfirmationDialog}))},S=v.disableShowCancelBlockRfqQuoteConfirmationDialog,toggleDisableCancelBlockRfqQuoteConfirmationDialog=()=>{_(e=>({...e,disableShowCancelBlockRfqQuoteConfirmationDialog:!e.disableShowCancelBlockRfqQuoteConfirmationDialog}))},C=!!B(Su)[zu.BlockRfq],[w,T]=(0,$.useState)(`newestFirst`),{blockRfqs:E}=useGetOpenBlockRFQData(`all`,``,w),D=(0,$.useCallback)(e=>i(t=>{let n=typeof e==`function`?e(t.positionProportions):e;return{...t,positionProportions:n}}),[i]),O=(0,$.useCallback)(()=>i(e=>({...e,isDialogExpanded:!e.isDialogExpanded})),[i]),k=(0,$.useCallback)(()=>T(e=>e===`newestFirst`?`oldestFirst`:`newestFirst`),[]),[ee,te]=(0,$.useState)(null),[j,M]=(0,$.useState)(!1),re=(0,$.useMemo)(()=>E.find(e=>e.block_rfq_id===ee),[E,ee]),ie=(0,$.useCallback)(e=>{te(e.block_rfq_id),M(!0)},[]);return{sortOrder:w,blockRfqs:E,isDialogVisible:g,isDialogExpanded:r,isFloatingWidgetActive:C,positionProportions:n,selectedBlockRfqData:re,selectedBlockRfqId:ee,reviewDialogOpen:j,cancelConfirmationOpen:y,onChangeSortOrderButtonClick:k,onExpandButtonClick:O,setPosition:D,handleCancel:(0,$.useCallback)(async n=>{if((n.role===`taker`&&!x||n.role===`maker`&&!S)&&!y){te(n.block_rfq_id),b(!0);return}n.role===`taker`?(await e.cancelBlockRfq({block_rfq_id:n.block_rfq_id}),t.trackEvent(`block_rfq_cancelled`)):(await e.cancelAllBlockRfqQuotes({block_rfq_id:n.block_rfq_id}),t.trackEvent(`block_rfq_maker_all_quotes_cancelled`)),b(!1)},[x,S,y,e,t]),handleReview:ie,toggleDisableCancelBlockRfqConfirmationDialog,toggleDisableCancelBlockRfqQuoteConfirmationDialog,onCloseReviewDialog:(0,$.useCallback)(()=>{te(null),M(!1)},[]),setCancelConfirmationOpen:b}};function BlockRfqNotifications(){let e=yt(),t=Ti(),n=B(Ln),{interfaceSettings:r}=td(),{disableSounds:i,suppressNotificationsForBlockRfqs:o}=r,s=Zd(),{isDialogVisible:c,isFloatingWidgetActive:p}=useFloatingWidget(),m=Yu(t=>{t.state===`open`&&(i||s(Vu.blockRfqNotification),(!c||!p)&&Y.notify({isInfo:!0,message:R._({id:`tradeScreen.blockRFQ.makerNotification`}),iconName:`blockRfq`,title:R._({id:`tradeScreen.blockRFQ.pendingRFQ`})},{autoClose:8e3,onClick:()=>e(jt.blockRfqs)}))});return(0,$.useEffect)(()=>{let handleNotificationForMaker=({data:e})=>{m(e)};if(n&&!o)return t.subscribe(`block_rfq.maker.any`,handleNotificationForMaker),()=>{t.unsubscribe(`block_rfq.maker.any`,handleNotificationForMaker)}},[t,m,n,o]),null}V();var zk=P(Fr,ai([`isDragging`]))(({isDragging:e})=>z`
1390    position: fixed;
1391    cursor: ${e?`grabbing`:`grab`};
1392    z-index: 1205;
1393    background-color: unset;
1394    pointer-events: auto;
1395  `),WindowAwareDraggableItem=({id:e,position:t,children:n,...r})=>{let{attributes:i,listeners:o,setNodeRef:s,transform:c,isDragging:p}=Wd({id:e}),m={transform:Bd.Translate.toString(c),top:t.y,left:t.x};return(0,X.jsx)(zk,{isDragging:p,ref:s,...i,...o,style:m,...r,children:n})};V();var Bk=P(`div`)(()=>z`
1396    position: fixed;
1397    width: 100vw;
1398    height: 100vh;
1399    z-index: 1205;
1400    pointer-events: auto;
1401  `),WindowAwareDraggableContainer=({children:e,position:t,componentId:n,setPosition:r})=>{let[i,o]=(0,$.useState)(!1),s=ff(Jd(Kd,{activationConstraint:{distance:10}}
1401)),{width:c,height:p}=wn(),{ref:m,width:h,height:g}=Vd(),_=(0,$.useCallback)((e,t,n,i)=>{r(r=>{let o=r.x*n,s=r.y*i,c=n-e,p=t+s>i?i-t:s,m=e>n?0:Math.max(0,Math.min(o,c)),h=Math.max(0,Math.min(p,i));return{x:m/n,y:h/i}})},[r]);(0,$.useEffect)(()=>{!h||!g||_(h,g,c,p)},[h,g,p,c,_]);let v=(0,$.useCallback)(e=>{o(!0)},[]),y=(0,$.useCallback)(e=>{o(!1),r(t=>({x:t.x+e.delta.x/c,y:t.y+e.delta.y/p}))},[p,c,r]),b=(0,$.useMemo)(()=>({x:c*t.x,y:p*t.y}),[t,p,c]),x=b&&(0,X.jsx)(WindowAwareDraggableItem,{position:b,id:n,children:(0,X.jsx)(`div`,{ref:m,children:e})});return(0,X.jsx)(af,{sensors:s,onDragStart:v,onDragEnd:y,modifiers:[zd],children:i?(0,X.jsx)(Bk,{children:x}):x})},getDialogContent=e=>({rfq:{title:R._({id:`tradeScreen.blockRFQ.cancelRFQ.title`}),heading:R._({id:`tradeScreen.blockRFQ.cancelRFQ.heading`}),body:(0,X.jsx)(N,{components:{0:(0,X.jsx)(`br`,{}),1:(0,X.jsx)(`br`,{})},id:`tradeScreen.blockRFQ.cancelRFQ.body`}),cancel:R._({id:`tradeScreen.blockRFQ.cancelRFQ.cancel`}),confirm:R._({id:`tradeScreen.blockRFQ.cancelRFQ.confirm`})},quote:{title:R._({id:`tradeScreen.blockRFQ.cancelOpenQuote.title`}),heading:R._({id:`tradeScreen.blockRFQ.cancelOpenQuote.heading`}),body:R._({id:`tradeScreen.blockRFQ.cancelOpenQuote.body`}),cancel:R._({id:`tradeScreen.blockRFQ.cancelOpenQuote.cancel`}),confirm:R._({id:`tradeScreen.blockRFQ.cancelOpenQuote.confirm`})},quoteList:{title:R._({id:`tradeScreen.blockRFQ.cancelOpenQuotes.title`}),heading:R._({id:`tradeScreen.blockRFQ.cancelOpenQuotes.heading`,values:{openQuotes:e}}),body:R._({id:`tradeScreen.blockRFQ.cancelOpenQuotes.body`}),cancel:R._({id:`tradeScreen.blockRFQ.cancelOpenQuotes.cancel`}),confirm:R._({id:`tradeScreen.blockRFQ.cancelOpenQuotes.confirm`})}}),ConfirmCancellationDialog=({variant:e,onConfirmClick:t,onClose:n,onDontShowAgainToggle:r,openQuotes:i})=>{let o=getDialogContent(i);return(0,X.jsxs)(mf,{isOpen:!0,onClose:n,width:e===`rfq`?472:532,height:e===`rfq`?292:262,children:[(0,X.jsx)(mf.Header,{title:o[e].title,withCloseButton:!0}),(0,X.jsxs)(I,{marginTop:4,display:`flex`,flexDirection:`column`,gap:1.5,children:[(0,X.jsx)(L,{variant:`h6`,children:o[e].heading}),(0,X.jsx)(L,{children:o[e].body})]}),(0,X.jsxs)(I,{marginTop:4,display:`flex`,alignItems:`center`,justifyContent:`space-between`,children:[(0,X.jsx)(hp,{control:(0,X.jsx)(mp,{onChange:e=>r(e.target.checked)}),label:(0,X.jsx)(N,{id:`tradeScreen.blockRFQ.confirmation.dontShowAgain`})}),(0,X.jsxs)(I,{display:`flex`,gap:1.5,flexShrink:0,whiteSpace:`nowrap`,children:[(0,X.jsx)(H,{onClick:n,variant:`gray`,children:o[e].cancel}),(0,X.jsx)(H,{onClick:t,variant:`filled`,color:`error`,children:o[e].confirm})]})]})]})},Vk=(0,$.createContext)(void 0);function useMakerRfqContext(){let e=(0,$.useContext)(Vk);if(!e)throw Error(`useMakerRfqContext must be used within MakerRfqContextProvider`);return e}function MakerRfqContextProvider({children:e,legs:t,amount:n,comboId:r}){let{componentSettings:{typeOfQuote:i,isAllOrNone:o,allQuotesExpanded:s,quoteTimerTimestamp:c,tradeDirection:p},setComponentSettings:m}=Wp({componentId:`blockRfqRespond`,initialState:{isAllOrNone:!1,typeOfQuote:`twoWay`,allQuotesExpanded:!0,quoteTimerTimestamp:null,tradeDirection:`buy`}}),[h,g]=(0,$.useState)(t),[_,v]=(0,$.useState)(n),[y,b]=(0,$.useState)(!1),[x,S]=(0,$.useState)(!1),[C,w]=(0,$.useState)(!1),[T,E]=(0,$.useState)(),[D,O]=(0,$.useState)(!1),k=(0,$.useRef)({buy:void 0,sell:void 0}),ee=jf({comboId:r,legs:t}),te=kf(),A=(0,$.useCallback)(e=>{m(t=>({...t,quoteTimerTimestamp:e}))},[m]),j=(0,$.useCallback)((e,t=`buy`)=>e===`bid`?i===`oneWay`&&p!==t:i===`oneWay`&&p===t,[p,i]),ne=(0,$.useCallback)(async(e,n)=>{e!==void 0&&k.current[n]!==e&&(k.current[n]=e,await te({price:e,legs:t.map(({instrument_name:e,direction:t,ratio:n})=>({instrument_name:e,direction:t,amount:n})),onSuccess:e=>{g(t=>t.map(t=>{let r=e.legs.find(e=>e.instrument_name===t.instrument_name)?.price;return{...t,[n]:r}}))},onFailed:()=>{g(e=>e.map(e=>({...e,[n]:void 0})))},onSettled:()=>{O(!1)}}))},[te,t]),M=(0,$.useMemo)(()=>ei(ne,1e3),[ne]),re=(0,$.useCallback)((e,t)=>{O(!0),M(e,t)},[M]),ie=(0,$.useCallback)(async(e,t)=>{M.cancel(),await ne(e,t)},[M,ne]),ae=(0,$.useCallback)(()=>{E(void 0),g(t),v(n),w(!1),k.current={buy:void 0,sell:void 0}},[n,t]),oe=(0,$.useMemo)(()=>({state:{typeOfQuote:i,tradeDirection:p,legsWithQuotes:h,amountValue:o?n:_,isAggregatedBidFocused:y,isAggregatedAskFocused:x,isAllOrNone:o,allQuotesExpanded:s,editedQuoteId:T,isValidationError:C,strategyName:ee,quoteTimerTimestamp:c,isLoadingLegPrices:D},action:{setLegsWithQuotes:g,isInputDisabled:j,setAmountValue:v,setIsAggregatedBidFocused:b,setIsAggregatedAskFocused:S,setLegPricesB
1401asedOnAggregatedPriceDebounced:re,setLegPricesBasedOnAggregatedPrice:ie,setEditedQuoteId:E,reset:ae,setIsValidationError:w,setQuoteTimerTimestamp:A,setComponentSettings:m}}),[i,p,h,o,n,_,y,x,T,C,ee,j,re,ie,ae,m,s,c,A,D]);return(0,X.jsx)(Vk.Provider,{value:oe,children:e})}V();var Hk=P(`div`,ai([`withGreeks`]))(({theme:e,withGreeks:t})=>z`
1402    margin-top: auto;
1403    padding: ${e.spacing(1.5,2)};
1404    ${t?`background-color: ${e.getColor({dark:`darkGray.80`,light:`lightGray.60`})}`:``};
1405    display: flex;
1406    flex-direction: column;
1407    gap: ${e.spacing(1.5)};
1408    border-radius: 8px;
1409    align-items: flex-end;
1410
1411    button {
1412      min-width: 79px;
1413      margin-right: auto;
1414      flex-wrap: nowrap;
1415    }
1416  `);function StrategyDetailsAndMakers({legs:e,amount:t,makers:n,onCancel:r,aggregatePrice:i,hedgeLeg:o,isBasisTrade:s,feeDiscount:c,comboId:p}){let m=B(pp),[h,g]=(0,$.useState)(!1),{isOption:_}=Ki.splitInstrument(e[0].instrument_name)||{};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Jf,{legs:e,amount:t,aggregatePrice:i,hedgeLeg:o,isBasisTrade:s,feeDiscount:c,withStrategyTitleLabel:!0,comboId:p}),(0,X.jsx)(Yf,{withMargin:!0}),n.length===0?(0,X.jsx)(Zf,{}):(0,X.jsx)(Rf,{titleAdornment:(0,X.jsx)(wf,{variant:`light`,size:`sm`,amount:n.length}),expanded:h,setExpanded:e=>g(!!e),title:R._({id:`tradeScreen.blockRFQ.makers.label`}),children:(0,X.jsx)(If,{makers:n})}),r&&(0,X.jsxs)(Hk,{withGreeks:!!_,children:[!!_&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(np,{legs:e,amount:t}),(0,X.jsx)(Yf,{})]}),(0,X.jsx)(Nd,{isDisabled:m?.write,children:(0,X.jsx)(H,{size:`xs`,variant:`filled`,color:`error`,onClick:r,disabled:!m?.write,children:R._({id:`tradeScreen.blockRFQ.listCard.cancelRFQ`})})})]})]})}V();var Uk=P(L,ai([`isLessThenMin`,`size`]))(({theme:e,isLessThenMin:t,size:n})=>z`
1417    color: var(
1418      --block-rfq-list-card-color,
1419      ${e.getColor({dark:t?`error.200`:`lightGray.0`,light:t?`error.100`:`darkGray.100`})}
1420    );
1421
1422    ${n===`md`?z`
1423          line-height: 36px;
1424          margin-bottom: ${e.spacing(.5)};
1425        `:``}
1426    > span:first-of-type {
1427      color: ${e.getColor({dark:`lightGray.200`,light:`darkGray.60`})};
1428    }
1429  `),Wk=P(`div`,ai([`inline`]))(({theme:e,inline:t})=>z`
1430    line-height: ${e.typography.body3.lineHeight};
1431    font-size: ${e.typography.body3.fontSize};
1432    font-weight: 600;
1433    color: ${e.getColor({dark:`lightGray.0`,light:`darkGray.100`})};
1434    margin-bottom: ${e.spacing(.5)};
1435
1436    ${t?z`
1437          display: flex;
1438          gap: 5px;
1439        `:``}
1440    > p {
1441      margin: 0px;
1442      text-align: center;
1443    }
1444  `);function TimeDisplay({timestamp:e,inline:t=!1,size:n=`md`,withUtcLabel:r,variant:i,...o}){let{remainingTime:s}=Qd(e),c=(0,BS.default)(e).utc(),p=6e4,{zerosInTimer:m,remainingTimeFormat:h}=function(){return s>36e5?{zerosInTimer:``,remainingTimeFormat:`HH:mm:ss`}:s>p?{zerosInTimer:`00:`,remainingTimeFormat:`mm:ss`}:{zerosInTimer:`00:00:`,remainingTimeFormat:`ss`}}();return i===`date`?(0,X.jsxs)(Wk,{inline:t,...o,children:[(0,X.jsxs)(`p`,{children:[c.format(`HH:mm:ss`),r?` UTC,`:`,`]}),(0,X.jsx)(`p`,{children:c.format(`D MMM YYYY`)})]}):(0,X.jsxs)(Uk,{isLessThenMin:s<p,size:n,variant:`h5`,...o,children:[(0,X.jsx)(`span`,{children:m}),(0,X.jsx)(`span`,{children:BS.default.duration(s).format(h)})]})}var TakerTradeConfirmationDialog=({blockRfqId:e,amount:t,bidPrice:n,askPrice:r,legs:i,hedge:o,isOpen:s,comboId:c,onClose:p,onConfirmClicked:m,onCancelClicked:h,onDontShowAgainToggle:g,isBasisTrade:_})=>{let v=B(t=>Ak(t,e)),y=Yu(Xf(()=>{m()}
1444));return(0,X.jsxs)(mf,{isOpen:s,onClose:p,onKeyDown:y,tabIndex:0,width:504,height:660,children:[(0,X.jsx)(mf.Header,{title:R._({id:`tradeScreen.blockRFQ.confirmTrade`}),id:e,withCloseButton:!0}),(0,X.jsxs)(tp,{children:[(0,X.jsx)(L,{children:(0,X.jsx)(N,{id:`tradeScreen.blockRFQ.confirmationDialog.areYouSure`})}),(0,X.jsx)(L,{children:(0,X.jsx)(N,{id:`tradeScreen.blockRFQ.confirmationDialog.warning`})})]}),(0,X.jsx)(zf,{takerName:v?.taker,allocations:v?.trade_allocations}),(0,X.jsx)(I,{paddingX:1,overflow:`auto`,maxHeight:280,children:(0,X.jsx)(lp,{amount:t,legs:i,hedgeLeg:o,bidPrice:n,askPrice:r,withStrategyTitleLabel:!0,comboId:c,isBasisTrade:_})}),(0,X.jsxs)(Wf,{children:[(0,X.jsx)(hp,{control:(0,X.jsx)(mp,{onChange:e=>g(e.target.checked)}),label:(0,X.jsx)(N,{id:`tradeScreen.blockRFQ.confirmation.dontShowAgain`})}),(0,X.jsxs)(cp,{children:[(0,X.jsx)(qf,{onClick:h,children:(0,X.jsx)(N,{id:`common.commonScreen.cancel`})}),(0,X.jsx)(qf,{color:`primary`,onClick:m,children:(0,X.jsx)(N,{id:`commonScreen.common.confirm`})})]})]})]})};V();var Gk=P(H)(({theme:e})=>z`
1445    :disabled {
1446      color: ${e.getColor({dark:`lightGray.0`,light:`darkGray.100`})};
1447    }
1448  `),Kk=P(Gk)(()=>z`
1449    background-color: transparent;
1450
1451    &:hover,
1452    &:disabled {
1453      background-color: transparent;
1454    }
1455  `);function PriceButtons({legs:e,price:t,bestBidQuote:n,bestAskQuote:r,markPrice:i,timeInForce:o,setPrice:s}){let c=o===`fill_or_kill`,onClick=e=>{s(e===`bid`?n?.price??0:r?.price??0)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Gk,{variant:`gray`,size:`sm`,color:t!==void 0&&n?.price!==void 0&&t<=n.price&&c?void 0:`success`,onClick:()=>onClick(`bid`),disabled:!n,children:n?Lf({legs:e,value:n.price}):`-`}),(0,X.jsx)(Kk,{disabled:i===void 0,variant:`gray`,size:`sm`,onClick:()=>s(i),children:i===void 0?`-`:Lf({legs:e,value:i})}),(0,X.jsx)(Gk,{variant:`gray`,size:`sm`,color:t!==void 0&&r?.price!==void 0&&t>=r.price&&c?void 0:`error`,onClick:()=>onClick(`ask`),disabled:!r,children:r?Lf({legs:e,value:r.price}):`-`})]})}var getTimeInForceOptions=()=>[{label:R._({id:`tradeScreen.blockRFQ.fok`}),value:`fill_or_kill`,dataId:`fokFilterBtn`},{label:R._({id:`commonScreen.common.trigger`}),value:`good_til_cancelled`,dataId:`triggerFilterBtn`}],qk=r((e=>{var t=qr();Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(Pt()),r=ft();e.default=(0,n.default)((0,r.jsx)(`path`,{d:`M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3m-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3m0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5m8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5`}),`People`)}));V();var Jk=n(qk()),Yk=P(`div`)(({theme:e})=>z`
1456    display: flex;
1457    align-items: center;
1458    padding: ${e.spacing(1/8,1)};
1459    gap: ${e.spacing(0,.25)};
1460    border-radius: 6px;
1461    cursor: default;
1462    color: ${e.palette.dsColors.lightGray[0]};
1463    background: ${e.palette.mode===`dark`?e.palette.dsColors.lightGray[300]:e.palette.dsColors.darkGray[20]};
1464  `),Xk=P(`div`)`
1465  display: flex;
1466  align-items: center;
1467  flex-direction: column;
1468`,Zk=P(Jk.default)`
1469  width: 14px;
1470  height: 14px;
1471`;function MakerNamesTooltip({makers:e,tooltipPlacement:t=`bottom`}){return(0,X.jsx)(Mr,{body:(0,X.jsx)(Xk,{children:e.map(e=>(0,X.jsx)(L,{variant:`body4`,children:e},e))}),placement:t,children:(0,X.jsxs)(Yk,{children:[(0,X.jsx)(L,{variant:`body4`,fontWeight:700,children:e.length}),(0,X.jsx)(Zk,{})]})})}var QuoteExpiryTimer=({quoteExpiry:e,className:t})=>{let{remainingTime:n,formattedRemainingTime:r}=Qd(e),{getColor:i}=Dn(),o=n<6e4,s=i(o?{default:`attention.200`}:{dark:`lightGray.80`,light:`darkGray.80`}),c=i(o?{default:`attention.20`}:{dark:`darkGray.20`,light:`lightGray.200`});return(0,X.jsx)(An,{label:r,icon:`timer`,color:s,backgroundColor:c,className:t})};V();var Qk=P(`div`)(({theme:e})=>z`
1472    display: grid;
1473    grid-template-columns: 1fr 1fr 1fr;
1474    gap: ${e.spacing(.5)};
1475    text-align: center;
1476    color: ${e.getColor({dark:`lightGray.200`,light:`darkGray.60`})};
1477    border-bottom: 1px solid ${e.getColor({default:`darkGray.10`})};
1478    padding-bottom: ${e.spacing(.5)};
1479    margin-bottom: ${e.spacing(2)};
1480  `),$k=P(`div`)(({theme:e})=>z`
1481    display: flex;
1482    justify-content: space-between;
1483    align-items: center;
1484    gap: ${e.spacing(1)};
1485  `),eA=P(FiltersBar)(({theme:e})=>z`
1486    align-self: center;
1487    padding: ${e.spacing(.5)};
1488
1489    .${Vn.root} {
1490      line-height: ${e.typography.body1.lineHeight};
1491      font-size: ${e.typography.body1.fontSize};
1492      padding: ${e.spacing(.5,1.5)};
1493      min-width: 72px;
1494    }
1495  `),tA=P(L,ai([`side`]))(({theme:e,side:t})=>z`
1496    color: ${e.getColor({default:t===`bid`?`success.200`:`error.200`})};
1497    font-weight: 600;
1498  `);function Makers({shouldShowMakerNames:e,bestQuote:t}){return(0,X.jsxs)(I,{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:1,width:`122px`,height:`22px`,children:[(0,X.jsxs)(L,{variant:`body4`,noWrap:!0,children:[e&&t?.makers?.length===1&&t.makers[0],e&&(t?.makers?.length??0)>1&&(0,X.jsx)(MakerNamesTooltip,{makers:t?.makers??[]}),!e||(t?.makers?.length??0)===0&&(0,X.jsxs)(I,{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:1,children:[(0,X.jsx)(N,{id:`tradeScreen.blockRFQ.makers.label`}),`:`,` `,t?.makers?.length||`-`]})]}),t?.expires_at&&(0,X.jsx)(QuoteExpiryTimer,{quoteExpiry:t.expires_at})]})}function PriceSelection({bestBidQuote:e,bestAskQuote:t,shouldShowMakerNames:n,markPrice:r,price:i,setPrice:o,legs:s,timeInForce:c,setTimeInForce:p,isBasisTrade:m,isError:h}){let{quote_currency:g}=Ki.splitInstrument(s[0].instrument_name),_=Math.min(...s.map(e=>Ki.getInstrumentData(e.instrument_name)?.block_trade_tick_size??1/0)),v=(0,$.useMemo)(()=>getTimeInForceOptions(),[]);return(0,X.jsx)(ip,{tooltip:`taker-dialog-select-quote`,children:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(Qk,{children:[(0,X.jsx)(L,{variant:`body4`,children:(0,X.jsx)(N,{id:`tradeScreen.blockTrade.bestBid`})}),(0,X.jsx)(L,{variant:`body4`,children:(0,X.jsx)(N,{id:`commonScreen.common.mark`})}),(0,X.jsx)(L,{variant:`body4`,children:(0,X.jsx)(N,{id:`tradeScreen.blockTrade.bestAsk`})}),(0,X.jsx)(PriceButtons,{legs:s,price:i,bestBidQuote:e,bestAskQuote:t,markPrice:r,timeInForce:c,setPrice:o}),(0,X.jsx)(Makers,{shouldShowMakerNames:n,bestQuote:e}),(0,X.jsx)(`div`,{}),(0,X.jsx)(Makers,{shouldShowMakerNames:n,bestQuote:t}),m&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(L,{variant:`body4`,children:[(0,X.jsx)(N,{id:`tradeScreen.blockRfq.yield`}),`:`,` `,(0,X.jsx)(tA,{variant:`body4`,side:`bid`,children:e?.yield||`-`})]}),(0,X.jsx)(`div`,{}),(0,X.jsxs)(L,{variant:`body4`,children:[(0,X.jsx)(N,{id:`tradeScreen.blockRfq.yield`}),`:`,` `,(0,X.jsx)(tA,{variant:`body4`,side:`ask`,children:t?.yield||`-`})]})]})]}),(0,X.jsxs)($k,{children:[(0,X.jsx)(eA,{filters:v,onChange:(e,t)=>
1498t&&p(t),selectedValue:c}),(0,X.jsx)(Id,{size:`md`,currency:g,step:_,value:i,onChange:o,isError:h})]})]})})}V();var nA=P(`div`)(({theme:e})=>z`
1499    display: flex;
1500    flex-direction: column;
1501    gap: ${e.spacing(.25)};
1502    width: 100%;
1503  `),rA=P(`div`,ai([`highlightedSide`,`direction`]))(({theme:e,highlightedSide:t,direction:n})=>{let getBuySellColor=e=>n===`buy`?e===`buy`?`success.200`:`error.200`:e===`buy`?`error.200`:`success.200`;return z`
1504    display: flex;
1505    justify-content: space-between;
1506
1507    p {
1508      font-size: ${e.typography.body4.fontSize};
1509      font-weight: ${e.typography.body4.fontWeight};
1510      line-height: ${e.typography.body4.lineHeight};
1511      color: ${e.getColor({dark:`lightGray.300`,light:`darkGray.60`})};
1512      margin: 0px;
1513    }
1514
1515    ${(t===`all`||t===`buy`)&&z`
1516      > p:nth-of-type(1) {
1517        color: ${e.getColor({default:getBuySellColor(`buy`)})};
1518      }
1519    `}
1520
1521    > p:nth-of-type(2) {
1522      text-align: right;
1523      ${(t===`all`||t===`sell`)&&z`
1524        color: ${e.getColor({default:getBuySellColor(`sell`)})};
1525      `}
1526    }
1527  `}),getBuySellLabel=(e,t=!1)=>e===`buy`?t?R._({id:`commonScreen.notificationTags.sell`}):R._({id:`commonScreen.notificationTags.buy`}):t?R._({id:`commonScreen.notificationTags.buy`}):R._({id:`commonScreen.notificationTags.sell`}),ShowLegRow=({leg:e,highlightedSide:t})=>(0,X.jsxs)(rA,{highlightedSide:t,direction:e.direction,children:[(0,X.jsx)(`p`,{children:`${getBuySellLabel(e.direction)}: ${Ri(e.instrument_name)}`}),(0,X.jsx)(`p`,{children:`${getBuySellLabel(e.direction,!0)}: ${Ri(e.instrument_name)}`})]});function LegsInTrade({legs:e,highlightedSide:t,hedge:n}){return(0,X.jsxs)(nA,{children:[e.map(e=>(0,X.jsx)(ShowLegRow,{leg:e,highlightedSide:t},`${e.instrument_name}:${e.direction}`)),n&&(0,X.jsx)(ShowLegRow,{leg:n,highlightedSide:t})]})}function BuySellButtons({bestBidPrice:e,bestAskPrice:t,onSubmit:n,price:r,timeInForce:i,legs:o,hedgeLeg:s}){let{analyticsService:c}=Ru(),p=i===`fill_or_kill`,m=B(pp),h=r!==void 0&&e!==void 0?r>e:!0,g=p&&(r!==void 0&&t!==void 0?r<t:!0),_=p&&h,v=g&&_?`none`:!g&&!_?`all`:g?`sell`:`buy`,onClick=e=>{c.trackEvent(`block_rfq_taker_buy_sell_pressed`,{orderDirection:e}),n(e)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Nd,{isDisabled:m?.write,fullWidth:!0,children:(0,X.jsxs)(I,{display:`flex`,gap:1,width:`100%`,marginTop:2,marginBottom:1,children:[(0,X.jsx)(H,{size:`md`,fullWidth:!0,variant:`filled`,color:`success`,disabled:!m?.write||g,onClick:()=>onClick(`buy`),children:R._({id:`commonScreen.notificationTags.buy`})}),(0,X.jsx)(H,{size:`md`,fullWidth:!0,variant:`filled`,color:`error`,disabled:!m?.write||_,onClick:()=>onClick(`sell`),children:R._({id:`commonScreen.notificationTags.sell`})})]})}),(0,X.jsx)(LegsInTrade,{legs:o,hedge:s,highlightedSide:v})]})}V();var iA=P(I)(({theme:e})=>z`
1528    display: grid;
1529    grid-template-columns: 2fr 1fr 1fr;
1530    row-gap: ${e.spacing(1)};
1531    padding-inline: 8px;
1532  `),aA=P(L)(({theme:e})=>z`
1533    color: ${e.getColor({dark:`lightGray.200`,light:`darkGray.60`})};
1534  `),oA=P(L,ai([`direction`]))(({theme:e,direction:t})=>z`
1535    color: ${e.getColor({default:t===`buy`?`success.200`:`error.200`})};
1536    font-weight: 600;
1537  `),sA=P(Ir)`
1538  width: 12px;
1539  height: 12px;
1540  cursor: pointer;
1541`;function OpenOrder({blockRfqId:e}){let t=Ti(),n=Uu(t=>Ak(t,e));return!n||!n.trade_trigger?null:(0,X.jsxs)(I,{display:`flex`,flexDirection:`column`,gap:1,marginTop:`auto`,marginBottom:1.5,children:[(0,X.jsx)(L,{variant:`body2`,fontWeight:600,children:(0,X.jsx)(N,{id:`tradeScreen.blockRFQ.openOrder`})}),(0,X.jsxs)(iA,{children:[(0,X.jsx)(aA,{variant:`body3`,children:(0,X.jsx)(N,{id:`commonScreen.common.side`})}),(0,X.jsx)(aA,{variant:`body3`,textAlign:`right`,children:(0,X.jsx)(N,{id:`commonScreen.common.price`})}),(0,X.jsx)(aA,{variant:`body3`,textAlign:`right`,children:(0,X.jsx)(N,{id:`commonScreen.common.cancel`})}),(0,X.jsx)(oA,{variant:`body1`,direction:n.trade_trigger?.direction,textTransform:`uppercase`,children:n.trade_trigger?.direction===`buy`?(0,X.jsx)(N,{id:`commonScreen.common.buy`}):(0,X.jsx)(N,{id:`commonScreen.common.sell`})}),(0,X.jsx)(oA,{variant:`body1`,direction:n.trade_trigger?.direction,textAlign:`right`,children:Lf({legs:n.legs,value:n.trade_trigger?.price})}),(0,X.jsx)(I,{display:`flex`,justifyContent:`flex-end`,alignItems:`center`,children:(0,X.jsx)(sA,{name:`closeSmall`,onClick:n=>{n.stopPropagation(),t.cancelBlockRfqTriggerOrder({block_rfq_id:e})}})})]})]})}V();var cA=P(`div`)(({theme:e})=>z`
1542    display: flex;
1543    flex-direction: column;
1544    margin-top: ${e.spacing(1)};
1545    padding: ${e.spacing(2,0)};
1546    height: 100%;
1547  `),lA=P(`div`)(({theme:e})=>z`
1548    display: flex;
1549    flex-direction: column;
1550    justify-content: center;
1551    margin-top: auto;
1552    text-align: center;
1553    padding-top: ${e.spacing(1.5)};
1554    border-top: 1px solid ${e.getColor({default:`darkGray.10`})};
1555  `),uA=P(L)(({theme:e})=>z`
1556    display: flex;
1557    justify-content: center;
1558    width: 100%;
1559    color: ${e.getColor({dark:`lightGray.100`,light:`darkGray.60`})};
1560    margin-top: ${e.spacing(3)};
1561  `);function TakerRFQDetailsDialog({onClose:e,blockRfqId:t,legs:n,amount:r,makers:i,expirationTimestamp:o,bids:s,asks:c,hedgeLeg:p,isBasisTrade:m,feeDiscount:h,comboId:g,markPrice:_,tradeTriggerOrder:v,initialPrice:y}){let b=B(e=>Ak(e,t)),{analyticsService:x}=Ru(),S=Ti(),{getColor:C}=rr(),w=(0,$.useRef)(null),T=Math.min(...n.map(e=>Ki.getInstrumentData(e.instrument_name)?.block_trade_tick_size??1/0)),E=Lt(_??0,T),{componentSettings:{timeInForce:D},setComponentSettings:O}
1561=Wp({componentId:`blockRfqTaker`,initialState:{timeInForce:`fill_or_kill`}}),k=y??c[0]?.price??s[0]?.price??E,[ee,te]=(0,$.useState)(D===`fill_or_kill`?k:E),[A,j]=(0,$.useState)(!1),[ne,M]=(0,$.useState)(!1),[re,ie]=(0,$.useState)(!1),{setInterfaceSettings:ae,interfaceSettings:oe}=td(),se=oe.disableShowBlockRfqTakerTradeConfirmationDialog,ce=oe.disableShowCancelBlockRfqConfirmationDialog,toggleDisableShowBlockRfqTakerTradeConfirmationDialog=()=>{ae(e=>({...e,disableShowBlockRfqTakerTradeConfirmationDialog:!e.disableShowBlockRfqTakerTradeConfirmationDialog}))},toggleDisableCancelBlockRfqConfirmationDialog=()=>{ae(e=>({...e,disableShowCancelBlockRfqConfirmationDialog:!e.disableShowCancelBlockRfqConfirmationDialog}))},le=(0,$.useCallback)(()=>{if(!ne&&!ce){M(!0);return}S.cancelBlockRfq({block_rfq_id:t}),x.trackEvent(`block_rfq_cancelled`),M(!1)},[ne,ce,S,t,x]),onSubmit=async e=>{if(w.current=e,ee!==void 0){if(!se&&!re){ie(!0);return}try{await S.makeBlockRfqOrder({block_rfq_id:t,amount:r,direction:e,legs:n,price:ee,time_in_force:D,hedge:p}),ie(!1),x.trackEvent(`block_rfq_taker_trade_executed`,{legs:n.map(e=>({instrument_name:e.instrument_name})),hedge:p?.instrument_name,amount:r})}catch(e){ie(!1),console.error(e)}}else j(!0)},ue=(0,$.useCallback)(e=>O({timeInForce:e}),[O]);return(0,X.jsx)(Hf,{children:(0,X.jsxs)(mf,{isOpen:!0,onClose:e,width:938,height:644,twoParts:!0,children:[(0,X.jsxs)(mf.LeftContainer,{width:530,children:[(0,X.jsx)(mf.Header,{title:R._({id:`tradeScreen.blockTrade.strategyDetails`}),id:t,withAdditionalPadding:!0}),(0,X.jsx)(zf,{takerName:b?.taker,allocations:b?.trade_allocations}),(0,X.jsx)(StrategyDetailsAndMakers,{legs:n,makers:i,amount:r,hedgeLeg:p,isBasisTrade:m,feeDiscount:h,onCancel:le,comboId:g})]}),(0,X.jsxs)(mf.RightContainer,{background:C({dark:`darkGray.80`,light:`lightGray.80`}),children:[(0,X.jsx)(mf.Header,{title:R._({id:`tradeScreen.blockRFQ.tradeOpen`}),infoTooltipText:R._({id:`tradeScreen.blockRfq.tradeDetailsTooltip`}),withCloseButton:!0}),(0,X.jsxs)(cA,{children:[(0,X.jsx)(PriceSelection,{legs:n,markPrice:E,bestBidQuote:s[0],bestAskQuote:c[0],price:ee,setPrice:te,timeInForce:D,setTimeInForce:ue,isError:A,isBasisTrade:m,shouldShowMakerNames:!!b?.taker}),s?.length===0&&c?.length===0&&D===`fill_or_kill`?(0,X.jsx)(uA,{variant:`body1`,children:(0,X.jsx)(N,{id:`tradeScreen.blockRFQ.noQuotes`})}):(0,X.jsx)(BuySellButtons,{bestBidPrice:s[0]?.price,bestAskPrice:c[0]?.price,onSubmit,price:ee,timeInForce:D,legs:n,hedgeLeg:p})]}),v?.state===`untriggered`&&(0,X.jsx)(OpenOrder,{blockRfqId:t}),(0,X.jsxs)(lA,{children:[(0,X.jsx)(L,{variant:`helperText`,color:C({dark:`lightGray.200`,light:`darkGray.60`}),children:(0,X.jsx)(N,{id:`tradeScreen.blockTrade.timeTillExpiry`})}),(0,X.jsx)(TimeDisplay,{timestamp:o,size:`sm`,variant:`countdown`})]})]}),re&&(0,X.jsx)(TakerTradeConfirmationDialog,{amount:r,blockRfqId:t,isOpen:!0,legs:n,hedge:p,askPrice:w.current===`buy`?ee:void 0,bidPrice:w.current===`sell`?ee:void 0,onClose:()=>ie(!1),onConfirmClicked:()=>onSubmit(w.current??`buy`),onDontShowAgainToggle:()=>{x.trackEvent(`block_rfq_taker_confirm_dont_show_again`),toggleDisableShowBlockRfqTakerTradeConfirmationDialog()},onCancelClicked:()=>ie(!1),comboId:g,isBasisTrade:m}),ne&&(0,X.jsx)(ConfirmCancellationDialog,{variant:`rfq`,onConfirmClick:le,onClose:()=>M(!1),onDontShowAgainToggle:toggleDisableCancelBlockRfqConfirmationDialog})]})})}var calculateAggregatePrice=(e,t)=>e.reduce((e,n)=>In(e,yn(yn(n[t],n.ratio),n.direction===`buy`?1:-1)),0),MakerConfirmationDialog=({amount:e,hedge:t,isOpen:n,onClose:r,onConfirmClicked:i,onEditClicked:o,onDontShowAgainToggle:s,isBasisTrade:c,feeDiscount:p,comboId:m,takerName:h})=>{let{state:{isAllOrNone:g,legsWithQuotes:_,typeOfQuote:v,tradeDirection:y}}=useMakerRfqContext(),{bidLegs:b,bidPrice:x}=(0,$.useMemo)(()=>_.every(e=>e.buy!==void 0)&&(v===`twoWay`||y===`buy`)?{bidLegs:_.map(e=>({instrument_name:e.instrument_name,direction:e.direction,ratio:e.ratio,price:e.buy})),bidPrice:calculateAggregatePrice(_,`buy`)}:{bidLegs:void 0,bidPrice:void 0},[_,y,v]),{askLegs:S,askPrice:C}=(0,$.useMemo)(()=>_.every(e=>e.sell!==void 0)&&(v===`twoWay`||y===`sell`)?{askLegs:_.map(e=>({instrument_name:e.instrument_name,direction:e.direction,ratio:e.ratio,price:e.sell})),askPrice:calculateAggregatePrice(_,`sell`)}:{askLegs:void 0,askPrice:void 0},[_,y,v]),w=Yu(Xf(()=>{i(e,g)}));return(0,X.jsxs)(mf,{isOpen:n,onClose:r,onKeyDown:w,tabIndex:0,width:612,height:571,children:[(0,X.jsx)(mf.Header,{title:R._({id:`tradeScreen.blockRFQ.confirmQuote`}),withCloseButton:!0}),(0,X.jsxs)(tp,{children:[(0,X.jsx)(L,{children:(0,X.jsx)(N,{id:`tradeScreen.blockRFQ.confirmationDialog.quoteAreYouSure`})}),(0,X.jsx)(L,{children:(0,X.jsx)(N,{id:`tradeScreen.blockRFQ.confirmationDialog.quoteWarning`})})]}),(0,X.jsx)(zf,{takerName:h}),(0,X.jsx)(I,{paddingX:1,overflow:`auto`,maxHeight:260,children:(0,X.jsx)(lp,{amount:e,comboId:m,isAllOrNone:g,legs:_.map(e=>({direction:e.direction,instrument_name:e.instrument_name,ratio:e.ratio})),withStrategyTitleLabel:!0,hedgeLeg:t,bidLegs:b,bidPrice:x,askLegs:S,askPrice:C,isBasisTrade:c,feeDiscount:p,withBidAskPriceLabel:!0})}),(0,X.jsxs)(Wf,{children:[(0,X.jsx)(hp,{control:(0,X.jsx)(mp,{onChange:e=>s(e.target.checked)}),label:(0,X.jsx)(N,{id:`tradeScreen.blockRFQ.confirmation.dontShowAgain`})}),(0,X.jsxs)(cp,{children:[(0,X.jsx)(qf,{onClick:o,children:(0,X.jsx)(N,{id:`tradeScreen.blockRFQ.editQuote`})}),(0,X.jsx)(qf,{color:`primary`,onClick:()=>i(e,g),children:(0,X.jsx)(N,{id:`commonScreen.common.confirm`})})]})]})]})},useGetBidAskHeaderColor=()=>{let{getColor:e}=rr(),{state:{tradeDirection:t,typeOfQuote:n}}=useMakerRfqContext();return(0,$.useCallback)(r=>e(n===`twoWay`||r===t?{default:`primary.200`}:{dark:`lightGray.200`,light:`darkGray.20`}),[t,e,n])};function formatMarkPrice({markPrice:e,instrumentName:t,addUnitBefore:n}){let r=ui(t).priceDecimals,i=Ki.isOptionInstrument(t);
1561return ki(e,Math.max(r,i?2:0),n)}function MarkPriceForOneLeg({instrumentName:e}){let t=S(e),{getColor:n}=rr(),r=n({dark:`lightGray.100`,light:`darkGray.80`});return(0,X.jsx)(L,{variant:`subtitle1`,color:r,fontWeight:400,textAlign:`center`,children:t?.mark_price===void 0?`-`:formatMarkPrice({markPrice:t.mark_price,instrumentName:e})})}var dA=(0,$.memo)(MarkPriceForOneLeg);function LegDetailsRow({leg:e,index:t}){let{analyticsService:n}=Ru(),{getColor:r}=rr(),i=r({dark:`lightGray.0`,light:`darkGray.100`}),{quote_currency:o}=Ki.splitInstrument(e.instrument_name),{state:{isAggregatedBidFocused:s,isAggregatedAskFocused:c,isValidationError:p,strategyName:m},action:{isInputDisabled:h,setIsAggregatedBidFocused:g,setIsAggregatedAskFocused:_,setLegsWithQuotes:v}}=useMakerRfqContext(),shouldInputBeActive=(e,t)=>e===`bid`?s&&t===`buy`||c&&t===`sell`:s&&t===`sell`||c&&t===`buy`,onFocusChanged=(e,t,n)=>{e===`bid`&&t===`buy`||e===`ask`&&t===`sell`?g(n):_(n)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(bd,{variant:e.direction}),(0,X.jsx)(L,{variant:`subtitle1`,color:i,children:Ri(e.instrument_name)}),(0,X.jsx)(L,{variant:`subtitle1`,color:i,children:`${e.direction===`buy`?`+`:`-`}${e.ratio}`}),(0,X.jsx)(Id,{autoFocus:t===0,value:e.direction===`buy`?e.buy:e.sell,onBlur:()=>n.trackEvent(`block_rfq_maker_added_price`),onChange:e=>v(n=>{let r=[...n];return r[t]={...r[t],[r[t].direction]:e},r}),isActive:shouldInputBeActive(`bid`,e.direction),min:Ki.getInstrumentData(e.instrument_name).block_trade_tick_size,step:Ki.getInstrumentData(e.instrument_name).block_trade_tick_size,currency:o,isDisabled:h(`bid`,e.direction)||m===`Future Spread`,onFocusChange:t=>onFocusChanged(`bid`,e.direction,t),isError:p&&!h(`bid`,e.direction)&&!(e.direction===`buy`?e.buy:e.sell)}),(0,X.jsx)(dA,{instrumentName:e.instrument_name}),(0,X.jsx)(Id,{autoFocus:h(`bid`,e.direction)&&t===0,value:e.direction===`sell`?e.buy:e.sell,onBlur:()=>n.trackEvent(`block_rfq_maker_added_price`),onChange:e=>v(n=>{let r=[...n];return r[t]={...r[t],[r[t].direction===`sell`?`buy`:`sell`]:e},r}),isActive:shouldInputBeActive(`ask`,e.direction),min:Ki.getInstrumentData(e.instrument_name).block_trade_tick_size,step:Ki.getInstrumentData(e.instrument_name).block_trade_tick_size,currency:o,isDisabled:h(`ask`,e.direction)||m===`Future Spread`,onFocusChange:t=>onFocusChanged(`ask`,e.direction,t),isError:p&&!h(`ask`,e.direction)&&!(e.direction===`sell`?e.buy:e.sell)})]})}V();var grid=e=>`
1562	display: grid;
1563	grid-template-columns: 1fr 6fr 1fr 3.9fr 2.8fr 3.9fr;
1564	gap: ${e.spacing(0,3)};
1565	padding: ${e.spacing(1,2)};
1566	margin-top: ${e.spacing(1)};
1567    align-items: center;
1568`,fA=P(`div`)(({theme:e})=>z`
1569    ${grid(e)}
1570    padding-bottom: 0px;
1571    color: ${e.getColor({dark:`lightGray.200`,light:`darkGray.80`})};
1572  `),pA=P(`div`)(({theme:e})=>z`
1573    ${grid(e)}
1574    background: ${e.getColor({dark:`darkGray.60`,light:`lightGray.40`})};
1575    border-radius: 6px;
1576  `),mA=P(An)(({theme:e})=>z`
1577    height: 20px;
1578    margin-left: auto;
1579
1580    .MuiTypography-root {
1581      font-size: ${e.typography.body4.fontSize};
1582      line-height: ${e.typography.body4.lineHeight};
1583      text-transform: lowercase;
1584    }
1585  `);function LegsDetails({hedge:e}){let{getColor:t}=rr(),{state:{legsWithQuotes:n}}=useMakerRfqContext(),r=t({dark:`lightGray.0`,light:`darkGray.100`}),i=useGetBidAskHeaderColor();return(0,X.jsxs)(I,{overflow:`auto`,maxHeight:325,children:[(0,X.jsxs)(fA,{children:[(0,X.jsx)(L,{variant:`body3`,children:(0,X.jsx)(N,{id:`commonScreen.common.side`})}),(0,X.jsx)(L,{variant:`body3`,children:(0,X.jsx)(N,{id:`commonScreen.common.instrument`})}),(0,X.jsx)(L,{variant:`body3`,children:(0,X.jsx)(N,{id:`commonScreen.common.ratio`})}),(0,X.jsx)(L,{variant:`body3`,color:i(`buy`),children:(0,X.jsx)(N,{id:`commonScreen.common.bid`})}),(0,X.jsx)(L,{variant:`body3`,textAlign:`center`,children:(0,X.jsx)(N,{id:`commonScreen.common.markPrice`})}),(0,X.jsx)(L,{variant:`body3`,color:i(`sell`),children:(0,X.jsx)(N,{id:`commonScreen.common.ask`})})]}),n.map((e,t)=>(0,X.jsx)(pA,{children:(0,X.jsx)(LegDetailsRow,{leg:e,index:t})},`${e.instrument_name}:${e.direction}`)),e&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(fA,{children:[(0,X.jsx)(L,{variant:`body3`,children:(0,X.jsx)(N,{id:`commonScreen.common.side`})}),(0,X.jsx)(L,{variant:`body3`,children:(0,X.jsx)(N,{id:`commonScreen.common.instrument`})}),(0,X.jsx)(ip,{tooltip:`maker-hedge-amount`,children:(0,X.jsx)(L,{variant:`body3`,children:(0,X.jsx)(N,{id:`commonScreen.common.amount`})})}),(0,X.jsx)(L,{variant:`body3`,children:(0,X.jsx)(N,{id:`commonScreen.common.price`})}),(0,X.jsx)(`div`,{})]}),(0,X.jsxs)(pA,{children:[(0,X.jsx)(bd,{variant:e.direction}
1585),(0,X.jsx)(L,{variant:`subtitle1`,color:r,children:Ri(e.instrument_name)}),(0,X.jsx)(L,{variant:`subtitle1`,color:r,children:ki(e.amount,En(e.amount))}),(0,X.jsx)(L,{variant:`subtitle1`,color:r,children:Lf({legs:[e],value:e.price})}),(0,X.jsx)(`div`,{}),(0,X.jsx)(mA,{size:`small`,label:R._({id:`tradeScreen.blockRFQ.Hedge.label`}),backgroundColor:`transparent`,color:t({dark:`lightGray.0`,light:`darkGray.100`}),borderColor:t({dark:`lightGray.200`,light:`lightGray.20`}),hasBorder:!0})]})]})]})}function useMinAmountValidation({amount:e,hedge:t}){let{state:{legsWithQuotes:n,typeOfQuote:r,tradeDirection:i}}=useMakerRfqContext(),o=Ki.isLinearInstrument(n[0].instrument_name),s=(0,$.useMemo)(()=>Df(n),[n]),c=Ki.getInstrumentData(n[0].instrument_name)?.kind,p=(0,$.useMemo)(()=>{if(!t)return 1/0;let n=Ki.getInstrumentData(t.instrument_name)?.block_trade_min_trade_amount||1;if(Ki.getInstrumentData(t.instrument_name)?.isLinear){let e=t.price||1;n=Xt(n,e)}return n<=t.amount?yn(Xt(n,t.amount),e):1/0},[e,t]),{minAmountForMainStructure:m,isPriceTooSmall:h}=(0,$.useMemo)(()=>{if(o&&c===`future`&&!s){if(r===`twoWay`&&n.some(e=>!e.buy&&!e.sell)||r===`oneWay`&&n.some(e=>!e[i]))return{minAmountForMainStructure:e};let t=Math.min(...n.map(e=>Ki.getInstrumentData(e.instrument_name)?.block_trade_min_trade_amount||1/0)),o=n.reduce((e,t)=>{let n=r===`oneWay`?t[i]:t.buy&&t.sell?Math.min(t.buy,t.sell):t.buy||t.sell;return In(e,yn(Math.abs(t.ratio),n))},0),s=Xt(t,o),c=s>e;return{minAmountForMainStructure:c?e:s,isPriceTooSmall:c}}let t=n.reduce((e,t)=>{let{base_currency:n,currency:r,block_trade_min_trade_amount:i}=Ki.getInstrumentData(t.instrument_name)||{},o=(n?`${n}-${r}`:r)||``;return e[o]={minBlockTradeAmount:i||0,ratio:In(e[o]?.ratio||0,Math.abs(t.ratio||0))},e},{}),p=Object.values(t).map(({minBlockTradeAmount:e,ratio:t})=>Xt(e,t));return{minAmountForMainStructure:Math.min(...p)}},[e,s,o,n,c,i,r]),g=Math.min(p,m)===m;return(0,$.useMemo)(()=>({minBlockTradeAmount:Math.min(p,m),isPriceTooSmall:g&&h}),[h,p,m,g])}var hA=`/assets/all-or-none.dark-BH3f3oAt.png`,gA=`/assets/all-or-none.light-CXsPWmXk.png`;V();var _A=P(I)(({theme:e})=>z`
1586    display: flex;
1587    flex-direction: column;
1588    gap: ${e.spacing(.5)};
1589    width: 88px;
1590  `),vA=P(L)(({theme:e})=>z`
1591    color: ${e.getColor({dark:`lightGray.200`,light:`darkGray.60`})};
1592    text-decoration: underline dashed;
1593    text-underline-offset: 3px;
1594  `),yA=P(`div`)`
1595  div {
1596    gap: 4px !important;
1597
1598    div {
1599      border-radius: 3px !important;
1600    }
1601  }
1602`,generateTimeOptions=e=>{let t=[],n=e-(0,BS.default)().valueOf(),r=n/1e3-30;for(let e=15;e<=r;e+=e<60?15:30){let r=e*1e3;if(r<=n){let e=BS.default.duration(r).format(`mm:ss`);t.push({label:e,value:r})}}return t},transformStringToMilliseconds=e=>{let[t,n]=e.split(`:`).map(Number);return(t*60+n)*1e3},isValidTime=(e,t)=>{if(!/^\d{1,2}:\d{2}$/.test(e))return!1;let[n,r]=e.split(`:`).map(Number),i=(n*60+r)*1e3>BS.default.utc(t).diff(BS.default.utc());return n>=0&&r>=0&&r<=59&&!i},getTimeOptions=e=>[{label:R._({id:`tradeScreen.blockRFQ.quoteTimer.off`}),value:0},...generateTimeOptions(e)],bA=(0,$.memo)(({value:e,onChange:t,expirationTimestamp:n})=>{let r=(0,$.useMemo)(()=>getTimeOptions(n),[n]),i=(0,$.useMemo)(()=>e?{value:e,label:BS.default.duration(e).format(`mm:ss`)}:r[0],[e,r]),[o,s]=(0,$.useState)(i.label);return(0,X.jsx)(_A,{children:(0,X.jsx)(Sp,{options:r,freeSolo:!0,value:i,inputValue:o,onInputChange:(e,r)=>{s(r),(isValidTime(r,n)||r===`Off`)&&t(transformStringToMilliseconds(r))},onChange:(e,i)=>{i&&typeof i==`object`&&`value`in i?(t(i.value),s(i.label)):typeof i==`string`&&isValidTime(i,n)?(t(transformStringToMilliseconds(i)),s(i)):i===`Off`&&(t(r[0].value),s(r[0].label))},onBlur:()=>s(i.label),getOptionLabel:e=>typeof e==`object`?e.label:e,getOptionKey:e=>typeof e==`object`?e.value:e,isOptionEqualToValue:(e,t)=>e.value===t.value,disableClearable:!0,componentsProps:{popper:{placement:`top`}},renderInput:({InputProps:e,InputLabelProps:t,...n})=>(0,X.jsx)(yA,{children:(0,X.jsx)(Mi,{...n,...e,size:`sm`,label:(0,X.jsx)(Mr,{body:R._({id:`tradeScreen.blockRFQ.quoteTimer.tooltip`}),placement:`top`,children:(0,X.jsx)(vA,{variant:`body3`,children:(0,X.jsx)(N,{id:`tradeScreen.blockRFQ.quoteTimer`})})})})})})})});V();var xA=P(`div`)(({theme:e})=>z`
1603    padding: ${e.spacing(0,2)};
1604    height: 80px;
1605    display: flex;
1606    align-items: center;
1607    justify-content: space-between;
1608    background-color: ${e.getColor({dark:`darkGray.60`,light:`lightGray.80`})};
1609    border-radius: 6px;
1610  `),SA=P(L)(({theme:e})=>z`
1611    font-weight: 600;
1612    color: ${e.getColor({dark:`lightGray.0`,light:`darkGray.100`})};
1613  `),CA=P(oi)(({theme:e})=>z`
1614    border: solid 0.5px ${e.palette.dsColors.darkGray[10]};
1615    height: 32px;
1616    margin: ${e.spacing(0,3)};
1617  `),wA=P(Mr)(()=>z`
1618    & .${gi.tooltip} {
1619      max-width: 470px;
1620    }
1621  `),TA=P(`img`)(({theme:e})=>z`
1622    width: 453.5px;
1623    margin-top: ${e.spacing(1)};
1624  `),EA=P(na)(({theme:e})=>z`
1625    color: ${e.getColor({dark:`lightGray.100`,light:`darkGray.200`})};
1626    border-bottom: 1px dashed currentColor;
1627    cursor: pointer;
1628    font-weight: 600;
1629  `),DA=P(L)(({theme:e})=>z`
1630    cursor: pointer;
1631    color: ${e.getColor({dark:`lightGray.0`,light:`darkGray.100`})};
1632  `),OA=P(na)(({theme:e})=>z`
1633    color: inherit;
1634    font-size: ${e.typography.body3.fontSize};
1635    line-height: ${e.typography.body3.lineHeight};
1636  `),kA=P(`div`,ai([`isAllOrNone`]))(({theme:e,isAllOrNone:t})=>z`
1637    display: flex;
1638    justify-content: ${t?`flex-end`:`space-between`};
1639    color: ${e.getColor(t?{dark:`lightGray.200`,light:`darkGray.60`}:{default:`primary.200`})};
1640    margin-bottom: ${e.spacing(.5)};
1641  `);function Footer$1({amount:e,onCancel:t,onSubmit:n,amountStep:r,hedge:i,expirationTimestamp:o}){let s=Dn(),c=B(pp),{state:{legsWithQuotes:p,amountValue:m,isAllOrNone:h,editedQuoteId:g,isValidationError:_,isLoadingLegPrices:v,quoteTimerTimestamp:y},action:{setAmountValue:b,setComponentSettings:x,reset:S,setQuoteTimerTimestamp:C}}=useMakerRfqContext(),w=r||Gf(p.map(e=>Ki.getInstrumentData(e.instrument_name).min_trade_amount),p.length),{minBlockTradeAmount:T}=useMinAmountValidation({amount:e,hedge:i}),E=Lt(T,w,Math.ceil);return(0,X.jsxs)(xA,{children:[(0,X.jsxs)(I,{display:`flex`,alignItems:`center`,gap:1.5,children:[(0,X.jsx)(gd,{id:`allOrNone`,disabled:!!g,checked:h,onChange:()=>{x(e=>({...e,isAllOrNone:!h}))}}),(0,X.jsx)(wA,{disableInteractive:!0,title:R._({id:`tradeScreen.blockRFQ.allOrNone`}),placement:`top`,body:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(N,{components:{0:(0,X.jsx)(`strong`,{})},id:`tradeScreen.blockRFQ.allOrNoneTooltip`}),(0,X.jsx)(TA,{src:s.palette.mode===`light`?gA:hA,alt:`All-or-none Helper`})]}),children:(0,X.jsx)(EA,{htmlFor:`allOrNone`,children:(0,X.jsx)(N,{id:`tradeScreen.blockRFQ.allOrNone`})})})]}),(0,X.jsxs)(I,{display:`flex`,alignItems:`center`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(kA,{isAllOrNone:h,children:[(0,X.jsx)(OA,{htmlFor:`amount`,children:(0,X.jsx)(N,{id:`commonScreen.common.amount`})}),!h&&(0,X.jsxs)(DA,{variant:`body3`,fontWeight:600,onClick:()=>b(E),children:[(0,X.jsx)(N,{id:`commonScreen.common.min`}),`:`,` `,sa(E)]})]}),h?(0,X.jsx)(SA,{variant:`body2`,textAlign:`end`,marginTop:.25,children:e}):(0,X.jsx)(Id,{id:`amount`,width:150,size:`sm`,value:m,onChange:b,max:e,min:w,step:w,isError:_&&(m||0)<T})]}),(0,X.jsx)(CA,{}),(0,X.jsx)(bA,{value:y,onChange:C,expirationTimestamp:o}),(0,X.jsx)(CA,{}),(0,X.jsxs)(I,{display:`flex`,gap:1.5,children:[(0,X.jsx)(H,{variant:`gray`,onClick:()=>{g||t(),S()},children:R._({id:`commonScreen.common.cancel`})}),(0,X.jsx)(Nd,{isDisabled:c?.write,children:(0,X.jsx)(Cr,{variant:`filled`,onClick:n,disabled:!c?.write,loading:v,children:g?R._({id:`tradeScreen.blockRFQ.saveChanges`}):R._({id:`common.order.quote`})})})]})]})]})}e(Footer$1,`Footer`);var getTypeOfQuoteOptions=()=>[{label:R._({id:`tradeScreen.blockRFQ.oneWay`}),value:`oneWay`},{label:R._({id:`tradeScreen.blockRFQ.twoWay`}),value:`twoWay`}];V();var AA=P(`div`)(({theme:e})=>z`
1642    display: flex;
1643    align-items: center;
1644    margin-top: ${e.spacing(2.5)};
1645    padding: ${e.spacing(2)};
1646    background-color: ${e.getColor({dark:`darkGray.80`,light:`lightGray.40`})};
1647    border-radius: 8px;
1648  `),jA=P(oi)(({theme:e})=>z`
1649    margin: ${e.spacing(0,1.5)};
1650    border-right: solid 1px
1651      ${e.getColor({dark:`darkGray.40`,light:`lightGray.200`})};
1652    height: 24px;
1653  `),MA=P(np)(()=>z`
1654    margin-left: auto;
1655  `),NA=P(Mf)(()=>z`
1656    align-self: center;
1657    height: 24px;
1658  `),PA=P(xf)(()=>z`
1659    align-self: center;
1660    height: 24px;
1661    min-width: 80px;
1662  `),FA=e(({legs:e,amount:t})=>{let{analyticsService:n}=Ru(),{state:r,action:i}=useMakerRfqContext(),o=(0,$.useMemo)(()=>getTypeOfQuoteOptions(),[]);return(0,X.jsxs)(AA,{children:[(0,X.jsx)(NA,{value:r.typeOfQuote,values:o,onValueChange:e=>{n.trackEvent(`block_rfq_maker_quote_type_selected`,{typeOfQuote:e}),i.setComponentSettings(t=>({...t,typeOfQuote:e}))},disabled:!!r.editedQuoteId,variant:`standard`}),(0,X.jsx)(jA,{}),r.typeOfQuote===`oneWay`&&(0,X.jsx)(PA,{direction:r.tradeDirection,onDirectionChange:e=>i.setComponentSettings(t=>({...t,tradeDirection:e})),disabled:!!r.editedQuoteId}),(0,X.jsx)(MA,{legs:e,amount:t,hideMarkPrice:!0})]})},`Header`),SvgTrash=e=>(0,X.jsx)(`svg`,{width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,X.jsx)(`g`,{id:`Filled-icons / dark / trash `,children:(0,X.jsx)(`path`,{id:`Vector`,d:`M13.5 3H10.5V2.25C10.5 1.91848 10.3683 1.60054 10.1339 1.36612C9.89946 1.1317 9.58152 1 9.25 1H6.75C6.41848 1 6.10054 1.1317 5.86612 1.36612C5.6317 1.60054 5.5 1.91848 5.5 2.25V3H2.5C2.36739 3 2.24021 3.05268 2.14645 3.14645C2.05268 3.24021 2 3.36739 2 3.5C2 3.63261 2.05268 3.75979 2.14645 3.85355C2.24021 3.94732 2.36739 4 2.5 4H3.03125L3.625 13.5288C3.66937 14.3678 4.3125 15 5.125 15H10.875C11.6916 15 12.3219 14.3819 12.375 13.5312L12.9688 4H13.5C13.6326 4 13.7598 3.94732 13.8536 3.85355C13.9473 3.75979 14 3.63261 14 3.5C14 3.36739 13.9473 3.24021 13.8536 3.14645C13.7598 3.05268 13.6326 3 13.5 3ZM6.01781 13H6C5.87042 13.0001 5.74587 12.9499 5.6526 12.8599C5.55933 12.77 5.50462 12.6473 5.5 12.5178L5.25 5.51781C5.24528 5.3852 5.29342 5.25615 5.38385 5.15904C5.47428 5.06193 5.59958 5.00472 5.73219 5C5.8648 4.99528 5.99385 5.04342 6.09096 5.13385C6.18807 5.22428 6.24528 5.34958 6.25 5.48219L6.5 12.4822C6.50238 12.5479 6.49179 12.6134 6.46884 12.6749C6.44589 12.7365 6.41103 12.793 6.36624 12.841C6.32146 12.8891 6.26764 12.9279 6.20785 12.9552C6.14806 12.9825 6.08349 12.9977 6.01781 13ZM8.5 12.5C8.5 12.6326 8.44732 12.7598 8.35355 12.8536C8.25979 12.9473 8.13261 13 8 13C7.86739 13 7.74
1662021 12.9473 7.64645 12.8536C7.55268 12.7598 7.5 12.6326 7.5 12.5V5.5C7.5 5.36739 7.55268 5.24021 7.64645 5.14645C7.74021 5.05268 7.86739 5 8 5C8.13261 5 8.25979 5.05268 8.35355 5.14645C8.44732 5.24021 8.5 5.36739 8.5 5.5V12.5ZM9.5 3H6.5V2.25C6.49962 2.21706 6.50583 2.18439 6.51826 2.15388C6.53069 2.12338 6.54909 2.09567 6.57238 2.07238C6.59567 2.04909 6.62338 2.03069 6.65388 2.01826C6.68439 2.00583 6.71706 1.99962 6.75 2H9.25C9.28294 1.99962 9.31561 2.00583 9.34612 2.01826C9.37662 2.03069 9.40433 2.04909 9.42762 2.07238C9.45091 2.09567 9.46931 2.12338 9.48174 2.15388C9.49417 2.18439 9.50038 2.21706 9.5 2.25V3ZM10.5 12.5178C10.4954 12.6473 10.4407 12.77 10.3474 12.8599C10.2541 12.9499 10.1296 13.0001 10 13H9.98188C9.91623 12.9977 9.85168 12.9824 9.79193 12.9551C9.73218 12.9278 9.67839 12.889 9.63364 12.8409C9.58889 12.7929 9.55406 12.7364 9.53113 12.6749C9.5082 12.6133 9.49762 12.5478 9.5 12.4822L9.75 5.48219C9.75234 5.41653 9.76759 5.35197 9.79488 5.2922C9.82217 5.23243 9.86096 5.17863 9.90904 5.13385C9.95713 5.08908 10.0136 5.05421 10.0751 5.03124C10.1367 5.00828 10.2022 4.99766 10.2678 5C10.3335 5.00234 10.398 5.01759 10.4578 5.04488C10.5176 5.07217 10.5714 5.11096 10.6161 5.15904C10.6609 5.20713 10.6958 5.26356 10.7188 5.32511C10.7417 5.38667 10.7523 5.45215 10.75 5.51781L10.5 12.5178Z`,fill:`white`})})});V();var IA=P(`div`)(({theme:e})=>z`
1663    display: flex;
1664    justify-content: space-between;
1665    align-items: center;
1666    background-color: ${e.getColor({default:`primary.20`})};
1667    padding: ${e.spacing(.5,1.5)};
1668    gap: ${e.spacing(.75)};
1669    border-radius: 4px;
1670  `),LA=P(Ir)`
1671  width: 12px;
1672  height: 12px;
1673`,QuoteExpiresIn=({quote:e,isEdited:t})=>{let{formattedRemainingTime:n}=Qd(e.expires_at||0),r=Ti(),removeTimer=async()=>{try{await r.editBlockRfqQuote({...e,expires_at:0})}catch(e){console.error(e)}};return e.expires_at?(0,X.jsxs)(IA,{children:[(0,X.jsxs)(I,{display:`flex`,alignItems:`center`,gap:.75,children:[(0,X.jsx)(LA,{name:`timer`}),(0,X.jsx)(L,{variant:`body3`,children:(0,X.jsx)(N,{values:{formattedRemainingTime:n},id:`tradeScreen.blockRFQ.expiresAt`})})]}),!t&&(0,X.jsx)(LA,{name:`closeSmall`,onClick:e=>{e.stopPropagation(),removeTimer()}})]}):null};V();var RA=P(`div`)(({theme:e})=>z`
1674    margin-top: ${e.spacing(3)};
1675    display: flex;
1676    flex-direction: column;
1677    gap: ${e.spacing(.75)};
1678    height: 100%;
1679    overflow-y: auto;
1680  `),zA=P(`div`,ai([`isSelected`]))(({theme:e,isSelected:t})=>z`
1681    padding: ${e.spacing(1,0)};
1682    background-color: ${e.getColor({dark:`darkGray.60`,light:`lightGray.20`})};
1683    border-radius: 6px;
1684    border: solid 1px transparent;
1685    cursor: pointer;
1686    ${t?`border-color: ${e.getColor({default:`primary.200`})}`:``};
1687  `),BA=P(fu)(({theme:e})=>z`
1688    .${mu.wrapperInner} {
1689      display: flex;
1690      flex-direction: column;
1691      gap: ${e.spacing(.125)};
1692    }
1693  `),VA=P(oi)(({theme:e})=>z`
1694    margin: ${e.spacing(1,0)};
1695    border-bottom: solid 1px
1696      ${e.getColor({dark:`darkGray.40`,light:`lightGray.200`})};
1697    width: 100%;
1698  `),HA=P(H,ai([`isVisible`]))(({isVisible:e})=>z`
1699    display: ${e?`block`:`none`};
1700  `),UA=P(`div`)(({theme:e})=>z`
1701    margin-top: auto;
1702    text-align: center;
1703    padding-top: ${e.spacing(2)};
1704    display: flex;
1705    flex-direction: column;
1706    align-items: center;
1707    gap: ${e.spacing(.5)};
1708  `),ListOfQuotes=({blockRfqId:e,expirationTimestamp:t})=>{let{getColor:n}=rr(),{analyticsService:r}=Ru(),i=B(pp),o=B(t=>jk(t,e)),[s,c]=(0,$.useState)(!1),[p,m]=(0,$.useState)(void 0),h=(0,$.useMemo)(()=>[...o].sort((e,t)=>e.price-t.price),[o]),g=Ti(),{setInterfaceSettings:_,interfaceSettings:v}=td(),{state:{editedQuoteId:y,allQuotesExpanded:b},action:{setEditedQuoteId:x,setLegsWithQuotes:S,setAmountValue:C,setComponentSettings:w}}=useMakerRfqContext(),getPriceColor=(e,t)=>e===`buy`?t===`buy`?`success.200`:`error.200`:t===`buy`?`error.200`:`success.200`,setDataBasedOnQuote=e=>{S(e.legs.map(t=>({...t,[e.direction]:t.price}))),C(e.amount),w(t=>({...t,isAllOrNone:e.execution_instruction===`all_or_none`,typeOfQuote:`oneWay`,tradeDirection:e.direction}))},onEdit=e=>{x(e.block_rfq_quote_id),setDataBasedOnQuote(e)},T=v.disableShowCancelBlockRfqQuoteConfirmationDialog,toggleDisableCancelBlockRfqQuoteConfirmationDialog=()=>{_(e=>({...e,disableShowCancelBlockRfqQuoteConfirmationDialog:!e.disableShowCancelBlockRfqQuoteConfirmationDialog}))},E=(0,$.useCallback)(async t=>{if(!s&&!T){c(!0);return}t?(await g.cancelBlockRfqQuote({block_rfq_id:e,block_rfq_quote_id:t}),r.trackEvent(`block_rfq_maker_quote_cancelled`)):(await g.cancelAllBlockRfqQuotes({block_rfq_id:e}),x(void 0),r.trackEvent(`block_rfq_maker_all_quotes_cancelled`)),c(!1)},[s,T,x,g,e,r]);return(0,X.jsxs)(X.Fragment,{children:[h.length===0?(0,X.jsx)(Tl,{overlayNoRowsTemplate:R._({id:`tradeScreen.blockRFQ.noQuotesHere`})}):(0,X.jsx)(RA,{children:h.map(e=>(0,X.jsxs)(zA,{isSelected:y===e.block_rfq_quote_id,onClick:()=>setDataBasedOnQuote(e),children:[(0,X.jsxs)(I,{display:`flex`,paddingX:1.5,gap:1,alignItems:`center`,children:[(0,X.jsx)(bd,{variant:e.direction}),e.execution_instruction===`all_or_none`&&(0,X.jsx)(An,{size:`small`,label:R._({id:`tradeScreen.blockRFQ.allOrNoneTag`}),backgroundColor:`transparent`,color:n({dark:`lightGray.0`,light:`darkGray.100`}),borderColor:n({default:`primary.100`}),hasBorder:!0}),(0,X.jsx)(L,{variant:`body3`,fontWeight:700,children:(0,BS.default)(e.last_update_timestamp).format(`HH:mm:ss, D MMM YYYY`)}),(0,X.jsx)(I,{display:`flex`,marginLeft:`auto`,gap:1,children:y===e.block_rfq_quote_id?(0,X.jsx)(L,{variant:`body3`,color:n({dark:`lightGray.80`,light:`darkGray.60`}),lineHeight:`24px`,children:(0,X.jsx)(N,{id:`tradeScreen.blockRFQ.editing`})}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Nd,{isDisabled:i?.write,children:(0,X.jsx)(H,{size:`xs`,variant:`gray`,onClick:t=>{t.stopPropagation(),onEdit(e)},disabled:!i?.write,children:R._({id:`commonScreen.common.edit`})})}),(0,X.jsx)(Nd,{isDisabled:i?.write,children:(0,X.jsx)(H,{size:`xs`,variant:`filled`,color:`error`,onClick:t=>{t.stopPropagation(),m(e.block_rfq_quote_id),E(e.block_rfq_quote_id)},disabled:!i?.write,children:(0,X.jsx)(SvgTrash,{})})})]})})]}),(0,X.jsx)(VA,{}),(0,X.jsxs)(I,{display:`flex`,paddingX:1.5,flexDirection:`column`,gap:.25,children:[(0,X.jsxs)(BA,{in:b,children:[e.legs.map(t=>(0,X.jsxs)(I,{display:`flex`,justifyContent:`space-between`,alignItems:`center`,children:[(0,X.jsx)(Af,{variant:`body3`,orderDirection:t.direction,instrumentName:t.instrument_name,directionIndicator:`divi
1708der`,disablePadding:!0}),(0,X.jsx)(L,{variant:`body3`,color:n({default:getPriceColor(e.direction,t.direction)}),textAlign:`right`,children:Lf({legs:e.legs,value:t.price})})]},t.instrument_name)),e.hedge&&(0,X.jsxs)(I,{display:`flex`,justifyContent:`space-between`,alignItems:`center`,children:[(0,X.jsx)(Af,{variant:`body3`,orderDirection:e.hedge.direction,instrumentName:e.hedge.instrument_name,directionIndicator:`divider`,disablePadding:!0}),(0,X.jsxs)(L,{variant:`body3`,textAlign:`right`,fontWeight:600,display:`flex`,alignItems:`center`,gap:1,children:[sa(e.hedge.amount,En(e.hedge.amount)),(0,X.jsx)(`span`,{children:`@`}),(0,X.jsx)(`span`,{children:Lf({legs:[e.hedge],value:e.hedge.price})})]})]})]}),(0,X.jsxs)(I,{display:`flex`,justifyContent:`space-between`,alignItems:`center`,children:[(0,X.jsxs)(L,{variant:`body3`,display:`flex`,alignItems:`center`,gap:1,children:[(0,X.jsx)(N,{id:`commonScreen.common.amount`}),(0,X.jsx)(`span`,{children:`/`}),(0,X.jsx)(N,{id:`commonScreen.common.price`})]}),(0,X.jsxs)(L,{variant:`body3`,textAlign:`right`,fontWeight:600,display:`flex`,alignItems:`center`,gap:1,children:[sa(e.amount,En(e.amount)),(0,X.jsx)(`span`,{children:`@`}),(0,X.jsx)(`span`,{children:Lf({legs:e.legs,value:e.price})})]})]}),(0,X.jsx)(QuoteExpiresIn,{isEdited:y===e.block_rfq_quote_id,quote:e})]})]},e.block_rfq_quote_id))}),(0,X.jsxs)(UA,{children:[(0,X.jsx)(HA,{variant:`filled`,color:`error`,size:`xs`,isVisible:h.length>1,onClick:()=>{m(void 0),E()},children:(0,X.jsx)(N,{values:{0:h.length},id:`tradeScreen.blockRFQ.listOfQuotes.cancelAll`})}),(0,X.jsx)(VA,{}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(L,{variant:`helperText`,color:n({dark:`lightGray.200`,light:`darkGray.60`}),children:(0,X.jsx)(N,{id:`tradeScreen.blockTrade.timeTillExpiry`})}),(0,X.jsx)(TimeDisplay,{timestamp:t,size:`sm`,variant:`countdown`})]})]}),s&&(0,X.jsx)(ConfirmCancellationDialog,{variant:p?`quote`:`quoteList`,openQuotes:p?1:h.length,onDontShowAgainToggle:toggleDisableCancelBlockRfqQuoteConfirmationDialog,onConfirmClick:()=>E(p),onClose:()=>{c(!1),m(void 0)}})]})};V();var WA=P(L)(({theme:e})=>z`
1709    color: ${e.getColor({dark:`lightGray.100`,light:`darkGray.200`})};
1710    border-bottom: 1px dashed currentColor;
1711    width: fit-content;
1712    cursor: pointer;
1713  `);function AggregateMarkPrice(){let{state:{legsWithQuotes:e,amountValue:t}}=useMakerRfqContext(),n=(0,$.useMemo)(()=>[{legs:e,amount:t}],[e,t]),{blocks:r}=ep(n),{mark:i}=r[0],o=(0,$.useMemo)(()=>{if(i!==void 0)return Lf({legs:e,value:i})},[e,i]);return(0,X.jsxs)(I,{display:`flex`,flexDirection:`column`,gap:.75,justifySelf:`center`,children:[(0,X.jsx)(Mr,{body:(0,X.jsx)(L,{variant:`body3`,children:(0,X.jsx)(N,{id:`tradeScreen.blockRFQ.aggregatedMarkPriceTooltip`})}),disableInteractive:!0,placement:`top`,children:(0,X.jsx)(WA,{variant:`body3`,children:(0,X.jsx)(N,{id:`tradeScreen.blockRFQ.aggregatedMarkPrice`})})}),(0,X.jsx)(L,{children:o??`-`})]})}var GA=(0,$.memo)(AggregateMarkPrice);V();var KA=P(`div`)(({theme:e})=>z`
1714    padding: ${e.spacing(2)};
1715    display: grid;
1716    grid-template-columns: 2fr 7fr 4.1fr 2.8fr 4.1fr;
1717    gap: ${e.spacing(3)};
1718    align-items: center;
1719    height: 98px;
1720  `),qA=P(L)(({theme:e})=>z`
1721    color: ${e.getColor({dark:`lightGray.200`,light:`darkGray.60`})};
1722  `),JA=P(L)(({theme:e})=>z`
1723    font-weight: 600;
1724    color: ${e.getColor({dark:`lightGray.0`,light:`darkGray.100`})};
1725  `),YA=P(Ir)(()=>z`
1726    width: 20px;
1727    height: 20px;
1728  `),shouldShowAggregatePrice=e=>e.length>1&&ap(e)&&Uf(e)&&Ki.splitInstrument(e[0]?.instrument_name)?.kind!==`spot`;function StrategyAndAggregatedPrice({isBasisTrade:e,feeDiscount:t}){let{analyticsService:n}=Ru(),[r,i]=(0,$.useState)(),[o,s]=(0,$.useState)(),{state:{legsWithQuotes:c,isAggregatedAskFocused:p,isAggregatedBidFocused:m,isValidationError:h,strategyName:g},action:{isInputDisabled:_,setIsAggregatedBidFocused:v,setIsAggregatedAskFocused:y,setLegPricesBasedOnAggregatedPriceDebounced:b,setLegPricesBasedOnAggregatedPrice:x}}=useMakerRfqContext(),S=Ki.splitInstrument(c[0].instrument_name).settlement_currency,C=useGetBidAskHeaderColor(),w=Math.min(...c.map(e=>Ki.getInstrumentData(e.instrument_name).block_trade_tick_size)),T=g!==`Cross Currency Spread`;(0,$.useEffect)(()=>{c.every(e=>e.buy)?i(calculateAggregatePrice(c,`buy`)):i(void 0),c.every(e=>e.sell)?s(calculateAggregatePrice(c,`sell`)):s(void 0)},[c,w]);let handleBidAskValueChange=(e,t)=>
1728{e!==void 0&&(e!==0&&(t===`buy`?i(e):s(e)),b(e,t))};return(0,X.jsxs)(KA,{children:[T&&(0,X.jsxs)(I,{display:`flex`,flexDirection:`column`,gap:.75,children:[(0,X.jsx)(qA,{variant:`body3`,children:(0,X.jsx)(N,{id:`commonScreen.common.currency`})}),(0,X.jsxs)(I,{display:`flex`,alignItems:`center`,gap:1,children:[(0,X.jsx)(YA,{currency:S.toLowerCase()}),(0,X.jsx)(JA,{variant:`body2`,children:S})]})]}),(0,X.jsxs)(I,{display:`flex`,flexDirection:`column`,gap:.75,gridColumn:T?2:`span 2`,children:[(0,X.jsx)(qA,{variant:`body3`,children:(0,X.jsx)(N,{id:`commonScreen.common.strategy`})}),(0,X.jsxs)(I,{display:`flex`,alignItems:`center`,gap:1.5,children:[(0,X.jsx)(JA,{variant:`body2`,whiteSpace:`nowrap`,children:g}),e&&(0,X.jsx)(yf,{}),t&&(0,X.jsx)(gf,{feeDiscount:t,currency:S})]})]}),shouldShowAggregatePrice(c)&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(I,{display:`flex`,flexDirection:`column`,gap:.75,children:[(0,X.jsx)(ip,{tooltip:`maker-quotes`,children:(0,X.jsx)(L,{variant:`body3`,color:C(`buy`),children:(0,X.jsx)(N,{id:`commonScreen.common.bid`})})}),(0,X.jsx)(Id,{size:`md`,value:r,onChange:e=>handleBidAskValueChange(e,`buy`),step:w,isDisabled:_(`bid`),onFocusChange:v,isActive:m,onBlur:e=>{x(e,`buy`),n.trackEvent(`block_rfq_maker_set_aggregate_price`,{orderDirection:`buy`})},isError:h&&!_(`bid`)&&r===void 0,autoFocus:!0})]}),(0,X.jsx)(GA,{}),(0,X.jsxs)(I,{display:`flex`,flexDirection:`column`,gap:.75,children:[(0,X.jsx)(L,{variant:`body3`,color:C(`sell`),children:(0,X.jsx)(N,{id:`commonScreen.common.ask`})}),(0,X.jsx)(Id,{size:`md`,value:o,onChange:e=>handleBidAskValueChange(e,`sell`),step:w,isDisabled:_(`ask`),onFocusChange:y,isActive:p,onBlur:e=>{x(e,`sell`),n.trackEvent(`block_rfq_maker_set_aggregate_price`,{orderDirection:`sell`})},isError:h&&!_(`ask`)&&o===void 0})]})]})]})}var XA=(0,$.memo)(StrategyAndAggregatedPrice);function useQuoteValidation(e,t){let{state:{legsWithQuotes:n,amountValue:r,typeOfQuote:i,tradeDirection:o},action:{setIsValidationError:s}}=useMakerRfqContext();return(0,$.useCallback)(()=>{let c=(r||0)>=e,p=i===`twoWay`&&n.every(e=>e.buy&&e.sell),m=i===`oneWay`&&n.every(e=>e[o]);return c&&(p||m)&&!t?(s(!1),!0):(t&&Y.notify({isError:!0,message:R._({id:`tradeScreen.blockRFQ.makerDialog.priceTooSmallError`})}),s(!0),!1)},[r,t,n,e,s,o,i])}V();var ZA=P(`div`)(({theme:e})=>z`
1729    margin-top: auto;
1730    background-color: ${e.getColor({dark:`darkGray.80`,light:`lightGray.20`})};
1731    border-radius: 6px;
1732  `),QA=P(`div`)(({theme:e})=>z`
1733    display: flex;
1734    justify-content: space-between;
1735    align-items: center;
1736    margin-right: ${e.spacing(1.5)};
1737    width: 100%;
1738  `),MakerRfqDetailsDialog=({id:e,isOpen:t,onClose:n,amount:r,hedge:i,expirationTimestamp:o,amountStep:s,isBasisTrade:c,feeDiscount:p,takerRating:m,takerName:h,comboId:g})=>{let{analyticsService:_}=Ru(),{getColor:v}=rr(),y=Ti(),{state:{legsWithQuotes:b,editedQuoteId:x,typeOfQuote:S,tradeDirection:C,amountValue:w,isAllOrNone:T,strategyName:E,allQuotesExpanded:D,quoteTimerTimestamp:O,isLoadingLegPrices:k},action:{reset:ee,setComponentSettings:te}}=useMakerRfqContext(),A=Ki.isLinearInstrument(b[0].instrument_name),j=E===`Future Spread`&&!A,ne=B(t=>jk(t,e)),[M,re]=(0,$.useState)(!1),{setInterfaceSettings:ie,interfaceSettings:ae}=td(),oe=ae.disableShowBlockRfqMakerConfirmationDialog,{minBlockTradeAmount:se,isPriceTooSmall:ce}=useMinAmountValidation({amount:r,hedge:i}),le=useQuoteValidation(se,ce),toggleDisableShowBlockRfqMakerConfirmationDialog=()=>{ie(e=>({...e,disableShowBlockRfqMakerConfirmationDialog:!e.disableShowBlockRfqMakerConfirmationDialog}))},onSubmit=async()=>{if(!(!le()||k)&&w!==void 0){let getParams=t=>({block_rfq_id:e,amount:w,direction:t,legs:b.map(({instrument_name:e,direction:n,ratio:r,...i})=>({instrument_name:e,direction:n,ratio:r,...!j&&{price:i[t]}})),...j&&{price:calculateAggregatePrice(b,t)},execution_instruction:T?`all_or_none`:`any_part_of`,hedge:i,...x?{block_rfq_quote_id:x}:{},...O?{expires_at:(0,BS.default)().valueOf()+O}:{expires_at:x?0:void 0}}),addBlockRfqQuoteWithNotifications=async e=>{try{if(x)await y.editBlockRfqQuote({...e,block_rfq_quote_id:x}),_.trackEvent(`block_rfq_maker_quote_edited`);else{if(!oe&&!M){re(!0);return}await y.addBlockRfqQuote(e),_.trackEvent(`block_rfq_maker_quote_added`)}ee(),Y.notify({message:R._({id:`tradeScreen.blockRFQ.quoteSent`})}),re(!1)}catch(e){if(console.error(e),re(!1),!dd(e))return;e.data?.limit&&e.data.reason&&e.data?.instrument_name&&Y.notify({isError:!0,message:(0,X.jsxs)(I,{children:[e.data.reason,`:`,(0,X.jsx)(I,{paddingLeft:2,children:(0,X.jsxs)(`li`,{children:[Ri(e.data.instrument_name),`:`,` `,e.data.limit]})})]})})}};if(S===`twoWay`){addBlockRfqQuoteWithNotifications(getParams(`buy`)),addBlockRfqQuoteWithNotifications(getParams(`sell`));return}addBlockRfqQuoteWithNotifications(getParams(C))}},ue=Yu(Xf(()=>{onSubmit()})),de=D?R._({id:`tradeScreen.blockRFQ.collapseAll`}):R._({id:`tradeScreen.blockRFQ.expandAll`}),handleToggleQuotesExpanded=()=>{te(e=>({...e,allQuotesExpanded:!e.allQuotesExpanded}))};return(0,X.jsx)(Hf,{children:(0,X.jsxs)(mf,{isOpen:t,onClose:n,onKeyDown:ue,tabIndex:0,width:1115,height:690,twoParts:!0,children:[(0,X.jsxs)(mf.LeftContainer,{width:760,children:[(0,X.jsx)(mf.Header,{title:R._({id:`tradeScreen.blockRFQ.respondRfq`}),id:e,infoTooltipText:(0,X.jsx)(N,{components:{0:(0,X.jsx)(`br`,{}),1:(0,X.jsx)(`br`,{}),2:(0,X.jsx)(`strong`,{}),3:(0,X.jsx)(`strong`,{})},id:`tradeScreen.blockRfq.quoteDialog.respondTooltip`}),takerRating:m,takerName:h,withAdditionalPadding:!0}),(0,X.jsx)(FA,{legs:b,amount:r}),(0,X.jsx)(LegsDetails,{hedge:i}),(0,X.jsxs)(ZA,{children:[(0,X.jsx)(XA,{isBasisTrade:c,feeDiscount:p}),(0,X.jsx)(Footer$1,{amount:r,amountStep:s,onCancel:n,onSubmit,hedge:i,expirationTimestamp:o})]})]}),(0,X.jsxs)(mf.RightContainer,{background:v({dark:`darkGray.80`,light:`lightGray.80`}),children:[(0,X.jsx)(mf.Header,{title:(0,X.jsxs)(QA,{children:[(0,X.jsx)(L,{variant:`h5`,children:(0,X.jsx)(N,{id:`tradeScreen.blockRFQ.openQuotes`})}),ne.length>0&&(0,X.jsx)(H,{variant:`gray`,size:`xs`,startIcon:(0,X.jsx)(Ir,{name:D?`collapse`:`expand`}),onClick:handleToggleQuotesExpanded,children:de})]}),withCloseButton:!0}),(0,X.jsx)(ListOfQuotes,{blockRfqId:e,expirationTimestamp:o})]}),M&&(0,X.jsx)(MakerConfirmationDialog,{amount:!T&&w?w:r,isOpen:!0,hedge:i,onClose:()=>re(!1),onConfirmClicked:onSubmit,onDontShowAgainToggle:()=>{_.trackEvent(`block_rfq_maker_confirm_dont_show_again`),toggleDisableShowBlockRfqMakerConfirmationDialog()},onEditClicked:()=>re(!1),isBasisTrade:c,feeDiscount:p,comboId:g,takerName:h})]})})},ReviewBlockRfqDialogs=({blockRfqs:e,selectedBlockRfqId:t,onClose:n,initialPrice:r})=>{let{analyticsService:i}=Ru(),o=(0,$.useMemo)(()=>e.find(e=>e.block_rfq_id===t),[e,t]),s=(0,$.useCallback)(()=>{o&&i.trackEvent(o?.role===`taker`?`block_rfq_taker_trade_dialog_closed`:`block_rfq_maker_quote_dialog_closed`),n()}
1738,[i,n,o]);return(0,$.useEffect)(()=>{o?.block_rfq_id&&(o.role===`maker`&&i.trackEvent(`block_rfq_maker_quote_dialog_open`),o.role===`taker`&&i.trackEvent(`block_rfq_taker_trade_dialog_open`))},[i,o?.block_rfq_id,o?.role]),(0,X.jsxs)(X.Fragment,{children:[o&&o.role===`taker`&&(0,X.jsx)(TakerRFQDetailsDialog,{onClose:s,blockRfqId:o.block_rfq_id,legs:o.legs,amount:o.amount,makers:o.makers??[],expirationTimestamp:o.expiration_timestamp,bids:o.bids,asks:o.asks,hedgeLeg:o.hedge,isBasisTrade:o.isBasisTrade,feeDiscount:o.feeDiscount,comboId:o.combo_id,markPrice:o.mark,initialPrice:r,tradeTriggerOrder:o.trade_trigger}),o&&o.role===`maker`&&(0,X.jsx)(MakerRfqContextProvider,{legs:o.legs,amount:o.amount,comboId:o.combo_id,children:(0,X.jsx)(MakerRfqDetailsDialog,{onClose:s,id:o.block_rfq_id,amount:o.amount,hedge:o.hedge,expirationTimestamp:o.expiration_timestamp,takerRating:o.taker_rating,amountStep:o.min_trade_amount,isBasisTrade:o.isBasisTrade,feeDiscount:o.feeDiscount,takerName:o.taker,comboId:o.combo_id,isOpen:!0})})]})},getInfoAboutDisplayingLegs=(e,t)=>{let n=e.length+ +!!t>6;return{shouldShowSeeAllLegs:n,numberOfVisibleLegs:n?t?4:5:6}},getRowHeight=({data:e})=>{if(!e)return;let t=`hedge`in e?e.hedge:e.hedgeLeg;switch(Number(e?.legs.length)+ +!!t){case 1:case 2:case 3:return 100;case 4:return 122;case 5:return 146;default:return 170}};V();var $A=P(`div`)(({theme:e})=>z`
1739    display: flex;
1740    width: 322px;
1741    flex: 0 0 auto;
1742    flex-direction: column;
1743    justify-content: center;
1744    gap: ${e.spacing(.5)};
1745  `),ej=P(`div`)(()=>z`
1746    display: flex;
1747    align-items: center;
1748    justify-content: space-between;
1749  `),tj=P(L)(({theme:e})=>z`
1750    line-height: ${e.typography.body1.lineHeight};
1751    font-size: ${e.typography.body1.fontSize};
1752    font-weight: 600;
1753  `),areAllLegsWithRatio=e=>e.every(e=>e.ratio!==void 0);function LegAutoUpdate({instrumentName:e,legs:t,totalAmount:n}){let{price:r,amount:i,direction:o}=$f({legs:areAllLegsWithRatio(t)?t:[],hedgeLegInstrumentName:e,totalAmount:n});return(0,X.jsxs)(ej,{children:[(0,X.jsx)(Af,{instrumentName:e,orderDirection:o}),(0,X.jsxs)(tj,{textAlign:`right`,children:[i?sa(i,En(i)):`-`,` @`,` `,r?Lf({legs:[{instrument_name:e}],value:r}):`-`]})]})}function Legs({legs:e,hedgeLeg:t,autoUpdate:n,totalAmount:r,...i}){let{numberOfVisibleLegs:o,shouldShowSeeAllLegs:s}=getInfoAboutDisplayingLegs(e,t);return(0,X.jsxs)($A,{...i,children:[e.slice(0,o).map((e,t)=>(0,X.jsxs)(ej,{children:[(0,X.jsx)(Af,{instrumentName:e.instrument_name,orderDirection:e.direction,hasCurrencyIcon:!0,disablePadding:!0}),(0,X.jsx)(tj,{children:e.ratio?`${e.direction===`buy`?`+`:`-`}${e.ratio}`:`-`})]},`${e.instrument_name}-${t}`)),s&&(0,X.jsx)(tj,{variant:`body1`,children:`${R._({id:`tradeScreen.blockTrade.allLegs`})} (${e.length})`}),t&&(n&&r?(0,X.jsx)(LegAutoUpdate,{instrumentName:t.instrument_name,legs:e,totalAmount:r}):(0,X.jsxs)(ej,{children:[(0,X.jsx)(Af,{instrumentName:t.instrument_name,orderDirection:t.direction}),(0,X.jsxs)(tj,{textAlign:`right`,whiteSpace:`initial`,children:[t.amount?sa(t.amount,En(t.amount)):`-`,` `,`@`,` `,t.price&&t.amount?Lf({legs:[t],value:t.price}):`-`]})]}))]})}V();var nj=P(H)(({theme:e})=>z`
1754    text-wrap: nowrap;
1755    &:hover {
1756      background-color: ${e.palette.dsColors.error[200]};
1757      color: white !important;
1758    }
1759  `);function CancelButton({isMaker:e=!1,numberOfCurrentUserOrders:t,onCancel:n}){let r=B(pp),i=function(){return e&&t?t>1?`${R._({id:`tradeScreen.blockRFQ.listCard.cancelAll`})} (${t})`:R._({id:`tradeScreen.blockRFQ.listCard.cancelOrder`}):R._({id:`tradeScreen.blockRFQ.listCard.cancelRFQ`})}();return(0,X.jsx)(Nd,{isDisabled:r?.write,children:(0,X.jsx)(nj,{variant:`gray`,size:`xs`,onClick:e=>{e.stopPropagation(),n()},disabled:!r?.write,children:i})})}V();var rj=P(H)(({theme:e})=>z`
1760    width: 100%;
1761    border-top-right-radius: 0;
1762    border-top-left-radius: 0;
1763    background-color: ${e.getColor({dark:`darkGray.200`,light:`darkGray.100`})}${e.palette.mode===`dark`?`28`:`3C`};
1764  `),ij=P(`div`)(({theme:e})=>z`
1765    padding: ${e.spacing(2,2,1.5)};
1766    display: flex;
1767    justify-content: space-between;
1768  `),aj=P(`div`)(({theme:e})=>z`
1769    display: flex;
1770    gap: ${e.spacing(1)};
1771  `),oj=P(`div`)(({theme:e})=>z`
1772    display: flex;
1773    gap: ${e.spacing(1.5)};
1774    align-items: center;
1775  `),sj=P(H)(({theme:e})=>z`
1776    color: ${e.getColor({dark:`lightGray.80`,light:`darkGray.40`})};
1777    padding: 0px;
1778    min-width: 16px;
1779    height: 16px;
1780
1781    > div {
1782      height: 16px;
1783      width: 16px;
1784    }
1785
1786    &:hover {
1787      color: ${e.getColor({dark:`lightGray.200`,light:`darkGray.60`})};
1788    }
1789
1790    & .MuiSvgIcon-root {
1791      font-size: 16px !important;
1792    }
1793  `),cj=P(wf)(({theme:e})=>z`
1794    background-color: ${e.getColor({light:`darkGray.60`,dark:`darkGray.80`})};
1795    text-shadow: none;
1796
1797    .${vi.root} {
1798      color: ${e.getColor({default:`lightGray.0`})};
1799    }
1800  `),lj=P(Legs)(({theme:e})=>z`
1801    width: unset;
1802    .${vi.root} {
1803      font-size: ${e.typography.body3.fontSize};
1804      line-height: ${e.typography.body3.lineHeight};
1805      font-weight: ${e.typography.body3.fontWeight};
1806    }
1807  `),uj=P(`div`)(({theme:e})=>z`
1808    display: flex;
1809    justify-content: space-between;
1810    width: 100%;
1811    gap: ${e.spacing(1)};
1812
1813    .${vi.root} {
1814      font-size: ${e.typography.subtitle1.fontSize};
1815      line-height: ${e.typography.subtitle1.lineHeight};
1816      color: ${e.getColor({dark:`lightGray.0`,light:`darkGray.100`})};
1817    }
1818  `),dj=P(Rf)(({theme:e})=>z`
1819    max-height: unset;
1820    overflow-y: unset;
1821
1822    section:last-of-type {
1823      padding-top: ${e.spacing(1)};
1824    }
1825  `),fj=P(`div`)(({theme:e})=>z`
1826    display: flex;
1827    justify-content: flex-end;
1828    gap: ${e.spacing(1)};
1829    justify-self: flex-end;
1830  `),pj=P(H)(()=>z`
1831    min-width: 86px;
1832  `),mj=P(pj)(({theme:e})=>z`
1833    background-color: ${e.getColor({dark:`darkGray.80`,light:`lightGray.100`})};
1834    color: white !important;
1835
1836    &:hover {
1837      background-color: ${e.getColor({dark:`darkGray.60`,light:`lightGray.80`})};
1838    }
1839  `),hj=P(CancelButton)(({theme:e})=>z`
1840    min-width: 86px;
1841    background-color: ${e.getColor({dark:`darkGray.80`,light:`lightGray.100`})};
1842  `),gj=P(L)(({theme:e})=>z`
1843    color: ${e.getColor({dark:`lightGray.80`,light:`darkGray.60`})};
1844  `),_j=P(H)(({theme:e})=>z`
1845    background-color: transparent !important;
1846    color: ${e.getColor({default:`primary.200`})} !important;
1847  `),vj=P(wi)(()=>z`
1848    position: unset;
1849    justify-content: center;
1850    height: fit-content;
1851    flex-shrink: 0;
1852  `),yj=P(L,ai([`withLabel`]))(({withLabel:e})=>z`
1853    font-weight: bold;
1854    overflow: hidden;
1855    text-overflow: ellipsis;
1856    max-width: ${e?`135px`:`100%`};
1857    white-space: nowrap;
1858  `),bj=P(`div`)(({theme:e})=>z`
1859    display: flex;
1860    flex-direction: column;
1861    gap: ${e.spacing(1)};
1862    padding-top: ${e.spacing(1)};
1863  `),useCollapsibleBlockRfqDetails=e=>{let t=Pn(),[n,r]=(0,$.useState)(!0),[i,o]=(0,$.useState)(!1),s=(0,$.useRef)(null),c=(0,$.useMemo)(()=>jf({comboId:e.combo_id,legs:e.legs}),[e]),p=e.role===`taker`,m=(0,$.useCallback)(()=>{t(nd.updateBlockRfqs({...e,isIgnored:!e.isIgnored}))},[e,t]),h=(0,$.useCallback)(()=>{m(),o(!0),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{o(!1)},4e3)},[m]);return(0,$.useEffect)(()=>()=>{s.current&&clearTimeout(s.current)},[]),{expanded:n,setExpanded:r,isUndoVisible:i,setIsUndoVisible:o,toggleIgnoreRfq:m,handleIgnoreRfq:h,strategyName:c,isTaker:p}},BlockRfqDetailsContent=({blockRfq:e,isTaker:t,onCancel:n,onIgnore:r,onReview:i})=>(0,X.jsxs)(I,{display:`flex`,flexDirection:`column`,gap:1,children:[(0,X.jsx)(lj,{legs:e.legs,hedgeLeg:e.hedge}),(0,X.jsxs)(fj,{children:[t||!t&&e.numberOfQuotes?(0,X.jsx)(hj,{isMaker:!t,numberOfCurrentUserOrders:e.numberOfQuotes,onCancel:n}):(0,X.jsx)(mj,{size:`xs`,onClick:r,children:R._({id:`tradeScreen.blockRFQ.floatingWidget.ignore`})}),(0,X.jsx)(pj,{variant:`filled`,size:`xs`,onClick:i,children:R._({id:`tradeScreen.blockRFQ.floatingWidget.review`})})]})]}),UndoMessage=({toggleIgnoreRfq:e,setIsUndoVisible:t})=>(0,X.jsxs)(I,{display:`flex`,justifyContent:`center`,alignItems:`center`,children:[(0,X.jsx)(gj,{variant:`body3`,children:(0,X.jsx)(N,{id:`tradeScreen.blockRFQ.floatingWidget.ignoredRfq`})}),(0,X.jsx)(_j,{onClick:()=>{e(),t(!1)},children:(0,X.jsx)(N,{id:`tradeScreen.blockRFQ.floatingWidget.undo`})})]}),CollapsibleBlockRfqDetails=({blockRfq:e,onCancel:t,onReview:n})=>{let{expanded:r,setExpanded:i,isUndoVisible:o,toggleIgnoreRfq:s,handleIgnoreRfq:c,strategyName:p,isTaker:m,setIsUndoVisible:h}=useCollapsibleBlockRfqDetails(e);return e.isIgnored&&!o?null:(0,X.jsxs)(bj,{children:[o&&(0,X.jsx)(UndoMessage,{toggleIgnoreRfq:s,setIsUndoVisible:h}),!e.isIgnored&&(0,X.jsx)(dj,{title:(0,X.jsxs)(uj,{children:[(0,X.jsxs)(I,{display:`flex`,gap:1,alignItems:`center`,children:[m&&(0,X.jsx)(vj,{variant:`secondary`,children:(0,X.jsx)(N,{id:`tradeScreen.blockRFQ.myRfq`})}),(0,X.jsx)(yj,{withLabel:m,children:p})]}),(0,X.jsx)(TimeDisplay,{timestamp:e.expiration_timestamp,size:`sm`,variant:`countdown`})]}),expanded:r,setExpanded:()=>i(!r),children:(0,X.jsx)(BlockRfqDetailsContent,{blockRfq:e,isTaker:m,onCancel:()=>t(e),onIgnore:c,onReview:()=>n(e)})}),(0,X.jsx)(oi,{variant:`middle`})]})};V();var xj=P(`div`)(({theme:e})=>z`
1864    padding-bottom: ${e.spacing(1.5)};
1865  `),BlockRfqDetailsList=({blockRfqs:e,onCancel:t,onReview:n})=>(0,X.jsx)(xj,{children:(0,X.jsx)(I,{maxHeight:515,overflow:`auto`,children:e.map(e=>(0,X.jsx)(CollapsibleBlockRfqDetails,{blockRfq:e,onCancel:t,onReview:n},e.block_rfq_id))})});V();var Sj=P(`div`)(({theme:e})=>z`
1866    width: 300px;
1867    max-height: 620px;
1868    overflow-y: hidden;
1869    background-color: ${e.getColor({dark:`darkGray.20`,light:`lightGray.0`})}${e.palette.mode===`dark`&&`B3`};
1870    border-radius: ${e.shape.borderRadius}px;
1871    backdrop-filter: blur(30px);
1872  `),FloatingRfqInfoWidget=()=>{let e=yt(),{isFloatingWidgetActive:t,isDialogVisible:n,isDialogExpanded:r,positionProportions:i,onChangeSortOrderButtonClick:o,onExpandButtonClick:s,setPosition:c,blockRfqs:p,sortOrder:m,handleCancel:h,handleReview:g,selectedBlockRfqId:_,selectedBlockRfqData:v,reviewDialogOpen:y,cancelConfirmationOpen:b,toggleDisableCancelBlockRfqConfirmationDialog:x,toggleDisableCancelBlockRfqQuoteConfirmationDialog:S,setCancelConfirmationOpen:C,onCloseReviewDialog:w}=useFloatingWidget();if(!n||!t)return null;let T=p.filter(e=>!e.isIgnored).length;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(WindowAwareDraggableContainer,{setPosition:c,position:i,componentId:zu.BlockRfq,children:(0,X.jsxs)(Sj,{children:[(0,X.jsxs)(ij,{children:[(0,X.jsxs)(aj,{children:[(0,X.jsx)(L,{variant:`h6`,children:(0,X.jsx)(N,{id:`tradeScreen.blockRFQ.openRFQ`})}),(0,X.jsx)(cj,{size:`md`,variant:`light`,amount:T})]}),(0,X.jsxs)(oj,{children:[(0,X.jsx)(sj,{size:`xs`,variant:`plain`,"data-id":`sortBtn`,onClick:o,disabled:!T,children:(0,X.jsx)(Ir,{name:m===`newestFirst`?`sortDescending`:`sortAscending`})}),(0,X.jsx)(sj,{size:`xs`,variant:`plain`,"data-id":`expandBtn`,onClick:s,disabled:!T,children:(0,X.jsx)(Ir,{name:r?`chevronUp`:`chevronDown`})})]})]}),(0,X.jsx)(fu,{in:r,children:(0,X.jsx)(BlockRfqDetailsList,{blockRfqs:p,onCancel:h,onReview:g})}),(0,X.jsx)(rj,{variant:`gray`,onClick:()=>e(`/${jt.blockRfqs}`),children:R._({id:`tradeScreen.blockRFQ.openRFQList`})})]})}),b&&v&&(0,X.jsx)(ConfirmCancellationDialog,{variant:v.role===`taker`?`rfq`:v.numberOfQuotes&&v.numberOfQuotes>1?`quoteList`:`quote`,onConfirmClick:()=>h(v),onClose:()=>C(!1),onDontShowAgainToggle:v.role===`taker`?x:S,openQuotes:v.numberOfQuotes}),y&&(0,X.jsx)(ReviewBlockRfqDialogs,{blockRfqs:p,selectedBlockRfqId:_,onClose:w})]})},Cj=mi(FloatingRfqInfoWidget);V();var wj=P(Ir)(({theme:e})=>z`
1873    color: ${e.getColor({dark:`lightGray.100`,light:`darkGray.80`})};
1874    font-size: inherit;
1875  `),BrokerInviteModalHeader=({onClose:e})=>(0,X.jsxs)(I,{display:`flex`,alignItems:`center`,justifyContent:`space-between`,mb:4,children:[(0,X.jsx)(L,{variant:`h5`,children:(0,X.jsx)(N,{id:`tradeScreen.brokerInvite.title`})}),(0,X.jsx)(H,{onClick:e,size:`sm`,variant:`plain`,children:(0,X.jsx)(wj,{name:`close`})})]});V();var Tj=P(`div`,ai([`size`]))(({theme:e,size:t})=>z`
1876    flex: 0 0 auto;
1877    height: ${e.spacing(t)};
1878    min-width: ${e.spacing(t)};
1879  `);V();var Ej=P(`div`)(({theme:e})=>z`
1880    display: flex;
1881    justify-content: space-between;
1882    align-items: center;
1883    border-radius: 8px;
1884    gap: ${e.spacing(1.75)};
1885    padding: ${e.spacing(2)};
1886    background-color: ${e.getColor({dark:`darkGray.60`,light:`lightGray.80`})};
1887  `),BrokerInfoCard=({name:e,description:t,imageUrl:n})=>(0,X.jsxs)(Ej,{children:[(0,X.jsxs)(I,{display:`flex`,gap:1.5,children:[(0,X.jsx)(Tj,{size:5,children:(0,X.jsx)(aa,{name:`id-card`,size:5})}),(0,X.jsxs)(I,{display:`flex`,gap:.5,flexDirection:`column`,children:[(0,X.jsx)(L,{variant:`subt
1887itle1`,children:e}),(0,X.jsx)(L,{variant:`body4`,children:t})]})]}),n&&(0,X.jsx)(I,{maxHeight:40,children:(0,X.jsx)(`img`,{src:n,alt:`Broker logo`,style:{maxHeight:`40px`,aspectRatio:`auto`}})})]}),PendingInviteInformation=({name:e,variant:t})=>(0,X.jsx)(I,{display:`flex`,gap:1.75,flexDirection:`row`,"align-items":`center`,children:(0,X.jsxs)(I,{display:`flex`,flexDirection:`column`,gap:.5,maxWidth:t===`modal`?312:`100%`,children:[(0,X.jsx)(L,{variant:`h6`,children:(0,X.jsx)(N,{values:{name:e},id:`tradeScreen.brokerInvite.subtitle`})}),(0,X.jsx)(L,{variant:`body1`,children:(0,X.jsx)(N,{id:`tradeScreen.brokerInvite.description`})})]})}),Dj=P(L)`
1888  display: block;
1889  font-weight: 600;
1890`,PendingInviteWarning=()=>(0,X.jsx)(Tp,{severity:`warning`,children:(0,X.jsx)(Dj,{variant:`body3`,children:(0,X.jsx)(N,{id:`tradeScreen.brokerInvite.warning`})})});V();var Oj=P(H)(()=>z``),ActionButtons=({brokerInfo:e,variant:t})=>{let n=Pn(),r=B(Ci)===`main`,i=(0,$.useCallback)(async t=>{try{await Np(e=>n(xd.editLinkedBroker(e)).unwrap(),[{broker_code:e.broker_code,state:t,confirmations_required:!0,confirmations_shared:!1}]);let r={connected:(0,X.jsx)(N,{values:{0:e.name},id:`tradeScreen.phoneBrokers.invitationAccepted`}),rejected:(0,X.jsx)(N,{values:{0:e.name},id:`tradeScreen.phoneBrokers.invitationRejected`})};r[t]&&Y.notify({isSuccess:t===`connected`,isInfo:t===`rejected`,message:r[t]})}catch(e){Y.notify({isError:!0,message:(0,X.jsx)(N,{id:`tradeScreen.phoneBrokers.failedToHandleInvitation`})}),console.error(e)}},[e,n]);return(0,X.jsxs)(I,{display:`flex`,flexDirection:t===`modal`?`row-reverse`:`column`,gap:1.5,width:`fit-content`,justifySelf:`flex-end`,alignSelf:`flex-end`,children:[(0,X.jsx)(Oj,{variant:`filled`,size:`lg`,onClick:()=>i(`connected`),children:(0,X.jsx)(N,{id:`tradeScreen.brokerInvite.confirm`})}),r&&(0,X.jsx)(Oj,{variant:`bordered`,size:`lg`,onClick:()=>n(xd.toggleBrokerCorporateIdentityVisibility({broker_code:e.broker_code,lei_visible:!0,brn_visible:!0})),children:(0,X.jsx)(N,{id:`tradeScreen.brokerInvite.shareOnlyLeiBrn`})}),(0,X.jsx)(Oj,{variant:`gray`,size:`lg`,onClick:()=>i(`rejected`),children:(0,X.jsx)(N,{id:`tradeScreen.brokerInvite.denyRequest`})})]})};V();var kj=P(`div`)(({theme:e})=>z`
1891    display: flex;
1892    flex-direction: column;
1893    gap: ${e.spacing(2.5)};
1894  `),SupportIllustration=()=>(0,X.jsx)(Tj,{size:12.25,children:(0,X.jsx)(aa,{name:`support`,size:12.25})}),PendingInvitation=({brokerInfo:e,variant:t})=>(0,X.jsxs)(kj,{children:[(0,X.jsxs)(I,{display:`flex`,gap:2,alignItems:`center`,children:[t===`page`&&(0,X.jsx)(SupportIllustration,{}),(0,X.jsxs)(I,{display:`flex`,flexDirection:`column`,gap:1,flex:1,children:[(0,X.jsxs)(I,{display:`flex`,children:[(0,X.jsx)(PendingInviteInformation,{name:e.name,variant:t}),t===`modal`&&(0,X.jsx)(SupportIllustration,{})]}),(0,X.jsx)(BrokerInfoCard,{description:e.description,imageUrl:e.logo_url??``,name:e.name})]}),t===`page`&&(0,X.jsx)(ActionButtons,{brokerInfo:e,variant:t})]}),(0,X.jsx)(PendingInviteWarning,{}),t===`modal`&&(0,X.jsx)(ActionButtons,{brokerInfo:e,variant:t})]}),Aj=mi(PendingInvitation);V();var jj=P(br)(({theme:e})=>z`
1895    padding: ${e.spacing(3)};
1896    width: 472px;
1897    background-color: ${e.getColor({dark:`darkGray.200`,light:`lightGray.0`})};
1898
1899    > div {
1900      padding: 0;
1901    }
1902  `),Mj=mi(()=>{let e=Uu(mn),[t,n]=(0,$.useState)(!1);return(0,$.useEffect)(()=>{n(!!e)},[e]),!e||!t?null:(0,X.jsxs)(jj,{open:t,hasAction:!1,children:[(0,X.jsx)(BrokerInviteModalHeader,{onClose:()=>n(!1)}),(0,X.jsx)(Aj,{brokerInfo:e,variant:`modal`})]})});function BrokerageTradeSideTag({side:e}){let t=Dn(),n=e===`buy`?R._({id:`tradeScreen.brokerage.common.maker`}):R._({id:`tradeScreen.brokerage.common.taker`});return(0,X.jsx)(An,{label:n,size:`small`,color:t.getColor({default:`lightGray.0`}),backgroundColor:t.getColor({dark:e===`buy`?`success.200`:`secondary.80`,light:e===`buy`?`success.200`:`secondary.200`}),hasShadow:!0})}V();var Nj=P(`div`,ai([`textAlign`]))(({theme:e,textAlign:t=`left`})=>z`
1903    display: flex;
1904    flex-direction: column;
1905    justify-content: space-between;
1906    gap: ${e.spacing(.5)};
1907    text-align: ${t};
1908  `),Pj=P(tr(L,{variant:`body4`}))(({theme:e})=>z`
1909    color: ${e.getColor({dark:`lightGray.200`,light:`darkGray.60`})};
1910  `);V();var Fj=P(L,ai([`priceDirection`]))(({theme:e,priceDirection:t})=>t&&z`
1911      color: ${e.getColor({default:t===`you_pay`?`error.200`:`success.200`})};
1912    `),getPriceLabel=e=>e===`you_pay`?(0,X.jsx)(N,{id:`tradeScreen.brokerage.price.youPay`}):e===`you_get`?(0,X.jsx)(N,{id:`tradeScreen.brokerage.price.youGet`}):(0,X.jsx)(N,{id:`commonScreen.common.price`}),PriceDetail=({legs:e})=>{let{displayPrice:t,isSingleLegFuture:n,priceDirection:r}=Bf({legs:e});return n?null:(0,X.jsxs)(Nj,{textAlign:`right`,children:[(0,X.jsx)(Pj,{children:getPriceLabel(r)}),(0,X.jsx)(Fj,{variant:`h6`,priceDirection:r,children:t})]})};V();var getInstrumentsForEstimatedPM=(e,t)=>[...e,...t?[t]:[]].reduce((e,t)=>
1912({...e,[t.instrument_name]:{amount:t.amount,direction:t.direction}}),{}),Ij=P(`div`)(()=>z`
1913    display: flex;
1914    justify-content: space-between;
1915    align-items: center;
1916    grid-column: 1 / span 3;
1917  `),Lj=P(Pj)(()=>z`
1918    border-bottom: 1px dashed;
1919    max-width: fit-content;
1920    align-self: flex-end;
1921  `),Rj=P(L)(()=>z`
1922    filter: blur(2px);
1923    font-weight: 600;
1924  `),zj=P(Ir)(({theme:e})=>z`
1925    color: ${e.getColor({default:`primary.200`})};
1926    font-size: 16px;
1927  `),Bj=P(`div`)(({theme:e})=>z`
1928    display: flex;
1929    align-items: center;
1930    gap: ${e.spacing(.5)};
1931    cursor: pointer;
1932  `),TradePositionImpact=({isVisible:e,legs:t,direction:n,hedgeLeg:r})=>{let{quote_currency:i,isSpot:o}=Ki.splitInstrument(t[0].instrument_name)||{},s=(0,$.useMemo)(()=>({instruments:getInstrumentsForEstimatedPM(t,r)}),[t,r]),{pmMargins:c,refresh:p}=Qf();(0,$.useEffect)(()=>{c[n]===null&&p(s,n)},[n,s,p,c]);let m=(0,$.useMemo)(()=>{let e=n===`buy`?c.buy:c.sell,t=Or(i??``).force2Decimals?2:4;return e?sa(e,t):`-`},[n,c,i]);return o?null:(0,X.jsxs)(Ij,{children:[(0,X.jsxs)(Bj,{onClick:()=>e&&p(s,n),children:[(0,X.jsx)(rp,{tooltipName:`positionMMImpact`,children:(0,X.jsx)(Lj,{children:(0,X.jsx)(N,{id:`tradeScreen.orderForm.positionMMImpact`})})}),e&&(0,X.jsx)(zj,{name:`refresh`})]}),e?(0,X.jsx)(L,{variant:`body3`,fontWeight:600,children:m}):(0,X.jsx)(Rj,{variant:`body3`,children:m})]})};V();var Vj=P(`div`)(({theme:e})=>z`
1933    display: grid;
1934    grid-template-columns: repeat(3, auto);
1935    row-gap: ${e.spacing(.5)};
1936    column-gap: ${e.spacing(1.5)};
1937    padding: ${e.spacing(2)};
1938    border-radius: ${e.shape.borderRadius}px;
1939    background-color: ${e.getColor({dark:`darkGray.60`,light:`lightGray.80`})};
1940  `),Hj=P(oi)(({theme:e})=>z`
1941    grid-column: 1 / span 3;
1942    margin: ${e.spacing(1.5,0)};
1943  `),TradeConfirmationDetails=({comboId:e,role:t,legs:n,hedgeLeg:r,targetUserId:i})=>{let o=B(Bi),s=B(Di),c=t===`maker`?`buy`:`sell`,p=(0,$.useMemo)(()=>e?_f(e):n.length===1?_f(n[0].instrument_name):`Custom`,[e,n]);return(0,X.jsxs)(Vj,{children:[(0,X.jsxs)(Nj,{textAlign:`left`,children:[(0,X.jsx)(Pj,{children:(0,X.jsx)(N,{id:`commonScreen.common.strategy`})}),(0,X.jsx)(L,{variant:`h6`,children:p})]}),(0,X.jsxs)(Nj,{textAlign:`right`,children:[(0,X.jsx)(Pj,{children:(0,X.jsx)(N,{id:`commonScreen.common.side`})}),(0,X.jsx)(I,{children:(0,X.jsx)(BrokerageTradeSideTag,{side:c})})]}),(0,X.jsx)(PriceDetail,{legs:n}),s&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Hj,{}),(0,X.jsx)(TradePositionImpact,{isVisible:o===i,legs:n,hedgeLeg:r,direction:c})]})]})};V();var Uj=P(L)(({theme:e})=>z`
1944    color: ${e.getColor({dark:`lightGray.200`,light:`darkGray.60`})};
1945    font-size: ${e.typography.body3.fontSize};
1946    line-height: ${e.typography.body3.lineHeight};
1947  `),TradeLegHeading=({isHedgeLeg:e})=>(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Uj,{paddingLeft:2,children:e?(0,X.jsx)(N,{id:`tradeScreen.blockRFQ.Hedge.label`}):(0,X.jsx)(N,{id:`commonScreen.common.instrument`})}),(0,X.jsx)(Uj,{align:`right`,children:(0,X.jsx)(N,{id:`commonScreen.common.amount`})}),(0,X.jsx)(Uj,{align:`right`,children:(0,X.jsx)(N,{id:`commonScreen.common.price`})})]}),TradeLegRow=({leg:e})=>(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Af,{instrumentName:e.instrument_name,orderDirection:e.direction,disablePadding:!0}),(0,X.jsx)(L,{align:`right`,fontWeight:600,children:sa(e.amount,En(e.amount))}),(0,X.jsx)(L,{align:`right`,fontWeight:600,children:Lf({legs:[e],value:e.price})})]});V();var Wj=P(`div`)(({theme:e})=>z`
1948    display: grid;
1949    grid-template-columns: repeat(3, auto);
1950    gap: ${e.spacing(.5,1.5)};
1951    margin: ${e.spacing(1,0)};
1952    max-height: 180px;
1953    overflow-y: auto;
1954  `),Gj=P(I)(({theme:e})=>z`
1955    display: flex;
1956    flex-direction: column;
1957    gap: ${e.spacing(.5)};
1958  `),Kj=P(oi)`
1959  grid-column: span 3;
1960`,qj=P(L)`
1961  font-weight: 600;
1962`,TradeLegsAndTotalValues=({legs:e,hedgeLeg:t})=>{let{isSingleLegFuture:n,amountOfUnits:r,unitPrice:i,displayPrice:o}=Bf({legs:e});return(0,X.jsxs)(Wj,{children:[(0,X.jsx)(TradeLegHeading,{}),e.map(e=>(0,X.jsx)(TradeLegRow,{leg:e},e.instrument_name)),t&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(TradeLegHeading,{isHedgeLeg:!0}),(0,X.jsx)(TradeLegRow,{leg:t})]}),(0,X.jsx)(Kj,{}),n?(0,X.jsx)(`div`,{}):(0,X.jsxs)(Gj,{paddingLeft:2,children:[(0,X.jsx)(Uj,{children:(0,X.jsx)(N,{id:`tradeScreen.brokerage.clientTradeApproval.unitPrice`})}),(0,X.jsx)(qj,{children:i})]}),(0,X.jsxs)(Gj,{alignItems:`flex-end`,children:[(0,X.jsx)(Uj,{children:(0,X.jsx)(N,{id:`tradeScreen.brokerage.clientTradeApproval.amountOfUnits`})}),(0,X.jsx)(qj,{children:sa(r)})]}),(0,X.jsxs)(Gj,{alignItems:`flex-end`,children:[(0,X.jsx)(Uj,{children:(0,X.jsx)(N,{id:`tradeScreen.brokerage.clientTradeApproval.aggregatePrice`})}),(0,X.jsx)(qj,{children:o})]}),(0,X.jsx)(Kj,{})]})},Jj=(0,$.memo)(TradeLegsAndTotalValues),LoginStatusLabel=()=>{let e={value:R._({id:`tradeScreen.brokerage.clientTradeApproval.requireLogin`}),variant:`gray`};return(0,X.jsx)(wi,{labels:[e],position:`top-right`})};V();var Yj=P(`div`)(({theme:e})=>z`
1963    display: flex;
1964    position: relative;
1965    padding: ${e.spacing(1.5)};
1966    gap: ${e.spacing(1)};
1967    align-items: center;
1968    border-radius: ${e.shape.borderRadius}px;
1969    background-color: ${e.getColor({dark:`darkGray.60`,light:`lightGray.80`})};
1970    flex: 1;
1971  `),Xj=P(L)(()=>z`
1972    display: -webkit-box;
1973    overflow: hidden;
1974    text-overflow: ellipsis;
1975    line-clamp: 1;
1976    -webkit-line-clamp: 1;
1977    -webkit-box-orient: vertical;
1978  `),Zj=P(`img`)(()=>z`
1979    max-height: 20px;
1980  `),Qj=P(`div`)(({theme:e})=>z`
1981    display: flex;
1982    flex-direction: column;
1983    gap: ${e.spacing(1)};
1984  `),isBroker=e=>`broker_code`in e,PartyDetailsCard=({party:e})=>{let t=B(Bi),{getColor:n}=Dn(),r=isBroker(e),i=!r&&t===e.userId;return(0,X.jsxs)(Yj,{children:[!r&&!i&&!e.confirmations_shared&&(0,X.jsx)(LoginStatusLabel,{}),(0,X.jsx)(I,{maxHeight:40,children:(0,X.jsx)(aa,{name:r?`id-card`:`inactive-account`,size:5})}),(0,X.jsxs)(Qj,{children:[(0,X.jsxs)(I,{display:`flex`,gap:.5,flexDirection:`column`,children:[(0,X.jsx)(Xj,{variant:`body3`,fontWeight:600,children:r?e.name:e.username}),(0,X.jsxs)(L,{variant:`body4`,color:n({dark:`lightGray.80`,light:`darkGray.80`}),children:[r&&(0,X.jsx)(N,{id:`tradeScreen.brokerage.common.broker`}),!r&&!i&&(0,X.jsx)(N,{id:`tradeScreen.brokerage.mySubaccount`}),!r&&i&&(0,X.jsx)(N,{id:`tradeScreen.brokerage.myAccount`})]})]}),r&&(0,X.jsx)(I,{height:20,children:e.logo_url&&(0,X.jsx)(Zj,{src:e.logo_url,alt:e.name})}),!r&&(0,X.jsx)(An,{variant:`outlined`,hasBorder:!0,borderColor:n({dark:`lightGray.200`,light:`primary.200`}),color:n({dark:`lightGray.0`,light:`darkGray.100`}),label:`${R._({id:`tradeScreen.brokerage.common.userId`})}: ${e.userId}`})]})]})};V();var $j=P(`div`)(({theme:e})=>z`
1985    display: flex;
1986    align-items: center;
1987    gap: ${e.spacing(2)};
1988  `),PartyDetailsContainer=({broker:e,trade:t})=>(0,X.jsxs)($j,{children:[(0,X.jsx)(PartyDetailsCard,{party:e}),(0,X.jsx)(Ir,{name:`repeat`}),(0,X.jsx)(PartyDetailsCard,{party:{confirmations_shared:t.confirmations_shared,username:t.username,userId:t.user_id}})]});V();var eM=P(H)(()=>z`
1989    flex: 1;
1990    max-width: 150px;
1991    white-space: nowrap;
1992  `),TradeApprovalLoginWarning=({targetUserId:e})=>{let t=Ti(),n=B(kn),r=(0,$.useCallback)(async()=>{try{n?await t.loginToSubaccount({accountId:e}):await t.logout()}catch(e){console.log(e)}},[t,n,e]);return(0,X.jsxs)(I,{display:`flex`,flexDirection:`column`,gap:2,children:[(0,X.jsx)(Tp,{severity:`warning`,children:(0,X.jsx)(L,{variant:`body3`,children:(0,X.jsx)(N,{values:{targetUserId:e},id:`tradeScreen.brokerage.clientTradeApproval.warning`})})}),(0,X.jsxs)(I,{display:`flex`,gap:1.5,alignItems:`center`,justifyContent:`flex-end`,children:[!n&&(0,X.jsx)(Tp,{severity:`info`,children:(0,X.jsx)(L,{variant:`body3`,children:(0,X.jsx)(N,{id:`tradeScreen.brokerage.clientTradeApproval.switchAccountInfo`})})}),(0,X.jsx)(eM,{variant:`filled`,onClick:r,children:(0,X.jsx)(N,{id:`commonScreen.common.logIn`})})]})]})};V();var tM=e(e=>e.request_state===`expired`?{message:R._({id:`tradeScreen.brokerage.clientTradeApproval.tradeExpired`}),variant:`error`}:e.request_state===`cancelled`?{message:R._({id:`tradeScreen.brokerage.clientTradeApproval.tradeCancelled`}),variant:`error`}:e.state.value===`approved`?{message:R._({id:`tradeScreen.brokerage.clientTradeApproval.tradeApproved`}),variant:`success`}:{message:R._({id:`tradeScreen.brokerage.clientTradeApproval.tradeRejected`}),variant:`error`},`getMessages`),nM=P(`div`)(({theme:e})=>z`
1993    display: flex;
1994    justify-content: flex-end;
1995    gap: ${e.spacing(1.5)};
1996    padding-top: ${e.spacing(2)};
1997  `),rM=P(H)(()=>z`
1998    flex: 1;
1999    max-width: 150px;
2000    white-space: nowrap;
2001  `),TradeActionSection=({trade:e,currentUserId:t,hasEnoughPermissions:n,onReject:r,onApprove:i})=>{let o=t===e?.user_id||e?.confirmations_shared;if(e.request_state!==`pending`||e.state.value!==`initial`){let{message:t,variant:n}=tM(e);return(0,X.jsx)(Tp,{severity:n,children:t})}return o?(0,X.jsxs)(nM,{children:[(0,X.jsx)(Nd,{isDisabled:n,children:(0,X.jsx)(rM,{disabled:!n,variant:n?`gray`:`filled`,onClick:r,children:(0,X.jsx)(N,{id:`tradeScreen.brokerage.cancelTrade`})})}),(0,X.jsx)(Nd,{isDisabled:n,children:(0,X.jsx)(rM,{variant:`filled`,disabled:!n,onClick:i,children:(0,X.jsx)(N,{id:`tradeScreen.brokerage.clientTradeApproval.confirmTrade`})})})]}):(0,X.jsx)(TradeApprovalLoginWarning,{targetUserId:e.user_id})};V();var iM=P(`div`)(({theme:e})=>z`
2002    display: flex;
2003    flex-direction: column;
2004    margin-top: ${e.spacing(3)};
2005    gap: ${e.spacing(1.5)};
2006  `),aM=P(`div`)(()=>z`
2007    display: flex;
2008    flex-direction: column;
2009    align-items: center;
2010    justify-content: center;
2011  `),oM=P(tr(L,{variant:`body4`}))(({theme:e})=>z`
2012    color: ${e.getColor({dark:`lightGray.80`,light:`darkGray.60`})};
2013  `),sM=P(`div`)(({theme:e})=>z`
2014    display: flex;
2015    align-items: center;
2016    justify-content: space-between;
2017    width: 100%;
2018    gap: ${e.spacing(1)};
2019  `),cM=P(`div`)`
2020  display: flex;
2021  align-items: center;
2022`,lM=P(Pi)(({theme:e})=>z`
2023    padding: ${e.spacing(.25)};
2024    margin-right: ${e.spacing(1)};
2025  `),BrokerageClientTradeApprovalDialog=({onClose:e,pendingTrades:t,allTrades:n})=>{let r=B(Bi),i=Ti(),o=B(Rt),s=B(dp),[c,p]=(0,$.useState)(t);(0,$.useEffect)(()=>{p(e=>{let t=e.map(e=>n.find(t=>Ud(t)===Ud(e))??e),r=n.filter(t=>Xd(t)&&!e.some(e=>Ud(e)===Ud(t)));return r.length>0&&t.push(...r),t})},[n]);let[m,h]=(0,$.useState)(0),g=!!s?.write,_=c[m],v=_?o.find(e=>e.broker_code===_.broker_code):null,y=(0,$.useCallback)(async e=>{if(_)try{let t={role:_.role,timestamp:_.timestamp,nonce:_.nonce};await(e===`approve`?i.approvePendingBlockTrade(t):i.rejectPendingBlockTrade(t))}catch(e){dd(e)&&Y.notify({isError:!0,message:getErrorMessageFromDictionary(e)}),console.error(e)}},[_,i]);return!_||!v||t.length===0?null:(0,X.jsxs)(mf,{isOpen:!0,width:488,onClose:e,children:[(0,X.jsx)(mf.Header,{withCloseButton:!0,title:(0,X.jsxs)(sM,{children:[(0,X.jsxs)(L,{variant:`h5`,children:[R._({id:`tradeScreen.brokerage.clientTradeApproval.title`}),c.length>1&&` (${m+1}/${c.length})`]}),c.length>1&&(0,X.jsxs)(cM,{children:[(0,X.jsx)(lM,{disabled:m===0,onClick:()=>h(m-1),children:(0,X.jsx)(MC,{})}),(0,X.jsx)(lM,{disabled:m===c.length-1,onClick:()=>h(m+1),children:(0,X.jsx)(NC,{})})]})]})}),(0,X.jsxs)(iM,{children:[(0,X.jsx)(L,{children:(0,X.jsx)(N,{components:{0:(0,X.jsx)(`br`,{})},id:`tradeScreen.brokerage.clientTradeApproval.description`})}),(0,X.jsx)(PartyDetailsContainer,{broker:v,trade:_}),(0,X.jsxs)(L,{children:[(0,X.jsx)(N,{id:`tradeScreen.brokerage.tradeDetails`}),`:`]}
2025),(0,X.jsx)(TradeConfirmationDetails,{comboId:_.combo_id,role:_.role,legs:_.legs,hedgeLeg:_.hedgeLeg,targetUserId:_.user_id}),(0,X.jsx)(Jj,{legs:_.legs,hedgeLeg:_.hedgeLeg}),_.request_state===`pending`&&_.state.value===`initial`&&(0,X.jsxs)(aM,{children:[(0,X.jsx)(oM,{children:(0,X.jsx)(N,{id:`tradeScreen.blockTrade.timeTillExpiry`})}),(0,X.jsx)(TimeDisplay,{timestamp:_.expires_at,variant:`countdown`})]}),(0,X.jsx)(TradeActionSection,{trade:_,currentUserId:r,hasEnoughPermissions:g,onApprove:()=>y(`approve`),onReject:()=>y(`reject`)})]})]})},uM=mi(BrokerageClientTradeApprovalDialog),dM=6e4,BrokerageClientTradeApproval=()=>{let e=B(kd),t=(0,$.useMemo)(()=>e.filter(e=>Xd(e)).sort((e,t)=>e.timestamp-t.timestamp),[e]),[n,r]=(0,$.useState)(!!t.length),i=(0,$.useRef)([]);return(0,$.useEffect)(()=>{i.current=t.map(e=>{let t=Ud(e);return i.current.includes(t)||r(!0),t})},[t]),(0,$.useEffect)(()=>{if(t.length===0||n)return;let e=setInterval(()=>{t.length>0&&r(!0)},dM);return()=>clearInterval(e)},[t.length,n]),n?(0,X.jsx)(uM,{allTrades:e,pendingTrades:t,onClose:()=>r(!1)}):null},isBrokerTradeType=e=>e.every(e=>`state`in e&&`broker_code`in e),useExpiredTradeFilter=e=>{let t=(0,$.useRef)(null),n=Pn(),r=(0,$.useCallback)(t=>{t.length&&(isBrokerTradeType(e)?n(nd.setExpiredBrokerTradesById(t)):n(nd.setExpiredBrokerTradeRequestsById(t)))},[n,e]),i=(0,$.useCallback)(()=>{t.current&&=(clearTimeout(t.current),null);let n=Date.now(),[o,s]=ad(e,e=>e.expires_at<=n),c=o.map(e=>ud(e)),p=MS(s,[e=>e.expires_at])[0];if(c.length&&r(c),p){let e=p.expires_at;t.current=setTimeout(()=>{r([ud(p)]),i()},e-n)}},[e,r]);(0,$.useEffect)(()=>(i(),()=>{t.current&&clearTimeout(t.current)}),[i])},isBrokerTradeRequest=e=>`maker`in e&&`taker`in e&&!(`username`in e),isBlockTradeRequest=e=>`counterparty_state`in e,isBrokerTrade=e=>`state`in e&&`broker_code`in e,getMessages=e=>({brokerTrade:{user:{approved:R._({id:`notification.pendingBrokerTrade.approved`}),rejected:R._({id:`notification.pendingBrokerTrade.declined`})},counterparty:{approved:R._({id:`notification.pendingBrokerTrade.counterpartyApproved`}),rejected:R._({id:`notification.pendingBrokerTrade.counterpartyDeclined`})},broker:{cancelled:R._({id:`notification.pendingBrokerTrade.brokerRejected`})}},brokerTradeRequest:{maker:{approved:R._({id:`notification.pendingBrokerTradeRequest.makerApproved`,values:{partyName:e}}),rejected:R._({id:`notification.pendingBrokerTradeRequest.makerDeclined`,values:{partyName:e}})},taker:{approved:R._({id:`notification.pendingBrokerTradeRequest.takerApproved`,values:{partyName:e}}),rejected:R._({id:`notification.pendingBrokerTradeRequest.takerDeclined`,values:{partyName:e}})},cancelled:R._({id:`notification.pendingBrokerTradeRequest.cancelled`})}}),getChangeNotificationMessage=(e,t)=>{if(!Du(e,t)){if(e.request_state!==`expired`&&t.request_state===`expired`)return{message:R._({id:`notification.pendingBrokerTrade.expired`}),isError:!0};if(isBrokerTrade(e)&&isBrokerTrade(t)){let n=getMessages(),r=t.state.value,i=e.state.value,o=t.counterparty_state.value,s=e.counterparty_state.value;if(r!==`initial`&&r!==i)return{message:n.brokerTrade.user[r],isError:r===`rejected`};if(o!==`initial`&&o!==s)return{message:n.brokerTrade.counterparty[o],isError:o===`rejected`};if(t.request_state===`cancelled`)return{message:n.brokerTrade.broker.cancelled,isError:!0}}if(isBrokerTradeRequest(e)&&isBrokerTradeRequest(t)){let n=t.maker.state.value,r=e.maker.state.value,i=t.taker.state.value,o=e.taker.state.value;if(n!==`initial`&&n!==r)return{message:getMessages(t.maker.client_link_name).brokerTradeRequest.maker[n],isError:n===`rejected`};if(i!==`initial`&&i!==o)return{message:getMessages(t.taker.client_link_name).brokerTradeRequest.taker[i],isError:i===`rejected`};if(t.request_state===`cancelled`)return{message:getMessages().brokerTradeRequest.cancelled,isError:!0}}}},useBrokerageTradeNotifications=e=>{let t=yt(),n=(0,$.useRef)({});(0,$.useEffect)(()=>{let r=e.reduce((e,t)=>(e[ud(t)]=t,e),{});Object.entries(r).forEach(([e,r])=>{if(!n.current[e])return;let i=getChangeNotificationMessage(n.current[e],r);i&&Y.notify({isError:i.isError,message:i.message},{onClick:()=>{t(jt.brokerage)}})}),n.current=r},[e,t])};function isBrokerTradeRequestParty(e){return e!==void 0&&`client_id`in e}function isBrokerTradeParty(e){return!!(e&&`client_id`in e)}function createUnregisteredParty(e){return{...e||{state:{value:`initial`,timestamp:0}},client_link_name:R._({id:`tradeScreen.brokerage.unregistered`}),client_name:R._({id:`tradeScreen.brokerage.unregistered`}),confirmations_required:!0,user_id:void 0,is_unregistered:!0}}function transformUnregisteredParties(e){let{maker:t,taker:n}=e,r=isBrokerTradeRequestParty(t)?t:createUnregisteredParty(t),i=isBrokerTradeRequestParty(n)?n:createUnregisteredParty(n);return{...e,maker:r,taker:i}
2025}function transformUnregisteredClientParties(e){let t={value:`initial`,timestamp:0};return{...e,counterparty_state:{...t,...e.counterparty_state}}}function transformHistoricalUnregisteredParties(e){let{maker:t,taker:n}=e,r={client_link_name:R._({id:`tradeScreen.brokerage.unregistered`}),client_name:R._({id:`tradeScreen.brokerage.unregistered`}),confirmations_required:!0,user_id:void 0},i=isBrokerTradeParty(t)?t:r,o=isBrokerTradeParty(n)?n:r;return{...e,maker:i,taker:o}}function BrokerageExpiriesAndNotifications(){let e=B(Ad),t=B(Ld),n=B(kd),r=B(Fd),i=B(Jr),o=(0,$.useMemo)(()=>i?.state?t.map(transformUnregisteredParties):e.map(transformUnregisteredClientParties),[i?.state,t,e]),s=(0,$.useMemo)(()=>i?.state?r.map(transformUnregisteredParties):n.map(transformUnregisteredClientParties),[i?.state,r,n]);return useExpiredTradeFilter(o),useBrokerageTradeNotifications(s),null}var fM=`/assets/dark-CHsdD2Hc.svg`,pM=`/assets/light-Ci4joKs4.svg`;V();var mM=P(br,ai([`isMobile`]))(({theme:e,isMobile:t})=>z`
2026    padding: 0;
2027    max-width: ${t?`90%`:`450px`};
2028    width: ${t?`100%`:`auto`};
2029
2030    box-shadow: ${e.palette.mode===`dark`?`0 20px 24px -4px rgba(16, 24, 40, 0.08), 0 8px 8px -4px rgba(16, 24, 40, 0.03)`:`4px 4px 22px 0 rgba(0, 0, 0, 0.12)`};
2031
2032    background: ${e.palette.mode===`dark`?`linear-gradient(147deg, rgba(255, 204, 0, 0.20) 13.04%, rgba(255, 204, 0, 0.00) 50.36%), #181A1B`:`linear-gradient(147deg, rgba(229, 184, 0, 0.20) 13.04%, rgba(229, 184, 0, 0.00) 50.36%), #FFF`};
2033
2034    > div {
2035      display: flex;
2036      flex-direction: column;
2037      padding: 32px 24px;
2038      gap: ${e.spacing(3)};
2039    }
2040  `),hM=P(`div`)(({theme:e})=>z`
2041    display: inline-block;
2042    background: url(${e.palette.mode===`dark`?fM:pM});
2043    background-position: center;
2044    background-size: contain;
2045    width: 96px;
2046    height: 96px;
2047  `),gM=P(`div`)(({theme:e})=>z`
2048    display: flex;
2049    flex-direction: column;
2050    align-items: center;
2051    gap: ${e.spacing(3)};
2052  `),ServerMessagePopUp=()=>{let e=Gt(),t=Ti(),n=yt(),[r,i]=(0,$.useState)(``);(0,$.useEffect)(()=>{let getPopupMessage=async()=>{try{let{message:e}=await t.getPopupMessage();i(e.trim())}catch(e){console.error(e)}};getPopupMessage()},[t]);let closePopup=()=>i(``),handleContentClick=e=>{let t=e.target.closest(`a`);if(t?.href){let r=new URL(t.href);r.origin===window.location.origin&&r.pathname.startsWith(`/`)&&(e.preventDefault(),closePopup(),n(r.pathname+r.search+r.hash))}};return(0,X.jsxs)(mM,{open:!!r,hasAction:!1,hasTitleDivider:!1,isMobile:e,isAutoHeight:!0,onClose:closePopup,children:[(0,X.jsxs)(gM,{onClick:handleContentClick,children:[(0,X.jsx)(hM,{}),(0,X.jsx)(L,{textAlign:`center`,component:`div`,dangerouslySetInnerHTML:{__html:Pp.sanitize(r)}})]}),(0,X.jsx)(H,{fullWidth:!0,variant:`gray`,onClick:closePopup,children:(0,X.jsx)(N,{id:`commonScreen.common.close`})})]})},_M=mi(ServerMessagePopUp);Hn(),cw.default.polyfill();var vM=yd({productionPrefix:`deribit-`}),yM=new DesktopSessionsManager,App=()=>{let{deribitClient:e,env:t,featureToggles:n}=Oi(),{isNotesComponentEnabled:r,isMarginBufferEnabled:i}=n,o=ur(),{initialized:s,serverStatus:c,requestsOverLimit:p,connectionFailed:m}=useInitApiConnection({config:{deribitClient:e,isTest:t.isTest,isMarginBufferEnabled:i},notify:Y.notify,sessionsManager:yM});return c===503||c===502?(0,X.jsx)(Ct,{i18n:R,children:(0,X.jsx)(Cd,{generateClassName:vM,children:(0,X.jsx)(vr,{injectFirst:!0,children:(0,X.jsxs)(Et,{theme:o,children:[(0,X.jsx)(CssBaseline,{}),(0,X.jsx)(yT,{connectionFailed:m})]})})})}):p?(0,X.jsx)(Ct,{i18n:R,children:(0,X.jsx)(Cd,{generateClassName:vM,children:(0,X.jsx)(vr,{injectFirst:!0,children:(0,X.jsxs)(Et,{theme:o,children:[(0,X.jsx)(CssBaseline,{}),(0,X.jsx)(ErrorPage,{type:`overLimit`})]})})})}):(0,X.jsxs)(Ct,{i18n:R,children:[(0,X.jsx)(DocumentTitle,{title:R._({id:`commonScreen.browserTags.defaultTitle`})}),(0,X.jsx)(hf,{children:(0,X.jsx)(Cd,{generateClassName:vM,children:(0,X.jsx)(vr,{injectFirst:!0,children:(0,X.jsxs)(Et,{theme:o,children:[(0,X.jsx)(fp,{}),(0,X.jsxs)(Hd,{children:[(0,X.jsx)(CssBaseline,{}),(0,X.jsx)(ModalStaticVersion2,{}),(0,X.jsx)(Ok,{}),s&&(0,X.jsxs)(ef,{children:[(0,X.jsx)(ToastContainer,{}),(0,X.jsx)(of,{isMobile:!1}),(0,X.jsx)(Cj,{}),(0,X.jsx)(BlockRfqNotifications,{}),(0,X.jsx)(BrokerageExpiriesAndNotifications,{}),(0,X.jsx)(CookieConsent,{}),(0,X.jsx)(AppForceUpdate,{}),(0,X.jsx)(_t,{}),r&&(0,X.jsx)(NotesManager,{}),(0,X.jsx)(ProfileIdentifier,{}),(0,X.jsx)(BlockTradeApproval,{}),(0,X.jsx)(Mj,{}),(0,X.jsx)(BrokerageClientTradeApproval,{}),(0,X.jsx)(yk,{}),(0,X.jsx)(_M,{})]})]})]})})})})]})},bM=vd(()=>({root:{width:`30px`,height:`30px`,position:`absolute`,left:`calc(50% - 30px)`,top:`calc(50% - 30px)`}})),Spinner=()=>{let e=bM();return(0,X.jsx)(Zt,{color:`primary`,className:e.root})},withSuspense=e=>(0,X.jsx)($.Suspense,{fallback:(0,X.jsx)(Spinner,{}),children:e}),ProtectedRoute=({children:e})=>{let t=B(Ln);return(0,$.useEffect)(()=>{t||Zu.open({type:Mu.login})},[t]),e};function ScreenAction(){let e=yt(),t=useCreateAffiliate(B(ji)),n=useLinkActionHandling();return(0,$.useEffect)(()=>{t===!1&&n===!1&&e(`/futures/${window.location.search}`,{replace:!0})},[e,t,n]),(0,X.jsx)(X.Fragment,{})}var xM=`/assets/deribit-redirect-D1eiac5u.svg`;function ConfirmationCheckbox(e){return(0,X.jsx)(wp,{className:e.className,control:(0,X.jsx)(mp,{"data-id":e[`data-id`],size:`small`,checked:e.checked,onChange:e.onChange,name:`dontShowMeAgain`,color:`primary`}),label:e.label||R._({id:`tradeScreen.confirmation.dontShowAgain`})})}var validateUrl=e=>{if(e===`https://t.me/Deribit`)return!0;let t=[`deribit.com`,`coindesk.com`,`cointelegraph.com`,`bitcoinmagazine.com`,`theblock.co`];try{let{hostname:n,protocol:r}=new URL(e),i=r===`http:`||r===`https:`,o=t.some(e=>n===e||n.endsWith(`.${e}`));return i&&o}catch{return!1}};V();var SM=ld(`img`)`
2053  height: 56px;
2054`,CM=ld(`div`)(({theme:e})=>z`
2055    display: flex;
2056    flex-direction: column;
2057    justify-content: center;
2058    text-align: center;
2059    gap: ${e.spacing(1)};
2060  `);function StandardConfirmation({url:e,theme:t}){return(0,X.jsxs)(CM,{children:[(0,X.jsx)(L,{variant:`body2`,children:(0,X.jsx)(N,{id:`redirect.confirmation.description`})}),(0,X.jsx)(L,{variant:`body2`,color:t.palette.primary.light,children:(0,X.jsx)(`a`,{href:e,rel:`noreferrer noopener`,children:e})})]})}function TelegramConfirmation(){return(0,X.jsx)(L,{variant:`body2`,component:`div`,children:(0,X.jsx)(N,{components:{0:(0,X.jsx)(`p`,{}),1:(0,X.jsx)(`p`,{}),2:(0,X.jsx)(`p`,{})},id:`redirect.confirmation.telegramWarning`})})}function RedirectConfirmation(){let e=ur(),[t,n]=(0,$.useState)(!1),{interfaceSettings:r,setInterfaceSettings:i}=td(),o=r.disableLeavingDeribitConfirmation,[s]=Mn(),c=s.get(`to`);if(!c||!validateUrl(c))return(0,X.jsx)(xt,{to:`/`});let[p,m]=c===`https://t.me/Deribit`?[(0,X.jsx)(TelegramConfirmation,{}),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(ConfirmationCheckbox,{"data-id":`confirm`,checked:t,onChange:e=>n(e.target.checked),label:R._({id:`redirect.confirmation.telegramConfirmation`})}),(0,X.jsx)(H,{color:`primary`,variant:`contained`,href:t?c:``,disabled:!t,children:(0,X.jsx)(N,{id:`redirect.confirmation.goToTelegram`})})]})]:[(0,X.jsx)(StandardConfirmation,{url:c,theme:e}),(0,X.jsx)(ConfirmationCheckbox,{"data-id":`doNotShowAgain`,checked:o,onChange:e=>{i(t=>({...t,disableLeavingDeribitConfirmation:e.target.checked}))}})];return(0,X.jsx)(uT,{icon:(0,X.jsx)(SM,{src:xM,alt:`Deribit logo`}),iconHeight:56,title:R._({id:`redirect.confirmation.title`}),description:p,children:m})}var wM=mi(RedirectConfirmation);V(),Br();function isInvalidCodeError(e){return dd(e)&&e.code===-32602&&e.data.param===`code`}var TM=Hi(`div`)(({theme:e})=>z`
2061    margin: ${e.spacing(16)} auto 0;
2062    display: flex;
2063    flex-direction: column;
2064    align-items: center;
2065    gap: ${e.spacing(4)};
2066    width: 75%;
2067  `),EM=Hi(L)(({theme:e})=>z`
2068    font-size: ${e.typography.h2.fontSize};
2069    line-height: ${e.typography.h2.lineHeight};
2070    font-weight: 600;
2071    text-align: center;
2072  `),DM=Hi(L)(({theme:e})=>z`
2073    font-size: ${e.typography.h6.fontSize};
2074    line-height: 30px;
2075    text-align: center;
2076  `);function ScreenSecondaryEmailCodeConfirm(){let e=yt(),t=St(),n=Ti(),{co
2076de:r,mode:i}=t.state||{};window.history.replaceState({},document.title);let[o,s]=(0,$.useState)(!1),[c,p]=(0,$.useState)(!1);if((0,$.useEffect)(()=>{if(!r||!i)return e(`/`);let checkCode=async()=>{try{i===`set`?await n.setSecondaryEmailConfirm({code:r}):await n.removeSecondaryEmailConfirm({code:r}),s(!0)}catch(e){if(isInvalidCodeError(e)){p(!0);return}throw e}};checkCode()},[e,r,i,n]),!r||!i)return null;let{title:m,confirmInfo:h}=c?{title:R._({id:`secondaryEmailScreen.invalidLink.title`}),confirmInfo:R._({id:`secondaryEmailScreen.invalidLink.subtitle`})}:{title:R._({id:`secondaryEmailScreen.success.title`}),confirmInfo:R._({id:`secondaryEmailScreen.success.subtitle.set`})};return(0,X.jsxs)(TM,{children:[(0,X.jsx)(DocumentTitle,{title:R._({id:`secondaryEmailScreen.title`})}),(c||o)&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(EM,{children:m}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(DM,{children:h}),(0,X.jsx)(DM,{children:(0,X.jsx)(N,{id:`secondaryEmailScreen.secondaryEmailConfirmationStatusInfo`})})]}),(0,X.jsx)(H,{variant:`filled`,component:$n,to:`/account/BTC/wallet`,children:(0,X.jsx)(N,{id:`secondaryEmailScreen.button.goToWallet`})})]})]})}var OM=mi(ScreenSecondaryEmailCodeConfirm);V();var getErrorMessage=e=>dd(e)&&e?.data?.reason===`only for main accounts`?(0,X.jsx)(N,{id:`accountScreen.accountDeletionSubaccount`}):(0,X.jsx)(N,{id:`commonScreen.common.invalidOrExpiredCode`}),kM=P(`div`)(({theme:e})=>z`
2077    display: flex;
2078    flex-direction: column;
2079    align-items: center;
2080    justify-content: center;
2081    flex-grow: 1;
2082    height: 100vh;
2083    gap: ${e.spacing(1)};
2084    position: relative;
2085  `),AM=P(`div`)(({theme:e})=>z`
2086    position: absolute;
2087    top: 0;
2088    padding: ${e.spacing(2,0)};
2089  `),jM=P(H)(({theme:e})=>z`
2090    margin-top: ${e.spacing(2)};
2091  `),MM=P(tr(L,{variant:`body2`}))(({theme:e})=>z`
2092    text-align: center;
2093    width: 100%;
2094    max-width: 700px;
2095
2096    padding: ${e.spacing(1,2.25)};
2097    color: ${e.palette.mode===`dark`?e.palette.dsColors.lightGray[80]:e.palette.dsColors.darkGray[60]};
2098    border-bottom: 1px solid
2099      ${e.palette.mode===`dark`?e.palette.dsColors.darkGray[10]:e.palette.dsColors.lightGray[200]};
2100  `),CloseAccount=()=>{let e=Ti(),t=Uu(Ln),[n,r]=(0,$.useState)(`idle`),[i,o]=(0,$.useState)(),s=yt(),c=St(),{lang:p}=Ep(),{code:m}=c.state||{};if((0,$.useEffect)(()=>{let deleteAccount=async()=>{if(!t){s(`/login`);return}if(!m){r(`error`);return}try{await e.deleteAccount({code:m}),r(`success`)}catch(e){console.log(e),r(`error`),o(e)}};deleteAccount()},[m,e,t,s]),n!==`success`)return n===`error`&&(Y.notify({isError:!0,message:getErrorMessage(i)}),s(`/futures/BTC-PERPETUAL`)),null;let h=new URL(`/${p}/?noredirect`,window.location.origin);return(0,X.jsxs)(kM,{children:[(0,X.jsx)(AM,{children:(0,X.jsx)(sn,{width:128})}),(0,X.jsx)(I,{width:256,children:(0,X.jsx)(aa,{name:`shredder`})}),(0,X.jsx)(L,{variant:`h1`,fontWeight:700,textAlign:`center`,children:(0,X.jsx)(N,{id:`serviceScreen.accountRemoval.title`})}),(0,X.jsx)(MM,{children:(0,X.jsx)(N,{components:{0:(0,X.jsx)(`br`,{}),1:(0,X.jsx)(`br`,{})},id:`serviceScreen.accountRemoval.body`})}),(0,X.jsx)(jM,{variant:`filled`,href:h.toString(),children:(0,X.jsx)(N,{id:`serviceScreen.accountRemoval.button`})})]})},NM=mi(CloseAccount),OAuth=()=>{let e=Ti(),t=yt(),[n]=Mn(),{oAuthData:r}=useOAuthData();return(0,$.useEffect)(()=>{let e=n.get(`state`),i=n.get(`code`),o=n.get(`error`);if(!r){t(`/login`);return}if(o){t(`/login`),Y.notify({isError:!0,message:R._({id:`common.oAuthError.authenticationCanceled`})});return}if(r.type===`tfaSetup`){t(`../tfa_setup`,{state:{stateParam:e,authCodeParam:i}});return}if(r.type===`signUp`){t(`/register`,{state:{stateParam:e,authCodeParam:i}});return}if(r.type===`login`){t(`/login`,{state:{stateParam:e,authCodeParam:i}});return}},[e,n,t,r]),null};V();var PM=20,FM=`https://www.coinbase.com`,IM=P(`div`)(({theme:e})=>z`
2101    text-align: center;
2102    color: ${e.getColor({default:`lightGray.80`})};
2103  `),CoinbaseOnboardingMovedScreen=()=>(0,X.jsx)(ir,{forceTheme:`dark`,children:(0,X.jsx)(uT,{icon:(0,X.jsx)(aa,{name:`bulb`,size:PM,variantOverride:`dark`}),iconHeight:PM,title:R._({id:`registerScreen.coinbaseSignUp.moved.title`}),description:(0,X.jsxs)(IM,{children:[(0,X.jsx)(L,{variant:`body2`,component:`p`,children:(0,X.jsx)(N,{id:`registerScreen.coinbaseSignUp.moved.description`})}),(0,X.jsx)(I,{mt:4,children:(0,X.jsx)(kr,{href:FM,children:(0,X.jsx)(H,{children:(0,X.jsx)(N,{id:`registerScreen.coinbaseSignUp.moved.button`})})})})]})})}),LM=`coinbase-sign-up`,CoinbaseSignUpRoute=()=>{let{isValid:e}=useCoinbaseSignUpParams();return e?(0,X.jsx)(lD,{action:`coinbaseSignUp`}):(0,X.jsx)(CoinbaseOnboardingMovedScreen,{})};function VerificationSuccess(){return(0,X.jsx)(`div`,{style:{textAlign:`center`},children:(0,X.jsx)(`p`,{children:(0,X.jsx)(N,{id:`accountScreen.verification.verificationSuccess.user`})})})}function ResidenceVerificationSuccess(){return(0,X.jsx)(`div`,{style:{textAlign:`center`},children:(0,X.jsx)(`p`,{children:(0,X.jsx)(N,{id:`accountScreen.verification.residenceVerificationSuccess`})})})}var RM={211:0,310:1,311:2,320:3,9200:4,9210:5,9100:6,9300:7,9400:8,9801:9,9810:10,9820:11,9822
2103:12};function getJumioErrorMessage(e){let t=RM[e];switch(console.log(t,e),t){case 0:case 1:case 3:case 4:case 5:return R._({id:`accountScreen.verification.verificationError.verificationSessionProblem`});case 6:case 7:case 8:case 9:case 10:return R._({id:`accountScreen.verification.verificationError.verificationProblem`});case 11:case 12:return R._({id:`accountScreen.verification.verificationError.cameraNotAvailable`});default:return`Unknown error`}}function VerificationError(){let e=+Ou(St().search).error_code,t=e?getJumioErrorMessage(e):`Unknown error`;return(0,X.jsx)(`div`,{style:{textAlign:`center`},children:(0,X.jsx)(`p`,{children:t})})}var zM=vd(({palette:e})=>({mainContainer:{height:`100%`,backgroundColor:e.background.fullScreenDialog},logoContainer:{paddingTop:`32px`,paddingBottom:`32px`},formContainer:{backgroundColor:e.background.paper,width:`400px`,padding:`24px`},appNameContaner:{fontSize:`20px`},selectInputContainer:{width:`100%`},tfaInputContainer:{width:`100%`,margin:`12px 0px`},scopeTableContainer:{paddingBottom:`8px`},buttonsContainer:{paddingTop:`12px`}})),ScreenAppAuthorization=()=>{let e=zM(),{globalDomain:t}=Oi(),n=Ti(),r=St(),i=B(ji);useCreateAffiliate(i);let[o,s]=(0,$.useState)({response_type:`token`,client_id:``,redirect_uri:``,fixed_redirect_uri:``,scope_string:``,current_uid:0,state:``,app_icon:``,app_name:``,app_host:``,app_home_page:``,accounts:[],scope_map:{}}),[c,p]=(0,$.useState)(!0),[m,h]=(0,$.useState)(``),[g,_]=(0,$.useState)(0),v=(0,$.useCallback)(async()=>{try{let e=await Np(n.authorizeApp.bind(n),[{response_type:o.response_type,client_id:o.client_id,redirect_uri:o.redirect_uri,scope:o.scope_string,state:o.state,uid:g}]);window.location.href=e.redirect_uri}catch(e){e?.code===13100&&Y.notify({isError:!0,message:R._({id:`appAuthorizationScreen.consentForm.existingApplicationApiKeyIsDisabled`})}),console.log(e)}},[o,g,n]);(0,$.useEffect)(()=>{let init=async()=>{let e=decodeURIComponent(r.search.replace(/\+/g,` `)),t=Ou(e);try{let e=await n.checkApp(t);if(e?.result){let t=e?.result.data;typeof t==`string`&&t.includes(`http`)?window.location.href=t:(s(t),_(t.current_uid)),p(!1)}else if(e?.error){let t=e.error;t.data?.param===`scope`?h(R._({id:`appAuthorizationScreen.consentForm.invalidOrMalformedScope`})):t.code===13100?h(R._({id:`appAuthorizationScreen.consentForm.existingApplicationApiKeyIsDisabled`})):h(R._({id:`commonScreen.common.someErrorOccurred`})),p(!1)}}catch(e){console.log(e)}};i?(of.close(),init()):Zu.open({type:Mu.login})},[r.search,i,n]);let y=(0,X.jsx)(bp,{component:`button`,onClick:()=>{Zu.open({type:Mu.login})},children:(0,X.jsx)(N,{id:`commonScreen.common.here`})}),b=(0,X.jsx)(bp,{target:`_blank`,rel:`noopener noreferrer`,href:`https://docs.${t}/#access-scope`,children:(0,X.jsx)(N,{id:`commonScreen.common.documentation`})});return(0,X.jsxs)($i,{container:!0,alignItems:`center`,className:e.mainContainer,children:[(0,X.jsx)(up,{isLoading:c}),(0,X.jsxs)($i,{container:!0,item:!0,alignItems:`center`,direction:`column`,children:[(0,X.jsx)($i,{item:!0,className:e.logoContainer,children:(0,X.jsx)(`a`,{href:`./`,children:(0,X.jsx)(sn,{width:128})})}),(0,X.jsxs)($i,{container:!0,item:!0,className:e.formContainer,alignItems:`center`,direction:`column`,spacing:1,children:[(0,X.jsx)($i,{item:!0,children:(0,X.jsx)(`h1`,{children:(0,X.jsx)(N,{id:`appAuthorizationScreen.consentForm.authorizeApplication`})})}),m?(0,X.jsx)(xp,{type:`error`,children:m}):(0,X.jsxs)(X.Fragment,{children:[o.app_icon&&(0,X.jsx)($i,{item:!0,children:(0,X.jsx)(`img`,{height:`80px`,className:`app_icon`,src:o.app_icon,alt:o.app_name})}),(0,X.jsx)($i,{item:!0,className:e.appNameContaner,children:o.app_name}),o.app_host&&(0,X.jsx)($i,{item:!0,children:(0,X.jsx)(bp,{href:o.app_home_page,target:`_blank`,rel:`noopener noreferrer`,children:o.app_host})}),g&&(0,X.jsx)($i,{item:!0,className:e.selectInputContainer,children:(0,X.jsx)(Mp,{onChange:e=>_(e.target.value),value:g,fullWidth:!0,children:o.accounts?.map(({username:e,uid:t,type:n})=>(0,X.jsxs)(Ii,{value:t,children:[e,` `,n===`main`&&`(main)`]},t))})}),(0,X.jsx)($i,{item:!0,children:(0,X.jsx)(N,{values:{linkToLoginForm:y},id:`appAuthorizationScreen.consentForm.clickToUseDifferentAccount`})}),(0,X.jsx)($i,{item:!0,children:(0,X.jsx)(`p`,{children:(0,X.jsx)(N,{id:`appAuthorizationScreen.consentForm.applicationRequiresAccessToTheFollowingScopes`})})}),(0,X.jsxs)($i,{container:!0,item:!0,spacing:1,className:e.scopeTableContainer,children:[(0,X.jsx)($i,{item:!0,xs:6,children:(0,X.jsx)(`b`,{children:(0,X.jsx)(N,{id:`commonScreen.common.type`})})}),(0,X.jsx)($i,{item:!0,xs:6,children:(0,X.jsx)(`b`,{children:(0,X.jsx)(N,{id:`commonScreen.common.access`})})}),(0,X.jsx)($i,{item:!0,xs:12,children:(0,X.jsx)(Cp,{})}),o.scope_map&&Object.entries(o.scope_map).map(([e,t])=>(0,X.jsxs)($.Fragment,{children:[(0,X.jsx)($i,{item:!0,xs:6,children:e}),(0,X.jsx)($i,{item:!0,xs:6,children:t})]},e))]}),(0,X.jsxs)($i,{item:!0,children:[(0,X.jsx)(`b`,{children:(0,X.jsx)(N,{id:`appAuthorizationScreen.consentForm.note`})}),` `,(0,X.jsx)(N,{id:`appAuthorizationScreen.consentForm.applicationWillBeAbleToAccessYourSubaccounts`})]}),(0,X.jsx)($i,{item:!0,children:(0,X.jsx)(N,{values:{linkToAccessScopeDocumentation:b},id:`appAuthorizationScreen.consentForm.moreInformationAboutAccessScopes`})}),(0,X.jsxs)($i,{container:!0,item:!0,justifyContent:`center`,spacing:2,className:e.buttonsContainer,children:[(0,X.jsx)($i,{item:!0,xs:6,children:(0,X.jsx)(Dd,{onClick:()=>window.location.href=`${o.fixed_redirect_uri}
2103?error=access_denied`,color:`primary`,variant:`outlined`,fullWidth:!0,children:(0,X.jsx)(N,{id:`commonScreen.common.deny`})})}),(0,X.jsx)($i,{item:!0,xs:6,children:(0,X.jsx)(Dd,{onClick:v,color:`primary`,variant:`contained`,fullWidth:!0,children:(0,X.jsx)(N,{id:`commonScreen.common.approve`})})})]})]})]})]})]})},BM=kp({root:{fontWeight:500,fontSize:`13px`}})(L);vd({container:{paddingTop:`8px`,paddingBottom:`8px`,display:`flex`},title:{width:`320px`,display:`flex`,paddingTop:`8px`},input:{display:`flex`,alignItems:`start`},explanation:{display:`flex`,flexDirection:`column`},filler:{height:`10px`,width:`100%`},buttons:{display:`flex`,justifyContent:`flex-end`,paddingTop:`4px`,paddingBottom:`12px`},mobileContainer:{display:`flex`,flexDirection:`column`},mobileTitleCheckboxContainer:{paddingTop:`8px`,paddingBottom:`8px`,display:`flex`,justifyContent:`space-between`},mobileTitle:{justifyContent:`space-between`,display:`flex`,paddingTop:`8px`},mobileExplanation:{marginRight:`30px`},divider:{paddingTop:`15px`}});var VM=vd(e=>({root:{display:`flex`,justifyContent:`flex-end`,position:`absolute`,top:`24px`,right:`18px`,gap:`8px`,[e.breakpoints.down(`lg`)]:{position:`initial`,justifyContent:`flex-start`,paddingBottom:`16px`},[e.breakpoints.down(`md`)]:{flexDirection:`column`}}})),HeaderButtons=({children:e})=>{let t=VM();return(0,X.jsx)(`div`,{className:t.root,children:$.Children.map(e,(e,t)=>(0,X.jsx)(`div`,{children:e},t))})},HM=vd(e=>({paper:({noPadding:t})=>({width:`100%`,position:`relative`,borderRadius:`6px`,padding:t===!0?`20px 20px 20px 0`:`20px`,[e.breakpoints.down(`sm`)]:{paddingRight:0}}),sectionContainer:{display:`flex`,justifyContent:`space-between`,flexDirection:`column`,padding:`0px`,marginBottom:`24px`},titleContainer:{display:`flex`,flexDirection:`row`,alignItems:`center`,marginBottom:`8px`,justifyContent:`space-between`},iconContainer:{marginTop:`7px`},sectionTitle:{fontSize:`24px`,lineHeight:`32px`,fontWeight:700},subsectionTitle:{fontSize:`20px`,lineHeight:`28px`,fontWeight:700},currencyTitle:{fontSize:`24px`,color:e.palette.type===`dark`?`#CCCFD1`:`#404649`,paddingLeft:`8px`},sectionSubtitle:{color:e.palette.type===`dark`?`#CCCFD1`:`#404649`,marginBottom:`4px`},section2:{padding:`0px`,flex:1},input:{flex:1},inputPaper:{border:`1px solid ${e.palette.divider}`,display:`flex`,alignItems:`center`,width:`100%`,height:e.spacing(4.5),boxSizing:`border-box`,"&:focus-within":{borderColor:e.palette.primary.main}},root:{width:`100%`,backgroundColor:e.palette.background.paper}}));function Section({title:e,subheader:t,height:n,children:r,headerButtons:i,noPadding:o=!1,scrollable:s=!1,currency:c,transparent:p}){let m=HM({noPadding:o}),h={height:n,overflow:s?`auto`:`initial`};return p&&(h.background=`transparent`),(0,X.jsxs)(Fr,{className:m.paper,style:h,children:[(e||t)&&(0,X.jsxs)(`div`,{className:m.sectionContainer,children:[(0,X.jsxs)(`div`,{className:m.titleContainer,children:[(0,X.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`},children:[c&&(0,X.jsx)(`div`,{className:m.iconContainer,children:(0,X.jsx)(Ir,{currency:c.toLowerCase()})}),(0,X.jsx)(`div`,{className:m.sectionTitle,style:{paddingLeft:c?`8px`:`0px`},children:e}),(0,X.jsx)(`div`,{className:m.currencyTitle,children:c?.toUpperCase()})]}),(0,X.jsx)(`div`,{children:i})]}),(0,X.jsx)(`div`,{children:(0,X.jsx)(`div`,{className:m.sectionSubtitle,children:t})})]}),(0,X.jsx)(`div`,{className:m.section2,style:{height:!e&&!t&&n?n:void 0},children:r})]})}var UM=kp(e=>({root:{marginRight:e.spacing(.5),marginBottom:e.spacing(.5)}}))(Vi),WM=vd(()=>({root:{display:`flex`,justifyContent:`center`,alignItems:`center`,flexGrow:`1`}}));function NotAvailableInfo({children:e}){let t=WM();return(0,X.jsx)(`h1`,{className:t.root,children:e})}var GM=vd(({palette:e})=>({tableContainer:{borderStyle:`solid`,borderWidth:`1px`,borderRadius:`8px`,borderColor:e.background.main},tableRow:{borderStyle:`solid`,borderWidth:`0px`,borderBottomWidth:`1px`,borderColor:e.background.main}})),CouponActivation=()=>{let e=GM(),t=Ti(),[n,r]=(0,$.useState)(),i=B(Ci),{couponCode:o}=vt(),s=yt(),c=(0,$.useCallback)(()=>{Y.notify({isError:!0,message:R._({id:`commonScreen.error.11050-invalid-coupon-code`})}),s(`/`,{replace:!0})},[s]),p=(0,$.useCallback)(async()=>
2103{if(!o){c();return}try{await t.activateCoupon({code:o}),Y.notify({message:(0,X.jsx)(N,{id:`commonScreen.common.couponActivated`})}),s(`/`,{replace:!0})}catch(e){console.log(e)}},[o,c,s,t]);return(0,$.useEffect)(()=>{let fetchCoupon=async()=>{if(!o){c();return}try{let e=await t.getCouponDetails({code:o});e.for_registration?c():r(e)}catch(e){console.log(e),s(`/`,{replace:!0})}};i===`main`&&fetchCoupon()},[o,i,c,s,t]),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(DocumentTitle,{title:R._({id:`couponActivationScreen.title`})}),(0,X.jsxs)(uf,{children:[!i&&(0,X.jsx)(NotAvailableInfo,{children:(0,X.jsx)(N,{id:`commonScreen.common.couponNotLoggedIn`})}),i===`subaccount`&&(0,X.jsx)(NotAvailableInfo,{children:(0,X.jsx)(N,{id:`commonScreen.common.noAccess`})}),n&&(0,X.jsx)($i,{container:!0,justifyContent:`center`,padding:`64px 8px`,children:(0,X.jsx)($i,{item:!0,xs:12,md:8,lg:6,xl:4,children:(0,X.jsx)(Section,{title:R._({id:`couponActivationScreen.title`}),children:(0,X.jsxs)($i,{container:!0,spacing:2,children:[(0,X.jsx)($i,{item:!0,xs:12,children:(0,X.jsx)(L,{gutterBottom:!0,variant:`body1`,children:(0,X.jsx)(N,{id:`commonScreen.common.activateCoupon`})})}),(0,X.jsx)($i,{item:!0,xs:12,sm:12,md:7,children:(0,X.jsx)(pn,{className:e.tableContainer,children:(0,X.jsx)(mr,{size:`small`,children:(0,X.jsx)(gr,{children:getCouponDetailsDefs(n).map(({key:t,value:n})=>(0,X.jsxs)(nr,{className:e.tableRow,children:[(0,X.jsx)(Ei,{align:`left`,children:t}),(0,X.jsx)(Ei,{align:`right`,children:n})]},t))})})})}),(0,X.jsx)($i,{item:!0,xs:12,dangerouslySetInnerHTML:{__html:n.description},overflow:`scroll`,maxWidth:`300px`}),(0,X.jsxs)($i,{container:!0,item:!0,spacing:1,justifyContent:`flex-end`,children:[(0,X.jsx)($i,{item:!0,children:(0,X.jsx)(Dd,{variant:`outlined`,color:`primary`,onClick:()=>s(`/`,{replace:!0}),children:(0,X.jsx)(N,{id:`commonScreen.common.cancel`})})}),(0,X.jsx)($i,{item:!0,children:(0,X.jsx)(Dd,{variant:`contained`,onClick:p,color:`primary`,children:(0,X.jsx)(N,{id:`commonScreen.common.confirm`})})})]})]})})})})]})]})},KM=$.lazy(()=>Ar(()=>import(`./ScreenJumioVerification-yNbo1xNR.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),qM=$.lazy(()=>Ar(()=>import(`./ScreenTrading-qRYbXHSf.js`),__vite__mapDeps([22,1,9,2,3,10,4,5,6,7,11,12,13,23,24,25,15,26,8,14,16,17,18,19,20,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50]))),JM=$.lazy(()=>Ar(()=>import(`./ScreenAccount-sK-sE7Xm.js`).then(e=>e.t),__vite__mapDeps([51,1,9,2,3,10,4,5,6,7,11,12,13,24,25,15,26,8,14,16,17,18,19,20,27,28,29,31,40,33,34,35,52,53,54,21,42,46]))),YM=$.lazy(()=>Ar(()=>import(`./ScreenStatistics-B2R6BjXv.js`),__vite__mapDeps([55,1,9,2,3,10,4,5,6,7,11,12,13,30,14,29,27,25,15,31,32,33,34,35,36,28,37,38,39,8,16,17,18,19,20,54,42,46,49,44]))),XM=$.lazy(()=>Ar(()=>import(`./ScreenKnowledgeBase-impQV_mo.js`),__vite__mapDeps([56,1,2,12,5]))),ZM=$.lazy(()=>Ar(()=>import(`./ScreenOptionWizard-CGiOdvPv.js`),__vite__mapDeps([57,1,2,13,3,8,9,10,4,5,6,7,11,12,14,15,16,17,18,19,20,41,31,40,33,34,36,38,42,43,44]))),QM=$.lazy(()=>Ar(()=>import(`./ScreenDashboard-CFXsSF41.js`),__vite__mapDeps([58,1,9,2,3,10,4,5,6,7,11,12,13,14,8,15,16,17,18,19,20,27,31,40,33,34,37,52,53,48]))),$M=$.lazy(()=>Ar(()=>import(`./ScreenFuturesSpreadsMatrix-M7YnLl9t.js`),__vite__mapDeps([59,1,9,2,3,10,4,5,6,7,11,12,13,23,24,25,15,26,8,14,16,17,18,19,20,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50]))),eN=$.lazy(()=>Ar(()=>import(`./ScreenOptionsChart-BiSRL_1n.js`),__vite__mapDeps([60,1,2,3,8,9,10,4,5,6,7,11,12,13,14,15,16,17,18,19,20,47,30,29,27,25,31,32,33,34,35,36,28,37,38,39,26,43]))),tN=$.lazy(()=>Ar(()=>import(`./ScreenBlockRfqs-DzyjOEAR.js`),__vite__mapDeps([61,1,2,3,4,5,23,9,10,6,7,11,12,13,24,25,15,26,8,14,16,17,18,19,20,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50]))),nN=$.lazy(()=>Ar(()=>import(`./ScreenBrokerage-anjzrQt6.js`),__vite__mapDeps([62,1,2,3,4,5,23,9,10,6,7,11,12,13,24,25,15,26,8,14,16,17,18,19,20,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50]))),router=e=>{let{loginApi:t}=e.platformConfig;return Ht([{path:`/`,element:(0,X.jsx)(App,{}),errorElement:(0,X.jsx)(RootErrorPage,{}),children:[{path:`/`,element:(0,X.jsx)(LandingPage,{})},{path:`/index.html`,element:(0,X.jsx)(xt,{replace:!0,to:`/`})},{path:`/account`,element:(0,X.jsx)(xt,{replace:!0,to:ht(si.accountAccountSettings,{[jn.currency]:`BTC`})})},{path:`/account/BTC`,element:(0,X.jsx)(xt,{replace:!0,to:ht(si.accountAccountSettings,{[jn.currency]:`BTC`})})},{path:`/account/:currency/verification/:typeOfVerification/:id`,element:withSuspense((0,X.jsx)(KM,{}))},{path:si.account,element:(0,X.jsx)(ProtectedRoute,{children:withSuspense((0,X.jsx)(JM,{}))}),index:!0},{path:`/statistics`,element:(0,X.jsx)(xt,{replace:!0,to:`/statistics/BTC`})},{path:si.statistics,element:withSuspense((0,X.jsx)(YM,{}))},...e.featureToggles.isSpotEnabled?[{path:`/spot`,element:(0,X.jsx)(xt,{replace:!0,to:`/spot/BTC_USDC`})},{path:si.spot,element:withSuspense((0,X.jsx)(qM,{}))}]:[],{path:`/futures`,element:(0,X.jsx)(xt,{replace:!0,to:`/futures/BTC-PERPETUAL`})},{path:si.futures,element:withSuspense((0,X.jsx)(qM,{}))},{path:si.futuresSpreads,element:withSuspense((0,X.jsx)(qM,{}))},{path:`/blocktrades`,element:(0,X.jsx)(ShortOptionRouteGuard,{children:(0,X.jsx)(xt,{replace:!0,to:`/blocktrades/BTC`})})},{path:si.blocktrades,element:(0,X.jsx)(ShortOptionRouteGuard,{children:withSuspense((0,X.jsx)(qM,{}))})},{path:`/combos`,element:(0,X.jsx)(ShortOptionRouteGuard,{children:(0,X.jsx)(xt,{replace:!0,to:`/combos/BTC`})})},{path:`/combos/:${jn.currencyPair}`,element:(0,X.jsx)(ShortOptionRouteGuard,{children:withSuspense((0,X.jsx)(qM,{}))}),children:[{path:`:${jn.instrument}`,element:withSuspense((0,X.jsx)(qM,{}))}]},{path:`/options`,element:(0,X.jsx)(xt,{replace:!0,to:`/options/BTC`})},{path:`/options/:${jn.currencyPair}`,element:withSuspense((0,X.jsx)(qM,{})),children:[{path:`:${jn.currencyPairAndExpiry}`,element:withSuspense((0,X.jsx)(qM,{})),children:[{path:`:${jn.instrument}`,element:withSuspense((0,X.jsx)(qM,{}))}]}]},...e.featureToggles.isOptionWizardEnabled?[{path:`/option-wizard`,element:(0,X.jsx)(xt,{replace:!0,to:`/option-wizard/BTC`})},{path:si.optionWizard,element:withSuspense((0,X.jsx)(ZM,{})),loader:async({params:e})=>e.currency&&e.currency!==e.currency.toUpperCase()?pt(ht(si.optionWizard,{currency:e.currency.toUpperCase()})):null}]:[],{path:`/${jt.futuresSpreadsMatrix}`,element:(0,X.jsx)(xt,{replace:!0,to:`/${jt.futuresSpreadsMatrix}/BTC`})},{path:si.futuresSpreadsMatrix[0],element:withSuspense((0,X.jsx)($M,{})),children:[{path:`:${jn.instrument}`,element:withSuspense((0,X.jsx)($M,{}))}]}
2103,{path:`/custom/:${jn.pageId}`,element:withSuspense((0,X.jsx)(qM,{})),children:[{path:`:${jn.instrument}`,element:withSuspense((0,X.jsx)(qM,{}))}]},{path:`/kb`,element:withSuspense((0,X.jsx)(XM,{})),children:[{path:`:article`,element:withSuspense((0,X.jsx)(XM,{}))}]},{path:`/coinbase`,element:(0,X.jsx)(xt,{replace:!0,to:`/register?utm_source=coinbase`})},...t===`proxy`?[{path:`login`,element:(0,X.jsx)(LoginScreenWithTheme,{action:`login`})},{path:`set_password`,element:(0,X.jsx)(LoginScreenWithTheme,{action:`setPassword`})}]:[{path:`login`,element:(0,X.jsx)(lD,{action:`login`})},{path:`register`,element:(0,X.jsx)(RegisterRedirectGuard,{children:(0,X.jsx)(lD,{action:`signUp`})}),children:[{path:`:couponCode`,element:(0,X.jsx)(RegisterRedirectGuard,{children:(0,X.jsx)(lD,{action:`signUp`})})}]},{path:LM,element:(0,X.jsx)(CoinbaseSignUpRoute,{})},{path:`login_api`,element:(0,X.jsx)(lD,{action:`loginByApi`})},{path:`tfa_setup`,element:(0,X.jsx)(lD,{action:`setupTFA`})},{path:`forgot_password`,element:(0,X.jsx)(lD,{action:`forgotPassword`})},{path:`/reset_password`,element:(0,X.jsx)(lD,{action:`setupPassword`})},{path:`email_confirmation`,element:(0,X.jsx)(lD,{action:`emailConfirmation`})},{path:`resend_activation_email`,element:(0,X.jsx)(lD,{action:`resendActivationLink`})}],{path:`/oauth`,element:(0,X.jsx)(OAuth,{})},{path:Tn.verificationSuccess,element:(0,X.jsx)(VerificationSuccess,{})},{path:Tn.residenceverificationSuccess,element:(0,X.jsx)(ResidenceVerificationSuccess,{})},{path:Tn.verificationError,element:(0,X.jsx)(VerificationError,{})},{path:Tn.residenceverificationError,element:(0,X.jsx)(VerificationError,{})},{path:`/app_authorization`,element:(0,X.jsx)(ScreenAppAuthorization,{})},{path:`/coupon/:couponCode`,element:(0,X.jsx)(CouponActivation,{})},{path:`/redirect`,element:(0,X.jsx)(wM,{})},{path:`/confirm_secondary_email`,element:(0,X.jsx)(OM,{})},{path:`/close_account`,element:(0,X.jsx)(NM,{})},{path:`/${jt.blockRfqs}`,element:(0,X.jsx)(ShortOptionRouteGuard,{children:withSuspense((0,X.jsx)(tN,{}))})},{path:`/${jt.brokerage}`,element:(0,X.jsx)(ShortOptionRouteGuard,{children:withSuspense((0,X.jsx)(nN,{}))})},...e.env.isTest?[{path:`/options-chart/:currencyPair`,element:withSuspense((0,X.jsx)(eN,{}))},{path:`/${jt.optionsChart}`,element:(0,X.jsx)(xt,{replace:!0,to:`/${jt.optionsChart}/BTC`})}]:[],...e.featureToggles.isDashboardEnabled?[{path:`/dashboard`,element:(0,X.jsx)(ProtectedRoute,{children:withSuspense((0,X.jsx)(QM,{}))})}]:[],{path:si.action,element:(0,X.jsx)(ScreenAction,{})},{path:`*`,element:(0,X.jsx)(ErrorPage,{type:`notFound`})}]}])},rN=r(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_customParseFormat=r()})(e,(function(){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,n=/\d/,r=/\d\d/,i=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,s={},a=function(e){return(e=+e)+(e>68?1900:2e3)},f=function(e){return function(t){this[e]=+t}},c=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||={}).offset=function(e){if(!e||e===`Z`)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return n===0?0:t[0]===`+`?-n:n}(e)}],u=function(e){var t=s[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=s.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?`pm`:`PM`);return n},p={A:[o,function(e){this.afternoon=d(e,!1)}],a:[o,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*e}],SS:[r,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,f(`seconds`)],ss:[i,f(`seconds`)],m:[i,f(`minutes`)],mm:[i,f(`minutes`)],H:[i,f(`hours`)],h:[i,f(`hours`)],HH:[i,f(`hours`)],hh:[i,f(`hours`)],D:[i,f(`day`)],DD:[r,f(`day`)],Do:[o,function(e){var t=s.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,``)===e&&(this.day=r)}],w:[i,f(`week`)],ww:[r,f(`week`)],M:[i,f(`month`)],MM:[r,f(`month`)],MMM:[o,function(e){var t=u(`months`),n=(u(`monthsShort`)||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw Error();this.month=n%12||n}],MMMM:[o,function(e){var t=u(`months`).indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,f(`year`)],YY:[r,function(e){this.year=a(e)}],YYYY:[/\d{4}/,f(`year`)],Z:c,ZZ:c};function l(n){for(var r=n,i=s&&s.formats,o=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),c=o.length,m=0;m<c;m+=1){var h=o[m],g=p[h],_=g&&g[0],v=g&&g[1];o[m]=v?{regex:_,parser:v}:h.replace(/^\[|\]$/g,``)}return function(e){for(var t={},n=0,r=0;n<c;n+=1){var i=o[n];if(typeof i==`string`)r+=i.length;else{var s=i.regex,p=i.parser,m=e.slice(r),h=s.exec(m)[0];p.call(t,h),e=e.replace(h,``)}}return function(e){var t=e.afternoon;if(t!==void 0){var n=e.hours;t?n<12&&(e.hours+=12):n===12&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(a=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,o=e.args;this.$u=r;var c=o[1];if(typeof c==`string`){var p=!0===o[2],m=!0===o[3],h=p||m,g=o[2];m&&(g=o[2]),s=this.$locale(),!p&&g&&(s=n.Ls[g]),this.$d=function(e,t,n,r){try{if([`x`,`X`].indexOf(t)>-1)return new Date((t===`X`?1e3:1)*e);var i=l(t)(e),o=i.year,s=i.month,c=i.day,p=i.hours,m=i.minutes,h=i.seconds,g=i.milliseconds,_=i.zone,v=i.week,y=new Date,b=c||(o||s?1:y.getDate()),x=o||y.getFullYear(),S=0;o&&!s||(S=s>0?s-1:y.getMonth());var C,w=p||0,T=m||0,E=h||0,D=g||0;return _?new Date(Date.UTC(x,S,b,w,T,E,D+60*_.offset*1e3)):n?new Date(Date.UTC(x,S,b,w,T,E,D)):(C=new Date(x,S,b,w,T,E,D),v&&(C=r(C).week(v).toDate()),C)}catch{return new Date(``)}}(t,c,r,n),this.init(),g&&!0!==g&&(this.$L=this.locale(g).$L),h&&t!=this.format(c)&&(this.$d=new Date(``)),s={}}else if(c instanceof Array)for(var _=c.length,v=1;v<=_;v+=1){o[1]=c[v-1];var y=n.apply(this,o);if(y.isValid()){this.$d=y.$d,this.$L=y.$L,this.init();break}v===_&&(this.$d=new Date(``))}else i.call(this,e)}}}))})),iN=r(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_weekOfYear=r()})(e,(function(){var e=`week`,t=`year`;return function(n,r,i){var o=r.prototype;o.week=function(n){if(n===void 0&&(n=null),n!==null)return this.add(7*(n-this.week()),`day`);var r=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var o=i(this).startOf(t).add(1,t).date(r),s=i(this).endOf(e);if(o.isBefore(s))return 1}var c=i(this).startOf(t).date(r).startOf(e).subtract(1,`millisecond`),p=this.diff(c,e,!0);return p<0?i(this).startOf(`week`).week():Math.ceil(p)},o.weeks=function(e){return e===void 0&&(e=null),this.week(e)}}}))})),aN=r(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_isBetween=r()})(e,(function(){return function(e,t,n){t.prototype.isBetween=function(e,t,r,i){var o=n(e),s=n(t),c=(i||=`()`)[0]===`(`,p=i[1]===`)`;return(c?this.isAfter(o,r):!this.isBefore(o,r))&&(p?this.isBefore(s,r):!this.isAfter(s,r))||(c?this.isBefore(o,r):!this.isAfter(o,r))&&(p?this.isAfter(s,r):!this.isBefore(s,r))}}}))})),oN=n($d()),sN=n(ee()),cN=n(rN()),lN=n(iN()),uN=n(aN()),dN=t({messages:()=>fN}),fN=JSON.parse(`{"accountScreen.account.accessLog.changedSecurityKey":["Key assigned to ",["assignment"]," changed from \\"",["prevKey"],"\\" to \\"",["currentKey"],"\\"."],"accountScreen.account.accessLog.loginFailed":["Login failed"],"accountScreen.account.accessLog.loginSuccessful":["Login successful"],"accountScreen.account.accessLog.newSecurityKeyassignment":["Security ke
2103y \\"",["keyName"],"\\" assigned to ",["assignments"],"."],"accountScreen.account.accessLog.removedSecurityKeyassignment":["Security key \\"",["keyName"],"\\" unassigned from ",["assignments"],"."],"accountScreen.account.accessLog.securityKeyActivated":["Activated security key \\"",["keyName"],"\\" (assignments: ",["assignments"],")."],"accountScreen.account.accessLog.securityKeyActivatedWithoutAssignments":["activated security key \\"",["keyName"],"\\""],"accountScreen.account.accessLog.securityKeyAuthorization":["Authorization of ",["method"]," with ",["keyType"]," security key \\"",["keyName"],"\\"."],"accountScreen.account.accessLog.securityKeyModeChanged":["Security key management mode set to: ",["managementMode"],"."],"accountScreen.account.accessLog.securityKeyRemoved":["Security key ",["keyName"]," removed and unassigned from ",["assignments"],"."],"accountScreen.account.accessLog.securityKeyRemovedWithoutUnassignments":["Security key ",["keyName"]," removed."],"accountScreen.account.accessLog.securityKeysHaveBeenRemoved":["Security keys have been removed."],"accountScreen.account.accessLog.title":["Access Log"],"accountScreen.account.accountCreated":["Account created: ",["creationDate"]],"accountScreen.account.accountParametersChangedDescription":["Notify when account parameters have been changed by Deribit (e.g. rate limits, PM configuration)."],"accountScreen.account.accountParametersChangedNotifications":["Account Parameters Changed Notifications"],"accountScreen.account.accountSettings":["Account Settings"],"accountScreen.account.activationTimeRemaining":["Time remaining:"],"accountScreen.account.alreadyUsedUsername":["This username already exists, please choose a different one."],"accountScreen.account.appleLogin":["Apple Log In"],"accountScreen.account.appleLogin.helperText":["If selected, it is allowed to login into account via Apple."],"accountScreen.account.areYouSureToDecreaseDailyWithdrawalLimit":["Are you sure that you want to decrease your daily withdrawal limit? You can increase it only by contacting us via ",["supportDeribitLink"],"."],"accountScreen.account.blockFee":["Block Fee"],"accountScreen.account.blockFeeDescription":["The Block Fee is expressed as percentage of the base fee that can be found on the <0>fees page</0>. For example if the base fee is 0.025% and the percentage shown is 80% it would imply your Block Fees for this instrument are 80% of 0.025% = 0.02%."],"accountScreen.account.cancel":["CANCEL"],"accountScreen.account.changePassword":["Change Password"],"accountScreen.account.changePasswordCoinbaseHelperText":["To change password use following link:"],"accountScreen.account.changePasswordHelperText":["Click the button to receive a link for the password change."],"accountScreen.account.changedUsernameInfo":["Your account username has been successfully changed."],"accountScreen.account.chinese":["Chinese (简体中文)"],"accountScreen.account.clientOfCoinbaseBermuda":["Client of Coinbase Bermuda"],"accountScreen.account.clientOfDeribitPanama":["Client of Deribit Panama"],"accountScreen.account.clients.addClient":["Add Client"],"accountScreen.account.clients.addClientDialog.client.label":["Client Name"],"accountScreen.account.clients.addClientDialog.client.placeholder":["Enter the name of the client group"],"accountScreen.account.clients.addClientDialog.company.label":["Company Name"],"accountScreen.account.clients.addClientDialog.company.placeholder":["Enter company name"],"accountScreen.account.clients.addClientDialog.errors.nameAlreadyUsed":["The name is already in use."],"accountScreen.account.clients.addClientDialog.success":["Client added"],"accountScreen.account.clients.addClientDialog.title":["Add New Client"],"accountScreen.account.clients.addClientDialog.warning":["The client will decide if the manual confirmation will be allowed"],"accountScreen.account.clients.refreshClientList":["Refresh Client List"],"accountScreen.account.closeAccount":["Close account"],"accountScreen.account.closeAccount.checkboxText":["I have downloaded all transaction logs and am ready to proceed"],"accountScreen.account.closeAccount.modalInfo":["Please download all the logs for future reference, you can not download files from closed accounts nor can Deribit provide this for closed accounts."],"accountScreen.account.closeAccount.modalInfo2":["After clicking the Close account button, you'll receive an email with a confirmation link. The process to close your account will only begin once you click that link."],"accountScreen.account.closeAccount.modalTitle":["Close account"],"accountScreen.account.closeAccount.requested.body":["We have sent a confirmation link to finalize the process of closing your account."],"accountScreen.account.closeAccount.requested.title":["Please check your mailbox."],"accountScreen.account.confirmChanges":["CONFIRM CHANGES"],"accountScreen.account.copyUserId":["Copy user ID"],"accountScreen.account.dailyWithdrawalLimit":["Daily withdrawal limit"],"accountScreen.account.dailyWithdrawalLimitHasBeenChanged":["Daily withdrawal limit has been changed"],"accountScreen.account.dailyWithdrawalLimitHasBeenSetToZero":["The daily withdrawal limit has been set to 0. Please contact support to change the limit value."],"accountScreen.account.date":["DATE"],"accountScreen.account.deleteAccountButtonText":["Clicking this button will not close your account immediately."],"accountScreen.account.deleteAccountFromSubaccountError":["Account can be closed from main account only."],"accountScreen.account.deleteAccountHelperText":["It is possible to close an account only if there are no open positions and orders, and the account balance is below $12.50 in each currency."],"accountScreen.account.email":["Email"],"accountScreen.account.emailLanguage":["Email Language"],"accountScreen.account.english":["English"],"accountScreen.account.feeDiscounts":["Fee Discounts"],"accountScreen.account.feeDiscountsDescription":["Your fee discount level is: ",["group"],". You can find detailed information about fee levels in the <0>Knowledge Base</0>."],"accountScreen.account.firstKeyDescription":["The first key you create will be assigned to all managements: account management, login management and wallet management. You can choose any name for your security ke
2103y, for example: FirstKey, WalletKey, AccountKey."],"accountScreen.account.goToSubscribe":["Go to subscribe"],"accountScreen.account.googleLogin":["Google Log In"],"accountScreen.account.googleLogin.helperText":["If selected, it is allowed to login into account via Google."],"accountScreen.account.instrumentType":["Instrument Type"],"accountScreen.account.ip":["IP"],"accountScreen.account.ipPinning":["IP Pinning"],"accountScreen.account.ipPinning.helperText":["If selected, switching to a new IP address during an already established session will automatically terminate the session."],"accountScreen.account.liquidationNotifications":["Liquidation Notifications"],"accountScreen.account.liquidationNotificationsDescription":["Notify when Deribit started to incrementally reduce your position in an attempt to keep the maintenance margin below the margin balance of your account."],"accountScreen.account.location":["LOCATION"],"accountScreen.account.log":["LOG"],"accountScreen.account.loginNotifications":["Login Notifications"],"accountScreen.account.loginNotificationsDescription":["Notify when someone logs into your account."],"accountScreen.account.makerFee":["Maker Fee"],"accountScreen.account.marginCallNotifications":["Margin Call Notifications"],"accountScreen.account.marginCallNotificationsDescription":["Notify when the margin balance of your account has fallen below the initial margin requirement."],"accountScreen.account.memberOfDubaiExchange":["Member of Dubai exchange"],"accountScreen.account.mmp.blockRfqTitle":["RFQ MMP Settings"],"accountScreen.account.mmp.cannotInstantiateInactiveMmpConfig":["Cannot instantiate inactive mmp config."],"accountScreen.account.mmp.createGroup":["Create \\"",["option"],"\\" group"],"accountScreen.account.mmp.default":["Default"],"accountScreen.account.mmp.deltaLimit":["Delta Limit"],"accountScreen.account.mmp.deltaLimitIsTooHigh":["Delta Limit is too high."],"accountScreen.account.mmp.deltaLimitIsTooLow":["Delta Limit is too low."],"accountScreen.account.mmp.frozenTime":["Frozen Time"],"accountScreen.account.mmp.frozenTimeIsTooHigh":["Frozen Time is too high."],"accountScreen.account.mmp.frozenTimeIsTooLow":["Frozen Time is too low."],"accountScreen.account.mmp.global":["Global"],"accountScreen.account.mmp.groupNameAlreadyTaken":["Group name already taken."],"accountScreen.account.mmp.interval":["Interval"],"accountScreen.account.mmp.intervalIsTooHigh":["Interval is too high."],"accountScreen.account.mmp.intervalIsTooLow":["Interval is too low."],"accountScreen.account.mmp.maxQuoteQuantity":["Max Quote Quantity"],"accountScreen.account.mmp.maxQuoteQuantityIsTooHigh":["Max Quote Quantity is too high."],"accountScreen.account.mmp.maxQuoteQuantityIsTooLow":["Max Quote Quantity is too low."],"accountScreen.account.mmp.maximumValueIs":["Maximum value is ",["0"],"."],"accountScreen.account.mmp.minimumValueIs":["Minimum value is ",["0"],"."],"accountScreen.account.mmp.mmpGroup":["MMP Group"],"accountScreen.account.mmp.quantityLimit":["Quantity Limit"],"accountScreen.account.mmp.quantityLimitIsTooHigh":["Quantity Limit is too high."],"accountScreen.account.mmp.quantityLimitIsTooLow":["Quantity Limit is too low."],"accountScreen.account.mmp.quantityLimitMustNotExceedMaxQuoteQuantity":["Quantity Limit must not exceed Max Quote Quantity."],"accountScreen.account.mmp.reset":["Reset MMP"],"accountScreen.account.mmp.resetConfirmation":["Orders MMP has been reset successfully"],"accountScreen.account.mmp.resetConfirmationForGroup":["MMP for ",["mmpGroupToReset"]," group has been reset successfully"],"accountScreen.account.mmp.seconds":["sec."],"accountScreen.account.mmp.starbaseMmpGroupId":["Starbase MMP Group ID"],"accountScreen.account.mmp.subtitle":["Here you can configure MMP settings for orders. MMP settings for MMP-tagged orders are configured via the Default group. MMP for mass quotes are set scoped to their MMP group. To remove MMP settings, set the Interval to 0."],"accountScreen.account.mmp.subtitleRfq":["To remove MMP settings, set the Interval to 0."],"accountScreen.account.mmp.title":["MMP Settings"],"accountScreen.account.mmp.tradeCountLimit":["Trade Count Limit"],"accountScreen.account.mmp.updateConfirmation":["MMP has been updated successfully."],"accountScreen.account.mmp.updateFailed":["Unable to save MMP settings."],"accountScreen.account.mmp.vegaLimit":["Vega Limit"],"accountScreen.account.mmp.vegaLimitIsTooHigh":["Vega Limit is too high."],"accountScreen.account.mmp.vegaLimitIsTooLow":["Vega Limit is too low."],"accountScreen.account.newLimitValueMustBeSmaller":["The new limit value must be smaller than the current one: ",["savedDailyWithdrawalLimit"]],"accountScreen.account.newsletterAndExchangeNotifications.subTitle":["Overview of all Deribit Exchange updates, Announcements, Option Flow Commentary, Market Research articles, Education Courses and Deribit API."],"accountScreen.account.newsletterAndExchangeNotifications.title":["Join Newsletter and Exchange Notifications"],"accountScreen.account.noteThatEachCurrencyHasSeparateWithdrawalLimit":["
2103Note that each currency has a separate withdrawal limit."],"accountScreen.account.notifications.subTitle":["Here you can choose which email notifications you would like to receive."],"accountScreen.account.notifications.title":["Notifications"],"accountScreen.account.password":["Password"],"accountScreen.account.passwordChange.requested.aside":["* Changing your password will sign you out on your devices."],"accountScreen.account.passwordChange.requested.body":["We have sent you an email to change your password."],"accountScreen.account.passwordChange.requested.title":["Please check your mailbox."],"accountScreen.account.profileDetails":["Profile Details"],"accountScreen.account.rebalanceNotifications":["Rebalance Notifications"],"accountScreen.account.rebalanceNotificationsDescription":["Notify cross collateral accounts when negative equity limit is breached."],"accountScreen.account.russian":["Russian (Русский)"],"accountScreen.account.safeSessionDuration":["Safe Session Duration"],"accountScreen.account.safeSessionDuration.helperText":["If selected, the session inactivity timeout will be 1 hour. If unchecked, the session inactivity timeout will be one week. This timeout defines the time a session will remain active in case there is no activity during the session."],"accountScreen.account.security.subTitle":["Additional Security Measures"],"accountScreen.account.security.title":["Security"],"accountScreen.account.securityCodeDescription":["Enter the 6-digit code generated by the application"],"accountScreen.account.spanish":["Spanish (Español)"],"accountScreen.account.takerFee":["Taker Fee"],"accountScreen.account.tfaEnable":["Enable"],"accountScreen.account.tooShortUsername":["Wrong username, it has to be at least 5 characters long"],"accountScreen.account.trading.accountLevelSelfMatchPrevention":["Account-Level Self-Match Prevention"],"accountScreen.account.trading.accountLevelSelfMatchPreventionDescription":["Activate the 'Account-Level Self-Match Prevention' feature to prevent trades between your own accounts (sub and or main). \\nWhen this feature is enabled, any self-matching attempt between your accounts will be prevented. \\nThis includes situations where a buy order from one of your subaccounts would match a sell order from another subaccount. \\nIn such cases, Deribit will determine which order to cancel based on your selected preference in the 'Self-Match Prevention' toggle. \\nThis prevention measure helps you avoid unintentional self-matching across your accounts."],"accountScreen.account.trading.blockRfqSelfMatchPrevention":["Block RFQ Self-Match Prevention"],"accountScreen.account.trading.blockRfqSelfMatchPreventionDescription":["Enable 'Block RFQ Self-Match Prevention' to prevent trading Block RFQs against accounts configured within your Block RFQ Identity.\\nIf this setting is activated your account's Identity will be filtered out of the available maker list.\\nIf you 'Select all' makers in your Block RFQ your Identity will not be targeted.\\nIf you target your Parent Identity the accounts under it that share your Identity will not be targeted."],"accountScreen.account.trading.selfMatchPrevention":["Self-Match Prevention<0/>(active = cancel maker, inactive = reject taker)"],"accountScreen.account.trading.selfMatchPreventionDescription":["Self-matching is always prevented for orders with the same UID, including main and sub-accounts. This setting determines how it is prevented: when enabled, the primary (maker, passive) order is cancelled; when disabled (default), the secondary (taker, active) order is rejected. For more information, see the <0>Account Settings documentation</0>."],"accountScreen.account.trading.subTitle":["Additional Trading Settings"],"accountScreen.account.trading.title":["Trading"],"accountScreen.account.userId":["User ID: ",["userId"]],"accountScreen.account.username":["Username"],"accountScreen.account.wrongUsernameFormat":["Wrong alias, only alphanumeric characters allowed"],"accountScreen.accountDeletionSubaccount":["Only the main account can initiate account deletion."],"accountScreen.affiliate.affiliate":["Affiliate"],"accountScreen.affiliate.affiliateDashboard":["Affiliate Dashboard"],"accountScreen.affiliate.affiliateDescription":["Daily at 08:05 UTC, we update the statistics below and make the payouts. You can find your daily payouts in your ",["transactionLogLink"],". Search for ",["affiliate"]," to filter the transactions."],"accountScreen.affiliate.affiliateLinkFrontPage":["Affiliate Link to Front Page:"],"accountScreen.affiliate.affiliateLinkSignUpForm":["Affiliate Link to Sign-Up Form:"],"accountScreen.affiliate.affiliateProgramIsOff":["The affiliate program is OFF for your account."],"accountScreen.affiliate.affiliateProgramIsOn":["The affiliate program is ON for your account."],"accountScreen.affiliate.enable":["Enable"],"accountScreen.affiliate.iAgreeWithTermsAndConditions":["I agree with the Terms and Conditions. Click to enable the Affiliate Program."],"accountScreen.affiliate.referred":["You have referred ",["0"]," users."],"accountScreen.affiliate.shareLinkInfo":["Please share the link with friends, family and other traders to promote our exchange."],"accountScreen.affiliate.termsAndConditio":["Terms and Conditions"],"accountScreen.affiliate.termsAndConditionsInfo":["Click here for the ",["termsAndConditionLink"]," of our affiliate program."],"accountScreen.affiliate.totalPaidOut":["The total payout to you as an affiliate:"],"accountScreen.api.account":["Account"],"accountScreen.api.actions":["Actions"],"accountScreen.api.addNewKey":["ADD NEW KEY"],"accountScreen.api.apiAccess":["API Access"],"accountScreen.api.apiConsoleButton":["API CONSOLE"],"accountScreen.api.apiConsoleInfo":["To explore all our API endpoints, visit our <0>API Console</0>."],"accountScreen.api.apiKeyNameCanContainMaximum":["API key name can contain a maximum of 16 characters."],"accountScreen.api.apiKeyNameCanContainOnlyLettersNumbersAndUnderscores":["API key name can contain only letters, numbers and underscores."],"accountScreen.api.apiRateLimits":["API Rate Limits"],"accountScreen.api.apiSettings":["API Settings"],"accountScreen.api.atLeastOneIpIsIncorrect":["At least one IP you want to add to whitelist is not correct."],"accountScreen.api.authorizedApplications":["Authorized Applications"],"accountScreen.api.autoCod":["Auto CoD"],"accountScreen.api.autoCodDescription":["Enable automatic CoD (Cancel on disconnect) for all API connections."],"accountScreen.api.autoCodDescriptionDetail
2103sForStarbaseUsers1":["Cancel on Disconnect on Starbase SBE is applied on a per-session basis. Orders will only be canceled for the specific sessions where CoD is enabled."],"accountScreen.api.autoCodDescriptionDetailsForStarbaseUsers2":["Because the session is closed when the disconnect occurs, the corresponding cancel messages will not appear on SBE. To review all cancel messages for a given session, please use FIX Drop Copy."],"accountScreen.api.blockRfq":["Block RFQ"],"accountScreen.api.blockTrade":["Block Trade"],"accountScreen.api.changeIpWhitelist":["Change IP Whitelist"],"accountScreen.api.changeScope":["CHANGE SCOPE"],"accountScreen.api.clientId":["Client ID"],"accountScreen.api.clientSecret":["Client Secret"],"accountScreen.api.clientSecret.selfGeneratedKey":["Self-generated key"],"accountScreen.api.createKey":["Create a new API key"],"accountScreen.api.createKey.publicKey":["Public Key"],"accountScreen.api.currentLimits":["Current Limits"],"accountScreen.api.custody":["Custody"],"accountScreen.api.doYouWantToRemoveKey":["Do you want to remove key ",["clientId"],"?"],"accountScreen.api.doYouWantToRevokeApplication":["Do you want to revoke application <0>",["appName"],"</0>?"],"accountScreen.api.docsInfo":["Visit Deribit <0>Knowledge Base</0> to read our <1>API documentation</1>, including API v1, API v2, and FIX."],"accountScreen.api.domain":["Domain"],"accountScreen.api.duplicateOfIpAdresses":["Duplicate of IP addresses"],"accountScreen.api.editKey":["Edit key"],"accountScreen.api.enabled":["Enabled"],"accountScreen.api.features.blockTradesApproval":["Block trade approval"],"accountScreen.api.features.blockTradesApproval.tooltip":["Require user approval for block trades executed with this API key."],"accountScreen.api.ipWhitelist":["IP Whitelist"],"accountScreen.api.limitsInfo":["Matching engine requests - ",["matching_engine_rate"],"/s (",["matching_engine_burst"],"/s in a burst) Other requests - ",["non_matching_engine_rate"],"/s (",["non_matching_engine_burst"],"/s in a burst)."],"accountScreen.api.modals.selectKeyType.optionDeribit.description":["We generate a key for you, making it easy to start using our API, especially with the API console. We recommend limited API scopes for market data (raw subscriptions) and non-sensitive info. You can also use this key to log in on the frontend or mobile app, and we suggest pairing it with two-factor authentication. Some partner integrations may need a self-generated key."],"accountScreen.api.modals.selectKeyType.optionDeribit.title":["Deribit-generated key"],"accountScreen.api.modals.selectKeyType.optionSelf.description":["You generate your own key pair, with API calls securely signed using your private key. We only require your public key, making this the most secure way to access our API. This is recommended for production applications that require full API scopes, including trading, wallet management, and configuring account settings."],"accountScreen.api.modals.selectKeyType.optionSelf.inputLabel":["Public key"],"accountScreen.api.modals.selectKeyType.optionSelf.inputPlaceholder":["Enter public key"],"accountScreen.api.modals.selectKeyType.optionSelf.title":["Self-generated key"],"accountScreen.api.modals.selectKeyType.title":["Select API key type"],"accountScreen.api.name":["Name"],"accountScreen.api.noKeys":["No keys"],"accountScreen.api.noName":["No Name"],"accountScreen.api.qrCode":["QR Code"],"accountScreen.api.refresh":["Refresh"],"accountScreen.api.removeKey":["Remove Key"],"accountScreen.api.resetSecret":["Reset Secret"],"accountScreen.api.revokeAccess":["Revoke access"],"accountScreen.api.scope":["Scope"],"accountScreen.api.scopes":["Scopes"],"accountScreen.api.showKeys":["Show keys"],"accountScreen.api.toListYourKeysUseButton":["To list your keys use \\"Show keys\\" button"],"accountScreen.api.trade":["Trade"],"accountScreen.api.useInApiConsole":["Use in the API console"],"accountScreen.api.wallet":["Wallet"],"accountScreen.blockRfq.accountDefinedLimits.currencyPair":["Currency Pair"],"accountScreen.blockRfq.accountDefinedLimits.disableInstrumentQuoting":["Disable Instrument Quoting"],"accountScreen.blockRfq.accountDefinedLimits.maxAmount":["Max Amount"],"accountScreen.blockRfq.accountDefinedLimits.maxSpread":["Max Spread"],"accountScreen.blockRfq.accountDefinedLimits.resetSuccess":["Account limits are reset"],"accountScreen.blockRfq.accountDefinedLimits.saveChanges":["Save Changes"],"accountScreen.blockRfq.accountDefinedLimits.subtitle":["These settings define the maximum amount that can be quoted on a Block RFQ as a maker, as well as the maximum allowed deviation from the mark price per quote. Users can also choose to disable quoting Block RFQs entirely on a per-currency-pair basis."],"accountScreen.blockRfq.accountDefinedLimits.success":["Account limits are set for ",["currencyPair"]," ",["instrumentKind"]],"accountScreen.blockRfq.accountDefinedLimits.title":["Account Defined 
2103Limits"],"accountScreen.blockRfq.accountIdentityStructure.description":["Each account can include a Parent Identity, representing the account as a whole. Optionally, subaccounts can be grouped into multiple Identities, representing various entities such as a trader, a desk or a different company."],"accountScreen.blockRfq.accountIdentityStructure.title":["Account Identity Structure"],"accountScreen.blockRfq.contactSupport":["Click to contact support"],"accountScreen.blockRfq.identitiesTable.isMaker":["Maker"],"accountScreen.blockRfq.identitiesTable.parent":["Parent Identity / Identity"],"accountScreen.blockRfq.identitiesTable.takerRating":["OTV Ratio"],"accountScreen.blockRfq.identitiesTable.userId":["User ID"],"accountScreen.blockRfq.manageIdentity.description":["Identities for your account can be set up and updated through our support team. If you need to modify your Parent Identity or specific Identities, please reach out to us by submitting a support ticket."],"accountScreen.blockRfq.manageIdentity.title":["Manage Your Identity"],"accountScreen.brokerProfile.actions":["Actions"],"accountScreen.brokerProfile.brn":["BRN"],"accountScreen.brokerProfile.brokerAddress":["Address"],"accountScreen.brokerProfile.brokerDescription":["Description"],"accountScreen.brokerProfile.brokerName":["Broker Name"],"accountScreen.brokerProfile.brokerNumber":["Phone Number"],"accountScreen.brokerProfile.clientLinkId":["Client Link ID"],"accountScreen.brokerProfile.clientLinkUpdated":["Client link updated"],"accountScreen.brokerProfile.clientUpdated":["Client updated"],"accountScreen.brokerProfile.clients.mainAccount":["Main account"],"accountScreen.brokerProfile.clients.subaccount":["Subaccount"],"accountScreen.brokerProfile.clientsHistory":["Clients History"],"accountScreen.brokerProfile.clientsOverview":["Clients Overview"],"accountScreen.brokerProfile.company":["Company"],"accountScreen.brokerProfile.copyLink":["Copy link"],"accountScreen.brokerProfile.displayName":["Display Name"],"accountScreen.brokerProfile.doYouWantToRemoveClient":["Do you want to remove client ",["0"],"?"],"accountScreen.brokerProfile.doYouWantToRemoveClientLink":["Do you want to remove the client link named ",["0"],"?"],"accountScreen.brokerProfile.editClientDetails":["Edit Client Details"],"accountScreen.brokerProfile.includeSubaccounts":["Include subaccounts"],"accountScreen.brokerProfile.internalNote":["Internal Note"],"accountScreen.brokerProfile.invitationLink":["Invitation link"],"accountScreen.brokerProfile.isClientAutomaticallyConfirming":["Is client automatically confirming?"],"accountScreen.brokerProfile.lei":["LEI"],"accountScreen.brokerProfile.linkedUserId":["User ID"],"accountScreen.brokerProfile.noInvitedClients":["No invited clients"],"accountScreen.brokerProfile.searchClientNameOrCompany":["Search client name / company"],"accountScreen.brokerProfile.subtitle":["If you want to change broker info, please contact <0>Customer support</0>."],"accountScreen.brokerProfile.title":["Broker Profile"],"accountScreen.brokerProfile.updateClient":["Update Client"],"accountScreen.brokerProfile.updateClientLink":["Update Client Link"],"accountScreen.brokerProfile.userId":["User ID: ",["0"]],"accountScreen.buyCrypto.confirmDialog.description":["You will be taken to Banxa to continue the payment process."],"accountScreen.buyCrypto.corporateAccountNotSupported":["This provider is not supported for corporate accounts."],"accountScreen.buyCrypto.depositAddressNotReady":["Deposit address is not ready yet"],"accountScreen.buyCrypto.disclaimer.agreeTermsOfUse":["I have read and agree to the Terms of Use"],"accountScreen.buyCrypto.disclaimer.buttonLabel":["Continue"],"accountScreen.buyCrypto.disclaimer.description":["You will be taken to ",["provider"],". Services relating to payments are provided by ",["provider"],", which is a separate platform owned by a third party. Please read and agree to ",["provider"],"'s Terms of Use before using their service. For any questions relating to payments, please contact ",["provider"],". Deribit does not assume any responsibility for any loss or damage caused by the use of this payment service."],"accountScreen.buyCrypto.disclaimer.kyc":["The following operation is handled via a third-party provider: \\"",["provider"],"\\". This provider requires you to provide KYC information, including first and last name, email address, residence details, identification documents and a selfie image. Are you allowing Deribit to share that information with Legend Trading on your behalf? If Legend Trading finds the provided personal data insufficient, you will be asked to redo the KYC verification with them."],"accountScreen.buyCrypto.disclaimer.kycAgreeToShare":["I agree to share my KYC with ",["provider"]],"accountScreen.buyCrypto.disclaimer.title":["Disclaimer"],"accountScreen.buyCrypto.error.countryForbidden":["This provider is not available in your residence country."],"accountScreen.buyCrypto.error.invali
2103dAmount":["Invalid amount provided"],"accountScreen.buyCrypto.error.maxAmount":["The amount cannot be greater than ",["maxAmount"]],"accountScreen.buyCrypto.error.minAmount":["The amount cannot be lower than ",["minAmount"],"."],"accountScreen.buyCrypto.error.minAmountForCurrency":["The amount cannot be lower than ",["minAmount"]," for the selected currency."],"accountScreen.buyCrypto.error.notSupportedCurrency":["Currency ",["currency"]," is not currently supported for this provider."],"accountScreen.buyCrypto.error.providerUnavailable":["We're unable to fetch prices for this provider at the moment."],"accountScreen.buyCrypto.error.unsupportedCurrencyPair":[["selectedFiat"],"/",["selectedCoin"]," pair is not supported by this provider"],"accountScreen.buyCrypto.individualAccountNotSupported":["This provider is not supported for individual accounts."],"accountScreen.buyCrypto.kycComplete":["complete your KYC"],"accountScreen.buyCrypto.kycRequired":["To use this service, ",["completeKycLink"]," on Deribit."],"accountScreen.buyCrypto.kycTransferUnsuccessful":["KYC Transfer Unsuccessful"],"accountScreen.buyCrypto.legendTradingDeclinedTransferKycData":["Legend Trading has declined the transfer of your KYC data."],"accountScreen.buyCrypto.needToCompleteKycProcessOnLegendTrading":["If you choose to proceed, you will need to complete the KYC process directly on Legend Trading."],"accountScreen.buyCrypto.paymentChannel.kycReady":["KYC Ready"],"accountScreen.buyCrypto.paymentChannel.receiveIncludingFees":["Receive (Including fees)"],"accountScreen.buyCrypto.paymentChannel.title":["Choose a payment channel"],"accountScreen.buyCrypto.paymentDetails.amount":["Amount"],"accountScreen.buyCrypto.paymentDetails.choosePaymentMethod":["Choose a payment method and view details"],"accountScreen.buyCrypto.paymentDetails.depositToAccount":["Deposit to account"],"accountScreen.buyCrypto.paymentDetails.paymentProvider":["Payment Provider"],"accountScreen.buyCrypto.paymentDetails.title":["Payment details"],"accountScreen.buyCrypto.receiveLabel":["Receive"],"accountScreen.buyCrypto.rejectedBecausefaceImageIsMissing":["Legend Trading has rejected transferring KYC details because your face image is missing"],"accountScreen.buyCrypto.spendLabel":["Spend"],"accountScreen.buyCrypto.unableToFetchWidgetProps":["Unable to fetch widget props"],"accountScreen.buyCrypto.unableToTransferKycDetail
2103s":["Unable to transfer KYC details"],"accountScreen.buyCrypto.unsupportedCoin":[["currencyName"]," is currently unsupported by this feature."],"accountScreen.buyCrypto.verification":["verification"],"accountScreen.buyCrypto.verificationRequired":["Please complete your ",["verificationLink"]," to use this provider."],"accountScreen.buyCrypto.yourFaceImageIsMissing":["Reason: Your face image is missing."],"accountScreen.cancel":["Cancel"],"accountScreen.changeMargin.acceptTermsOfServiceHelperText":["By accepting the Terms of Service for changing the margin model, you confirm that you are familiar with the details of our margin model as described in our Knowledge Base."],"accountScreen.changeMargin.apiLimit":["This operation is limited to ",["0"]," times per ",["1"]," hours."],"accountScreen.changeMargin.changeMarginModel":["Change Margin Model"],"accountScreen.changeMargin.chooseMarginModel":["Choose Margin Model"],"accountScreen.changeMargin.currentStatus":["Current status:"],"accountScreen.changeMargin.marginsCalculations":["Margins Calculations"],"accountScreen.changeMargin.portfolioMarginCross":["Cross: Portfolio Margin"],"accountScreen.changeMargin.portfolioMarginSegregated":["Segregated: Portfolio Margin"],"accountScreen.changeMargin.standardMarginCross":["Cross: Standard Margin"],"accountScreen.changeMargin.standardMarginSegregated":["Segregated: Standard Margin"],"accountScreen.changeMargin.successfullyChangedMarginModel":["Successfully changed margin model."],"accountScreen.changeMargin.title":["Change margin"],"accountScreen.changeMarginModel.title":["Change Margin Model"],"accountScreen.common.actions":["Actions"],"accountScreen.common.addAddress":["Add Address"],"accountScreen.common.addWithdrawalAddress":["Add Withdrawal Address"],"accountScreen.common.address":["Address"],"accountScreen.common.addressBelongToIndividualOrCorporation":["Does this address belong to an individual or corporation?"],"accountScreen.common.addressBook":["Address Book"],"accountScreen.common.addressLabel":["Address Label"],"accountScreen.common.amount":["Amount"],"accountScreen.common.availableOnlyForLoggedIn":["Available only for logged-in users."],"accountScreen.common.beneficiaryCompanyAddress":["Beneficiary's company address"],"accountScreen.common.beneficiaryCompanyName":["Beneficiary's company name"],"accountScreen.common.beneficiaryFirstName":["Beneficiary's first name"],"accountScreen.common.beneficiaryLastName":["Beneficiary's last name"],"accountScreen.common.beneficiaryResidentialAddress":["Beneficiary's residential address"],"accountScreen.common.confirm":["Confirm"],"accountScreen.common.confirmationEmailForTurningOffEmailConfirmationsWasSend":["An email confirming the disabling of email confirmations has been sent. Click again to cancel this action."],"accountScreen.common.corporation":["Corporation"],"accountScreen.common.createdAt":["Created at:"],"accountScreen.common.delete":["Delete"],"accountScreen.common.deleteAddress":["Delete Address"],"accountScreen.common.disableConfirmationsTooltip":["Turn off email confirmations"],"accountScreen.common.doYouWantToRemoveAddress":["Do you want to remove this address ",["addressName"],"?"],"accountScreen.common.editAddressDetails":["Edit address details"],"accountScreen.common.emailConfirmationChangeCancelled":["Email confirmation change has been cancelled"],"accountScreen.common.emailConfirmationRequired":["E-mail confirmation is required"],"accountScreen.common.emailConfirmationsTurnedOff":["E-mail confirmations for address ",["address"]," have been turned off"],"accountScreen.common.emailConfirmationsTurnedOn":["E-mail confirmations for address ",["address"]," have been turned on"],"accountScreen.common.enableConfirmationsTooltip":["Turn on email confirmations"],"accountScreen.common.failure":["Failure"],"accountScreen.common.individual":["Individual"],"accountScreen.common.infoAt":["Info at ",["infoLink"]],"accountScreen.common.lastName":["Last name"],"accountScreen.common.network":["Network"],"accountScreen.common.no":["No"],"accountScreen.common.originatorCompanyAddress":["Originator's company address"],"accountScreen.common.originatorResidentialAddress":["Originator's residential address"],"accountScreen.common.other":["Other"],"accountScreen.common.requestToChangeEmailConfirmationsReceived":["The request to change email confirmations for the address ",["address"]," has been received. Please check your email and click the confirmation link."],"accountScreen.common.status":["Status"],"accountScreen.common.submit":["Submit"],"accountScreen.common.success":["Success"],"accountScreen.common.tag":["Tag"],"accountScreen.common.twoFactorAuth":["Two-Factor Authentication"],"accountScreen.common.usycWarning":["Before withdrawing make sure that the destination address is whitelisted with Hashnote. Withdrawals to addresses not on the whitelist will be cancelled."],"accountScreen.common.verifiedAddress":["Verified address. E-mail confirmation is not required."],"accountScreen.common.warning":["Don't send real ",["0"],". You can fund your account with internal test coins ",["1"],". In this case, please don't deposit more than ",["2"]," to leave some coins for other traders as well."],"accountScreen.common.yes":["Yes"],"accountScreen.confirm":["Confirm"],"accountScreen.custody.actions":["Actions"],"accountScreen.custody.address":["Address"],"accountScreen.custody.addressesRequired":["Deposit and Withdrawal Addresses are required."],"accountScreen.custody.amount":["Amount"],"accountScreen.custody.apiPage":["API page"],"accountScreen.custody.balance":["Balance"],"accountScreen.custody.button.cancel":["Cancel"],"accountScreen.custody.button.close":["Close"],"accountScreen.custody.button.confirm":["Confirm"],"accountScreen.custody.button.next":["Next"],"accountScreen.custody.button.previous":["Previous"],"accountScreen.custody.cancelPending":["Cancel Pending Withdrawals"],"accountScreen.custody.cancelPendingWithdrawalAddress":["Cancel Pending Withdrawal Address"],"accountScreen.custody.cannotCopyToClipboard":["Can't 
2103copy the text. Please do it yourself"],"accountScreen.custody.clientId":["Client ID"],"accountScreen.custody.clientSecret":["Client Secret"],"accountScreen.custody.cobo":["Cobo"],"accountScreen.custody.cobo.logsTitle":["COBO Custody Logs"],"accountScreen.custody.cobo.withdrawalAddressTitle":["Set COBO Custody Withdrawal Address"],"accountScreen.custody.copied":["Copied"],"accountScreen.custody.copper":["Copper"],"accountScreen.custody.copper.logsTitle":["COPPER Custody Logs"],"accountScreen.custody.copper.setAPIKeyDialogTitle":["Set API Key for COPPER Custody"],"accountScreen.custody.copyToClipboard":["Copy to clipboard"],"accountScreen.custody.custdoyClientCreated":["The Custody Client ID has been successfully created!"],"accountScreen.custody.custody":["Custody"],"accountScreen.custody.custodyId":["Custody Account Id"],"accountScreen.custody.depositAddress":["Deposit Address"],"accountScreen.custody.falconx":["FalconX"],"accountScreen.custody.falconx.logsTitle":["FalconX Custody Logs"],"accountScreen.custody.falconx.setAPIKeyDialogTitle":["Set API Key for FalconX Custody"],"accountScreen.custody.feeBalance":["Fee balance"],"accountScreen.custody.fireblocks":["Fireblocks"],"accountScreen.custody.fireblocks.logsTitle":["Fireblocks Custody Logs"],"accountScreen.custody.fireblocks.setAPIKeyDialogTitle":["Set API Key for Fireblocks Custody"],"accountScreen.custody.keyNotFound":["The API Key related to this Custody is missing.<0/> Please contact ",["supportMailLink"]," in order to solve this issue."],"accountScreen.custody.komainu":["Komainu"],"accountScreen.custody.komainu.logsTitle":["Komainu Custody Logs"],"accountScreen.custody.komainu.setAPIKeyDialogTitle":["Set API Key for Komainu Custody"],"accountScreen.custody.loadSecretKey":["Load Secret Key"],"accountScreen.custody.logs.amount":["Amount"],"accountScreen.custody.logs.depositToCustody":["Deposit to custody balance"],"accountScreen.custody.logs.depositTrading":["Deposit to trading balance"],"accountScreen.custody.logs.log":["Log"],"accountScreen.custody.logs.requestId":["Request ID"],"accountScreen.custody.logs.withdrawalFromCustody":["Withdrawal from custody balance"],"accountScreen.custody.logs.withdrawalFromTrading":["Withdrawal from trading balance"],"accountScreen.custody.messages.cancelWithdrawalAddressSuccessfull":["The pending withdrawal address was cancelled successfully. "],"accountScreen.custody.messages.depositAddressSuccessfull":["The deposit address was set successfully."],"accountScreen.custody.messages.invalidAddress":["The address is invalid."],"accountScreen.custody.messages.maximumAmountOfDecimals":["For amounts in ",["0"]," there is a limit of ",["1"]," decimals."],"accountScreen.custody.messages.operationProblem":["There was a problem with this operation."],"accountScreen.custody.messages.successfulRequest":["Successful Request"],"accountScreen.custody.messages.transactionProblem":["There was a problem with this transaction."],"accountScreen.custody.messages.withdrawSuccessful":["The withdrawal of ",["amount"]," ",["currency"]," has been successfully requested."],"accountScreen.custody.messages.withdrawalAddressPending":["The new withdrawal address is pending."],"accountScreen.custody.messages.withdrawalAddressSuccessfull":["The withdrawal address has been set successfully."],"accountScreen.custody.messages.withdrawalLimit":["Transfer would cross the daily withdrawals limit of ",["0"]," ",["1"],". Current withdrawals amount: ",["2"]],"accountScreen.custody.noAPIKeys":["There are no API Keys available.<0/>Please set an API key for Custody with scope 'custody:read_write' in ",["apiPageLink"],"."],"accountScreen.custody.noCustody":["No custody is enabled for this account."],"accountScreen.custody.noCustodyForCurrency":["Your custodian does not support this currency."],"accountScreen.custody.pendingWithdrawalAddress":["Withdrawal address \`",["pending_withdrawal_address"],"\` will be available on ",["0"]],"accountScreen.custody.pendingWithdrawalAmount":["Pending Withdrawal Amount"],"accountScreen.custody.pendingWithdrawals":["Pending Withdrawals Amount"],"accountScreen.custody.pendingWithdrawalsCanceledSuccessfully":["The pending withdrawals have been cancelled successfully."],"accountScreen.custody.setAPIKey":["Set an API key"],"accountScreen.custody.setAPIKeyDialogButton":["Submit"],"accountScreen.custody.setDepositAddress":["Set Deposit Address"],"accountScreen.custody.setWithdrawalAddress":["Set Withdrawal Address"],"accountScreen.custody.showLogs":["Show Logs"],"accountScreen.custody.sygnum":["Sygnum"],"accountScreen.custody.sygnum.logsTitle":["Sygnum Custody Logs"],"accountScreen.custody.sygnum.setAPIKeyDialogTitle":["Set API Key for Sygnum Custody"],"accountScreen.custody.tradingBlance":["Trading Balance"],"accountScreen.custody.withdraw":["Withdraw"],"accountScreen.custody.withdraw.button":["Withdraw"],"accountScreen.custody.withdrawalAddress":["Withdrawal Address"],"accountScreen.custody.zodia":["Zodia"],"accountScreen.custody.zodia.logsTitle":["ZODIA Custody Logs"],"accountScreen.custody.zodia.setAPIKeyDialogTitle":["Set API Key for ZODIA Custody"],"accountScreen.deposit.actions":["Actions"],"accountScreen.deposit.addMissingInfo":["Add Missing Info"],"accountScreen.deposit.address":["Deposit Address"],"accountScreen.deposit.addressBelongToIndividualOrCorporation":["Is the Originator an individual or a corporation?"],"accountScreen.deposit.addressCreated":["A new deposit address has been created"],"accountScreen.deposit.addressOld":["Old format (address:tag)"],"accountScreen.deposit.amount":["Amount"],"accountScreen.deposit.buidlAddressWarnings":["For withdrawals of BUIDL, the destination address has to be whitelisted with Securitize directly. Absence of whitelisting with Securitize will result in the rejection of the withdrawal operation. For more information see <0>https://securitize.io/buidl-lgf-1</0>"],"accountScreen.deposit.clearance_status":["Clearance Status"],"accountScreen.deposit.completed":["Completed"],"accountScreen.deposit.copied":["Copied"],"accountScreen.deposit.copyToClipboard":["Copy to clipboard"],"accountScreen.deposit.depositAddress":["Your ",["currencyInfo"]," deposit address is:"],"accountScreen.deposit.depositAddressCreationFailed":["Deposit address creation failed"],"accountScreen.deposit.depositAddressInfo":["Please provide the information of the sender (\\"Originator\\") of the deposit below."],"accountScreen.deposit.depositExtraInfoForETH":["Please be sure to add enough gas to your transaction (",["ethGasLimit"],"). Depositing from another exchange might not work, therefore, we strongly suggest to only deposit from an <0>Ethereum wallet</0>."],"accountScreen.deposit.depositHistory":["Deposit History"],"accountScreen.deposit.depositInfo":["Your deposit will be credited in a few minutes after <0>",["confirmationsAmount"]," confirmation(s)</0> on the ",["networkName"]," network, provided that the necessary <1>Travel Rule</1> information for the source address has been entered."],"accountScreen.deposit.depositInfoForCurrency":["We do not charge a fee for ",["currency"]," deposits. Don’t send <0>less</0> than ",["minAmount"]," ",["currency"],", as the transaction may not get processed."],"accountScreen.deposit.depositSourceInfo":["Deposit Source Information"],"accountScreen.deposit.destinationTag":["De
2103stination Tag"],"accountScreen.deposit.destinationTagWithValue":["Destination Tag: ",["destinationTag"]],"accountScreen.deposit.ethWarning1":["Please make sure to add a high enough gas limit (",["ethGasLimit"],") to your transaction."],"accountScreen.deposit.ethWarning2":["Sending anything other than ETH to this address might result in loss of funds."],"accountScreen.deposit.ethWarning3":["Only use Ethereum (ERC20) network or your funds might be unrecoverable."],"accountScreen.deposit.failed":["Failed"],"accountScreen.deposit.failed.tooltip":["Invalid transaction. Deposit is not credited."],"accountScreen.deposit.generateDepositAddress":["Generate a deposit address"],"accountScreen.deposit.goToVerification":["Click here to verify your account"],"accountScreen.deposit.here":["here"],"accountScreen.deposit.inProgress":["In Progress"],"accountScreen.deposit.inReview":["In Review"],"accountScreen.deposit.infoAPIKeyScopeRequired":["API Key with scopes 'account: read' and 'custody: read_write' is required."],"accountScreen.deposit.lastUpdate":["Last Update"],"accountScreen.deposit.missingInfo":["Missing Info"],"accountScreen.deposit.missingInfo.tooltip":["Please provide missing information so the deposit can be credited"],"accountScreen.deposit.networkDisplayName":["Network"],"accountScreen.deposit.networkWithValue":["Network: ",["networkDisplayName"]],"accountScreen.deposit.originatorCompanyName":["Originator's company name"],"accountScreen.deposit.originatorFirstName":["Originator's first name"],"accountScreen.deposit.originatorLastName":["Originator's last name"],"accountScreen.deposit.orignatorBlockchainAddress":["Originator's Blockchain Address"],"accountScreen.deposit.personal.question":["Are you the originator?"],"accountScreen.deposit.processing":["Processing..."],"accountScreen.deposit.processing.tooltip":["Deposit is in progress"],"accountScreen.deposit.qrInfo":["Only send ",["currency"]," to this address"],"accountScreen.deposit.qrInfo2":["Sending coins other than ",["currency"]," to this address may result in the loss of your deposit."],"accountScreen.deposit.qrInfoETH":["Only send native ETH to this address on Ethereum chain.\\nSending coins other than ETH to this address or on another chain than Ethereum may result in the loss of your deposit."],"accountScreen.deposit.qrInfoUSDC":["Only send ERC20 USDC to this address on Ethereum chain.\\nSending coins other than USDC to this address or on another chain than Ethereum may result in the loss of your deposit"],"accountScreen.deposit.refunded":["Refunded"],"accountScreen.deposit.refunded.tooltip":["Transaction was refunded to the originator"],"accountScreen.deposit.rejected":["Rejected"],"accountScreen.deposit.rejected.tooltip":["Deposit is not credited. Please contact <0>[email protected]</0>"],"accountScreen.deposit.replaced":["Replaced"],"accountScreen.deposit.sanctionedJurisdictionsWarning":["Do not send ",["currency"]," that originates, directly or indirectly, from individuals or entities sanctioned by the UAE, the UN, or OFAC, or from wallet addresses operated by exchanges located in sanctioned jurisdictions such as Belarus, Iran, North Korea, Russia, or Syria. Such actions may result in the freezing of assets and/or the termination of your account."],"accountScreen.deposit.sanctionedJurisdictionsWarningHtx":["Do not send ",["currency"]," from addresses linked to HTX, as HTX has recently been sanctioned. Such deposits will not be credited."],"accountScreen.deposit.selectNetwork":["Select network"],"accountScreen.deposit.setupTfaToGenerateAddress":["Please set up a security key to generate a deposit address"],"accountScreen.deposit.solWarningMessage":["We currently do not offer any ",["currency"]," instruments. Derivative and spot trading is not possible."],"accountScreen.deposit.sourceAddress":["Source Address"],"accountScreen.deposit.status":["Status"],"accountScreen.deposit.success":["Success"],"accountScreen.deposit.transactionInfo":["Transaction confirmation on the ",["networkName"]," network can take from 1 hour and more if sent with a low fee."],"accountScreen.deposit.txInfo":["Tx Info"],"accountScreen.deposit.usdcERC20Warning":["Only send ",["currency"]," using the Ethereum (ERC20) network, or your funds might be unrecoverable. We do not accept other chains."],"accountScreen.deposit.usycAddressWarnings":["For deposit operations in USYC, the deposit address has to be whitelisted with Hashnote directly. Absence of whitelisting with Hashnote will result in the rejection of the deposit operation. For more information see <0>https://usyc.docs.hashnote.com/overview/investor-onboarding</0>"],"accountScreen.deposit.xrpAddressWarning1":["Deribit uses the new X-address format for XRP addresses. To convert X-address to old format use the link: ",["xrpDocumentationLink"],"."],"accountScreen.deposit.xrpAddressWarning2":["Make sure to specify the deposit tag. Transactions with a missing or incorrect tag may result in the loss of your deposit."],"accountScreen.externalEquity.custody":["Custody"],"accountScreen.externalEquity.destination":["Destination"],"accountScreen.externalEquity.destinationCurrency":["Destination (",["currency"],")"],"accountScreen.externalEquity.header":["External Equity"],"accountScreen.externalEquity.input.amount.label":["Amount"],"accountScreen.externalEquity.source":["Source"],"accountScreen.externalEquity.sourceCurrency":["Source (",["currency"],")"],"accountScreen.externalEquity.submitButton":["Move Exter
2103nal Equity"],"accountScreen.externalEquity.transferProcessedSuccessfully.":["Transfer processed successfully."],"accountScreen.impliedEquity.destination":["Destination"],"accountScreen.impliedEquity.destinationCurrency":["Destination (",["targetCurrency"],")"],"accountScreen.impliedEquity.header":["Implied Equity"],"accountScreen.impliedEquity.input.amount.label":["Amount"],"accountScreen.impliedEquity.source":["Source"],"accountScreen.impliedEquity.sourceCurrency":["Source (",["currency"],")"],"accountScreen.impliedEquity.submitButton":["Move Implied Equity"],"accountScreen.impliedEquity.transferProcessedSuccessfully.":["Transfer processed successfully."],"accountScreen.investorClassification.institutionalInvestor":["Institutional Investor"],"accountScreen.investorClassification.qualifiedInvestor":["Qualified Investor"],"accountScreen.investorClassification.retailInvestor":["Retail Investor"],"accountScreen.legal.accept":["Accept"],"accountScreen.legal.agreeToMigrationMessage":["I consent to the transfer of my Deribit account from DRB Panama Inc. to Deribit FZE."],"accountScreen.legal.alert.review":["Review"],"accountScreen.legal.alert.title":["New terms of service"],"accountScreen.legal.beforeTrade":["Before you can start trading, you are required to complete our KYC process in the menu ",["0"],"."],"accountScreen.legal.cbbm.onboardedCustodyEntity":["You have been onboarded onto the Coinbase broker in Bermuda as your custody entity."],"accountScreen.legal.cbbm.onboardedTradingEntity":["You have been onboarded onto the Coinbase broker in Bermuda as your trading entity and custody entity."],"accountScreen.legal.cbbm.tosInfo":["Please find a copy of the Terms of Service by clicking the link below. If you have any questions, please reach out to your Account Manager or send an email to ",["cbbmContactLink"],"."],"accountScreen.legal.cbbm.userAgreementLink":["Coinbase Bermuda Ltd User Agreement"],"accountScreen.legal.contactUs":["If you have any questions, please contact ",["contactLink"],"."],"accountScreen.legal.custodySelection.deribitCustody":["Deribit Custody Wallets"],"accountScreen.legal.custodySelection.desktop.description":["By default, the virtual assets in your Deribit account will be held in Deribit Custody wallets. However, you also have the option to use a third-party custodian (if you are a customer of one or planning to become one). You can review the available options <0>here</0>.<1/><2/>Please confirm whether you will be using Deribit Custody or one of the following third-party custodians:"],"accountScreen.legal.custodySelection.mobile.description":["However, you also have the option to use a third-party custodian (if you are a customer of one or planning to become one). You can review the available options <0>here</0>.<1/><2/>Please confirm whether you will be using Deribit Custody or one of the following third-party custodians:"],"accountScreen.legal.custodySelection.mobile.introParagraph":["By default, the virtual assets in your Deribit account will be held in Deribit Custody wallets."],"accountScreen.legal.custodySelection.thirdPartyCustodian":["Listed Third-Party Custodian"],"accountScreen.legal.custodySelection.title":["Custody Selection"],"accountScreen.legal.deribitRegulatedExchange":["Deribit’s regulated exchange in Dubai"],"accountScreen.legal.documentsTable.applicable":["Applicable"],"accountScreen.legal.documentsTable.current":["Current"],"accountScreen.legal.documentsTable.dateOfAcceptance":["Date of acceptance"],"accountScreen.legal.documentsTable.legalDocument":["Legal document"],"accountScreen.legal.documentsTable.title":["Legal Documents"],"accountScreen.legal.documentsTable.type":["Type"],"accountScreen.legal.dubai.alert":["We have updated our terms. Please review and accept the new Exchange Membership Terms and Exchange Rulebook by clicking the button below."],"accountScreen.legal.etdQuiz.question1":["What investments do you have experience with?"],"accountScreen.legal.etdQuiz.question1.choice1":["Futures/options"],"accountScreen.legal.etdQuiz.question1.choice2":["Other leveraged products"],"accountScreen.legal.etdQuiz.question1.choice3":["Non-leveraged products (e.g. stocks, ETFs, spot, etc.)"],"accountScreen.legal.etdQuiz.question1.choice4":["None of the above"],"accountScreen.legal.etdQuiz.question10":["My position may be automatically closed when:"],"accountScreen.legal.etdQuiz.question10.choice1":["My position is profitable."],"accountScreen.legal.etdQuiz.question10.choice2":["My account is running at a loss. The value of my account has fallen below the maintenance margin requirement."],"accountScreen.legal.etdQuiz.question10.choice3":["My position has not changed."],"accountScreen.legal.etdQuiz.question10.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question11":["Which of the following best describes price slippage?"],"accountScreen.legal.etdQuiz.question11.choice1":["The difference between the price before an order (the arrival price) and the execution price."],"accountScreen.legal.etdQuiz.question11.choice2":["The movement of price of a derivative in a bear market."],"accountScreen.legal.etdQuiz.question11.choice3":["When the price moves in your favor."],"accountScreen.legal.etdQuiz.question11.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question12":["You have set a stop-loss on your position. If the market moves rapidly and gaps through the price you have set, what will happen?"],"accountScreen.legal.etdQuiz.question12.choice1":["The stop-loss will close my position at a better price than expected."],"accountScreen.legal.etdQuiz.question12.choice2":["The stop-loss will close my position at the next available price, which could be worse than expected, resulting in a greater loss."],"accountScreen.legal.etdQuiz.question12.choice3":["The stop-loss will not be triggered."],"accountScreen.legal.etdQuiz.question12.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question13":["To open a future position, you need sufficient collateral on your account to cover the:"],"accountScreen.legal.etdQuiz.question13.choice1":["Nominal value of the position."],"accountScreen.legal.etdQuiz.question13.choice2":["Initial margin requirements."],"accountScreen.legal.etdQuiz.question13.choice3":["The premium for the position."],"accountScreen.legal.etdQuiz.question13.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question14":["What are Coin-M Futures"],"accountScreen.legal.etdQuiz.question14.choice1":["Futures margined and quoted in USDC"],"accountScreen.legal.etdQuiz.question14.choice2":["Futures margined and quoted in USDT"],"accountScreen.legal.etdQuiz.question14.choice3":["Futures margined and quoted in their underlying cryptocurrency"],"accountScreen.legal.etdQuiz.question14.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question15":["When trading dated futures, which of the following is correct?"],"accountScreen.legal.etdQuiz.question15.choice1":["The future will expire with the expiry of the underlying asset"],"accountScreen.legal.etdQuiz.question15.choice2":["The future will not expire."],"accountScreen.legal.etdQuiz.question15.choice3":["The future will expire even if the underlying asset does not expire."],"accountScreen.legal.etdQuiz.question15.choice4":["I don't know"],"accountScreen.legal.etdQuiz.question16":["Which of the following is correct about futures"],"accountScreen.legal.etdQuiz.question16.choice1":["Futures are cash products where you can only trade for the cash available on your account."],"accountScreen.legal.etdQuiz.question16.choice2":["When trading futures, you pay a premium and your losses are limited to this premium."],"accountScreen.legal.etdQuiz.question16.choice3":["Futures are margin products where collateral on your account can be leveraged for greater market effect, magnifying both your profits and losses."],"accountScreen.legal.etdQuiz.question16.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question17":["When short selling futures, losses are:"],"accountScreen.legal.etdQuiz.question17.choice1":["Limited to your initial investment."],"accountScreen.legal.etdQuiz.question17.choice2":["Limited to a premium paid."],"accountScreen.legal.etdQuiz.question17.choice3":["Potentially unlimited."],"accountScreen.legal.etdQuiz.question17.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question18":["What is a dated futures contract?"],"accountScreen.legal.etdQuiz.question18.choice1":["An agreement to buy or sell an underlying asset at an agreed price on a fixed date."],"accountScreen.legal.etdQuiz.question18.choice2":["An agreement to buy or sell an underlying asset at an agreed price at any time after a fixed date."],"accountScreen.legal.etdQuiz.question18.choice3":["An agreement that gives the buyer the option but not the obligation to buy or sell the underlying asset at an agreed price on or before a fixed date."],"accountScreen.legal.etdQuiz.question18.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question19":["To open a futures position, you need collateral on your account to cover the:"],"accountScreen.legal.etdQuiz.question19.choice1":["The cash value of the futures contracts."],"accountScreen.legal.etdQuiz.question19.choice2":["The initial margin."],"accountScreen.legal.etdQuiz.question19.choice3":["The maintenance margin."],"accountScreen.legal.etdQuiz.question19.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question2":["How many trades in leveraged financial instruments (e.g. options, futures, perpetuals) have you placed in the course of the last year?"],"accountScreen.legal.etdQuiz.question2.choice1":["0"],"accountScreen.legal.etdQuiz.question2.choice2":["1-9"],"accountScreen.legal.etdQuiz.question2.choice3":["10-49"],"accountScreen.legal.etdQuiz.question2.choice4":["More than 50"],"accountScreen.legal.etdQuiz.question20":["How can futures contracts be used for hedging purposes in the crypto market?"],"accountScreen.legal.etdQuiz.question20.choice1":["By investing in multiple cryptocurrencies to increase exposure."],"accountScreen.legal.etdQuiz.question20.choice2":["By taking a futures position that offsets the risk of price movements in the underlying cryptocurrency."],"accountScreen.legal.etdQuiz.question20.choice3":["By selling all existing assets to avoid losses."],"accountScreen.legal.etdQuiz.question20.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question21":["What is an example of risk management practice when trading COIN-M or USDS-M futures?"],"accountScreen.legal.etdQuiz.question21.choice1":["Avoiding the use of stop-loss orders"],"accountScreen.legal.etdQuiz.question21.choice2":["Allocating all your capital to a single trade"],"accountScreen.legal.etdQuiz.question21.choice3":["Using a diversified portfolio and setting stop-loss levels"],"accountScreen.legal.etdQuiz.question21.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question22":["Which of the following statements is true regarding settlement in COIN-M and USDS-M futures?"],"accountScreen.legal.etdQuiz.question22.choice1":["COIN-M futures are settled in the underlying cryptocurrency, while USDS-M futures are settled in USD pegged stablecoins."],"accountScreen.legal.etdQuiz.question22.choice2":["USDS-M futures are settled in any fiat currency."],"accountScreen.legal.etdQuiz.question22.choice3":["COIN-M futures can only be settled in Bitcoin."],"accountScreen.legal.etdQuiz.question22.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question23":["How does using leverage in COIN-M or USDS-M futures trading affect your risk exposure?"],"accountScreen.legal.etdQuiz.question23.choice1":["It eliminates risk completely."],"accountScreen.legal.etdQuiz.question23.choice2":["It increases both potential profits and potential losses."],"accountScreen.legal.etdQuiz.question23.choice3":["It has no effect on risk exposure."],"accountScreen.legal.etdQuiz.question23.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question24":["What does \\"open interest\\" indicate in the context of futures trading?"],"accountScreen.legal.etdQuiz.question24.choice1":["The total number of futures contracts that are open and active in the market."],"accountScreen.legal.etdQuiz.question24.choice2":["The interest rates applied to margin accounts."],"accountScreen.legal.etdQuiz.question24.choice3":["The number of investors actively trading in the market."],"accountScreen.legal.etdQuiz.question24.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question25":["What are funding fees in perpetual futures contracts?"],"accountScreen.legal.etdQuiz.question25.choice1":["Fees paid to the exchange for opening a trade."],"accountScreen.legal.etdQuiz.question25.choice2":["Fees exchanged between long and short positions to ensure the contract price stays in line with the underlying asset price."],"accountScreen.legal.etdQuiz.question25.choice3":["Fixed fees applied at the end of the trading day."],"accountScreen.legal.etdQuiz.question25.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question26":["What does short selling involve in the context of futures trading?"],"accountScreen.legal.etdQuiz.question26.choice1":["Buying an asset with the expectation that its price will rise."],"accountScreen.legal.etdQuiz.question26.choice2":["Selling a futures contract with the expectation that the price of the underlying asset will fall."],"accountScreen.legal.etdQuiz.question26.choice3":["Selling an asset in order to buy a different one."],"accountScreen.legal.etdQuiz.question26.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question27":["What is the role of liquidity pools in the context of futures trading?"],"accountScreen.legal.etdQuiz.question27.choice1":["They help maintain a fixed price for the underlying asset."],"accountScreen.legal.etdQuiz.question27.choice2":["They provide liquidity to the market, enabling traders to execute orders without significant price slippage."],"accountScreen.legal.etdQuiz.question27.choice3":["They are only relevant for spot trading."],"accountScreen.legal.etdQuiz.question27.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question28":["What is the difference between a market maker and a market taker in futures trading?"],"accountScreen.legal.etdQuiz.question28.choice1":["Market makers provide liquidity by placing limit orders, while market takers fill existing orders at market prices."],"accountScreen.legal.etdQuiz.question28.choice2":["Market makers trade only for themselves, while market takers trade on behalf of clients."],"accountScreen.legal.etdQuiz.question28.choice3":["Market makers are always institutional investors, while market takers are retail investors."],"accountScreen.legal.etdQuiz.question28.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question29":["What is a primary risk associated with using high leverage in futures trading?"],"accountScreen.legal.etdQuiz.question29.choice1":["It can lead to substantial losses that exceed your initial margin."],"accountScreen.legal.etdQuiz.question29.choice2":["It eliminates the need for margin calls."],"accountScreen.legal.etdQuiz.question29.choice3":["It allows for safer trading of illiquid assets."],"accountScreen.legal.etdQuiz.question29.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question3":["Has your current job (or a previous job held) assisted your understanding of the risks involved with trading leveraged financial instruments?"],"accountScreen.legal.etdQuiz.question3.choice1":["No"],"accountScreen.legal.etdQuiz.question3.choice2":["Yes, I was employed in this job for less than 3 months"],"accountScreen.legal.etdQuiz.question3.choice3":["Yes, I was employed in this job for 3-12 months"],"accountScreen.legal.etdQuiz.question3.choice4":["Yes, I was employed in this job for 1-3 years"],"accountScreen.legal.etdQuiz.question3.choice5":["Yes, I was employed in this job for more than 3 years"],"accountScreen.legal.etdQuiz.question30":["Why is liquidity important when trading crypto futures?"],"accountScreen.legal.etdQuiz.question30.choice1":["It ensures that traders can enter and exit positions without significant price impact."],"accountScreen.legal.etdQuiz.question30.choice2":["Higher liquidity guarantees profit."],"accountScreen.legal.etdQuiz.question30.choice3":["It only affects the price of the underlying asset, not futures contracts."],"accountScree
2103n.legal.etdQuiz.question30.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question31":["What distinguishes COIN-M futures from USDS-M futures?"],"accountScreen.legal.etdQuiz.question31.choice1":["COIN-M futures are traded exclusively in Bitcoin, while USDS-M futures can be traded in any cryptocurrency."],"accountScreen.legal.etdQuiz.question31.choice2":["COIN-M futures are settled in cryptocurrencies, whereas USDS-M futures are settled in USD pegged stablecoins."],"accountScreen.legal.etdQuiz.question31.choice3":["COIN-M futures are only available on decentralized exchanges."],"accountScreen.legal.etdQuiz.question31.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question32":["When buying an option, losses are:"],"accountScreen.legal.etdQuiz.question32.choice1":["Limited to the premium paid."],"accountScreen.legal.etdQuiz.question32.choice2":["Limited to the premium received."],"accountScreen.legal.etdQuiz.question32.choice3":["Potentially unlimited."],"accountScreen.legal.etdQuiz.question32.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question33":["If you buy a call option:"],"accountScreen.legal.etdQuiz.question33.choice1":["You have the right (but not the obligation) to buy the underlying financial instrument at the strike price."],"accountScreen.legal.etdQuiz.question33.choice2":["You have the obligation to buy the underlying financial instrument at the strike price."],"accountScreen.legal.etdQuiz.question33.choice3":["You have the obligation to sell the underlying financial instrument to the buyer at the strike price."],"accountScreen.legal.etdQuiz.question33.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question34":["What does it mean if options are leveraged?"],"accountScreen.legal.etdQuiz.question34.choice1":["You have the right, but not the obligation to exercise the option."],"accountScreen.legal.etdQuiz.question34.choice2":["Profits and losses are magnified compared to the underlying asset."],"accountScreen.legal.etdQuiz.question34.choice3":["Lowers sensitivity to price changes in the underlying asset."],"accountScreen.legal.etdQuiz.question34.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question35":["Which of the following best describes the \\"premium\\" of an option?"],"accountScreen.legal.etdQuiz.question35.choice1":["The cost of purchasing the option."],"accountScreen.legal.etdQuiz.question35.choice2":["The profit gained from exercising the option."],"accountScreen.legal.etdQuiz.question35.choice3":["The difference between the strike price and the market price."],"accountScreen.legal.etdQuiz.question35.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question36":["The price of an option can change due to:"],"accountScreen.legal.etdQuiz.question36.choice1":["Changes in the price of the underlying instrument."],"accountScreen.legal.etdQuiz.question36.choice2":["Changes in price volatility of the underlying instrument."],"accountScreen.legal.etdQuiz.question36.choice3":["Time-decay of the option towards expiry."],"accountScreen.legal.etdQuiz.question36.choice4":["All of the above."],"accountScreen.legal.etdQuiz.question36.choice5":["I don't know."],"accountScreen.legal.etdQuiz.question37":["When writing (selling) an option, losses are:"],"accountScreen.legal.etdQuiz.question37.choice1":["Limited to the premium paid."],"accountScreen.legal.etdQuiz.question37.choice2":["Limited to the premium received."],"accountScreen.legal.etdQuiz.question37.choice3":["Potentially unlimited."],"accountScreen.legal.etdQuiz.question37.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question38":["What is the term for the price at which an option can be exercised?"],"accountScreen.legal.etdQuiz.question38.choice1":["Strike price"],"accountScreen.legal.etdQuiz.question38.choice2":["Premium"],"accountScreen.legal.etdQuiz.question38.choice3":["Market Price"],"accountScreen.legal.etdQuiz.question38.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question39":["What happens to an option's time value as it approaches expiration?"],"accountScreen.legal.etdQuiz.question39.choice1":["It increases exponentially."],"accountScreen.legal.etdQuiz.question39.choice2":["It decreases and eventually becomes zero."],"accountScreen.legal.etdQuiz.question39.choice3":["It becomes negative."],"accountScreen.legal.etdQuiz.question39.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question4":["Do you have any relevant qualifications/studied courses which w
2103ould assist your understanding of the nature and risk of trading leveraged financial instruments?"],"accountScreen.legal.etdQuiz.question4.choice1":["Yes - I have a relevant financial qualification"],"accountScreen.legal.etdQuiz.question4.choice2":["Yes - I have a relevant formal qualification (i.e. degree level)"],"accountScreen.legal.etdQuiz.question4.choice3":["Yes - I have attended formal training courses/seminars or other educational or training processes (lasting at least several days)"],"accountScreen.legal.etdQuiz.question4.choice4":["No"],"accountScreen.legal.etdQuiz.question40":["In options trading, what does \\"delta\\" measure?"],"accountScreen.legal.etdQuiz.question40.choice1":["The time decay of an option."],"accountScreen.legal.etdQuiz.question40.choice2":["The sensitivity of the option's price to changes in the price of the underlying asset."],"accountScreen.legal.etdQuiz.question40.choice3":["The change in the option's price with respect to changes in volatility."],"accountScreen.legal.etdQuiz.question40.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question41":["What does the \\"theta\\" of an option represent?"],"accountScreen.legal.etdQuiz.question41.choice1":["The rate at which an option's value declines as it approaches expiration."],"accountScreen.legal.etdQuiz.question41.choice2":["The likelihood of the option expiring in the money."],"accountScreen.legal.etdQuiz.question41.choice3":["The implied volatility of the underlying asset."],"accountScreen.legal.etdQuiz.question41.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question42":["In which scenario w
2103ould a trader benefit most from a long call option?"],"accountScreen.legal.etdQuiz.question42.choice1":["When the underlying asset's price remains stable."],"accountScreen.legal.etdQuiz.question42.choice2":["When the underlying asset's price declines significantly."],"accountScreen.legal.etdQuiz.question42.choice3":["When the underlying asset's price increases significantly."],"accountScreen.legal.etdQuiz.question42.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question43":["What is a potential risk of selling naked options?"],"accountScreen.legal.etdQuiz.question43.choice1":["Limited profit potential."],"accountScreen.legal.etdQuiz.question43.choice2":["Unlimited loss potential."],"accountScreen.legal.etdQuiz.question43.choice3":["High premium costs."],"accountScreen.legal.etdQuiz.question43.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question44":["Which factor is NOT typically considered when pricing cryptocurrency options?"],"accountScreen.legal.etdQuiz.question44.choice1":["Current price of the underlying asset"],"accountScreen.legal.etdQuiz.question44.choice2":["Time until expiration"],"accountScreen.legal.etdQuiz.question44.choice3":["The regulatory environment"],"accountScreen.legal.etdQuiz.question44.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question45":["What is a key difference between options and futures contracts in crypto trading?"],"accountScreen.legal.etdQuiz.question45.choice1":["Options give you the obligation to buy or sell, while futures do not."],"accountScreen.legal.etdQuiz.question45.choice2":["Options provide the right, but not the obligation, to buy or sell the underlying asset."],"accountScreen.legal.etdQuiz.question45.choice3":["Futures are more complex than options."],"accountScreen.legal.etdQuiz.question45.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question46":["What is a key risk associated with buying options?"],"accountScreen.legal.etdQuiz.question46.choice1":["Options can be exercised at any time without notice."],"accountScreen.legal.etdQuiz.question46.choice2":["The total loss is limited to the premium paid, regardless of market movement."],"accountScreen.legal.etdQuiz.question46.choice3":["Options can expire worthless, resulting in a total loss of the premium paid."],"accountScreen.legal.etdQuiz.question46.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question47":["In cryptocurrency options trading, what does it mean to \\"exercise\\" an option?"],"accountScreen.legal.etdQuiz.question47.choice1":["To sell the option to another trader."],"accountScreen.legal.etdQuiz.question47.choice2":["To buy or sell the underlying cryptocurrency at the strike price."],"accountScreen.legal.etdQuiz.question47.choice3":["To convert the option into a futures contract."],"accountScreen.legal.etdQuiz.question47.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question48":["What does it mean for a long call option to be \\"in the money\\"?"],"accountScreen.legal.etdQuiz.question48.choice1":["The underlying asset price is lower than the strike price."],"accountScreen.legal.etdQuiz.question48.choice2":["The underlying asset price is higher than the strike price."],"accountScreen.legal.etdQuiz.question48.choice3":["The option is trading at its intrinsic value."],"accountScreen.legal.etdQuiz.question48.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question49":["The premium of an option consists of intrinsic value and which other component?"],"accountScreen.legal.etdQuiz.question49.choice1":["Interest rate"],"accountScreen.legal.etdQuiz.question49.choice2":["Strike price"],"accountScreen.legal.etdQuiz.question49.choice3":["Time value"],"accountScreen.legal.etdQuiz.question49.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question5":["Are you familiar with analyzing technical charts and indicators?"],"accountScreen.legal.etdQuiz.question5.choice1":["No, I am not familiar with analyzing technical charts and indicators."],"accountScreen.legal.etdQuiz.question5.choice2":["I have some understanding of analyzing technical charts and indicators."],"accountScreen.legal.etdQuiz.question5.choice3":["Yes, I am proficient in analyzing technical charts and indicators."],"accountScreen.legal.etdQuiz.question50":["What typically happens to an option if it expires out of the money?"],"accountScreen.legal.etdQuiz.question50.choice1":["The holder receives a payout."],"accountScreen.legal.etdQuiz.question50.choice2":["The option is exercised automatically."],"accountScreen.legal.etdQuiz.question50.choice3":["The option expires worthless."],"accountScreen.legal.etdQuiz.question50.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question51":["What is the purpose of a protective put in options trading?"],"accountScreen.legal.etdQuiz.question51.choice1":["To increase leverage and potential profit."],"accountScreen.legal.etdQuiz.question51.choice2":["To hedge against a decline in the value of the underlying asset."],"accountScreen.legal.etdQuiz.question51.choice3":["To reduce the premium paid on call options."],"accountScreen.legal.etdQuiz.question51.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question52":["Which of the following is generally true about selling options compared to buying options?"],"accountScreen.legal.etdQuiz.question52.choice1":["Selling options involves higher risk but can benefit from time decay."],"accountScreen.legal.etdQuiz.question52.choice2":["Selling options guarantees a higher profit than buying options."],"accountScreen.legal.etdQuiz.question52.choice3":["Selling options carries no risk 
2103if the market moves against the seller."],"accountScreen.legal.etdQuiz.question52.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question53":["How does the profit/loss potential work for a trader who buys a put option?"],"accountScreen.legal.etdQuiz.question53.choice1":["Loss is limited to the premium paid, while profit is potentially unlimited."],"accountScreen.legal.etdQuiz.question53.choice2":["Loss is limited to the premium paid, and profit is limited to the strike price minus the premium."],"accountScreen.legal.etdQuiz.question53.choice3":["Loss and profit are both unlimited."],"accountScreen.legal.etdQuiz.question53.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question54":["How is the breakeven price calculated for a call option at expiration?"],"accountScreen.legal.etdQuiz.question54.choice1":["Subtract the premium from the strike price"],"accountScreen.legal.etdQuiz.question54.choice2":["Add the premium to the strike price"],"accountScreen.legal.etdQuiz.question54.choice3":["The premium price itself is the breakeven"],"accountScreen.legal.etdQuiz.question54.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question55":["How does implied volatility affect the pricing of options?"],"accountScreen.legal.etdQuiz.question55.choice1":["Higher implied volatility generally increases the options premium, reflecting greater expected price movement."],"accountScreen.legal.etdQuiz.question55.choice2":["Higher implied volatility decreases the options premium."],"accountScreen.legal.etdQuiz.question55.choice3":["Implied volatility has no effect on option pricing."],"accountScreen.legal.etdQuiz.question55.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question6":["What leverage would create the biggest loss if the price moved against you?"],"accountScreen.legal.etdQuiz.question6.choice1":["1 to 1"],"accountScreen.legal.etdQuiz.question6.choice2":["1 to 10"],"accountScreen.legal.etdQuiz.question6.choice3":["1 to 30"],"accountScreen.legal.etdQuiz.question6.choice4":["I don't know"],"accountScreen.legal.etdQuiz.question7":["If you open a $30,000 position with 1:30 leverage, what is your margin?"],"accountScreen.legal.etdQuiz.question7.choice1":["$300"],"accountScreen.legal.etdQuiz.question7.choice2":["$1000"],"accountScreen.legal.etdQuiz.question7.choice3":["$10000"],"accountScreen.legal.etdQuiz.question7.choice4":["I don't know"],"accountScreen.legal.etdQuiz.question8":["What is a Margin Call?"],"accountScreen.legal.etdQuiz.question8.choice1":["Demand for additional capital to bring a margin account up to the minimum maintenance margin."],"accountScreen.legal.etdQuiz.question8.choice2":["Additional money provided by the broker."],"accountScreen.legal.etdQuiz.question8.choice3":["Demand for the client to open new positions."],"accountScreen.legal.etdQuiz.question8.choice4":["I don't know."],"accountScreen.legal.etdQuiz.question9":["What is \\"leverage\\" in the context of trading?"],"accountScreen.legal.etdQuiz.question9.choice1":["The ability to trade multiple contracts simultaneously."],"accountScreen.legal.etdQuiz.question9.choice2":["The ability to control a large position with a relatively small amount of capital."],"accountScreen.legal.etdQuiz.question9.choice3":["The method of diversifying across different asset classes."],"accountScreen.legal.etdQuiz.question9.choice4":["I don't know."],"accountScreen.legal.etdQuizBanner.consent.checkboxLabel":["I understand the risks associated with trading on this platform and wish to proceed with providing consent to use the products."],"accountScreen.legal.etdQuizBanner.consent.yesButton":["I consent"],"accountScreen.legal.etdQuizBanner.description.completed":["You have successfully passed the test."],"accountScreen.legal.etdQuizBanner.description.default":["We'll ask you a few questions to make sure you understand the risks involved in trading on this platform. If you don't pass, you can try again after a waiting period."],"accountScreen.legal.etdQuizBanner.description.failed":["You have not been successful in taking the quiz, but you can take it again after the time window below."],"accountScreen.legal.etdQuizBanner.description.failedNotLocked":["You have not been successful in taking the quiz, but you can try again now."],"accountScreen.legal.etdQuizBanner.description.requiresConsent":["It is risky for you to trade on the platform. You must provide consent to use our products."],"accountScreen.legal.etdQuizBanner.startQuizButton":["Start Quiz"],"accountScreen.legal.etdQuizBanner.successMessage":["Well done! You have passed the quiz"],"accountScreen.legal.etdQuizBanner.timeRemainingTooltip":["You will be able to take the quiz again after ",["timeRemaining"]],"accountScreen.legal.etdQuizBanner.title.completed":["You have passed the Trading Knowledge Quiz"],"accountScreen.legal.etdQuizBanner.title.default":["Start the Trading Knowledge Quiz"],"accountScreen.legal.etdQuizBanner.title.failed":["You have failed the Trading Knowledge Quiz"],"accountScreen.legal.etdQuizBanner.title.requiresConsent":["Consent Required to Continue Trading"],"accountScreen.legal.etdQuizForm.cancelButton":["Cancel"],"accountScreen.legal.etdQuizForm.completion.closeButton":["Close"],"accountScreen.legal.etdQuizForm.completion.completed.caption":["Congratulations! You have successfully completed the quiz."],"accountScreen.legal.etdQuizForm.completion.completed.title":["You have passed the Trading Knowledge Quiz"],"accountScreen.legal.etdQuizForm.completion.failed.caption":["Please review the questions and try again later."],"accountScreen.legal.etdQuizForm.completion.failed.title":["You did not pass the Trading Knowledge Quiz"],"accountScreen.legal.etdQuizForm.consent.caption":["It is risky for you to trade on the platform. You must provide consent to use our products."],"accountScreen.legal.etdQuizForm.consent.checkboxLabel":["I understand the risks associated with trading on this platform and wish to proceed with providing consent to use the products."],"accountScreen.legal.etdQuizForm.consent.title":["You did not pass the Trading Knowledge Quiz"],"accountScreen.legal.etdQuizForm.consent.yesButton":["I consent"],"accountScreen.legal.etdQuizForm.description":["We are required to collect certain tax-related information to ensure proper reporting to the relevant tax authorities. Please review and complete the fields below."],"accountScreen.legal.etdQuizForm.emptyState.caption":["Click the button below to begin answering questions about trading knowledge."],"accountScreen.legal.etdQuizForm.emptyState.title":["Ready to start the quiz?"],"accountScreen.legal.etdQuizForm.modalTitle":["Trading Knowledge Quiz"],"accountScreen.legal.etdQuizForm.startQuizButton":["Start Quiz"],"accountScreen.legal.etdQuizForm.submitButton":["Submit Quiz"],"accountScreen.legal.experienced.acceptTermsMessage":["I agree to the Exchange Membership Terms and the Rulebook of Deribit FZE, after having read and understood them."],"accountScreen.legal.experienced.carefullyReviewTos":["We encourage you to carefully review the Exchange Membership Terms and the Exchange Rulebook."],"accountScreen.legal.investorClassificationMessage":["Your Investor Classification is ",["investorType"],". For more information on the Investor Classification, please visit our ",["knowledgeBaseLink"],"."],"accountScreen.legal.legalDocuments.error":["Getting legal documents failed. Please try again later."],"accountScreen.legal.legalDocuments.name.dubai.generalTerms":["Exchange Membership Terms Deribit FZE"],"accountScreen.legal.legalDocuments.name.dubai.rulebook":["Exchange Rulebook Deribit FZE"],"accountScreen.legal.legalDocuments.name.marketMakerAgreement":["Market Maker Agreement"],"accountScreen.legal.legalDocuments.name.methodologyAddendumToMarketMakerAgreement":["Methodology Addendum to Market Maker Agreement"],"accountScreen.legal.legalDocuments.name.panama.generalTerms":["Terms of Service DRB Panama Inc."],"accountScreen.legal.legalDocuments.name.panama.newGeneralTerms":["New Terms of Service DRB Panama Inc."],"accountScreen.legal.legalDocuments.name.productAddendumToMarketMakerAgreement":["Product Addendum to Market Maker Agreement"],"accountScreen.legal.linksBelowWithEffectiveDateAfterLive":["Please find below a link to the Exchange Membership Terms and the Exchange Rulebook from Deribit FZE, both of which are applicable as of ",["effectiveDate"]," for members of Deribit FZE."],"accountScreen.legal.marketMakerInfoTable.description":["To enroll in any of Deribit's liquidity programs, please contact your account manager to sign the Market Maker Agreement. The available programs are outlined in the Product Addendum. For the exact SLA measurement methods, see the Methodology Addendum."],"accountScreen.legal.marketMakerInfoTable.title":["Supplementary Information for Market Makers"],"accountScreen.legal.n
2103oAccess":["Not available for subaccounts"],"accountScreen.legal.noAccess.scope":["Access denied because of missing API key scope"],"accountScreen.legal.onboardBrokerMessage":["You have been onboarded onto the Deribit broker in Panama, operated by DRB Panama Inc."],"accountScreen.legal.specialCustodyClientCantTransfer":["Due to the way your third-party custody is set up, we cannot transfer your account to our exchange in Dubai at this point in time. Therefore, you will remain a client of DRB Panama Inc., which will be trading as a broker on the exchange in Dubai. All of our trading instruments will still be available to you."],"accountScreen.legal.termsAndRulebook":["Exchange Membership Terms & Rulebook"],"accountScreen.legal.termsOfService":["Terms of Service"],"accountScreen.legal.title":["Legal"],"accountScreen.legal.tosApplicabilityInfo":["Please find a copy of the Terms of Service by clicking the link below. These Terms of Service are applicable as of ",["effectiveDate"],"."],"accountScreen.legal.userNotification.allowTransferAccountNotification":["If you wish to transfer your Deribit account, including your equity and positions, to our regulated exchange in Dubai, please tick the box below. This will terminate the relationship between DRB Panama Inc. and you. Consequently, the Terms of Service of DRB Panama Inc. will no longer be applicable."],"accountScreen.legal.userNotification.memberOfDubai":["You are now a member of Deribit FZE."],"accountScreen.legal.userNotification.panamaRelationshipTermination":["The relationship between DRB Panama Inc. and you has been terminated. Consequently, the Terms of Service of DRB Panama Inc. are no longer applicable."],"accountScreen.legal.userNotification.transferredAccountMessage":["We have transferred your Deribit account, including your virtual assets and positions, from DRB Panama Inc. to Deribit FZE, our regulated exchange in Dubai on ",["migrationDate"],"."],"accountScreen.legal.userNotification.varaLicense":["Deribit FZE, our entity in Dubai, has obtained a license from the Virtual Assets Regulatory Authority (VARA) in Dubai. Since you are a ",["investorType"],", we can onboard you onto our regulated exchange in Dubai and transfer your Deribit account from DRB Panama Inc. to Deribit FZE."],"accountScreen.margin.maxNumSpotOrders":["Maximum number of open spot orders"],"accountScreen.margin.maxSizeSpotOrders":["Maximum size of all open spot orders"],"accountScreen.margin.maxTotalValOfSpot":["The total maximum value of open spot orders in ",["currency"]],"accountScreen.movePositions.areYouSureYouWantToMoveTheSelectedPositions":["Are you sure you want to move the selected positions?"],"accountScreen.movePositions.destination":["Destination"],"accountScreen.movePositions.destinationUID":["Destination User ID"],"accountScreen.movePositions.movePositions":["Move Positions"],"accountScreen.movePositions.pleaseSelectDestination":["Please select a destination"],"accountScreen.movePositions.pleaseSelectSource":["Please select a source"],"accountScreen.movePositions.positionsHaveBeenMoved":["Positions have been moved."],"accountScreen.movePositions.priceToMove":["Price to move"],"accountScreen.movePositions.showSelectedOnly":["Show selected only"],"accountScreen.movePositions.sizeToMove":["Size to move"],"accountScreen.movePositions.source":["Source"],"accountScreen.movePositions.sourceUID":["Source User ID"],"accountScreen.phoneBrokers.brokerName":["Broker Name"],"accountScreen.phoneBrokers.brokersHistory.title":["Brokers history"],"accountScreen.phoneBrokers.brokersOverview.confirmation.cancel":["Cancel"],"accountScreen.phoneBrokers.brokersOverview.onScreenConfirmation.dialog.acknowledgeWarningText":["I read the text above and want to remove on-screen confirmation"],"accountScreen.phoneBrokers.brokersOverview.onScreenConfirmation.dialog.confirmText":["Remove Confirmation"],"accountScreen.phoneBrokers.brokersOverview.onScreenConfirmation.dialog.subtitle":["Are you sure you want to remove on-screen confirmation for ",["0"],"?"],"accountScreen.phoneBrokers.brokersOverview.onScreenConfirmation.dialog.title":["Requires On-screen Confirmation"],"accountScreen.phoneBrokers.brokersOverview.onScreenConfirmation.dialog.warningText":["By removing on-screen confirmations, all trades that broker <0>",["0"],"</0> submits to your account will be automatically confirmed. Only change this setting if you have complete trust in <1>",["1"],"</1>."],"accountScreen.phoneBrokers.brokersOverview.removeLink.confirmation.brokerName":["Broker's name"],"accountScreen.phoneBrokers.brokersOverview.removeLink.confirmation.confirmText":["Remove Connection"],"accountScreen.phoneBrokers.brokersOverview.removeLink.confirmation.description":["Description"],"accountScreen.phoneBrokers.brokersOverview.removeLink.confirmation.subtitle":["Are you sure you want to unlink this broker?"],"accountScreen.phoneBrokers.brokersOverview.removeLink.confirmation.title":["Remove Connection to Broker"],"accountScreen.phoneBrokers.brokersOverview.removeLink.confirmation.warning":["Once the connection is removed, they will no longer be able to submit trades on your behalf."],"accountScreen.phoneBrokers.brokersOverview.removeLink.confirmation.warning.reconnect":["You can always re
2103connect later if needed."],"accountScreen.phoneBrokers.brokersOverview.title":["Brokers overview"],"accountScreen.phoneBrokers.clientName":["Client Name"],"accountScreen.phoneBrokers.companyName":["Company Name"],"accountScreen.phoneBrokers.confirmationsRequire2fa":["You need to set up a security key to perform this action"],"accountScreen.phoneBrokers.confirmationsRequired":["Requires on-screen confirmation"],"accountScreen.phoneBrokers.confirmationsShared":["Allow to confirm trades on other connected subs"],"accountScreen.phoneBrokers.dateAndTime":["Date & Time"],"accountScreen.phoneBrokers.description":["Description"],"accountScreen.phoneBrokers.displayName":["Display Name"],"accountScreen.phoneBrokers.internalNote":["Internal Note"],"accountScreen.phoneBrokers.logo":["Logo"],"accountScreen.phoneBrokers.pendingInvitation.noInvitations":["No Invitations"],"accountScreen.phoneBrokers.pendingInvitation.title":["Pending Invitation"],"accountScreen.phoneBrokers.shareCorporateRegistrationNumbers":["Share corporate registration numbers"],"accountScreen.phoneBrokers.shareCorporateRegistrationNumbers.tooltip":["If set to true, then the broker will be able to read your BRN and LEI codes"],"accountScreen.pnlAnalysis.accountSummary":["Account Summary"],"accountScreen.pnlAnalysis.accountValue":["Account Value"],"accountScreen.pnlAnalysis.accountValueDescription":["The total value of your account including withdrawals, deposits, and transfers."],"accountScreen.pnlAnalysis.averageBuyPrice":["Average Buy Price"],"accountScreen.pnlAnalysis.averageSellPrice":["Average Sell Price"],"accountScreen.pnlAnalysis.buyAmount":["Buy Amount"],"accountScreen.pnlAnalysis.closedPNL":["Closed PNL"],"accountScreen.pnlAnalysis.closedPnl":["Closed PNL"],"accountScreen.pnlAnalysis.cumulativeFees":["Cumulative Fees"],"accountScreen.pnlAnalysis.cumulativeFeesDescription":["The cumulative amount of trading fees paid."],"accountScreen.pnlAnalysis.description":["Provides an overview of your account's performance for options, futures, and perpetual instruments."],"accountScreen.pnlAnalysis.earned":["Earned"],"accountScreen.pnlAnalysis.feeSummary":["Fee Summary"],"accountScreen.pnlAnalysis.feeSummaryDescription":["A breakdown of the total trading fees paid and earned."],"accountScreen.pnlAnalysis.finalEquity":["Final Equity"],"accountScreen.pnlAnalysis.finalEquityExc":["Final Equity (excluding open positions)"],"accountScreen.pnlAnalysis.getAnalysis":["Get Analysis"],"accountScreen.pnlAnalysis.instrumentPNL":["Instrument PNL"],"accountScreen.pnlAnalysis.limitReached":["The date range chosen is too large. We could only fetch data from ",["startTime"]," to ",["lastLogTime"],". Please select a smaller range and try again."],"accountScreen.pnlAnalysis.noDataAvailable":["No data available."],"accountScreen.pnlAnalysis.openPnl":["Open PNL"],"accountScreen.pnlAnalysis.paid":["Paid"],"accountScreen.pnlAnalysis.remainingAmount":["Remaining Amount"],"accountScreen.pnlAnalysis.sellAmount":["Sell Amount"],"accountScreen.pnlAnalysis.source":["Source"],"accountScreen.pnlAnalysis.sum":["Sum"],"accountScreen.pnlAnalysis.totalFees":["Total Fees"],"accountScreen.pnlAnalysis.totalTransfers":["Total Transfers"],"accountScreen.pnlAnalysis.tradePNL":["Trade PNL"],"accountScreen.pnlAnalysis.tradePNLDescriptionWithCurrentTime":["Trades before the selected start time are excluded. PNL excludes any position PNL."],"accountScreen.pnlAnalysis.tradePNLDescriptionWithEndTime":["Trades with no match between buy and sell amounts during the selected time period are excluded. PNL excludes any position PNL."],"accountScreen.pnlAnalysis.transfers":["Transfers"],"accountScreen.pnlAnalysis.transfersBreakdown":["A breakdown of the total transfers."],"accountScreen.portfolioMargin.autoRefresh":["Auto Refresh"],"accountScreen.portfolioMargin.changeMargin":["Change Margin"],"accountScreen.portfolioMargin.checkOutKnowledgeBaseArticle":["Check out our knowledge base article to learn more about <0>Portfolio Margin</0>."],"accountScreen.portfolioMargin.contactInfo":["If these settings are too restrictive for your trading needs, please contact us at <0>[email protected]</0>"],"accountScreen.portfolioMargin.decouplingShock":["Decoupling Shock"],"accountScreen.portfolioMargin.deltaShock":["Delta Shock"],"accountScreen.portfolioMargin.extendedRiskMatrix":["Extended Risk Matrix"],"accountScreen.portfolioMargin.instrument":["Instrument"],"accountScreen.portfolioMargin.maxNumOfOpenFutures":["Maximum number of open futures orders per direction"],"accountScreen.portfolioMargin.maxNumOfOpenOptions":["Maximum number of open options orders per direction"],"accountScreen.portfolioMargin.maxNumOfOpenOrders":["Maximum number of all open orders on derivatives instruments"],"accountScreen.portfolioMargin.maxTotalAmountOfContracts":["Maximum total amount of contracts per direction in open orders for options"],"accountScreen.portfolioMargin.maxTotalValOfFutures":["Maximum total value of futures open orders per direction in USD"],"accountScreen.portfolioMargin.mmpMargin":["MMP Margin"],"accountScreen.portfolioMargin.openOrdersMargin":["Open Orders Margin"],"accountScreen.portfolioMargin.parametersPerCurrency":["Parameters per Currency"],"accountScreen.portfolioMargin.parametersPerCurrency.annualisedMoveRisk":["Annualised % move risk"],"accountScreen.portfolioMargin.parametersPerCurrency.both":["both"],"accountScreen.portfolioMargin.parametersPerCurrency.correlationSet":["Correlation Set"],"accountScreen.portfolioMargin.parametersPerCurrency.equityImpact":["Equity Impact"],"accountScreen.portfolioMargin.parametersPerCurrency.extendedDampener":["Extended Dampener"],"accountScreen.portfolioMargin.parametersPerCurrency.haircut":["Haircut"],"accountScreen.portfolioMargin.parametersPerCurrency.includeInUsdEquity":["Include in USD Equity"],"accountScreen.portfolioMargin.parametersPerCurrency.maxPnlOffset":["Max PNL Offset"],"accountScreen.portfolioMargin.parametersPerCurrency.minExpiryDeltaShock":["Min Expiry Delta Shock"],"accountScreen.portfolioMargin.parametersPerCurrency.none":["none"],"accountScreen.portfolioMargin.parametersPerCurrency.pnlOffset":["PNL Offset"],"accountScreen.portfolioMargin.parametersPerCurrency.upside":["upside"],"accountScreen.portfolioMargin.parametersPerCurrencyPair":["Parameters per Currency Pair"],"accountScreen.portfolioMargin.parametersPerCurrencyPair.currencyPair":["Currency Pair"],"accountScreen.portfolioMargin.parametersPerCurrencyPair.deltaTotalLiquidShockThreshold":["Delta Total Liquid. Shock Threshold"],"accountScreen.portfolioMargin.parametersPerCurrencyPair.extendedTableFactor":["Extended Table Factor"],"accountScreen.portfolioMargin.parametersPerCurrencyPair.longTermVegaPower":["Long Term Vega Power"],"accountScreen.portfolioMargin.parametersPerCurrencyPair.maxDeltaShock":["Max Delta Shock"],"accountScreen.portfolioMargin.parametersPerCurrencyPair.minVolatilityForShockUp":["Min Volatility For Shock Up"],"accountScreen.portfolioMargin.parametersPerCurrencyPair.priceRange":["Price Range"],"accountScreen.portfolioMargin.parametersPerCurrencyPair.shortTermVegaPower":["Short Term Vega Power"],"accountScreen.portfolioMargin.parametersPerCurrencyPair.volatilityRangeDown":["Volatility Range Down"],"accountScreen.portfolioMargin.parametersPerCurrencyPair.volatilityRangeUp":["Volatility Range Up"],"accountScreen.portfolioMargin.pmeData":["Portfolio Margin Data"],"accountScreen.portfolioMargin.portfolioMarginHeader":["Your account margin is calculated using portfolio margin rules."],"accountScreen.portfolioMargin.refresh":["Refresh"],"accountScreen.portfolioMargin.rollShock":["Roll Shock"],"accountScreen.portfolioMargin.showAll":["Show All"],"accountScreen.portfolioMargin.snapshotTakenAt"
2103:["Snapshot taken at ",["0"]," UTC"],"accountScreen.portfolioMargin.spotReserve":["Spot Reserve"],"accountScreen.portfolioMargin.tradedOnly":["Traded only"],"accountScreen.portfolioMargin.worstCaseScenario":["Worst Case Scenario"],"accountScreen.portfolioMargin.youCanEnableOrDisablePortfolioMargin":["You can enable or disable Portfolio Margin"],"accountScreen.portfolioMargin.yourPortfolioMarginLimits":["Your Portfolio Margin Limits:"],"accountScreen.security.accountManagement":["Account <0/>"],"accountScreen.security.accountManagementKeyDescription":["Account management: this is <0>the master key</0> that is is needed to add, remove and change assignments of security keys. It is also needed for other account-related actions like managing API keys or subaccounts."],"accountScreen.security.accountManagementMasterKey":["<0>The Master Key</0> is the key assigned to the <1>account management</1>. It is needed to add, remove and change assignments of security keys."],"accountScreen.security.activationTimeReached":["The time for adding the security key (5 min) has expired. Please try again."],"accountScreen.security.add2FA":["2FA"],"accountScreen.security.addNewSecurityKey":["Add new security key"],"accountScreen.security.addPasskey":["Passkey"],"accountScreen.security.addSecurityKey.description":["Learn more about two-factor authentication at our <0>Knowledge base</0>."],"accountScreen.security.addSecurityKey.setName.passkey":["Set unique name for the Passkey"],"accountScreen.security.addSecurityKey.setName.tfa":["Set a unique name for the 2FA key."],"accountScreen.security.addToken.configureApp":["Configure the app"],"accountScreen.security.addToken.forAccount":["account management"],"accountScreen.security.addToken.forAdmin":["admin management"],"accountScreen.security.addToken.forLogin":["login"],"accountScreen.security.addToken.forWallet":["wallet management"],"accountScreen.security.addToken.scanQrCode":["Open the 2FA app and add your account by scanning the QR code below. If you cannot use a QR code, enter this text code:"],"accountScreen.security.addToken.tokenUsage":["Decide what you want to use the token for"],"accountScreen.security.adminManagement":["Admin"],"accountScreen.security.advancedTable.addAssignment":["Add assignment..."],"accountScreen.security.assignment.account":["Account (master)"],"accountScreen.security.assignment.admin":["Admin"],"accountScreen.security.assignment.login":["Login"],"accountScreen.security.assignment.wallet":["Wallet"],"accountScreen.security.basicAssignmentTable.header.assignKey":["Assign key"],"accountScreen.security.basicAssignmentTable.header.assignedKey":["Assigned key"],"accountScreen.security.basicAssignmentTable.header.assignment":["Assignment"],"accountScreen.security.basicAssignmentTable.header.createdAt":["Created at"],"accountScreen.security.coinbaseKeysAlert.description":["When utilizing your Coinbase login credentials to authenticate on the Deribit platform, please note that the associated security keys are exclusively applicable for Deribit <0>Login operations</0>. To view and administer these security keys, navigate directly to your Coinbase account settings at the following link:"],"accountScreen.security.coinbaseKeysAlert.title":["Coinbase Keys for Deribit Authentication"],"accountScreen.security.loginManagement":["Login"],"accountScreen.security.loginManagementKeyDescription":["Login management: logging in to the platform."],"accountScreen.security.maxTokenCharacters":["max ",["maxLength"]," characters"],"accountScreen.security.newToken.addingPasskeyFailed":["Adding new key failed. You've used invalid Passkey, you've cancelled Passkey registration or you've used the same Passkey again. Please try again."],"accountScreen.security.newToken.incorrectName":["Token name can contain only letters, numbers, dashes and underscores."],"accountScreen.security.newToken.registerSecurityKey":["Register security key"],"accountScreen.security.noSecurityKeyAssigned":["No security key assigned"],"accountScreen.security.securityKey.notDefined":["Not defined"],"accountScreen.security.securityKey.removeConfirmation":["Do you want to remove security ke
2103y: ",["0"],"?"],"accountScreen.security.securityKey.removeTooltip.noOtherKeysCoverAssignments":["This key cannot be removed because the remaining keys do not cover all required assignments."],"accountScreen.security.securityKey.removeTooltip.oneKeyPerAccountRequired":["You must have at least one security key in your account."],"accountScreen.security.securityKeyAdded":["Security key has been added."],"accountScreen.security.securityKeyDescription":["Two-factor authentication (2FA) or a Passkey provides an extra layer of security to your account. We strongly recommend you to enable security keys (2FA or Passkey) and use different keys for login and wallet management. Learn more about two-factor authentication at our <0>Knowledge base</0>."],"accountScreen.security.securityKeyDescriptionBanner.title":["Two-factor authentication (2FA) or a Passkey provides an extra layer of security to your account. We strongly recommend you to enable security keys."],"accountScreen.security.securityKeyRemoved":["Security key has been removed."],"accountScreen.security.securityKeyTable.activeSecurityKeys":["Active security keys"],"accountScreen.security.securityKeyTable.disabledRemoveButton":["The required assignments (wallet, account) need to always have a security key assigned."],"accountScreen.security.securityKeyTable.disabledRemoveButtonAdvanced":["The required assignments (account) need to always have a security key assigned"],"accountScreen.security.securityKeyTable.header.actions":["Actions"],"accountScreen.security.securityKeyTable.header.assignments":["Assignments"],"accountScreen.security.securityKeyTable.header.created":["Created at"],"accountScreen.security.securityKeyTable.header.keyName":["Name"],"accountScreen.security.securityKeyTable.header.keyType":["Type"],"accountScreen.security.securityKeyTable.header.removeKey":["Remove key"],"accountScreen.security.securityKeyassignments":["Security keys assignments"],"accountScreen.security.securityKeys.tfaApp":["2FA App"],"accountScreen.security.securityKeys.u2f":["Passkey"],"accountScreen.security.securityKeysCanBeAssignedTo":["Security keys can be assigned to:"],"accountScreen.security.trustedSessions.header.actions":["Actions"],"accountScreen.security.trustedSessions.header.authorizedAt":["Authorized at"],"accountScreen.security.trustedSessions.header.keyUsed":["Key Used"],"accountScreen.security.trustedSessions.header.location":["Location"],"accountScreen.security.trustedSessions.header.session":["Session"],"accountScreen.security.trustedSessions.stopAllSessions":["Stop All Sessions"],"accountScreen.security.trustedSessions.stopSession":["Stop Session"],"accountScreen.security.trustedSessions.title":["Trusted sessions"],"accountScreen.security.unassignKey":["Unassign key"],"accountScreen.security.walletManagement":["Wallet"],"accountScreen.security.walletManagementKeyDescription":["Wallet management: withdrawals, adding and removing withdrawal addresses, transfers."],"accountScreen.security.youCannotUnassignKey":["You cannot unassign ke
2103y from ",["assignment"]," management"],"accountScreen.settings.chatMessage":["Live Chat Notification"],"accountScreen.settings.confirmationDialogsSectionDescription":["Certain actions require a confirmation. Experienced traders can turn these off."],"accountScreen.settings.confirmationDialogsTitle":["Confirmation Dialogues"],"accountScreen.settings.disableShowBlockRfqMakerConfirmationDialog":["Block RFQ Quote Confirmation Dialog"],"accountScreen.settings.disableShowCancelBlockRfqConfirmationDialog":["Block RFQ Confirm Block RFQ Cancellation"],"accountScreen.settings.disableShowCancelBlockRfqConfirmationDialogDescription":["Require a confirmation before cancelling a Block RFQ"],"accountScreen.settings.disableShowCancelBlockRfqQuoteConfirmationDialog":["Block RFQ Confirm Quote Cancellation"],"accountScreen.settings.disableShowCancelBlockRfqQuoteConfirmationDialogDescription":["Require a confirmation before cancelling a quote for a Block RFQ."],"accountScreen.settings.enableSounds":["Play Sounds"],"accountScreen.settings.enableSoundsDescription":["Plays short sounds after certain events happen."],"accountScreen.settings.fzeMigrationPopup":["Deribit FZE migration popup"],"accountScreen.settings.fzeMigrationPopupDescription":["Show Deribit FZE migration popup."],"accountScreen.settings.leavingDeribitConfirmationDialog":["You're Leaving Deribit Confirmation Dialog"],"accountScreen.settings.miscellaneous":["Miscellaneous"],"accountScreen.settings.notificationPosition":["In-page Notifications Position"],"accountScreen.settings.notificationPositionDescription":["Change the position at which notifications appear"],"accountScreen.settings.notifications":["Notifications"],"accountScreen.settings.notifications.afterChange":["Notifications will appear here now."],"accountScreen.settings.notifications.option.bottomLeft":["Bottom Left"],"accountScreen.settings.notifications.option.bottomRight":["Bottom Right"],"accountScreen.settings.notifications.option.topLeft":["Top Left"],"accountScreen.settings.notifications.option.topRight":["Top Right"],"accountScreen.settings.notificationsDescription":["We show in-page notifications whenever certain events happen. You can turn off the events below."],"accountScreen.settings.orderExecuted":["Order Executed"],"accountScreen.settings.preferences":["Preferences"],"accountScreen.settings.showBlockRfqMakerConfirmationDialogDescription":["Require a confirmation before adding a quote to a Block RFQ."],"accountScreen.settings.showBlockRfqTakerTradeConfirmationDialog":["Block RFQ Trade Confirmation Dialog"],"accountScreen.settings.showBlockRfqTakerTradeConfirmationDialogDescription":["Require a confirmation before trading a Block RFQ."],"accountScreen.settings.showClosePositionConfirmationDialog":["Close Order Confirmation Dialog"],"accountScreen.settings.showClosePositionConfirmationDialogDescription":["Require a confirmation before executing the order."],"accountScreen.settings.showCreateBlockRfqConfirmation":["Block RFQ Creation Confirmation Dialog"],"accountScreen.settings.showCreateBlockRfqConfirmationDescription":["Require a confirmation before creating a Block RFQ."],"accountScreen.settings.showDeepExecutionConfirmationDialog":["Immediate Deep Execution Warning Confirmation Dialog"],"accountScreen.settings.showDeepExecutionConfirmationDialogDescription":["Require a confirmation before placing an order deep in the market."],"accountScreen.settings.showEditOrderConfirmationDialog":["Edit Order Confirmation Dialog"],"accountScreen.settings.showEditOrderConfirmationDialogDescription":["Require a confirmation before editing the order."],"accountScreen.settings.showLeavingDeribitConfirmationDialogDescription":["Require a confirmation before leaving Deribit."],"accountScreen.settings.showNewOrderConfirmationDialog":["Order Confirmation Dialog"],"accountScreen.settings.showNewOrderConfirmationDialogDescription":["Require a confirmation before executing the order."],"accountScreen.settings.showNotificationsForApiOrders":["API Order Notification"],"accountScreen.settings.showNotificationsForApiTrades":["API Trade Notification"],"accountScreen.settings.showNotificationsForBlockRfqs":["Block RFQ Notification"],"accountScreen.settings.showNotificationsForBlockRfqsDescription":["Notify when users request a Block RFQ."],"accountScreen.settings.showNotificationsWhenOrdersArePlacedByApi":["Notify when orders are placed through the API."],"accountScreen.settings.showNotificationsWhenTradesArePlacedByApi":["Notify when trades are made through the API."],"accountScreen.settings.showOrder":["Show Orders"],"accountScreen.settings.showOrderDescription":["Display lines that represent all your current orders."],"accountScreen.settings.showPositions":["Show Positions"],"accountScreen.settings.showPositionsDescription":["Display lines that represent your current positions."],"accountScreen.settings.soundSettings":["Sound Settings"],"accountScreen.settings.sounds.beep":["Beep"],"accountScreen.settings.sounds.cashRegister":["Cash Register"],"accountScreen.settings.sounds.clunk":["Clunk"],"accountScreen.settings.sounds.doorBell":["Door Bell"],"accountScreen.settings.sounds.exquisite":["Exquisite"],"accountScreen.settings.sounds.hello":["Hello"],"accountScreen.settings.sounds.interface":["Interface"],"accountScreen.settings.sounds.notification":["Notification"],"accountScreen.settings.sounds.openEnded":["Open Ended"],"accountScreen.settings.sounds.point":["Point"],"accountScreen.settings.sounds.unconvinced":["
2103Unconvinced"],"accountScreen.settings.sounds.unsure":["Unsure"],"accountScreen.settings.syncAcrossDevices":["Sync user settings across devices"],"accountScreen.settings.syncAcrossDevicesDescription":["Your preferences, such as layout configurations, will automatically stay in sync across all your browsers and devices."],"accountScreen.settings.syncUserSettingsDescription":["You are turning on sync. Choose which settings to use across your devices"],"accountScreen.settings.syncUserSettingsTitle":["Sync User Settings"],"accountScreen.settings.syncUserSettingsUseLocal":["Use settings from this device"],"accountScreen.settings.syncUserSettingsUseRemote":["Use existing remote settings"],"accountScreen.settings.syncUserSettingsWarning":["By choosing “Use settings from this device\\", your current settings will be shared across all connected devices."],"accountScreen.settings.tradingViewChart":["TradingView Chart"],"accountScreen.sideMenu.account":["Account"],"accountScreen.sideMenu.accountSettings":["Account Settings"],"accountScreen.sideMenu.affiliate":["Affiliate"],"accountScreen.sideMenu.interfaceSettings":["Interface Settings"],"accountScreen.sideMenu.legal":["Legal"],"accountScreen.sideMenu.logOut":["Log Out"],"accountScreen.sideMenu.myAccount":["My Account"],"accountScreen.sideMenu.phoneBrokerClients":["Clients"],"accountScreen.sideMenu.phoneBrokers":["Brokers"],"accountScreen.sideMenu.security":["Security Keys"],"accountScreen.sideMenu.starbase":["Starbase"],"accountScreen.sideMenu.starbaseApiKeys":["API Keys"],"accountScreen.sideMenu.starbaseMembers":["Members"],"accountScreen.sideMenu.switch":["Switch"],"accountScreen.sideMenu.switchAccount":["Switch Account"],"accountScreen.sideMenu.verification":["Verification"],"accountScreen.sideMenu.wallet":["Wallet"],"accountScreen.standardMargin.maximumFuturePositionSize":["Maximum future position size"],"accountScreen.standardMargin.maximumNumberOfAllOpenOrders":["Maximum number of all open orders"],"accountScreen.standardMargin.maximumNumberOfOpenOrdersInInstrument":["Maximum number of open orders in instrument"],"accountScreen.standardMargin.maximumTotalShortOptionsPositionsSize":["Maximum total short options positions size"],"accountScreen.standardMargin.title":["Standard Margin"],"accountScreen.standardMargin.yourStandardMarginLimits":["Your Standard Margin Limits:"],"accountScreen.starbase.apiKeys":["API Keys"],"accountScreen.starbase.apiKeys.addNewKey":["Add new key"],"accountScreen.starbase.apiKeys.atLeastOneScopeRequired":["Please select at least one scope."],"accountScreen.starbase.apiKeys.changeScope":["Change Scope"],"accountScreen.starbase.apiKeys.createKey":["Create API Key"],"accountScreen.starbase.apiKeys.createNewKey":["Create a new API Key"],"accountScreen.starbase.apiKeys.directAccessApiKeys":["API Keys"],"accountScreen.starbase.apiKeys.editScope":["Edit scope"],"accountScreen.starbase.apiKeys.name":["Name"],"accountScreen.starbase.apiKeys.namePlaceholder":["optional"],"accountScreen.starbase.members":["Members"],"accountScreen.starbase.members.activateSuccess":["Member activated"],"accountScreen.starbase.members.addMember":["Add member"],"accountScreen.starbase.members.deactivateSuccess":["Member deactivated"],"accountScreen.starbase.members.deleteMemberDialog.confirmation":["Are you sure you want to delete member \\"",["0"],"\\"? This action cannot be undone."],"accountScreen.starbase.members.deleteMemberDialog.deleteButton":["Delete"],"accountScreen.starbase.members.deleteMemberDialog.success":["Member deleted successfully"],"accountScreen.starbase.members.deleteMemberDialog.title":["Delete Member"],"accountScreen.starbase.members.memberDialog.accountsLabel":["Accounts"],"accountScreen.starbase.members.memberDialog.addButton":["Add Member"],"accountScreen.starbase.members.memberDialog.addSuccess":["Member added successfully"],"accountScreen.starbase.members.memberDialog.addTitle":["Add Member"],"accountScreen.starbase.members.memberDialog.editSuccess":["Member updated successfully"],"accountScreen.starbase.members.memberDialog.editTitle":["Edit Member"],"accountScreen.starbase.members.memberDialog.mainBadge":["main"],"accountScreen.starbase.members.memberDialog.nameLabel":["Member Name"],"accountScreen.starbase.members.memberDialog.namePlaceholder":["Enter member name"],"accountScreen.starbase.members.memberDialog.saveButton":["Save Changes"],"accountScreen.starbase.members.memberDialog.selectAccountPlaceholder":["Select account"],"accountScreen.starbase.members.noMembers":["No members found"],"accountScreen.starbase.members.table.accounts":["Accounts"],"accountScreen.starbase.members.table.actions":["Actions"],"accountScreen.starbase.members.table.active":["Active"],"accountScreen.starbase.members.table.inactive":["Inactive"],"accountScreen.starbase.members.table.memberId":["Member ID"],"accountScreen.starbase.members.table.name":["Name"],"accountScreen.starbase.members.table.status":["Status"],"accountScreen.starbase.members.title":["Members"],"accountScreen.starbase.openOrdersAndPreTradeRiskUpdateInterval":["Open orders and pre-trade risk refresh every 10 seconds and may not reflect the latest state immediately."],"accountScreen.starbase.scope.fixDropCopy":["FIX Drop Copy"],"accountScreen.starbase.scope.restOrderEntry":["REST Gateway"],"accountScreen.starbase.scope.sbeOrderEntry":["SBE Order Entry"],"accountScreen.statistics.aggregatedVolumeTotal":["Total Aggregated Volume"],"accountScreen.statistics.csv.depositWithdrawal":["Deposit / Withdrawal"],"accountScreen.statistics.csv.snapshotTaken":["Snapshot taken"],"accountScreen.statistics.downloadCSV":["Download CSV"],"accountScreen.statistics.downloadCsvForAllMonths":["Download CSV for all months"],"accountScreen.statistics.downloadPDF":["Download PDF"],"accountScreen.statistics.feesPaid":["Fees Paid"],"accountScreen.statistics.futuresVolume":["Futures Volume"],"accountScreen.statistics.futuresVolumeDollar":["Futures Volume ($)"],"accountScreen.statistics.historicalTradeVolumeReport":["Trade Volume History"],"accountScreen.statistics.includeDeletedSubaccounts":["Include deleted subaccounts"],"accountScreen.statistics.monthEndPositionScreenshot":["Month End Position Snapshot"],"accountScreen.statistics.monthlyReports":["Monthly Reports"],"accountScreen.statistics.monthlyReports.aggregated":["Aggregated"],"accountScreen.statistics.monthlyReports.aggregatedVolume":["Aggregated Volume"],"accountScreen.statistics.monthlyReports.aggressive":["Aggressive"],"accountScreen.statistics.monthlyReports.balance":["Balance"],"accountScreen.statistics.monthlyReports.balances":["Balances"],"accountScreen.statistics.monthlyReports.depositsVolume":["Deposits"],"accountScreen.statistics.monthlyReports.depositsWithdrawals":["Deposits/Withdrawals"],"accountScreen.statistics.monthlyReports.equity":["Equity"],"accountScreen.statistics.monthlyReports.futureTradingFeesCurrency":["Futures Trading Fees (",["currency"],")"],"accountScreen.statistics.monthlyReports.futureTradingFeesUsd":["Futures Trading Fees (USD)"],"accountScreen.statistics.monthlyReports.futureTradingVolumeCurrency":["Futures Trading Volume (",["currency"],")"],"accountScreen.statistics.monthlyReports.futureTradingVolumeUsd":["Futures Trading Volume (USD)"],"accountScreen.statistics.monthlyReports.initialMargin":["Initial Margin"],"accountScreen.statistics.monthlyReports.mainAccount":["Main Account: ",["userId"]],"accountScreen.statistics.monthlyReports.maintenanceMargin":["Maintenance Margin"],"accountScreen.statistics.monthlyReports.marginBalance":["Margin Balance"],"accountScreen.statistics.monthlyReports.netVolume":["Net"],"accountScreen.statistics.monthlyReports.noOpenPositions":["No Open Positions"],"accountScreen.statistics.monthlyReports.optionsTradingFeesCurrency":["Options Trading Fees (",["currency"],")"],"accountScreen.statistics.monthlyReports.optionsTradingFeesUsd":["Options Trading Fees (USD)"],"accountScreen.statistics.monthlyReports.optionsTradingVolumeCurrency":["Options Trading Volume (",["currency"],")"],"accountScreen.statistics.monthlyReports.optionsTradingVolumeUsd":["Options Trading Volume (USD)"],"accountScreen.statistics.monthlyReports.passive":["Passive"],"accountScreen.statistics.monthlyReports.perpetualTradingFeesCurrency":["Perpetual Trading Fees (",["currency"],")"],"accountScreen.statistics.monthlyReports.perpetualTradingFeesUsd":["Perpetual Trading Fees (USD)"],"accountScreen.statistics.monthlyReports.perpetualTradingVolumeCurrency":["Perpetual Trading Volume (",["currency"],")"],"accountScreen.statistics.monthlyReports.perpetualTradingVolumeUsd":["Perpetual Trading Volume (USD)"],"accountScreen.statistics.monthlyReports.positions":["Positions"],"accountScreen.statistics.monthlyReports.spotTradingFeesCurrency":["Spot Trading Fees (",["currency"],")"],"accountScreen.statistics.monthlyReports.spotTradingVolumeCurrency":["Spot Trading Volume (",["currency"],")"],"accountScreen.statistics.monthlyReports.subaccount":["Subaccount: ",["userId"]],"accountScreen.statistics.monthlyReports.total":["Total"],"accountScreen.statistics.monthlyReports.withdrawalsVolume":["Withdrawals"],"accountScreen.statistics.monthlySummaryFeesOverview":["Monthly Summary Fees Overview"],"accountScreen.statistics.monthlySummaryTradingOverview":["Monthly Summary Trading Overview"],"accountScreen.statistics.optionsVolume":["Options Volume"],"accountScreen.statistics.passiveAggressiveChart":["Passive vs Aggressive Trades"],"accountScreen.statistics.pdf.activeSubaccounts":["Active subaccounts:"],"accountScreen.statistics.pdf.aggregated":["Aggregated"],"accountScreen.statistics.pdf.aggregatedSubs":["Aggregated Subs"],"accountScreen.statistics.pdf.aggressive":["Aggressive"],"accountScreen.statistics.pdf.balance":["Balance"],"accountScreen.statistics.pdf.balances":["Balances"],"accountScreen.statistics.pdf.cbbm.footerLine1":["Coinbase Bermuda Ltd’s company number is 202302164 and its registered office is Park Place, 55 Par La Ville Road, Hamilton HM11, Bermuda"],"accountScreen.statistics.pdf.client":["Client:"],"accountScreen.statistics.pdf.creationDate":["Creation date:"],"accountScreen.statistics.pdf.currentlyRemoved":["currently removed"],"accountScreen.statistics.pdf.dateForEndMonth":["Date for end of month:"],"accountScreen.statistics.pdf.dateOfMigration:":["Date of migration:"],"accountScreen.statistics.pdf.deposits":["Deposits"],"accountScreen.statistics.pdf.dubai.footerLine1":["Deribit FZE"],"accountScreen.statistics.pdf.dubai.footerLine2":["Dubai World Trade Centre, One Central, The Offices 4 - Unit 04.08"],"accountScreen.statistics.pdf.email":["Account email:"],"accountScreen.statistics.pdf.entity:":["Entity:"],"accountScreen.statistics.pdf.equity":["Equity"],"accountScreen.statistics.pdf.feesSummary":["Fees Summary"],"accountScreen.statistics.pdf.footerLine1":["DRB Panama Inc. Via España, Delta Bank Building, 6th Floor, Suite 604D. Panama City, Republic of Panama Mercantile record: 155684990LEI: 254900U686NV6MO56950"],"accountScreen.statistics.pdf.footerLine2":["Document provided by Deribit on: ",["date"]],"accountScreen.statistics.pdf.futures":["Futures"],"accountScreen.statistics.pdf.im":["IM"],"accountScreen.statistics.pdf.index":["Index"],"accountScreen.statistics.pdf.indexPrice":["Index Price:"],"accountScreen.statistics.pdf.instrument":["Instrument"],"accountScreen.statistics.pdf.mainUserId":["Main account user ID:"],"accountScreen.statistics.pdf.marginBalance":["Margin Balance"],"accountScreen.statistics.pdf.mark":["Mark"],"accountScreen.statistics.pdf.mm":["MM"],"accountScreen.statistics.pdf.monthlyStatement":["Monthly Statement"],"accountScreen.statistics.pdf.net":["NET"],"accountScreen.statistics.pdf.options":["Options"],"accountScreen.statistics.pdf.passive":["Passive"],"accountScreen.statistics.pdf.perpetuals":["Perpetuals"],"accountScreen.statistics.pdf.positions":["Positions"],"accountScreen.statistics.pdf.size":["Size"],"accountScreen.statistics.pdf.snapshotReport":["Snapshot report:"],"accountScreen.statistics.pdf.spotFeesSummary":["Spot Fees Summary"],"accountScreen.statistics.pdf.spotTradingSummary":["Spot Trading Summary"],"accountScreen.statistics.pdf.total":["Total"],"accountScreen.statistics.pdf.tradingSummary":["Trading Summary"],"accountScreen.statistics.pdf.type":["Type"],"accountScreen.statistics.pdf.usdAggregatedValues":["USD Aggregated Values (all currencies)"],"accountScreen.statistics.pdf.userId":["User ID"],"accountScreen.statistics.pdf.value":["Value"],"accountScreen.statistics.pdf.withdrawals":["Withdrawals"],"accountScreen.statistics.refresh":["Refresh"],"accountScreen.statistics.selectAMonth":["Select a month"],"accountScreen.statistics.snapshotTaken":["Snapshot taken"],"accountScreen.statistics.spotVolume":["Spot volume"],"accountScreen.statistics.statisticsPeriod":["Statistics Period"],"accountScreen.statistics.volumeStatistics":["Volume Statistics"],"accountScreen.subaccounts.accountAlias":["Account Alias"],"accountScreen.subaccounts.accountAliasHasBeenChanged":["Account alias has been changed."],"accountScreen.subaccounts.actions":["Actions"],"accountScreen.subaccounts.addNewSubAccount":["Add a New Subaccount"],"accountScreen.subaccounts.available":["Available"],"accountScreen.subaccounts.availableBalance":["Available Balance"],"accountScreen.subaccounts.balance":["Balance"],"accountScreen.subaccounts.canLoginToSubaccount":["Can log in to the subaccount"],"accountScreen.subaccounts.closeAllOpenOrders":["close all open orders"],"accountScreen.subaccounts.closeAllOpenPositionsIn":["close all open positions in"],"accountScreen.subaccounts.confirmPassword":["Confirm password"],"accountScreen.subaccounts.derivativesConsent.acknowledge":["I understand and accept the risks associated with derivative products."],"accountScreen.subaccounts.derivativesConsent.body":["Derivative instruments (such as options, futures, and perpetuals) are complex financial products that involve a high level of risk. Their value can fluctuate rapidly, and you could lose all funds you have deposited. These products may not be suitable for all investors. Please ensure you fully understand the risks involved and seek independent advice if necessary."],"accountScreen.subaccounts.derivativesConsent.ok":["OK"],"accountScreen.subaccounts.derivativesConsent.title":["Risks of Derivative Products"],"accountScreen.subaccounts.disable":["Disable"],"accountScreen.subaccounts.disableLoginForSubaccount":["Would you like to disable login for the subaccount '",["subaccountNick"],"'?"],"accountScreen.subaccounts.disableReceivingNotificationsForSubaccount":["Would you like to disable receiving notifications for the subaccount '",["subaccountNick"],"' on the main email?"],"accountScreen.subaccounts.disabled":["Disabled"],"accountScreen.subaccounts.discard":["Discard"],"accountScreen.subaccounts.email":["Email"],"accountScreen.subaccounts.emailCanContainUpTo100Characters":["Email can contain up to 100 characters."],"accountScreen.subaccounts.emailForSubaccountWasChangedToYourMainEmailAddress":["Email for subaccount ",["0"]," was changed to your main email address."],"accountScreen.subaccounts.emailWasChangedToPreviousEmailAddress":["Email for subaccount ",["0"]," was changed to the previous email address."],"accountScreen.subaccounts.enable":["Enable"],"accountScreen.subaccounts.enableLoginForSubaccount":["Would you like to enable login for the subaccount '",["subaccountNick"],"'?"],"accountScreen.subaccounts.enableReceivingNotificationsForSubaccount":["Would you like to enable receiving notifications for the subaccount '",["subaccountNick"],"' on the main email?"],"accountScreen.subaccounts.enabled":["Enabled"],"accountScreen.subaccounts.equity":["Equity"],"accountScreen.subaccounts.mainAccount":["Main Account"],"accountScreen.subaccounts.margin":["Margin"],"accountScreen.subaccounts.nick":["Nick / Alias"],"accountScreen.subaccounts.password":["Password"],"accountScreen.subaccounts.passwordHasBeenSet":["Password has been successfully set!"],"accountScreen.subaccounts.productsDisabledForTrading":["Products disabled for trading"],"accountScreen.subaccounts.provideValidEmailAddress":["Please provide a valid email address."],"accountScreen.subaccounts.providedEmailIsAlreadyUsed":["Provided email address is already used for your ",["subaccountName"]," subaccount."],"accountScreen.subaccounts.receiveNotificationEmails":
2103["Send all notification emails to the main email"],"accountScreen.subaccounts.refresh":["Refresh"],"accountScreen.subaccounts.removeSub":["Remove the subaccount"],"accountScreen.subaccounts.removeSubaccountModalConfirmText":["Remove subaccount"],"accountScreen.subaccounts.removeSubaccountModalContent":["You will lose access to the transaction log, order and trade history of this account. Are you sure?"],"accountScreen.subaccounts.removeSubaccountModalExtendedContent":["You will lose affiliate payouts, access to the transaction log, order and trade history of this account. Are you sure?"],"accountScreen.subaccounts.removeSubaccountModalTitle":["Do you want to remove the subaccount '",["0"],"'?"],"accountScreen.subaccounts.resetSecurityKeysForSubaccount":["Reset Security Keys for subaccount '",["subaccountNick"],"'?"],"accountScreen.subaccounts.securityKeys":["Security Keys"],"accountScreen.subaccounts.selectProductsToDisableForTrading":["Select the products you wish to disable for trading:"],"accountScreen.subaccounts.selectProductsToDisableForTrading.warning":["Please be aware that our liquidation engine and risk team can still trade disabled products when your account is in liquidation."],"accountScreen.subaccounts.setEmailAddress":["You need to set an email address first"],"accountScreen.subaccounts.setEmailAddressAndPassword":["You need to set an email address and a password first"],"accountScreen.subaccounts.setPassword":["You need to set a password first"],"accountScreen.subaccounts.showDetail":["Show details"],"accountScreen.subaccounts.signInMainAccount":["Sign in with the main account"],"accountScreen.subaccounts.signInSub":["Sign in with the subaccount"],"accountScreen.subaccounts.spotOnly":["Spot-Only"],"accountScreen.subaccounts.spotOnlyAdded.body":["Your new subaccount has been added in Spot-Only mode. If you wish to enable derivative products, please click the pencil icon and update the 'Products disabled for trading' settings."],"accountScreen.subaccounts.spotOnlyAdded.title":["Spot-Only Subaccount Added"],"accountScreen.subaccounts.subaccount":["Subaccount"],"accountScreen.subaccounts.subaccountCreated":["A subaccount has been created."],"accountScreen.subaccounts.subaccountEmail":["Subaccount email"],"accountScreen.subaccounts.subaccountPassword":["Subaccount password"],"accountScreen.subaccounts.subaccountRemovedInfo":["Subaccount '",["0"],"' removed"],"accountScreen.subaccounts.subaccounts":["Subaccounts"],"accountScreen.subaccounts.subaccountsDescription":["Subaccounts are separate accounts controlled by your main account. Margin is isolated, and funds can be transferred between your main account and subaccounts and vice versa."],"accountScreen.subaccounts.submitChanges":["Submit changes"],"accountScreen.subaccounts.totalBalance":["Total Balance"],"accountScreen.subaccounts.tradingMode":["Trading mode"],"accountScreen.subaccounts.transferAllRemainingFundsToOtherAccount":["transfer all remaining funds to other subaccount or main account"],"accountScreen.subaccounts.unableRemoveSubaccountModalTitle":["Unable to remove the subaccount '",["0"],"'"],"accountScreen.subaccounts.undefined":["Undefined"],"accountScreen.subaccounts.waitUntilSettlementOrDeliveryOf":["wait until settlement or delivery of"],"accountScreen.subaccounts.weSentAConfirmationEmailToGivenNewEmailAddress":["We have sent a confirmation email to the new email address."],"accountScreen.subaccounts.wrongEmailAddressAlreadyUsed":["Wrong email address, it is already being used."],"accountScreen.transactionLog.awaitingSettlement":["Awaiting settlement"],"accountScreen.transactionLog.balance":["Balance"],"accountScreen.transactionLog.cashFlow":["Cash Flow"],"accountScreen.transactionLog.change":["Change"],"accountScreen.transactionLog.downloadLogs":["Download Logs"],"accountScreen.transactionLog.equity":["Equity"],"accountScreen.transactionLog.export.add":["Add"],"accountScreen.transactionLog.export.button":["Export"],"accountScreen.transactionLog.export.cancel":["Cancel"],"accountScreen.transactionLog.export.description":["Enter the year and email addresses to receive the transaction log as a CSV file. The download link will be sent to the main account email and any additional recipients you specify."],"accountScreen.transactionLog.export.error.emailAlreadyAdded":["Email address is already in the list"],"accountScreen.transactionLog.export.error.invali
2103dEmail":["One of the provided emails has invalid format."],"accountScreen.transactionLog.export.error.reportNotReady":["Report is not ready yet. Please try again later."],"accountScreen.transactionLog.export.error.tooManyEmails":["List of provided emails is too long."],"accountScreen.transactionLog.export.mainAccount":["main account"],"accountScreen.transactionLog.export.selectYear":["Select Year"],"accountScreen.transactionLog.export.sendCopyTo":["Send a copy to"],"accountScreen.transactionLog.export.sendCsv":["Send CSV"],"accountScreen.transactionLog.export.success":["We'll send a download link to ",["mainAccountEmail"]," plus added CCs shortly."],"accountScreen.transactionLog.export.title":["Export Logs"],"accountScreen.transactionLog.export.warning":["Your data will be sent securely and will only be shared with the specified recipients. Please, ensure the email addresses are correct before proceeding."],"accountScreen.transactionLog.feeCharged":["Fee Charged"],"accountScreen.transactionLog.feeRate":["Fee Rate"],"accountScreen.transactionLog.fromFeeBalance":["From fee balance"],"accountScreen.transactionLog.fromTo":["from '",["source"],"' (",["sourceCurrency"],") to '",["target"],"' (",["targetCurrency"],")."],"accountScreen.transactionLog.funding":["Funding"],"accountScreen.transactionLog.indexPrice":["The index price at the moment of the transaction. Note that for delivery entries, this may be different from the delivery price."],"accountScreen.transactionLog.info":["Info"],"accountScreen.transactionLog.markPrice":["Mark Price"],"accountScreen.transactionLog.pnlAnalysis":["PNL Analysis"],"accountScreen.transactionLog.position":["Position"],"accountScreen.transactionLog.refresh":["Refresh"],"accountScreen.transactionLog.searchAllTransactions":["Search all transactions"],"accountScreen.transactionLog.settlementPrice":["Settlement Price"],"accountScreen.transactionLog.side":["Side"],"accountScreen.transactionLog.sourceDeribitAdmin":["Source: Deribit admin."],"accountScreen.transactionLog.tradeId":["Trade ID"],"accountScreen.transactionLog.transactionLog":["Transaction Log"],"accountScreen.transactionLog.type":["Type"],"accountScreen.transfer.actions":["Actions"],"accountScreen.transfer.addressIsNotUsableYet":["The address is not usable yet"],"accountScreen.transfer.amount":["Amount"],"accountScreen.transfer.cancelTheTransfer":["Cancel the transfer"],"accountScreen.transfer.creationAt":["Created at:"],"accountScreen.transfer.crossCollateralInfo":["This value can include cross-collateral equivalents from other currencies, and so is not necessarily available to withdraw or transfer in this currency. Spot markets can be used to move funds into the desired currency."],"accountScreen.transfer.destination":["Destination"],"accountScreen.transfer.destinationUID":["Destination User ID"],"accountScreen.transfer.disableEmailConfirmationsOnTransfersToAddress":["Disable e-mail confirmations on ",["currency"]," transfers to address ",["otherSideAddress"]],"accountScreen.transfer.fabrWarning":["Should an account be close to the 100% CMM limit on FABR, transferring funds from a non cross margin account (Segregated PM/SM, Cross SM) to a Cross PM account might result in a CMM > 100%, thus causing a liquidation (given that Equity is charged MM on Cross PM as part of the risk matrix). Recalculating the margins pre and post transfer would result in temporary account lock and delays for the clients, which we want to prevent. It has been decided to let the transfers through and display this warning message. The new margins can be calculated in the position builder before the transfer takes place, to ensures no impact on your account."],"accountScreen.transfer.feeBalance":["Fee Balance"],"accountScreen.transfer.feeBalanceToSubaccount":["Fee balance to subaccount"],"accountScreen.transfer.fundsToOtherDeribitAccount":["Funds to other Deribit account"],"accountScreen.transfer.fundsToSubaccount":["Funds to subaccount"],"accountScreen.transfer.impliedEquityInfo":["This value can include cross-collateral equivalents from other currencies and external equity, and so it is not necessarily available to withdraw or transfer in this currency. Spot markets can be used to move funds into the desired currency."],"accountScreen.transfer.income":["Income"],"accountScreen.transfer.kindOfTransfer":["Kind of transfer"],"accountScreen.transfer.mainAccount":["Main Account"],"accountScreen.transfer.payment":["Payment"],"accountScreen.transfer.rewardIncome":["Reward income"],"accountScreen.transfer.rewardPayout":["Reward payout"],"accountScreen.transfer.selectDestination":["Please select a destination"],"accountScreen.transfer.selectSource":["Please select a source"],"accountScreen.transfer.source":["Source"],"accountScreen.transfer.sourceAndDestinationCannotBeTheS
2103ame":["Source and destination cannot be the same"],"accountScreen.transfer.sourceDestination":["Source/Destination"],"accountScreen.transfer.sourceUID":["Source User ID"],"accountScreen.transfer.status":["Status"],"accountScreen.transfer.subAccount":["Subaccount"],"accountScreen.transfer.tooBigPrecisionForAmountField":["Too big precision for the Amount field."],"accountScreen.transfer.transferButton":["Transfer"],"accountScreen.transfer.transferDetails":["Transfer details"],"accountScreen.transfer.transferFeeBalanceHistory":["Transfer Fee Balance History"],"accountScreen.transfer.transferHistory":["Transfer History"],"accountScreen.transfer.transferIsDone":["Transfer to ",["addressName"]," is done."],"accountScreen.transfer.transferIsWaitingForConfirmation":["The transfer request to ",["addressName"]," is waiting for a confirmation in your mailbox."],"accountScreen.transfer.transferLimitCrossed":["Transfer would cross daily withdrawals limit ",["0"]," ",["1"],", current withdrawals ",["2"]," ",["3"],"."],"accountScreen.transfer.transferToMainAccount":["Transfer to the main account"],"accountScreen.transfer.type":["Type"],"accountScreen.transfer.updatedAt":["Updated at:"],"accountScreen.transfer.yourRequestToTransferHasBeenConfirmed":["Your transfer request has been confirmed"],"accountScreen.transfer.yourTransferRequestHasBeenCancelled":["Your transfer request has been cancelled"],"accountScreen.verification.additionalIdentificationInformation.description":["Please upload an additional document that includes your photograph, such as a second government-issued photo ID (e.g. national ID card, driver's license, voter ID card, residency permit, resident cards, government employment card, military ID, passport card, government medical card, firearms license, etc.). This must be a different document from the ID provided in the first step."],"accountScreen.verification.additionalIdentificationInformation.title":["Additional identification information"],"accountScreen.verification.address.description":["Please enter the address details that match the address in your proof of residence."],"accountScreen.verification.address.title":["Address Information"],"accountScreen.verification.buildingApartmentHouseNumber":["House/Apartment/Building number"],"accountScreen.verification.businessAddress":["What is the address of your business?"],"accountScreen.verification.businessDescription":["Description of the business"],"accountScreen.verification.businessName":["What is the name of your business?"],"accountScreen.verification.businessRegistrationNumber":["Business registration number"],"accountScreen.verification.cannotUpdateInfo":["You cannot update the information during this process."],"accountScreen.verification.city":["City"],"accountScreen.verification.clientCategorization.description":["To comply with regulatory requirements, we need to categorise our UK clients. For this purpose, we kindly ask you to complete the steps below. It is important that you provide accurate information, as the <0>client categorisation</0> determines whether we can offer our services to you."],"accountScreen.verification.clientCategorization.professionalClient.consent":["I hereby confirm that I wish to be treated generally as a Professional Client. I understand and accept that, by doing so, I will not benefit from the regulatory protections and compensation rights available to Retail Clients, and I am aware of the consequences of losing those protections."],"accountScreen.verification.clientCategorization.professionalClient.preliminaryText":["Deribit does not accept Retail Clients from the United Kingdom. However, we may accept Professional Clients. If you believe that you qualify as a Professional Client, please provide the required information in the next step."],"accountScreen.verification.clientCategorization.professionalClient.warning":["Please note that Professional Clients have fewer regulatory protections and compensation rights than Retail Clients. If we onboard you as a Professional Client, you will not be entitled to the regulatory protections and compensation rights available to Retail Clients."],"accountScreen.verification.clientCategorization.qualitativeAttestation":["I hereby confirm that, based on my education, professional experience, and knowledge of leveraged financial instruments, I am capable of making my own investment decisions and understanding the risks involved. I have provided accurate information about my background and investment experience to Deribit, and I understand that Deribit relies on this information to assess my classification as a professional client under the FCA Handbook."],"accountScreen.verification.clientCategorization.quantitativeTest.introduction":["For the quantitative test, we kindly ask you to confirm whether you satisfy at least 2 out of 3 criteria below. Please answer all three questions and provide supporting documentation. You only have to satisfy 2 out of 3 criteria to pass the quantitative test."],"accountScreen.verification.clientCategorization.quantitativeTest.title":["Quantitative Test"],"accountScreen.verification.clientCategorization.retailClient.rejection":["You have indicated that you do not meet the criteria to be treated as a Professional Client. As a result, you will be categorised as a Retail Client. As we currently do not accept Retail Clients, we are unable to offer our services to you at this time."],"accountScreen.verification.clientCategorization.riskDisclosure.text":["Crypto derivatives carry a high degree of risk. It is important that you understand these risks, which are outlined in the <0>Risk Disclosures</0> on our website."],"accountScreen.verification.clientCategorization.title":["Client Categorisation"],"accountScreen.verification.companyIndustry":["Industry in which the company is active"],"accountScreen.verification.contactUs":["Should you have any questions, please contact ",["complianceMailLink"],"."],"accountScreen.verification.contractualArrangement.label":["You have indicated that you handle third party clients. Is there a contractual arrangement in place with the client for these services?"],"accountScreen.verification.contractualArrangement.label.broker":["You have indicated that you will execute orders on behalf of clients. Is there a contractual arrangement in place with the client for these services?"],"accountScreen.verification.contractualArrangement.label.investmentManager":["You have indicated that you manage third party assets with investment discretion. Is there a contractual arrangement in place with the client for these services?"],"accountScreen.verification.contractualArrangement.rejected":["We cannot proceed with your onboarding as you need to have a contractual arrangement in place with the client for these services you offer."],"accountScreen.verification.controllingPersonType.description":["Please choose the type of controlling person from the list below."],"accountScreen.verification.controllingPersonType.field":["Select controlling person type"],"accountScreen.verification.controllingPersonType.group.legalArrangement":["Controlling person of a legal arrangement"],"accountScreen.verification.controllingPersonType.group.legalEntity":["Controlling person of a legal entity"],"accountScreen.verification.controllingPersonType.group.trust":["Controlling person of a trust"],"accountScreen.verification.controllingPersonType.title":["Controlling Person Type"],"accountScreen.verification.corporate.addressDetail
2103sContactPerson":["Contact person full address details"],"accountScreen.verification.corporate.caspCarsDescription":["Crypto-Asset Service Provider (CASP) information for CARS compliance reporting."],"accountScreen.verification.corporate.caspCarsTitle":["CASP/CARS Information"],"accountScreen.verification.corporate.caspDeclarationText":["I confirm that I understand how Deribit will use and share the information I provide, as outlined in the terms and conditions of the Entity User's relationship with Deribit.<0/><1/>I acknowledge that the information provided in this form, along with details about the Entity User and any related transactions or accounts, may be shared with tax authorities. These authorities may further exchange this information with tax authorities in other countries or jurisdictions where the Entity User is a tax resident.<2/><3/>I certify that I have the authority to act on behalf of the Entity User for all transactions and accounts covered by this form.<4/><5/>I affirm that all information provided in this form is, to the best of my knowledge and belief, accurate and complete.<6/><7/>I agree to notify Deribit of any changes that affect the Entity User's tax residency status or that render any information incorrect or incomplete, including changes to Controlling Persons. I will submit an updated form within 90 days of such changes."],"accountScreen.verification.corporate.caspTins":["Tax Identification Numbers"],"accountScreen.verification.corporate.countryOfRegisteredOffice":["Country"],"accountScreen.verification.corporate.differentMailingAddress":["Does your company have a different mailing address than the one registered in step one?"],"accountScreen.verification.corporate.expectedTradeType":["What kind of trades do you expect to conduct?"],"accountScreen.verification.corporate.expectedTradeType.required":["You must choose at least one expected trade type"],"accountScreen.verification.corporate.investorClassification.description":["To determine your company's <0>Investor Classification</0>, please answer the questions below. It is important that you provide accurate information, as the Investor Classification determines which trading instruments and leverage limits we can offer you, as well as the Deribit entity under which we can onboard you."],"accountScreen.verification.corporate.investorClassification.icRefresh.retail.warning":["We will classify you as a Retail Investor on 1 August 2025. You will still be able to trade the same products with the same fees and leverage limits."],"accountScreen.verification.corporate.investorClassification.icRefresh.retailAndSp
2103otOnly.warning":["Your account will be changed to Spot-Only on 1 August 2025. You will no longer be able to trade our derivatives contracts (perpetuals, futures, options)."],"accountScreen.verification.corporate.investorClassification.investorExperience.prefilled":["We have pre-filled the answer based on your trading history."],"accountScreen.verification.corporate.investorClassification.netAssets.balanceSheets":["Corporate financial statements"],"accountScreen.verification.corporate.investorClassification.netAssets.balanceSheets.description":["Please upload a recent financial statement (not older than 3 months), certified by the CFO or an external auditor, that clearly shows the net assets of the company and the issue date."],"accountScreen.verification.corporate.investorClassification.netAssets.cash":["Cash"],"accountScreen.verification.corporate.investorClassification.netAssets.cash.description":["Please upload a recent bank statement (not older than 3 months) showing the name of the company, the issue date, the balance in the bank account, and the name/logo of the financial institution."],"accountScreen.verification.corporate.investorClassification.netAssets.financialInstruments":["Financial Instruments"],"accountScreen.verification.corporate.investorClassification.netAssets.financialInstruments.description":["Please upload a recent overview (not older than 3 months) of your stock portfolio, an account statement from your trading platform(s), or a similar supporting document. This document must clearly display the name of the company, the issue date, the balance in your account, and the name/logo of the financial institution."],"accountScreen.verification.corporate.investorClassification.netAssets.realEstate":["Tangible real estate"],"accountScreen.verification.corporate.investorClassification.netAssets.realEstate.description":["Please upload a recent purchase contract (not older than 3 months), a recent certificate or valuation report issued by a real estate agent or governmental agency, or documentation of recent sales of comparable neighboring properties. This document must clearly display the name of the company, the issue date, the value of the property, and the name/logo of the financial institution."],"accountScreen.verification.corporate.investorClassification.netAssets.virtualAssets":["Virtual Assets"],"accountScreen.verification.corporate.investorClassification.netAssets.virtualAssets.description":["Please upload a recent account statement (not older than 3 months) of your trading platform, wallet provider or custodian that shows the value of the company’s virtual assets. This document must clearly display the name of the company, the issue date, the balance in the account, and the name/logo of the financial institution."],"accountScreen.verification.corporate.investorClassification.netAssets.virtualAssets.warning":["Please note that 100% of the value of non-algorithmic stablecoins (e.g., USDT, USDC) will be taken into account, while only 50% of the value of non-stablecoins will be considered."],"accountScreen.verification.corporate.investorClassification.netAssetsThreshold":["Does the company maintain net assets of > USD 1,000,000 (> 3,750,000 United Arab Emirates Dirham)?"],"accountScreen.verification.corporate.investorClassification.netAssetsThreshold.basedOn":["Based on ",["0"]],"accountScreen.verification.corporate.investorClassification.netAssetsThreshold.prefilled":["We have pre-filled the answer based on the value of the virtual assets in your account"],"accountScreen.verification.corporate.investorClassification.proofOfNetAssetsAboveThreshold":["Please select the applicable asset categories and upload documents demonstrating that the total value of your net assets exceeds USD 1,000,000."],"accountScreen.verification.corporate.investorClassification.proofOfNetAssetsAboveThreshold.warning":["Ensure that each document clearly displays the company's name and/or contact email address, as well as the issue date."],"accountScreen.verification.corporate.investorClassification.proofOfProductExperience":["Please upload a document that reflects the company has conducted a minimum of 12 transactions in derivative contracts (e.g. options and futures) during the last 12 months (for example, a trading statement or the recent transaction history from a trading platform). Please ensure that the document clearly states the company's name, the type of derivative instruments traded, and the date of the trades."],"accountScreen.verification.corporate.investorClassification.proofOfProfessionalExperience":["Please upload a document that shows that the company has worked for at least 12 months in the financial sector for an authorized firm or a professional services firm in a relevant position and in relation to leveraged instruments."],"accountScreen.verification.corporate.investorClassification.required.netAssetsBalanceSheet":["You must upload a file to prove the company's net assets in financial statements"],"accountScreen.verification.corporate.investorClassification.required.netAssetsCash":["You must upload a file to prove the company's net assets in cash"],"accountScreen.verification.corporate.investorClassification.required.netAssetsFinancialInstruments":["You must upload a file to prove the company's net assets in financial instruments"],"accountScreen.verification.corporate.investorClassification.required.netAssetsProof":["At least one proof of net assets is required"],"accountScreen.verification.corporate.investorClassification.required.netAssetsRealEstate":["You must upload a file to prove the company's net assets in real estate"],"accountScreen.verification.corporate.investorClassification.required.netAssetsVirtualAssets":["You must upload a file to prove the company's net assets in virtual assets"],"accountScreen.verification.corporate.investorClassification.required.proofOfProductExperience":["You must upload a file to prove your product experience"],"accountScreen.verification.corporate.investorClassification.required.proofOfProfessionalExperience":["You must upload a file to prove the professional experience of the company"],"accountScreen.verification.corporate.investorClassification.title":["Investor Classification"],"accountScreen.verification.corporate.investorExperience.label":["To determine the Investor Classification, we kindly request that you confirm whether your company has experience in trading leveraged instruments. Please choose one of the three options:"],"accountScreen.verification.corporate.isCaspUnderCars":["Does your company qualify as a CASP under CARS regulations?"],"accountScreen.verification.corporate.noTinCountry":["If you are not a tax resident of any country, please provide the country/jurisdiction of your main office or where your business is primarily managed"],"accountScreen.verification.corporate.optionRequired":["You must choose a valid option"],"accountScreen.verification.corporate.originOfFundsCountries":["From which jurisdiction will the company deposit virtual assets into the Deribit account?"],"accountScreen.verification.corporate.originOfFundsCountries.caption":["Please confirm in which jurisdiction(s) the originating hosted wallet (VASP) or unhosted wallet is registered or located."],"accountScreen.verification.corporate.originOfFundsCountries.required":["You must choose at least one jurisdiction"],"accountScreen.verification.corporate.possessVat":["Are you VAT registered?"],"accountScreen.verification.corporate.powerOfAttorney":["Check this box if your company has power of attorney to sign on behalf of this company"],"accountScreen.verification.corporate.prohibitedBelarusian":["Belarusian companies are not allowed to use our services. For more information, please visit our ",["knowledgeBaseProhibitedBelarusianLink"],"."],"accountScreen.verification.corporate.prohibitedRussians":["Russian companies are not allowed to use our services. For more information, please visit our ",["knowledgeBaseProhibitedRussiansLink"],"."],"accountScreen.verification.corporate.registeredOfficeAddress":["Registered office address"],"accountScreen.verification.corporate.registeredOfficeInfo":["You have provided the following registered office address in Step 1: ",["company_details_street_name"]," ",["company_details_building_number"],", ",["company_details_postcode"]," ",["company_details_city"],["0"],["1"]],"accountScreen.verification.corporate.relatedEntityName":["Related entity name"],"accountScreen.verification.corporate.required":["This field is required"],"accountScreen.verification.corporate.required.caspCarsChoice":["Please select whether your company qualifies as a CASP under CARS regulations"],"accountScreen.verification.corporate.required.mailingAddressChoice":["Please select whether your company has a different mailing address"],"accountScreen.verification.corporate.required.mailingBuildingNumber":["Mailing building number is required"],"accountScreen.verification.corporate.required.mailingCity":["Mailing city is required"],"accountScreen.verification.corporate.required.mailingCountry":["Mailing country is required"],"accountScreen.verification.corporate.required.mailingPostcode":["Mailing postal code is required"],"accountScreen.verification.corporate.required.mailingStreetName":["Mailing street name is required"],"accountScreen.verification.corporate.required.noTinCountry":["Please provide the country/jurisdiction of your main office or where your business is primarily managed"],"accountScreen.verification.corporate.required.relatedEntityName":["Related entity name is required"],"accountScreen.verification.corporate.required.taxEntityType":["Please select at least one tax entity type"],"accountScreen.verification.corporate.required.tradableMarketName":["Tradable market name is required"],"accountScreen.verification.corporate.signatureCapacity":["Under which capacity are you signing?"],"accountScreen.verification.corporate.sourceOfFunds.required":["You must choose at least one source of funds"],"accountScreen.verification.corporate.sourceOfWealth":["What is the source of wealth of the company (multiple options can be selected)?"],"accountScreen.verification.corporate.sourceOfWealth.required":["You must choose at least one source of wealth"],"accountScreen.verification.corporate.sptProviderConsent":["We hereby confirm that we have assessed whether providing our services as an SPT provider requires a license and that we act in compliance with all applicable regulations."],"accountScreen.verification.corporate.taxEntityTypeLabel":["Which of the following tax entity types best describes your company?"],"accountScreen.verification.corporate.tradableMarketName":["Tradable market name"],"accountScreen.verification.corporate.ubo.sourceOfWealth":["What is the source of wealth?"],"accountScreen.verification.corporate.ubos.actions":["Actions"],"accountScreen.verification.corporate.ubos.additionalVerificationStatus":["Additional ID"],"accountScreen.verification.corporate.ubos.fullName":["Full name"],"accountScreen.verification.corporate.ubos.roles":["Role(s)"],"accountScreen.verification.corporate.ubos.verificationStatus":["ID verification"],"accountScreen.verification.corporate.useRegisteredAddressAsMailingAddress":["We will use this address as your mailing address."],"accountScreen.verification.corporate.vaSourceOfFunds":["Source of Funds - What is the origin of the virtual assets that the company intends to deposit into the Deribit account (multiple options can be selected)?"],"accountScreen.verification.corporate.vaSourceOfFunds.caption":["Please note that we require information on the source of the virtual assets themselves, not the fiat currency used to acquire them."],"accountScreen.verification.corporate.vaSourceOfFunds.required":["Please note that we require information on the source of the virtual assets themselves, not the fiat currency used to acquire them."],"accountScreen.verification.corporate.vaSourceOfFundsDetail
2103s":["What are the other sources of funds?"],"accountScreen.verification.corporate.vaSourceOfFundsWalletType":["What type of wallet or service will the virtual assets be transferred from?"],"accountScreen.verification.corporate.vaSourceOfFundsWalletType.required":["Source of funds (wallet type) is required"],"accountScreen.verification.corporate.vatNumber":["VAT number"],"accountScreen.verification.corporateAccount":["Corporate Account"],"accountScreen.verification.corporateAccount.UboDetails.fileUpload":["File Upload"],"accountScreen.verification.corporateAccount.UboDetails.personalDetails":["Personal Details"],"accountScreen.verification.corporateAccount.UboDetails.taxInfo":["Tax Information"],"accountScreen.verification.corporateAccount.addPerson":["Add person"],"accountScreen.verification.corporateAccount.addUbo.instructon2":["Upload a recent (not more than 3 months old) proof of residence (utility bill, bank statement, tax bill or document from the local authorities)."],"accountScreen.verification.corporateAccount.addUbo.proofOfResidence":["Proof of Residence"],"accountScreen.verification.corporateAccount.additionalFile":["Additional file"],"accountScreen.verification.corporateAccount.additionalFileOptional":["Additional file (optional)"],"accountScreen.verification.corporateAccount.additionalFiles":["Additional files"],"accountScreen.verification.corporateAccount.additionalId":["Verify Now"],"accountScreen.verification.corporateAccount.amlProcedures":["Please upload a copy of your AML procedure(s)"],"accountScreen.verification.corporateAccount.applicationSubmitted":["Application submitted"],"accountScreen.verification.corporateAccount.businessRegDoc":["Recent (not more than 3 months old) document that reflects registration with the local authorities and the regulated status of the company (e.g. business register extract, Certificate of Incumbency, Certificate of Good Standing)."],"accountScreen.verification.corporateAccount.certificateOfIncorporation":["Certificate of incorporation"],"accountScreen.verification.corporateAccount.clientCategorization":["Client Categorisation"],"accountScreen.verification.corporateAccount.companyDetails":["Company details"],"accountScreen.verification.corporateAccount.companyDocuments":["Company documents"],"accountScreen.verification.corporateAccount.deactivateUbo.confirmation":["By clicking the Confirm button, you are confirming that the UBO/director/trader/signatory/legal representative is no longer active per:"],"accountScreen.verification.corporateAccount.director":["Director"],"accountScreen.verification.corporateAccount.directorsDetails":["Register of Directors including the names, residential addresses and dates of appointment of all directors, signed and dated within the past 3 months by a signatory, with the name of the signatory provided."],"accountScreen.verification.corporateAccount.governmentWebsiteUrl.description":["URL of the website from the local authorities that contains details confirming the registration of your company."],"accountScreen.verification.corporateAccount.header.description":["Please collect and upload all the required documents listed below."],"accountScreen.verification.corporateAccount.investorClassification":["Investor Classification"],"accountScreen.verification.corporateAccount.investorClassification.helperText":["This information is important because it determines whether we can classify you as an Institutional Investor. If the company does not satisfy 2 of the 3 criteria, we will assign a different Investor Classification to your account. For more information, please check the page ",["knowledgeBaseLink"]," in our Knowledge Base."],"accountScreen.verification.corporateAccount.investorExperience.noExperience":["I have no relevant knowledge regarding leveraged instruments (options and futures)."],"accountScreen.verification.corporateAccount.investorExperience.product":["I have conducted a minimum of 12 transactions in derivative contracts during the last 12 months"],"accountScreen.verification.corporateAccount.investorExperience.professional":["I have worked for at least 12 months in the financial sector for an authorised firm or a professional services firm in relation to leveraged instruments."],"accountScreen.verification.corporateAccount.investorExperienceCorporate.noExperience":["The company has no relevant knowledge regarding leveraged instruments (e.g. options and futures)"],"accountScreen.verification.corporateAccount.investorExperienceCorporate.product":["The company has conducted a minimum of 12 transactions in derivative contracts during the last 12 months"],"accountScreen.verification.corporateAccount.investorExperienceCorporate.professional":["A director and/or trader of the company has worked for at least 12 months in the financial sector for an authorised firm or a professional services firm in relation to leveraged instruments"],"accountScreen.verification.corporateAccount.leaveNote":["Leave a note (optional)"],"accountScreen.verification.corporateAccount.legalEntityType.companyLimitedByShares":["Company limited by shares"],"accountScreen.verification.corporateAccount.legalEntityType.decentralizedAutonomousOrganization":["Decentralized Autonomous Organization (DAO)"],"accountScreen.verification.corporateAccount.legalEntityType.exemptedLimitedCompany":["Exempted Limited Company"],"accountScreen.verification.corporateAccount.legalEntityType.foundation":["Foundation"],"accountScreen.verification.corporateAccount.legalEntityType.limitedLiabilityCompany":["Limited Liability Company"],"accountScreen.verification.corporateAccount.legalEntityType.limitedLiabilityPartnership":["Limited Liability Partnership"],"accountScreen.verification.corporateAccount.legalEntityType.other":["Other"],"accountScreen.verification.corporateAccount.legalEntityType.privateLimitedCompany":["Private Limited Company"],"accountScreen.verification.corporateAccount.legalEntityType.proprietary":["Proprietary"],"accountScreen.verification.corporateAccount.legalEntityType.regulatedFund":["Regulated Fund"],"accountScreen.verification.corporateAccount.legalEntityType.spc":["SPC"],"accountScreen.verification.corporateAccount.legalEntityType.trust":["Trust"],"accountScreen.verification.corporateAccount.legalEntityType.unregulatedFund":["Unregulated Fund"],"accountScreen.verification.corporateAccount.legalRepresentative":["Legal Representative"],"accountScreen.verification.corporateAccount.memorandum":["Memorandum and Articles of Association"],"accountScreen.verification.corporateAccount.ownershipDetails":["Register of Members/Shareholders including names, residential addresses and number of shares, signed and dated within the past 3 months by a signatory, with the name of the signatory provided."],"accountScreen.verification.corporateAccount.ownershipStructure":["Corporate structure chart showing the shareholders and UBOs, including share percentages and countries of residence/incorporation, signed and dated within the past 3 months by a signatory, with the name of the signatory provided."],"accountScreen.verification.corporateAccount.powerOfAttorney":["You have indicated in the tax information step that you have a power of attorney on behalf of the company. Please upload a copy of the power of attorney."],"accountScreen.verification.corporateAccount.proofOfContractualArrangement":["Please upload documentary proof of the contractual arrangement the company has with the client."],"accountScreen.verification.corporateAccount.proofOfExemptFromRegulated":["You have indicated that your company is exempt from having a license for the services it offers. Please upload documentary proof supporting this exemption (e.g. a letter from the regulator or an external legal counsel confirming that the company is not required to hold a license)."],"accountScreen.verification.corporateAccount.proofOfRegisteredOffice":["Recent (not more than 3 months old) proof of registered office for the entity (e.g. bank statement, tax b
2103ill, lease agreement, contract for corporate service provider). The document should be addressed to the company and include the name and registered address details of the company."],"accountScreen.verification.corporateAccount.proofOfRegulation":["You have indicated in step 1 that your company has a license from a financial services regulator. Please upload a copy of the license."],"accountScreen.verification.corporateAccount.proofOfSignedCertificationStatement.broker":["Please download the <0>statement for brokers</0> and upload a signed statement below."],"accountScreen.verification.corporateAccount.proofOfSignedCertificationStatement.investmentManager":["Please download the <0>statement for Investment Managers</0> and upload a signed statement below."],"accountScreen.verification.corporateAccount.proofOfStockExchangeListing":["You have indicated in step 1 that your company is listed. Please upload a document that reflects your listed status."],"accountScreen.verification.corporateAccount.purposeOfAccount.executingStrategiesWithoutClientAssetCustody":["Provision and execution of trading strategies without client asset custody"],"accountScreen.verification.corporateAccount.purposeOfAccount.hedging":["Hedging"],"accountScreen.verification.corporateAccount.purposeOfAccount.investing":["Investing"],"accountScreen.verification.corporateAccount.purposeOfAccount.longTermHolding":["Long-term holding"],"accountScreen.verification.corporateAccount.purposeOfAccount.tradingForClientsAccount":["Trading for the account of clients"],"accountScreen.verification.corporateAccount.purposeOfAccount.tradingForOwnAccount":["Trading for own account"],"accountScreen.verification.corporateAccount.restrictedCountriedStatement":["Please download the <0>statement regarding the restricted countries</0> and upload a signed statement below."],"accountScreen.verification.corporateAccount.signatory":["Signatory"],"accountScreen.verification.corporateAccount.sourceOfFunds":["Please upload a document that reflects the source of your funds (selected by you in step 1 of this form)."],"accountScreen.verification.corporateAccount.sourceOfFunds.clientFunds":["Client funds"],"accountScreen.verification.corporateAccount.sourceOfFunds.earlyInvestors":["Early investors (secondary funding)"],"accountScreen.verification.corporateAccount.sourceOfFunds.founders":["Founders (primary funding)"],"accountScreen.verification.corporateAccount.sourceOfFunds.loan":["Loan"],"accountScreen.verification.corporateAccount.sourceOfFunds.other":["Other income sources"],"accountScreen.verification.corporateAccount.sourceOfFunds.profit":["Profit of the company"],"accountScreen.verification.corporateAccount.sourceOfFunds.updated":["Please upload supporting documentation that demonstrates the source(s) of funds that you selected."],"accountScreen.verification.corporateAccount.sourceOfWealth.clientFunds":["Client funds"],"accountScreen.verification.corporateAccount.sourceOfWealth.earlyInvestors":["Early investors (secondary funding)"],"accountScreen.verification.corporateAccount.sourceOfWealth.founders":["Founders (primary funding)"],"accountScreen.verification.corporateAccount.sourceOfWealth.investments":["Investments"],"accountScreen.verification.corporateAccount.sourceOfWealth.loansOrFinancing":["Loans or financing"],"accountScreen.verification.corporateAccount.sourceOfWealth.other":["Other sources"],"accountScreen.verification.corporateAccount.sourceOfWealth.profit":["Profit of the company"],"accountScreen.verification.corporateAccount.sourceOfWealth.proof":["Please upload documentation demonstrating the source(s) of wealth you selected in step 1 of this form (e.g. audited financial statements)."],"accountScreen.verification.corporateAccount.sourceOfWealth.proof.updated":["Please upload supporting documentation that demonstrates the source(s) of wealth that you selected."],"accountScreen.verification.corporateAccount.sourceOfWealth.saleOfAssets":["Sale of assets"],"accountScreen.verification.corporateAccount.step3.addUboInformation":["Please add the information of each director, UBO, trader, signatory and legal representative."],"accountScreen.verification.corporateAccount.step3.deactivate":["Deactivate"],"accountScreen.verification.corporateAccount.step3.deactivate.error":["Deactivation failed. Please try again later."],"accountScreen.verification.corporateAccount.step3.edit":["Edit"],"accountScreen.verification.corporateAccount.step3.idVerificationBlocked":["Cannot start process because the account is on review."],"accountScreen.verification.corporateAccount.step3.instruction2":["It can take a few minutes for the ID to be verified. You can refresh the page to check the ID verification status."],"accountScreen.verification.corporateAccount.step3.instructionForID":["You can use a passport or ID card depending on the issuing country."],"accountScreen.verification.corporateAccount.step3.notAllRolesAdded":["You have not yet added a ",["0"],". Please note that you are required to add the information of each director, UBO, trader, signatory and legal representative."],"accountScreen.verification.corporateAccount.step3.remove":["Remove"],"accountScreen.verification.corporateAccount.step3.signatoryDefinition":["A signatory is a person who is authorized to act on behalf of the company in relation to the Deribit account."],"accountScreen.verification.corporateAccount.step3.title":["Corporate Persons"],"accountScreen.verification.corporateAccount.step3.uboDefinition":["A UBO is a natural person that (indirectly) owns ≥",["uboThreshold"],"% of the shares in the company. If there are no UBOs who have ≥",["uboThreshold"],"% ultimate beneficial interest, the UBO designation should be assigned to the individual occupying the role of senior managing official."],"accountScreen.verification.corporateAccount.step3.uboListDetails":["The list should include at least 1 UBO, 1 director and 1 trader. If the company has more than one UBO/director/trader, then provide the information of each of these persons."],"accountScreen.verification.corporateAccount.step3.viewDetails":["View Details"],"accountScreen.verification.corporateAccount.submitInformation":["Submit Your Application for Verification"],"accountScreen.verification.corporateAccount.theInformationSubmittedIsBeingVerified":["The information submitted is being verified. You cannot update the information during this process."],"accountScreen.verification.corporateAccount.totalAssetsCriteria":["Does the company satisfy at least 2 out of the 3 criteria below?"],"accountScreen.verification.corporateAccount.totalAssetsCriteria.1":["Balance sheet total of at least USD 20 million;"],"accountScreen.verification.corporateAccount.totalAssetsCriteria.2":["Net annual turnover of at least USD 40 million;"],"accountScreen.verification.corporateAccount.totalAssetsCriteria.3":["Own funds of at least USD 2 million."],"accountScreen.verification.corporateAccount.totalAssetsCriteria.description":["Please note you will need to upload the most recent annual accounts, certified and dated by the CFO or an external auditor, in the next step of this form if you have answered Yes."],"accountScreen.verification.corporateAccount.totalAssetsProof.description":["Please upload the most recent annual accounts, certified and dated by the CFO or an external auditor, that demonstrate the company satisfies at least 2 out of the 3 criteria."],"accountScreen.verification.corporateAccount.totalAssetsProof.helperText":["If the certified annual accounts are not available, please update your response to the question regarding the 2 out of 3 financial criteria in step 1 of this form."],"accountScreen.verification.corporateAccount.totalAssetsProofCriteria":["You have indicated in step 1 that your company satisfies at least 2 out of the following 3 criteria:"],"accountScreen.verification.corporateAccount.totalAssetsProofCriteria.1":["Balance sheet total of at least USD 20 million;"],"accountScreen.verification.corporateAccount.totalAssetsProofCriteria.2":["Net annual turnover of at least USD 40 million;"],"accountScreen.verification.corporateAccount.totalAssetsProofCriteria.3":["Own funds of at least USD 2 million."],"accountScreen.verification.corporateAccount.trader":["Trader"],"accountScreen.verification.corporateAccount.typeOfBusiness.broker":["Broker"],"accountScreen.verification.corporateAccount.typeOfBusiness.hedgeFund":["Hedge Fund"],"accountScreen.verification.corporateAccount.typeOfBusiness.investmentManager":["Investment Manager"],"accountScreen.verification.corporateAccount.typeOfBusiness.marketMaker":["Market Maker"],"accountScreen.verification.corporateAccount.typeOfBusiness.miner":["Miner"],"accountScreen.verification.corporateAccount.typeOfBusiness.other":["Other"],"accountScreen.verification.corporateAccount.typeOfBusiness.primeBroker":["Prime Broker"],"accountScreen.verification.corporateAccount.typeOfBusiness.proprietaryTradingFirm":["Proprietary Trading Firm (e.g HFT firm/Arbitrage Firm)"],"accountScreen.verification.corporateAccount.typeOfBusiness.sptProvider":["Strategic Portfolio Trading (SPT) Provider"],"accountScreen.verification.corporateAccount.typeOfBusiness.vasp":["Virtual Assets Service Provider (VASP)"],"accountScreen.verification.corporateAccount.ubo":["UBO"],"accountScreen.verification.corporateAccount.ubo.controllingPersonsDeclaration":["Controlling Persons Declaration"],"accountScreen.verification.corporateAccount.ubo.controllingPersonsDeclarationDescription":["Generate the tax residency self-certification form, sign it, and upload the signed copy."],"accountScreen.verification.corporateAccount.ubo.proofOfSourceOfWealth":["Provide proof of source of wealth"],"accountScreen.verification.corporateAccount.uboDetails.savePersonalInfo":["Please save personal information before navigating to this tab."],"accountScreen.verification.corporateAccount.uploadID":["Verify Now"],"accountScreen.verification.corporateAccount.uploadedOn":["Uploaded on ",["0"]," (",["1"],")"],"accountScreen.verification.corporateAccount.youHaveNotYetEnteredAllDetails":["You have not yet entered all details and/or uploaded all the documents as required in all of the steps."],"accountScreen.verification.corporateAccount.youHaveUnsavedChanges":["You have unsaved changes. Click Save before submitting your application."],"accountScreen.verification.corporateClientCategorization.description":["To comply with regulatory requirements, we need to categorise our UK clients. For this purpose, we kindly ask you to complete the steps below. It is important that you provide accurate information, as the <0>client categorisation</0> determines whether we can offer our services to you."],"accountScreen.verification.corporateClientCategorization.ecProof.label":["Please upload documentation demonstrating that the company qualifies under the option selected above (e.g. a licence issued by a MiFID regulator)."],"accountScreen.verification.corporateClientCategorization.ecType.option.centralBank":["A central bank"],"accountScreen.verification.corporateClientCategorization.ecType.option.collectiveInvestmentScheme":["A c
2103ollective investment scheme authorised under the UK provisions which implemented the UCITS Directive or its management company"],"accountScreen.verification.corporateClientCategorization.ecType.option.creditInstitution":["A credit institution"],"accountScreen.verification.corporateClientCategorization.ecType.option.financialInstitution":["Another financial institution authorised or regulated under the law of the United Kingdom"],"accountScreen.verification.corporateClientCategorization.ecType.option.insuranceCompany":["An insurance company"],"accountScreen.verification.corporateClientCategorization.ecType.option.investmentFirm":["An investment firm (i.e. a firm authorised under MiFID to provide investment services or perform investment activities on a professional basis)"],"accountScreen.verification.corporateClientCategorization.ecType.option.nationalGovernment":["A national government or its corresponding office, including a public body that deals with public debt at national level"],"accountScreen.verification.corporateClientCategorization.ecType.option.none":["None of the above"],"accountScreen.verification.corporateClientCategorization.ecType.option.pensionFund":["A pension fund or its management company"],"accountScreen.verification.corporateClientCategorization.ecType.option.supranational":["A supranational organisation"],"accountScreen.verification.corporateClientCategorization.ecType.question":["Does the company qualify for any of the following options?"],"accountScreen.verification.corporateClientCategorization.portfolioProof.cash":["Cash"],"accountScreen.verification.corporateClientCategorization.portfolioProof.cash.description":["Please upload a recent bank statement (not older than 3 months) showing the company's name, the issue date, the balance in the bank account, and the name/logo of the financial institution."],"accountScreen.verification.corporateClientCategorization.portfolioProof.cryptoAssets":["Crypto Assets"],"accountScreen.verification.corporateClientCategorization.portfolioProof.cryptoAssets.description":["Please upload a recent account statement (not older than 3 months) of the trading platform, wallet provider or custodian that shows the value of the company's crypto assets. This document must clearly display the company's name, the issue date, the balance in the account, and the name/logo of the financial institution."],"accountScreen.verification.corporateClientCategorization.portfolioProof.description":["Please select the applicable asset categories and upload documents demonstrating that the total value of the company's financial instrument portfolio exceeds EUR 500,000."],"accountScreen.verification.corporateClientCategorization.portfolioProof.financialInstruments":["Financial Instruments"],"accountScreen.verification.corporateClientCategorization.portfolioProof.financialInstruments.description":["Please upload a recent overview (not older than 3 months) of the company's stock portfolio, an account statement from trading platform(s), or a similar supporting document. This document must clearly display the company's name, the issue date, the balance in the account, and the name/logo of the financial institution."],"accountScreen.verification.corporateClientCategorization.portfolioProof.warning":["Ensure that each document clearly displays the company's name and/or email address, as well as the issue date."],"accountScreen.verification.corporateClientCategorization.portfolioSize.prefilled":["We have pre-filled the answer based on the value of assets in the company's account"],"accountScreen.verification.corporateClientCategorization.portfolioSize.question":["Does the company hold a portfolio of financial instruments (including cash and virtual assets) that exceeds EUR 500,000 (or equivalent)?"],"accountScreen.verification.corporateClientCategorization.ppcRegulatedProof.label":["Please upload documentation demonstrating that the company qualifies under the option selected above."],"accountScreen.verification.corporateClientCategorization.ppcRegulatedType.info":["Currently, we do not accept regional governments, including public bodies that manage public debt at the regional level."],"accountScreen.verification.corporateClientCategorization.ppcRegulatedType.option.collectiveInvestmentScheme":["A c
2103ollective investment scheme or the management company of such a scheme"],"accountScreen.verification.corporateClientCategorization.ppcRegulatedType.option.commodityDealer":["A commodity or commodity derivatives dealer"],"accountScreen.verification.corporateClientCategorization.ppcRegulatedType.option.financialInstitution":["Any other authorised or regulated financial institution"],"accountScreen.verification.corporateClientCategorization.ppcRegulatedType.option.institutionalInvestor":["Any other institutional investor"],"accountScreen.verification.corporateClientCategorization.ppcRegulatedType.option.local":["A local"],"accountScreen.verification.corporateClientCategorization.ppcRegulatedType.option.none":["None of the above"],"accountScreen.verification.corporateClientCategorization.ppcRegulatedType.question":["Is the company one of the following entities that is required to be authorised or regulated to operate in the financial markets?"],"accountScreen.verification.corporateClientCategorization.ppcSizeMet.question":["Is the company a large undertaking meeting at least two of the following size requirements on company basis?"],"accountScreen.verification.corporateClientCategorization.ppcSizeMet.requirements":["(a) balance sheet total of EUR 20,000,000\\n(b) net turnover of EUR 40,000,000\\n(c) own funds of EUR 2,000,000"],"accountScreen.verification.corporateClientCategorization.ppcSizeProof.label":["Please upload the most recent financial statements, certified and dated by the CFO or an external auditor, demonstrating that the company meets at least two of the three requirements."],"accountScreen.verification.corporateClientCategorization.professionalClient.consent":["I hereby confirm that I wish the company be treated generally as a Professional Client. I understand and accept that, by doing so, the company will not benefit from the regulatory protections and compensation rights available to Retail Clients, and I am aware of the consequences of losing those protections."],"accountScreen.verification.corporateClientCategorization.professionalClient.preliminaryText":["Deribit does not accept Retail Clients from the United Kingdom. However, we may accept Professional Clients. If you believe that your company qualifies as a Professional Client, please provide the required information in the next step."],"accountScreen.verification.corporateClientCategorization.professionalClient.warning":["Please note that Professional Clients have fewer regulatory protections and compensation rights than Retail Clients. If we onboard the company as a Professional Client, the company will not be entitled to the regulatory protections and compensation rights available to Retail Clients."],"accountScreen.verification.corporateClientCategorization.professionalExperience.question":["Does the person responsible for trading on the account currently work, or have they previously worked, in the financial sector for at least one year in a professional role requiring knowledge of leveraged financial instruments?"],"accountScreen.verification.corporateClientCategorization.professionalExperienceProof.label":["Please upload documentation that shows that the trader has worked for at least 12 months in the financial sector for an authorised firm or a professional services firm in a relevant position and in relation to leveraged instruments."],"accountScreen.verification.corporateClientCategorization.qualitativeAttestation":["I hereby confirm that, based on the education, professional experience, and knowledge of leveraged financial instruments of the individuals involved, the company is capable of making its own investment decisions and understanding the associated risks. The company has provided accurate and complete information to Deribit regarding the background and investment experience of the individuals involved, and acknowledges that Deribit relies on this information to assess the company's classification as a professional client under the FCA Handbook."],"accountScreen.verification.corporateClientCategorization.qualitativeTest.title":["Consent & Qualitative Test"],"accountScreen.verification.corporateClientCategorization.quantitativeTest.introduction":["For the quantitative test, we kindly ask you to confirm whether the company satisfies at least 2 out of 3 criteria. Please answer all three questions and provide supporting documentation. The company only needs to satisfy 2 out of 3 criteria to pass the quantitative test."],"accountScreen.verification.corporateClientCategorization.quantitativeTest.title":["Quantitative test"],"accountScreen.verification.corporateClientCategorization.required.ecProof":["You must upload at least one proof document"],"accountScreen.verification.corporateClientCategorization.required.ecType":["You must select an option for Eligible Counterparty question"],"accountScreen.verification.corporateClientCategorization.required.epcConsent":["You must confirm that you wish the company to be treated as a Professional Client"],"accountScreen.verification.corporateClientCategorization.required.portfolioProof":["At least one proof of portfolio size is required"],"accountScreen.verification.corporateClientCategorization.required.portfolioSize":["You must answer whether the company holds a portfolio exceeding EUR 500,000"],"accountScreen.verification.corporateClientCategorization.required.ppcRegulatedProof":["You must upload at least one proof document"],"accountScreen.verification.corporateClientCategorization.required.ppcRegulatedType":["You must select an option for Per Se Professional Client question"],"accountScreen.verification.corporateClientCategorization.required.ppcSizeMet":["You must answer whether the company meets the size requirements"],"accountScreen.verification.corporateClientCategorization.required.ppcSizeProof":["You must upload financial statements demonstrating the company meets size requirements"],"accountScreen.verification.corporateClientCategorization.required.professionalExperience":["You must answer whether the trader has professional experience"],"accountScreen.verification.corporateClientCategorization.required.professionalExperienceProof":["You must upload at least one proof of professional experience"],"accountScreen.verification.corporateClientCategorization.required.qualitativeAttestation":["You must confirm the company is capable of making investment decisions"],"accountScreen.verification.corporateClientCategorization.required.sizableTrades":["You must answer whether the company has conducted sizable trades"],"accountScreen.verification.corporateClientCategorization.required.sizableTradesProof":["You must upload at least one proof of sizable trades"],"accountScreen.verification.corporateClientCategorization.retailClient.rejection":["You have indicated that the company does not meet the criteria to be treated as a Professional Client. As a result, it will be categorised as a Retail Client. As we currently do not accept Retail Clients, we are unable to offer our services to you at this time."],"accountScreen.verification.corporateClientCategorization.riskDisclosure.text":["Crypto derivatives carry a high degree of risk. It is important that you understand these risks, which are outlined in the <0>Risk Disclosures</0> on our website."],"accountScreen.verification.corporateClientCategorization.sizableTrades.prefilled":["We have pre-filled the answer based on the company's trading history"],"accountScreen.verification.corporateClientCategorization.sizableTrades.prefilled.withCount":["We have pre-filled the answer based on the company's trading history. The company has conducted ",["0"]," sizable trades (≥$25k) in its Deribit account."],"accountScreen.verification.corporateClientCategorization.sizableTrades.question":["Has the company conducted trades of significant size (min. notional value of USD 25,000) in leveraged financial instruments (e.g. options, futures and perpetuals) at an average frequency of 10 per quarter over the previous four quarters (i.e. 40 in total)?"],"accountScreen.verification.corporateClientCategorization.sizableTradesProof.info":["Acceptable documents include trading statements or recent transaction history from a trading platform. Please make sure that the document clearly states the name of the company, the type of instruments traded, and the date of the trades."],"accountScreen.verification.corporateClientCategorization.sizableTradesProof.label":["Please upload one or more documents demonstrating the company has conducted a minimum of 40 transactions in leveraged financial instruments with a notional value of at least USD 25,000 over the previous four quarters."],"accountScreen.verification.corporateClientCategorization.title":["Client Categorisation"],"accountScreen.verification.corporateForm.submissionFailed":["The information has not been submitted. Please try again later."],"accountScreen.verification.corporateForm.submitted":["The information has been submitted"],"accountScreen.verification.corporateFormSubmitted":["The information has been submitted."],"accountScreen.verification.country":["Country"],"accountScreen.verification.countryOfBirth":["Country of Birth"],"accountScreen.verification.countryOfIncorporation":["Country of incorporation"],"accountScreen.verification.countryOfResidence":["Country of residence"],"accountScreen.verification.countryOfResidenceContactPerson.note":["If you would like to change the country of residence, please contact <0>[email protected]</0>
2103"],"accountScreen.verification.countryOfResidenceIndividual":["Country of residence"],"accountScreen.verification.dateOfBirth":["Date of birth"],"accountScreen.verification.dateOfBirthContactPerson":["Date of birth of the contact person"],"accountScreen.verification.dateOfBirthContactPerson.note":["As per our <0>Terms of Service</0>, you are required to be 18 years old to use our services"],"accountScreen.verification.dateOfBirthIndividual":["Date of birth"],"accountScreen.verification.dateOfIncorporation":["Date of incorporation"],"accountScreen.verification.depositsAndTradingInfo":["You can make deposits via your ",["linkToWallet"]," and start trading. Please make sure your information is up-to-date. ",["contactUs"]],"accountScreen.verification.documentType":["Document type"],"accountScreen.verification.employerAddress":["What is the address of your employer (the company you work for)?"],"accountScreen.verification.employerName":["What is the name of your employer (the company you work for)?"],"accountScreen.verification.employmentStatusProof":["Please upload documentation that demonstrates your employment status."],"accountScreen.verification.error.countryNotExemptFromIssuingTin":["This country is not on the list of countries known to be exempt from issuing TINs"],"accountScreen.verification.error.countryNotExemptFromRequiringTin":["This country is not on the list of countries known to be exempt from requiring TINs for tax residents"],"accountScreen.verification.error.validTinRequired":["You will not be able to proceed with your application without providing a valid TIN"],"accountScreen.verification.expectedTradeType.option.derivatives":["Derivatives"],"accountScreen.verification.expectedTradeType.option.none":["None"],"accountScreen.verification.expectedTradeType.option.spot":["Spot"],"accountScreen.verification.fileAutoSaveFailed":["Could not auto-save the uploaded file. Please click Save."],"accountScreen.verification.fileLimit":["The maximum size per file is 10 MB."],"accountScreen.verification.fileTooLarge":["The file ",["fileName"]," is too large. Please upload a file smaller than ",["maxSize"],"MB."],"accountScreen.verification.fileUploadFailed":["File upload failed. Please try again."],"accountScreen.verification.financialProfile.title":["Financial Profile"],"accountScreen.verification.firstAndMiddleName":["First name plus middle name(s)"],"accountScreen.verification.firstAndMiddleNamesContactPerson":["First name plus middle name(s) of the contact person"],"accountScreen.verification.generateDeclarationFile":["Generate Declaration File"],"accountScreen.verification.houseApartmentBuildingNumber":["House/Apartment/Building number"],"accountScreen.verification.icRefresh.alert":["The investor classification criteria have been updated. Please complete the new questions to avoid potential trading restrictions."],"accountScreen.verification.icRefresh.alert.title":["Complete Investor Classification Refresh"],"accountScreen.verification.icRefresh.consent.accept":["Accept transfer to Panama"],"accountScreen.verification.icRefresh.consent.popup.switch":["Switch"],"accountScreen.verification.icRefresh.consent.popup.switch.title":["Switch to Spot-Only"],"accountScreen.verification.icRefresh.consent.switchToSpotOnly":["Switch to Spot-only"],"accountScreen.verification.icRefresh.consent.switchToSpotOnly.description":["Are you sure you want to switch your account to Spot-Only? You will no longer be able to trade perpetuals, futures or options"],"accountScreen.verification.icRefreshForcedMigration.alert":["We have reclassified you as a Retail Investor and migrated your account to DRB Panama Inc., our broker that executes orders on the Deribit Dubai exchange. Your positions are not affected, and you can continue trading the same products with the same fees and leverage limits.<0/><1/>As a result, the business relationship with Deribit FZE has been terminated, and the Terms of Service of DRB Panama Inc. now apply. You can review these ",["0"],".<2/><3/>If you prefer not to be onboarded with DRB Panama Inc., we can migrate your account back to Deribit FZE (UAE). However, this would limit you to trading spot products only - derivatives would no longer be available.<4/><5/>By continuing to use our services, you agree to the migration and onboarding with DRB Panama Inc."],"accountScreen.verification.icRefreshForcedMigration.alert.accept":["Transfer to Panama"],"accountScreen.verification.icRefreshForcedMigration.alert.switchToSpot":["Switch to Spot-only"],"accountScreen.verification.icRefreshForcedMigration.alert.termsOfService":["I have read and understood the Terms of Service of DRB Panama Inc."],"accountScreen.verification.icRefreshForcedMigration.alert.title":["Account Migration to DRB Panama Inc."],"accountScreen.verification.idIdentificationDocument":["ID / Identification Document"],"accountScreen.verification.idVerification.cancelIdVerification":["Cancel ID verification"],"accountScreen.verification.idVerification.chooseDocumentType":["Please choose the document type you would like to use to verify your identity"],"accountScreen.verification.idVerification.copyLink":["Copy verification link"],"accountScreen.verification.idVerification.dontHavePassport":["Don't have a passport?"],"accountScreen.verification.idVerification.euResidencePermitRequired":["Please use your valid residence permit to complete the ID verification. Other types of ID are not accepted for your nationality."],"accountScreen.verification.idVerification.failed":["Verification failed. Please try again."],"accountScreen.verification.idVerification.guidelines":["For this step, it is important that you:<0><1>Make sure that your browser settings allow pop-ups</1><2>Make sure there is proper lighting and good background</2></0>"],"accountScreen.verification.idVerification.idCardDescription":["Please make sure you use a valid ID that reflects your nationality and place of birth. After you have provided the ID, please complete the liveness check for face recognition. For this step, you need a camera."],"accountScreen.verification.idVerification.passportCardDescription":["Please make sure you use a valid passport. After you have provided the passport, please complete the liveness check for face recognition. For this step, you need a camera."],"accountScreen.verification.idVerification.pending":["The ID verification is in progress in another browser tab. If you have completed the ID verification in this tab, please wait a few minutes. The status of your ID verification will be updated automatically."],"accountScreen.verification.idVerification.pendingTitle":["Please complete the verification in the tab that has opened."],"accountScreen.verification.idVerification.problemsAccessing":["If you have trouble accessing the ID verification, please copy the link below and paste it in a new browser tab to proceed."],"accountScreen.verification.idVerification.title":["ID Verification (camera required)"],"accountScreen.verification.idVerification.userIdNotificationRusBel":["After you have provided the Residence Permit, please complete the liveness check for face recognition. For this step, you need a camera."],"accountScreen.verification.indiciaExplanation.crossBorderCommuter":["I am a cross-border commuter."],"accountScreen.verification.indiciaExplanation.diplomatic":["I'm a foreign individual assigned to a diplomatic post or a position in a consulate or embassy in the country of my residence address."],"accountScreen.verification.indiciaExplanation.expat":["I am an expat."],"accountScreen.verification.indiciaExplanation.frontierWorker":["I'm a frontier worker or an employee who w
2103orks on a truck or train that travels between jurisdictions."],"accountScreen.verification.indiciaExplanation.investmentProperty":["I own an investment property or a second home in a different country."],"accountScreen.verification.indiciaExplanation.military":["I am a military member or government employee stationed abroad."],"accountScreen.verification.indiciaExplanation.other":["Other"],"accountScreen.verification.indiciaExplanation.remoteWorker":["I'm a remote worker."],"accountScreen.verification.indiciaExplanation.renouncedCitizenship":["I have formally renounced my citizenship of my country of birth."],"accountScreen.verification.indiciaExplanation.seasonalResident":["I am a seasonal resident."],"accountScreen.verification.indiciaExplanation.student":["I'm a student at an educational institution in the country of my residence address."],"accountScreen.verification.indiciaExplanation.teacher":["I'm a teacher, trainee, or intern at an educational institution in the country of my residence address, or a participant in an educational or cultural exchange program."],"accountScreen.verification.indiciaExplanation.temporaryWork":["I have a temporary work assignment or sabbatical in a different country."],"accountScreen.verification.indiciaExplanationTooltip":["Please provide a detailed explanation for this issue in your information."],"accountScreen.verification.indiciaIssuesTitle":["Selected Countries Requiring Clarification"],"accountScreen.verification.indiciaMessage.corporate.missingBirthPlace":["Your company's country of incorporation is ",["countryName"]," but your company is not a tax resident of ",["countryName"],"."],"accountScreen.verification.indiciaMessage.corporate.missingIncorporationCountry":["Your company's country of incorporation is ",["countryName"]," but your company is not a tax resident of ",["countryName"],"."],"accountScreen.verification.indiciaMessage.corporate.missingResidence":["Your company's country of residence is ",["countryName"]," but your company is not a tax resident of ",["countryName"],"."],"accountScreen.verification.indiciaMessage.corporate.unexpectedTin":["Your company has indicated that it is a tax resident of ",["countryName"],", but this is not reflected in your KYC info:"],"accountScreen.verification.indiciaMessage.missingBirthPlace":["You have indicated that your country of birth is the ",["countryName"],", but you are not a tax resident of the ",["countryName"],". Please clarify."],"accountScreen.verification.indiciaMessage.missingResidence":["You have indicated ",["countryName"]," as your country of residence, but not as your tax residency. Please clarify."],"accountScreen.verification.indiciaMessage.unexpectedTin":["You have indicated that you are a tax resident of ",["countryName"],", but this is not reflected in your KYC information. Please clarify."],"accountScreen.verification.individual.fileRequirements":["Make sure the file format meets the requirements. It must be: .pdf, .txt, .doc, .docx or an image file. Maximum file size ",["KYC_MAX_FILE_SIZE_MB"],"MB."],"accountScreen.verification.individual.fileUploadError":["Could not upload file ",["0"],": ",["1"]],"accountScreen.verification.individual.financialProfile.title":["Financial Profile"],"accountScreen.verification.individual.idVerification.title":["ID Verification"],"accountScreen.verification.individual.investorClassification.annualIncomeThreshold":["Do you have an annual income of > USD 191,000 (> 700,000 United Arab Emirates Dirham)?"],"accountScreen.verification.individual.investorClassification.description":["To determine your <0>Investor Classification</0>, please answer the questions below. It is important that you provide accurate information, as the Investor Classification determines which trading instruments and leverage limits we can offer you, as well as the Deribit entity under which we can onboard you."],"accountScreen.verification.individual.investorClassification.icRefresh.retail.warning":["We will classify you as a Retail Investor on 1 August 2025. You will still be able to trade the same products with the same fees and leverage limits."],"accountScreen.verification.individual.investorClassification.icRefresh.retailAndSp
2103otOnly.warning":["Your account will be changed to Spot-Only on 1 August 2025. You will no longer be able to trade our derivatives contracts (perpetuals, futures, options)."],"accountScreen.verification.individual.investorClassification.investorExperience.label":["In order to determine your Investor Classification, we would like to kindly ask you to confirm whether you have any experience in trading leveraged instruments. Please choose one of the three options:"],"accountScreen.verification.individual.investorClassification.investorExperience.prefilled":["We have pre-filled the answer based on your trading history"],"accountScreen.verification.individual.investorClassification.netAssets.cash":["Cash"],"accountScreen.verification.individual.investorClassification.netAssets.financialInstruments":["Financial Instruments"],"accountScreen.verification.individual.investorClassification.netAssets.realEstate":["Non-primary tangible real estate"],"accountScreen.verification.individual.investorClassification.netAssets.virtualAssets":["Virtual Assets"],"accountScreen.verification.individual.investorClassification.netAssetsThreshold":["Do you maintain net assets of > USD 1,000,000 (> 3,750,000 United Arab Emirates Dirham)?"],"accountScreen.verification.individual.investorClassification.netAssetsThreshold.basedOn":["Based on ",["0"]],"accountScreen.verification.individual.investorClassification.netAssetsThreshold.prefilled":["We have pre-filled the answer based on the value of the virtual assets in your account"],"accountScreen.verification.individual.investorClassification.proofOfAnnualIncome":["Please upload one or more documents demonstrating that your annual income exceeds USD 191,000."],"accountScreen.verification.individual.investorClassification.proofOfAnnualIncomeWarning":["Acceptable documents include a recent payslip (not older than 3 months), an employment contract, or a recent bank statement showing salary payments."],"accountScreen.verification.individual.investorClassification.proofOfNetAssetsAboveThreshold":["Please select the applicable asset categories and upload documents demonstrating that the total value of your net assets exceeds USD 1,000,000."],"accountScreen.verification.individual.investorClassification.proofOfNetAssetsAboveThreshold.cash.description":["Please upload a recent bank statement (not older than 3 months) showing your name, the issue date, the balance in your bank account, and the name/logo of the financial institution."],"accountScreen.verification.individual.investorClassification.proofOfNetAssetsAboveThreshold.financialInstruments.description":["Please upload a recent overview (not older than 3 months) of your stock portfolio, an account statement from your trading platform(s), or a similar supporting document. This document must clearly display your name, the issue date, the balance in your account, and the name/logo of the financial institution."],"accountScreen.verification.individual.investorClassification.proofOfNetAssetsAboveThreshold.realEstate.description":["Please upload a recent purchase contract (not older than 3 months), a recent certificate or valuation report issued by a real estate agent or governmental agency, or documentation of recent sales of comparable neighboring properties. This document must clearly display your name, the issue date, the value of the property, and the name/logo of the financial institution."],"accountScreen.verification.individual.investorClassification.proofOfNetAssetsAboveThreshold.virtualAssets.description":["Please upload a recent account statement (not older than 3 months) of your trading platform, wallet provider or custodian that shows the value of your virtual assets. This document must clearly display your name, the issue date, the balance in your account, and the name/logo of the financial institution."],"accountScreen.verification.individual.investorClassification.proofOfNetAssetsAboveThreshold.virtualAssets.warning":["Please note that 100% of the value of non-algorithmic stablecoins (e.g., USDT, USDC) will be taken into account, while only 50% of the value of non-stablecoins will be considered."],"accountScreen.verification.individual.investorClassification.proofOfNetAssetsAboveThreshold.warning":["Ensure that each document clearly displays your name and/or email address, as well as the issue date."],"accountScreen.verification.individual.investorClassification.proofOfProductExperience":["Please upload a document that reflects you have conducted a minimum of 12 transactions in derivative contracts (e.g. options and futures) during the last 12 months (for example, a trading statement or the recent transaction history from a trading platform). Please make sure that the document clearly states your name, the type of derivative instruments that were traded, and the date of the trades."],"accountScreen.verification.individual.investorClassification.proofOfProfessionalExperience":["Please upload a document that shows that you have worked for at least 12 months in the financial sector for an authorised firm or a professional services firm in a relevant position and in relation to leveraged instruments."],"accountScreen.verification.individual.investorClassification.title":["Investor Classification"],"accountScreen.verification.individual.personalInformation.title":["Personal Information"],"accountScreen.verification.individual.prohibitedBelarusians":["We cannot accept you as our client because of your country of residence and nationality. For more information, please visit our ",["knowledgeBaseProhibitedBelarusianLink"],"."],"accountScreen.verification.individual.prohibitedRussians":["We cannot accept you as our client because of your country of residence and nationality. For more information, please visit our ",["knowledgeBaseProhibitedRussiansLink"],"."],"accountScreen.verification.individual.proofOfRe
2103sidence.title":["Proof of Residence"],"accountScreen.verification.individual.suitability.title":["Suitability"],"accountScreen.verification.individual.taxInformation.title":["Tax Information"],"accountScreen.verification.individual.toggleFileUpload":["Toggle file upload for ",["name"]],"accountScreen.verification.individualAccount":["Individual Account"],"accountScreen.verification.individualAccount.submitError":["Submission failed. Please try again later."],"accountScreen.verification.intendedDepositAmount":["Intended deposit amount in the next 12 months"],"accountScreen.verification.invalidFieldsDialog.body":["Your changes were saved, but this step still has missing or required information. Review this step now, or move forward if the next step is available."],"accountScreen.verification.invalidFieldsDialog.continueAnyway":["Move forward anyway"],"accountScreen.verification.invalidFieldsDialog.seeWhatIsWrong":["Review this step"],"accountScreen.verification.invalidFieldsDialog.title":["This step still needs attention"],"accountScreen.verification.investorClassification.netAssetsThreshold.totalAssets":["Total assets in Deribit account: USD ",["0"]," (stablecoins count for 100%, non-stablecoins count for 50%)"],"accountScreen.verification.investorClassification.required.netAssetsCash":["You must upload a file to prove your net assets in cash"],"accountScreen.verification.investorClassification.required.netAssetsFinancialInstruments":["You must upload a file to prove your net assets in financial instruments"],"accountScreen.verification.investorClassification.required.netAssetsRealEstate":["You must upload a file to prove your net assets in real estate"],"accountScreen.verification.investorClassification.required.netAssetsVirtualAssets":["You must upload a file to prove your net assets in virtual assets"],"accountScreen.verification.investorClassificationInfo":["You have been classified as a ",["investorClassification"],". For more information on the Investor Classification, please check ",["investorClassificationDocLink"],"."],"accountScreen.verification.investorSuitability.hightRiskProducts":["Do 
2103you understand that the products available on the Deribit platform are high risk due to them being leveraged products and due to the price volatility of virtual assets?"],"accountScreen.verification.investorSuitability.personalPositionMonitoring":["Do you understand that you are expected to monitor your open positions yourself?"],"accountScreen.verification.investorSuitability.priceFluctuation247":["Are you aware that the prices of our products can fluctuate 24 hours a day, 7 days a week, and not only during standard business hours?"],"accountScreen.verification.investorSuitability.riskOfLiquidation":["Do you understand that a small percentage change in the price of the underlying virtual assets may lead to liquidation?"],"accountScreen.verification.investorSuitability.riskOfLosingVirtualAssets":["Are you aware that you risk losing all of the virtual assets you have deposited into your Deribit account if you have one or more open positions that move against you?"],"accountScreen.verification.isExemptFromRegulated":["You have indicated that the company does not have a valid license. Is the company exempt from being regulated for the services it offers?"],"accountScreen.verification.isExemptFromRegulated.description":["Please note that you will need to upload proof of the exemption status in the next step of this form if you have answered Yes."],"accountScreen.verification.isExemptFromRegulated.rejected":["We cannot proceed with your onboarding as you are not exempt from regulated activities and your company is not regulated."],"accountScreen.verification.isRegulated":["Does the company have an appropriate license (by a competent financial services regulator) for the services it offers?"],"accountScreen.verification.isRegulated.description":["Please note you will need to upload a copy of the license in the next step of this form if you have answered Yes."],"accountScreen.verification.jobTitle":["Job title of the contact person"],"accountScreen.verification.jumio.documentUploaded":["The document has been uploaded. It can take a few minutes for the ID to be verified.<0/><1/>Please refresh the Verification page to check whether the ID has been approved.<2/><3/>You can close this page."],"accountScreen.verification.knowledgeBase":["Knowledge Base"],"accountScreen.verification.kycRefresh.alert":["Please check if the KYC information is up to date and upload the required documents to avoid trading restrictions for your account."],"accountScreen.verification.kycRefresh.alert.finish":["Finish now"],"accountScreen.verification.kycRefresh.alert.title":["KYC Refresh"],"accountScreen.verification.kycRefresh.alert.verify":["Verify now"],"accountScreen.verification.lastNameContactPerson":["Last name of the contact person"],"accountScreen.verification.legalEntityIdentifier":["Legal entity identifier (LEI) - this field is optional."],"accountScreen.verification.legalEntityName":["Legal entity name"],"accountScreen.verification.legalEntityType":["Type of legal entity"],"accountScreen.verification.legalEntityTypeDetails":["What is the type of the legal entity?"],"accountScreen.verification.level0.companyDetails":["Company details"],"accountScreen.verification.level0.personDetails":["Contact person details"],"accountScreen.verification.level0.save":["Save"],"accountScreen.verification.level0.update":["Update"],"accountScreen.verification.level1.startVerification":["Start Verification"],"accountScreen.verification.level1.step2b.note":["Please upload a recent (not more than 3 months old) utility bill, bank statement, tax bill or document from the authorities that contains your name, residential address details and issue date. We do not accept mobile phone bills, waybills or screenshots of banking apps. Your name and address should be clearly visible in the document."],"accountScreen.verification.listedOnAStockExchange":["Is the company listed on a stock exchange?"],"accountScreen.verification.listedOnExchange.description":["Please note that you will need to upload a document that confirms your listed status in the next step of this form if you have answered Yes."],"accountScreen.verification.maxLength.vatNumber":["VAT number must be at most 18 characters"],"accountScreen.verification.minValue.intendedNumberOfTrades":["Intended number of trades must be greater than 0."],"accountScreen.verification.missingDeposit.alert":["Your deposit is missing information. Please add this in your Wallet so we can process the transaction."],"accountScreen.verification.missingDeposit.alert.title":["Missing Deposit Information"],"accountScreen.verification.missingDeposit.alert.verify":["Go to wallet"],"accountScreen.verification.missingInfo":["Missing info"],"accountScreen.verification.nationalities":["Nationality (if you have multiple nationalities, please select each nationality)"],"accountScreen.verification.nationalities.corporate":["Nationality (if multiple nationalities apply, please select each nationality)"],"accountScreen.verification.nationality":["Nationality"],"accountScreen.verification.no":["No"],"accountScreen.verification.noAccess":["Not available for subaccounts"],"accountScreen.verification.noAccess.scope":["Access denied because of missing API key scope"],"accountScreen.verification.noTinForCountry":["I don't have a TIN"],"accountScreen.verification.noTinReason":["Reason for not having a TIN"],"accountScreen.verification.noTinReason.applicationRejected":["TIN application was rejected"],"accountScreen.verification.noTinReason.appliedButNotReceived":["Applied for TIN but not yet received"],"accountScreen.verification.noTinReason.countryDoesNotIssueTins":["Country does not issue TINs"],"accountScreen.verification.noTinReason.countryDoesNotRequireTin":["Country does not require TINs for tax residents"],"accountScreen.verification.notAp
2103plicable":["Not applicable"],"accountScreen.verification.onboard.cbbm":["You have been onboarded onto Coinbase Bermuda."],"accountScreen.verification.onboard.dubai":["You have been onboarded on the Deribit exchange of Deribit FZE, which is incorporated in Dubai, UAE, and regulated by the Virtual Assets Regulatory Authority (VARA) in Dubai <0/>."],"accountScreen.verification.onboard.panama":["You have been onboarded to the Deribit brokerage service of DRB Panama Inc., which is incorporated in Panama City, Panama <0/>. DRB Panama Inc. will execute orders on your behalf on the Deribit exchange in Dubai."],"accountScreen.verification.onlyForLoggedInUsers":["Verification is only available for logged-in users."],"accountScreen.verification.panamaOnboarding.consent.description":["On August 1st 2025 you will be classified as a Retail Investor. We will transfer your account back to DRB Panama, which is our broker that executes orders on Deribit Dubai, so you can continue trading the same products under the same fees and leverage limits. Your positions will not be affected."],"accountScreen.verification.panamaOnboarding.consent.description.tosLink":["You can review the Terms of Service DRB Panama Inc. <0>here</0>."],"accountScreen.verification.panamaOnboarding.consent.termsOfService":["I have read and understood the Terms of Service of DRB Panama Inc."],"accountScreen.verification.panamaOnboarding.consent.title":["Retail Investor Classification"],"accountScreen.verification.passport":["Passport"],"accountScreen.verification.pdfGenerated":["PDF generated successfully. Please sign and upload it."],"accountScreen.verification.pdfGenerationFailed":["Failed to generate PDF. Please try again."],"accountScreen.verification.personalInformation.addUbo.description":["Please enter personal details that match the details on the ID of the director/UBO/signatory/legal representative/trader."],"accountScreen.verification.personalInformation.description":["Please enter your personal details that match the details on your ID."],"accountScreen.verification.personalInformation.title":["Personal Information"],"accountScreen.verification.personalInformation.uboType.description":["Please choose one or more role(s) of this person from the list."],"accountScreen.verification.placeOfBirth":["Place of birth"],"accountScreen.verification.postalCode":["Postal code"],"accountScreen.verification.principalPlaceOfBusiness":["In which country is the principal place of business of the company?"],"accountScreen.verification.principalPlaceOfBusiness.description":["This is typically the location from which the officers, partners or managers of the legal person primarily direct, control, and coordinate the activities of the legal person. The principal place of business is not necessarily the same as the registered office address."],"accountScreen.verification.proofOfResidence.title":["Proof of residence"],"accountScreen.verification.purposeOfAccount":["What is the purpose of the account?"],"accountScreen.verification.purposeOfAccountDetails":["Please provide additional details on the intended nature and purpose of your account."],"accountScreen.verification.required.annualIncomeAboveThreshold":["You must specify your annual income"],"accountScreen.verification.required.atLeastOneTin":["Add at least one country as your tax residency."],"accountScreen.verification.required.buildingNumber":["Number is required"],"accountScreen.verification.required.businessAddress":["Business address is required."],"accountScreen.verification.required.businessName":["Business name is required."],"accountScreen.verification.required.city":["City is required"],"accountScreen.verification.required.companyOwner":["Company ownership info is required."],"accountScreen.verification.required.countryOfBirth":["Country of birth is required."],"accountScreen.verification.required.countryOfResidence":["Country of residence is required."],"accountScreen.verification.required.dateOfBirth":["Date of birth is required."],"accountScreen.verification.required.default":["This field is required"],"accountScreen.verification.required.employerAddress":["Employer address is required."],"accountScreen.verification.required.employerName":["Employer name is required."],"accountScreen.verification.required.employmentStatus":["Employment status is required."],"accountScreen.verification.required.employmentStatusProof":["Proof of the employment status is required"],"accountScreen.verification.required.estimatedAnnualIncome":["Estimated annual income is required."],"accountScreen.verification.required.estimatedNetWorth":["Estimated net worth is required."],"accountScreen.verification.required.evidenceEddProofOfIdentity":["Alternative ID is required"],"accountScreen.verification.required.expectedTradeType":["Expected trade type is required"],"accountScreen.verification.required.firstName":["First name is required"],"accountScreen.verification.required.indiciaExplanation":["Please provide an explanation for this discrepancy"],"accountScreen.verification.required.intendedDepositAmount":["Intended deposit amount is required."],"accountScreen.verification.required.intendedNumberOfTrades":["Intended number of trades is required."],"accountScreen.verification.required.investorExperience":["You need to choose your experience"],"accountScreen.verification.required.jobIndustry":["Job industry is required."],"accountScreen.verification.required.lastName":["Last name is required"],"accountScreen.verification.required.nationalities":["At least one nationality is required"],"accountScreen.verification.required.nationality":["Nationality is required."],"accountScreen.verification.required.netAssetsAboveThreshold":["Net assets above threshold is required"],"accountScreen.verification.required.netAssetsProof":["At least one proof of net assets is required"],"accountScreen.verification.required.originOfFundsCountries":["At least one jurisdiction is required"],"accountScreen.verification.required.placeOfBirth":["Place of birth is required"],"accountScreen.verification.required.possessVat":["Please indicate if you are VAT registered"],"accountScreen.verification.required.postalCode":["Postal code is required"],"accountScreen.verification.required.proofOfAnnualIncome":["Proof of annual income is required"],"accountScreen.verification.required.proofOfProductExperience":["Proof of experience is required"],"accountScreen.verification.required.proofOfProfessionalExperience":["Proof of experience is required"],"accountScreen.verification.required.purposeOfAccount":["Purpose of account is required."],"accountScreen.verification.required.purposeOfAccountDetails":["Additional purpose details are required"],"accountScreen.verification.required.signatoryName":["Signatory name is required"],"accountScreen.verification.required.sourceOfFunds":["Source of funds is required."],"accountScreen.verification.required.sourceOfFundsDetail
2103s":["Other fund sources information is required."],"accountScreen.verification.required.sourceOfFundsProof":["Proof of the source of funds is required"],"accountScreen.verification.required.sourceOfWealth":["Source of wealth is required."],"accountScreen.verification.required.sourceOfWealthDetails":["Other wealth source information is required."],"accountScreen.verification.required.sourceOfWealthProof":["Proof of the source of wealth is required"],"accountScreen.verification.required.stateProvinceCounty":["State/Province/County is required"],"accountScreen.verification.required.streetName":["Street name is required"],"accountScreen.verification.required.taxCountry":["Country of tax identification is required"],"accountScreen.verification.required.tin":["Tax identification number is required"],"accountScreen.verification.required.vaSourceOfFunds":["Please specify the source of the virtual assets"],"accountScreen.verification.required.vaSourceOfFundsDetails":["Other fund sources information is required"],"accountScreen.verification.required.vaSourceOfFundsWalletType":["Source of funds (wallet type) is required"],"accountScreen.verification.required.vatNumber":["VAT number is required"],"accountScreen.verification.required.yesOrNo":["You need to choose Yes or No"],"accountScreen.verification.residence.ubo.description":["Please enter the residence address details that match the address in your proof of residence."],"accountScreen.verification.residenceInformation.title":["Residence Information"],"accountScreen.verification.residencePermit":["Residence Permit"],"accountScreen.verification.residenceVerificationSuccess":["The verification of your documents is in process. You may close this tab."],"accountScreen.verification.search.noResults":["No results found"],"accountScreen.verification.search.placeholder":["Search..."],"accountScreen.verification.selectAccountType":["Please select the type of account:"],"accountScreen.verification.setAccountTypeFailed":["Failed to set account type. Please try again."],"accountScreen.verification.signatureFullName":["Signature (your full name)"],"accountScreen.verification.sourceOfFunds":["What is the source of funds in the Deribit account (multiple options can be selected)?"],"accountScreen.verification.sourceOfFundsDetails":["What are the other fund sources?"],"accountScreen.verification.sourceOfFundsProof":["Proof of the source of funds"],"accountScreen.verification.sourceOfFundsProof.updated":["Please upload supporting documentation that demonstrates the source(s) of funds that you selected."],"accountScreen.verification.sourceOfWealth.ubo.title":["Source of Wealth"],"accountScreen.verification.sourceOfWealthDetails":["What are the other sources of wealth?"],"accountScreen.verification.sourceOfWealthProof":["Please upload supporting documentation that demonstrates the source(s) of wealth that you selected."],"accountScreen.verification.stateOrRegion":["State or region"],"accountScreen.verification.stateProvinceCounty":["State/Province/County"],"accountScreen.verification.status.corporate.guidance":["<0>We only accept documents in (translated) English.</0> <1>If you need help with the form, please review our ",["guidelinesLink"]," for corporate KYC.</1>"],"accountScreen.verification.status.rejected":["Your account has been rejected. Please check your email for more details. ",["contactUs"]],"accountScreen.verification.status.review":["Thank you for completing the verification form. We will verify the information soon and contact you afterwards. ",["updateIsNotPossible"]," ",["contactUs"]],"accountScreen.verification.step.next":["Next"],"accountScreen.verification.step2.sourceOfWealth":["What is the source of your wealth (multiple options can be selected)?"],"accountScreen.verification.step2.sourceOfWealthSubText":["This question is to help us understand how your net worth was accumulated."],"accountScreen.verification.step2.userNotification":["Please make sure to provide accurate information, as this information will be taken into account when monitoring the activity in your account. In the event that discrepancies are detected between the provided information and the activity in your account, we may request you to submit additional information to substantiate the observed activity."],"accountScreen.verification.step3.accountPurpose.executingOrdersForClientsAccount":["Executing of orders on behalf of clients"],"accountScreen.verification.step3.accountPurpose.hedging":["Hedging"],"accountScreen.verification.step3.accountPurpose.holding":["Long-term holding"],"accountScreen.verification.step3.accountPurpose.investing":["Investing"],"accountScreen.verification.step3.accountPurpose.managingAssetsForClientsAccount":["Managing third party assets with investment discretion"],"accountScreen.verification.step3.accountPurpose.trading":["Trading"],"accountScreen.verification.step3.companyOwner":["Are you a director, owner or controller of the company?"],"accountScreen.verification.step3.employmentStatus":["What is your employment status?"],"accountScreen.verification.step3.employmentStatus.employedFullTime":["Employed (full-time)"],"accountScreen.verification.step3.employmentStatus.employedPartTime":["Employed (part
2103-time)"],"accountScreen.verification.step3.employmentStatus.independentTrader":["Independent Trader"],"accountScreen.verification.step3.employmentStatus.retiredPensioner":["Retired/Pensioner"],"accountScreen.verification.step3.employmentStatus.selfEmployed":["Self-employed"],"accountScreen.verification.step3.employmentStatus.student":["Student"],"accountScreen.verification.step3.employmentStatus.unemployed":["Unemployed"],"accountScreen.verification.step3.estimatedAnnualIncome":["What is your estimated annual income in USD?"],"accountScreen.verification.step3.estimatedNetWorth":["What is your estimated net worth (wealth) in USD?"],"accountScreen.verification.step3.expectedTradeType":["What kind of trades do you expect to conduct?"],"accountScreen.verification.step3.fundsSourcesInDeribitAccountMultiple":["What is the source of the funds in your Deribit account (multiple options can be selected)?"],"accountScreen.verification.step3.incomeSource.companyProfits":["Company profits/dividend"],"accountScreen.verification.step3.incomeSource.companySale":["Company Sale"],"accountScreen.verification.step3.incomeSource.employment":["Employment"],"accountScreen.verification.step3.incomeSource.gift":["Gift"],"accountScreen.verification.step3.incomeSource.inheritance":["Inheritance"],"accountScreen.verification.step3.incomeSource.lifePolicy":["Maturity/surrender of life policy"],"accountScreen.verification.step3.incomeSource.loan":["Loan"],"accountScreen.verification.step3.incomeSource.other":["Other sources"],"accountScreen.verification.step3.incomeSource.pensionOrSocialBenefits":["Pension or social benefits"],"accountScreen.verification.step3.incomeSource.propertySale":["Property Sale"],"accountScreen.verification.step3.incomeSource.savings":["Savings"],"accountScreen.verification.step3.incomeSource.sharesInvesting":["Sale of shares or other investment"],"accountScreen.verification.step3.incomeSource.virtualAssets":["Virtual Assets trading"],"accountScreen.verification.step3.intendedDepositAmount":["What is the amount that you expect to deposit on Deribit in the next 12 months?"],"accountScreen.verification.step3.intendedNumberOfTrades":["What is the number of trades that you expect to make on Deribit in the next 12 months?"],"accountScreen.verification.step3.jobIndustry":["In what job industry?"],"accountScreen.verification.step3.jobIndustry.accountancy":["Accountancy/Professional services"],"accountScreen.verification.step3.jobIndustry.agriculture":["Agriculture/Farming"],"accountScreen.verification.step3.jobIndustry.armedForces":["Armed forces/Arms dealing/Military"],"accountScreen.verification.step3.jobIndustry.artMarkets":["Art markets participants"],"accountScreen.verification.step3.jobIndustry.banking":["Banking"],"accountScreen.verification.step3.jobIndustry.cannabis":["Cannabis production and distribution"],"accountScreen.verification.step3.jobIndustry.catering":["Catering/Hospitality"],"accountScreen.verification.step3.jobIndustry.charityNonProfit":["Charity/Non-profit"],"accountScreen.verification.step3.jobIndustry.civilAviationRoadsRailways":["Transport (civil aviation, roads, railways)"],"accountScreen.verification.step3.jobIndustry.constructionExtraction":["Construction/Extraction industries"],"accountScreen.verification.step3.jobIndustry.creative":["Creative/Media"],"accountScreen.verification.step3.jobIndustry.education":["Education"],"accountScreen.verification.step3.jobIndustry.emergencyServices":["Emergency Services"],"accountScreen.verification.step3.jobIndustry.engineering":["Engineering"],"accountScreen.verification.step3.jobIndustry.financialServices":["Financial services"],"accountScreen.verification.step3.jobIndustry.gambling":["Gambling/Casinos"],"accountScreen.verification.step3.jobIndustry.government":["Government/Civil (national or local)/Public services"],"accountScreen.verification.step3.jobIndustry.healthMedicine":["Health/Medicine"],"accountScreen.verification.step3.jobIndustry.highValueSales":["Sales/Trading in high-value goods such as cars, jewellery or similar."],"accountScreen.verification.step3.jobIndustry.hr":["HR (as an industry, not a role within a firm)"],"accountScreen.verification.step3.jobIndustry.legalIndustry":["Legal (as an industry, not a role within a firm)"],"accountScreen.verification.step3.jobIndustry.leisure":["Leisure/Entertainment/Tourism"],"accountScreen.verification.step3.jobIndustry.logistics":["Logistics/Couriers/Postal services"],"accountScreen.verification.step3.jobIndustry.manufacturing":["Manufacturing"],"accountScreen.verification.step3.jobIndustry.marketing":["Marketing/PR/Advertising (as an industry, not a role within a firm)"],"accountScreen.verification.step3.jobIndustry.pharmaceutical":["Pharmaceutical"],"accountScreen.verification.step3.jobIndustry.property":["Property"],"accountScreen.verification.step3.jobIndustry.publicSector":["Public Sector"],"accountScreen.verification.step3.jobIndustry.retail":["Retail"],"accountScreen.verification.step3.jobIndustry.shipping":["Shipping/Ports/Fisheries"],"accountScreen.verification.step3.jobIndustry.socialCare":["Social care"],"accountScreen.verification.step3.jobIndustry.technology":["IT/Technology industries"],"accountScreen.verification.step3.jobIndustry.telecommunication":["Telecommunication"],"accountScreen.verification.step3.jobIndustry.tobacco":["Tobacco/Smoking products manufacturing and distribution"],"accountScreen.verification.step3.jobIndustry.utilities":["Utilities (electricity, water, gas)"],"accountScreen.verification.step3.jobIndustry.virtualAssets":["Virtual Assets trading"],"accountScreen.verification.step3.netWorth.10-30k":["10,000 – 30,000 USD"],"accountScreen.verification.step3.netWorth.15-30k":["15,000 – 30,000 USD"],"accountScreen.verification.step3.netWorth.30-50k":["30,001 – 50,000 USD"],"accountScreen.verification.step3.netWorth.50-150k":["50,001 – 150,000 USD"],"accountScreen.verification.step3.netWorth.less10k":["Less than 10,000 USD"],"accountScreen.verification.step3.netWorth.less15k":["Less than 15,000 USD"],"accountScreen.verification.step3.netWorth.moreThan150k":["More than 150,000 USD"],"accountScreen.verification.step3.originOfFundsCountries":["From which jurisdiction will you deposit virtual assets into your Deribit account?"],"accountScreen.verification.step3.originOfFundsCountries.caption":["Please confirm in which jurisdiction(s) the originating hosted wallet (VASP) or unhosted wallet is registered or located."],"accountScreen.verification.step3.possessVat":["Are you VAT registered?"],"accountScreen.verification.step3.purposeOfAccount":["What is the purpose of your account?"],"accountScreen.verification.step3.purposeOfAccountDetails":["Please provide additional details on the intended nature and purpose of your account."],"accountScreen.verification.step3.sourceOfWealthOther":["What is the other source of wealth?"],"accountScreen.verification.step3.vaSourceOfFunds":["Source of Funds - What is the origin of the virtual assets that you intend to deposit into your Deribit account (multiple options can be selected)?"],"accountScreen.verification.step3.vaSourceOfFundsDetail
2103s":["Please specify the other source of funds"],"accountScreen.verification.step3.vaSourceOfFundsSubText":["Please note that we require information on the source of the virtual assets themselves, not the fiat currency used to acquire them."],"accountScreen.verification.step3.vaSourceOfFundsWalletType":["What type of wallet or service will the virtual assets be transferred from?"],"accountScreen.verification.step3.vatNumber":["VAT number"],"accountScreen.verification.stepMenu.completePreviousSteps":["Complete previous steps to unlock this"],"accountScreen.verification.stepMenu.thisStepRequiresAdditionalInformation":["This step requires additional information"],"accountScreen.verification.steps.companyDocuments.title":["Company Documents"],"accountScreen.verification.steps.idVerification.title":["Corporate Persons"],"accountScreen.verification.streetName":["Street name"],"accountScreen.verification.suitability.title":["Suitability"],"accountScreen.verification.taxEntityType.activeNfeGovernment":["A Government Entity or Central Bank"],"accountScreen.verification.taxEntityType.activeNfeInternationalOrg":["An International Organisation (Governmental or Intergovernmental)"],"accountScreen.verification.taxEntityType.activeNfeOther":["Other active non-financial entity or Excluded Person"],"accountScreen.verification.taxEntityType.activeNfePubliclyTraded":["A corporation whose stock is regularly traded on an established securities market or an entity which is a related entity of such a corporation"],"accountScreen.verification.taxEntityType.depositoryInstitution":["Depository Institution, Custodial Institution or Specified Insurance Company"],"accountScreen.verification.taxEntityType.group.activeCrsCarf":["Active Non-Financial Entity/ Excluded Person"],"accountScreen.verification.taxEntityType.group.financialInstitution":["Financial Institution"],"accountScreen.verification.taxEntityType.group.passiveCrsCarf":["Passive Non-Financial Entity/ Excluded Person"],"accountScreen.verification.taxEntityType.investmentEntityManagedByOtherFi":["An Investment Entity managed by another Financial Institution"],"accountScreen.verification.taxEntityType.otherInvestmentEntity":["Other Investment Entity"],"accountScreen.verification.taxEntityType.passiveNfe":["Entity other than an Active Entity or an Excluded Person"],"accountScreen.verification.taxInformation.addMore":["Add more"],"accountScreen.verification.taxInformation.addressUsedForTax":["We will use the following residence address provided in Step 1 for tax reporting purposes: ",["street_name"]," ",["building_number"],["0"]," ",["city"],["1"],["2"]],"accountScreen.verification.taxInformation.declarationText":["I declare that all information indicated by me in this Tax Information form is, to the best of my knowledge and belief, true, correct, and complete.<0/><1/>I agree that if there is a change in circumstances that affects the information provided or causes it to become incorrect or incomplete, I will provide a new Tax Information form within 90 days of the change of circumstances.<2/><3/>I certify that I am the Individual Account Holder / Individual Customer identified above for all the account(s) to which this form relates.<4/><5/>I understand that information related to my Deribit account, including any information provided above, may be shared with regulators in the country where my account is maintained, as well as any country where I am a tax resident, in compliance with applicable law."],"accountScreen.verification.taxInformation.declarationTitle":["Declaration and signature"],"accountScreen.verification.taxInformation.description":["We are required to collect certain tax-related information to meet our regulatory obligations. Please complete the fields below."],"accountScreen.verification.taxInformation.personalInfoUsedForTax":["We will use the name and last name (",["first_name"]," ",["last_name"],") provided in Step 1 for tax reporting purposes to the relevant tax authorities."],"accountScreen.verification.taxInformation.saved":["Tax information has been saved successfully"],"accountScreen.verification.taxInformation.signatureCaption":["Last signed on ",["0"]],"accountScreen.verification.taxInformation.submitError":["Submission failed. Please try again later"],"accountScreen.verification.taxInformation.taxResidencyDescription":["Please provide information about your tax residency. You must add at least one country where you are a tax resident."],"accountScreen.verification.taxInformation.taxResidencyTitle":["Tax residency information"],"accountScreen.verification.taxInformation.title":["Tax information"],"accountScreen.verification.taxResidency":["Tax Residency"],"accountScreen.verification.tin":["Tax Identification Number (TIN)"],"accountScreen.verification.tinTooltip":["Tax Identification Number (TIN) is a unique number assigned to an individual or entity for tax purposes."],"accountScreen.verification.title":["Verification"],"accountScreen.verification.typeOfBusiness":["Type of the business"],"accountScreen.verification.typeOfBusinessDetail
2103s":["What is the other type of business?"],"accountScreen.verification.uboControllingPersonType.controlByOtherMeans":["Control by other means"],"accountScreen.verification.uboControllingPersonType.controlByOwnership":["Control by ownership"],"accountScreen.verification.uboControllingPersonType.legalArrangementBeneficiaryEquivalent":["Beneficiary equivalent"],"accountScreen.verification.uboControllingPersonType.legalArrangementOtherEquivalent":["Other equivalent"],"accountScreen.verification.uboControllingPersonType.legalArrangementProtectorEquivalent":["Protector equivalent"],"accountScreen.verification.uboControllingPersonType.legalArrangementSettlorEquivalent":["Settlor equivalent"],"accountScreen.verification.uboControllingPersonType.legalArrangementTrusteeEquivalent":["Trustee equivalent"],"accountScreen.verification.uboControllingPersonType.seniorManagingOfficial":["Senior managing official"],"accountScreen.verification.uboControllingPersonType.trustBeneficiary":["Beneficiary"],"accountScreen.verification.uboControllingPersonType.trustOther":["Other controlling cerson"],"accountScreen.verification.uboControllingPersonType.trustProtector":["Protector"],"accountScreen.verification.uboControllingPersonType.trustSettlor":["Settlor"],"accountScreen.verification.uboControllingPersonType.trustTrustee":["Trustee"],"accountScreen.verification.uboType.title":["Person Role(s)"],"accountScreen.verification.ukClientCategorization.portfolioProof.cash":["Cash"],"accountScreen.verification.ukClientCategorization.portfolioProof.cash.description":["Please upload a recent bank statement (not older than 3 months) showing your name, the issue date, the balance in your bank account, and the name/logo of the financial institution."],"accountScreen.verification.ukClientCategorization.portfolioProof.description":["Please select the applicable asset categories and upload documents demonstrating that the total value of your financial instrument portfolio exceeds EUR 500,000."],"accountScreen.verification.ukClientCategorization.portfolioProof.financialInstruments":["Financial Instruments"],"accountScreen.verification.ukClientCategorization.portfolioProof.financialInstruments.description":["Please upload a recent overview (not older than 3 months) of your stock portfolio, an account statement from your trading platform(s), or a similar supporting document. This document must clearly display your name, the issue date, the balance in your account, and the name/logo of the financial institution."],"accountScreen.verification.ukClientCategorization.portfolioProof.virtualAssets":["Cryptoassets"],"accountScreen.verification.ukClientCategorization.portfolioProof.virtualAssets.description":["Please upload a recent account statement (not older than 3 months) of your trading platform, wallet provider or custodian that shows the value of your cryptoassets. This document must clearly display your name, the issue date, the balance in your account, and the name/logo of the financial institution."],"accountScreen.verification.ukClientCategorization.portfolioProof.warning":["Ensure that each document clearly displays your name and/or email address, as well as the issue date."],"accountScreen.verification.ukClientCategorization.portfolioSize.prefilled":["We have pre-filled the answer based on the value of assets in your account"],"accountScreen.verification.ukClientCategorization.portfolioSize.question":["Do you hold a portfolio of financial instruments (including cash and cryptoassets) that exceeds EUR 500,000 (or equivalent)?"],"accountScreen.verification.ukClientCategorization.professionalExperience.question":["Do you work or have you worked in the financial sector for at least one year in a professional position which requires knowledge of leveraged financial instruments?"],"accountScreen.verification.ukClientCategorization.professionalExperienceProof.label":["Please upload documentation that shows that you have worked for at least 12 months in the financial sector for an authorised firm or a professional services firm in a relevant position and in relation to leveraged instruments"],"accountScreen.verification.ukClientCategorization.required.portfolioProof":["At least one proof of portfolio size is required"],"accountScreen.verification.ukClientCategorization.required.portfolioSize":["You must answer whether you hold a portfolio exceeding EUR 500,000"],"accountScreen.verification.ukClientCategorization.required.professionalExperience":["You must answer whether you have professional experience"],"accountScreen.verification.ukClientCategorization.required.professionalExperienceProof":["You must upload at least one proof of professional experience"],"accountScreen.verification.ukClientCategorization.required.sizableTrades":["You must answer whether you have conducted sizable trades"],"accountScreen.verification.ukClientCategorization.required.sizableTradesProof":["You must upload at least one proof of sizable trades"],"accountScreen.verification.ukClientCategorization.sizableTrades.prefilled":["We have pre-filled the answer based on your trading history"],"accountScreen.verification.ukClientCategorization.sizableTrades.prefilled.withCount":["We have pre-filled the answer based on your trading history. You have conducted ",["0"]," sizable trades (≥$25k) in your Deribit account."],"accountScreen.verification.ukClientCategorization.sizableTrades.question":["Have you conducted trades of significant size (min. notional value of USD 25,000) in leveraged financial instruments (e.g. options, futures and perpetuals) at an average frequency of 10 per quarter over the previous four quarters (i.e. 40 in total)?"],"accountScreen.verification.ukClientCategorization.sizableTradesProof.info":["Acceptable documents include trading statements or recent transaction history from a trading platform. Please make sure that the document clearly states your name, the type of instruments traded, the notional value of the trades, and the date of the trades."],"accountScreen.verification.ukClientCategorization.sizableTradesProof.label":["Please upload one or more documents demonstrating you have conducted a minimum of 40 transactions in leveraged financial instruments with a notional value of at least USD 25,000 over the previous four quarters."],"accountScreen.verification.vaSourceOfFunds.corporate.airdropsForks":["Airdrops / Forks"],"accountScreen.verification.vaSourceOfFunds.corporate.clientFundsInVa":["Client funds paid in virtual assets"],"accountScreen.verification.vaSourceOfFunds.corporate.companyProfitInVa":["Profit of the company in the form of virtual assets"],"accountScreen.verification.vaSourceOfFunds.corporate.equityInvestmentsInVa":["Equity investments received in virtual assets (funding from investors)"],"accountScreen.verification.vaSourceOfFunds.corporate.loanInVa":["Loan paid in virtual assets"],"accountScreen.verification.vaSourceOfFunds.corporate.mining":["Mining"],"accountScreen.verification.vaSourceOfFunds.corporate.other":["Other (please specify)"],"accountScreen.verification.vaSourceOfFunds.corporate.purchasedViaExchange":["Purchased using fiat currency via exchange/broker"],"accountScreen.verification.vaSourceOfFunds.corporate.saleOfSharesInVa":["Sale of shares or other investments paid in virtual assets"],"accountScreen.verification.vaSourceOfFunds.corporate.stakingYieldRewards":["Staking / Yield / Rewards"],"accountScreen.verification.vaSourceOfFunds.individual.airdropsForks":["Airdrops / Forks"],"accountScreen.verification.vaSourceOfFunds.individual.companyProfitsInVa":["Company profits/dividend paid in virtual assets"],"accountScreen.verification.vaSourceOfFunds.individual.companySaleInVa":["Company sale paid in virtual assets"],"accountScreen.verification.vaSourceOfFunds.individual.giftDonationsInVa":["Gift / Donations paid in virtual assets"],"accountScreen.verification.vaSourceOfFunds.individual.inheritanceInVa":["Inheritance paid in virtual assets"],"accountScreen.verification.vaSourceOfFunds.individual.loanInVa":["Loan paid in virtual assets"],"accountScreen.verification.vaSourceOfFunds.individual.mining":["Mining"],"accountScreen.verification.vaSourceOfFunds.individual.other":["Other (please specify)"],"accountScreen.verification.vaSourceOfFunds.individual.propertySaleInVa":["Property sale paid in virtual assets"],"accountScreen.verification.vaSourceOfFunds.individual.purchasedViaExchange":["Purchased using fiat currency via exchange/broker"],"accountScreen.verification.vaSourceOfFunds.individual.salaryInVa":["Salary / Compensation paid in virtual assets"],"accountScreen.verification.vaSourceOfFunds.individual.saleOfSharesInVa":["Sale of shares or other investments paid in virtual assets"],"accountScreen.verification.vaSourceOfFunds.individual.stakingYieldRewards":["Staking / Yield / Rewards"],"accountScreen.verification.vaSourceOfFunds.individual.tradingGains":["Virtual Assets trading gains"],"accountScreen.verification.vaSourceOfFunds.walletType.hosted":["Hosted wallet (another Virtual Asset Service Provider, such as an exchange or broker)"],"accountScreen.verification.vaSourceOfFunds.walletType.unhosted":["Unhosted wallet (self-custody wallet where the private keys are controlled by the owner)"],"accountScreen.verification.verificationError.cameraNotAvailable":["Camera is not available, please choose the upload option and try again."],"accountScreen.verification.verificationError.verificationProblem":["Something went wrong, if you have already finished the verification process, please wait until the processing is done, otherwise, please try again."],"accountScreen.verification.verificationError.verificationSessionProblem":["Something is wrong with your verification session, if you have already finished the verification process, please wait until the processing is done, otherwise, please try again."],"accountScreen.verification.verificationSuccess.ubo":["The verification of the ID is in progress. This can take several minutes."],"accountScreen.verification.verificationSuccess.user":["The verification of your ID document is in progress. Please wait a few minutes. You may close this tab. The status of your ID verification will be updated automatically in the menu Verification."],"accountScreen.verification.yes":["Yes"],"accountScreen.wallet.actions":["Actions"],"accountScreen.wallet.assets":["Assets"],"accountScreen.wallet.buy":["Buy"],"accountScreen.wallet.coin":["Coin"],"accountScreen.wallet.custody":["Custody"],"accountScreen.wallet.deposit":["Deposit"],"accountScreen.wallet.equity":["Equity"],"accountScreen.wallet.externalEquity":["External Equity"],"accountScreen.wallet.impliedEquity":["Implied Equity"],"accountScreen.wallet.informationMissingFromDeposit":["Information missing from deposit(s). Please add the information below."],"accountScreen.wallet.nonWhitelistedAddress":["Not Whitelisted"],"accountScreen.wallet.rewards.accumulatedRew
2103ard":["Accumulated rewards"],"accountScreen.wallet.rewards.dailyEligibleEquity":["Daily eligible equity"],"accountScreen.wallet.rewards.exportCsv":["Export to CSV"],"accountScreen.wallet.rewards.history":["Rewards History"],"accountScreen.wallet.rewards.notEligible":["This account is not eligible for rewards."],"accountScreen.wallet.rewards.paid":["Paid"],"accountScreen.wallet.rewards.title":["Rewards"],"accountScreen.wallet.rewards.toBePaid":["To be paid"],"accountScreen.wallet.rewards.total":["Total rewards"],"accountScreen.wallet.totalAccountValue":["Total Account Value"],"accountScreen.wallet.trade":["Trade"],"accountScreen.wallet.transfer":["Transfer"],"accountScreen.wallet.unknownWhitelisting":["Unknown"],"accountScreen.wallet.whitelistStatus":["Whitelist Status"],"accountScreen.wallet.whitelistStatusRefresh":["Click to refresh the whitelist status"],"accountScreen.wallet.whitelistedAddress":["Whitelisted"],"accountScreen.wallet.whitelistingCheckFailure":["We could not check if one or more addresses are whitelisted. Please try again later."],"accountScreen.wallet.withdraw":["Withdraw"],"accountScreen.wallet.withdraw.downloadCsvForAllCurrencies":["Download CSV for all currencies"],"accountScreen.wallet.withdraw.downloadCsvPartialFailure":["We couldn't load the address book for the following currencies: ",["0"]],"accountScreen.wallet.withdraw.infoRequired":["Additional info needs to be provided in order to enable withdrawals for this address. Click to provide the required info."],"accountScreen.wallet.withdraw.provideInfo.verificationRequired":["Please complete your verification in order to provide info for this withdrawal address."],"accountScreen.wallet.withdraw.refresh ":["Check address whitelisting"],"accountScreen.wallet.withdraw.verificationRequired":["Please complete your verification in order to generate a withdrawal address."],"accountScreen.withdraw.actions":["Actions"],"accountScreen.withdraw.addNewProvider":["Add \\"",["providerName"],"\\" provider"],"accountScreen.withdraw.addressIsAwaitingAdminConfirmation":["The address is awaiting admin confirmation."],"accountScreen.withdraw.addressMustBeEthereumAddress":["This address must be an Ethereum (ERC20) address."],"accountScreen.withdraw.allErc20Currencies":["All ERC20 currencies"],"accountScreen.withdraw.amount":["Amount"],"accountScreen.withdraw.amountCorrectedToMaxPossible":["Amount corrected to the maximum possible withdrawal"],"accountScreen.withdraw.areYouSureThatYouWantToCancelThisWithdrawal":["Are you sure you want to cancel this withdrawal?"],"accountScreen.withdraw.awaitingConfirmation":["Awaiting your confirmation"],"accountScreen.withdraw.awaitingSecondEmail":["Confirm from your second email"],"accountScreen.withdraw.blockchainAddress":["Blockchain Address"],"accountScreen.withdraw.cancelWithdrawal":["Cancel Withdrawal"],"accountScreen.withdraw.coinbase.account":["Account"],"accountScreen.withdraw.coinbase.accountLocation":["Account location"],"accountScreen.withdraw.coinbase.country":["Country"],"accountScreen.withdraw.coinbase.entityType.individual":["Individual"],"accountScreen.withdraw.coinbase.entityType.organization":["Organization"],"accountScreen.withdraw.coinbase.entityType.question":["Is the owner an individual or an organization?"],"accountScreen.withdraw.coinbase.isSelf.originatorQuestion":["Does the originator address belong to you?"],"accountScreen.withdraw.coinbase.isSelf.question":["Does this address belong to you?"],"accountScreen.withdraw.coinbase.name":["Full name"],"accountScreen.withdraw.coinbase.organizationName":["Organization name"],"accountScreen.withdraw.coinbase.provideOriginatorInfo":["Provide originator info"],"accountScreen.withdraw.coinbase.walletType.exchange":["Exchange (VASP)"],"accountScreen.withdraw.coinbase.walletType.originatorQuestion":["Is the originator address a self-hosted wallet or an exchange (VASP)?"],"accountScreen.withdraw.coinbase.walletType.question":["Is the destination a self-hosted wallet or an exchange (VASP)?"],"accountScreen.withdraw.coinbase.walletType.selfHosted":["Self-hosted wallet"],"accountScreen.withdraw.confirm":["I hereby declare that the information given above is true and accurate, and that I agree that Deribit may share this information with third parties for regulatory purposes"],"accountScreen.withdraw.currentSessionProfits":["Current Session Profits"],"accountScreen.withdraw.days":["Days"],"accountScreen.withdraw.destinationTag":["De
2103stination Tag"],"accountScreen.withdraw.disableEmailConfirmationsOnWithdrawalsToAddress":["Disable e-mail confirmations on ",["currency"]," withdrawals to address ",["address"]],"accountScreen.withdraw.estimatedFee":["Estimated fee"],"accountScreen.withdraw.extraCurrencies":["Extra Currencies"],"accountScreen.withdraw.fee":["Fee"],"accountScreen.withdraw.feeBeforeSubsidy":["Fee before subsidy"],"accountScreen.withdraw.goToDeposit":["Go to Deposit"],"accountScreen.withdraw.isHosted.privateWallet":["Private wallet"],"accountScreen.withdraw.isHosted.question":["Is this address from a private (unhosted) wallet, or from a Virtual Asset Service Provider (VASP), e.g. an exchange?"],"accountScreen.withdraw.isHosted.vasp":["VASP"],"accountScreen.withdraw.label":["Label"],"accountScreen.withdraw.lockedBalanceTooltip":["We have locked ",["0"]," ",["currency"]," from your withdrawable balance because some deposits you made are being processed or are missing info about transaction originator"],"accountScreen.withdraw.max":["Max"],"accountScreen.withdraw.mustAgreeToSharingInformation":["You must agree that Deribit may share this information with third parties for regulatory purposes"],"accountScreen.withdraw.network":["Network"],"accountScreen.withdraw.noAccess":["Not available for subaccounts"],"accountScreen.withdraw.personal.question":["Are you the beneficiary of this address?"],"accountScreen.withdraw.pleaseGoToYourDepositPageToFixTheIssue":["Please go to your Deposit page to fix the issue."],"accountScreen.withdraw.priority":["Priority"],"accountScreen.withdraw.processing":["Processing"],"accountScreen.withdraw.recipientAddress":["Recipient's Address"],"accountScreen.withdraw.removeSecondaryEmail":["Remove Email"],"accountScreen.withdraw.resultingBalance":["Resulting Balance"],"accountScreen.withdraw.sanctionsWarning":["Do not make withdrawals, directly or indirectly, to sanctioned individuals or entities designated by the UAE, the UN, or OFAC, or to wallet addresses operated by exchanges located in sanctioned jurisdictions, including Belarus, Iran, North Korea, Russia, and Syria. Violations may result in frozen assets and/or account termination."],"accountScreen.withdraw.sanctionsWarningHtx":["Do not withdraw ",["currency"]," to addresses linked to HTX, as HTX has recently been sanctioned. Such withdrawals will be rejected."],"accountScreen.withdraw.secondaryEmailConfirmation":["Secondary Email Confirmation"],"accountScreen.withdraw.secondaryEmailConfirmation.invalidEmail":["Invalid email address. Your main account's address or its alias are not allowed."],"accountScreen.withdraw.secondaryEmailConfirmation.noAccess":["If you don't have access to your email you need to contact <0>[email protected]</0>"],"accountScreen.withdraw.secondaryEmailConfirmation.removingConfirmationSentToPrimaryAndSecondaryEmails":["To complete removing your secondary email, please use the links we sent you to your current account email and to your secondary confirmation email."],"accountScreen.withdraw.secondaryEmailConfirmation.removingConfirmationSentToPrimaryEmail":["To complete removing the secondary confirmation email, please use the link that was sent to the primary email."],"accountScreen.withdraw.secondaryEmailConfirmation.removingConfirmationSentToSecondaryEmail":["To complete removing the secondary confirmation email, please use the link that was sent to the secondary email."],"accountScreen.withdraw.secondaryEmailConfirmation.settingConfirmationSentToPrimaryAndSecondaryEmails":["To complete setting your secondary email <0>",["secondary_email"],"</0>, please use the links we sent you to your current account email and to your secondary confirmation email."],"accountScreen.withdraw.secondaryEmailConfirmation.settingConfirmationSentToPrimaryEmail":["To complete setting the secondary confirmation email <0>",["secondary_email"],"</0>, please use the link that was sent to the primary email."],"accountScreen.withdraw.secondaryEmailConfirmation.settingConfirmationSentToSecondaryEmail":["To complete setting the secondary confirmation email <0>",["secondary_email"],"</0>, please use the link that was sent to the secondary email."],"accountScreen.withdraw.setSecondaryEmail":["Set Email"],"accountScreen.withdraw.status":["Status"],"accountScreen.withdraw.tag":["Tag (optional)"],"accountScreen.withdraw.transactionFee":["Transaction Fee"],"accountScreen.withdraw.txInfo":["Tx Info"],"accountScreen.withdraw.unconfirmed":["Unconfirmed (confirm in email)"],"accountScreen.withdraw.unknown":["Unknown"],"accountScreen.withdraw.updateAddressInfo":["Update address info"],"accountScreen.withdraw.updateInfo":["Update info"],"accountScreen.withdraw.updatedAt":["Updated at:"],"accountScreen.withdraw.usycAddressNotWhitelisted":["Error: you can withdraw USYC only to whitelisted address. For more information on how to whitelist an address with Hashnote, see here: <0>https://usyc.hashnote.com/</0>"],"accountScreen.withdraw.usycWhitelistWarning":["For withdrawals of USYC, the destination address has to be whitelisted with Hashnote directly. Absence of whitelisting with Hashnote will result in the rejection of the withdrawal operation. For more information see <0>https://usyc.docs.hashnote.com/overview/investor-onboarding</0>"],"accountScreen.withdraw.vasp":["VASP"],"accountScreen.withdraw.vasp.helpText":["Choose a VASP from the list. If the VASP is not in the list, please select 'Other'."],"accountScreen.withdraw.vasp.name":["VASP name"],"accountScreen.withdraw.vasp.website":["VASP website"],"accountScreen.withdraw.withdrawButton":["Withdraw"],"accountScreen.withdraw.withdrawableBalanceIsAdjustedDueToMissingInformation":["Your withdrawable balance is adjusted due to missing information from\\nyour deposit(s)."],"accountScreen.withdraw.withdrawalCancellation":["Withdrawal Cancellation"],"accountScreen.withdraw.withdrawalDelayDescription":["Transfers to any newly added withdrawal address will be possible only after this minimum period has passed. If the time value is reduced after the initial confirmation, it will only come into effect after the time of the primary setting has passed. If the minimum is set at zero, newly added addresses are active in 2 hours. If the minimum is set at two days, new addresses can only be used in 2 days, thereby creating a security time buffer in case the account is compromised. In case you have a custody wallet account, withdrawal delay is set by your wallet provider."],"accountScreen.withdraw.withdrawalDelayLabel":["The number of days (min 0, max 60 days), after which withdrawals to new addresses become active."],"accountScreen.withdraw.withdrawalDelayRangeErrorMessage":["The value must be between 0 and 60 days"],"accountScreen.withdraw.withdrawalDelaySettingChanged":["The first withdrawal delay 
2103setting has been changed."],"accountScreen.withdraw.withdrawalDelayZeroInfo":["Please note: Setting the new address activation delay to '0 Days' does not mean withdrawals will be instant. Using a delay of zero is less secure, and so withdrawals may be subject to extra manual checks before they are sent. We recommend setting a delay of 3 days or more, and adding at least one safe address ahead of time to avoid any unwanted delays. Users are free to add more than one address."],"accountScreen.withdraw.withdrawalDetails":["Withdrawal details"],"accountScreen.withdraw.withdrawalHistory":["Withdrawal History"],"accountScreen.withdraw.withdrawalInfo":["The withdrawal has been initiated. Check your mailbox to confirm."],"accountScreen.withdraw.withdrawalSettingsExternalAddresses":["Withdrawal settings external addresses and internal transfers"],"accountScreen.withdraw.withdrawalWithoutConfirmationInfo":["The withdrawal has been initiated."],"accountScreen.withdraw.withdrawalWouldCrossDailyLimit":["Withdrawal would cross the daily limit ",["dailyLimit"]," ",["currency"],", current withdrawals ",["currentWithdrawals"]," ",["currency"],"."],"accountScreen.withdraw.withdrawalsDelaySettingWillChange":["The first withdrawals delay setting will change from ",["from"]," to ",["to"]," days ",["withdrawalActivationTime"]],"accountScreen.withdraw.withdrawalsTemporarilyUnavailable":["Withdrawals are temporarily unavailable."],"accountScreen.withdraw.xAddressHelper":["We support both address formats (<0>https://xrpaddress.info</0>)"],"accountScreen.withdraw.youWillGet":["You Will Get"],"accountScreen.withdraw.yourRequestToWithdrawHasBeenConfirmed":["Your request to withdraw has been confirmed"],"accountScreen.withdraw.yourWithdrawalRequestHasBeenCancelled":["Your withdrawal request has been cancelled"],"acountScreen.security.securityKeys.noKeyAdded":["You have no Security Key added."],"appAuthorizationScreen.consentForm.applicationRequiresAccessToTheFollowingScopes":["Application requires access to the following scopes*:"],"appAuthorizationScreen.consentForm.applicationWillBeAbleToAccessYourSubaccounts":["Application will be able to access your subaccounts when it is granted access to the main account."],"appAuthorizationScreen.consentForm.authorizeApplication":["Authorize application"],"appAuthorizationScreen.consentForm.clickToUseDifferentAccount":["Click ",["linkToLoginForm"],", if you want to use a different account."],"appAuthorizationScreen.consentForm.existingApplicationApiKeyIsDisabled":["Existing application API key is disabled, see \\"Authorized applications\\" in \\"Api\\" tab of your account"],"appAuthorizationScreen.consentForm.invalidOrMalformedScope":["Invalid or malformed scope"],"appAuthorizationScreen.consentForm.moreInformationAboutAccessScopes":["*More information about access scopes can be found in our ",["linkToAccessScopeDocumentation"]],"appAuthorizationScreen.consentForm.note":["NOTE:"],"blockTrade.roleInTrade.setYourRole":["Set a role in the block trade"],"blockTrade.roleInTrade.yourRole":["Your role in the block trade"],"blockTrade.strategy.markPriceOfCombo":["Mark Price of Combo"],"blockTrade.strategy.markPriceUsedRefTooltip":["Whenever 'Ref price' input is empty, the current underlying price is used to calculate the combo mark price."],"blockTrade.strategy.refPrice":["Ref price"],"combos.comboDescription.callCalendarSpread":["A calendar spread is usually done to take an opinion on the forward volatility curve and also consequently takes an opinion on the basis between the expiries. Buying the Call Calendar involves buying a call in an expiry and selling a call in a closer expiry with the same strike."],"combos.comboDescription.callDiagonalSpread":["A diagonal calendar spread is usually done to take an opinion on the forward volatility curve but also on mispricings in the smile. Buying the strategy involves buying a call in an expiry and selling a call in a closer expiry with a different strike."],"combos.comboDescription.callRatio1X2Spread":["Buying this call ratio involves buying the lower strike call and selling 2 times the higher strike call. It is bullish for small moves up but is losing for large moves up. One advantage is the paid premium from the long call is reduced from the short and can even result in premium received,"],"combos.comboDescription.callRatio1X3Spread":["Buying this call ratio involves buying the lower strike call and selling 3 times the higher strike call. It is bullish for small moves up but is losing for large moves up. One advantage is the paid premium from the long call is reduced from the short and is even most likely premium received but with the greater r
2103isk of losing on large upside moves"],"combos.comboDescription.callRatio2X3Spread":["'Buying this call ratio involves buying 2 times lower strike call and selling 3 times the higher strike call (Effectively equivalent to the call ratio 1x1.5). It is bullish for small moves up but is losing for large moves up. One advantage is the paid premium from the long call is reduced from the short and can even result in premium received',"],"combos.comboDescription.callSpread":["A call spread involves buying and selling a call with different strikes within the same expiry. Buying a call spread is a bullish strategy but unlike buying a call outright, it requires a payment of less premium which comes with limiting the upside potential gain, hence buying a call spread is good for when a moderate price gain is expected."],"combos.comboDescription.diagonalStraddleCalendar":["A straddle calendar is usually done to take an opinion on the forward volatility curve and mispricings along the smile curve. Buying the Straddle Calendar involves buying a straddle (call and put with same strike) in an expiry and selling the straddle in a closer expiry with the same strikes."],"combos.comboDescription.futureSpread":["Buying a future and simultaneously selling a future with a different expiry. This strategy is often used when rolling risk, reducing synthetic risk, trading discrepancies in the forward curve or capturing yield,"],"combos.comboDescription.noDescription":["No description for this Combo type."],"combos.comboDescription.putCalendarSpread":["'A calendar spread is usually done to take an opinion on the forward volatility curve and also consequently takes an opinion on the basis between the expiries. Buying the Put Calendar involves buying a put in an expiry and selling a put in a closer expiry with the same strike',"],"combos.comboDescription.putDiagonalSpread":["A diagonal calendar spread is usually done to take an opinion on the forward volatility curve but also on mispricings in the smile. Buying the strategy involves buying a put in an expiry and selling a put in a closer expiry with a different strike."],"combos.comboDescription.putRatio1X2Spread":["Buying this put ratio involves buying the higher strike put and selling 2 times the lower strike put. It is bearish for small moves down but is losing for large moves down. One advantage is the paid premium from the long put is reduced from the short and can even result in premium received."],"combos.comboDescription.putRatio1X3Spread":["Buying this put ratio involves buying the higher strike put and selling 3 times the lower strike put. It is bearish for small moves down but is losing for large moves down. One advantage is the paid premium from the long put is reduced from the short and can even result in premium received and is even most likely premium received but with the greater risk of losing on large downside moves."],"combos.comboDescription.putRatio2X3Spread":["Buying this put ratio involves buying 2 times the higher strike put and selling 3 times the lower strike put. It is bearish for small moves down but is losing for large moves down. One advantage is the paid premium from the long put is reduced from the short and can even result in premium received."],"combos.comboDescription.putSpread":["A put spread involves buying and selling a put with different strikes within the same expiry. Buying a put spread is a bearish strategy but unlike buying a put outright, it requires a payment of less premium which comes with limiting the upside potential gain, hence buying a put spread is good for when a moderate price reduction is expected."],"combos.comboDescription.riskReversal":["This involves buying or selling an out-the-money put whilst trading an out-the-money call in the other direction. Buying the risk reversal is bullish on Put-Call skew."],"combos.comboDescription.riskReversalITM":["This involves buying or selling an in-the-money call whilst trading an in-the-money put in the other direction. Buying the risk reversal is bullish on Put-Call skew."],"combos.comboDescription.straddle":["A volatility trade, with buying a call and a put on the same strike. Buying the strategy is bullish on volatility and requires sufficient deviation up or down to recover the premium paid."],"combos.comboDescription.straddleC
2103alendar":["A straddle calendar is usually done to take an opinion on the forward volatility curve. Buying the Straddle Calendar involves buying a straddle (call and put with same strike) in an expiry and selling the straddle in a closer expiry with the same strikes."],"combos.comboDescription.strangle":["A volatility trade, with buying a call on a higher strike and a put on the lower strike. Buying the strategy is bullish on volatility and requires sufficient deviation up or down to recover the premium paid."],"combos.comboDescription.strangleITM":["A volatility trade, with buying a call on a lower strike and a put on the higher strike. Buying the strategy is bullish on volatility and requires sufficient deviation up or down to recover the premium paid."],"combos.common.amount":["Amount"],"combos.common.ask":["Ask"],"combos.common.bid":["Bid"],"combos.common.delta":["Delta"],"combos.common.expiry":["Expiry"],"combos.common.filter":["Filter"],"combos.common.filter.clear":["Clear filter"],"combos.common.implied":["Implied"],"combos.common.indexPrice":["Index Price"],"combos.common.instrument":["Instrument"],"combos.common.legDetails":["Leg Details"],"combos.common.mark":["Mark"],"combos.common.netDelta":["Net Delta"],"combos.common.pnl":["PNL"],"combos.common.strike":["Strike"],"combos.common.theta":["Theta"],"combos.common.type":["Type"],"combos.common.vega":["Vega"],"combos.createCombo.combosThatMatch":["Combos that match."],"combos.createCombo.pnlChart":["PNL Chart"],"combos.createCombo.selectStrategy":["Select strategy"],"combos.tooltips.actualAskPrice":["actual ask price."],"combos.tooltips.actualBidPrice":["Actual bid price."],"combos.tooltips.grayColor":["Gray colour:"],"combos.tooltips.greenColor":["Green colour:"],"combos.tooltips.indicativePrice":["This is the indicative price you can trade this Combo at in the individual legs."],"combos.tooltips.redColor":["Red colour:"],"common.appForceUpdate.newVersionAvailable":["New version is available! Please refresh the page to see all updates."],"common.banners.twoFaBanner.actions.proceed":["Finish 2FA Process"],"common.banners.twoFaBanner.description":["You will not be able to generate new deposit address without Two-Factor Authentication enabled"],"common.banners.twoFaBanner.title":["Please finish the Two-Factor Authentication to make your account secure"],"common.banners.verification.additionalInfo.actions.verify":["Provide missing info"],"common.banners.verification.additionalInfo.menu.description":["Please review the email we have sent to you."],"common.banners.verification.additionalInfo.menu.title":["Additional info required"],"common.banners.verification.icRefresh.dubaiEligibleForPanama.actions.goToInvestorClassificationStep":["Go to Investor Classification step"],"common.banners.verification.icRefresh.dubaiEligibleForPanama.menu.description":["You will be classified as a Retail Investor on 1 August 2025 and we will transfer your account back to DRB Panama Inc"],"common.banners.verification.icRefresh.dubaiEligibleForPanama.menu.title":["Transfer to DRB Panama"],"common.banners.verification.icRefresh.dubaiEligibleForPanama.topBar.description":["You will be classified as a Retail Investor on 1 August 2025. We will transfer your account back to DRB Panama Inc., our broker that executes orders on Deribit Dubai, so you will still be able to trade the same products with the same fees and leverage limits. Your positions will not be affected."],"common.banners.verification.icRefresh.dubaiEligibleForPanama.topBar.title":["Transfer to DRB Panama"],"common.banners.verification.icRefresh.dubaiNotEligibleForPanama.actions.goToInvestorClassificationStep":["Go to Investor Classification step"],"common.banners.verification.icRefresh.dubaiNotEligibleForPanama.menu.title":["Retail Investor Classification & Spot-Only"],"common.banners.verification.icRefresh.dubaiNotEligibleForPanama.topBar.description":["You will be classified as a Retail Investor and your account will be changed to Spot-Only on 1 August 2025. This means you will no longer be able to trade our derivatives contracts (perpetuals, futures, options)."],"common.banners.verification.icRefresh.dubaiNotEligibleForPanama.topBar.title":["Retail Investor Classification & Spot-Only"],"common.banners.verification.icRefresh.panamaClients.actions.goToInvestorClassificationStep":["Go to Investor Classification step"],"common.banners.verification.icRefresh.panamaClients.menu.description":["You will be classified as a Retail Investor on 1 August 2025. You will still be able to trade the same products with the same fees and leverage limits"],"common.banners.verification.icRefresh.panamaClients.menu.title":["Retail Investor Classification"],"common.banners.verification.icRefresh.panamaClients.topBar.description":["You will be classified as a Retail Investor on 1 August 2025. You will still be able to trade the same products with the same fees and leverage limits."],"common.banners.verification.icRefresh.panamaClients.topBar.title":["Retail Investor Classification"],"common.banners.verification.icRefresh.qiClients.actions.finishNow":["Finish now"],"common.banners.verification.icRefresh.qiClients.menu.description":["Please complete the new questions to avoid potential trading restrictions"],"common.banners.verification.icRefresh.qiClients.menu.title":["Investor Classification Refresh"],"common.banners.verification.icRefresh.qiClients.topBar.description":["The investor classification criteria have been updated. Please complete the new questions to avoid potential trading restrictions."],"common.banners.verification.icRefresh.qiClients.topBar.title":["Complete Investor Classification Refresh"],"common.banners.verification.idRefresh.actions.verify":["Provide ID"],"common.banners.verification.idRefresh.menu.description":["Provide a new ID to avoid restrictions"],"common.banners.verification.idRefresh.menu.title":["Your ID is (almost) expired"],"common.banners.verification.idRefresh.topBar.description":["Please provide your new ID in order to avoid trading restrictions for your account."],"common.banners.verification.idRefresh.topBar.title":["Your ID is (almost) expired"],"common.banners.verification.kycBanner.actions.finishNow":["Finish KYC Now"],"common.banners.verification.kycBanner.menu.description":["Verified KYC is mandatory for trading"],"common.banners.verification.kycBanner.menu.title":["KYC is not completed"],"common.banners.verification.kycRefresh.menu.description":["Complete KYC refresh to avoid restrictions"],"common.banners.verification.kycRefresh.menu.title":["KYC Refresh Required"],"common.banners.verificationState.pending.description":["Please complete the verification process, so you can make deposits and start trading. You are required to provide us with accurate and up-to-date information."],"common.banners.verificationState.pending.title":["Finish the KYC to have full access to your account features"],"common.banners.verificationState.pendingAdditionalInfo.description":["We have sent you an email in which we request you to provide additional information for the verification of your account. Please check your email for the details. You can add the missing information in the verification form. You are required to provide us with accurate and up-to-date information.",["0"]," ",["contactUs"]],"common.banners.verificationState.pendingAdditionalInfo.title":["Additional information required for the verification of your account"],"common.banners.verificationState.pendingKycRefresh.description":["Please confirm whether the KYC information is accurate and up to date, and upload the most recent versions of the required documents. You are required to provide us with accurate and up-to-date information.",["0"]," ",["contactUs"]],"common.banners.verificationState.pendingKycRefresh.title":["Complete the KYC Refresh to avoid trading restrictions"],"common.banners.verificationState.rejected.title":["Your account has been rejected. Please check your email for more details"],"common.banners.verificationState.review.title":["Thank you for completing the steps in the verification form"],"common.banners.verificationState.success.corporate.title":["The status of your corporate account is Verified"],"common.banners.verificationState.success.individual.title":["The status of your individual account is Verified"],"common.commonScreen.cancel":["Cancel"],"common.commonScreen.cookiesConsentMessage":["This website uses co
2103okies to ensure you get the best experience on our website."],"common.commonScreen.deleting":["Deleting..."],"common.commonScreen.error":["Error"],"common.commonScreen.learnMore":["Learn more"],"common.commonScreen.uploading":["Uploading..."],"common.country":["Country"],"common.disabled":["Disabled"],"common.enabled":["Enabled"],"common.oAuthError.authenticationCanceled":["Authentication cancelled by user. Please restart the process if you’d like to sign in."],"common.oAuthError.noAccountFound":["No account found for this email. You may need to register first."],"common.oAuthError.noAccountFoundCoinbase":["No account found. You may need to migrate your account first."],"common.oAuthError.oAuthDisabled":["You have disabled ",["0"]," login for your account. You can log in with your password or reset it using the Forgot your password form."],"common.order.iceberg":["Iceberg"],"common.order.liquidation":["Liquidation"],"common.order.mobile":["Mobile"],"common.order.post":["Post"],"common.order.queued":["Queued"],"common.order.quote":["Quote"],"common.order.rebalance":["Rebalance"],"common.order.reduce":["Reduce"],"common.order.riskReducing":["Risk Reducing"],"common.order.starbase":["Starbase"],"common.remove":["Remove"],"common.tags.currency.cross.tooltip":["Currencies that can be used in Cross Collateral to increase USD equity"],"common.tags.currency.offset.tooltip":["Currencies that can be used in Cross Collateral to offset the upside risk of instruments in the same base currency. Offset coins DO NOT increase account's USD equity."],"common.tags.currency.partialCross.tooltip":["Currencies that can be used in Cross Collateral, up to a certain limit, to increase USD equity"],"commonScreen.accountSwitcher.searchByUid":["Search by UID"],"commonScreen.alert.disabledInstrumentKind.message":[["disabledProductsString"]," are disabled for trading on your account."],"commonScreen.alert.mmpTriggered.blockRfqTradeCountLimit":["Time left until Block RFQ trade count limit will be reset: ",["formattedTime"],"."],"commonScreen.alert.mmpTriggered.main":["The MMP (",["mmpGroup"]," group) has been triggered and your operations are frozen."],"commonScreen.alert.mmpTriggered.timeLeftUntilBlockRfqIndexWillBeUnfrozen":["Time left until index ",["indexName"]," for Block RFQ will be unfrozen: ",["formattedTime"],"."],"commonScreen.alert.mmpTriggered.timeLeftUntilIndexWillBeUnfrozen":["Time left until index ",["indexName"]," will be unfrozen: ",["formattedTime"],"."],"commonScreen.alert.security.main1":["Increase the security level of your account."],"commonScreen.alert.security.main2":["We recommend that you ",["0"],["1"],["2"],"."],"commonScreen.alert.security.tfa":["Enable Two-Factor Authentication"],"commonScreen.alert.security.withdrawalsDelay":["Increase the delay which is applied to newly added withdrawal addresses before they become available"],"commonScreen.announcements.hide":["Hide"],"commonScreen.announcements.markAllAsRead":["Mark all as read"],"commonScreen.announcements.markAsRead":["Mark as read"],"commonScreen.announcements.noNewAnnouncements":["You have no new announcements"],"commonScreen.announcements.title":["Announcements"],"commonScreen.appForceUpdate.refresh":["Refresh"],"commonScreen.browserTags.blockRfq":["Block RFQs"],"commonScreen.browserTags.blocktrading":["Blocktrading"],"commonScreen.browserTags.brokerage":["Brokerage"],"commonScreen.browserTags.defaultTitle":["Crypto Options and Futures Exchange"],"commonScreen.browserTags.futuresSpreadsMatrix":["Futures Spreads Matrix"],"commonScreen.browserTags.optionWizard":["Option Wizard"],"commonScreen.browserTags.optionsTrading":["Options Trading"],"commonScreen.buyCryptoMessages.cancelled":["You have cancelled your order with ",["provider"],". If something went wrong, please contact ",["provider"]," support. Your Order ID is ",["orderId"]],"commonScreen.buyCryptoMessages.declined":["Your payment has been declined by an external payment system. If something went wrong, please contact ",["provider"]," support. Your Order ID is ",["orderId"]],"commonScreen.buyCryptoMessages.expired":["Your order with ",["provider"]," has expired. If something went wrong, please contact ",["provider"]," support. Your Order ID is ",["orderId"]],"commonScreen.buyCryptoMessages.paymentReceived":[["provider"]," has received your payment. The order is being verified and processed."],"commonScreen.buyCryptoMessages.pe
2103ndingPayment":["Your order with ",["provider"]," is in progress."],"commonScreen.buyCryptoMessages.success":["Your order with ",["provider"]," has been completed. You can view the transaction on"],"commonScreen.buyCryptoMessages.tag.order":["Order"],"commonScreen.buyCryptoMessages.waitingPayment":["You have paid for your order. ",["provider"]," is waiting for final confirmation from the payment system."],"commonScreen.closeOutMargin":["Close out Margin Ratio"],"commonScreen.closeOutMargin.description":["Close out Margin Ratio = Close out Margin / Margin Balance. A value greater than or equal to 100% means your account reached the Liquidity Service Program, Deribit will liquidate your positions outside of the order book"],"commonScreen.common.24hChange":["24h Change"],"commonScreen.common.24hHigh":["24h High"],"commonScreen.common.24hLow":["24h Low"],"commonScreen.common.24hVolume":["24h Volume"],"commonScreen.common.CSV":["CSV"],"commonScreen.common.PNL":["PNL"],"commonScreen.common.abbreviated.closeOutMargin":["CoM"],"commonScreen.common.abbreviated.closeOutMarginProjected":["CoM (Projected)"],"commonScreen.common.abbreviated.closePosition":["Close"],"commonScreen.common.abbreviated.dollarPremium":["$ Premium"],"commonScreen.common.abbreviated.indexPrice":["Index"],"commonScreen.common.abbreviated.initialMargin":["IM"],"commonScreen.common.abbreviated.initialMarginProjected":["IM (Projected)"],"commonScreen.common.abbreviated.maintenanceMargin":["MM"],"commonScreen.common.abbreviated.maintenanceMarginProjected":["MM (Projected)"],"commonScreen.common.abbreviated.percentPremium":["% Premium"],"commonScreen.common.abbreviated.sessionRpl":["RSPL"],"commonScreen.common.abbreviated.sessionUpl":["USPL"],"commonScreen.common.abbreviated.timeInForce":["TIF"],"commonScreen.common.abbreviated.worstCaseScenarioBucketExtended":["(Bucket ",["worstCaseBucket"],")"],"commonScreen.common.abbreviated.worstCaseScenarioBucketStandard":["(Bucket ",["worstCaseBucket"],", ",["worstCaseVol"],")"],"commonScreen.common.accept2fa":["Accept 2FA"],"commonScreen.common.acceptTermsOfService":["Accept Terms of Service"],"commonScreen.common.access":["Access"],"commonScreen.common.accessToTheAccountHasBeenLocked":["Access to the account has been locked."],"commonScreen.common.account":["Account"],"commonScreen.common.accountCount":["You have <0>",["0"],"</0> active account"],"commonScreen.common.accountLockedForFollowing":["Your account has been locked for the following currencies:"],"commonScreen.common.accountsCount":["You have <0>",["0"],"</0> active accounts"],"commonScreen.common.activateCombo":["Activate Combo"],"commonScreen.common.activateCoupon":["Do you want to activate this coupon?"],"commonScreen.common.active":["Active"],"commonScreen.common.addComponent":["Add component"],"commonScreen.common.addNow":["Add Now"],"commonScreen.common.addTab":["Add Tab"],"commonScreen.common.advanced":["Advanced"],"commonScreen.common.affiliateHasBeenDisabled":["Affiliate program has been disabled on your account. Please contact <0>[email protected]</0> to request reactivation."],"commonScreen.common.affiliateIsNotAvailable":["Affiliate program is not available"],"commonScreen.common.affiliateIsNotAvailableInResidenceCountry":["Affiliate program is not available in your residence country."],"commonScreen.common.affiliateRestrictionsApplyToYourCountry":["Affiliate program restrictions apply to your residence country. You will continue to receive earnings from existing affiliates."],"commonScreen.common.aggregated":["Aggregated"],"commonScreen.common.all":["All"],"commonScreen.common.amount":["Amount"],"commonScreen.common.amountDollars":["Amount ($)"],"commonScreen.common.amountTooLarge":["Amount too large"],"commonScreen.common.anchorMaxPrice":["Anchor Max Price"],"commonScreen.common.anchorMinPrice":["Anchor Min Price"],"commonScreen.common.anchorPrice":["Anchor Price"],"commonScreen.common.and":["and"],"commonScreen.common.annualizedPremium":["Annualized Premium"],"commonScreen.common.approve":["Approve"],"commonScreen.common.apr":["APR"],"commonScreen.common.april":["April"],"commonScreen.common.ask":["Ask"],"commonScreen.common.askAmount":["Ask amount"],"commonScreen.common.askSize":["Ask Size"],"commonScreen.common.august":["August"],"commonScreen.common.autoHeight":["Auto Height"],"commonScreen.common.available":["Available"],"commonScreen.common.availableBalance":["Available Balance"],"commonScreen.common.availableTradingBalance":["Available (trading) balance"],"commonScreen.common.averageBidAsk":["Mid Price"],"commonScreen.common.averagePrice":["Avg. Price"],"commonScreen.common.averagePriceUsd":["Avg. Price (USD)"],"commonScreen.common.avgLast8hFunding":["Avg. Last 8h Funding"],"commonScreen.common.back":["Back"],"commonScreen.common.bankruptcies":["Bankruptcies"],"commonScreen.common.baseAmount":["Base Amount"],"commonScreen.common.baseCurrency":["Base currency"],"commonScreen.common.bid":["Bid"],"commonScreen.common.bidAmount":["Bid amount"],"commonScreen.common.bidSize":["Bid Size"],"commonScreen.common.blockRfqAccount":["Block RFQ"],"commonScreen.common.buy":["Buy"],"commonScreen.common.buySellDirection":["Side"],"commonScreen.common.call":["Call"],"commonScreen.common.calls":["CALLS"],"commonScreen.common.cancel":["Cancel"],"commonScreen.common.cancelled":["Cancelled"],"commonScreen.common.cannotCopyToClipboard":["Unable to copy to clipboard"],"commonScreen.common.cashBalance":["Cash Balance"],"commonScreen.common.categories.account":["Account"],"commonScreen.common.categories.all":["All"],"commonScreen.common.categories.combos":["Combos"],"commonScreen.common.categories.futures":["Futures"],"commonScreen.common.categories.metricsFutures":["Metrics Futures"],"commonScreen.common.categories.metricsOptions":["Metrics Options"],"commonScreen.common.categories.options":["Options"],"commonScreen.common.categories.tools":["Tools"],"commonScreen.common.categories.trading":["Trading"],"commonScreen.common.clickHere":["click here"],"commonScreen.common.close":["Close"],"commonScreen.common.closeOutMargin":["Close out Margin"],"commonScreen.common.columns":["Columns"],"commonScreen.common.combo":["Combo"],"commonScreen.common.comboFuture":["Future Combos"],"commonScreen.common.comboOption":["Option Combos"],"commonScreen.common.combos":["Combos"],"commonScreen.common.complete":["Complete"],"commonScreen.common.completed":["Completed"],"commonScreen.common.componentDeprecated":["This component is deprecated."],"commonScreen.common.confirm":["Confirm"],"commonScreen.common.contactUs":["Contact Us"],"commonScreen.common.continue":["Continue"],"commonScreen.common.contractSize":["Contract Size"],"commonScreen.common.contracts":["Contracts"],"commonScreen.common.copied":["Copied"],"commonScreen.common.copyToClipboard":["Copy to clipboard"],"commonScreen.common.couponActivated":["Coupon has been activated."],"commonScreen.common.couponNotLoggedIn":["You must be logged in to activate a coupon."],"commonScreen.common.createCombo":["Create Combo"],"commonScreen.common.credit":["Credit"],"commonScreen.common.crossValues":["Cross values"],"commonScreen.common.currency":["Currency"],"commonScreen.common.currencyNotSupported":[["currency"]," is not yet supported"],"commonScreen.common.currencyPair":["Currency pair"],"commonScreen.common.currencyPairLockedMessage":["The currency pair is temporarily locked. The admin is performing maintenance work, and the currency pair will get unlocked soon. You can cancel your open orders despite trading being disabled. We ap
2103ologize for the inconvenience and appreciate your understanding."],"commonScreen.common.date":["Date"],"commonScreen.common.dateTime.monthAgo":["A month ago"],"commonScreen.common.dateTime.now":["Now"],"commonScreen.common.dateTime.today":["Today"],"commonScreen.common.dateTime.weekAgo":["A week ago"],"commonScreen.common.dateTime.yearAgo":["A year ago"],"commonScreen.common.dateTime.yesterday":["Yesterday"],"commonScreen.common.dateTimeRange.to":["to"],"commonScreen.common.debit":["Debit"],"commonScreen.common.december":["December"],"commonScreen.common.default":["Default"],"commonScreen.common.delta":["Delta"],"commonScreen.common.deltaUSD":["USD Delta"],"commonScreen.common.deny":["Deny"],"commonScreen.common.deribitKnowledgeBase":["Deribit Knowledge Base"],"commonScreen.common.direction":["Side"],"commonScreen.common.disableApiKeys":["Disable API keys"],"commonScreen.common.disableAutoHeight":["Disable Auto Height"],"commonScreen.common.displayAmount":["Display Amount"],"commonScreen.common.documentation":["documentation"],"commonScreen.common.dollarPremium":["Dollar Premium"],"commonScreen.common.dropzoneFile":["Drag files here or <0>browse files</0>"],"commonScreen.common.edit":["Edit"],"commonScreen.common.editNote":["Edit Note"],"commonScreen.common.enablePortfolioMargin":["This is a ",["standardMargin"]," account. You can change margin model <0>here</0>."],"commonScreen.common.equity":["Equity"],"commonScreen.common.examples":["Examples:"],"commonScreen.common.exchange":["Exchange"],"commonScreen.common.exchanges":["Exchanges"],"commonScreen.common.exitFullscreen":["Exit Fullscreen"],"commonScreen.common.expiration":["Expiration"],"commonScreen.common.expirationType":["Expiration Type"],"commonScreen.common.expiry":["Expiry"],"commonScreen.common.expiryDate":["Expiry Date"],"commonScreen.common.exportAsCSV":["Export as CSV"],"commonScreen.common.externalEquity":["External Equity"],"commonScreen.common.favorites":["Favourites"],"commonScreen.common.features":["Features"],"commonScreen.common.february":["February"],"commonScreen.common.feeBalance":["Fee Balance"],"commonScreen.common.fees":["Fees"],"commonScreen.common.fileSaved":["File saved"],"commonScreen.common.filesLabel":["Files:"],"commonScreen.common.filters.all":["All"],"commonScreen.common.filters.combos":["Combos"],"commonScreen.common.filters.futures":["Futures"],"commonScreen.common.filters.limitAndMarket":["Limit & Market"],"commonScreen.common.filters.options":["Options"],"commonScreen.common.filters.search":["Search"],"commonScreen.common.filters.spot":["Spot"],"commonScreen.common.filters.trigger":["Trigger"],"commonScreen.common.fromWhenNewWithdrawalDelay":["New withdrawal address delay settings will be changed from ",["withdrawalDelayCurrentValue"]," day(s) to ",["withdrawalDelayNewValue"]," day(s) at ",["fromWhenNewWithdrawalDelay"]],"commonScreen.common.fullDate":["Long Date"],"commonScreen.common.fullscreen":["Fullscreen"],"commonScreen.common.funding":["Funding/8h"],"commonScreen.common.fundingHistory":["Funding History"],"commonScreen.common.future":["Future"],"commonScreen.common.futureSize":["Future Size"],"commonScreen.common.futureSpreads":["Futures Spreads"],"commonScreen.common.futures":["Futures"],"commonScreen.common.futuresTables":["Futures Tables"],"commonScreen.common.gamma":["Gamma"],"commonScreen.common.gotIt":["Got it"],"commonScreen.common.greeks":["Greeks"],"commonScreen.common.grouping.byCurrency":["By currency"],"commonScreen.common.grouping.byStrategy":["By strategy"],"commonScreen.common.grouping.currency":["Currency"],"commonScreen.common.grouping.expiry":["Expiry"],"commonScreen.common.grouping.none":["No grouping"],"commonScreen.common.here":["here"],"commonScreen.common.home":["Home"],"commonScreen.common.iceberg":["Iceberg"],"commonScreen.common.id":["ID"],"commonScreen.common.impliedEquity":["Implied Equity"],"commonScreen.common.inactiveInstrument":["This instrument is not available for trading yet."],"commonScreen.common.indexPrice":["Index Price"],"commonScreen.common.initialMargin":["Initial Margin"],"commonScreen.common.instantBuy":["Instant Buy"],"commonScreen.common.instantSell":["Instant Sell"],"commonScreen.common.instrument":["Instrument"],"commonScreen.common.instrumentHasExpired":["Instrument ",["instrument"]," has expired."],"commonScreen.common.instruments":["Instruments"],"commonScreen.common.invalidOrExpiredCode":["Invalid or expired code"],"commonScreen.common.inverseOptions":["Inverse Options"],"commonScreen.common.iv":["IV"],"commonScreen.common.january":["January"],"commonScreen.common.july":["July"],"commonScreen.common.june":["June"],"commonScreen.common.kind":["Kind"],"commonScreen.common.knowledgeBase":["Knowledge Base"],"commonScreen.common.last":["Last"],"commonScreen.common.lastPrice":["Last Price"],"commonScreen.common.lastUpdateUTC":["Last Update (UTC)"],"commonScreen.common.leg":["Leg ",["0"]],"commonScreen.common.limitPrice":["Limit Price"],"commonScreen.common.linearOptions":["Linear Options"],"commonScreen.common.liveChat":["Live Chat"],"commonScreen.common.liveChat.error.unableToLoad":["Unable to load chat. Please try again later."],"commonScreen.common.liveChat.unreadMessages":["New message in the Live Chat"],"commonScreen.common.loading":["Loading..."],"commonScreen.common.logIn":["Log In"],"commonScreen.common.long":["Long"],"commonScreen.common.main":["main"],"commonScreen.common.maintenanceMargin":["Maintenance Margin"],"commonScreen.common.march":["March"],"commonScreen.common.marginBalance":["Margin Balance"],"commonScreen.common.marginBuffer":["Margin Buffer"],"commonScreen.common.mark":["Mark"],"commonScreen.common.markIV":["Mar
2103k IV"],"commonScreen.common.markPrice":["Mark Price"],"commonScreen.common.marketPrice":["Market Price"],"commonScreen.common.maxLeverage":["Max Leverage"],"commonScreen.common.maxPrice":["Max Buy Price"],"commonScreen.common.may":["May"],"commonScreen.common.min":["Min"],"commonScreen.common.minOrderSize":["Min Order Size"],"commonScreen.common.minPrice":["Min Sell Price"],"commonScreen.common.netDelta":["Net Delta"],"commonScreen.common.netDeltaUSD":["USD Net Delta"],"commonScreen.common.next":["Next"],"commonScreen.common.no":["No"],"commonScreen.common.noAccess":["Not available for subaccounts"],"commonScreen.common.noData":["No Data"],"commonScreen.common.noFavoritesSet":["No favourites are set."],"commonScreen.common.noMatchingResults":["No matching results."],"commonScreen.common.noPositionsForCurrency":["No positions for this currency."],"commonScreen.common.noResults":["There are no results for the selected settings."],"commonScreen.common.noResultsForSearchQuery":["No results"],"commonScreen.common.nonZero":["Non-Zero"],"commonScreen.common.none":["None"],"commonScreen.common.notAvailableForCurrency":["Not available for ",["currency"]," at the moment."],"commonScreen.common.notAvailableForNonAdmin":["Not available for non-admin."],"commonScreen.common.notAvailableForTest":["Not available for test."],"commonScreen.common.notEnoughPermissions":["Not enough permissions"],"commonScreen.common.note":["Note"],"commonScreen.common.nothingHere":["
2103Nothing here..."],"commonScreen.common.november":["November"],"commonScreen.common.october":["October"],"commonScreen.common.oneContract":["Contract"],"commonScreen.common.onePercentGammaPNL":["1% Gamma PNL"],"commonScreen.common.openInterest":["Open Interest"],"commonScreen.common.openInterestCoin":["Open Interest (coin)"],"commonScreen.common.openOrders":["Open Orders"],"commonScreen.common.option":["Option"],"commonScreen.common.optionComboPrice":["Option Combo Price"],"commonScreen.common.options":["Options"],"commonScreen.common.or":["or"],"commonScreen.common.orderId":["Order ID"],"commonScreen.common.orderType":["Order Type"],"commonScreen.common.other":["Other"],"commonScreen.common.ourWebsite":["our website"],"commonScreen.common.passwordChanged":["The password has been changed."],"commonScreen.common.passwordCompromised":["This password appears in a public lists of passwords leaked from other sites. Using this password puts your account at high risk of compromise. Please choose a different password."],"commonScreen.common.passwordIsNotValid":["Your password should contain at least 10 characters."],"commonScreen.common.passwordRequirements":["12 characters or more, containing a digit, uppercase letter, and symbol"],"commonScreen.common.passwordsDoNotMatch":["Password does not match the confirmed password"],"commonScreen.common.pending":["Pending"],"commonScreen.common.percentPremium":["Percentage Premium"],"commonScreen.common.perp":["Perp"],"commonScreen.common.perpetual":["Perpetual"],"commonScreen.common.perpetuals":["Perpetuals"],"commonScreen.common.platformLockedMessage":["The platform is temporarily locked for scheduled maintenance. Trading is currently disabled, but you may still cancel any open orders. We apologize for the inconvenience and appreciate your understanding."],"commonScreen.common.pln":["PNL"],"commonScreen.common.pnl":["PNL"],"commonScreen.common.pnlUsd":["PNL (USD)"],"commonScreen.common.position":["Position"],"commonScreen.common.positions":["Positions"],"commonScreen.common.post":["Post"],"commonScreen.common.premium":["Premium"],"commonScreen.common.price":["Price"],"commonScreen.common.priceSource":["Price Source"],"commonScreen.common.priceTooLarge":["Price too large"],"commonScreen.common.priceUSD":["Price (USD)"],"commonScreen.common.priceUsed":["Price Used"],"commonScreen.common.put":["Put"],"commonScreen.common.puts":["PUTS"],"commonScreen.common.quantity":["Quantity"],"commonScreen.common.quantityStep":["Quantity Step"],"commonScreen.common.ratio":["Ratio"],"commonScreen.common.readMore":["Read more"],"commonScreen.common.recommended":["Recommended"],"commonScreen.common.reduce":["Reduce"],"commonScreen.common.reduceOnlyModeEnabled":["Reduce-Only mode has been enabled for your account.<0/>This means you can no longer open any new positions-only close existing ones. Please note that deposits will not be credited to your account. Withdrawals are not affected. If you have any questions regarding this notification, please contact <1>[email protected]</1>."],"commonScreen.common.referralCodeIsNotValid":["The referral link provided does not appear to be valid. Please verify the link and, if the issue persists, contact our support team for further assistance."],"commonScreen.common.refresh":["Refresh"],"commonScreen.common.reject":["Reject"],"commonScreen.common.rejected":["Rejected"],"commonScreen.common.releasedAmount":["Released Amount"],"commonScreen.common.remaining":["Remaining"],"commonScreen.common.remove":["Remove"],"commonScreen.common.reset":["Reset"],"commonScreen.common.restrictedBlockTrades":["Restricted block trades"],"commonScreen.common.restrictedBlockTrades.tooltip":["Limit the block_trade read scope of the API key to block trades that have been made using this specific API key."],"commonScreen.common.returnOnInvestment":["Return on investment"],"commonScreen.common.rho":["Rho"],"commonScreen.common.roi":["ROI"],"commonScreen.common.save":["Save"],"commonScreen.common.scopesOfTheAccountHaveBeenChanged":["Scopes of the account and/or API credentials you were logged in have been changed. Please log in again."],"commonScreen.common.securityKeysReset":["Security ke
2103ys reset"],"commonScreen.common.securityKeysReset.areYouSureThatYouWantToLockAccessToAccountWithEmail":["<0>Are you sure that you want to lock access to the account with email <1>",["email"],"</1>?</0><2>To unlock your account contact <3>[email protected]</3>.</2><4>Please note that unlocking requires several security checks and can take several business days.</4>"],"commonScreen.common.securityKeysReset.cancel":["Do you want to cancel the request of disable security keys?"],"commonScreen.common.securityKeysReset.confirm":["Do you want to disable security keys?"],"commonScreen.common.securityKeysReset.lockAccountConfirm":["Lock access"],"commonScreen.common.securityKeysReset.lockAccountTitle":["Lock access to the account"],"commonScreen.common.segregatedValues":["Segregated values"],"commonScreen.common.selectAll":["Select all"],"commonScreen.common.selectApiKey":["Select API Key"],"commonScreen.common.selectInstrument":["Select Instrument"],"commonScreen.common.sell":["Sell"],"commonScreen.common.september":["September"],"commonScreen.common.sessionRPL":["RSPL"],"commonScreen.common.sessionUPL":["USPL"],"commonScreen.common.settings":["Settings"],"commonScreen.common.settlementCurrency":["Settlement Currency"],"commonScreen.common.short":["Short"],"commonScreen.common.showLess":["Show less"],"commonScreen.common.showMore":["Show more"],"commonScreen.common.side":["Side"],"commonScreen.common.size":["Size"],"commonScreen.common.sizeCrypto":["Value"],"commonScreen.common.skip":["Skip"],"commonScreen.common.someErrorOccurred":["Some error occurred"],"commonScreen.common.somethingWentWrong":["Something went wrong"],"commonScreen.common.spot":["Spot"],"commonScreen.common.spotReserve":["Spot Reserve"],"commonScreen.common.statsAndReports":["Stats and Reports"],"commonScreen.common.status":["Status"],"commonScreen.common.strategy":["Strategy"],"commonScreen.common.strike":["Strike"],"commonScreen.common.subAccount":["subaccount"],"commonScreen.common.submit":["Submit"],"commonScreen.common.switchAccount":["Switch Account"],"commonScreen.common.tenor":["Tenor"],"commonScreen.common.theoProfit":["THEO Profit"],"commonScreen.common.theta":["Theta"],"commonScreen.common.tickSize":["Tick Size"],"commonScreen.common.time":["Time"],"commonScreen.common.title":["Title"],"commonScreen.common.total":["Total"],"commonScreen.common.totalDeltaProjected":["Delta Total (Projected)"],"commonScreen.common.totalPriceExcludingFees":["Total (excl. fees)"],"commonScreen.common.tradeId":["Trade ID"],"commonScreen.common.tradingBandwidth":["Trading bandwidth"],"commonScreen.common.trigger":["Trigger"],"commonScreen.common.triggerOffset":["Trigger Offset"],"commonScreen.common.triggerPrice":["Trigger Price"],"commonScreen.common.type":["Type"],"commonScreen.common.unconfirmed":["Unconfirmed"],"commonScreen.common.unverified":["Unverified"],"commonScreen.common.usd":["USD"],"commonScreen.common.usdTotal":["Total USD"],"commonScreen.common.usdcSettled":["USDC 
2103settled"],"commonScreen.common.userLocked":["Your account has been locked by Deribit administrators, please contact <0>[email protected]</0> if you wish to unlock the account."],"commonScreen.common.vega":["Vega"],"commonScreen.common.verificationGuidelineLink":["guidelines"],"commonScreen.common.verified":["Verified"],"commonScreen.common.wallet":["Wallet"],"commonScreen.common.withdrawableBalance":["Withdrawable Balance"],"commonScreen.common.withdrawableBalance.tooltip":["Available Balance - Session Profit"],"commonScreen.common.withdrawalAddressForCurrencyAvailableInfo":["The withdrawal address ",["address"]," for ",["currenciesString"]," will be available ",["withdrawalAvailableUTC"]],"commonScreen.common.withdrawalAddressForCurrencyIsWaitingForAdminApproval":["The withdrawal address ",["address"]," for ",["currenciesString"]," is waiting for admin's approval"],"commonScreen.common.yes":["Yes"],"commonScreen.common.youCanChangeYourMarginModelHere":["You can change your margin model <0>here</0>."],"commonScreen.common.yourSecurityKeysCancelRequestHasBeenCancelled":["Security keys cancel request has been cancelled."],"commonScreen.componentNotFound":["Component not found"],"commonScreen.cookieConsent.accept":["Accept all"],"commonScreen.cookieConsent.actions.allow":["Allow All"],"commonScreen.cookieConsent.actions.reject":["Reject All"],"commonScreen.cookieConsent.actions.showSettings":["Adjust my preferences"],"commonScreen.cookieConsent.check_settings":["Adjust my preferences"],"commonScreen.cookieConsent.reject":["Reject all"],"commonScreen.cookies.attributes.domain":["Domain"],"commonScreen.cookies.attributes.expiry":["Expiry"],"commonScreen.cookies.attributes.type":["Type"],"commonScreen.cookies.attributes.type.cookie":["HTTP Cookie"],"commonScreen.cookies.attributes.type.localStorage":["HTML Local Storage"],"commonScreen.cookies.attributes.type.origin.firstParty":["First Party"],"commonScreen.cookies.attributes.type.origin.thirdParty":["Third Party"],"commonScreen.cookies.attributes.type.sessionStorage":["HTML Session Storage"],"commonScreen.cookies.categories.marketing._gcl_au":["Used by Google ad sensor to properly triage users and display ads."],"commonScreen.cookies.categories.marketing.description":["Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third-party advertisers."],"commonScreen.cookies.categories.marketing.guest_id":["These cookies are set by X to identify and track the website visitor for marketing analytics."],"commonScreen.cookies.categories.marketing.muc_ads":["Used to enhance ad relevance by tracking user behavior across websites. It collects data to display more personalized and engaging ads, with a typical lifespan of 400 days to 2 years."],"commonScreen.cookies.categories.marketing.personalisation_id":["X collects data through a range of plug-ins and integrations, that is primarily used for tracking and targeting."],"commonScreen.cookies.categories.marketing.title":["Marketing"],"commonScreen.cookies.categories.statistics.ZD-buid":["Used to create a deviceId and track analytics events for pages that load a Live Chat on them"],"commonScreen.cookies.categories.statistics.ZD-suid":["Used to create a sessionId and track analytics events for pages that load a Live Chat on them."],"commonScreen.cookies.categories.statistics._ga":["Used by Google Analytics to properly retrieve usage data."],"commonScreen.cookies.categories.statistics.description":["Statistics cookies collect information about how visitors use our services, for instance which pages visitors go to most often, and if they get error messages from web pages. These cookies collect aggregated (anonymous) data on the pages visited. They are used to improve our services."],"commonScreen.cookies.categories.statistics.mp":["Track user interaction to improve the overall user experience."],"commonScreen.cookies.categories.statistics.title":["Statistics"],"commonScreen.cookies.categories.strict.ZD-widgetOpen":["Maintains the open/closed state of the Live Chat across page visits."],"commonScreen.cookies.categories.strict._cfuvid":["Integral cookie used by CloudFare to prevent spam bots."],"commonScreen.cookies.categories.strict.appUserId":["Used to identify the particular user that has started the Live Chat conversation."],"commonScreen.cookies.categories.strict.cf_clearance":["This cookie is used as part of Cloudflare's security and performance features."],"commonScreen.cookies.categories.strict.cid":["This cookie is used to protect user session."],"commonScreen.cookies.categories.strict.clientId":["Used to identify the device from which the Live Chat conversation is initiated."],"commonScreen.cookies.categories.strict.conversationStartedAt":["Used to synchronise Live Chat across multiple tabs."],"commonScreen.cookies.categories.strict.cookieConsent":["Used to know whether or not you have given consent to cookies."],"commonScreen.cookies.categories.strict.cookieConsentScopes":["Used to remember the cookie categories you consented to."],"commonScreen.cookies.categories.strict.cookieSettings":["Used to keep track of your preferences, including custom pages and other core functionality."],"commonScreen.cookies.categories.strict.description":["Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies."],"commonScreen.cookies.categories.strict.sessionToken":["Used to authenticate requests and verify the user in the Live Chat."],"commonScreen.cookies.categories.strict.title":["Strictly Necessary Cookies"],"commonScreen.cookies.errors.strictCookiesNoDisable":["Cannot disable necessary cookies"],"commonScreen.cookies.expiry.minute":[["0"]," minute(s)"],"commonScreen.cookies.expiry.persistent":["Persistent"],"commonScreen.cookies.expiry.session":["Session"],"commonScreen.cookies.expiry.year":[["0"]," year(s)"],"commonScreen.cookies.settings.description":["When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer."],"commonScreen.cookies.settings.title":["Privacy Preference Center"],"commonScreen.countdown.days":["days"],"commonScreen.countdown.hours":["hours"],"commonScreen.countdown.minutes":["minutes"],"commonScreen.countdown.seconds":["seconds"],"commonScreen.countries.Afghanistan":["Afghanistan"],"commonScreen.countries.AlandIslands":["Åland Islands"],"commonScreen.countries.Albania":["Albania"],"commonScreen.countries.Algeria":["Algeria"],"commonScreen.countries.AmericanSamoa":["American Samoa"],"commonScreen.countries.Andorra":["Andorra"],"commonScreen.countries.Angola":["Angola"],"commonScreen.countries.Anguilla":["Anguilla"],"commonScreen.countries.Antarctica":["Antarctica"],"commonScreen.countries.AntiguaAndBarbuda":["Antigua and Barbuda"],"commonScreen.countries.Argentina":["Argentina"],"commonScreen.countries.Armenia":["Armenia"],"commonScreen.countries.Aruba":["Aruba"],"commonScreen.countries.Australia":["Australia"],"commonScreen.countries.Austria":["Austria"],"commonScreen.countries.Azerbaijan":["Azerbaijan"],"commonScreen.countries.Bahamas":["Bahamas"],"commonScreen.countries.Bahrain":["Bahrain"],"commonScreen.countries.Bangladesh":["Bangladesh"],"commonScreen.countries.Barbados":["Barbados"],"commonScreen.countries.Belarus":["Belarus"],"commonScreen.countries.Belgium":["Belgium"],"commonScreen.countries.Belize":["Belize"],"commonScreen.countries.Benin":["Benin"],"commonScreen.countries.Bermuda":["Bermuda"],"commonScreen.countries.Bhutan":["Bhutan"],"commonScreen.countries.BoliviaPlurinationalStateOf":["Bolivia, Plurinational State of"],"commonScreen.countries.BonaireSintEustatiusAndSaba":["Bonaire, Sint Eustatius and Saba"],"commonScreen.countries.BosniaAndHerzegovina":["Bosnia and Herzegovina"],"commonScreen.countries.Botswana":["Botswana"],"commonScreen.countries.BouvetIsland":["Bouvet Island"],"commonScreen.countries.Brazil":["Brazil"],"commonScreen.countries.BritishIndianOceanTerritory":["British Indian Ocean Territory"],"commonScreen.countries.BruneiDarussalam":["Brunei Darussalam"],"commonScreen.countries.Bulgaria":["Bulgaria"],"commonScreen.countries.BurkinaFaso":["Burkina Faso"],"commonScreen.countries.Burundi":["Burundi"],"commonScreen.countries.Cambodia":["Cambodia"],"commonScreen.countries.Cameroon":["Cameroon"],"commonScreen.countries.Canada":["Canada"],"commonScreen.countries.CapeVerde":["Cape Verde"],"commonScreen.countries.CaymanIslands":["Cayman Islands"],"commonScreen.countries.CentralAfricanRepublic":["Central African Republic"],"commonScreen.countries.Chad":["Chad"],"commonScreen.countries.Chile":["Chile"],"commonScreen.countries.China":["China"],"commonScreen.countries.ChristmasIsland":["Christmas Island"],"commonScreen.countries.CocosKeelingIslands":["Cocos (Keeling) Islands"],"commonScreen.countries.Colombia":["Colombia"],"commonScreen.countries.Comoros":["Comoros"],"commonScreen.countries.Congo":["Congo"],"commonScreen.countries.CongoTheDemocraticRepublicOfThe":["Congo, the Democratic Republic of the"],"commonScreen.countries.CookIslands":["Cook Islands"],"commonScreen.countries.CostaRica":["Costa Rica"],"commonScreen.countries.CoteDIvoire":["Côte d'Ivoire"],"commonScreen.countries.Croatia":["Croatia"],"commonScreen.countries.Cuba":["Cuba"],"commonScreen.countries.Curacao":["Curaçao"],"commonScreen.countries.Cyprus":["Cyprus"],"commonScreen.countries.Czechia":["Czechia"],"commonScreen.countries.Denmark":["Denmark"],"commonScreen.countries.Djibouti":["Djibouti"],"commonScreen.countries.Dominica":["Dominica"],"commonScreen.countries.DominicanRepublic":["Dominican Republic"],"commonScreen.countries.Dubai":["Dubai"],"commonScreen.countries.Ecuador":["Ecuador"],"commonScreen.countries.Egypt":["Egypt"],"commonScreen.countries.ElSalvador":["El Salvador"],"commonScreen.countries.EquatorialGuinea":["Equatorial Guinea"],"commonScreen.countries.Eritrea":["Eritrea"],"commonScreen.countries.Estonia":["Estonia"],"commonScreen.countries.Ethiopia":["Ethiopia"],"commonScreen.countries.FalklandIslandsMalvinas":["Falkland Islands (Malvinas)"],"commonScreen.countries.FaroeIslands":["Faroe Islands"],"commonScreen.countries.Fiji":["Fiji"],"commonScreen.countries.Finland":["Finland"],"commonScreen.countries.France":["France"],"commonScreen.countries.FrenchGuiana":["French Guiana"],"commonScreen.countries.FrenchPolynesia":["French Polynesia"],"commonScreen.countries.FrenchSouthernTerritories":["French Southern Territories"],"commonScreen.countries.Gabon":["Gabon"],"commonScreen.countries.Gambia":["Gambia"],"commonScreen.countries.Georgia":["Georgia"],"commonScreen.countries.Germany":["Germany"],"commonScreen.countries.Ghana":["Ghana"],"commonScreen.countries.Gibraltar":["Gibraltar"],"commonScreen.countries.Greece":["Greece"],"commonScreen.countries.Greenland":["Greenland"],"commonScreen.countries.Grenada":["Grenada"],"commonScreen.countries.Guadeloupe":["Guadeloupe"],"commonScreen.countries.Guam":["Guam"],"commonScreen.countries.Guatemala":["Guatemala"],"commonScreen.countries.Guernsey":["Guernsey"],"commonScreen.countries.Guinea":["Guinea"],"commonScreen.countries.GuineaBissau":["Guinea-Bissau"],"commonScreen.countries.Guyana":["Guyana"],"commonScreen.countries.Haiti":["Haiti"],"commonScreen.countries.HeardIslandAndMcDonaldIslands":["Heard Island and McDonald Islands"],"commonScreen.countries.HolySeeVaticanCityState":["Holy See (Vatican City State)"],"commonScreen.countries.Honduras":["Honduras"],"commonScreen.countries.HongKong":["Hong Kong"],"commonScreen.countries.Hungary":["Hungary"],"commonScreen.countries.Iceland":["Iceland"],"commonScreen.countries.India":["India"],"commonScreen.countries.Indonesia":["Indonesia"],"commonScreen.countries.IranIslamicRepublicOf":["Iran, Islam
2103ic Republic of"],"commonScreen.countries.Iraq":["Iraq"],"commonScreen.countries.Ireland":["Ireland"],"commonScreen.countries.IsleOfMan":["Isle of Man"],"commonScreen.countries.Israel":["Israel"],"commonScreen.countries.Italy":["Italy"],"commonScreen.countries.Jamaica":["Jamaica"],"commonScreen.countries.Japan":["Japan"],"commonScreen.countries.Jersey":["Jersey"],"commonScreen.countries.Jordan":["Jordan"],"commonScreen.countries.Kazakhstan":["Kazakhstan"],"commonScreen.countries.Kenya":["Kenya"],"commonScreen.countries.Kiribati":["Kiribati"],"commonScreen.countries.KoreaDemocraticPeoplesRepublicOf":["Korea, Democratic People's Republic Of"],"commonScreen.countries.KoreaRepublicOf":["Korea, Republic of"],"commonScreen.countries.Kosovo":["Kosovo"],"commonScreen.countries.Kuwait":["Kuwait"],"commonScreen.countries.Kyrgyzstan":["Kyrgyzstan"],"commonScreen.countries.LaoPeoplesDemocraticRepublic":["Lao People's Democratic Republic"],"commonScreen.countries.Latvia":["Latvia"],"commonScreen.countries.Lebanon":["Lebanon"],"commonScreen.countries.Lesotho":["Lesotho"],"commonScreen.countries.Liberia":["Liberia"],"commonScreen.countries.Libya":["Libya"],"commonScreen.countries.Liechtenstein":["Liechtenstein"],"commonScreen.countries.Lithuania":["Lithuania"],"commonScreen.countries.Luxembourg":["Luxembourg"],"commonScreen.countries.Macao":["Macao"],"commonScreen.countries.Madagascar":["Madagascar"],"commonScreen.countries.Malawi":["Malawi"],"commonScreen.countries.Malaysia":["Malaysia"],"commonScreen.countries.Maldives":["Maldives"],"commonScreen.countries.Mali":["Mali"],"commonScreen.countries.Malta":["Malta"],"commonScreen.countries.MarshallIslands":["Marshall Islands"],"commonScreen.countries.Martinique":["Martinique"],"commonScreen.countries.Mauritania":["Mauritania"],"commonScreen.countries.Mauritius":["Mauritius"],"commonScreen.countries.Mayotte":["Mayotte"],"commonScreen.countries.Mexico":["Mexico"],"commonScreen.countries.MicronesiaFederatedStatesOf":["Micronesia, Federated States of"],"commonScreen.countries.MoldovaRepublicOf":["Moldova, Republic of"],"commonScreen.countries.Monaco":["Monaco"],"commonScreen.countries.Mongolia":["Mongolia"],"commonScreen.countries.Montenegro":["Montenegro"],"commonScreen.countries.Montserrat":["Montserrat"],"commonScreen.countries.Morocco":["Morocco"],"commonScreen.countries.Mozambique":["Mozambique"],"commonScreen.countries.Myanmar":["Myanmar"],"commonScreen.countries.Namibia":["Namibia"],"commonScreen.countries.Nauru":["Nauru"],"commonScreen.countries.Nepal":["Nepal"],"commonScreen.countries.Netherlands":["Netherlands"],"commonScreen.countries.NewCaledonia":["New Caledonia"],"commonScreen.countries.NewZealand":["New Zealand"],"commonScreen.countries.Nicaragua":["Nicaragua"],"commonScreen.countries.Niger":["Niger"],"commonScreen.countries.Nigeria":["Nigeria"],"commonScreen.countries.Niue":["Niue"],"commonScreen.countries.NorfolkIsland":["Norfolk Island"],"commonScreen.countries.NorthMacedonia":["North Macedonia"],"commonScreen.countries.NorthernMarianaIslands":["Northern Mariana Islands"],"commonScreen.countries.Norway":["Norway"],"commonScreen.countries.Oman":["Oman"],"commonScreen.countries.Pakistan":["Pakistan"],"commonScreen.countries.Palau":["Palau"],"commonScreen.countries.PalestinianTerritoryOccupied":["Palestinian Territory, Occupied"],"commonScreen.countries.Panama":["Panama"],"commonScreen.countries.PapuaNewGuinea":["Papua New Guinea"],"commonScreen.countries.Paraguay":["Paraguay"],"commonScreen.countries.Peru":["Peru"],"commonScreen.countries.Philippines":["Philippines"],"commonScreen.countries.Pitcairn":["Pitcairn"],"commonScreen.countries.Poland":["Poland"],"commonScreen.countries.Portugal":["Portugal"],"commonScreen.countries.PuertoRico":["Puerto Rico"],"commonScreen.countries.Qatar":["Qatar"],"commonScreen.countries.Reunion":["Réunion"],"commonScreen.countries.Romania":["Romania"],"commonScreen.countries.RussianFederation":["Russian Federation"],"commonScreen.countries.Rwanda":["Rwanda"],"commonScreen.countries.SaintBarthelemy":["Saint Barthélemy"],"commonScreen.countries.SaintHelenaAscensionAndTristanAaCunha":["Saint Helena, Ascension and Tristan da Cunha"],"commonScreen.countries.SaintKittsAndNevis":["Saint Kitts and Nevis"],"commonScreen.countries.SaintLucia":["Saint Lucia"],"commonScreen.countries.SaintMartinFrenchPart":["Saint Martin (French part)"],"commonScreen.countries.SaintPierreAndMiquelon":["Saint Pierre and Miquelon"],"commonScreen.countries.SaintVincentAndTheGrenadines":["Saint Vincent and the Grenadines"],"commonScreen.countries.Samoa":["Samoa"],"commonScreen.countries.SanMarino":["San Marino"],"commonScreen.countries.SaoTomeAndPrincipe":["Sao Tome and Principe"],"commonScreen.countries.SaudiArabia":["Saudi Arabia"],"commonScreen.countries.Senegal"
2103:["Senegal"],"commonScreen.countries.Serbia":["Serbia"],"commonScreen.countries.Seychelles":["Seychelles"],"commonScreen.countries.SierraLeone":["Sierra Leone"],"commonScreen.countries.Singapore":["Singapore"],"commonScreen.countries.SintMaartenDutchPart":["Sint Maarten (Dutch part)"],"commonScreen.countries.Slovakia":["Slovakia"],"commonScreen.countries.Slovenia":["Slovenia"],"commonScreen.countries.SolomonIslands":["Solomon Islands"],"commonScreen.countries.Somalia":["Somalia"],"commonScreen.countries.SouthAfrica":["South Africa"],"commonScreen.countries.SouthGeorgiaAndTheSouthSandwichIslands":["South Georgia and the South Sandwich Islands"],"commonScreen.countries.SouthSudan":["South Sudan"],"commonScreen.countries.Spain":["Spain"],"commonScreen.countries.SriLanka":["Sri Lanka"],"commonScreen.countries.Sudan":["Sudan"],"commonScreen.countries.Suriname":["Suriname"],"commonScreen.countries.SvalbardAndJanMayen":["Svalbard and Jan Mayen"],"commonScreen.countries.Swaziland":["Swaziland"],"commonScreen.countries.Sweden":["Sweden"],"commonScreen.countries.Switzerland":["Switzerland"],"commonScreen.countries.SyrianArabRepublic":["Syrian Arab Republic"],"commonScreen.countries.Taiwan":["Taiwan"],"commonScreen.countries.Tajikistan":["Tajikistan"],"commonScreen.countries.TanzaniaUnitedRepublicOf":["Tanzania, United Republic of"],"commonScreen.countries.Thailand":["Thailand"],"commonScreen.countries.TimorLeste":["Timor-Leste"],"commonScreen.countries.Togo":["Togo"],"commonScreen.countries.Tokelau":["Tokelau"],"commonScreen.countries.Tonga":["Tonga"],"commonScreen.countries.TrinidadAndTobago":["Trinidad and Tobago"],"commonScreen.countries.Tunisia":["Tunisia"],"commonScreen.countries.Turkey":["Turkey"],"commonScreen.countries.Turkmenistan":["Turkmenistan"],"commonScreen.countries.TurksAndCaicosIslands":["Turks and Caicos Islands"],"commonScreen.countries.Tuvalu":["Tuvalu"],"commonScreen.countries.Uganda":["Uganda"],"commonScreen.countries.Ukraine":["Ukraine"],"commonScreen.countries.UkraineCrimea":["Ukraine - Crimea"],"commonScreen.countries.UkraineDonetsk":["Ukraine - Donetsk"],"commonScreen.countries.UkraineLuhansk":["Ukraine - Luhansk"],"commonScreen.countries.UnitedArabEmirates":["United Arab Emirates"],"commonScreen.countries.UnitedKingdom":["United Kingdom"],"commonScreen.countries.UnitedStates":["United States"],"commonScreen.countries.UnitedStatesMinorOutlyingIslands":["United States Minor Outlying Islands"],"commonScreen.countries.Uruguay":["Uruguay"],"commonScreen.countries.Uzbekistan":["Uzbekistan"],"commonScreen.countries.Vanuatu":["Vanuatu"],"commonScreen.countries.VenezuelaBolivarianRepublicOf":["Venezuela, Bolivarian Republic of"],"commonScreen.countries.VietNam":["Viet Nam"],"commonScreen.countries.VirginIslandsBritish":["British Virgin Islands"],"commonScreen.countries.VirginIslandsUS.":["Virgin Islands, U.S."],"commonScreen.countries.WallisAndFutuna":["Wallis and Futuna"],"commonScreen.countries.WesternSahara":["Western Sahara"],"commonScreen.countries.Yemen":["Yemen"],"commonScreen.countries.Zambia":["Zambia"],"commonScreen.countries.Zimbabwe":["Zimbabwe"],"commonScreen.coupon.currentUsages":["Current usages"],"commonScreen.coupon.maximalUsages":["Maximal usages"],"commonScreen.coupon.type":["Type"],"commonScreen.coupon.validTo":["Valid to"],"commonScreen.coupon.value":["Value"],"commonScreen.crossInitialMargin":["Cross Initial Margin Ratio"],"commonScreen.crossInitialMargin.description":["Cross Initial Margin is calculated as (BTC Position Initial Margin * BTC Index) + (ETH Position Initial Margin * ETH Index) + (USDC Position Initial Margin * USDC-USD index) in the User Accounts"],"commonScreen.crossMaintenanceMargin":["Cross Maintenance Margin Ratio"],"commonScreen.crossMaintenanceMargin.description":["Cross Maintenance Margin is calculated as: (BTC Maintenance Margin * BTC Index) + (ETH Maintenance Margin * ETH Index) + (USDC Maintenance Margin * USDC-USD index) in the User Accounts"],"commonScreen.customTags.announcement":["Announcement"],"commonScreen.customTags.security":["Security"],"commonScreen.customTags.success":["Success"],"commonScreen.customTags.warning":["Warning"],"commonScreen.drawerMenu.api":["API"],"commonScreen.drawerMenu.blockRfq":["Block RFQ"],"commonScreen.drawerMenu.blockRfq.subtitle":["Large trades via request to select market makers"],"commonScreen.drawerMenu.blockTrades":["Block Trades"],"commonScreen.drawerMenu.blockTrades.subtitle":["Large privately negotiated trades"],"commonScreen.drawerMenu.blog":["Insights"],"commonScreen.drawerMenu.buyCrypto":["Buy Crypto"],"commonScreen.drawerMenu.comboBooks":["Combo Books"],"commonScreen.drawerMenu.comboBooks.subtitle":["Multi-leg trading strategies"],"commonScreen.drawerMenu.data":["Data"],"commonScreen.drawerMenu.deposit":["Deposit"],"commonScreen.drawerMenu.deribitFixingIndices":["Deribit Fixing Indices"],"commonScreen.drawerMenu.deribitIndices":["Deribit Indices"],"commonScreen.drawerMenu.externalEquity":["External Equity"],"commonScreen.drawerMenu.fundingRate":["Funding Rate"],"commonScreen.drawerMenu.futures":["Futures"],"commonScreen.drawerMenu.futuresSpreads":["Futures Spreads"],"commonScreen.drawerMenu.futuresSpreads.subtitle":["Trading futures with different expirations"],"commonScreen.drawerMenu.historicalVolatility":["Historical Volatility"],"commonScreen.drawerMenu.impliedEquity":["Implied Equity"],"commonScreen.drawerMenu.insuranceFund":["Insurance Fund"],"commonScreen.drawerMenu.knowledgeBase":["Knowledge Base"],"commonScreen.drawerMenu.learnMore":["Learn more"],"commonScreen.drawerMenu.metrics":["Metrics"],"commonScreen.drawerMenu.metricsFutures":["Metrics Futures"],"commonScreen.drawerMenu.metricsOptions":["Metrics Options"],"commonScreen.drawerMenu.movePositions":["Move Positions"],"commonScreen.drawerMenu.phoneBrokerClients":["Clients"],"commonScreen.drawerMenu.phoneBrokers":["Brokers"],"commonScreen.drawerMenu.pnlAnalysis":["PNL Analysis"],"commonScreen.drawerMenu.portfolioMargin":["Portfolio Margin"],"commonScreen.drawerMenu.positionBuilder":["Position Builder"],"commonScreen.drawerMenu.standardMargin":["Standard Margin"],"commonScreen.drawerMenu.strategyTrading":["Strategy"],"commonScreen.drawerMenu.subAccounts":["Subaccounts"],"commonScreen.drawerMenu.telegramSupportGroup":["Telegram Support Group"],"commonScreen.drawerMenu.transactionLog":["Transaction Log"],"commonScreen.drawerMenu.transfer":["Transfer"],"commonScreen.drawerMenu.volatilityIndex":["Volatility Index (DVOL)"],"commonScreen.drawerMenu.wallet":["Wallet"],"commonScreen.drawerMenu.withdraw":["Withdraw"],"commonScreen.dropdownFutureSpreads.longLeg":["Long Leg"],"commonScreen.dropdownFutureSpreads.shortLeg":["Short Leg"],"commonScreen.dropdownFutures.all":["All"],"commonScreen.dropdownSearch.24hChange":["24h Change"],"commonScreen.dropdownSearch.24hVolume":["24h Volume"],"commonScreen.dropdownSearch.24hVolumeCoin":["24h Volume (coin)"],"commonScreen.dropdownSearch.24hVolumeUSD":["24h Volume USD"],"commonScreen.dropdownSearch.contracts":["Contracts"],"commonScreen.dropdownSearch.pair":["Pair"],"commonScreen.dropdownSearch.price":["Price"],"commonScreen.dropdownSearch.settlement":["Settlement"],"commonScreen.email.invalid":["Email address is invali
2103d"],"commonScreen.email.required":["Email is required"],"commonScreen.error.-32000-mmp_missing_params":["At least one of Quantity Limit, Delta Limit, or Vega Limit must have a value."],"commonScreen.error.-32602-change_margin_model_not_allowed":["Change margin model is not allowed"],"commonScreen.error.-32602-duplicate_block_rfq":["Block RFQ structure already exists."],"commonScreen.error.-32602-expires_at_exceeds_expiration_time":["Timer value exceeds Block RFQ lifetime"],"commonScreen.error.-32602-invalid-iceberg-ratio":["Invalid iceberg ratio"],"commonScreen.error.-32602-invalid_iv_price":["IV for advanced order cannot be greater than 499%"],"commonScreen.error.-32602-must_conform_to_tick_size":["Price has to be rounded to a certain tick size."],"commonScreen.error.-32602-not_allowed_for_direct_access_users":["Not allowed for direct access users"],"commonScreen.error.-32602-not_allowed_for_direct_access_users-with-param":["Not allowed for direct access users. Param: ",["param"]],"commonScreen.error.-32602-private_buy_sell_value_too_high":["The price is too high."],"commonScreen.error.-32602-private_buy_sell_value_too_large":["The size is too large."],"commonScreen.error.-32602-private_buy_sell_value_too_low":["The price is too low."],"commonScreen.error.-32602-too-small-iceberg-amount":["Too small iceberg amount"],"commonScreen.error.-32602-too-small-iceberg-total-amount":["Too small iceberg total amount"],"commonScreen.error.-32602-used_by_a_different_user":["This broker code is already used by a different user."],"commonScreen.error.10003":["Order overlap is found and self-trading is not permitted."],"commonScreen.error.10005":["Currently the lowest acceptable price is ",["price"]],"commonScreen.error.10007":["Currently the highest acceptable price is ",["price"]],"commonScreen.error.10013":["Total limit of open orders has been exceeded, it is applicable for PME users."],"commonScreen.error.10028-create_combo_too_many_requests":["You have reached the max number of combos you can create in a certain time interval. Please try again in 1 to 2 days."],"commonScreen.error.10030-close_position":["Request rejected - a position closing order already exists"],"commonScreen.error.10038":["Reached max number of PME risk-reducing orders."],"commonScreen.error.10039":["Account has not enough funds in ",["currency"]," currency for this operation."],"commonScreen.error.10043":["Price has to be rounded to a certain tick size."],"commonScreen.error.10043extended":["The price for ",["instrument_name"]," has to be multiple of ",["limit"]],"commonScreen.error.10055":["The block trade has been already used or invalidated by the creator."],"commonScreen.error.10057":["Your order exceeds the maximum future position size in base currency."],"commonScreen.error.10072":["Disabled while position lock"],"commonScreen.error.11013":["Rejected, maximum number of open orders on spot for ",["currency"]," is ",["limit"]],"commonScreen.error.11020":["Rejected, maximum number of open orders per instrument reached."],"commonScreen.error.11021":["Price modification for post only order is not possible"],"commonScreen.error.11022":["Maximum order amount for this instrument is ",["maxAmount"]],"commonScreen.error.11030-forbidden_by_risk_profile":["This operation is forbidden by your risk profile"],"commonScreen.error.11030-invalid_show_to_total_ratio":["The ratio between total amount and display amount is invalid"],"commonScreen.error.11030-show_too_small":["Display amount is too small"],"commonScreen.error.11031":["Trading is currently disabled for this instrument."],"commonScreen.error.11031-account_locked":["Your account is locked."],"commonScreen.error.11035-no_more_triggers":["Allowed amount of trigger orders has been exceeded."],"commonScreen.error.11036":["Invalid trigger price"],"commonScreen.error.11050-block_rfq_combo_price_too_high":["The combo price for this strategy needs to be smaller than 0."],"commonScreen.error.11050-block_rfq_combo_price_too_low":["The combo price for this strategy needs to be bigger than 0."],"commonScreen.error.11050-block_trade_already_cancelled":["Trade is not available anymore"],"commonScreen.error.11050-company_cannot_be_onboarded_not_regulated_not_exempt":["Company cannot be onboarded as it is not regulated and not exempt from regulated activities."],"commonScreen.error.11050-failed-to-calculate-leg-prices":["Could not calculate individual leg prices, please enter them manually."],"commonScreen.error.11050-invalid-coupon-code":["The coupon code is invali
2103d, expired or has been already activated."],"commonScreen.error.11050.noIncrementalOTOEditing":["It is not possible to edit this type of order. To change the details of this order, you will need to cancel it and place a new order with the desired settings."],"commonScreen.error.11093":["Only one new address per day is allowed"],"commonScreen.error.11095.disabledDepositAddressCreation":["Creation of deposit addresses is disabled."],"commonScreen.error.11095.unverified":["Creation of new deposit addresses is not available until verification is done."],"commonScreen.error.11096":["The address belongs to the user"],"commonScreen.error.11098":["Your account is locked."],"commonScreen.error.12001":["Limit of subaccounts has been reached."],"commonScreen.error.12007-has_active_block_rfq":["Subaccount not removed because it has an active Block RFQ"],"commonScreen.error.12007-has_not_zero_equity":["Subaccount not removed because it has non-zero equity"],"commonScreen.error.12007-has_pending_deposits":["Subaccount not removed because it has at least one pending deposit"],"commonScreen.error.12007-is_linked_to_voice_broker":["Subaccount not removed because it is linked to a broker"],"commonScreen.error.12007-is_owner_of_app":["Subaccount not removed because it is the owner of a registered application"],"commonScreen.error.12007-is_part_of_block_rfq_allocation":["Subaccount not removed because it is part of a Block RFQ allocation"],"commonScreen.error.13012-subaccount_without_login_ability":["You cannot add a security key for a subaccount without login rights."],"commonScreen.error.13021-starbase_member":["Unable to update member."],"commonScreen.error.13021-unsatisfied-margin-model-requirements":["Unsatisfied margin model requirements."],"commonScreen.error.13022":["Withdrawals are disabled"],"commonScreen.error.13023":["Limit of API keys has been reached."],"commonScreen.error.13028":["The verification is temporarily unavailable, please try again later"],"commonScreen.error.13028-default":["There was an error when submitting the application."],"commonScreen.error.13028-failed_to_cancel_starbase_orders":["Cancelling Starbase orders is temporarily unavailable. Please try again later."],"commonScreen.error.13028-missing_corporate_details":["No data has been sent."],"commonScreen.error.13028-missing_corporate_details_field":["There is some data missing: ",["field"],"."],"commonScreen.error.13028-missing_corporate_file":["Not all required fields have been provided: ",["file"],"."],"commonScreen.error.13028-missing_corporate_files":["In Step 2 there are corporate files that are not uploaded."],"commonScreen.error.13028-missing_ubo_details":["There are missing UBO details: ",["field"],"."],"commonScreen.error.13028-missing_ubo_file":["A UBO file is missing: ",["file"],"."],"commonScreen.error.13028-missing_verification_data":["Please select and save your Nationality and Country of Birth in Step 1\\nfirst."],"commonScreen.error.13028-too_close_to_settlement":["You cannot create a combo close to settlement."],"commonScreen.error.13030":["MMP has been triggered"],"commonScreen.error.13031":["Verification required"],"commonScreen.error.13034":["Limit of security keys has been reached."],"commonScreen.error.13035":["Limit of active Combos has been reached."],"commonScreen.error.13036":["Creating combo and orders on combo for specified instruments is currently unavailable."],"commonScreen.error.13041":["You can not trade this product"],"commonScreen.error.13401":["Restrictions for your residence country apply"],"commonScreen.error.13668-challenge_timeout":["Time to confirm the action has expired. Please try again."],"commonScreen.error.13672-invalid_activation_challenge":["The time for adding the security key (5 min) is over. Please try again."],"commonScreen.error.13673":["There must be at least one security key with the wallet assignment"],"commonScreen.error.13675":["There must be at least one security key with the login assignment"],"commonScreen.error.13676":["There must be at least one security key in your account"],"commonScreen.error.13776":["Coupon activation over limit"],"commonScreen.error.13781":["Coupon has already been used."],"commonScreen.error.13791":["Sharing KYC data with third party provider has been already initiated"],"commonScreen.error.13792":["KYC data that we have is insufficient for sharing according to the third party provider. Please try to complete your verification profile."],"commonScreen.error.13793":["Unable to access your KYC data at the moment. Please try again later."],"commonScreen.error.13800":["Resend activation mail over limit"],"commonScreen.error.13815":["Secondary email already exists"],"commonScreen.error.13816":["Secondary email already removed"],"commonScreen.error.13900":["The system is busy now. Please try again later."],"commonScreen.error.13901":["The maximum number of OTO orders (",["0"],") are already open."],"commonScreen.error.13905":["Maximum number of quotes reached for this Block RFQ"],"commonScreen.error.13906":["Maximum number of quotes reached for this Block RFQ side"],"commonScreen.error.13907-block_rfq_not_fully_filled":["Order could not be fully filled."],"commonScreen.error.13911":["Limit of clients created by a broker reached."],"commonScreen.error.13912":["Broker can't become a client of another broker."],"commonScreen.error.13913":["Your account is already linked to this broker."],"commonScreen.error.13917-account_quote_limit_crossed":["You have reached the quote limit for ",["formattedCurrencyPair"]," ",["kind"],"."],"commonScreen.error.13917-account_quote_limit_crossed-max_amount":["The maximum amount is ",["maxAmount"]," ",["maxAmountCurrency"]],"commonScreen.error.13917-account_quote_limit_crossed-max_spread":["The maximum spread is ",["maxSpreadPercentage"],"%"],"commonScreen.error.13917-account_quote_limit_crossed-quote_disabled":["Quoting is disabled for ",["formattedCurrencyPair"]," ",["kind"],"."],"commonScreen.error.13919":["Subaccounts of a broker 
2103cannot be onboarded as their client."],"commonScreen.error.13921":["Trading is currently disabled for this instrument."],"commonScreen.error.maxSpotOrderQuantity":["Rejected, maximum open orders quantity on spot for ",["currency"]," is ",["limit"]],"commonScreen.error.maximumFuturePositionSizeExceeded":["Maximum future position size of ",["maxAmount"]," exceeded for ",["instrumentName"],"."],"commonScreen.error.notEnoughFunds":["Account has not enough funds for the operation."],"commonScreen.error.retryLoginAfter":["Please retry to log in after ",["wait"]],"commonScreen.footer.24hTotalVol":["24h total volume:"],"commonScreen.footer.24hVol":["24h vol."],"commonScreen.footer.futuresVol":["Futures volume:"],"commonScreen.footer.optionsVol":["Options volume:"],"commonScreen.footer.privacySettings":["Cookie Settings"],"commonScreen.form.error.invalidUrlFormat":["Invalid URL format"],"commonScreen.form.error.required":["This field is required"],"commonScreen.initialMargin":["Initial Margin Ratio"],"commonScreen.initialMargin.description":["Initial Margin Ratio = Initial Margin / Margin Balance. A value greater than or equal to 100% means you have allocated all your Margin Balance as margin, and hence have no available balance to use for increasing your position"],"commonScreen.initialMargin.descriptionPortfolioMargin":["Initial Margin Ratio = Initial Margin / Equity. A value greater than or equal to 100% means you have allocated all your Equity as margin, and hence have no available balance to use for increasing your position"],"commonScreen.maintenanceMargin":["Maintenance Margin Ratio"],"commonScreen.maintenanceMargin.description":["Maintenance Margin Ratio = Maintenance Margin / Margin Balance. A value greater than or equal to 100% means your account is under liquidation since you don't have enough Margin Balance to maintain your current positions"],"commonScreen.maintenanceMargin.descriptionPortfolioMargin":["Maintenance Margin Ratio = Maintenance Margin / Equity. A value greater than or equal to 100% means your account is under liquidation since you don't have enough Equity to maintain your current positions"],"commonScreen.marginBreached.forAllAccounts":["Margin breach across this account. ",["time"]," until autoliquidation. Please refill in any currency on any of your accounts."],"commonScreen.marginBuffer.actualUtilization":["Actual Utilization"],"commonScreen.marginBuffer.actualUtilizationDescription":["Calculated as Max(0, Unscaled Maintenance Margin - Margin Balance). Unscaled Maintenance Margin = Maintenance Margin / Maintenance Margin Scaledown Multiplier. A negative Actual Utilization means that the client is not using the Margin Scaledown facility currently. It is shown as an indication of how close one is to actually using the Margin Scaledown"],"commonScreen.marginBuffer.au":["AU"],"commonScreen.marginBuffer.im":["IM"],"commonScreen.marginBuffer.maxUsage":["Max Usage"],"commonScreen.marginBuffer.maxUsageDescription":["Utilization: ",["0"],"%"],"commonScreen.marginBuffer.mm":["MM"],"commonScreen.marginBuffer.mu":["MU"],"commonScreen.marginBuffer.state":["State"],"commonScreen.marginBuffer.stateTooltipA":["A (Standard Liquidation: review type active, if state=active)"],"commonScreen.marginBuffer.stateTooltipDL":["DL (Countdown, if state=active_countdown)"],"commonScreen.marginBuffer.stateTooltipL":["L (Under Liquidation, if state=active_under_liquidation)"],"commonScreen.marginBuffer.stateTooltipS":["S (Standard Liquidation: review type inactive, if state=inactive)"],"commonScreen.marginTooltip.crossPortfolioMargin":["Cross: Portfolio Margin"],"commonScreen.marginTooltip.crossPortfolioMarginDescription":["This is a Cross: Portfolio Margin account. \\nThis means that all Cross currencies are used as collateral for your positions and that your portfolio is margined as a whole."],"commonScreen.marginTooltip.crossStandardMargin":["Cross: Standard Margin"],"commonScreen.marginTooltip.crossStandardMarginDescription":["This is a Cross: Standard Margin account. \\nThis means that all Cross currencies are used as collateral for your positions and that positions are independent."],"commonScreen.marginTooltip.segregatedPortfolioMargin":["Segregated: Portfolio Margin"],"commonScreen.marginTooltip.segregatedPortfolioMarginDescription":["This is a Segregated: Portfolio Margin account.\\nThis means that only your settlement currency is used as collateral for your positions and that your portfolio is margined as a whole."],"commonScreen.marginTooltip.segregatedStandardMargin":["Segregated: Standard Margin"],"commonScreen.marginTooltip.segregatedStandardMarginDescription":["This is a Segregated: Standard Margin account.\\nThis means that only your settlement currency is used as collateral for your positions, and those positions are independent."],"commonScreen.movePositions.amountIsLargerThanPositionSizeFor":["Amount is larger than position size for ",["instrumentName"],"."],"commonScreen.movePositions.cannotMovePositions":["Cannot move position/positions. Some unex
2103pected error occurs. Please try again later."],"commonScreen.movePositions.movePositionsOverLimit":["Move positions over limit.\\n"],"commonScreen.movePositions.mustBeMultipleOfContractSizeFor":["Must be a multiple of contract size for ",["instrumentName"],"."],"commonScreen.movePositions.noOpenPositionFor":["No open position for ",["instrumentName"],"."],"commonScreen.movePositions.priceForTradeIsHigherThanMaxBuyPriceFor":["Price for trade is higher than max buy price for ",["instrumentName"],"."],"commonScreen.movePositions.priceForTradeIsLowerThanMinSellPriceFor":["Price for trade is lower than min sell price for ",["instrumentName"],"."],"commonScreen.movePositions.temporarilyUnavailable":["Temporarily unavailable"],"commonScreen.navigationBar.brokerage":["Brokerage"],"commonScreen.navigationBar.combos":["Combos"],"commonScreen.navigationBar.futures":["Futures"],"commonScreen.navigationBar.futuresAndPerpetuals":["Futures and Perpetuals"],"commonScreen.navigationBar.options":["Options"],"commonScreen.navigationBar.perpetuals":["Perpetuals"],"commonScreen.navigationBar.spot":["Spot"],"commonScreen.notes.conflictDialog.description":["Changes have been made to this note in another browser tab or window."],"commonScreen.notes.conflictDialog.keepLocalVersion":["Keep local version"],"commonScreen.notes.conflictDialog.remoteVersion":["Remote version"],"commonScreen.notes.conflictDialog.title":["Note conflict"],"commonScreen.notes.conflictDialog.useRemoteVersion":["Use remote version"],"commonScreen.notes.error.conflict":["Note conflict"],"commonScreen.notes.error.noteLengthLimitExceeded":["You exceeded ",["0"]," chars note limit."],"commonScreen.notes.error.noteNoteFound":["Note not found."],"commonScreen.notes.error.unableToFetch":["Unable to load a note."],"commonScreen.notes.error.unableToSave":["Unable to save the note. <0>Try again</0>."],"commonScreen.notes.status.loading":["Loading..."],"commonScreen.notes.status.saved":["Saved"],"commonScreen.notes.status.saving":["Saving..."],"commonScreen.notificationTags.buy":["Buy"],"commonScreen.notificationTags.new":["New"],"commonScreen.notificationTags.orderFilled":["Order Filled"],"commonScreen.notificationTags.sell":["Sell"],"commonScreen.openOrders.cancel":["Cancel"],"commonScreen.openOrders.cancelAll":["Cancel all open orders"],"commonScreen.pagination.noResults":["No results"],"commonScreen.pagination.perPage":["Per page:"],"commonScreen.pagination.resultsCount":[["start"],"-",["end"]," of ",["total"]],"commonScreen.portfolioMargin.effectiveEquityMargin":["Effective Equity Margin"],"commonScreen.portfolioTooltip.bucket":["Bucket"],"commonScreen.portfolioTooltip.priceLabel":["Price:"],"commonScreen.portfolioTooltip.vol":["Vol"],"commonScreen.portfolioTooltip.worstCaseScenarioTitle":["Worst Case Scenario"],"commonScreen.realWorldAssetWarning.footnote":["Read the full <0>Risk Disclosure</0> before confirming."],"commonScreen.realWorldAssetWarning.message":["By clicking <0>\\"Confirm\\"</0> you acknowledge that you have read and understand the potential risks associated with trading real world asset perpetuals."],"commonScreen.realWorldAssetWarning.title":["Real World Asset Perpetuals Risk Acknowledgement"],"commonScreen.resetPasswordForm.confirmPasswordIsRequired":["Confirm your new password"],"commonScreen.resetPasswordForm.passwordIsRequired":["Password is required"],"commonScreen.resetPasswordForm.passwordsDoNotMatch":["Passwords must match"],"commonScreen.restoreLayoutConfirmModal.confirmText":["Yes"],"commonScreen.restoreLayoutConfirmModal.content":["Are you sure you would like to restore the default layout?"],"commonScreen.restoreLayoutConfirmModal.title":["Warning"],"commonScreen.security.errors.activationFailure":["Could not activate the security key"],"commonScreen.security.errors.activationParamsFailure":["Could not get activation params"],"commonScreen.security.errors.genericFailure":["Could not finish security key setup"],"commonScreen.security.errors.registerFailure":["Could not register the passkey"],"commonScreen.security.errors.timeout":["The security key setup process has timed out"],"commonScreen.security.errors.unsupportedMethodFailure":["Unsupported security ke
2103y method"],"commonScreen.security.securityKeySetup.activationTimeRemaining":["Time remaining: <0>",["authProcessRemainingTime"],"</0>"],"commonScreen.security.securityKeySetup.addSuccessMessage":["Security key was added successfully"],"commonScreen.security.securityKeySetup.appConfigureBody":["Open the 2FA app and add your account by scanning the QR code"],"commonScreen.security.securityKeySetup.banner.description.one":["<0>Login management:</0> logging in to the platform."],"commonScreen.security.securityKeySetup.banner.description.three":["<0>Wallet management:</0> withdrawals, adding and removing withdrawal addresses, transfers."],"commonScreen.security.securityKeySetup.banner.description.two":["<0>Account management:</0> this is the master key that is needed to add, remove and change assignments of security keys; needed for other account-related actions like managing API keys or subaccounts."],"commonScreen.security.securityKeySetup.banner.title'":["Security keys can be assigned to:"],"commonScreen.security.securityKeySetup.nameFormatError":["Incorrect format. Must consist only of letters, numbers, dashes or underscores"],"commonScreen.security.securityKeySetup.nameHint":["You can choose any name for your security key, for example: FirstKey, WalletKey, AccountKey."],"commonScreen.security.securityKeySetup.nameLabel.securityKey":["Set a unique name for the security key:"],"commonScreen.security.securityKeySetup.options.2fa.description":["Secure your Deribit account using a two-factor authentication App like Google Authenticator."],"commonScreen.security.securityKeySetup.options.2fa.title":["Add Auth App 2FA"],"commonScreen.security.securityKeySetup.options.tfa.actionLabel":["Add 2FA App"],"commonScreen.security.securityKeySetup.options.u2f.actionLabel":["Add PassKey"],"commonScreen.security.securityKeySetup.options.u2f.description":["Secure your Deribit account using just your fingerprint, face, screen lock, or security key. Passkeys can be created on your devices or on security keys."],"commonScreen.security.securityKeySetup.options.u2f.title":["Add PassKey"],"commonScreen.security.securityKeySetup.qrCodeAlternative":["If you cannot use a QR code, enter this text code:"],"commonScreen.security.securityKeySetup.sixDigitCodeHintText":["Enter the 6-digit code generated by the app:"],"commonScreen.securityKeyConfirmation.confirmWithPasskey":["Confirm with Passkey"],"commonScreen.securityKeyConfirmation.enter2faCode":["Enter 2FA code"],"commonScreen.securityKeyConfirmation.error.invalidTfaCode":["You've provided an invalid 2FA code. Please verify that you are using the proper security key."],"commonScreen.securityKeyConfirmation.error.tooManyTfaAttempts":["You have made too many failed attempts, please wait ",["0"]," seconds and try again."],"commonScreen.securityKeyConfirmation.pleaseProvide2faFromOneOfYourKeys":["Please provide 2FA from one of your keys:"],"commonScreen.securityKeyConfirmation.title":["Confirm action"],"commonScreen.securityKeyConfirmation.useYourPasskey":["Use your Passkey:"],"commonScreen.settingsMenu.customTabs":["Custom tabs"],"commonScreen.settingsMenu.dark":["Dark Theme"],"commonScreen.starbasePtrMargin.description":["Used Balance Ratio = Used Balance / Available Balance. Available: ",["available"],". Used: ",["used"],"."],"commonScreen.starbasePtrMargin.title":["Starbase Available Balance Usage"],"commonScreen.subaccounts.confirmPasswordIsRequired":["Confirm your new password"],"commonScreen.subaccounts.passwordIsRequired":["Password is required"],"commonScreen.subaccounts.passwordsDoNotMatch":["Passwords must match"],"commonScreen.turningOnAutoliquidation.forAllAccounts":["Turning on autoliquidation for all currencies on all your accounts."],"commonScreen.typeMarginStandardTitle":["This account is a Standard Margin account. This means that positions are independent and long option positions are fully funded (hence long options can't ever be liquidated)."],"commonScreen.validation.maxFourDecimals":["The value can have at most 4 decimal places"],"commonScreen.validation.valueHasToBeNonnegativeNumber":["The value has to be a non-negative number."],"commonScreen.validation.valueMustBeGreaterThanZero":["The value must be greater than zero."],"commonScreen.validation.wholeNumber":["The value has to be a whole number."],"commonScreen.welcome.lastLogin":["Your last login 
2103was on ",["0"]," UTC from ",["ip"]," near ",["city"],", ",["country"]],"commonScreen.welcome.title":["Welcome back, ",["username"]],"commonScreen.widgets.AccountSummary.currencyOrValue":["Currency / Value"],"commonScreen.widgets.AccountSummary.name":["Account Summary"],"commonScreen.widgets.AccountSummary.valueOrCurrency":["Value / Currency"],"commonScreen.widgets.BlockRfq.name":["Block RFQ"],"commonScreen.widgets.Margin.name":["Margin"],"commonScreen.widgets.OpenOrders.name":["Open Orders"],"commonScreen.widgets.PlatformTime.name":["Platform Time"],"commonScreen.widgets.PriceDvol.funding8h":["Funding/8h."],"commonScreen.widgets.PriceDvol.indexPriceTooltip":[["currency"]," Index Price: $",["indexPrice"]],"commonScreen.widgets.PriceDvol.nameOnlyIndex":[["currency"]," Index"],"commonScreen.widgets.Subaccounts.name":["Subaccounts"],"commonScreen.widgets.TimeTillSettlement.name":["Time Till Settlement"],"commonScreen.widgets.UserId.name":["User ID"],"couponActivationScreen.title":["Coupon Activation"],"dashboard.accountDetails.buyCrypto":["Buy Crypto"],"dashboard.accountDetails.hideTotalAccountValue":["Hide total account value"],"dashboard.accountDetails.showTotalAccountValue":["Show total account value"],"dashboard.accountDetails.totalAccountValue":["Total Account Value"],"dashboard.accountDetails.userId":["User ID:"],"dashboard.accountDetails.username.tag.main":["main"],"dashboard.accountDetails.username.tag.subaccount":["subaccount"],"dashboard.accountDetails.wallet":["Wallet"],"dashboard.affiliate.agreeTermsAndConditions":["I agree with the <0>Terms and Conditions</0>. Click to enable the Affiliate Program."],"dashboard.affiliate.buttonEnable":["Enable"],"dashboard.affiliate.cancel":["Cancel"],"dashboard.affiliate.copyLink":["Share Personal Link"],"dashboard.affiliate.disabled":["The affiliate program is OFF for your account."],"dashboard.affiliate.enable":["Enable"],"dashboard.affiliate.referredUsers":["Referred Users"],"dashboard.affiliate.shareLinkWithFriends":["Please share the link with friends, family and other traders to promote our exchange:"],"dashboard.affiliate.title":["Affiliate Dashboard"],"dashboard.affiliate.totalPayout":["The total payout to you as an affiliate:"],"dashboard.deribitAcademy.description":["Dive into free online courses exploring crypto derivatives trading fundamentals and techniques."],"dashboard.deribitAcademy.outOfOffice.description":["Welcome to \\"Out of Office\\", an exciting and dynamic YouTube show hosted by the charismatic Lilly! Join us as Lilly attends various crypto events, armed with a box full of cards containing intriguing questions and rumors about the crypto world."],"dashboard.deribitAcademy.outOfOffice.title":["Out of Office"],"dashboard.deribitAcademy.staticItem.creatorDescription":["Educator"],"dashboard.deribitAcademy.title":["Deribit Academy"],"dashboard.news.tab.economicCalendar":["Economic Calendar"],"dashboard.news.tab.latestNews":["Latest News"],"dashboard.pageTitle":["Dashboard"],"dashboard.section.support.knowledgeBase.subtitle":["Our library with the most important documentation about Deribit."],"dashboard.section.support.knowledgeBase.title":["Knowledge Base"],"dashboard.section.support.liveChat.subtitle":["Access our Live Chat via our Exchange"],"dashboard.section.support.liveChat.title":["In-App Live Chat"],"dashboard.section.support.telegramSupport.subtitle":["Our main Support channel in English, Chinese and Russian."],"dashboard.section.support.telegramSupport.title":["Telegram Support 24/7"],"dashboard.section.support.title":["Support"],"dashboard.section.tradingTools.deribitMetrics.subtitle":["Essential futures/options charts and statistics for trading."],"dashboard.section.tradingTools.deribitMetrics.title":["Deribit Metrics"],"dashboard.section.tradingTools.optionWizard.subtitle":["Find the best option for your price forecast."],"dashboard.section.tradingTools.optionWizard.title":["Option Wizard"],"dashboard.section.tradingTools.positionBuilder.subtitle":["Tool that simulate positions and view profit/ loss chart."],"dashboard.section.tradingTools.positionBuilder.title":["Position Builder"],"dashboard.section.tradingTools.testnet.subtitle":["Perfecting Strategies, Minimizing Risk"],"dashboard.section.tradingTools.testnet.title":["TestNet"],"dashboard.section.tradingTools.title":["Trading Tools"],"dashboard.sharePositionAnnouncement.body":["Easily showcase your trading journey from the Dashboard Position Table by clicking the share icon or accessing the context menu in the Positions Table with a right-click."],"dashboard.sharePositionAnnouncement.title":["New Feature: <0/>Shareable Profit & Loss Cards."],"dashboard.usdtModal.buttonClose":["Close"],"dashboard.whatsHot.header.n
2103ameAndVolume":["Name / 24h Volume"],"dashboard.whatsHot.header.priceAnd24Percentage":["Price / 24h%"],"dashboard.whatsHot.sortOrder.gainers":["Top performing"],"dashboard.whatsHot.sortOrder.losers":["Worst performing"],"dashboard.whatsHot.sortOrder.volume":["Highest volume"],"dashboard.whatsHot.title":["What's Hot Today"],"dashboard.yourAssets.action":["Action"],"dashboard.yourAssets.coin":["Coin"],"dashboard.yourAssets.netAssetValue":["Net Asset Value"],"dashboard.yourAssets.price":["Price"],"dashboard.yourAssets.title":["Your Assets"],"dashboard.yourAssets.value":["Value"],"dashboard.yourTrades.table.amount":["Amount"],"dashboard.yourTrades.table.futureSpread":["Future Spread"],"dashboard.yourTrades.table.instrument":["Instrument"],"dashboard.yourTrades.table.markPrice":["Mark Price"],"dashboard.yourTrades.table.price":["Price"],"dashboard.yourTrades.table.roi":["ROI"],"dashboard.yourTrades.table.sizeCrypto":["Value"],"dashboard.yourTrades.table.type":["Type"],"dashboard.yourTrades.title":["Your Trading"],"dashboard.yourtrades.tab.expiryGreeks":["Expiry Greeks"],"dashboard.yourtrades.tab.openOrders":["Open Orders"],"dashboard.yourtrades.tab.positions":["Positions"],"dashboard.yourtrades.tab.yourTrades":["Your Trades"],"documentType.AP":["Alipay Balance & Assets Certificate"],"documentType.BS":["Bank statement"],"documentType.CB":["Council bill"],"documentType.CCS":["Credit card statement"],"documentType.MOAP":["Mortgage application"],"documentType.TR":["Tax return"],"documentType.UB":["Utility bill"],"errorScreen.notFound.helpDocumentation":["Help/Documentation"],"errorScreen.notFound.subtitle":["We can't find the page you're looking for. Check out ",["docsLink"]," or head back ",["homeLink"],"."],"errorScreen.notFound.title":["404 Page Not Found"],"errorScreen.overLimit.subtitle":["Please refresh the page. The limit is shared between open browser tabs and windows, so you might also have to close some of them."],"errorScreen.overLimit.title":["API rate limit exceeded"],"landingScreen.common.yourAccountHasBeenConfirmed":["Your account has been confirmed"],"landingScreen.common.yourAccountHasNotBeenActivated":["Your account has not been activated. Check your email for the activation link. If not, your account might already be activated."],"login.promoDescription":["Set up your account to get started on trading crypto."],"login.promoTitle":["Start Trading Crypto Options, Perpetuals and Futures."],"login.promoTitle.gb":["Crypto Options, Perpetuals, and Futures."],"loginForm.action.emailConfirmation":["E-mail confirmation"],"loginForm.action.forgotPassword":["Forgot your password?"],"loginForm.action.login":["Log In"],"loginForm.action.loginApi":["Log In with API keys"],"loginForm.action.loginWithApple":["Log in with Apple"],"loginForm.action.loginWithGoogle":["Log in with Google"],"loginForm.action.resendActivationLink":["Resend activation mail?"],"loginForm.action.resetPassword":["Reset Password"],"loginForm.action.setPassword":["Create a password"],"loginForm.action.setUpPassword":["Set up new password"],"loginForm.action.signInWithCoinbaseAccount":["Sign in with Coinbase INTX Account"],"loginForm.action.signUp":["Create an account"],"loginForm.alreadyHaveAnAccount":["Already have an account?"],"loginForm.apiSignIn":["Log In with API Credentials"],"loginForm.apply":["Apply"],"loginForm.checkEmail":["It's time to check your email!"],"loginForm.clientId":["Client Id"],"loginForm.clientSecret":["Client Secret"],"loginForm.confirmPassword":["Confirm password"],"loginForm.continue":["Continue"],"loginForm.countryOfResidence":["Country of residence"],"loginForm.dontHaveAccount":["Don't have an account?"],"loginForm.email":["Email"],"loginForm.enterTfaCode":["Enter 2FA Code"],"loginForm.error.setPassword":["An error occurred while setting the password"],"loginForm.forgotPassword":["Forgot your password?"],"loginForm.hidePassword":["Hide password"],"loginForm.login":["Log in"],"loginForm.passkey":["Passkey"],"loginForm.password":["Password"],"loginForm.password.characters":["12+ characters"],"loginForm.password.digit":["a digit"],"loginForm.password.symbol":["symbol"],"loginForm.password.uppercaseLetter":["uppercase letter"],"loginForm.referralCode":["Referral Code (optional)"],"loginForm.register":["Register"],"loginForm.resendActivationLink":["Resend activation link"],"loginForm.securityKeyAdded":["Security ke
2103y has been added. Please log in"],"loginForm.showPassword":["Show password"],"loginForm.tfa.enableMessage":["Enable mandatory 2FA:"],"loginForm.tfa.skip.body":["You can skip 2FA set up for now to explore the platform. Although be able to deposit funds we will require mandatory 2FA set up"],"loginForm.tfa.skip.question":["Do you want to skip 2FA?"],"loginForm.twoFACode":["2FA Code"],"loginForm.username":["Username"],"loginScreen.forgotPassword.sentAnEmailToResetPassword":["We have sent an email to reset your password to the provided email, if it exists in our database."],"loginScreen.loginForm.accountClosed":["Your account has been closed."],"loginScreen.loginForm.checkMailboxToResetPassword":["Please check your mailbox to reset the password."],"loginScreen.loginForm.error.insufficientScopesForLogin":["Insufficient scopes of API Credentials for login"],"loginScreen.loginForm.error.invalidEmail":["Invalid email"],"loginScreen.loginForm.error.required":["This field is required"],"loginScreen.loginForm.error.tfaCode":["Enter a six-digit code"],"loginScreen.loginForm.invalidCredentialsHasBeenUsed":["Invalid credentials have been used or the current IP does not match the IP Whitelist."],"loginScreen.loginForm.loginLocked":["Login locked - please contact Support to unlock the account."],"loginScreen.loginForm.register":["Register"],"loginScreen.loginForm.wrongUserNamePasswordTFAOrInavctiveAccount":["Wrong username, password, 2FA or the account has not been activated yet."],"loginScreen.loginForm.yubiKeyError":["You've used an invalid Passkey, you've used the Passkey incorrectly, you've cancelled Passkey authorization or you've used Passkey when it is not needed. Please try again."],"loginScreen.resendActivationMailForm.weSentAnEmailWithActivationLink":["We sent an email with an activation link to the provided email if your account has not been activated yet."],"maintenanceScreen.footer.allRightsReserved":["All rights reserved"],"maintenanceScreen.footer.copyright":["Copyright"],"maintenanceScreen.primaryButton":["Contact Us"],"maintenanceScreen.serviceUnavailable.subtitle":["Sorry, we're performing maintenance."],"maintenanceScreen.serviceUnavailable.title":["Service Unavailable"],"maintenanceScreen.subtitle":["We're currently busy with updating our platform."],"maintenanceScreen.subtitle.checkBack":["Please check back soon."],"maintenanceScreen.title":["Scheduled Maintenance"],"modalLanguage.subtitle":["Choose your preferred interface language."],"modalLanguage.title":["Language Change"],"notification.order.cancelledOrders":["Cancelled ",["0"]," orders"],"notification.order.orderCancelled":["Order Cancelled"],"notification.order.orderEdited":["Order Edited"],"notification.order.orderSubmitted":["Order Submitted"],"notification.order.ordersCancelled":["Orders Cancelled"],"notification.orderCancelled.admin":["Canceled by the exchange"],"notification.orderCancelled.brokerCancel":["Your order was canceled"],"notification.orderCancelled.fullyFilled":["Fully filled"],"notification.orderCancelled.highBidLimit":["Bid price exceeded the limit"],"notification.orderCancelled.insufficientFunds":["Insufficient funds"],"notification.orderCancelled.insufficientLiquidity":["Insufficient liquidity"],"notification.orderCancelled.modifyOrder":["Order was modified"],"notification.orderCancelled.orderOverlap":["Order overlap is found and self-trading is not permitted."],"notification.orderCancelled.priceBound":["Price outside allowed range"],"notification.orderCancelled.selfTradePrevention":["Self-trade prevention"],"notification.orderCancelled.timeInForce":["Time in force expired"],"notification.orderCancelled.user":["You canceled this order"],"notification.pendingBlockTrade.approved":["Block trade approved"],"notification.pendingBlockTrade.counterpartyApproved":["Block trade approved by counterparty"],"notification.pendingBlockTrade.counterpartyRejected":["Block trade rejected by counterparty"],"notification.pendingBlockTrade.rejected":["Block trade rejected"],"notification.pendingBrokerTrade.approved":["Brokerage trade approved"],"notification.pendingBrokerTrade.brokerRejected":["Brokerage trade cancelled by broker"],"notification.pendingBrokerTrade.counterpartyApproved":["Brokerage trade approved by counterparty"],"notification.pendingBrokerTrade.counterpartyDeclined":["Brokerage trade declined by counterparty"],"notification.pendingBrokerTrade.declined":["Brokerage trade declined"],"notification.pendingBrokerTrade.expired":["Brokerage trade expired"],"notification.pendingBrokerTradeRequest.cancelled":["Brokerage trade cancelled"],"notification.pendingBrokerTradeRequest.makerApproved":["Brokerage trade approved by ",["partyName"]," (maker)"],"notification.pendingBrokerTradeRequest.makerDeclined":["Brokerage trade declined by ",["partyName"]," (maker)"],"notification.pendingBrokerTradeRequest.takerApproved":["Brokerage trade approved by ",["partyName"]," (taker)"],"notification.pendingBrokerTradeRequest.takerDeclined":["Brokerage trade declined by ",["partyName"]," (taker)"],"notification.systemNotification":["System Notification"],"notification.trade.maker":["maker"],"notification.trade.taker":["taker"],"notification.trade.tradeConfirmation":["Trade Confirmation"],"optionWizard.strategyType.coveredCall":["Covered Call"],"optionWizard.strategyType.longCall":["Long Call"],"optionWizard.strategyType.longPut":["Long Put"],"optionWizardScreen.confirmationModal.confirmOrder":["Confirm Order"],"optionWizardScreen.form.calculate":["5. Calculate"],"optionWizardScreen.form.calculateStrategy":["Calculate Strategy"],"optionWizardScreen.form.chooseCurrency":["1. Choose currency"],"optionWizardScreen.form.error.fetchError":["Error fetching strategy"],"optionWizardScreen.form.error.invali
2103dStrategyDetails":["Invalid strategy details"],"optionWizardScreen.form.error.noStrategyAvailable":["No profitable strategy available for the predicted price"],"optionWizardScreen.form.expectedExpiration":["3. Date of Price Expectation"],"optionWizardScreen.form.expectedPrice":["2. Expected Price"],"optionWizardScreen.form.totalInvestment":["4. Total Investment"],"optionWizardScreen.orderForm.amountError":["You don't have enough available funds to complete the action. Change amount to continue."],"optionWizardScreen.orderForm.max":["Max"],"optionWizardScreen.orderForm.maxAmount":["Max. Amount:"],"optionWizardScreen.results.copyStrategyLink":["Copy Strategy Link"],"optionWizardScreen.results.expectedPNL":["Expected PNL"],"optionWizardScreen.results.expectedPNLUSD":["Expected PNL (USD)"],"optionWizardScreen.results.expectedPrice":["Expected Price"],"optionWizardScreen.results.includedFees":["Incl. fees:"],"optionWizardScreen.results.maxLoss":["Max Loss"],"optionWizardScreen.results.optimalStrategy":["Optimal Strategy"],"optionWizardScreen.results.pnlChartTitle":["Profit & Loss Chart"],"optionWizardScreen.results.reviewOrder":["Review Order"],"optionWizardScreen.results.roi":["Expected ROI%"],"optionWizardScreen.results.totalInvestment":["Total Investment"],"optionWizardScreen.title":["Option Wizard"],"optionWizardScreen.title.tooltipBody":["For additional details on how the Option Wizard operates, please ",["linkToGuide"],"."],"optionWizardScreen.title.tooltipTitle":["Determine the optimal option strategy based on your own price expectations."],"optionWizardScreen.tooltips.call":["A call option is purchased. Long calls benefit when the underlying price increases. If a call is held until expiry, the underlying price must be above the strike price for the call to have any value. The most that can be lost is the price paid for the call option. <0/><1/> Click ",["strategyLink"]," to read more information on call options."],"optionWizardScreen.tooltips.coveredCall":["A call option is sold against a spot position. A premium is received for selling the call, but if the underlying price increases past the strike price, there will be something to pay the buyer of the call. <0/><1/> The sold call is ‘covered’ by the spot position, meaning the number of calls sold should not be larger than the spot position. For example, if a trader holds 2 BTC, they could sell up to 2 call options for this still to be considered a covered call. <2/><3/> Click ",["strategyLink"]," to read more information on covered calls."],"optionWizardScreen.tooltips.expectedPNL":["Your profit at the expected price"],"optionWizardScreen.tooltips.expectedPNLUSD":["Your profit at the expected price in USD value"],"optionWizardScreen.tooltips.expectedROI":["Your expected return on investment"],"optionWizardScreen.tooltips.put":["A put option is purchased. Long puts benefit when the underlying price decreases. If a put is held until expiry, the underlying price must be below the strike price for the put to have any value. The most that can be lost is the price paid for the put option. <0/><1/> Click ",["strategyLink"]," to read more information on put options."],"optionsChain.multiLeg.pnlAtExpiry":["PNL at Expiry"],"optionsChain.multiLeg.pnlNow":["PNL Now"],"optionsChain.multiLeg.resetZoom":["Reset zoom"],"optionsChart.modes.combo":["Combo"],"optionsChart.modes.singleLeg":["Single leg"],"optionsPricer.formResults.disclaimer":["* The results provided are based on assumptions and estimations, and should not be taken as definitive or accurate."],"orderBook.mark":["Mark"],"orderBook.total":["Total"],"pnlChart.changeInPnl":["Change in PNL"],"pnlChart.equity":["Equity"],"pnlChart.expiry":["Expiry"],"pnlChart.ignoreEquity":["Ignore equity"],"pnlChart.index":["Index"],"pnlChart.indexPrice":["Index Price"],"pnlChart.indexPriceChange":["Index Price Change"],"pnlChart.refreshChart":["Refresh Chart"],"pnlChart.today":["Today"],"pnlChart.usePositionBuilder":["Please use <0>Position Builder</0> instead."],"redirect.confirmation.description":["If you trust this link, click to continue."],"redirect.confirmation.goToTelegram":["Go to Telegram"],"redirect.confirmation.telegramConfirmation":["I have read and understood this message."],"redirect.confirmation.telegramWarning":["<0>Please note that this Telegram chat room is hosted on Telegram, not on the Deribit website. Deribit has no control over other users on Telegram, and it is possible for people not associated with Deribit to send private messages on Telegram. You should assume anyone initiating a private conversation on Telegram is a scammer. This remains true even if they have a Deribit picture or name.</0><1>Under no circumstances will Deribit employees ask you to transfer any funds, or give password or login details. Anyone doing so is a scammer. If you would prefer to use email support, the address is [email protected]</1><2>Please confirm you have read and understood this message.</2>"],"redirect.confirmation.title":["You're leaving Deribit."],"registerScreen.coinbaseSignUp.moved.button":["Go to Coinbase"],"registerScreen.coinbaseSignUp.moved.description":["To open a Deribit account, please start from Coinbase. You will be sent back here to finish signing up."],"registerScreen.coinbaseSignUp.moved.title":["Onboarding has moved to Coinbase"],"registerScreen.coinbaseSignUp.notice.onboarding":["To complete your application for derivatives trading, you need to be onboarded via Deribit exch
2103ange onboarding flow."],"registerScreen.coinbaseSignUp.notice.ownership":["Deribit is a cryptocurrency futures and options exchange owned by Coinbase."],"registerScreen.coinbaseSignUp.notice.regulatory":["This process includes specific regulatory questions about your trading knowledge and financial background that are required to determine your investor classification."],"registerScreen.confirmEmail.desc1":["To activate your account, please click the link in the activation email which has been sent to you."],"registerScreen.confirmEmail.desc2":["If you do not see the activation email in your inbox, you may need to check your spam/junk email folders."],"registerScreen.confirmEmail.formTitle":["Let's get you started"],"registerScreen.confirmEmail.goToLogInPreamble":["Go over to"],"registerScreen.confirmEmail.goToLoginLink":["Login"],"registerScreen.confirmEmail.resendFailure":["Could not send activation email"],"registerScreen.confirmEmail.resendLinkButton":["Resend link again"],"registerScreen.confirmEmail.resendLinkQuestion":["Did not get a link?"],"registerScreen.confirmEmail.resendSuccess":["Activation email sent successfully. Please check your inbox"],"registerScreen.confirmEmail.subTitle":["Please check your email and follow the link"],"registerScreen.confirmEmail.warning":["Important! Your account will not be activated until you verify your email address."],"registerScreen.registerForm.accountCreated":["Your account has been created. Please proceed with 2FA setup"],"registerScreen.registerForm.accountCreatedSuccessfully":["The account has been created successfully"],"registerScreen.registerForm.agreeTermsAndPolicy":["I agree to the ",["linkTermsOfService"],", to the ",["linkPrivacyPolicy"]," and to the ",["linkFees"],"."],"registerScreen.registerForm.agreeTermsAndPolicy.fees":["Fees"],"registerScreen.registerForm.agreeTermsAndPolicy.privacyNotice":["Privacy Notice"],"registerScreen.registerForm.agreeTermsAndPolicy.termsOfService":["Terms Of Service"],"registerScreen.registerForm.agreeTermsOfServiceAndPrivacyPolicy":["You must agree to the Terms of Service and Privacy Policy before continuing."],"registerScreen.registerForm.blockedDomain":["The email contains a blocked domain."],"registerScreen.registerForm.confirmPasswordIsRequired":["Confirm Password is required."],"registerScreen.registerForm.countryNotAllowed":["The selected country of residence is on our list of ",["restrictedCountries"],". Residents from Restricted Countries are not allowed to use our services."],"registerScreen.registerForm.countryRestricted.title":["Your country is restricted"],"registerScreen.registerForm.couponDetails":["Coupon Details"],"registerScreen.registerForm.discountInfo":["You have reached Deribit via a promotional link and will receive a 10% discount on trading fees if you sign up now!"],"registerScreen.registerForm.emailAlreadyTaken":["An account with this email already exists. Please log in instead."],"registerScreen.registerForm.emailMaximumMailboxExceeded":["The maximum number of accounts per mailbox (10) has been exceeded."],"registerScreen.registerForm.emailTooLong":["The email must be a maximum of ",["maxEmailLength"]," characters."],"registerScreen.registerForm.invali
2103dDomain":["The email has an invalid domain."],"registerScreen.registerForm.oAuthCodeIsInvalid":["Authorization code is invalid, please try to sign up again"],"registerScreen.registerForm.passwordIsRequired":["Password required"],"registerScreen.registerForm.prohibitedRussians":["For the selected country of residence, only nationals of EU member states, the EEA and Switzerland are allowed to use our service. For more information, please visit our ",["knowledgeBaseProhibitedRussiansLink"],"."],"registerScreen.registerForm.referralCodeApplied":["Referral Code was successfully applied"],"registerScreen.registerForm.refferalCodeApplied":["Referral Code was successfully applied"],"registerScreen.registerForm.refferalIsNotValid":["Referral Code is invalid"],"registerScreen.registerForm.registrationSuccessMessage":["Thank you for registering with Deribit.<0/>To activate your account, please click the link in the activation email which has been sent to you.<1/>If you do not see the activation email in your inbox, you may need to check your spam/junk email folders."],"registerScreen.registerForm.restrictedCountries":["Restricted Countries"],"registerScreen.registerForm.retailRestrictedCountry":["Please be informed that individuals and companies from your country of residence that classify as a <0>Retail Investor</0> are not allowed to use our services. For more information, please visit our <1>Knowledge Base</1>."],"registerScreen.registerForm.retailRestrictedCountry.hint":["Your country presents some restrictions"],"registerScreen.registerForm.selectCountry":["Please select your country"],"registerScreen.registerForm.specialCriteriaApply":["Special criteria apply"],"registerScreen.registerForm.specificOnboardingCriteria":["Please be informed that <0>specific (onboarding) criteria</0> apply based on your country of residence."],"registerScreen.registerForm.subscribeToMarketingEmails":["I agree to receive promotional and marketing communications from Deribit. I understand I can unsubscribe at any time."],"registerScreen.registerForm.ukRetailRestrictedCountry":["Please be informed that we do not accept retail clients residing in the United Kingdom. Visit <0>our website</0> to review the client categorisation requirements."],"registerScreen.registerForm.userAlreadyTaken":["This username is already taken."],"registerScreen.registerForm.userTooShort":["This nick /alias has to be of minimum 5 characters."],"registerScreen.registerForm.usernameAlphaNumeric":["A username can contain only letters and numbers."],"registerScreen.registerForm.usernameForbidden":["The username contains a word that is forbidden."],"registerScreen.registerForm.usernameIsRequired":["Username required"],"registerScreen.registerForm.usernameRequirements":["5 characters or more, containing only letters and numbers."],"registerScreen.registerForm.verifyYourEmail":["Important! Your account will not be activated until you verify your email address."],"secondaryEmailScreen.button.goToWallet":["Go to Wallet"],"secondaryEmailScreen.invalidLink.subtitle":["The link you used is not valid. It may be expired, or it has already been used."],"secondaryEmailScreen.invalidLink.title":["Link is not valid."],"secondaryEmailScreen.secondaryEmailConfirmationStatusInfo":["You can check the secondary email confirmation status on your Wallet page."],"secondaryEmailScreen.success.subtitle.set":["You may still need to use a confirmation link from another email."],"secondaryEmailScreen.success.title":["Thank you for confirmation"],"secondaryEmailScreen.title":["Confirm Secondary Email"],"serviceScreen.accountRemoval.body":["Your request to close your Deribit account has been received and is now being processed. <0/> We'll notify you via email once the process is complete. <1/> During this time, your account will remain locked."],"serviceScreen.accountRemoval.button":["Go back to Homepage"],"serviceScreen.accountRemoval.title":["Closing your Deribit account"],"setupPasswordForm.newPassword":["New password"],"statisticsScreen.deribitFixingIndexes.info":["Deribit Fixing Index is a reference rate designed to provide market participants with a transparent and reliable benchmark for their own accounting, valuation, and settlements. Deribit provides both a continuous ",["messageIndexName"]," reference rate and a <0>daily fixing at 08:00 UTC.</0> The Deribit Fixing Index is <1>not used for the settlement of any trades or contracts on the Deribit platform and is for information only.</1> All Deribit-listed derivatives continue to settle against their respective index prices as per our contract specifications."],"statisticsScreen.deribitIndex.expirationPriceHistory.subtitle":["Index price against which contracts expire."],"statisticsScreen.deribitIndexes.buttons.1day":["1d"],"statisticsScreen.deribitIndexes.buttons.1hour":["1h"],"statisticsScreen.deribitIndexes.buttons.1month":["1m"],"statisticsScreen.deribitIndexes.buttons.1year":["1y"],"statisticsScreen.deribitIndexes.buttons.2days":["2d"],"statisticsScreen.deribitIndexes.buttons.8hour":["8h"],"statisticsScreen.deribitIndexes.buttons.all":["all"],"statisticsScreen.deribitIndexes.exchanges.adjustedIndes":["Adjusted ",["0"]," Index"],"statisticsScreen.deribitIndexes.exchanges.backupMarkets":["The following markets are not currently enabled but are available as backup markets and can be enabled."],"statisticsScreen.deribitIndexes.exchanges.coinbaseIndexPriceMethodology":["Coinbase Index Price Methodology"],"statisticsScreen.deribitIndexes.exchanges.indexPrice":["Index Price: <0/> <1>",["indexPrice"],"</1>"],"statisticsScreen.deribitIndexes.exchanges.indexPriceFeeds":[["0"]," Index Price Feeds"],"statisticsScreen.deribitIndexes.exchanges.subtitle1":["We take mid prices from the bid/ask feed from the below exchanges, but we exclude any with 0% weight from the calculation. We then calculate the median on the remaining sources and calculate a Min Price of 0.5% below median and Max Price of 0.5% above median. We then calculate the Price Used of each source which is the Mid Price if the Mid Price is between the Min Price and Max Price, or the Min Price if the Mid Price is below the Min Price, or the Max Price if the Mid Price is above the Max Price. Then we calculate the weighted average of the Price Used with the Weights to give the final Index value."],"statisticsScreen.deribitIndexes.exchanges.subtitle2":["For this index, we also use the ",["0"]," index and adjust this with the ",["currency"],"-USD index."],"statisticsScreen.deribitIndexes.exchanges.subtitle3":["Median = median of the sources with weight > 0%"],"statisticsScreen.deribitIndexes.exchanges.subtitle4":["Price Used = min[max(0.995 * Median, Mid Price), 1.005 * Median]"],"statisticsScreen.deribitIndexes.exchanges.subtitle5":["Index = sumproduct(Price Used, Weight)"],"statisticsScreen.deribitIndexes.exchanges.thisIsTheOriginalPriceInTheAPI":["This is the original_price in the API."],"statisticsScreen.deribitIndexes.exchanges.thisIsThePriceInTheAPI":["This is the price in the API."],"statisticsScreen.deribitIndexes.excludedByAdmin":["Has been excluded by admin"],"statisticsScreen.deribitIndexes.expirationPriceHistory.title":["Expiration Price History"],"statisticsScreen.deribitIndexes.linearOptionsWarning":["Effective 15 July 2025, Deribit's ",["0"]," index will be pegged to the ",["usdIndex"]," index. For settlements on ",["usdIndex"]," contracts, Deribit will assume parity between USD and USDC. However, the USDC-USD index rate is used for the valuation of USDC collateral.<0/>For reference, see the <1>",["usdIndex"]," index page</1>."],"statisticsScreen.deribitIndexes.minutesAndSecondsToSettlement":["1 min. and ",["seconds"]," sec. to settlement, EDP:"],"statisticsScreen.deribitIndexes.minutesToSettlement":[["minutes"]," min. to settlement, EDP:"],"statisticsScreen.deribitIndexes.secondsToSettlement":[["seconds"]," sec. to settlement, EDP:"],"statisticsScreen.deribitIndexes.weight":["Weight"],"statisticsScreen.exportPriceIndexModal.cancel":["Cancel"],"statisticsScreen.exportPriceIndexModal.description":["The chart shows average price values for each aggregation window. Export the CSV to download the underlying non-aggregated monthly price index data."],"statisticsScreen.exportPriceIndexModal.downloadCsv":["Download CSV"],"statisticsScreen.exportPriceIndexModal.selectMonth":["Select Month"],"statisticsScreen.exportPriceIndexModal.selectYear":["Select Year"],"statisticsScreen.exportPriceIndexModal.title":["Export ",["displayIndexName"]," Price Index"],"statisticsScreen.fundinRate.current8hFundingRate":["Current 8-hourly funding rate"],"statisticsScreen.fundinRate.last8hAvg8hFundingRate":["Average 8-hourly funding rate of the last 8 hours"],"statisticsScreen.fundingRate.noActivePerpetuals":["No active perpetuals for the selected currency"],"statisticsScreen.fundingRate.title":["Funding Rate"],"statisticsScreen.historicalVolatility.subtitle":["Current 15 day historical (annualized) volatility of Deribit ",["currency"]," index: ",["lastIndex"],"%"],"statisticsScreen.historicalVolatility.title":["Historical Volatility"],"statisticsScreen.insuranceAndBankruptcies.title":["Insurance and Bankruptcies"],"statisticsScreen.insuranceFund.explanation":["<0>Deribit has an Insurance Fund that should cover all losses of bankrupt traders. Bankruptcy occurs if positions in an account have been liquidated and the amount of cryptocurrency in the wallet of the account is insufficient to cover (additional) losses. In case of bankruptcy, we will reset the balance of the relevant cryptocurrency in the account to zero by transferring funds from the Insurance Fund to the account.</0><1>Due to our advanced real-time incremental liquidation system, in the vast majority of cases, positions of traders will be reduced or closed before bankruptcy would occur. Deribit uses a hybrid Insurance Fund setup that consists of all currencies that we settle in. In the case that one gets depleted, Deribit can use the other Insurance Funds to cover the losses of bankrupt traders.</1><2>On this Insurance Fund page, we publish daily occurring bankruptcies and the last state of the Insurance Fund of each settlement currency. As long as there are funds in the Insurance Fund, withdrawals of (also unrealized) profits of not expired futures are available for withdrawal immediately after settlement (futures positions settle daily at 08.00 UTC). If the Insurance Fund gets depleted, any then occurring bankruptcies will be socialized among the winning traders.</2><3><4>Income</4><5/>Any liquidation orders are charged an extra fee on top of the default transaction fees. The extra proceeds are added every hour to the Insurance Fund. To learn more please read the ",["linkToKB"],".</3>"],"statisticsScreen.insuranceFund.title":["Insurance Balance"],"statisticsScreen.insuranceFund.totalInsuranceFundValue":["Total Insurance Fund value:"],"statisticsScreen.volatilityIndex.dvolIndexIsUnAvailable":["The DVOL index is only available for the following currencies: ",["0"],"."],"statisticsScreen.volatilityIndex.ivFooter":["Discover the insights offered by IVR and IVP. <0>Click here</0> to read more about these statistics and their role in helping you navigate market volatility."],"statisticsScreen.volatilityIndex.ivPercentile":["IV Percentile"],"statisticsScreen.volatilityIndex.ivPercentileDescription":["IV Percentile shows what percentage of time (in the last year) IV has been lower that the current level. IV as measured by DVOL."],"statisticsScreen.volatilityIndex.ivRank":["IV Rank"],"statisticsScreen.volatilityIndex.ivRankDescription":["IV Rank shows where the current IV level sits within the range of IV in the last year. IV as measured by DVOL."],"statisticsScreen.volatilityIndex.selectSupportedCurrency":["Please select a supported currency above."],"statisticsScreen.volatilityIndex.subheader":["For more information on how DVOL is calculated, read the explanation <0>here</0>."],"statisticsScreen.volatilityIndex.title":[["currency"]," Volatility Index (DVOL)"],"topBar.tooltip.announcements":["Announcements"],"tradeScreen.TVChart.componentSettings.disableIdleDetection":["Disable inactivity detection."],"tradeScreen.TVChart.isIdle":["We have detected inactivity. Please perform an action to reload the chart."],"tradeScreen.accountSummary.totalUsd":["Total USD"],"tradeScreen.accountSummary.valueType":["Value type"],"tradeScreen.addComponent.currency":["Currency"],"tradeScreen.addComponent.currencyPair":["Currency pair"],"tradeScreen.addComponent.defaultCurrency":["Setting \\"default\\" means that the currency for the component is taken from the URL.<0/>Setting to anything other than default will make the component currency fixed."],"tradeScreen.addComponent.defaultCurrencyPair":["Setting \\"default\\" means that the currency pair for the component is taken from the URL.<0/>Setting to anything other than default will make the component currency pair fixed."],"tradeScreen.addComponent.defaultInstrument":["Setting \\"default\\" means that the instrument for the component is taken from the URL.<0/>Setting to anything other than default will make the component instrument fixed."],"tradeScreen.addComponent.findComponent":["Find component"],"tradeScreen.addComponent.instrument":["Instrument"],"tradeScreen.addComponent.noComponentSelected":["No component selected"],"tradeScreen.addComponent.preview":["Preview"],"tradeScreen.addComponent.title":["Add component"],"tradeScreen.blockCreationDialog.aboutPm":["About PM"],"tradeScreen.blockCreationDialog.aboutPmTooltip":["On <0>Standard Margin</0>, margin requirements are calculated per position. In a Block RFQ with several large trades, the total margin required can be much higher. <1>Portfolio Margin</1> calculates requirements based on your overall portfolio, which may be more capital‑efficie
2103nt for this type of trading. <2>Read more</2>."],"tradeScreen.blockCreationDialog.addHedge":["Add hedge"],"tradeScreen.blockCreationDialog.addLeg":["Add leg"],"tradeScreen.blockCreationDialog.auto":["Auto"],"tradeScreen.blockCreationDialog.coinPair":["Coin-pair"],"tradeScreen.blockCreationDialog.custom":["Custom"],"tradeScreen.blockCreationDialog.disabledWhileAccountLockedWithPartyName":["The trade request cannot proceed because the account ",["partyName"]," is locked."],"tradeScreen.blockCreationDialog.disabledWhilePositionLockWithPartyName":["The trade request cannot proceed because ",["partyName"]," currently has locked positions."],"tradeScreen.blockCreationDialog.header.coinPair":["Coin-pair"],"tradeScreen.blockCreationDialog.header.makerSide":["Maker's Side"],"tradeScreen.blockCreationDialog.header.product":["Product"],"tradeScreen.blockCreationDialog.hedgeAmountTooltip":["By default the full Delta hedge amount is suggested but any amount can be requested."],"tradeScreen.blockCreationDialog.learnAboutHedging":["Learn about hedging"],"tradeScreen.blockCreationDialog.learnAboutHedgingTooltip":["A future leg can be added to option and spot structures as a Delta hedge.<0/> <1/>The future leg must share a base currency with at least one instrument in the legs."],"tradeScreen.blockCreationDialog.notEnoughFunds":[["partyName"]," does not have enough funds for this trade"],"tradeScreen.blockCreationDialog.notEnoughFundsStandardMargin":["Not enough funds.<0/>Consider switching to Portfolio Margin."],"tradeScreen.blockCreationDialog.priceTooltip":["The price of a hedge leg must be within a ",["hedgePercentagePrice"],"% bound around the current mark price."],"tradeScreen.blockCreationDialog.seeAll":["See all"],"tradeScreen.blockCreationDialog.selectExpiry":["Select expiry"],"tradeScreen.blockCreationDialog.selectStrike":["Select strike"],"tradeScreen.blockCreationDialog.title":["Create Strategy"],"tradeScreen.blockCreationDialog.validation.allocationAmountExceedsTotalAmount":["<0>Allocation amount exceeds total amount.</0> Please adjust the allocation amount before proceeding."],"tradeScreen.blockCreationDialog.validation.allocationAmountLessThanTotalAmount":["<0>Allocation amount is less than total amount.</0> Please adjust the allocation amount before proceeding."],"tradeScreen.blockCreationDialog.validation.allocationIsNotPossible":["This structure cannot be proportionally allocated among the selected clients."],"tradeScreen.blockCreationDialog.validation.currentAmount":["Current amount"],"tradeScreen.blockCreationDialog.validation.differentCurrencies":["<0>All spot currency pairs must have the same quote currency.</0><1/>Currently selected quote currencies: ",["0"]],"tradeScreen.blockCreationDialog.validation.forCurrencyPair":["for ",["0"]],"tradeScreen.blockCreationDialog.validation.incorrectHedgePrice":["<0>Hedge leg price is outside of allowed range</0> Adjust it to within ±1% of the mark price."],"tradeScreen.blockCreationDialog.validation.minAmount":["Minimum amount"],"tradeScreen.blockCreationDialog.validation.minHedgeAmount":["Minimum hedge amount"],"tradeScreen.blockCreationDialog.validation.minLegAmount":["Minimum leg amount"],"tradeScreen.blockCreationDialog.validation.missingAllocation":["<0>You didn't select any allocation account.</0> Please select an allocation account before proceeding or change to <1>Direct Trade</1>."],"tradeScreen.blockCreationDialog.validation.missingAllocationAmount":["<0>Allocation amount is missing.</0> Please specify the allocation amount before proceeding."],"tradeScreen.blockCreationDialog.validation.missingAmount":["<0>Some legs have missing amounts.</0> Please enter an amount for each leg."],"tradeScreen.blockCreationDialog.validation.missingData":["<0>Some required parameters are missing:</0><1/>Expiry, Strikes, or Coin Pair."],"tradeScreen.blockCreationDialog.validation.missingMaker":["Please select a maker to book the trade."],"tradeScreen.blockCreationDialog.validation.missingMakers":["At least one maker must be selected to submit the RFQ."],"tradeScreen.blockCreationDialog.validation.missingPrice":["<0>Some legs have missing prices.</0> Please enter a price for each leg."],"tradeScreen.blockCreationDialog.validation.missingTaker":["Please select a taker to book the trade."],"tradeScreen.blockCreationDialog.validation.missingTotalAmount":["<0>The total amount is missing.</0> Please specify the total amount before proceeding."],"tradeScreen.blockCreationDialog.validation.multipleRequirements":["One of the following requirements must be met:"],"tradeScreen.blockCreationDialog.validation.notEnoughMakers":["<0>Anonymous RFQ requires at least 5 makers</0> Please select additional makers or switch to non-anonymous RFQ."],"tradeScreen.blockCreationDialog.validation.notUniqueLegs":["<0>Duplicate legs not allowed.</0> Please review and adjust your strategy."],"tradeScreen.blockCreationDialog.validation.oneRequirement":["Min. amount updates automatically:"],"tradeScreen.blockRFQ.Hedge.label":["Hedge"],"tradeScreen.blockRFQ.aggregatedMarkPrice":["Aggr. Mark"],"tradeScreen.blockRFQ.aggregatedMarkPriceTooltip":["Net mark price of structure"],"tradeScreen.blockRFQ.allOrNone":["All-or-None"],"tradeScreen.blockRFQ.allOrNoneTag":["AoN"],"tradeScreen.blockRFQ.allOrNoneTooltip":["By selecting this order type your quote will not take part in the multi-maker auction model. Your quote will either be executed with the <0>full amount or not at all</0>."],"tradeScreen.blockRFQ.allocated":["Allocated"],"tradeScreen.blockRFQ.allocation.allocatedDescription":["This trade will be allocated to your selected"],"tradeScreen.blockRFQ.allocation.allocatedDescriptionAll":["subaccount(s) or client(s)"],"tradeScreen.blockRFQ.allocation.clients":["client(s)"],"tradeScreen.blockRFQ.allocation.directTradeDescription":["<0>Direct trades</0> will be placed from your own account. To allocate a trade, select <0>Allocated</0>."],"tradeScreen.blockRFQ.allocation.subaccounts":["subaccount(s)"],"tradeScreen.blockRFQ.allocations.userId":["User ID"],"tradeScreen.blockRFQ.amount":["Amount"],"tradeScreen.blockRFQ.anonymous":["Anonymous"],"tradeScreen.blockRFQ.basisTrade.label":["Basis Trade"],"tradeScreen.blockRFQ.calculateAsk":["Calculate Ask"],"tradeScreen.blockRFQ.calculateBid":["Calculate Bid"],"tradeScreen.blockRFQ.cancelOpenQuote.body":["Canceling this open quote will stop any ongoing negotiations or offers for the selected trade. This action cannot be undone."],"tradeScreen.blockRFQ.cancelOpenQuote.cancel":["No, keep quote"],"tradeScreen.blockRFQ.cancelOpenQuote.confirm":["Yes, cancel quote"],"tradeScreen.blockRFQ.cancelOpenQuote.heading":["Are you sure you want to cancel this quote?"],"tradeScreen.blockRFQ.cancelOpenQuote.title":["Cancel open quote"],"tradeScreen.blockRFQ.cancelOpenQuotes.body":["Canceling all open quotes will stop any ongoing negotiations or offers for the selected trades. This action cannot be undone."],"tradeScreen.blockRFQ.cancelOpenQuotes.cancel":["No, keep quote(s)"],"tradeScreen.blockRFQ.cancelOpenQuotes.confirm":["Yes, cancel quote(s)"],"tradeScreen.blockRFQ.cancelOpenQuotes.heading":["Are you sure you want to cancel all open quotes (",["openQuotes"],")?"],"tradeScreen.blockRFQ.cancelOpenQuotes.title":["Cancel open quotes"],"tradeScreen.blockRFQ.cancelRFQ.body":["Canceling will make the RFQ unavailable to others, and any ongoing negotiations will be terminated.<0/><1/> This action cannot be undone."],"tradeScreen.blockRFQ.cancelRFQ.cancel":["No, keep RFQ"],"tradeScreen.blockRFQ.cancelRFQ.confirm":["Yes, cancel RFQ"],"tradeScreen.blockRFQ.cancelRFQ.heading":["Are you sure you want to cancel this RFQ?"],"tradeScreen.blockRFQ.cancelRFQ.title":["Cancel RFQ"],"tradeScreen.blockRFQ.collapseAll":["Collapse All"],"tradeScreen.blockRFQ.confirmQuote":["Confirm Quote"],"tradeScreen.blockRFQ.confirmRFQ":["Confirm RFQ"],"tradeScreen.blockRFQ.confirmTrade":["Confirm Trade"],"tradeScreen.blockRFQ.confirmation.dontShowAgain":["Don't show again"],"tradeScreen.blockRFQ.confirmationDialog.areYouSure":["Are you sure you want to proceed with this trade?"],"tradeScreen.blockRFQ.confirmationDialog.quoteAreYouSure":["Are you sure you want to proceed with this quote?"],"tradeScreen.blockRFQ.confirmationDialog.quoteWarning":["Please double-check the details before confirming. You can cancel the quote later if needed."],"tradeScreen.blockRFQ.confirmationDialog.warning":["Please double-check the details before confirming. This action cannot be undone."],"tradeScreen.blockRFQ.createRFQ":["Create RFQ"],"tradeScreen.blockRFQ.crossQuoting":["Crossing your own quotes is not allowed"],"tradeScreen.blockRFQ.directTrade":["Direct Trade"],"tradeScreen.blockRFQ.disabledWhileAccountLockedWithPartyName":["The trade request cannot proceed because user ",["userId"]," account is locked."],"tradeScreen.blockRFQ.disabledWhilePositionLockWithPartyName":["The trade request cannot proceed because user ",["userId"]," 
2103currently has locked positions."],"tradeScreen.blockRFQ.discloseIdentity":["Disclose Identity"],"tradeScreen.blockRFQ.discloseIdentityTooltip":["<0>Optional: Reveal your identity to makers when creating an RFQ.</0> <1/>The identity of the maker offering the best quote will then be shared with you as well. This information will not be shared via public APIs.<2/><3/>*at least 5 makers have to be selected."],"tradeScreen.blockRFQ.discloseIdentityTooltip2":["To use this feature, you must first <0>set-up a taker identity</0>."],"tradeScreen.blockRFQ.disclosed":["Disclosed"],"tradeScreen.blockRFQ.disclosedTooltip":["<0>This trade has been set as open.</0> Your name will be visible to the Taker when you submit a quote. This information will not be shared via public APIs."],"tradeScreen.blockRFQ.editQuote":["Edit Quote"],"tradeScreen.blockRFQ.editRFQ":["Edit RFQ"],"tradeScreen.blockRFQ.editing":["Editing"],"tradeScreen.blockRFQ.expandAll":["Expand All"],"tradeScreen.blockRFQ.expiresAt":["Quote expires in ",["formattedRemainingTime"]],"tradeScreen.blockRFQ.filters.myRfqs":["My RFQs"],"tradeScreen.blockRFQ.filters.requestedByOthers":["Requested by others"],"tradeScreen.blockRFQ.filters.showAll":["Show all"],"tradeScreen.blockRFQ.filters.tradedOnly":["Traded only"],"tradeScreen.blockRFQ.floatingWidget.ignore":["Ignore"],"tradeScreen.blockRFQ.floatingWidget.ignoredRfq":["RFQ was moved to Ignored."],"tradeScreen.blockRFQ.floatingWidget.review":["Review"],"tradeScreen.blockRFQ.floatingWidget.undo":["Undo"],"tradeScreen.blockRFQ.fok":["FOK"],"tradeScreen.blockRFQ.futurePositionSizeExceededWithPartyName":[["partyName"]," would exceed the maximum future position size of ",["maxAmount"]," for ",["instrumentName"],"."],"tradeScreen.blockRFQ.futurePositionSizeExceededWithUserId":["User ",["userId"]," would exceed the maximum future position size of ",["maxAmount"]," for ",["instrumentName"],"."],"tradeScreen.blockRFQ.initialInstrumentExpire":["<0>Some instruments have expired.</0> Please select valid option to proceed."],"tradeScreen.blockRFQ.listCard.cancelAll":["Cancel all"],"tradeScreen.blockRFQ.listCard.cancelOrder":["Cancel order"],"tradeScreen.blockRFQ.listCard.cancelRFQ":["Cancel RFQ"],"tradeScreen.blockRFQ.listCard.drafts":["Drafts"],"tradeScreen.blockRFQ.listCard.ignoreRFQ":["Ignore RFQ"],"tradeScreen.blockRFQ.listCard.ignoredRfqs":["Ignored RFQs"],"tradeScreen.blockRFQ.listCard.impliedAsk":["Implied Ask"],"tradeScreen.blockRFQ.listCard.impliedBid":["Implied Bid"],"tradeScreen.blockRFQ.listCard.impliedBidAskTooltip":["This is the indicative price you can trade this RFQ at in the individual legs."],"tradeScreen.blockRFQ.listCard.myRfq":["My RFQ"],"tradeScreen.blockRFQ.listCard.openRfqs":["Open RFQs"],"tradeScreen.blockRFQ.listCard.quotePlaced":["Quote placed"],"tradeScreen.blockRFQ.listCard.restoreRFQ":["Restore"],"tradeScreen.blockRFQ.listCard.traded":["My trade"],"tradeScreen.blockRFQ.listOfQuotes.cancelAll":["Cancel all (",["0"],")"],"tradeScreen.blockRFQ.makerDialog.priceTooSmallError":["Price for legs is too small. Please adjust price."],"tradeScreen.blockRFQ.makerNotification":["You have a new open Block RFQ"],"tradeScreen.blockRFQ.makers.label":["Makers"],"tradeScreen.blockRFQ.mobileScreenTitle":["This feature is available in the Deribit mobile app. Please download or open the app to use it"],"tradeScreen.blockRFQ.myRfq":["My RFQ"],"tradeScreen.blockRFQ.negativeTradeStates.tradeCancelled.headline":["Trade was cancelled before reaching its expiration time."],"tradeScreen.blockRFQ.negativeTradeStates.tradeCancelled.title":["Trade Cancelled"],"tradeScreen.blockRFQ.negativeTradeStates.tradeExpired.headline":["Order was not filled before the expiration time."],"tradeScreen.blockRFQ.negativeTradeStates.tradeExpired.title":["Trade Expired"],"tradeScreen.blockRFQ.negativeTradeStates.tradeFailed.headline":["Trade failed before reaching its expiration time."],"tradeScreen.blockRFQ.negativeTradeStates.tradeFailed.title":["Trade Failed"],"tradeScreen.blockRFQ.newestFirst":["Newest first"],"tradeScreen.blockRFQ.noActiveRfqs":["No active RFQs for selected filters"],"tradeScreen.blockRFQ.noHistoricRfqs":["No RFQs for selected filters"],"tradeScreen.blockRFQ.noQuotes":["Requested quantity not offered yet."],"tradeScreen.blockRFQ.noQuotesHere":["No quotes here..."],"tradeScreen.blockRFQ.notEnoughFunds":["User ",["userId"]," does not have enough funds for this trade"],"tradeScreen.blockRFQ.notionalValue":["Notional Value"],"tradeScreen.blockRFQ.oldestFirst":["Oldest first"],"tradeScreen.blockRFQ.oneWay":["One way"],"tradeScreen.blockRFQ.openOrder":["Open order"],"tradeScreen.blockRFQ.openQuotes":["Open Quotes"],"tradeScreen.blockRFQ.openRFQ":["Open RFQ"],"tradeScreen.blockRFQ.openRFQList":["Open RFQ List"],"tradeScreen.blockRFQ.otvContribution":["Contributes to OTV"],"tradeScreen.blockRFQ.otvContributionTooltip":["This RFQ will be included in your Order-to-Volume calculation."],"tradeScreen.blockRFQ.otvNoContribution":["No OTV Contribution"],"tradeScreen.blockRFQ.otvNoContributionTooltip":["This RFQ will not be included in your Order-to-Volume calculation as it did not meet requirements for tradability."],"tradeScreen.blockRFQ.otvRatio":["OTV Ratio"],"tradeScreen.blockRFQ.otvTooltip":["Order-to-Volume ratio = Total USD amount requested/Total USD amount traded. Instead of an exact ratio a range is shown for privacy reasons."],"tradeScreen.blockRFQ.pendingRFQ":["Pending Block RFQ"],"tradeScreen.blockRFQ.postTradeImpact":["Post Trade Impact"],"tradeScreen.blockRFQ.quoteSent":["Quote sent successfully"],"tradeScreen.blockRFQ.quoteTimer":["Quote Timer"],"tradeScreen.blockRFQ.quoteTimer.off":["Off"],"tradeScreen.blockRFQ.quoteTimer.tooltip":["Quote will expire if not filled within the specified time. You can cancel the timer anytime after the quote is created."],"tradeScreen.blockRFQ.reIssueRfq":["Re-issue RFQ"],"tradeScreen.blockRFQ.removeDraft":["Remove draft"],"tradeScreen.blockRFQ.respondRfq":["Respond to RFQ"],"tradeScreen.blockRFQ.respondersList.favorites":["Favorites"],"tradeScreen.blockRFQ.restrictedAccess1":["Access to Block RFQ is restricted for your account."],"tradeScreen.blockRFQ.restrictedAccess2":["Please update your settings to enable it."],"tradeScreen.blockRFQ.rfqID":["RFQ ID:"],"tradeScreen.blockRFQ.saveChanges":["Save changes"],"tradeScreen.blockRFQ.selectedMakers":["Selected Makers"],"tradeScreen.blockRFQ.selectedTakers":["Selected Takers"],"tradeScreen.blockRFQ.strategy.label":["Strategy"],"tradeScreen.blockRFQ.taker":["Taker"],"tradeScreen.blockRFQ.totalPremium":["Total Premium"],"tradeScreen.blockRFQ.trade":["Trade"],"tradeScreen.blockRFQ.tradeExecuted.allQuotes":["All quotes "],"tradeScreen.blockRFQ.tradeExecuted.headline":["Trade executed at the price <0>",["0"],"</0>"],"tradeScreen.blockRFQ.tradeExecuted.maker":["Maker"],"tradeScreen.blockRFQ.tradeExecuted.makers":["Makers"],"tradeScreen.blockRFQ.tradeExecuted.title":["Trade Executed"],"tradeScreen.blockRFQ.tradeExecuted.trades":["Trades"],"tradeScreen.blockRFQ.tradeExecuted.yourShare":["Your share is <0>",["0"],"</0>/",["amount"]],"tradeScreen.blockRFQ.tradeFilledState.heading.maker":["Trade directions are listed from the perspective of the Maker."],"tradeScreen.blockRFQ.tradeFilledState.heading.taker":["Trade directions are listed from the perspective of the Taker."],"tradeScreen.blockRFQ.tradeOpen":["Trade open"],"tradeScreen.blockRFQ.twoWay":["Two-way"],"tradeScreen.blockRFQ.useDesktopVersion":["Use Desktop Version"],"tradeScreen.blockRFQ.utcTime":["UTC Time"],"tradeScreen.blockRfq.accountName":["Account name"],"tradeScreen.blockRfq.client":["Client"],"tradeScreen.blockRfq.clientConfirmationsRequired":["Automatic trade confirmation is required to allocate for this client"],"tradeScreen.blockRfq.clientPlaceholder":["Select client"],"tradeScreen.blockRfq.clientRemoved":["Client was removed"],"tradeScreen.blockRfq.company":["Company"],"tradeScreen.blockRfq.createRfqDialog.descriptionTooltip":["For more details, check the RFQ article in our <0>Knowledge Base</0>."],"tradeScreen.blockRfq.createRfqDialog.greeksInfo":["Main structure only<0/>(hedge excluded)"],"tradeScreen.blockRfq.createRfqDialog.multiplier":["Multiplier"],"tradeScreen.blockRfq.createRfqDialog.saveDraft":["Save Draft"],"tradeScreen.blockRfq.createRfqDialog.submit":["Submit RFQ"],"tradeScreen.blockRfq.createRfqDialog.titleTooltip":["Select the currency of the Block RFQ and then the combination of legs."],"tradeScreen.blockRfq.createRfqDialog.updateDraft":["Update Draft"],"tradeScreen.blockRfq.drafts.incompleteInstruments":["Some legs have an incomplete instrument"],"tradeScreen.blockRfq.drafts.limitReached":["You reached the limit of ",["MAX_BLOCK_RFQ_DRAFTS"]," drafts"],"tradeScreen.blockRfq.hedgeFeeWaived":["Hedge Fee Waived"],"tradeScreen.blockRfq.hedgeFeeWaived.tooltip":["Fees on hedge leg are waived for the amount that reduces net options delta. This is an approximate figure that depends on market conditions. The actual value at time of trade can be found in <0>Transaction Log</0>
2103"],"tradeScreen.blockRfq.invalidRatio":["Ratio for ",["instrumentName"]," cannot be higher than ",["limit"],"."],"tradeScreen.blockRfq.mainAccount":["Main account"],"tradeScreen.blockRfq.noAccountSelected":["No accounts selected."],"tradeScreen.blockRfq.onboarding.hedgeAutoUpdates":["<0>AUTO</0> mode keeps direction, price, and amount updated automatically based on the index price.<1/><2/> To stop updates and make changes, switch to <3>MANUAL</3> mode."],"tradeScreen.blockRfq.onboarding.makerHedgeAmount":["Hedge amount is distributed proportionally to trade size <0>in case of a fill by multiple makers.</0>"],"tradeScreen.blockRfq.onboarding.makerQuote":["Enter a price in the <0>Bid/Ask</0> fields to pre-fill leg prices using the pricing- algorithm.<1/><2/> Only available for conventional inverse option structures and future spreads."],"tradeScreen.blockRfq.onboarding.selectQuote":["Select your trade side and input the price to continue."],"tradeScreen.blockRfq.onboarding.totalAmount":["This is a total amount of the selected strategy. The actual order for each leg is the total amount scaled by ratio."],"tradeScreen.blockRfq.quoteDialog.respondTooltip":["Respond to an RFQ by filling in the price for each leg. You can also respond with an aggregate price and let Deribit calculate the price per leg.<0/> <1/>You can either quote both sides of the trade simultaneously via <2>Two way</2> or submit individual quotes through <3>One way</3>."],"tradeScreen.blockRfq.selectMakers":["Select Makers"],"tradeScreen.blockRfq.selectMakersTooltip":["Select the counterparties you want to ask for a quote."],"tradeScreen.blockRfq.selectTakers.accountName":["Account name"],"tradeScreen.blockRfq.selectTakers.missingTotalAmount":["Input the trade amount to allocate."],"tradeScreen.blockRfq.selectTakers.switchToPercentage":["Switch to amount in %."],"tradeScreen.blockRfq.selectTakers.switchToUnits":["Switch to amount in units."],"tradeScreen.blockRfq.selectTakersTooltip":["Allocate the trade to one or more accounts."],"tradeScreen.blockRfq.subaccount":["Subaccount"],"tradeScreen.blockRfq.subaccountPlaceholder":["Select subaccount"],"tradeScreen.blockRfq.subaccountRemoved":["Subaccount was removed"],"tradeScreen.blockRfq.tooManyOpenRfqs":["You already have the maximum number of allowed open Block RFQs."],"tradeScreen.blockRfq.tradeDetailsTooltip":["Trade your RFQ by crossing either the Bid or Ask price. The RFQ will be executed for the best available price up to the limit you inputed."],"tradeScreen.blockRfq.yield":["Yield"],"tradeScreen.blockTrade.accept":["Accept"],"tradeScreen.blockTrade.add":["add"],"tradeScreen.blockTrade.addCombo":["Add Combo"],"tradeScreen.blockTrade.addInstrument":["Add instrument"],"tradeScreen.blockTrade.allLegs":["See all legs"],"tradeScreen.blockTrade.alreadyUsed":["The block trade has already been executed"],"tradeScreen.blockTrade.bestAsk":["Best Ask"],"tradeScreen.blockTrade.bestBid":["Best Bid"],"tradeScreen.blockTrade.comboPrice":["Combo price"],"tradeScreen.blockTrade.contracts":["contracts"],"tradeScreen.blockTrade.create":["Create"],"tradeScreen.blockTrade.createBlockTrade":["Create Block Trade"],"tradeScreen.blockTrade.currentBlockTrade":["Current Block Trade"],"tradeScreen.blockTrade.error.alreadyAdded":[["instrument"]," has been already added to the block trade"],"tradeScreen.blockTrade.error.emptyField":[["fieldName"]," field is empty"],"tradeScreen.blockTrade.error.instrumentsInUse":["The following instruments have already been added to the block trade: ",["instruments"],"."],"tradeScreen.blockTrade.error.outsideBandwidth":["Price is outside the trading bandwidth"],"tradeScreen.blockTrade.error.sameInstrument":["Multiple instances of the same instrument cannot be added"],"tradeScreen.blockTrade.error.wrongInstrument":["Wrong instrument"],"tradeScreen.blockTrade.executeBlockTrade":["Execute Block Trade"],"tradeScreen.blockTrade.executeBlockTrade.pending":["Block trade approved. Waiting for counterparty."],"tradeScreen.blockTrade.getLegPricesError":["Combo price ",["0"],". Limit value for this strategy is ",["1"],"."],"tradeScreen.blockTrade.insufficientMinimumAmount":["Insufficient minimum amount - at least one of the minimum values must be met."],"tradeScreen.blockTrade.invalidateBlockTrade":["Invalidate Block Trade"],"tradeScreen.blockTrade.maker":["MAKER"],"tradeScreen.blockTrade.price":["Price"],"tradeScreen.blockTrade.quantity":["Quantity"],"tradeScreen.blockTrade.selectInstrument":["Select Instrument"],"tradeScreen.blockTrade.side":["Side"],"tradeScreen.blockTrade.strategyDetails":["Strategy Details"],"tradeScreen.blockTrade.taker":["TAKER"],"tradeScreen.blockTrade.timeAndDate":["Time & Date"],"tradeScreen.blockTrade.timeTillExpiry":["Time till expiry"],"tradeScreen.blockTrade.willBeInvalidatedIn":["The Block Trade will be automatically invalidated in ",["validityTime"],"s"],"tradeScreen.blockTradeApproval.banner.button":["Review trade"],"tradeScreen.blockTradeApproval.banner.subtitle":["Block Trade requires approval. Trade will expire in <0>",["formattedRemainingTime"],"</0> min."],"tradeScreen.blockTradeApproval.banner.title":["Pending approval"],"tradeScreen.blockTradeApproval.modal.expiration":["Trade expires in ",["formattedRemainingTime"]],"tradeScreen.blockTradeApproval.modal.subaccountName":["Subaccount name"],"tradeScreen.blockTradeApproval.modal.title":["Block Trade Approval"],"tradeScreen.blockTradeApproval.modal.tradeExpired":["Trade has expired"],"tradeScreen.blockTradeApproval.modal.tradeInitiatedBy":["Trade initiated by"],"tradeScreen.blockTradeApproval.modal.userRole":["Role"],"tradeScreen.blockTradeHistory.noDataOverlay":["You have no recent block trades for the chosen currency"],"tradeScreen.brokerInvite.confirm":["Confirm"],"tradeScreen.brokerInvite.denyRequest":["Deny Request"],"tradeScreen.brokerInvite.description":["By clicking “Confirm” below, you will also allow the broker to see the last 3 digits of your user ID."],"tradeScreen.brokerInvite.shareOnlyLeiBrn":["Share only LEI&BRN"],"tradeScreen.brokerInvite.subtitle":["Broker ",["name"]," has requested permission to submit trades on your behalf."],"tradeScreen.brokerInvite.title":["Pending Broker's Invitation"],"tradeScreen.brokerInvite.warning":["Please ensure you fully trust the broker, as they will be able to submit trades on your behalf."],"tradeScreen.brokerage.aggregatedPriceTooltip1":["Price will become available after you specify the contract details of the legs."],"tradeScreen.brokerage.aggregatedPriceTooltip2":["Once it's available, you can set individual legs prices and then aggregated price will be shown."],"tradeScreen.brokerage.aggregatedPriceTooltip3":["Alternatively, you can specify an aggregated price, and the prices of the legs will be calculated."],"tradeScreen.brokerage.approved":["Approved"],"tradeScreen.brokerage.autoApproval":["Auto-Approval"],"tradeScreen.brokerage.bookTrade":["Book a Trade"],"tradeScreen.brokerage.cancelTrade":["Cancel Trade"],"tradeScreen.brokerage.clientTradeApproval.aggregatePrice":["Total price"],"tradeScreen.brokerage.clientTradeApproval.amountOfUnits":["Amount of units"],"tradeScreen.brokerage.clientTradeApproval.confirmTrade":["Confirm Trade"],"tradeScreen.brokerage.clientTradeApproval.description":["Broker is requesting to execute a trade on your behalf.<0/>Review the details before confirming."],"tradeScreen.brokerage.clientTradeApproval.requireLogin":["Require Log In"],"tradeScreen.brokerage.clientTradeApproval.switchAccountInfo":["Logging in to a different subaccount will log you out from your current session"],"tradeScreen.brokerage.clientTradeApproval.title":["Confirm Trade Approval"],"tradeScreen.brokerage.clientTradeApproval.tradeApproved":["Trade has been approved"],"tradeScreen.brokerage.clientTradeApproval.tradeCancelled":["Trade has been cancelled by the broker"],"tradeScreen.brokerage.clientTradeApproval.tradeExpired":["Trade has expired"],"tradeScreen.brokerage.clientTradeApproval.tradeRejected":["Trade has been declined"],"tradeScreen.brokerage.clientTradeApproval.unitPrice":["Unit price"],"tradeScreen.brokerage.clientTradeApproval.warning":["To confirm you need to Log In to sub UID: ",["targetUserId"]],"tradeScreen.brokerage.common.broker":["Broker"],"tradeScreen.brokerage.common.buys":["Buys"],"tradeScreen.brokerage.common.hedge":["Hedge"],"tradeScreen.brokerage.common.maker":["Maker"],"tradeScreen.brokerage.common.parties":["Parties"],"tradeScreen.brokerage.common.sells":["Sells"],"tradeScreen.brokerage.common.taker":["Taker"],"tradeScreen.brokerage.common.trades":["Trades"],"tradeScreen.brokerage.common.userId":["UID"],"tradeScreen.brokerage.confirmTrade":["Confirm Trade"],"tradeScreen.brokerage.confirmationDialog.broker.cancelTrade.cancel":["Yes, Cancel Trade"],"tradeScreen.brokerage.confirmationDialog.broker.cancelTrade.description":["Some clients have not yet responded to the trade request. Canceling now will stop the trade submission process for all clients."],"tradeScreen.brokerage.confirmationDialog.broker.cancelTrade.heading":["Are you sure you want to cancel this trade?"],"tradeScreen.brokerage.confirmationDialog.broker.cancelTrade.keepTrade":["No, Keep Trade"],"tradeScreen.brokerage.confirmationDialog.broker.submitTrade.description":["Your client will need to manually or automatically approve the trade. Please ensure all details are correct before submitting."],"tradeScreen.brokerage.confirmationDialog.broker.submitTrade.editTrade":["Edit Trade"],"tradeScreen.brokerage.confirmationDialog.broker.submitTrade.title":["Submit Trade"],"tradeScreen.brokerage.copy":["Copy"],"tradeScreen.brokerage.createTrade":["Create Trade"],"tradeScreen.brokerage.createTradeDialog.headerTooltip":["Select the currency of the Block Trade and then the combination of legs."],"tradeScreen.brokerage.declinedByClient":["Declined by client"],"tradeScreen.brokerage.disabledWhileAccountLocked":["The trade request cannot proceed because one of the parties currently has a locked account."],"tradeScreen.brokerage.disabledWhilePositionLock":["The trade request cannot proceed because one of parties currently has locked positions."],"tradeScreen.brokerage.executed":["Executed"],"tradeScreen.brokerage.expired":["Expired"],"tradeScreen.brokerage.exportAsCsvFailed":["Failed to export history as CSV"],"tradeScreen.brokerage.futurePositionSizeExceeded":["The trade request cannot proceed because one of the parties would exceed the maximum future position size of ",["maxAmount"]," for ",["instrumentName"],"."],"tradeScreen.brokerage.futurePositionSizeExceededWithPartyName":[["partyName"]," would exceed the maximum future position size of ",["maxAmount"]," for ",["instrumentName"],"."],"tradeScreen.brokerage.goToBrokersPage":["Go to Brokers Page"],"tradeScreen.brokerage.goToClientsPage":["Go to Clients Page"],"tradeScreen.brokerage.hiddenName":["
2103Name"],"tradeScreen.brokerage.makerSignature":["Maker Signature"],"tradeScreen.brokerage.myAccount":["My Account"],"tradeScreen.brokerage.mySubaccount":["My Subaccount"],"tradeScreen.brokerage.noActiveTrades":["No active trades"],"tradeScreen.brokerage.noHistoricTrades":["No historic trades"],"tradeScreen.brokerage.noLinkedBrokers":["You don’t have connected brokers"],"tradeScreen.brokerage.noLinkedClients":["You don’t have connected clients yet"],"tradeScreen.brokerage.noRecentTrades":["No recent trades"],"tradeScreen.brokerage.notEnoughFundsGenericError":["One of the parties does not have enough funds for this trade"],"tradeScreen.brokerage.openTradeDialog.notAllParties":["Not all parties have responded to the trade yet."],"tradeScreen.brokerage.openTradeDialog.title":["Trade Open"],"tradeScreen.brokerage.partyInfoCard.approved":["Approved"],"tradeScreen.brokerage.partyInfoCard.autoApproved":["Auto-approved"],"tradeScreen.brokerage.partyInfoCard.declined":["Declined"],"tradeScreen.brokerage.partyInfoCard.pending":["Pending"],"tradeScreen.brokerage.pending":["Pending"],"tradeScreen.brokerage.pendingBrokerInvitations":["You have pending broker invitation"],"tradeScreen.brokerage.price.youGet":["You get"],"tradeScreen.brokerage.price.youPay":["You pay"],"tradeScreen.brokerage.repeatTrade":["Repeat Trade"],"tradeScreen.brokerage.restrictedAccess1":["Access to Brokerage is restricted for your account."],"tradeScreen.brokerage.restrictedAccess2":["Please update your settings to enable it."],"tradeScreen.brokerage.selectSides":["Select Sides"],"tradeScreen.brokerage.selectSidesTooltip":["Select the counterparties of the trade."],"tradeScreen.brokerage.sideSelectionDisabled":["Trading between subaccounts of the same client is not allowed."],"tradeScreen.brokerage.strategy":["Strategy"],"tradeScreen.brokerage.takerSignature":["Taker Signature"],"tradeScreen.brokerage.timeAndDate":["Time & Date"],"tradeScreen.brokerage.timestamp":["Timestamp"],"tradeScreen.brokerage.tradeCancelled":["Trade Cancelled"],"tradeScreen.brokerage.tradeDetails":["Trade details"],"tradeScreen.brokerage.tradeFailed":["Trade Failed"],"tradeScreen.brokerage.tradeStatus.cancelled.subtitle":["Trade was cancelled before reaching its expiration time."],"tradeScreen.brokerage.tradeStatus.cancelled.title":["Trade Cancelled"],"tradeScreen.brokerage.tradeStatus.executed.repeatPrompt":["If you want to trade this strategy again, click the \\"Repeat trade\\" button."],"tradeScreen.brokerage.tradeStatus.executed.subtitle":["Trade executed at a price"],"tradeScreen.brokerage.tradeStatus.executed.title":["Trade Executed"],"tradeScreen.brokerage.tradeStatus.expired.subtitle":["Trade expired at"],"tradeScreen.brokerage.tradeStatus.expired.title":["Trade Expired"],"tradeScreen.brokerage.tradeStatus.failed.subtitle":["Trade failed before reaching its expiration time."],"tradeScreen.brokerage.tradeStatus.failed.title":["Trade Failed"],"tradeScreen.brokerage.tradeStatus.pending.subtitle":["Pending counterparty approval"],"tradeScreen.brokerage.tradeStatus.pending.title":["Pending Trade"],"tradeScreen.brokerage.tradeStatus.rejected.repeatPrompt":["You can modify this trade and recreate it by clicking the \\"Repeat trade\\" button."],"tradeScreen.brokerage.tradeStatus.rejected.subtitle":["This trade was declined by one of the parties."],"tradeScreen.brokerage.tradeStatus.rejected.title":["Trade Closed"],"tradeScreen.brokerage.tradeStatusDialog.repeatTrade":["Repeat Trade"],"tradeScreen.brokerage.unregistered":["Unregistered"],"tradeScreen.brokerage.unregisteredTooltip":["To confirm a trade with an unregistered user, you must send them the generated Hash or JSON signature of the trade, which will be available in the subsequent step."],"tradeScreen.brokerage.you":["You"],"tradeScreen.cancelAll":["Cancel All"],"tradeScreen.comboList.notAvailableForCurrencyPair":["Not available for ",["currencyPair"]," at the moment"],"tradeScreen.common.-32602-block_rfq_at_least_one_long_leg":["At least one long leg is required to create a valid Block RFQ"],"tradeScreen.common.-32602-duplicated_block_rfqs":["Block RFQ structure already exists"],"tradeScreen.common.-32602-expired_block_trade_own_signature":["Provided own signature"],"tradeScreen.common.-32602-expired_block_trade_validity":["The block trade validity period has expired"],"tradeScreen.common.-32602-wrong_tfa_confirmation":["Invalid new 2FA code"],"tradeScreen.common.11030-insufficient_margin":["Insufficient margin"],"tradeScreen.common.11030-invalid_reduce_only_order":["Invalid reduce only order"],"tradeScreen.common.11030-reduce_only_due_to_anchor_breached":["Orders must be reduce only while the instrument's anchor price band is breached"],"tradeScreen.common.13020-invalid_code":["Invalid or expired code"],"tradeScreen.common.13671-you_cannot_switch_to_basic_mode":["You cannot switch to basic mode when you have more than one key assigned to one assignment."],"tradeScreen.common.areYouSureYouWantToCloseThisTab":["Are you sure you want to close this tab?"],"tradeScreen.common.blockRfq":["Block RFQ"],"tradeScreen.common.blockTrade":["Block Trade"],"tradeScreen.common.comboTrade":["Combo Trade"],"tradeScreen.common.combosTrades.all":["All"],"tradeScreen.common.combosTrades.future":["Future Combos"],"tradeScreen.common.combosTrades.puts":["Option Combos"],"tradeScreen.common.doYouWantToCancelAllOrdersByKind.body":["Are you sure you want to cancel all your <0>",["kindDisplayName"]," Orders (",["total"],")</0>?<1/>You cannot undo this action."],"tradeScreen.common.doYouWantToCancelAllOrdersByKind.title":["Cancel all ",["kindDisplayName"]," Orders?"],"tradeScreen.common.editTab":["Edit tab"],"tradeScreen.common.expiryDates":["Expiry dates"],"tradeScreen.common.filter":["Filter"],"tradeScreen.common.futureSpreadPremium.tooltip":["The annualised difference between the two futures. Calculated as: APR of future spread = (Future spread mid price / Mark of nearest future) * (525600 / future expirations time difference in minutes) * 100"],"tradeScreen.common.impliedVolatility":["Implied Volatility"],"tradeScreen.common.invalidParametersMessage":["Invalid Parameters"],"tradeScreen.common.loginRequired":["Please sign in. Login required."],"tradeScreen.common.more":["More"],"tradeScreen.common.nothingHere":["
2103Nothing here..."],"tradeScreen.common.optionsTrades.all":["All"],"tradeScreen.common.optionsTrades.calls":["Calls"],"tradeScreen.common.optionsTrades.puts":["Puts"],"tradeScreen.common.optionsTrades.toggleMinSize":["Min Size"],"tradeScreen.common.probability":["Probability (%)"],"tradeScreen.common.strike":["Strike"],"tradeScreen.common.strikePrice":["Strike Price"],"tradeScreen.common.strikes":["Strikes"],"tradeScreen.common.timeInForce":["Time In Force"],"tradeScreen.common.wouldYouLikeToCancelAllOpenOrders":["Would you like to cancel all open orders?"],"tradeScreen.common.wouldYouLikeToCancelAllOpenOrdersIncludingStarbase":["Would you like to cancel all open orders, including Starbase orders? Table filters will not be applied."],"tradeScreen.common.wouldYouLikeToCancelAllTheCurrentlyShownOrders":["Would you like to cancel all the currently shown orders?"],"tradeScreen.common.wouldYouLikeToCancelAllYourOpenOrdersIncludingStarbase":["Would you like to cancel all open orders, including Starbase orders?"],"tradeScreen.componentsNames.AccountSummary":["Account Summary"],"tradeScreen.componentsNames.AccountSummary.description":["The Account Summary component summarises the current state of your account. Hover over the column titles to view column descriptions, or click the vertical columns bar to adjust the number of displayed columns."],"tradeScreen.componentsNames.BlockRfq.description":["Overview of all active Block RFQs requested or tagged in as a maker."],"tradeScreen.componentsNames.BlockRfqRecentTrades":["Block RFQ Recent Trades"],"tradeScreen.componentsNames.BlockRfqRecentTrades.description":["Displays recent block RFQ trades for all users."],"tradeScreen.componentsNames.BlockRfqs":["Block RFQ Overview"],"tradeScreen.componentsNames.BlockRfqsHistory":["My Block RFQ History"],"tradeScreen.componentsNames.BlockRfqsHistory.description":["Record of all Block RFQs requested and responded to."],"tradeScreen.componentsNames.BlockTrade":["Block Trades"],"tradeScreen.componentsNames.BlockTrade.description":["The Block Trades component allows traders to create and accept block trades directly from the UI. Block trades allow two parties to trade directly with each other, without needing to use the public order books."],"tradeScreen.componentsNames.BlockTradeHistory":["My Block Trade History"],"tradeScreen.componentsNames.BlockTradeHistory.description":["The Block Trade History component shows all past block trades of your account. Click the vertical columns bar to adjust the number of displayed columns."],"tradeScreen.componentsNames.BrokerClientsOverview":["Broker Clients Overview"],"tradeScreen.componentsNames.BrokerClientsOverview.description":["Overview screen which shows all current, pending, and past clients of the broker."],"tradeScreen.componentsNames.BrokerageRecentTrades":["My Brokerage Order History"],"tradeScreen.componentsNames.BrokerageRecentTrades.description":["Shows history of all recently initiated broker trades including ones that were cancelled or expired."],"tradeScreen.componentsNames.BrokerageTradeHistory":["My Brokerage Trade History"],"tradeScreen.componentsNames.BrokerageTradeHistory.description":["Shows history of broker trades that resulted in an execution."],"tradeScreen.componentsNames.BrokerageTradingMonitor":["Brokerage Overview"],"tradeScreen.componentsNames.BrokerageTradingMonitor.description":["Overview screen which shows all pending broker trades and their confirmation status with clients."],"tradeScreen.componentsNames.CombosList":["Combos"],"tradeScreen.componentsNames.CombosList.description":["A list of all of the Combos that already have live orderbooks. Click on any of the Combos listed to open the orderbook for that Combo."],"tradeScreen.componentsNames.CombosTrades":["Combos Recent Trades"],"tradeScreen.componentsNames.CombosTrades.description":["The Combos Trades component shows all the past combo trades."],"tradeScreen.componentsNames.CreateCombo":["Create Combo"],"tradeScreen.componentsNames.CreateCombo.description":["Combo orderbooks can be created using this component."],"tradeScreen.componentsNames.DepthChart":["Depth Chart"],"tradeScreen.componentsNames.DepthChart.description":["The Depth Chart component shows a graphical representation of all buy and sell orders of a particular derivatives instrument at different price levels."],"tradeScreen.componentsNames.DvolVsIndexPrice":["Volatility Index (DVOL) vs Index Price"],"tradeScreen.componentsNames.DvolVsIndexPrice.description":["The underlying index price overlaid with the DVOL index over time."],"tradeScreen.componentsNames.EconomicCalendar":["Economic Calendar"],"tradeScreen.componentsNames.EconomicCalendar.description":["Displays important upcoming economic events. This includes economic data releases and announcements from central bank organisations."],"tradeScreen.componentsNames.EthBtcRatio":["Ethereum Index vs Bitcoin Index"],"tradeScreen.componentsNames.EthBtcRatio.description":["The Ethereum index price divided by the Bitcoin index price over time."],"tradeScreen.componentsNames.ExpiryGreeks":["Expiry Greeks"],"tradeScreen.componentsNames.ExpiryGreeks.description":["Displays a table of values of the Greeks for your positions. The Greeks shown include: Net Delta, Delta, Vega, Gamma, Theta, and Rho."],"tradeScreen.componentsNames.FundingVsIndexPrice":["Funding Rate vs Index Price"],"tradeScreen.componentsNames.FundingVsIndexPrice.description":["Funding rate and underlying index price development over time."],"tradeScreen.componentsNames.FutureSpreadsSummary":["Futures Spreads"],"tradeScreen.componentsNames.FutureSpreadsSummary.description":["A summary table of all available futures spreads for the chosen currency. This table includes several useful statistics for each Combo."],"tradeScreen.componentsNames.FuturesSpreadsMatrix":["Futures Spreads Matrix"],"tradeScreen.componentsNames.FuturesSpreadsMatrix.description":["Each of the available futures spreads for the chosen currency in a grid. Allows for easier finding and trading of futures spreads."],"tradeScreen.componentsNames.FuturesSpreadsTable":["Futures Spreads by Volume"],"tradeScreen.componentsNames.FuturesSpreadsTable.description":["The top traded future spreads in number of contracts and number of trades."],"tradeScreen.componentsNames.FuturesSummary":["Futures"],"tradeScreen.componentsNames.FuturesSummary.description":["A summary table of all available futures contracts for the chosen currency. This table includes several useful statistics for each contract."],"tradeScreen.componentsNames.HistoricalVolatility":["Historical Volatility vs Volatility Index (DVOL)"],"tradeScreen.componentsNames.HistoricalVolatility.description":["Realized volatility against DVOL index for up to a month."],"tradeScreen.componentsNames.IVCurvesChart":["Implied Volatility Curves"],"tradeScreen.componentsNames.IVCurvesChart.description":["All available expiries and their corresponding volatility."],"tradeScreen.componentsNames.InstrumentBar":["Instrument Bar"],"tradeScreen.componentsNames.InstrumentBar.description":["Instrument select with price and volume facts"],"tradeScreen.componentsNames.LiquidationsChart":["Liquidations Volume"],"tradeScreen.componentsNames.LiquidationsChart.description":["The total notional for liquidations for a given day separated by whether or not the liquidated trade was short or long"],"tradeScreen.componentsNames.MarkPriceChart":["Mark Price Chart"],"tradeScreen.componentsNames.MarkPriceChart.description":["The Mark Price Chart component shows the mark price for the instrument chosen, adjust the settings by clicking on the configuration icons above and below the chart."],"tradeScreen.componentsNames.News":["News"],"tradeScreen.componentsNames.News.description":["A feed of the latest crypto-related headlines, with links to the full news stories."],"tradeScreen.componentsNames.Notes":["Notepad"],"tradeScreen.componentsNames.Notes.description":["The Notepad component allows to save a quick note."],"tradeScreen.componentsNames.OpenInterestChart":["Open Interest (Prev. day)"],"tradeScreen.componentsNames.OpenInterestChart.description":["Open interest in number of contracts over time for perpetuals/futures/options or in USD notional for options."],"tradeScreen.componentsNames.OpenOrders":["Open Orders"],"tradeScreen.componentsNames.OpenOrders.description":["The Open Orders component shows the current state of all the open orders in the selected market. Select the information you would like to see displayed by hovering over the column titles. Adjust the settings of the component and download the open order data as a CSV file in the settings menu in the upper right corner of the table."],"tradeScreen.componentsNames.OptionBlockComboTradesBreakdown":["Block Combo Trades Breakdown"],"tradeScreen.componentsNames.OptionBlockComboTradesBreakdown.description":["A breakdown of combos bought and sold through block trades in number of contracts or number of trades for a day or a 
2103week."],"tradeScreen.componentsNames.OptionBlockTradesDirectionBreakdown":["Block Trades Breakdown"],"tradeScreen.componentsNames.OptionBlockTradesDirectionBreakdown.description":["A breakdown for block trades of Calls and Puts bought and sold in number of contracts and number of trades for a day or a week."],"tradeScreen.componentsNames.OptionChain":["Option Chain"],"tradeScreen.componentsNames.OptionInstrumentByVolume":["Options Top Volume By Instrument (Current Day)"],"tradeScreen.componentsNames.OptionInstrumentByVolume.description":["Top 5 instruments by 24 hour volume."],"tradeScreen.componentsNames.OptionOpenInterestByExpiration":["Open Interest By Expiration"],"tradeScreen.componentsNames.OptionOpenInterestByExpiration.description":["Outstanding open interest for puts and calls separated into the at the money and out of the money contracts for all expiries."],"tradeScreen.componentsNames.OptionOpenInterestByStrike":["Open Interest By Strike Price"],"tradeScreen.componentsNames.OptionOpenInterestByStrike.description":["The current open interest for puts and calls mapped over option's strike prices overlaid by the Max Pain Price."],"tradeScreen.componentsNames.OptionRegularComboTradesBreakdown":["Regular Combo Trades Breakdown"],"tradeScreen.componentsNames.OptionRegularComboTradesBreakdown.description":["A breakdown of combos bought and sold through regular trades in number of contracts or number of trades for a day or a week."],"tradeScreen.componentsNames.OptionRegularTradesDirectionBreakdown":["Regular Trades Breakdown"],"tradeScreen.componentsNames.OptionRegularTradesDirectionBreakdown.description":["A breakdown for regular trades of Calls and Puts bought and sold in number of contracts and number of trades for a day or a week."],"tradeScreen.componentsNames.OptionRegularTradesVsBlockTrades":["Regular Trades vs Block Trades"],"tradeScreen.componentsNames.OptionRegularTradesVsBlockTrades.description":["A breakdown of combo and block trades by contracts and number of trades for a day or a week."],"tradeScreen.componentsNames.OptionVolumeByExpiration":["Options Volume By Expiration (Current Day)"],"tradeScreen.componentsNames.OptionVolumeByExpiration.description":["The 24 hour volume for all current option expiries separated for calls and puts."],"tradeScreen.componentsNames.OptionWizard":["Option Wizard"],"tradeScreen.componentsNames.OptionWizard.description":["Determine the optimal option strategy based on your own price expectations."],"tradeScreen.componentsNames.OptionsChar.description":["Display all positions for an instrument along with the underlying prices"],"tradeScreen.componentsNames.OptionsChart":["Options Chart"],"tradeScreen.componentsNames.OptionsPricer":["Options Pricer"],"tradeScreen.componentsNames.OptionsPricer.description":["An option pricing tool. Input parameters such as underlying price, strike price, and volatility can be edited, with the resulting option price and Greeks being shown."],"tradeScreen.componentsNames.OptionsTableContainer":["Options"],"tradeScreen.componentsNames.OptionsTableContainer.description":["The Options component shows all available expiries and their corresponding order books. Select the information you would like to see displayed as well as the strike intervals in the settings menu above the table."],"tradeScreen.componentsNames.OptionsTrades":["Options Recent Trades"],"tradeScreen.componentsNames.OptionsTrades.description":["The Options Trades component shows all the past trades in the chosen market. Hover over the column titles to view column descriptions, or click the vertical columns bar to adjust the number of displayed columns."],"tradeScreen.componentsNames.OptionsVolume":["Options Volume (Previous day)"],"tradeScreen.componentsNames.OptionsVolume.description":["Historical volume for different option expiries."],"tradeScreen.componentsNames.OrderBook":["Order Book"],"tradeScreen.componentsNames.OrderBook.description":["The Order Book component displays the order book of the selected instrument. Click on the table settings menu in the right corner of the table to adjust it to your trading needs."],"tradeScreen.componentsNames.OrderForm":["Order Form"],"tradeScreen.componentsNames.OrderForm.description":["The Order Form component is where order details can be entered and submitted. There are several order types to choose from, as well as additional settings to make sure the order does what you want it to."],"tradeScreen.componentsNames.OrdersHistory":["Order History"],"tradeScreen.componentsNames.OrdersHistory.description":["The Order History component shows the past orders of your account. Hover over the column titles to view column descriptions, or click the vertical columns bar to adjust the number of displayed columns."],"tradeScreen.componentsNames.PnlChart":["PNL Chart"],"tradeScreen.componentsNames.PnlChart.description":["Displays the possible PNL of your positions depending on the underlying price. The date can be adju
2103sted to see how the PNL is likely to change as time passes."],"tradeScreen.componentsNames.PortfolioMarginRiskMatrix":["Portfolio Margin Risk Matrix"],"tradeScreen.componentsNames.PortfolioMarginRiskMatrix.description":["The Portfolio Margin Risk Matrix shows how the margin requirements for a portfolio margin account are calculated, broken down by position. The portfolio is tested against possible changes in the market, with the worst performing scenario being used to calculate the margin requirements."],"tradeScreen.componentsNames.PositionsAll":["Positions"],"tradeScreen.componentsNames.PositionsAll.description":["The Positions component summarises the current state of all positions. Hover over the column titles to view descriptions, edit settings at the top, or click the vertical columns bar to adjust the number of displayed columns."],"tradeScreen.componentsNames.PremiumChart":["Futures Premium Above The Index Price"],"tradeScreen.componentsNames.PremiumChart.description":["The difference between the future price and index price over time for all dated futures."],"tradeScreen.componentsNames.PriceLadder":["Price Ladder"],"tradeScreen.componentsNames.PriceLadder.description":["Provides an alternative way of placing orders in as little as one click. Orders are placed by clicking on the desired price level, allowing for multiple orders to be placed (or cancelled) quickly."],"tradeScreen.componentsNames.ProbabilityOfTouchChart":["Probability of Expiring Above Strike"],"tradeScreen.componentsNames.ProbabilityOfTouchChart.description":["The percentage chance of options expiring in the money as predicted by the market by plotting deltas against strike prices for the call of each expiry."],"tradeScreen.componentsNames.PutCallRatioChart":["Put/Call Ratio Chart"],"tradeScreen.componentsNames.PutCallRatioChart.description":["The ratio between the put and call open interest."],"tradeScreen.componentsNames.RecentTrades":["Recent Trades"],"tradeScreen.componentsNames.RecentTrades.description":["Displays the most recent trades for the selected instrument."],"tradeScreen.componentsNames.TVChart":["Chart"],"tradeScreen.componentsNames.TVChart.description":["The Chart component shows the price and volume data of the instrument chosen, adjust the settings by clicking on the configuration icons above and below the chart."],"tradeScreen.componentsNames.TVChartFutures":["Future Chart"],"tradeScreen.componentsNames.TermStructureChart":["Term Structure"],"tradeScreen.componentsNames.TermStructureChart.description":["The implied volatility of at the money options plotted against option expiries for Bitcoin and Ethereum options."],"tradeScreen.componentsNames.TradesHistory":["Trade History"],"tradeScreen.componentsNames.TradesHistory.description":["The Trade History component shows the past trades of the account. Edit settings at the top, or click the vertical columns bar to adjust the number of displayed columns."],"tradeScreen.componentsNames.VolatilitySurface":["Volatility Surface"],"tradeScreen.componentsNames.VolatilitySurface.description":["Displays an interactive three-dimensional chart of the entire volatility surface. Allows implied volatility to be viewed across all expirations and deltas."],"tradeScreen.componentsNames.futuresOpenInterestChart":["Futures Open Interest (Prev. day)"],"tradeScreen.confirmation.closePosition":["Close Position"],"tradeScreen.confirmation.dontShowAgain":["Don't show again."],"tradeScreen.confirmation.dontShowMeAgain":["Don't show it again"],"tradeScreen.confirmation.stopLoss":["Stop Loss"],"tradeScreen.confirmation.takeProfit":["Take Profit"],"tradeScreen.createCombo.comboCreatedSuccess":["Combo created successfully."],"tradeScreen.createCombo.notAvailableForCurrencyPair":["Not available for ",["currencyPair"]," at the moment"],"tradeScreen.customPageNotFound.notLoggedIn":["Please login to see this custom tab."],"tradeScreen.customPageNotFound.title":["This custom tab does not exist."],"tradeScreen.customPagesMenu.confirmDelete":["Are you sure you want to remove the tab <0>",["0"],"</0>?"],"tradeScreen.customPagesTabs.addComponent":["Add component"],"tradeScreen.customPagesTabs.addCustomTab":["Add tab"],"tradeScreen.customPagesTabs.addTab":["Add tab"],"tradeScreen.customPagesTabs.deleteTab":["Delete tab"],"tradeScreen.customPagesTabs.duplicateTab":["Duplicate tab"],"tradeScreen.customPagesTabs.moveDown":["Move down"],"tradeScreen.customPagesTabs.moveUp":["Move up"],"tradeScreen.customPagesTabs.removeBar":["Remove bar"],"tradeScreen.depthChart.depthChartUnavailable":["The Depth Chart is available only for instruments with opened orders on both sides."],"tradeScreen.depthChart.group":["Group"],"tradeScreen.economicCalendar.reload":["Reload"],"tradeScreen.economicCalendar.tableHeader.actual":["Actual"],"tradeScreen.economicCalendar.tableHeader.forecast":["Forec
2103ast"],"tradeScreen.economicCalendar.tableHeader.previous":["Previous"],"tradeScreen.economicCalendar.unableToFetch":["Unable to fetch economic calendar data"],"tradeScreen.export.downloadCSV":["Download CSV"],"tradeScreen.export.downloadChart":["Download Chart"],"tradeScreen.export.saveChart":["Save chart"],"tradeScreen.futureSpreadsSummary.position.tooltip.text":["This is the maximum amount you can trade in the future spread before increasing your position in one of the legs."],"tradeScreen.futureSpreadsSummary.position.tooltip.title":["Total Futures Spread position."],"tradeScreen.futuresSpreadsMatrix.long":["Long"],"tradeScreen.futuresSpreadsMatrix.longLeg":["Long Leg"],"tradeScreen.futuresSpreadsMatrix.short":["Short"],"tradeScreen.futuresSpreadsMatrix.shortLeg":["Short Leg"],"tradeScreen.instrumentBar.24hCh":["24h Ch."],"tradeScreen.instrumentBar.24hChange":["24h Change"],"tradeScreen.instrumentBar.24hChange.tooltip":["Show the relative change in price from 24 hours ago to now"],"tradeScreen.instrumentBar.24hHigh":["24h High"],"tradeScreen.instrumentBar.24hLow":["24h Low"],"tradeScreen.instrumentBar.24hLowHigh":["24h Low / High"],"tradeScreen.instrumentBar.24hLowHigh.tooltip":["The lowest and the highest traded price of the instrument in the last 24 hours"],"tradeScreen.instrumentBar.24hVolume":["24h Volume"],"tradeScreen.instrumentBar.24hVolume.tooltip":["The total size of volume traded in the last 24 hours for this instrument"],"tradeScreen.instrumentBar.24hVolumeCoin":["24h Volume (coin)"],"tradeScreen.instrumentBar.24hVolumeUSD":["24h Volume USD"],"tradeScreen.instrumentBar.Funding8h":["Funding/8h"],"tradeScreen.instrumentBar.Funding8h.tooltip":["The current realtime rate based on 8h periods. The average funding rate over last 8 hours was ",["funding"],"%"],"tradeScreen.instrumentBar.Open":["Open"],"tradeScreen.instrumentBar.Open.tooltip":["Open interest indicates the total size of the instrument that are currently out there. Open Interest = total size of all the open long positions = total size of all the open short positions"],"tradeScreen.instrumentBar.Premium.tooltip":["The APR shown is provided for informational purposes, similar to an interest rate. For expiring futures, it is the annualized premium of the Future over the Index price, calculated as: % (mid Future price / Index price − 1) × 525,600 / minutes until expiration. For perpetual contracts, it is the annualized funding rate derived from the current funding payments over the last 8 hours."],"tradeScreen.instrumentBar.deviation":["Deviation"],"tradeScreen.instrumentBar.deviation.tooltip":["The deviation of the Future over the Index price, for informational purposes (cf. to an interest rate), calculated as: %(Mid Future price / Index price - 1)."],"tradeScreen.instrumentBar.estimatedDeliveryPrice":["EDP"],"tradeScreen.instrumentBar.estimatedDeliveryPrice.tooltip":["Estimated Delivery Price"],"tradeScreen.instrumentBar.expiredInstrument":["Page instrument has expired. <0>Click here</0> to select a new instrument."],"tradeScreen.instrumentBar.expiredInstrument2":["Instrument has expired"],"tradeScreen.instrumentBar.futureMark":["Future Mark"],"tradeScreen.instrumentBar.index":["Index"],"tradeScreen.instrumentBar.index.tooltip":["The current index price"],"tradeScreen.instrumentBar.lambda":["Lambda"],"tradeScreen.instrumentBar.lambda.tooltip":["Lambda is an option Greek that measures how much leverage the option currently contains. It does so by calculating the percentage change in option value for a 1% change in the underlying price.<0/><1/>For example, a lambda of 10 means the option price is expected to increase by 10% if the underlying price increases by 1%. Lambda is positive for calls, and negative for puts."],"tradeScreen.instrumentBar.markIv.tooltip":["The exchange implied volatility estimate for this option"],"tradeScreen.instrumentBar.markUsd":["Mark USD"],"tradeScreen.instrumentBar.markUsd.tooltip":["This is an exchange metric to estimate the fair value of the option, converted to USD"],"tradeScreen.instrumentBar.noInstrumentSelected":["Page instrument is not selected. <0>Click here</0> to select an instrument."],"tradeScreen.instrumentBar.oiCoin":["OI (coin)"],"tradeScreen.instrumentBarPlaceholder.noInstrument":["No instrument selected"],"tradeScreen.instrumentSearch.default":["Default"],"tradeScreen.loading":["Loading..."],"tradeScreen.marketMetrics.all":["All"],"tradeScreen.marketMetrics.allExpirations":["All Expirations"],"tradeScreen.marketMetrics.amount":["Amount"],"tradeScreen.marketMetrics.amountUSD":["Amount (USD)"],"tradeScreen.marketMetrics.atmImpliedVolatility":["ATM Implied Volatility"],"tradeScreen.marketMetrics.blockRfqTrades":["Block RFQ Trades"],"tradeScreen.marketMetrics.blockTrades":["Block Trades"],"tradeScreen.marketMetrics.buyFutures":["Short Futures Bought"],"tradeScreen.marketMetrics.buyOptions":["Short Options Bought"],"tradeScreen.marketMetrics.callOpenInterest":["Call Open Interest"],"tradeScreen.marketMetrics.calls":["Calls"],"tradeScreen.marketMetrics.callsBought":["Calls Bought"],"tradeScreen.marketMetrics.callsItm":["Calls ITM"],"tradeScreen.marketMetrics.callsNotionalValue":["Calls Notional Value"],"tradeScreen.marketMetrics.callsOtm":["Calls OTM"],"tradeScreen.marketMetrics.callsSold":["Calls Sold"],"tradeScreen.marketMetrics.comboOrderBookTrades":["Combo Orderbook Trades"],"tradeScreen.marketMetrics.contracts":["Contracts"],"tradeScreen.marketMetrics.dailyCallsVolume":["24h Call Volume"],"tradeScreen.marketMetrics.dailyPutsVolume":["24h Put Volume"],"tradeScreen.marketMetrics.day":["Day"],"tradeScreen.marketMetrics.eightHours":["8 Hours"],"tradeScreen.marketMetrics.ethVsBtcIndex.title":["Ethereum Index vs Bitcoin Index"],"tradeScreen.marketMetrics.expiration":["Expiration"],"tradeScreen.marketMetrics.futuresSummary.title":["Futures"],"tradeScreen.marketMetrics.halfYear":["6 Months"],"tradeScreen.marketMetrics.historicalVolatility":["Historical Volatility"],"tradeScreen.marketMetrics.historicalVolatility.title":["Historical Volatility vs ",["currency"]," Volatility Index (DVOL)"],"tradeScreen.marketMetrics.hour":["Hour"],"tradeScreen.marketMetrics.indexPrice":["Index Price"],"tradeScreen.marketMetrics.interest":["Interest (8H)"],"tradeScreen.marketMetrics.itmCalls":["ITM Calls"],"tradeScreen.marketMetrics.itmPuts":["ITM Puts"],"tradeScreen.marketMetrics.maxPainPrice":["Max Pain Price"],"tradeScreen.marketMetrics.month":["Month"],"tradeScreen.marketMetrics.noTrades":["No trades for this market"],"tradeScreen.marketMetrics.notional":["Notional"],"tradeScreen.marketMetrics.notionalValue":["Notional Value"],"tradeScreen.marketMetrics.openInterest":["Open Interest"],"tradeScreen.marketMetrics.openInterest.selectOption.futures":["Futures"],"tradeScreen.marketMetrics.openInterest.selectOption.options":["Options"],"tradeScreen.marketMetrics.openInterest.selectOption.perpetual":["Perpetual"],"tradeScreen.marketMetrics.orderBookTrades":["Orderbook Trades"],"tradeScreen.marketMetrics.otmCalls":["OTM Calls"],"tradeScreen.marketMetrics.otmPuts":["OTM Puts"],"tradeScreen.marketMetrics.percentAnnualized":["% Annualized"],"tradeScreen.marketMetrics.percentPremium":["% Premium"],"tradeScreen.marketMetrics.putCallRatio":["Put/Call Ratio"],"tradeScreen.marketMetrics.putOpenInteres":["Put Open Interest"],"tradeScreen.marketMetrics.puts":["Puts"],"tradeScreen.marketMetrics.putsBought":["Puts Bought"],"tradeScreen.marketMetrics.putsItm":["Puts ITM"],"tradeScreen.marketMetrics.putsNotionalValue":["Puts 
2103Notional Value"],"tradeScreen.marketMetrics.putsOtm":["Puts OTM"],"tradeScreen.marketMetrics.putsSold":["Puts Sold"],"tradeScreen.marketMetrics.quarter":["3 Month"],"tradeScreen.marketMetrics.sellFutures":["Long Futures Sold"],"tradeScreen.marketMetrics.sellOptions":["Long Options Sold"],"tradeScreen.marketMetrics.strikePrice":["Strike Price"],"tradeScreen.marketMetrics.totalIntrinsicValue":["Total Intrinsic Value"],"tradeScreen.marketMetrics.totalItmValue":["Total ITM Value"],"tradeScreen.marketMetrics.totalNotionalValue":["Total Notional Value"],"tradeScreen.marketMetrics.totalOpenInterest":["Total Open Interest"],"tradeScreen.marketMetrics.totalOtmValue":["Total OTM Value"],"tradeScreen.marketMetrics.trades":["Trades"],"tradeScreen.marketMetrics.usdPremium":["$ Premium"],"tradeScreen.marketMetrics.volatility":["Volatility Index"],"tradeScreen.marketMetrics.volatilityIndex":[["currency"]," Volatility Index (DVOL)"],"tradeScreen.marketMetrics.week":["Week"],"tradeScreen.marketMetrics.year":["Year"],"tradeScreen.news.unableToFetch":["Unable to fetch news"],"tradeScreen.openOrders.cancelAllIsDisabledWhe
2103nSearchFilterIsUsed":["The Cancel All is disabled when the Search Filter is used"],"tradeScreen.openOrders.clickToEditTheseOrders":["Click to edit these orders"],"tradeScreen.openOrders.noDataOverlay":["You have no open orders in this market"],"tradeScreen.openOrders.refreshVisibleIM":["Refresh IM"],"tradeScreen.openOrders.title":["Open Orders"],"tradeScreen.openOrders.wasAmount":["was"],"tradeScreen.optionTrades.noData":["There are too few trades with a minimum size of ",["0"]," to filter."],"tradeScreen.optionsChain.distanceFromUnderlyingPrice":["Distance from underlying price"],"tradeScreen.optionsChain.expectedPriceMove":["Expected price move"],"tradeScreen.optionsChain.multiLeg":["Multi-Leg"],"tradeScreen.optionsChain.multiLeg.amountBelowMinimum":["Minimum trade amount is ",["minTradeAmount"]],"tradeScreen.optionsChain.multiLeg.customCombo":["Custom combo"],"tradeScreen.optionsChain.multiLeg.customComboNotSupported":["Custom combos are not supported. Please use a recognized strategy or Block RFQ."],"tradeScreen.optionsChain.multiLeg.emptyStateText":["Select an instrument from the option chain."],"tradeScreen.optionsChain.multiLeg.flipBuySell":["Flip Buy/Sell"],"tradeScreen.optionsChain.multiLeg.flipDirectionsToBuy":["Flip leg directions to buy this strategy"],"tradeScreen.optionsChain.multiLeg.flipDirectionsToSell":["Flip leg directions to sell this strategy"],"tradeScreen.optionsChain.multiLeg.greeks":["Greeks"],"tradeScreen.optionsChain.multiLeg.greeksAfter":["After"],"tradeScreen.optionsChain.multiLeg.greeksCurrent":["Current"],"tradeScreen.optionsChain.multiLeg.greeksOrder":["Order"],"tradeScreen.optionsChain.multiLeg.instrumentNotActive":["One or more instruments are not active for trading"],"tradeScreen.optionsChain.multiLeg.noPositionToReduce":["No position to reduce"],"tradeScreen.optionsChain.multiLeg.notEnoughLongPosition":["Not enough long position to reduce"],"tradeScreen.optionsChain.multiLeg.notEnoughShortPosition":["Not enough short position to reduce"],"tradeScreen.optionsChain.multiLeg.option":["Option"],"tradeScreen.optionsChain.multiLeg.positionLocked":["Position is locked"],"tradeScreen.optionsChain.multiLeg.priceRequired":["Price is required"],"tradeScreen.optionsChain.multiLeg.productDisabled":["Your account does not allow trading for one or more instruments in this strategy"],"tradeScreen.optionsChain.multiLeg.qty":["Qty"],"tradeScreen.optionsChain.multiLeg.side":["Side"],"tradeScreen.optionsChain.multiLeg.strategy":["Strategy"],"tradeScreen.optionsChain.multiLeg.tabs.greeks":["Greeks"],"tradeScreen.optionsChain.multiLeg.tabs.orderBook":["Order Book"],"tradeScreen.optionsChain.multiLeg.tabs.pnlChart":["PNL Chart"],"tradeScreen.optionsChain.singleLeg":["Single Leg"],"tradeScreen.optionsChain.usd":["USD"],"tradeScreen.optionsChart.IVShading":["IV Shading"],"tradeScreen.optionsChart.filter.combos":["Combo's"],"tradeScreen.optionsChart.filters.positionDelta":["Position Delta"],"tradeScreen.optionsChart.filters.positionSize":["Position Size"],"tradeScreen.optionsChart.impliedAsk":["Ask(Implied)"],"tradeScreen.optionsChart.impliedBid":["Bid(Implied)"],"tradeScreen.optionsChart.invalid_option_market_limit":["Market limit is disabled since it would result in an execution at a bad price"],"tradeScreen.optionsChart.marketLimit":["Market Limit"],"tradeScreen.optionsPricer.form.expiryDate":["Expiry Date"],"tradeScreen.optionsPricer.form.indexPrice":["Index"],"tradeScreen.optionsPricer.form.strike":["Strike"],"tradeScreen.optionsPricer.form.timeToMaturity":["Time to Maturity"],"tradeScreen.optionsPricer.form.underlyingPrice":["Future"],"tradeScreen.optionsPricer.form.volatility":["Volatility (%)"],"tradeScreen.optionsPricer.results.Delta":["Delta"],"tradeScreen.optionsPricer.results.Vega":["Vega"],"tradeScreen.optionsPricer.results.call":["Call"],"tradeScreen.optionsPricer.results.gamma":["Gamma"],"tradeScreen.optionsPricer.results.price":["Price"],"tradeScreen.optionsPricer.results.pricePerCurrency":["Price/Currency"],"tradeScreen.optionsPricer.results.put":["Put"],"tradeScreen.optionsPricer.results.theta":["Theta"],"tradeScreen.optionsTable.ask":["Ask"],"tradeScreen.optionsTable.bid":["Bid"],"tradeScreen.optionsTable.calls":["Calls"],"tradeScreen.optionsTable.column.extrinsicValue":["ExtValue"],"tradeScreen.optionsTable.componentSettings.aroundATM":["Around ATM"],"tradeScreen.optionsTable.componentSettings.showExpectedMove":["Expected price move"],"tradeScreen.optionsTable.componentSettings.strikeRanger":["Strike Range"],"tradeScreen.optionsTable.distance":["Distance From Underlying Price"],"tradeScreen.optionsTable.estDeliveryPrice":["Est. delivery price"],"tradeScreen.optionsTable.expired":["Expired, closed for trading."],"tradeScreen.optionsTable.exportToCsv":["Export to CSV"],"tradeScreen.optionsTable.extrinsicValue.tooltip":["The value given to an option by time and volatility. Extrinsic Value = Mark Price – Intrinsic Value. Intrinsic Value is how far in the money the option is."],"tradeScreen.optionsTable.gamma":["Gamma"],"tradeScreen.optionsTable.instrument":["Instrument"],"tradeScreen.optionsTable.ivAsk":["IV Ask"],"tradeScreen.optionsTable.ivBid":["IV Bid"],"tradeScreen.optionsTable.ivTooltip":["The one standard deviation expected move, as implied by the current at-the-money option prices. The expected move gives a price range that option prices are implying will most likely* contain the underlying price when those options expire.<0/>*Roughly 68% of the time, based on one standard deviation.<1/><2/>The expected range low is given by:<3/>
2103Future / (exp(ATM_Vol * sqrt(T)))<4/>The expected range high is given by:<5/>Future * (exp(ATM_Vol * sqrt(T)))"],"tradeScreen.optionsTable.last":["Last"],"tradeScreen.optionsTable.mark":["Mark"],"tradeScreen.optionsTable.nDelta":["NDelta"],"tradeScreen.optionsTable.newMark":["New Mark"],"tradeScreen.optionsTable.newMarkIv":["New Mark IV"],"tradeScreen.optionsTable.noExpiryStrings":["Not available for ",["currencyPair"]," at the moment"],"tradeScreen.optionsTable.open":["Open"],"tradeScreen.optionsTable.popUp.askPrice":["Ask Price"],"tradeScreen.optionsTable.popUp.askSize":["Ask Size"],"tradeScreen.optionsTable.popUp.bidPrice":["Bid Price"],"tradeScreen.optionsTable.popUp.bidSize":["Bid Size"],"tradeScreen.optionsTable.popUp.total":["Total"],"tradeScreen.optionsTable.pos":["Position"],"tradeScreen.optionsTable.puts":["Puts"],"tradeScreen.optionsTable.settlement.daily":["Daily"],"tradeScreen.optionsTable.settlement.monthly":["Monthly"],"tradeScreen.optionsTable.settlement.quarterly":["Quarterly"],"tradeScreen.optionsTable.settlement.weekly":["Weekly"],"tradeScreen.optionsTable.showAll":["Show all (",["checkboxNum"],")"],"tradeScreen.optionsTable.strike":["Strike"],"tradeScreen.optionsTable.theta":["Theta"],"tradeScreen.optionsTable.tho":["Rho"],"tradeScreen.optionsTable.timeToExpiry":["Time to Expiry:"],"tradeScreen.optionsTable.triangleDelta":["Δ|Delta"],"tradeScreen.optionsTable.underlyingFuture":["Underlying future:"],"tradeScreen.optionsTable.underlyingPrice.tooltip":["The forward price for this expiry is the ",["ulIndex"]," future mark price ",["ulPrice"]," which is used in the Black Scholes model to calculate the option prices."],"tradeScreen.optionsTable.underlyingPrice.tooltip.indexPrice":["The forward price for this expiry is the index price ",["ulPrice"]," which is used in the Black Scholes model to calculate the option prices."],"tradeScreen.optionsTable.underlyingPrice.tooltip.synBook":["The forward price for this expiry is the synthetic book ",["ulIndex"]," mark price ",["ulPrice"]," which is used in the Black Scholes model to calculate the option prices."],"tradeScreen.optionsTable.vega":["Vega"],"tradeScreen.optionsTable.volume":["Volume"],"tradeScreen.optionsTableHeader.ask.tooltip":["This is the price at which users are willing to sell the option."],"tradeScreen.optionsTableHeader.bid.tooltip":["This is the price at which users are willing to buy the option."],"tradeScreen.optionsTableHeader.distance.tooltip":["When 'Dist' is enabled, the percentage difference between the underlying price and the strike price is shown underneath the strike price."],"tradeScreen.optionsTableHeader.ivAsk.tooltip":["This is the implied volatility of the best ask price."],"tradeScreen.optionsTableHeader.ivBid.tooltip":["This is the implied volatility of the best bid price."],"tradeScreen.optionsTableHeader.mark.tooltip":["This is an exchange metric to estimate the fair value of the option. All user positions are valued against the Mark Price to calculate equity."],"tradeScreen.optionsTableHeader.optionsAskSize.tooltip":["This is the volume that is on the best ask."],"tradeScreen.optionsTableHeader.optionsBidSize.tooltip":["This is the volume that is on the best bid."],"tradeScreen.optionsTableHeader.optionsDelta.tooltip":["Delta is a risk measure and gives the change in USD price as the underlying changes."],"tradeScreen.optionsTableHeader.optionsLast.tooltip":["Last traded price."],"tradeScreen.optionsTableHeader.optionsOpen.tooltip":["Open Interest is the total amount of outstanding contracts. Open Interest = total open long positions = total open short positions."],"tradeScreen.optionsTableHeader.optionsVolume.tooltip":["The volume in the last 24 hours for this instrument."],"tradeScreen.optionsTableHeader.strike.tooltip":["The strike price of an option is the price at which a put or call option can be exercised."],"tradeScreen.optionsTrades.iv.tooltip":["The implied volatility equivalent to the traded price."],"tradeScreen.optionsTrades.position.tooltip":["The number of contracts you have for the instrument."],"tradeScreen.optionsTrades.price.tooltip":["The traded price."],"tradeScreen.optionsTrades.priceUSD.tooltip":["The coin traded price multiplied by the underlying price (forward)."],"tradeScreen.optionsTrades.theoProfit.tooltip":["The instant profit that Deribit would calculate for the user on the winning side of this trade. Theoretical (THEO) Profit = abs(Price - Mark Price) * Size."],"tradeScreen.orderBook.centerRow.edp":["EDP"],"tradeScreen.orderBook.centerRow.index":["Index"],"tradeScreen.orderBook.componentSettings.animation":["Animation in Order Book"],"tradeScreen.orderForm.advanced":["Advanced"],"tradeScreen.orderForm.advancedSettings.displayAmount":["Display Amount"],"tradeScreen.orderForm.advancedSettings.fillOrKill":["Fill Or Kill"],"tradeScreen.orderForm.advancedSettings.goodTillCancel":["Good Till Cancel"],"tradeScreen.orderForm.advancedSettings.goodTillDay":["Good Till Day"],"tradeScreen.orderForm.advancedSettings.iceberg":["Iceberg"],"tradeScreen.orderForm.advancedSettings.icebergOrder":["Iceberg Order"],"tradeScreen.orderForm.advancedSettings.immediateOrCancel":["Immediate Or Cancel"],"tradeScreen.orderForm.advancedSettings.post":["Post"],"tradeScreen.orderForm.advancedSettings.postOnly":["Post Only"],"tradeScreen.orderForm.advancedSettings.reduce":["Reduce"],"tradeScreen.orderForm.advancedSettings.reduceOnly":["Reduce Only"],"tradeScreen.orderForm.amountInputLabel":["Amount"],"tradeScreen.orderForm.anchorBreached":["Price anchor has been breached. Order prices are limited to the anch
2103or price range."],"tradeScreen.orderForm.availableBalance":["Available"],"tradeScreen.orderForm.btn.buy":["Buy"],"tradeScreen.orderForm.btn.sell":["Sell"],"tradeScreen.orderForm.buyMargin":["Buy Margin"],"tradeScreen.orderForm.calculator.entryPrice":["Entry Price"],"tradeScreen.orderForm.calculator.exitPrice":["Exit Price"],"tradeScreen.orderForm.calculator.profitLoss":["Profit / Loss"],"tradeScreen.orderForm.cbeRouted":["This order will be routed by Deribit FZE, acting as broker, to its affiliate Coinbase Exchange, Inc. for execution."],"tradeScreen.orderForm.componentSettings.amountInQuoteCurrency":["Amount in quote currency"],"tradeScreen.orderForm.componentSettings.scrollableOrderbook":["Scrollable order book"],"tradeScreen.orderForm.confirmation.OCO":["OCO (Take Profit & Stop Loss)"],"tradeScreen.orderForm.confirmation.TIF":["TIF"],"tradeScreen.orderForm.confirmation.amount":["Amount"],"tradeScreen.orderForm.confirmation.createOrder":["Create order"],"tradeScreen.orderForm.confirmation.currentBestAskIs":["The current best ASK is ",["displayedBestAsk"]],"tradeScreen.orderForm.confirmation.currentBestBidIs":["The current best BID is ",["displayedBestBid"]],"tradeScreen.orderForm.confirmation.currentInitialMargin":["Current Initial Margin"],"tradeScreen.orderForm.confirmation.currentMaintenanceMargin":["Current Maintenance Margin"],"tradeScreen.orderForm.confirmation.currentMarginBalance":["Current Margin Balance"],"tradeScreen.orderForm.confirmation.currentMarkPriceIs":["The current mark price is ",["displayedMarkPrice"]],"tradeScreen.orderForm.confirmation.didYouIntendToPlaceThisOrder":["Did you intend to place this order?"],"tradeScreen.orderForm.confirmation.displayAmount":["Display Amount"],"tradeScreen.orderForm.confirmation.estimatedInitialMargin":["Estimated Initial Margin"],"tradeScreen.orderForm.confirmation.estimatedMaintenanceMargin":["Estimated Maintenance Margin"],"tradeScreen.orderForm.confirmation.fee":["Fee"],"tradeScreen.orderForm.confirmation.feeMaker":["Fee Maker"],"tradeScreen.orderForm.confirmation.feeTaker":["Fee Taker"],"tradeScreen.orderForm.confirmation.initialMarginWillExceedMarginBalance":["Your Initial Margin will exceed the Margin Balance."],"tradeScreen.orderForm.confirmation.itWillProbablyBeExecutedImmediately":["Most likely it will be executed immediately."],"tradeScreen.orderForm.confirmation.maintenanceMarginWillExceedMarginBalance":["Your Maintenance Margin will exceed the Margin Balance."],"tradeScreen.orderForm.confirmation.no":["No"],"tradeScreen.orderForm.confirmation.orderType":["Order Type"],"tradeScreen.orderForm.confirmation.orderWillBePlacedAboveIt":["Your order will be placed ",["percentageDifference"],"% above it."],"tradeScreen.orderForm.confirmation.orderWillBePlacedBelowIt":["Your order will be placed ",["percentageDifference"],"% below it."],"tradeScreen.orderForm.confirmation.oto":["OTO"],"tradeScreen.orderForm.confirmation.pleaseConfirmTheOrder":["This could be intentional. In that case, please confirm the order."],"tradeScreen.orderForm.confirmation.price":["Price"],"tradeScreen.orderForm.confirmation.priceOfTheOrderPlacesItDeepIntoTheMarket":["The price of your submitted order places it deep into the market."],"tradeScreen.orderForm.confirmation.trigger":["Trigger"],"tradeScreen.orderForm.confirmation.triggerOffset":["Trigger Offset"],"tradeScreen.orderForm.confirmation.triggerPrice":["Trigger Price"],"tradeScreen.orderForm.confirmation.yes":["Yes"],"tradeScreen.orderForm.confirmation.yourOrder":["Your order"],"tradeScreen.orderForm.estimatedLoss":["Estimated Loss"],"tradeScreen.orderForm.estimatedProfit":["Estimated Profit"],"tradeScreen.orderForm.fee":["Fee"],"tradeScreen.orderForm.icebergInputLabel":["Display Amount"],"tradeScreen.orderForm.incorrectAmountError":["The trade amount must meet or exceed the minimum order size."],"tradeScreen.orderForm.invali
2103d_average_market_price.buy":["Buy is disabled since this market order would result in an execution at a bad price"],"tradeScreen.orderForm.invalid_average_market_price.sell":["Sell is disabled since this market order would result in an execution at a bad price"],"tradeScreen.orderForm.invalid_option_market_limit.buy":["Buy is disabled since this market limit order may execute too far from the current market price. To continue, place a limit order instead."],"tradeScreen.orderForm.invalid_option_market_limit.sell":["Sell is disabled since this market limit order may execute too far from the current market price. To continue, place a limit order instead."],"tradeScreen.orderForm.makerFee":["Maker Fee"],"tradeScreen.orderForm.margins.calculate":["Calculate"],"tradeScreen.orderForm.no_position_for_reduce_only.buy":["Buy is disabled since this would increase your position and you have Reduce Only enabled"],"tradeScreen.orderForm.no_position_for_reduce_only.sell":["Sell is disabled since this would increase your position and you have Reduce Only enabled"],"tradeScreen.orderForm.notEnoughPermissions":["Not enough permissions to make an order"],"tradeScreen.orderForm.only_reduce_orders_allowed.":["Only reduce orders are allowed."],"tradeScreen.orderForm.overlay.warning.message":["By clicking <0>\\"Confirm\\"</0> you acknowledge that you are aware of the limitations of the different order types on Deribit, and in particular conditional orders. Conditional orders include a SL and/or TP that are linked to a primary order. It is important to be aware that order execution is not guaranteed in all circumstances, and some combinations of primary and secondary order settings could cause undesirable behaviour."],"tradeScreen.orderForm.overlay.warning.subtitle":["You can test all of our order types for free on <0>test.deribit.com</0>. If you want to learn more, check out our <1>introduction to conditional orders</1>."],"tradeScreen.orderForm.overlay.warning.title":["Conditional Orders Limitations Acceptance"],"tradeScreen.orderForm.position":["Position"],"tradeScreen.orderForm.positionMMImpact":["Position MM impact"],"tradeScreen.orderForm.postonlyRejectTooltip":["\\"Post only\\" orders will always enter the order book as maker orders and will be rejected if they were to be matched instantly."],"tradeScreen.orderForm.priceInputLabel":["Price"],"tradeScreen.orderForm.product_disabled_for_trading":["This product is disabled for trading on your account."],"tradeScreen.orderForm.rfq":["RFQ"],"tradeScreen.orderForm.sellMargin":["Sell Margin"],"tradeScreen.orderForm.short_option_position_not_allowed":["Opening a short option position is not allowed by your risk profile."],"tradeScreen.orderForm.stopLoss":["Stop Loss"],"tradeScreen.orderForm.tabs.implv":["IV"],"tradeScreen.orderForm.tabs.limit":["Limit"],"tradeScreen.orderForm.tabs.limitIv":["Limit/IV"],"tradeScreen.orderForm.tabs.limitUsdIv":["Limit/USD/IV"],"tradeScreen.orderForm.tabs.market":["Market"],"tradeScreen.orderForm.tabs.marketLimit":["Market Limit"],"tradeScreen.orderForm.tabs.stopLimit":["Stop Limit"],"tradeScreen.orderForm.tabs.stopMarket":["Stop Market"],"tradeScreen.orderForm.tabs.takeLimit":["Take Limit"],"tradeScreen.orderForm.tabs.takeMarket":["Take Market"],"tradeScreen.orderForm.tabs.trailingStop":["Trailing Stop"],"tradeScreen.orderForm.tabs.trailingTake":["Trailing Stop"],"tradeScreen.orderForm.tabs.usd":["USD"],"tradeScreen.orderForm.takeProfit":["Take Profit"],"tradeScreen.orderForm.takerFee":["Taker Fee"],"tradeScreen.orderForm.tickSizePricesGte":["Tick Size (prices ≥ ",["above_price"],")"],"tradeScreen.orderForm.tickSizePricesLessThan":["Tick Size (prices < ",["minPrice"],")"],"tradeScreen.orderForm.tooltips.USDOrderTitle":["USD Order"],"tradeScreen.orderForm.tooltips.advancedIVOrder":["Your order is continuously updated by the system, such that the ",["currency"]," price of the order always corresponds with the implied volatility entered. Every 6 seconds the system evaluates your order and updates the price in ",["currency"],", such that the price of your order always corresponds with the given implied volatility. To calculate the price of the option, the ",["currency"],"-Index and the standard Black-Sch
2103oles model for European options are used."],"tradeScreen.orderForm.tooltips.advancedOrderForm":["This function allows experienced traders to place advanced USD and implied volatility orders"],"tradeScreen.orderForm.tooltips.advancedOrderFormIv":["Your order will be continuously updated by the system, such that the ",["currency"]," price of the order will correspond with the implied volatility entered. Every 6 seconds the system will evaluate your order and update the price in ",["currency"],", such that the price of your order will correspond with the given implied volatility. The ",["currency"],"-Index is used with standard Black-Scholes model for european options to calculate the price of the option."],"tradeScreen.orderForm.tooltips.advancedOrderFormLinear":["This function allows experienced traders to place advanced implied volatility orders"],"tradeScreen.orderForm.tooltips.advancedOrderFormTitle":["Advanced order form"],"tradeScreen.orderForm.tooltips.advancedOrderFormUsd":["Your order will be continuously updated by our system, such that the ",["currency"]," price of the order corresponds with the fixed entered price in USD. Price in ",["currency"]," = USD price / the current price of the underlying asset. Example: If you buy a 25 Sep 2020 option for $",["price1"]," and the 25 Sep 2020 future is trading at $",["price2"],", the price in ",["currency"]," will be $",["price1"],"/$",["price2"]," = 0.0222 ",["currency"],". Please note that the USD value is always calculated using the USD value of the underlying asset rather than the index."],"tradeScreen.orderForm.tooltips.advancedUSDOrder":["Your order is continuously updated by our system, such that the ",["currency"]," price of the order always corresponds with the fixed price in USD. Every 6 seconds the system evaluates your order and updates the price in ",["currency"],", such that the price in ",["currency"]," corresponds to the fixed price in USD. Price = USD Price / ",["currency"]," Index. Example: When you buy an option for $50 with the ",["currency"]," index at $300, the system accepts your order at a price of 0.1667 ",["currency"],". It gets continuously updated, such that it always corresponds to $50. The final price in USD, however, can slightly vary from the amount given in the order form, due to the nature of this order type."],"tradeScreen.orderForm.tooltips.advancedUSDOrderTitle":["USD order"],"tradeScreen.orderForm.tooltips.displayAmount":["The amount that will be displayed in the order book. The display amount needs to be in a ratio of 1:100 to the total amount and be at least 100 times larger than the minimum order size."],"tradeScreen.orderForm.tooltips.feeDescription":["Your fee level is ",["feeLevel"],", based on your trailing 30-day volume on Deribit. Fee tier upgrades are done daily, fee tier downgrades are done once a month."],"tradeScreen.orderForm.tooltips.feeTitle":["Fee"],"tradeScreen.orderForm.tooltips.fillOrKill":["Execute a transaction immediately and completely or not at all."],"tradeScreen.orderForm.tooltips.goodTillCancelled":["GTC is selected by default. An unfilled GTC order remains in the order book until cancelled, or until the instrument expires."],"tradeScreen.orderForm.tooltips.goodTillDay":["An unfilled GTD order remains in the order book until the end of the trading session. Trading Sessions end at 0800 UTC every day."],"tradeScreen.orderForm.tooltips.iceberg":["\\"Iceberg\\" orders show only the specified display amount in the order book. The full amount is hidden."],"tradeScreen.orderForm.tooltips.immediateOrCancel":["Executes the transaction immediately, if any portion of the order cannot be filled instantly, it gets cancelled."],"tradeScreen.orderForm.tooltips.implvOrderTitle":["Implied Volatility Order"],"tradeScreen.orderForm.tooltips.ivOrder":["Implied Volatility order"],"tradeScreen.orderForm.tooltips.limit":["Limit"],"tradeScreen.orderForm.tooltips.limitOrder":["Your buy (sell) order comes with a maximum (minimum) limit price. Your order will not match above (below) the order price for buy (sell) orders."],"tradeScreen.orderForm.tooltips.market":["Market"],"tradeScreen.orderForm.tooltips.marketLimit":["Market Limit"],"tradeScreen.orderForm.tooltips.marketLimitOrder":["Market order, but limited to the current best available market price. If partially filled, the remainder becomes a Limit order."],"tradeScreen.orderForm.tooltips.marketOrder":["Your order will be the agressor, moving through the order book until it is completely filled. The only price limit attached to this order is the allowed trading bandwidth limit of the instrument, which is imposed by the Deribit Risk Management System. The order will c
2103ontinue to match up to the allowed bandwidth, with any remainder resting in the order book at the highest (lowest) possible price for a buy (sell) order if not immediately filled."],"tradeScreen.orderForm.tooltips.maxLeverage":["Deribit offers leverage up to 100x. The max leverage you can use depends on the position you have. The bigger the position, the smaller the max leverage allowed. For more information: Knowledge Base => Deribit Perpetual => Initial Margin."],"tradeScreen.orderForm.tooltips.maximumLeverage":["Maximum Leverage"],"tradeScreen.orderForm.tooltips.openMarginDescription":["The required margin to place the order."],"tradeScreen.orderForm.tooltips.openMarginTitle":["Open Order Margin"],"tradeScreen.orderForm.tooltips.positionMMImpactDescription":["Shows the impact of the position on maintenance margin requirements."],"tradeScreen.orderForm.tooltips.positionMMImpactTitle":["Position MM Impact"],"tradeScreen.orderForm.tooltips.postOnly":["\\"Post only\\" orders will always enter the order book as maker orders and will be adjusted if they were to be matched instantly (with lower fee or rebate, see the docs for more details)."],"tradeScreen.orderForm.tooltips.reduceOnly":["\\"Reduce only\\" orders are intended to only reduce an existing position."],"tradeScreen.orderForm.tooltips.standard":["Standard"],"tradeScreen.orderForm.tooltips.standardOrder":["Your order will be placed at a fixed price given in BTC"],"tradeScreen.orderForm.tooltips.stopLimit":["A Limit order is sent to the market if the chosen trigger condition is met. Often used to limit the losses of an existing position once a certain price level has been reached."],"tradeScreen.orderForm.tooltips.stopLimitTitle":["Stop Limit"],"tradeScreen.orderForm.tooltips.stopLossDescription":["Places a secondary order after the primary order has been filled, typically designed to prevent further losses once a certain price has been reached. If a Stop Loss and Take Profit are both entered at the same time, they will be connected via OCO (one cancels other)."],"tradeScreen.orderForm.tooltips.stopLossTitle":["Stop Loss"],"tradeScreen.orderForm.tooltips.stopMarket":["A Market order is sent to the market if the chosen trigger condition is met. Often used to limit the losses of an existing position once a certain price level has been reached."],"tradeScreen.orderForm.tooltips.stopMarketTitle":["Stop Market"],"tradeScreen.orderForm.tooltips.takeLimit":["Take Limit"],"tradeScreen.orderForm.tooltips.takeLimitOrder":["A Limit order is sent to the market if the chosen trigger condition is met. Often used to take profit on an existing position once a certain price level has been reached."],"tradeScreen.orderForm.tooltips.takeMarket":["Take Market"],"tradeScreen.orderForm.tooltips.takeMarketOrder":["A Market order is sent to the market if the chosen trigger condition is met. Often used to take profit on an existing position once a certain price level has been reached."],"tradeScreen.orderForm.tooltips.takeProfitDescription":["Places a secondary order after the primary order has been filled, typically designed to close a position in profit once a certain price is reached. If a Stop Loss and Take Profit are both entered at the same time, they will be connected via OCO (one cancels other)."],"tradeScreen.orderForm.tooltips.takeProfitTitle":["Take Profit"],"tradeScreen.orderForm.tooltips.trailingStop":["Works similar to a Stop Market order, except the Trigger Price is automatically updated to never be any further away from the current price than the Offset Price chosen for the Trailing Stop. The price used as the current price can be the mark, index, or last price."],"tradeScreen.orderForm.tooltips.trailingStopTitle":["Trailing Stop"],"tradeScreen.orderForm.tooltips.trailingTake":["Trailing Take"],"tradeScreen.orderForm.tooltips.trailingTakeOrder":["To close a position only: a market order is sent to the market if triggered by the price."],"tradeScreen.orderForm.tooltips.triggerIndexPrice":["Index Price"],"tradeScreen.orderForm.tooltips.triggerLastPrice":["Last Price"],"tradeScreen.orderForm.tooltips.triggerMarkPrice":["Mark Price"],"tradeScreen.orderForm.triggerOffsetInputLabel":["Trigger Offset"],"tradeScreen.orderForm.triggerPriceInputLabel":["Trigger Price"],"tradeScreen.orderHistory.cancelReason":["Cancel Reason"],"tradeScreen.orderHistory.cancelReason.admin":["Admin cancel"],"tradeScreen.orderHistory.cancelReason.autoliquidation":["autoliquidation"],"tradeScreen.orderHistory.cancelReason.brokerCancel":["Canceled"],"tradeScreen.orderHistory.cancelReason.cancelOnDisconnect":["cancel on disconnect"],"tradeScreen.orderHistory.cancelReason.configChange":["config change"],"tradeScreen.orderHistory.cancelReason.editPostOnlyReject":["edit post-only reject"],"tradeScreen.orderHistory.cancelReason.highBidLimit":["Price limit exceeded"],"tradeScreen.orderHistory.cancelReason.insufficientFunds":["Insufficient funds"],"tradeScreen.orderHistory.cancelReason.insufficientLiquidity":["Insufficient liquidity"],"tradeScreen.orderHistory.cancelReason.mmpConfigCurtailment":["MMP config curtailment"],"tradeScreen.orderHistory.cancelReason.mmpTrigger":["MMP trigger"],"tradeScreen.orderHistory.cancelReason.modifyOrder":["Order modified"],"tradeScreen.orderHistory.cancelReason.ocoOtherClosed":["OCO other closed"],"tradeScreen.orderHistory.cancelReason.orderOverlap":["order overlap"],"tradeScreen.orderHistory.cancelReason.orderOverlapAn
2103otherSub":["order overlap (another sub)"],"tradeScreen.orderHistory.cancelReason.otoPrimaryClosed":["OTO primary closed"],"tradeScreen.orderHistory.cancelReason.pmeAccountLocked":["PME account locked"],"tradeScreen.orderHistory.cancelReason.pmeRiskReduction":["PME risk reduction"],"tradeScreen.orderHistory.cancelReason.positionLocked":["position locked"],"tradeScreen.orderHistory.cancelReason.priceBound":["Price outside of range"],"tradeScreen.orderHistory.cancelReason.riskMitigation":["risk mitigation"],"tradeScreen.orderHistory.cancelReason.riskProcessorTransfer":["risk processor transfer"],"tradeScreen.orderHistory.cancelReason.selfTradePrevention":["Self-trade"],"tradeScreen.orderHistory.cancelReason.settlement":["settlement"],"tradeScreen.orderHistory.cancelReason.timeInForce":["Time in force"],"tradeScreen.orderHistory.cancelReason.user":["You canceled"],"tradeScreen.orderHistory.cancelReason.userRequest":["user request"],"tradeScreen.ordersHistory.componentSettings.includeCancelledAndFullyUnfilled":["Include cancelled and fully unfilled"],"tradeScreen.ordersHistory.tradesListTitle":["Trades List (Order ID: ",["0"],")"],"tradeScreen.phoneBrokers.brokenLink":["This link appears to be broken. Please ask your broker for a new one and try again."],"tradeScreen.phoneBrokers.failedToHandleInvitation":["Could not process your selection. Please try again later."],"tradeScreen.phoneBrokers.invitationAccepted":["You have accepted the invitation from ",["0"]],"tradeScreen.phoneBrokers.invitationRejected":["You have rejected the invitation from ",["0"]],"tradeScreen.positionsAll.close":["Close"],"tradeScreen.positionsAll.confirmation.createBuyOrder":["Create a buy order"],"tradeScreen.positionsAll.confirmation.createSellOrder":["Create a sell order"],"tradeScreen.positionsAll.markPrice":["Mark Price"],"tradeScreen.positionsAll.market":["Market"],"tradeScreen.positionsAll.moveToSubaccount":["Move to subaccount"],"tradeScreen.positionsAll.sessionRPL.tooltip.header":["RSPL"],"tradeScreen.positionsAll.sessionRPL.tooltip.value":["Realized Funding in current session: ",["tooltipValue"]," ",["currency"]," included in session RPL"],"tradeScreen.positionsAll.sessionUPL.tooltip":["USPL"],"tradeScreen.positionsAll.sharePosition":["Share"],"tradeScreen.positionsAll.sharePositionDialog.download":["Download image"],"tradeScreen.positionsAll.sharePositionDialog.joinAffiliate":["Join our <0>Affiliate Program</0> and earn a share of the trading fees paid by your referrals."],"tradeScreen.positionsAll.sharePositionDialog.showPnlIn":["Show PNL in"],"tradeScreen.positionsAll.sharePositionDialog.subtitle":["Share your trading results for insights or feedback."],"tradeScreen.positionsAll.sharePositionDialog.title":["Share your Trade"],"tradeScreen.positionsAll.sharePositionImage.entryPrice":["Entry Price"],"tradeScreen.positionsAll.sharePositionImage.footer.affiliate.subtitle":["Get a 10% discount on trading fees."],"tradeScreen.positionsAll.sharePositionImage.footer.creationDate":["Created on: ",["date"]],"tradeScreen.positionsAll.sharePositionImage.footer.subtitle":["Crypto options and futures trading."],"tradeScreen.positionsAll.sharePositionImage.footer.title":["Join Deribit"],"tradeScreen.positionsAll.sharePositionImage.referralCode":["Referral Code"],"tradeScreen.priceLadder.asks":["Asks"],"tradeScreen.priceLadder.asks.tooltip":["Left click: add sell order"],"tradeScreen.priceLadder.bids":["Bids"],"tradeScreen.priceLadder.bids.tooltip":["Left click: add buy order"],"tradeScreen.priceLadder.buys":["Buys"],"tradeScreen.priceLadder.buys.tooltip":["Left click: cancel order<0/>Right click: cancel all orders on price level<1/>Left drag: change price level last order<2/>Right drag: change price level all orders"],"tradeScreen.priceLadder.cancelOrders.all":["Cancel All"],"tradeScreen.priceLadder.cancelOrders.buys":["Cancel Buys"],"tradeScreen.priceLadder.cancelOrders.sells":["Cancel Sells"],"tradeScreen.priceLadder.centerAll":["All"],"tradeScreen.priceLadder.centerAllLadders.tooltip":["Center all markets"],"tradeScreen.priceLadder.centerLadder.locked.tooltip":["Center market (locked)"],"tradeScreen.priceLadder.centerLadder.unlocked.tooltip":["Center market"],"tradeScreen.priceLadder.changePresets":["Change Presets"],"tradeScreen.priceLadder.confirmPresetChanges":["Confirm Changes"],"tradeScreen.priceLadder.defaultAmount":["Default Amount"],"tradeScreen.priceLadder.defaultAmount.helperText":["Enter the value that will serve as the default amount."],"tradeScreen.priceLadder.editPresets":["Edit Presets"],"tradeScreen.priceLadder.lockToCenter.lock.tooltip":["Lock market at center"],"tradeScreen.priceLadder.lockToCenter.unlock.tooltip":["Unlock market at center"],"tradeScreen.priceLadder.overlay.selectNewInstrument":["Select another instrument"],"tradeScreen.priceLadder.overlay.unavailableInstrument":["The selected instrument is unavailable."],"tradeScreen.priceLadder.overlay.warning.message":["By clicking <0>\\"Confirm\\"</0> you acknowledge that you are an experienced trader and possess a deep understanding of the Price Lad
2103der's mechanics."],"tradeScreen.priceLadder.overlay.warning.subtitle":["Want to learn more? Check out our <0>comprehensive guide</0> to explore the Price Ladder's features and advanced strategies!"],"tradeScreen.priceLadder.overlay.warning.title":["Price Ladder Proficiency Confirmation"],"tradeScreen.priceLadder.position":["Pos"],"tradeScreen.priceLadder.resetAmount":["Reset"],"tradeScreen.priceLadder.resetPresetsForm":["Reset"],"tradeScreen.priceLadder.sells":["Sells"],"tradeScreen.priceLadder.sells.tooltip":["Left click: cancel order<0/>Right click: cancel all orders on price level<1/>Left drag: change price level last order<2/>Right drag: change price level all orders"],"tradeScreen.putCallRatio.openInterest":["Open Interest"],"tradeScreen.putCallRatio.unableToFetch":["Unable to fetch data"],"tradeScreen.putCallRatio.volume":["Volume"],"tradeScreen.selectTakers":["Select Takers"],"tradeScreen.settingsMenu.addCustomPageModal.currencyField.label":["Page currency"],"tradeScreen.settingsMenu.addCustomPageModal.currencyFiled.error.required":["Please select a currency"],"tradeScreen.settingsMenu.addCustomPageModal.currentPageLayout":["Copy current page layout"],"tradeScreen.settingsMenu.addCustomPageModal.emptyPage":["Blank page"],"tradeScreen.settingsMenu.addCustomPageModal.instrumentField.label":["Page instrument"],"tradeScreen.settingsMenu.addCustomPageModal.instrumentFiled.error.required":["Please select an instrument"],"tradeScreen.settingsMenu.addCustomPageModal.layoutField.label":["Page layout"],"tradeScreen.settingsMenu.addCustomPageModal.nameField.error.pageExists":["A tab by this name already exists."],"tradeScreen.settingsMenu.addCustomPageModal.nameField.error.required":["Tab name is required"],"tradeScreen.settingsMenu.addCustomPageModal.nameField.label":["Tab name"],"tradeScreen.settingsMenu.addCustomPageModal.save":["Save"],"tradeScreen.settingsMenu.addCustomPageModal.title":["Add custom tab"],"tradeScreen.settingsMenu.copyCustomPageModal.title":["Duplicate tab \\"",["name"],"\\""],"tradeScreen.settingsMenu.moveWidgetTooltip":["Move widget"],"tradeScreen.settingsMenu.restoreLayout":["Restore Layout"],"tradeScreen.settingsMenu.settings":["Settings"],"tradeScreen.settingsMenu.widgets":["Widgets"],"tradeScreen.stopOrdersAll.action":["Action"],"tradeScreen.stopOrdersAll.lastUpdate":["Last Update"],"tradeScreen.tableHeader.amount.tooltip":["The traded amount. Depending on the type of instrument, this may be the amount of contracts, or the amount of a specific currency. If it is a specific currency, the currency symbol will be shown."],"tradeScreen.tableHeader.availableBalance.tooltip":["This is the amount of your margin balance that is still not reserved by the initial margin. Available Balance = Margin Balance - Initial Margin (for SM users)."],"tradeScreen.tableHeader.availableBalancePM.tooltip":["This is the amount of your equity that is still not reserved by your initial margin. Available Balance = Equity - Initial Margin (for PM users)."],"tradeScreen.tableHeader.avgPrice.tooltip":["The average transacted price for your open position."],"tradeScreen.tableHeader.avgPriceUsd.tooltip":["The average transacted price for your open position in USD."],"tradeScreen.tableHeader.cashBalance.tooltip":["Sum of all money transfers (internal and on blockchain), paid/received option premiums, results of incremental settlements and deliveries, corrections, and insurance refills. At the daily settlement, session profits/losses will be booked to the cash balance."],"tradeScreen.tableHeader.close.tooltip":["By clicking \\"Close\\" and then selecting a price, you will send a limit reduce order at that price. By clicking \\"Market\\", you will send a market reduce order. This feature is only available for futures."],"tradeScreen.tableHeader.closeOutMarginProjected.tooltip":["The close-out margin required before the Liquidity Support Program liquidates positions outside the order book. A close out margin of 100% or more means that your account enters the Liquidity Support Program stage. Eligible positions will be transferred, outside of the order book, to the LSP providers in order to bring the CoM level below 100%"],"tradeScreen.tableHeader.delta.tooltip":["Delta is a risk measure and gives the change in USD price as the underlying changes. NTD gives the change in BTC price as the underlying changes."],"tradeScreen.tableHeader.deltaTotalProjected.header1":["Delta Total (BTC and ETH)"],"tradeScreen.tableHeader.deltaTotalProjected.header2":["Delta Total (USDC)"],"tradeScreen.tableHeader.deltaTotalProjected.paragraph1":["The sum of Mark Price adjusted delta. In brackets is the Delta Total after the next expiration."],"tradeScreen.tableHeader.deltaTotalProjected.paragraph2":["Delta Total = Mark Price Adjusted Delta of options + BTC/ETH Value of Futures Positions"],"tradeScreen.tableHeader.deltaTotalProjected.paragraph3":["Mark Price Adjusted Delta = Black Scholes Delta - Mark Price of Options in BTC/ETH"],"tradeScreen.tableHeader.deltaTotalProjected.paragraph4":["Delta Total = Options Delta + USDC Value of Futures Positions"],"tradeScreen.tableHeader.deltaTotalProjected.paragraph5":["Options Delta = Sum of Delta * Index Price"],"tradeScreen.tableHeader.deltaTotalProjected.paragraph6":["These formulas for USDC Delta Total allow for the addition of the deltas from different currency pairs that use USDC as collateral."],"tradeScreen.tableHeader.displayAmount.tooltip":["The amount of the order displayed in the order book."],"tradeScreen.tableHeader.dollarPremium.tooltip":["The premium in terms of dollar value of the Future over the Index price."],"tradeScreen.tableHeader.equity.tooltip":["Total value of all assets in your account."],"tradeScreen.tableHeader.equity.tooltipExternal":["In brackets, you see Equity - External Equity."],"tradeScreen.tableHeader.equity.tooltipImplied":["In brackets, you see Equity - Implied Equity."],"tradeScreen.tableHeader.equity.tooltipImpliedAndExternal":["In brackets, you see Equity - Implied and External Equity."],"tradeScreen.tableHeader.estLiqPrice.tooltip":["The estimated mark price at which your position will be incrementally liquidated. The calculation does not take into account options positions. If you have short options positions, the effective liquidation price will be different."],"tradeScreen.tableHeader.fee.tooltip":["The fee is calculated as a percentage of the underlying asset of the contract. For more, please read the Deribit Knowledge Base. "],"tradeScreen.tableHeader.feeBalance.tooltip":["The amount left for paying trading fees received via coupons."],"tradeScreen.tableHeader.funding.tooltip":["The current realtime rate based on 8h periods. This only applies for Perpetual instruments."],"tradeScreen.tableHeader.gamma.tooltip":["Gamma is a risk measure and gives the change in delta as the underlying changes."],"tradeScreen.tableHeader.gammaPnl.tooltip":["The estimated PNL from Gamma on a 1% underlying move."],"tradeScreen.tableHeader.gammaPnlCalculation.tooltip":["0.5 * Gamma * (1% * IndexPrice)^2 * (if USDC/USDT, then USDC-USD/USDT-USD Index, else 1)"],"tradeScreen.tableHeader.initialMargin.tooltip":["The margin reserved for your open positions and open orders. If your margin balance falls below the initial margin requirements, open orders that would increase your position get cancelled and you are only able to place orders that reduce your position."],"tradeScreen.tableHeader.initialMarginProjected.tooltip":["The amount of margin reserved for your open positions and open orders. In brackets, you see your projected initial margin which w
2103ould be your estimated initial margin after the next expiration."],"tradeScreen.tableHeader.maintenanceMargin.tooltip":["The margin required to maintain your current positions. If your margin balance falls below the maintenance margin requirements, your position will get incrementally liquidated until the maintenance margin is lower than your margin balance."],"tradeScreen.tableHeader.maintenanceMarginProjected.tooltip":["The margin required to maintain your current positions. If your Margin Balance falls below this, then your account would incrementally liquidate until the Maintenance Margin goes below your Margin Balance. In brackets, you see your projected maintenance margin which would be your estimated maintenance margin after the next expiration."],"tradeScreen.tableHeader.maintenanceMarginProjectedPortfolioMargin.tooltip":["The margin required to maintain your current positions. If your Equity falls below this, then your account would incrementally liquidate until the Maintenance Margin goes below your Equity. In brackets, you see your projected maintenance margin which would be your estimated maintenance margin after the next expiration."],"tradeScreen.tableHeader.marginBalance.tooltip":["This is the amount of equity subtracting the value of the options. Mainly useful for SM users since your Initial Margin and Maintenance Margin are compared to this."],"tradeScreen.tableHeader.marginBuffer.tooltip":["The Margin Buffer is applied to  Margin Balance to additionally maintain your current positions. If it is fully used, then autoliquidation would be enabled until the Maintenance Margin goes below your Margin Balance + Margin Buffer."],"tradeScreen.tableHeader.markPrice.tooltip":["The price used for PNL and margin calculations, it can differ from the last price traded to avoid price manipulation."],"tradeScreen.tableHeader.netDelta.tooltip":["The Net Delta adjusts the Black-Scholes Delta of inverse options to take account of the mark price of the option."],"tradeScreen.tableHeader.netDeltaCalculation.tooltip":["Net Delta = Black-Scholes Delta - Mark Price"],"tradeScreen.tableHeader.openOrderAmount.tooltip":["Depending on the type of instrument, this may be the amount of contracts or the amount of a specific currency. If it is a specific currency, the currency symbol will be shown."],"tradeScreen.tableHeader.orderAmount.tooltip":["The order amount. Depending on the type of instrument, this may be the amount of contracts, or the amount of a specific currency. If it is a specific currency, the currency symbol will be shown."],"tradeScreen.tableHeader.orderBaseAmount.tooltip":["The order amount expressed in base currency."],"tradeScreen.tableHeader.orderPrice.tooltip":["The submitted price."],"tradeScreen.tableHeader.percentPremium.tooltip":["The premium in terms of percentage value of the Future over the Index price."],"tradeScreen.tableHeader.percentPremiumFutureSpread.tooltip":["The premium in terms of percentage value of the Future Spread mid price over the nearest term dated future mark price. Perpetual is treated as time to expiry = 0 for this purpose."],"tradeScreen.tableHeader.pnl.tooltip":["PNL for open positions since the time they were opened."],"tradeScreen.tableHeader.pnlUsd.tooltip":["PNL in USD for open positions since the time they were opened"],"tradeScreen.tableHeader.positionAmount.tooltip":["The total amount of the position. Depending on the type of instrument, this may be the amount of contracts or the amount of a specific currency. If it is a specific currency, the currency symbol will be shown."],"tradeScreen.tableHeader.positionBaseAmount.tooltip":["The total amount of the position expressed in base currency."],"tradeScreen.tableHeader.premiumAnnualized.tooltip":["The APR shown is provided for informational purposes, similar to an interest rate. For expiring futures, it is the annualized premium of the Future over the Index price, calculated as: % (mid Future price / Index price − 1) × 525,600 / minutes until expiration. For perpetual contracts, it is the annualized funding rate derived from the current funding payments over the last 8 hours."],"tradeScreen.tableHeader.remaining.tooltip":["The total size remaining (that is currently open) of the order."],"tradeScreen.tableHeader.rho.tooltip":["Rho is a risk measure and gives the change in option price as the interest rate changes."],"tradeScreen.tableHeader.roi.tooltip":["Futures ROI = (PNL / Initial Margin) * 100; Options ROI = ((Mark Price - Average Price) / Average Price) * 100"],"tradeScreen.tableHeader.sessionRPL.tooltip":["The profits and losses that have been realized since the last settlement by closing a futures position. Futures Session Realized Profits & Losses is included in your account equity and can be used as a trading margin, but is only available for withdrawal after settlement. At settlement, futures RSPL will be transferred to your cash balance and reset to 0."],"tradeScreen.tableHeader.sessionUPL.tooltip":["The profits and losses from open positions since the last settlement. USPL is included in your account equity and can be used as a trading margin, but is not available for withdrawal. At settlement, futures USPL will be transferred to your cash balance and reset to 0."],"tradeScreen.tableHeader.sizeCrypto.tooltip":["The size of the position in the coin it is settled in."],"tradeScreen.tableHeader.tenor.tooltip":["The time until the Future reaches maturity"],"tradeScreen.tableHeader.theta.tooltip":["Theta is a risk measure and gives the change in option price as 1 day passes."],"tradeScreen.tableHeader.tif.tooltip":["Time In Force of the order. (GTC = Good 'Til Cancel, GTD = Good 'Til Next Settlement, FOK = Fill Or Kill, IOC = Immediate Or Cancel)."],"tradeScreen.tableHeader.totalPNL.tooltip":["Profits and losses from your open positions. Futures ROI = (PNL / Initial Margin) * 100; Options ROI = (Mark Price - Average Price) / Average Price * 100"],"tradeScreen.tableHeader.tradeBaseAmount.tooltip":["The traded amount expressed in base currency."],"tradeScreen.tableHeader.usdDelta.tooltip":["The Delta multiplied by the index and if in USDC or USDT, converted to USD."],"tradeScreen.tableHeader.usdNetDelta.tooltip":["The Net Delta multiplied by the index and if in USDC or USDT, converted to USD."],"tradeScreen.tableHeader.vega.tooltip":["Vega is a risk measure and gives the USD change in the option price as for a 1% change in volatility."],"tradeScreen.tradesHistory.underlyingPrice":["Und. Mark"],"tradeScreen.tradesList.noDataOverlay":["This order was not a side of any trade"],"tradeScreen.tradesList.noDataOverlay.noHistory":["Trades older than 7 days are not being displayed."],"tradeScreen.tradingDialog.GreeksTable":["Greeks"],"tradeScreen.tradingDialog.instrumentExpiredDialog.description":["Delivery price: ",["deliveryPrice"]],"tradeScreen.tradingDialog.instrumentExpiredDialog.title":[["instrumentName"]," has expired"],"tradeScreen.tradingDialog.instrumentInactiveDialog.description":["This instrument was deactivated and is no longer available"],"tradeScreen.tradingDialog.instrumentInactiveDialog.title":["Instrument has been deactivated"],"tradeScreen.unsupportedCurrency":["Unsupported currency"],"tradeScreen.unsupportedInstrument":["Unsupported instrument"],"tradeScreen.userMenu.adminPanel":["Admin Panel"],"tradeScreen.userMenu.login":["Log In"],"tradeScreen.userMenu.logout":["Log Out"],"tradeScreen.volatilitySurface.deltas":["Deltas"],"tradeScreen.volatilitySurface.error":["Error creating volatility surface"],"tradeScreen.volatilitySurface.expiration":["Expiration"],"tradeScreen.volatilitySurface.expirations":["Expirations"],"tradeScreen.volatilitySurface.smile":["Smile"],"tradeScreen.volatilitySurface.volatility":["Volatility"],"transactionLog.tableHeader.cashFlow.tooltip":["For futures and perpetual contracts: Realized session PNL (since last settlement). For options: the amount paid or received for the options traded."],"transactionLog.tableHeader.change.tooltip":["Change in cash balance. For trades: fees and options premium paid/received. For settlement: Futures session PNL and perpetual session funding."],"transactionLog.tableHeader.feeCharged.tooltip":["Fees paid or received, including any extra fees (shown in brackets)."],"transactionLog.tableHeader.funding.tooltip":["Funding paid or received between trades in the perpetual contract, or between last trade before settlement and settlement (between brackets). All funding of the last 24h is settled to cash balance at daily settlement."],"verification.errorMessage.1":["There is a technical issue. Please try again later."],"verification.errorMessage.102":["Please prepare a full-colour copy of the original document."],"verification.errorMessage.104":["Please upload a copy of the original document."],"verification.errorMessage.109":["Verification failed because the document is punched. Please prepare a clean copy of the original document and try again. "],"verification.errorMessage.11":["Selfie failed. Please try again."],"verification.errorMessage.11050":["The combination of your nationality and country of residence is not permitted. For more information, please refer to: https://www.deribit.com/kb/deribit-restr
2103icted-countries."],"verification.errorMessage.1111":["Verification failed because the ID has expired. Please use a valid ID."],"verification.errorMessage.116":["Verification failed because text in document is superimposed. Please try again with a clean copy."],"verification.errorMessage.118":["Verification failed because different IDs were used. Please use the same document for front and back."],"verification.errorMessage.12":["Age difference between document photo and selfie is too big. Please use more recent ID."],"verification.errorMessage.13":["Liveness check (face recognition) failed. Please try again and make sure your entire face is visible."],"verification.errorMessage.15":["Liveness check (face recognition) failed. Please try again."],"verification.errorMessage.16":["Selfie failed because it is in black and white. Please make a selfie in colour."],"verification.errorMessage.19":["Thank you for uploading the document. We will verify the proof of residence and get back to you if needed. In the meantime, you can start trading."],"verification.errorMessage.2":["ID type not supported. Please use another document."],"verification.errorMessage.20":["Document is too old. Please choose newer document and try again."],"verification.errorMessage.200":["Document is not readable. Please use an image with better quality."],"verification.errorMessage.2001":["Verification failed because the document is blurred. Please try again."],"verification.errorMessage.2002":["Verification failed because the quality of the document is bad. Please try again."],"verification.errorMessage.2003":["Verification failed because part of the document is not visible. Please try again with the complete document."],"verification.errorMessage.2005":["Verification failed because the document is damaged. Please use a different document."],"verification.errorMessage.2006":["Verification failed because the document is not readable due to glare. Please try again."],"verification.errorMessage.2007":["Verification failed because document is not readable or incomplete. Please use a clear and complete document and try again."],"verification.errorMessage.201":["Verification failed. Please provide your ID and perform liveness check (face recognition)."],"verification.errorMessage.202":["Verification failed. Please use a copy of your original ID."],"verification.errorMessage.204":["Verification failed because front side of ID is missing. Please try again."],"verification.errorMessage.206":["Verification failed because backside of ID is missing. Please try again."],"verification.errorMessage.207":["Verification failed because the wrong page of the ID was used. Please try again."],"verification.errorMessage.209":["Verification failed because the signature in the ID is missing."],"verification.errorMessage.21":["The person in the selfie is not the same as the person from the ID."],"verification.errorMessage.210":["Verification failed because a black-and-white camera was used. Please use a full-colour camera and try again."],"verification.errorMessage.211":["Verification failed because different persons were shown. Please try again."],"verification.errorMessage.213":["Verification failed because the watermark is invalid. Please try again."],"verification.errorMessage.2222":["We cannot verify the expiration date of the ID. Please use another document."],"verification.errorMessage.300":["Verification cancelled."],"verification.errorMessage.4":["No ID has been uploaded."],"verification.errorMessage.5":["Verification failed. Please try again."],"verification.errorMessage.6":["Verification process cancelled."],"verification.errorMessage.7":["Selfie failed. Please use the camera and try again."],"verification.errorMessage.9":["Multiple people detected in selfie. Please make sure only one person is in the selfie."],"verification.errorMessage.9002":["The ID has expired or is about to expire. Please complete the ID verification with a new, valid ID."],"verification.errorMessage.9004":["We do not accept this type of ID. Please use your valid residence permit to complete the ID verification."],"verification.errorMessage.defaultText":["Verification failed. Please try again."],"verification.errorMessage.defaultText2":["If you are still experiencing issues, please contact [email protected]."],"verification.idVerification.state.success":["You have successfuly completed the ID verification"],"verification.message.rejected":["Your proof of residence has been rejected. Please check your email or contact ",["complianceMailLink"]," for more details of the rejection."],"verification.message.success":["Verification successful"],"verification.message.uploadSuccessful":["Upload successful. We will verify the proof of residence soon."]}`);R.load(`en`,fN),R.activate(`en`);async function dynamicActivate(e){let{messages:t}=await ra(Object.assign({
2103"../../../locale/en/messages.ts":()=>Ar(()=>Promise.resolve().then(()=>dN),void 0),
2103"../../../locale/es/messages.ts":()=>Ar(()=>import(`./messages-Df-kqZYX.js`),[]),
2103"../../../locale/hi/messages.ts":()=>Ar(()=>import(`./messages-Dfq87X0M.js`),[]),
2103"../../../locale/id/messages.ts":()=>Ar(()=>import(`./messages-Bllr5bW3.js`),[]),
2103"../../../locale/ko/messages.ts":()=>Ar(()=>import(`./messages-XqIRGSAN.js`),[]),
2103"../../../locale/pt/messages.ts":()=>Ar(()=>import(`./messages-DMDLL5r3.js`),[]),
2103"../../../locale/ru/messages.ts":()=>Ar(()=>import(`./messages-i8xThmn1.js`),[]),
2103"../../../locale/uk/messages.ts":()=>Ar(()=>import(`./messages-B1VaenOX.js`),[]),
2103"../../../locale/vi/messages.ts":()=>Ar(()=>import(`./messages-jDtcQc1U.js`),[]),
2103"../../../locale/zh_HANS/messages.ts":()=>Ar(()=>import(`./messages-CnVQGsMq.js`),[]),
2103"../../../locale/zh_HANT/messages.ts":()=>Ar(()=>import(`./messages-DdaceDyk.js`),[])
2103}),`../../../locale/${e}/messages.ts`,6);R.load(e,t),R.activate(e)}function useInitLanguage(){let e=B(ia);(0,$.useEffect)(()=>{let t=Op();dynamicActivate(Dp(e,t)?t:`en`)},[e])}var pN=[`cancelled`,`triggered`,`filled`],handleOrdersCancelledNotification=e=>{e.length===1?Y.notify({type:Td.ORDER_CANCELLED,order:e[0]}):e.length>1&&Y.notify({type:Td.ORDERS_CANCELLED,ordersNum:e.length,ordersType:e[0].order_type,ordersInstrument:e[0].instrument_name})},handleOrdersReplacedNotification=(e,t)=>{if(e.length)for(let n of e)if(Gr(n)){let{order_id:e,amount:r,price:i,trigger_price:o}=n,s=t[e];s&&(s.amount!==r||s.price!==i||s.trigger_price!==o)&&Y.notify({type:Td.ORDER,order:n})}else{let{order_id:e,amount:r,price:i,filled_amount:o,auto_replaced:s,usd:c,implv:p}=n,m=t[e];m&&!s&&(m.amount===r?(m.price!==i||m.usd!==c||m.implv!==p)&&Y.notify({type:Td.ORDER,order:n}):r===o?Y.notify({type:Td.ORDER_CANCELLED,order:n,fullyFilled:!0}):Y.notify({type:Td.ORDER,order:n}))}},handleOrdersSubmittedNotification=e=>{e.length&&e.forEach(e=>{Y.notify({type:Td.ORDER,order:e})})},handleOrdersNotification=(e,t,n)=>{let r=[],i=[],o=[];e.forEach(e=>{let{order_state:t,replaced:s,web:c,creation_timestamp:p,last_update_timestamp:m}=e,h=op(t);(!n||c)&&(h===`cancelled`?r.push(e):s?i.push(e):h!==`filled`&&h!==`triggered`&&h!==`rejected`&&p===m&&o.push(e))}),handleOrdersCancelledNotification(r),handleOrdersReplacedNotification(i,t),handleOrdersSubmittedNotification(o)},useTradingNotification=()=>{let e=Ti(),t=B(ji),{interfaceSettings:n}=td(),r=n.suppressNotificationsWhenApiOrders,i=n.suppressNotificationsWhenApiTrades,o=n.disableSounds,s=(0,$.useRef)({}),c=Zd();return(0,$.useEffect)(()=>{let getOpenOrders=async()=>{if(t){let t=await e.getOpenOrders();s.current=t.reduce((e,t)=>(e[t.order_id]=t,e),{})}};return getOpenOrders(),()=>{s.current={}}},[t,e]),(0,$.useEffect)(()=>{let userChangesHandler=({data:e})=>{let{orders:t,trades:n}=e;if(t.length&&handleOrdersNotification(t,s.current,r),t.forEach(e=>{s.current[e.order_id]=e}),n.length){let{web:e,block_trade:t}=s.current[n[0].order_id];(!i||e||t)&&(o||c(Vu.orderExecuted),n.forEach(e=>{Y.notify({type:Td.TRADES,trade:e})}))}t.forEach(e=>{pN.some(t=>op(e.order_state)===t)&&delete s.current[e.order_id]})};return t&&e.subscribe(`user.changes.any.any.100ms`,userChangesHandler,{suppressFirstCache:!0}),()=>{t&&e.unsubscribe(`user.changes.any.any.100ms`,userChangesHandler)}},[t,r,i,o,e,c]),null},useSynchronizeUserSettings=()=>{let e=Ti(),t=Pn(),n=B(Bi),r=(0,$.useRef)(!1);(0,$.useEffect)(()=>{let onKvChange=()=>{r.current=!0},t=`user.kv_changes`;if(n)return e.subscribe(t,onKvChange),()=>{e.unsubscribe(t,onKvChange)}},[e,n]),(0,$.useEffect)(()=>{let focusListener=async()=>{!r.current||document.hidden||(r.current=!1,await t(Bu.fetchUserSettings({omitSettings:[`componentsSettings`,`agGridState`,`layoutComponentsState`,`dashboard`]})))};return window.addEventListener(`focus`,focusListener),document.addEventListener(`visibilitychange`,focusListener),()=>{window.removeEventListener(`focus`,focusListener),document.removeEventListener(`visibilitychange`,focusListener)}},[t])};BS.default.extend(VS.default),BS.default.extend(sN.default),BS.default.extend(oN.default),BS.default.extend(cN.default),BS.default.extend(lN.default),BS.default.extend(uN.default);function Initializer(){return useInitLanguage(),useTradingNotification(),useSynchronizeUserSettings(),null}Hn();var mN=ld(`div`)({display:`flex`,flexDirection:`column`,minHeight:`100vh`,backgroundColor:`#000`,color:`#fff`}),hN=ld(`div`)({display:`flex`,flexWrap:`wrap`,justifyContent:`center`,alignItems:`center`,paddingTop:`35px`}),gN=ld(`div`)({display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,flexGrow:1,padding:`0px 20px 0px 20px`}),_N=ld(`div`)({display:`flex`,margin:`0px 40px 0px 40px`,padding:`22px 0px 22px 0px`,borderTop:`1px solid #fff`,justifyContent:`space-between`}),vN=ld(`ul`)(()=>({display:`flex`,justifyContent:`center`,padding:`0px`,margin:`0px`,flexWrap:`wrap`,flexDirection:`row`,listStyleType:`none`,"& li > a":{marginLeft:`20px`,padding:`0px`}})),yN={zh_HANS:`zh-CN`,zh_HANT:`zh-TW`},bN={};for(let e of pf){let t=yN[e.code]||e.code;bN[t]=e.name}var CrashPage=()=>{let e=[`translated-ltr`,`translated-rtl`].some(e=>document.documentElement.classList.contains(e)),t=bN[document.documentElement.getAttribute(`lang`)??``];
2103return(0,X.jsx)(vr,{injectFirst:!0,children:(0,X.jsx)(Et,{theme:nw,children:(0,X.jsxs)(mN,{children:[(0,X.jsx)(hN,{children:(0,X.jsx)(xn,{width:128,height:void 0,className:`dark`})}),(0,X.jsxs)(gN,{children:[(0,X.jsx)(PC,{style:{fontSize:`150px`}}),(0,X.jsx)(L,{variant:`h4`,paddingBottom:`24px`,children:`Ooops, something went wrong...`}),(0,X.jsx)(L,{variant:`h6`,paddingBottom:e?`24px`:`44px`,children:`Sorry for the inconvenience. Please refresh the page or contact support.`}),e&&(0,X.jsxs)(L,{variant:`body1`,paddingBottom:`44px`,children:[`Google Translate can cause errors loading some pages. Please try turning off auto translate features and refreshing the page.`,t&&(0,X.jsxs)(X.Fragment,{children:[` A `,t,` translation is available.`]})]}),(0,X.jsx)(Dd,{variant:`contained`,color:`primary`,target:`_blank`,rel:`noopener noreferrer`,href:`https://insights.deribit.com/contact-us/`,style:{color:`white`},children:`Contact Us`})]}),(0,X.jsxs)(_N,{children:[(0,X.jsxs)(L,{variant:`caption`,children:[`Copyright© `,new Date().getFullYear(),` Deribit. All rights reserved.`]}),(0,X.jsx)(vN,{children:tw.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsx)(`a`,{href:e[1],target:`_blank`,rel:`noopener noreferrer`,children:(0,X.jsx)(`img`,{src:e[2],alt:e[0],height:`25px`})})},`footer-list-menu-item-${e[1]}`))})]})]})})})},sensitiveParamScrubbing=(e,t)=>{let n=new URL(e.startsWith(`http`)?e:`http://example.com${e}`);for(let e of t)n.searchParams.has(e)&&n.searchParams.set(e,`[REDACTED]`);return n.toString().replace(`http://example.com`,``)},sentryFilter=e=>{let t=[`code`];e.request?.url&&(e.request.url=sensitiveParamScrubbing(e.request.url,t));let n=e.breadcrumbs||[];for(let e of n.filter(e=>e.category===`fetch`))e.data.url=sensitiveParamScrubbing(e.data.url,t);for(let e of n.filter(e=>e.category===`navigation`))e.data.from=sensitiveParamScrubbing(e.data.from,t),e.data.to=sensitiveParamScrubbing(e.data.to,t);return e},xN=Zr(),SN=`/assets/silence-W3-UJntm.mp3`;async function enableSound(){if(!xN.isSafari||xN.isMobile)return;let e=new Audio(SN);try{await e.play()}catch{let cb=async()=>{try{await e.play()}catch{}document.body.removeEventListener(`click`,cb)};document.body.addEventListener(`click`,cb)}}var isFeatureEnabled=(e,t)=>{if(!t||t.length===0)return!0;if(t.includes(e))return!1;let[n]=e.split(`.`),r=`${n}.*`;return!t.includes(r)},isRouteEnabled=(e,t)=>isFeatureEnabled(e,t),isUIFeatureEnabled=(e,t)=>isFeatureEnabled(e,t),isAuthFeatureEnabled=(e,t)=>isFeatureEnabled(e,t),isCurrencyEnabled=({currency:e,disabledCurrencies:t,enabledCurrencies:n})=>t?!t.includes(e):!n||n.includes(e),isComponentEnabled=({component:e,enabledComponents:t,disabledComponents:n})=>t?t.includes(e):!n||!n.includes(e),isInstrumentCurrencyPairEnabled=(e,t)=>{if(e===`*`)return!0;let n=Ki.splitInstrument(t);if(!n)return!1;let{currencyPair:r,base_currency:i,quote_currency:o}=n;return e.includes(r||`${i}_${o}`.toUpperCase())},isProductKindEnabled=(e,t)=>{if(e===`*`)return!0;let n=Ki.splitInstrument(t);return n?e.includes(n.kind):!1},isInstrumentEnabled=(e,t)=>isInstrumentCurrencyPairEnabled(e.currencyPairs,t)&&isProductKindEnabled(e.productKinds,t),canChangeMarginModel=e=>e===`*`||(e?.length??0)>1,CN=`/assets/deribit-logo-test-CW3x4Dp3.svg`,SvgDeribitRedirect=e=>(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 164 54`,...e,children:[(0,X.jsx)(`style`,{children:`
2104		path, rect {
2105			fill: #0052FF;
2106		}
2107	`}),(0,X.jsx)(`path`,{d:`M12.543 37.594H5.246v-7.297h7.297V15.703H5.246V8.406h7.297V1.109h7.297v7.297h7.297V1.109h7.297v7.297c8.067 0 14.594 6.527 14.594 14.594S42.5 37.594 34.434 37.594v7.297h-7.297v-7.297H19.84v7.297h-7.297v-7.297Zm7.297-7.297h14.594A7.292 7.292 0 0 0 41.73 23a7.292 7.292 0 0 0-7.297-7.297H19.84v14.594Z`}),(0,X.jsx)(`rect`,{width:8.21,height:8.21,x:148.758,y:19.84,fillOpacity:.3,rx:4.105}),(0,X.jsx)(`rect`,{width:8.21,height:8.21,x:132.338,y:19.84,fillOpacity:.5,rx:4.105}),(0,X.jsx)(`rect`,{width:8.21,height:8.21,x:115.918,y:19.84,fillOpacity:.7,rx:4.105}),(0,X.jsx)(`rect`,{width:8.21,height:8.21,x:99.498,y:19.84,fillOpacity:.8,rx:4.105}),(0,X.jsx)(`rect`,{width:8.21,height:8.21,x:83.078,y:19.84,fillOpacity:.9,rx:4.105}),(0,X.jsx)(`rect`,{width:8.21,height:8.21,x:66.658,y:19.84,rx:4.105})]}),wN=`/assets/deribit_logo_pdf_reports-BnL_AFF3.png`,TN=`/assets/deribit-logo-prod-dark-BdVmRj06.svg`,SvgCoinbaseLogo=e=>(0,X.jsxs)(`svg`,{width:109,height:19,viewBox:`0 0 109 19`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,X.jsx)(`g`,{clipPath:`url(#clip0_1_75)`,children:(0,X.jsx)(`path`,{d:`M21.9991 5.30444C18.0394 5.30444 14.9454 8.23761 14.9454 12.1643C14.9454 16.091 17.9612 18.999 21.9991 18.999C26.037 18.999 29.1052 16.0408 29.1052 12.1392C29.1052 8.26272 26.0894 5.30444 21.9991 5.30444ZM22.0258 16.1692C19.7709 16.1692 18.1185 14.4602 18.1185 12.1653C18.1185 9.8442 19.7442 8.13624 21.9991 8.13624C24.2807 8.13624 25.9321 9.87027 25.9321 12.1653C25.9321 14.4602 24.2807 16.1692 22.0258 16.1692ZM29.97 8.28879H31.9369V18.7451H35.0833V5.55933H29.97V8.28879ZM7.02696 8.13527C8.67931 8.13527 9.99031 9.12973 10.488 10.6089H13.8184C13.2149 7.44687 10.5404 5.30444 7.05367 5.30444C3.09396 5.30444 0 8.23761 0 12.1653C0 16.0929 3.01579 19 7.05367 19C10.4623 19 13.1892 16.8576 13.7927 13.6695H10.488C10.016 15.1486 8.70504 16.1692 7.05268 16.1692C4.77105 16.1692 3.17213 14.4602 3.17213 12.1653C3.17311 9.8442 4.74631 8.13527 7.02696 8.13527ZM89.7535 10.8898L87.4462 10.5587C86.3449 10.4061 85.5583 10.0489 85.5583 9.20697C85.5583 8.28879 86.5814 7.83017 87.9706 7.83017C89.4913 7.83017 90.462 8.4674 90.6717 9.51303H93.7132C93.3719 6.86082 91.2743 5.3054 88.0497 5.3054C84.7193 5.3054 82.5168 6.96316 82.5168 9.30931C82.5168 11.5531 83.9594 12.8546 86.8693 13.2621L89.1767 13.5932C90.3046 13.7458 90.9339 14.1802 90.9339 14.9961C90.9339 16.0417 89.8327 16.4752 88.3119 16.4752C86.4498 16.4752 85.401 15.7357 85.2437 14.6138H82.1497C82.4386 17.1897 84.5095 19 88.2852 19C91.7205 19 94.0012 17.4697 94.0012 14.8426C94.0012 12.4964 92.3498 11.2722 89.7535 10.8898ZM33.5101 0.127446C32.3565 0.127446 31.4907 0.94329 31.4907 2.0652C31.4907 3.1871 32.3555 4.00295 33.5101 4.00295C34.6638 4.00295 35.5296 3.1871 35.5296 2.0652C35.5296 0.94329 34.6638 0.127446 33.5101 0.127446ZM79.685 10.074C79.685 7.21805 77.9021 5.3054 74.1264 5.3054C70.5605 5.3054 68.5678 7.0655 68.174 9.76889H71.2946C71.452 8.72326 72.291 7.85624 74.074 7.85624C75.6739 7.85624 76.4605 8.54464 76.4605 9.38655C76.4605 10.4834 75.0179 10.7634 73.2349 10.942C70.8227 11.1969 67.8336 12.0127 67.8336 15.0733C67.8336 17.4456 69.6433 18.9749 72.5275 18.9749C74.7824 18.9749 76.1983 18.0567 76.9067 16.6027C77.0116 17.9032 78.008 18.7451 79.3981 18.7451H81.2335V16.0166H79.686V10.074H79.685ZM76.5911 13.3895C76.5911 15.1496 75.0179 16.4501 73.1033 16.4501C71.9229 16.4501 70.9266 15.9654 70.9266 14.9459C70.9266 13.6454 72.5265 13.2881 73.9948 13.1356C75.4107 13.0081 76.1973 12.7021 76.5911 12.115V13.3895ZM59.8885 5.30444C58.1312 5.30444 56.6629 6.0189 55.6141 7.21708V0H52.4677V18.7451H55.5617V17.0111C56.6105 18.2604 58.1055 19 59.8885 19C63.6641 19 66.5226 16.0929 66.5226 12.1653C66.5226 8.23761 63.6117 5.30444 59.8885 5.30444ZM59.4165 16.1692C57.1616 16.1692 55.5092 14.4602 55.5092 12.1653C55.5092 9.87027 57.1873 8.13624 59.4422 8.13624C61.7239 8.13624 63.3228 9.84517 63.3228 12.1653C63.3228 14.4602 61.6714 16.1692 59.4165 16.1692ZM44.9421 5.30444C42.8969 5.30444 41.5592 6.12028 40.7726 7.26826V5.55933H37.6519V18.7441H40.7983V11.5782C40.7983 9.56324 42.1093 8.13527 44.0496 8.13527C45.8593 8.13527 46.9862 9.38462 46.9862 11.1959V18.7451H50.1326V10.9671C50.1336 7.65059 48.3774 5.30444 44.9421 5.30444ZM109 11.7317C109 7.95762 106.168 5.3054 102.366 5.3054C98.328 5.3054 95.3646 8.26368 95.3646 12.1653C95.3646 16.2715 98.5377 19 102.418 19C105.696 19 108.266 17.1125 108.921 14.4351H105.643C105.171 15.6082 104.017 16.2715 102.47 16.2715C100.45 16.2715 98.9295 15.0473 98.5892 12.9048H108.999V11.7317H109ZM98.7732 10.7112C99.2719 8.87484 100.688 7.98272 102.313 7.98272C104.096 7.98272 105.46 8.97718 105.774 10.7112H98.7732Z`,fill:`#0052FF`})}),(0,X.jsx)(`defs`,{children:(0,X.jsx)(`clipPath`,{id:`clip0_1_75`,children:(0,X.jsx)(`rect`,{width:109,height:19,fill:`white`})})})]}),SvgCoinbaseLogoMobile=e=>(0,X.jsx)(`svg`,{width:32,height:32,viewBox:`0 0 32 32`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,X.jsx)(`path`,{d:`M16.0301 24C11.6018 24 8.01503 20.42 8.01503 16C8.01503 11.58 11.6018 8 16.0301 8C19.9975 8 23.2903 10.8867 23.9249 14.6667H32C31.3187 6.45333 24.4325 0 16.0301 0C7.18013 0 0 7.16667 0 16C0 24.8333 7.18013 32 16.0301 32C24.4325 32 31.3187 25.5467 32 17.3333H23.9249C23.2903 21.1133 19.9975 24 16.
21070301 24Z`,fill:`#0052FF`})}),EN=`/assets/cfm-logo-ZJCHVyKY.png`,DN=`/assets/coinbase_logo_pdf_reports-Kou9k80u.png`,ON={variant:`deribit`,branding:{platformName:`Deribit`,logos:{desktop:xn,mobile:zt,desktopTest:ca,mobileTest:Jn,qrCode:Yr,pdfReport:wN,shareImage:TN,shareImageTest:CN,redirect:SvgDeribitRedirect},favicon:`/favicon/prod/favicon.ico`,supportLink:`https://t.me/Deribit`},products:{currencyPairs:`*`,productKinds:`*`},disabledFeatures:{},currencies:{disabledCurrencies:[]},components:{disabledComponents:[]},marginModels:`*`,mainPath:`/futures/BTC-PERPETUAL`},kN={deribit:ON,proxy:{variant:`proxy`,branding:{platformName:`CFM`,logos:{desktop:SvgCoinbaseLogo,mobile:SvgCoinbaseLogoMobile,desktopTest:SvgCoinbaseLogo,mobileTest:SvgCoinbaseLogoMobile,qrCode:EN,pdfReport:DN,redirect:SvgCoinbaseLogo},favicon:`/favicon/prod/favicon.ico`},products:{currencyPairs:[`BTC_USDC`,`ETH_USDC`,`SOL_USDC`,`AVAX_USDC`,`XRP_USDC`],productKinds:[`option`]},loginApi:`proxy`,disabledFeatures:{auth:[],routes:`screens.futures,screens.blocktrades,screens.blockRfqs,screens.brokerage,screens.combos,screens.futuresSpreads,screens.futuresSpreadsMatrix,screens.spot,screens.brokerage,account.affiliate,account.verification,account.subaccounts,account.statistics,account.blockRfq,account.phoneBrokerClients,account.linkedPhoneBrokers,account.api,account.security,account.changeMarginModel,account.portfolioMargin,account.movePositions,account.legal,wallet.deposit,wallet.withdraw,wallet.buyCrypto,wallet.rewards,statistics.volatilityIndex,statistics.historicalVolatility,statistics.insuranceFund,statistics.optionsData,statistics.fundingRate,statistics.deribitFixingIndices,statistics.metricsFutures,blog,telegramSupport,positionBuilder,knowledgeBase,register`.split(`,`),ui:[`dashboard.supportWidget`,`dashboard.academyWidget`,`dashboard.affiliateWidget`,`dashboard.tradingToolsWidget`,`dashboard.economicCalendarWidget`,`footer.contactUs`,`footer.environmentSelector`,`header.announcements`,`header.kycBanners`,`trading.dvolWidget`,`accountSettings.security`,`accountSettings.closeAccount`,`accountSettings.notifications`,`interfaceSettings.apiOrderNotifications`,`interfaceSettings.apiTradeNotifications`,`interfaceSettings.liveChatNotifications`,`wallet.transfer`,`twoFABanner`,`cookieConsent.settings`]},currencies:{enabledCurrencies:[`USDC`]},components:{enabledComponents:[`InstrumentBar`,`OrderBook`,`TVChart`,`OptionsTrades`,`OrderForm`,`PositionsAll`,`OpenOrders`,`OrdersHistory`,`TradesHistory`,`OptionsTableContainer`,`AccountSummary`,`Notes`,`News`,`VolatilitySurface`,`ExpiryGreeks`,`IVCurvesChart`,`ProbabilityOfTouchChart`,`OpenInterestChart`,`OptionOpenInterestByStrike`,`OptionOpenInterestByExpiration`,`OptionInstrumentByVolume`,`OptionVolumeByExpiration`,`OptionRegularTradesDirectionBreakdown`,`OptionsVolume`]},marginModels:[`segregated_sm`],mainPath:`/options/BTC_USDC`}},createPlatformConfig=()=>{let e={REACT_APP_CSP_ENABLED:`true`,REACT_APP_DERIBIT_TEST_DOMAIN:`test.deribit.com`,REACT_APP_DOMAIN_GLOBAL:`deribit.com`,REACT_APP_GIT_COMMIT_SHA:`3dcc281a8e79fff17adf3e75579634b27b7debb6`,REACT_APP_IS_APPLE_LOGIN_ENABLED:`true`,REACT_APP_IS_GOOGLE_LOGIN_ENABLED:`true`,REACT_APP_WITHDRAWAL_CLEARANCE_ENABLED:`false`,REACT_APP_BUIDL_API:`https://public-feed.securitize.io`,REACT_APP_CBE_API_URL:`https://api.exchange.coinbase.com`,REACT_APP_CBE_WS_URL:`wss://ws-feed.exchange.coinbase.com`,REACT_APP_DATA_API:`https://data.deribit.com`,REACT_APP_DERIBIT_IS_TEST:`false`,REACT_APP_LANDING_PAGE_API:`https://landing-page-backend.deribit.com`,REACT_APP_METRICS_API:`https://metrics.deribit.com`,REACT_APP_NEWS_API:`https://newsfeed.deribit.com`,REACT_APP_USYC_API:`https://api.hashnote.com`,REACT_APP_TRAVEL_RULE_ENABLED:`false`,REACT_APP_GOOGLE_TAG_ID:`GTM-TNQCFF86`,REACT_APP_PROOF_OF_RESERVES_API:`https://por.deribit.com`,REACT_APP_SENTRY_DSN:`https://[email protected]/6454438`,REACT_APP_SENTRY_ENVIRONMENT:`production`,REACT_APP_SANDBOX_PARENT_ORIGIN:`https://www.deribit.com`,REACT_APP_DERIBIT_API_PUBLIC_FALLBACK:`www.deribit.com`,REACT_APP_CONTRACT_MULTIPLIERS_ENABLED:`false`,REACT_APP_IS_COOKIE_PROTECTION_ENABLED:`true`,REACT_APP_SANDBOX_URL:`https://assets.deribit.com`,REACT_APP_DERIBIT_API:`www.deribit.com`,REACT_APP_MATOMO_SITE_ID:`1`,NODE_ENV:`production`,PUBLIC_URL:`https://assets.deribit.com`}.REACT_APP_PLATFORM_VARIANT||`deribit`,t=kN[e];t||console.warn(`Unknown platform variant: ${e}, falling back to deribit`);let n=t??ON;return{variant:n.variant,loginApi:n.loginApi,mainPath:n.mainPath,branding:n.branding,products:n.products,currencies:n.currencies,marginModels:n.marginModels,components:n.components,isRouteEnabled:e=>isRouteEnabled(e,n.disabledFeatures.routes),isUIFeatureEnabled:e=>isUIFeatureEnabled(e,n.disabledFeatures.ui),isAuthFeatureEnabled:e=>isAuthFeatureEnabled(e,n.disabledFeatures.auth),isCurrencyEnabled:e=>isCurrencyEnabled({currency:e,...n.currencies}),isComponentEnabled:e=>isComponentEnabled({component:e,...n.components}),isInstrumentCurrencyPairEnabled:e=>isInstrumentCurrencyPairEnabled(n.products.currencyPairs,e),isProductKindEnabled:e=>isProductKindEnabled(n.products.productKinds,e),isInstrumentEnabled:e=>isInstrumentEnabled(n.products,e),canChangeMarginModel:()=>canChangeMarginModel(n.marginModels)}};function isValidUserSettingsStorageKey(e){return e in Gu}function migrate2_3(e){let t=yu(e);return(t.customPagesOrder||[]).length===0&&(t.customPagesOrder=Object.keys(t.customPages||{})),t.interfaceSettings={...t.interfaceSettings,displayCustomPagesTabBar:t.customPagesOrder.length>0,customPagesTabBarPosition:`top`},t}function migrate3_4(e){let t=yu(e),n=Lu();return t.customPages={...n.customPages?.[Hu]?{[Hu]:{name:`Trading Tools`}}:{},...n.customPages?.[Ju]?{[Ju]:{name:`Futures`}}:{},...t.customPages},t.customPagesOrder.indexOf(Ju)===-1&&t.customPagesOrder.push(Ju),t.customPagesOrder.indexOf(Hu)===-1&&t.customPagesOrder.push(Hu),t.interfaceSettings={...t.interfaceSettings,displayCustomPagesTabBar:!0,customPagesTabBarPosition:`top`},t}function migrate4_5(e){return migrate3_4(e)}function migrate5_6(e){return yu(e)}function migrate6_7(e){let t=yu(e);
2107if(t.customPages={[Fu]:{name:`Price Ladder`},...t.customPages},t.customPagesOrder.indexOf(Fu)===-1){let e=t.customPagesOrder.slice(-2);e.includes(Ju)&&e.includes(Hu)?t.customPagesOrder.splice(-2,0,Fu):t.customPagesOrder.push(Fu)}return t.interfaceSettings={...t.interfaceSettings},t}var AN=[`TransactionLog`,`popupComboOrderForm`,`popupOrderForm`,`FormBookRecent`,`insuranceFundList`,`VolatilityIndex`];function migrate7_8(e){let t=yu(e),n=[],r=Object.keys(t.layouts).flatMap(e=>{let r=t.layouts[e];if(Array.isArray(r))return r.flatMap(e=>(n.push(e.i),e.tabs.map(e=>e.id)))}).filter(Boolean),i=Object.keys({...t.componentsSettings,...t.agGridState,...t.tvChartState});for(let e of Object.keys(t.layoutComponentsState??{}))!n.includes(e)&&!e.includes(`default`)&&delete t.layoutComponentsState[e];for(let e of i)!r.some(t=>e.includes(t))&&!e.includes(`default`)&&!AN.includes(e)&&(delete t.componentsSettings[e],delete t.agGridState[e],delete t.tvChartState?.[e]);return t}function migrate8_9(e){let t=yu(e);return t.dashboard=Lu().dashboard,t}function migrate9_10(e){let t=yu(e);if(t.customPages={[Nu]:{name:`Option Wizard`},...t.customPages},t.customPagesOrder.indexOf(Nu)===-1){let e=t.customPagesOrder.indexOf(Fu);e===-1?t.customPagesOrder.push(Nu):t.customPagesOrder.splice(e,0,Nu)}return t.interfaceSettings={...t.interfaceSettings},t}function migrate10_11(e){let t=yu(e),updateLayoutComponent=e=>{e.x*=2,e.w*=2,e.minW&&(e.minW*=2),e.maxW&&(e.maxW*=2)};for(let e of Object.values(t.layouts)){if(Array.isArray(e)){e.forEach(updateLayoutComponent);continue}for(let t of Object.values(e))t.forEach(updateLayoutComponent)}return t}function migrate11_12(e){let t=yu(e),n=$e.futures.InstrumentBar.slice(1),updateLayoutComponent=e=>{e.y+=2};for(let e of[`futures`,`spot`]){let r=t.layouts[e];if(r)for(let[t,i]of Object.entries(r)){if(i.some(e=>e.i===n))continue;
2107i.forEach(updateLayoutComponent);let r=Re[e][t].find(e=>e.i===n);r&&i.unshift(r)}}return t}function migrate12_13(e){let t=yu(e),n=t.widgetsOrder?.findIndex(e=>e===`PriceDvol_USDC`);return t.widgetsOrder?.splice(n,0,`PriceDvol_USDT`),t}function migrate13_14(e){let t=yu(e);for(let e of Object.keys(Re)){let n=t.layouts&&t.layouts[e];!n||Array.isArray(n)||(`md`in n&&(n.xs=n.md,delete n.md),`sm`in n&&(n.xxs=n.sm,delete n.sm))}return t}function migrate14_15(e){let t=yu(e),n=$e.futuresSpreads.InstrumentBar.slice(2),updateLayoutComponent=e=>{e.y+=2},r=t.layouts.futuresSpreads;if(!r)return t;for(let[e,t]of Object.entries(r)){if(t.some(e=>e.i===n))continue;t.forEach(updateLayoutComponent);let r=Re.futuresSpreads[e].find(e=>e.i===n);r&&t.unshift(r)}return t}var jN={pos:[`pos`],mark:[`mark_price`],iv:[`bid_iv`,`ask_iv`],size:[`best_bid_amount`,`best_ask_amount`],last:[`last_price`],delta:[`delta`],netDelta:[`netDelta`],gamma:[`gamma`],vega:[`vega`],theta:[`theta`],rho:[`rho`],extrinsicValue:[`extrinsicValue`],open:[`open_interest`],volume:[`volume`]},MN=[`volume`,`open_interest`,`extrinsicValue`,`rho`,`theta`,`vega`,`gamma`,`netDelta`,`delta`,`last_price`,`best_bid_amount`,`bid_iv`,`best_bid_price`,`mark_price`,`best_ask_price`,`ask_iv`,`best_ask_amount`,`pos`];function migrate15_16(e){let t=yu(e);return t.componentsSettings&&Object.values(t.componentsSettings).filter(e=>
2107`columnSwitchersState`in e&&`areExpiriesOpen`in e&&`strikeConditions`in e).forEach(e=>{if(!e||Array.isArray(e.columnSwitchersState))return t;let n=e.columnSwitchersState,r=!1,i=!1;e.columnSwitchersState=Object.entries(n).reduce((e,t)=>{let n=jN[t[0]];return n.forEach(o=>{let s={id:o,isShown:t[1]};n.length>1&&(s.linked=n.filter(e=>e!==o)[0]),o===`best_bid_price`&&(s.disabled=!0,r=!0),o===`best_ask_price`&&(s.disabled=!0,i=!0),e.push(s)}),e},[]),r||e.columnSwitchersState.push({id:`best_bid_price`,isShown:!0,disabled:!0,linked:`best_ask_price`}),i||e.columnSwitchersState.push({id:`best_ask_price`,isShown:!0,disabled:!0,linked:`best_bid_price`}),e.columnSwitchersState.sort((e,t)=>MN.indexOf(e.id)-MN.indexOf(t.id))}),t}function migrate16_17(e){let t=yu(e),n=t.layouts;if(!n)return t;for(let e of Object.values(n))if(!qi(e))for(let t of Object.values(e))t.forEach(e=>{e.i.includes(`TradingTables`)&&(e.tabs=e.tabs.filter(e=>e.name!==`TriggerOrders`))});return t}function migrate17_18(e,t,n){let r=yu(e),i=Object.keys(r.layouts).flatMap(e=>{let t=r.layouts[e];if(Array.isArray(t))return t.flatMap(e=>e.tabs.map(e=>e.id))}).filter(Boolean),o=Object.keys({...r.tvChartState});for(let e of o)!i.some(t=>e.includes(t))&&!e.includes(`default`)&&delete r.tvChartState?.[e];let s=r.tvChartState;return delete r.tvChartState,s&&t.save({userId:n,key:`tvChartSettings`,value:s}),r}function migrate18_19(e){let t=yu(e);for(let e of Object.values(t.agGridState??{})){let t=e.find(e=>e.colId===`direction`);t&&(t.hide=!0)}return t}async function migrate19_20(e,t,n){await Promise.all(Object.entries(e).map(([e,r])=>{if(isValidUserSettingsStorageKey(e))return t.save({userId:n,key:e,value:r})}));let r=await t.getNotes(n);await t.save({userId:n,key:`notes`,value:r});let i=await t.getChartSettings({userId:n});await t.save({userId:n,key:`tvChartSettings`,value:i});let o=localStorage.getItem(`cookieConsent`);await t.save({userId:null,key:`cookieConsent`,value:JSON.parse(o||`null`)});let s=localStorage.getItem(`cookieConsentScopes`);return await t.save({userId:null,key:`cookieConsentScopes`,value:JSON.parse(s||`{}`)}),e}var NN=`deribitLocalSettings`,PN=`deribitGlobalSettings`,getDeribitLocalSettings=()=>{try{let e=localStorage.getItem(NN)||``;return JSON.parse(e)}catch{return{}}},getDeribitGlobalSettings=()=>{try{let e=localStorage.getItem(PN)||``;return JSON.parse(e)}catch{return{}}};async function migrate20_21(e,t,n){let r=yu(e),i=getDeribitLocalSettings(),o=getDeribitGlobalSettings();return localStorage.removeItem(NN),localStorage.removeItem(PN),Object.entries(i).forEach(([e,t])=>{r.componentsSettings[e]={...r.componentsSettings[e]||{},...t}}),o.blockTradeKey&&await t.save({userId:n,key:`blockTradeSignature`,value:o.blockTradeKey}),r}async function migrateUserSettings(e,t,n,r){let i=yu(e),o=i.version||0;if(t.env.isTest){let e=i.versionTimestamp||0;if(o===21&&e<1663672076304)return null}for(;o<21;)switch(o){case 0:case 1:case 2:console.log(`Migrate "userSettings" from version "2" to version "3"`),i=migrate2_3(i),o=3,i.version=3,i.versionTimestamp=Date.now();break;case 3:console.log(`Migrate "userSettings" from version "3" to version "4"`),i=migrate3_4(i),o=4,i.version=4,i.versionTimestamp=Date.now();break;case 4:console.log(`Migrate "userSettings" from version "4" to version "5"`),i=migrate4_5(i),o=5,i.version=5,i.versionTimestamp=Date.now();break;case 5:console.log(`Migrate "userSettings" from version "5" to version "6"`),i=migrate5_6(i),o=6,i.version=6,i.versionTimestamp=Date.now();break;case 6:console.log(`Migrate "userSettings" from version "6" to version "7"`),i=migrate6_7(i),o=7,i.version=7,i.versionTimestamp=Date.now();break;case 7:console.log(`Migrate "userSettings" from version "7" to version "8"`),i=migrate7_8(i),o=8,i.version=8,i.versionTimestamp=Date.now();break;case 8:console.log(`Migrate "userSettings" from version "8" to version "9"`),i=migrate8_9(i),o=9,i.version=9,i.versionTimestamp=Date.now();break;case 9:console.log(`Migrate "userSettings" from version "9" to version "10"`),i=migrate9_10(i),o=10,i.version=10,i.versionTimestamp=Date.now();break;case 10:console.log(`Migrate "userSettings" from version "10" to version "11"`),i=migrate10_11(i),o=11,i.version=11,i.versionTimestamp=Date.now();break;case 11:console.log(`Migrate "userSettings" from version "11" to version "12"`),i=migrate11_12(i),o=12,i.version=12,i.versionTimestamp=Date.now();break;case 12:console.log(`Migrate "userSettings" from version "12" to version "13"`),i=migrate12_13(i),o=13,i.version=13,i.versionTimestamp=Date.now();break;case 13:console.log(`Migrate "userSettings" from version "13" to version "14"`),i=migrate13_14(i),o=14,i.version=14,i.versionTimestamp=Date.now();break;case 14:console.log(`Migrate "userSettings" from version "14" to version "15"`),i=migrate14_15(i),o=15,i.version=15,i.versionTimestamp=Date.now();break;case 15:console.log(`Migrate "userSettings" from version "15" to version "16"`),i=migrate15_16(i),o=16,i.version=16,i.versionTimestamp=Date.now();break;case 16:console.log(`Migrate "userSettings" from version "16" to version "17"`),i=migrate16_17(i),o=17,i.version=17,i.versionTimestamp=Date.now();break;case 17:console.log(`Migrate "userSettings" from version "17" to version "18"`),i=migrate17_18(i,n,r),o=18,i.version=18,i.versionTimestamp=Date.now();break;case 18:console.log(`Migrate "userSettings" from version "18" to version "19"`),i=migrate18_19(i),o=19,i.version=19,i.versionTimestamp=Date.now();break;case 19:console.log(`Migrate "userSettings" from version "19" to version "20"`),i=await migrate19_20(i,n,r),o=20,i.version=20,i.versionTimestamp=Date.now();break;case 20:console.log(`Migrate "userSettings" from version "20" to version "21"`),i=await migrate20_21(i,n,r),o=21,i.version=21,i.versionTimestamp=Date.now();break;default:return null}return i}var UserSettingsService=class{appStorage;config;constructor({appStorageService:e,config:t}){this.appStorage=e,this.config=t}async save(e,t){await Promise.all(Object.entries(t).map(([t,n])=>{if(isValidUserSettingsStorageKey(t))return this.appStorage.save({userId:e,key:t,value:n})}
2107))}async fetch(e,t,n=!1){if(!t)return null;let r=null,i=await Object.values(Gu).reduce(async(t,r)=>{let i=await this.appStorage.get({userId:e,key:r,ignoreLocal:n});return{...await t,...i?{[r]:i}:{}}},Promise.resolve({}));Object.keys(i).length===0&&(r=await this.appStorage.getUserSettings(e));let o=null;try{o=await migrateUserSettings(r||i,this.config,this.appStorage,e)}catch(e){console.error(e)}return o||Object.values(Gu).forEach(t=>this.appStorage.delete({userId:e,key:t})),o?.version!==(i?.version||0)&&(this.appStorage.save({userId:e,key:`version`,value:o?.version||0}),this.appStorage.save({userId:e,key:`versionTimestamp`,value:o?.versionTimestamp||0})),o}async pull(e,t){return this.fetch(e,t,!0)}async push(e,t){t&&await Promise.all(Object.values(Gu).map(t=>{if(isValidUserSettingsStorageKey(t))return this.appStorage.push({userId:e,key:t})}))}},FN=`syncUserSettings`,AppStorageService=class{deribitClient;isKeyValueStoreEnabled;constructor({deribitClient:e,isKeyValueStoreEnabled:t}){this.deribitClient=e,this.isKeyValueStoreEnabled=t}get keyValueStoreKeys(){return this.getShouldSyncUserSettings()?this.isKeyValueStoreEnabled?[`componentsSettings`,`layouts`,`interfaceSettings`,`widgets`,`customPages`,`customPagesOrder`,`widgetsOrder`,`version`,`versionTimestamp`,`dashboard`,`notes`]:[`customPages`,`customPagesOrder`,`layouts`]:[]}getShouldSyncUserSettings(){return localStorage.getItem(FN)!==`false`}setShouldSyncUserSettings(e){localStorage.setItem(FN,JSON.stringify(e))}getStorageKey(e,t){return`${e?`user-${e}-`:``}${t}`}async get({userId:e,key:t,ignoreLocal:n=!1}){let r=this.getStorageKey(e,t),i=(()=>{if(n)return null;try{let e=localStorage.getItem(r)||`null`;return JSON.parse(e)}catch{return null}})(),o=await(async()=>{if(e&&this.keyValueStoreKeys.includes(t))try{return await this.deribitClient.getFromKeyValueStore({key:r})||null}catch{}return null})();return o?.timestamp&&o.timestamp>=(i?.timestamp??0)?(localStorage.setItem(r,JSON.stringify(o)),o.value):i?.value??null}async save({userId:e,key:t,value:n}){try{let r=this.getStorageKey(e,t),i={timestamp:Date.now(),value:n};localStorage.setItem(r,JSON.stringify(i)),e&&this.keyValueStoreKeys.includes(t)&&await this.deribitClient.saveToKeyValueStore(r,i)}catch(e){console.error(e)}}async push({userId:e,key:t}){let n=this.getStorageKey(e,t),r=(()=>{try{let e=localStorage.getItem(n)||`null`;return JSON.parse(e)}catch{return null}})();r&&await this.deribitClient.saveToKeyValueStore(n,r)}async delete({userId:e,key:t}){try{let n=this.getStorageKey(e,t);localStorage.removeItem(n),e&&this.keyValueStoreKeys.includes(t)&&await this.deribitClient.deleteFromKeyValueStore({key:n})}catch(e){console.error(e)}}async getUserSettings(e){let t=`userSettings-${e}`,n=(()=>{try{return JSON.parse(localStorage.getItem(t)||`{}`)}catch{return{}}})(),r=await(async()=>{if(e&&this.isKeyValueStoreEnabled)try{return await this.deribitClient.getFromKeyValueStore({key:t})||{}}catch{}return{}})();return{...r,...n,layouts:{...r.layouts||{},...n.layouts||{}}}}getChartSettings({userId:e}){let t=`tvChartSettings-${e}`;try{return JSON.parse(localStorage.getItem(t)||`{}`)}catch{return{}}}async getNotes(e){let t=`notes-${e}`,n=(()=>{try{return JSON.parse(localStorage.getItem(t)||`{}`)}catch{return{}}})(),r=await(async()=>{if(e)try{return await this.deribitClient.getFromKeyValueStore({key:t})||{}}catch{}return{}})();return{...n,...r}}},DummyAnalyticsService=class{debug;consent;constructor({config:e}){this.debug=e.analytics.debug,this.consent=!0}identifyProfile=e=>{this.debug&&console.log(`identifyProfile`,e)};resetProfile=()=>{this.debug&&console.log(`resetProfile`)};setProfileProperties=e=>{this.debug&&console.log(`setProfileProperties`,e??{})};setMainAccountId=e=>{this.debug&&console.log(`setMainAccountId`,e)};trackEvent=(e,t)=>{this.debug&&console.log(`trackEvent`,e,t??{})};optInTracking=()=>{this.debug&&console.log(`optInTracking`),this.consent=!0};optOutTracking=()=>{this.debug&&console.log(`optOutTracking `),this.consent=!1};hasConsent=()=>(this.debug&&console.log(`hasConsent`),this.consent)},IN=createConfig(createPlatformConfig()),{isHistoryClientUserTradesEnabled:LN,isHistoryClientLastTradesEnabled:RN,isKeyValueStoreEnabled:zN}=IN.featureToggles,VN=new DeribitClient,HN=new AppStorageService({deribitClient:VN,isKeyValueStoreEnabled:zN}),UN=new UserSettingsService({appStorageService:HN,config:IN}),WN=new DummyAnalyticsService({config:IN}),GN=new HistoryClient(VN,{isHistoryClientUserTradesEnabled:LN,isHistoryClientLastTradesEnabled:RN}),KN=new aC(IN.cbeApi.apiUrl,IN.cbeApi.wsUrl),qN=setupStore({deribitClient:VN,appStorageService:HN,userSettingsService:UN});init({dsn:IN.sentry.dsn,environment:IN.sentry.environment,release:IN.sentry.release,ignoreErrors:[`WebSocket API response timeout`,`ResizeObserver loop`,`waitForWebsocket timeout`,`AbortError`],beforeSend:sentryFilter}),os.registerModules([$b]),GridLicenseManager.setLicenseKey(`Using_this_{AG_Grid}_Enterprise_key_{AG-084249}_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___{Sentillia_B.V.}_is_granted_a_{Multiple_Applications}_Developer_License_for_{5}_Front-End_JavaScript_developers___All_Front-End_JavaScript_developers_need_to_be_licensed_in_addition_to_the_ones_working_with_{AG_Grid}_Enterprise___This_key_has_been_granted_a_Deployment_License_Add-on_for_{1}_Production_Environment___This_key_works_with_{AG_Grid}_Enterprise_versions_released_before_{9_November_2026}____[v3]_[01]_MTc5NDE4MjQwMDAwMA==a16cddb7c0bcb8a6aa865e686e00252f`),IN.env.isTest&&(window.deribitClient=VN,window.cbeClient=KN),window.getErrorLogs=()=>VN.getErrorLogs();var JN=console.error;console.error=(...e)=>{e.find(e=>isString(e)&&e.includes("The `value` provided to the Tabs component is invali
2107d."))||JN(...e)},enableSound(),(0,iC.createRoot)(document.getElementById(`root`)).render((0,X.jsx)(ErrorBoundary,{fallback:CrashPage,children:(0,X.jsx)(hn,{config:IN,children:(0,X.jsx)(fn,{deribitClient:VN,children:(0,X.jsx)(i,{cbeClient:KN,children:(0,X.jsx)(Mt,{store:qN,children:(0,X.jsxs)(gu,{appStorageService:HN,userSettingsService:UN,analyticsService:WN,deribitHistoryClient:GN,children:[(0,X.jsx)(Initializer,{}),(0,X.jsx)(ir,{children:(0,X.jsx)(rn,{children:(0,X.jsx)(qt,{router:router(IN)})})})]})})})})})}));export{activeNoteIdSelector as $,getInfoAboutDisplayingLegs as A,MS as At,useGetOpenBlockRFQData as B,Nj as C,useLinkActionHandling as Ct,Tj as D,ClickAwayListener as Dt,Aj as E,_C as Et,MakerNamesTooltip as F,useMissingInfoDepositCurrencies as G,blockRfqIsMaker as H,TakerTradeConfirmationDialog as I,getComboConfig as J,getBlockTradeNetDelta as K,TimeDisplay as L,ReviewBlockRfqDialogs as M,formatMarkPrice as N,CancelButton as O,fC as Ot,QuoteExpiryTimer as P,getNetDelta as Q,StrategyDetailsAndMakers as R,PriceDetail as S,ErrorPageContent as St,BrokerageTradeSideTag as T,PC as Tt,blockRfqUserInfoSelector as U,kk as V,bk as W,computeGreeks as X,getComboInstrumentsList as Y,convertGreeksToNotional as Z,transformUnregisteredClientParties as _,MT as _t,iN as a,addComboDetails as at,isBrokerTradeRequest as b,ShortOptionRouteGuard as bt,UM as c,formatOrderTrigger as ct,HeaderButtons as d,CopyableContent as dt,UO as et,BM as f,useLegalDocumentInfo as ft,transformHistoricalUnregisteredParties as g,isNumericString as gt,Spinner as h,OrDivider as ht,aN as i,useBeforeUnload as it,getRowHeight as j,Legs as k,calcSaltAndVerifier as kt,Section as l,triggerFormatter as lt,withSuspense as m,useAffiliateRestrictedCountries as mt,wN as n,notesSaveErrorSelector as nt,rN as o,transformComboDetails as ot,validateUrl as p,useDefaultKYCMode as pt,getBlockTradeNetDeltaCounterparty as q,CN as r,notesSaveStatusSelector as rt,NotAvailableInfo as s,$D as st,TN as t,notesFetchStatusSelector as tt,HM as u,isTrailingOrder as ut,transformUnregisteredParties as v,FiltersBar as vt,Pj as w,BC as wt,uM as x,ErrorPage as xt,isBlockTradeRequest as y,DocumentTitle as yt,ConfirmCancellationDialog as z};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.