@marimo-team/frontend 0.14.17-dev50 → 0.14.17-dev52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-Ce0TC-tZ.js → ConnectedDataExplorerComponent-DKw6KrX_.js} +1 -1
  2. package/dist/assets/{ImageComparisonComponent-DwSOwXhh.js → ImageComparisonComponent-DAPG8gPk.js} +1 -1
  3. package/dist/assets/{VegaLite-DvsYftTu.js → VegaLite-kpaj3jnh.js} +1 -1
  4. package/dist/assets/_baseEach-DgKJ_yh2.js +1 -0
  5. package/dist/assets/_baseMap-_qjAB773.js +1 -0
  6. package/dist/assets/_baseUniq-DsEmgZj4.js +1 -0
  7. package/dist/assets/{_createAggregator-CSBoqMlf.js → _createAggregator-0VsbCMQy.js} +1 -1
  8. package/dist/assets/{any-language-editor-BQlzQXKx.js → any-language-editor-XYuree7L.js} +1 -1
  9. package/dist/assets/{architectureDiagram-SUXI7LT5-B9Wxsw8t.js → architectureDiagram-SUXI7LT5-Bh9Z8-nA.js} +1 -1
  10. package/dist/assets/{blockDiagram-6J76NXCF-yXpuPCJ9.js → blockDiagram-6J76NXCF-yF4TXxi-.js} +1 -1
  11. package/dist/assets/{c4Diagram-6F6E4RAY-B0u0AKt2.js → c4Diagram-6F6E4RAY-BwpAvqdA.js} +1 -1
  12. package/dist/assets/channel-Cw6AEncD.js +1 -0
  13. package/dist/assets/{chunk-353BL4L5-Bx2Tp8dL.js → chunk-353BL4L5-DMTfIREf.js} +1 -1
  14. package/dist/assets/{chunk-67H74DCK-DT5zwdot.js → chunk-67H74DCK-BRE_KCf1.js} +1 -1
  15. package/dist/assets/{chunk-AACKK3MU-CS4IlaFm.js → chunk-AACKK3MU-CVrqgt5L.js} +1 -1
  16. package/dist/assets/{chunk-BFAMUDN2-C6afvyCK.js → chunk-BFAMUDN2-CXdFTjp4.js} +1 -1
  17. package/dist/assets/{chunk-E2GYISFI-xz1MYNbG.js → chunk-E2GYISFI-Bs9UZyZq.js} +1 -1
  18. package/dist/assets/{chunk-OW32GOEJ-C-bwAx0F.js → chunk-OW32GOEJ-C0bSrD3h.js} +1 -1
  19. package/dist/assets/{chunk-SKB7J2MH-IkNjP7aw.js → chunk-SKB7J2MH-BDH2f5qw.js} +1 -1
  20. package/dist/assets/{chunk-SZ463SBG-DeR9mZtM.js → chunk-SZ463SBG-Cd1qqD6j.js} +1 -1
  21. package/dist/assets/{circle-play-OPSOZUSJ.js → circle-play-ClFywCWK.js} +1 -1
  22. package/dist/assets/classDiagram-M3E45YP4-BZuQEW-x.js +1 -0
  23. package/dist/assets/classDiagram-v2-YAWTLIQI-BZuQEW-x.js +1 -0
  24. package/dist/assets/clone-D0U_4Foz.js +1 -0
  25. package/dist/assets/{compile-DPgtA4Er.js → compile-J4o3SSt8.js} +5 -5
  26. package/dist/assets/{dagre-JOIXM2OF-CzDN_bfy.js → dagre-JOIXM2OF-Cgr-ekQp.js} +1 -1
  27. package/dist/assets/{data-grid-overlay-editor-BEStKz7e.js → data-grid-overlay-editor-BFMjRfym.js} +1 -1
  28. package/dist/assets/{diagram-5UYTHUR4-TyPhhbg4.js → diagram-5UYTHUR4-C9sEDAJt.js} +1 -1
  29. package/dist/assets/{diagram-VMROVX33-B_yxodJs.js → diagram-VMROVX33-CGOvHRlz.js} +1 -1
  30. package/dist/assets/{diagram-ZTM2IBQH-CXiAslA1.js → diagram-ZTM2IBQH-Bz4gykiz.js} +1 -1
  31. package/dist/assets/edit-page-D5gsQ3AR.js +148 -0
  32. package/dist/assets/{erDiagram-3M52JZNH-BNCrTAQ9.js → erDiagram-3M52JZNH-BhaX3GHb.js} +1 -1
  33. package/dist/assets/{flowDiagram-KYDEHFYC-Ba_c9EPm.js → flowDiagram-KYDEHFYC-DPoEQUTq.js} +1 -1
  34. package/dist/assets/{ganttDiagram-EK5VF46D-DnIuKw2R.js → ganttDiagram-EK5VF46D-CLgJbKxE.js} +4 -4
  35. package/dist/assets/{gitGraphDiagram-GW3U2K7C-1QmaE2WA.js → gitGraphDiagram-GW3U2K7C-DY_b362V.js} +1 -1
  36. package/dist/assets/{glide-data-editor-d6grwpew.js → glide-data-editor-DOqNa5NG.js} +11 -11
  37. package/dist/assets/{graph-0uy08CRw.js → graph-BqHJo60z.js} +1 -1
  38. package/dist/assets/home-page-DePHQhvN.js +9 -0
  39. package/dist/assets/{index-ukteXaqC.js → index-B68QxZ4j.js} +1 -1
  40. package/dist/assets/{index-C2R0lChn.js → index-BEyze6er.js} +1 -1
  41. package/dist/assets/{index-CG-OzDYE.js → index-BIqVhCGI.js} +1 -1
  42. package/dist/assets/{index-CJtYacYk.js → index-BIv4gd5k.js} +1 -1
  43. package/dist/assets/{index-DMmdMuSp.js → index-BvsboPlP.js} +1 -1
  44. package/dist/assets/{index-DTGFFGrU.js → index-C6tN7Sd5.js} +1 -1
  45. package/dist/assets/{index-BRsKX55I.js → index-CSPyN4cW.js} +336 -336
  46. package/dist/assets/{index-8gVzrL6y.js → index-CX90WBn3.js} +1 -1
  47. package/dist/assets/{index-BspvY5k3.js → index-CXXB4K2m.js} +1 -1
  48. package/dist/assets/{index-D6I0WKad.js → index-CcmN_7Ri.js} +1 -1
  49. package/dist/assets/{index-DdZuv69w.js → index-ChwnRmyU.js} +1 -1
  50. package/dist/assets/{index-HJI8bjV4.js → index-CmbEuD_J.js} +1 -1
  51. package/dist/assets/{index-DTou-2SI.js → index-CpDzU4a4.js} +1 -1
  52. package/dist/assets/{index-Cp8m6mju.js → index-CwT8oLaJ.js} +1 -1
  53. package/dist/assets/{index-B7vzVfNW.js → index-D0hmgAd4.js} +1 -1
  54. package/dist/assets/{index-CD-N3MY0.js → index-D3oH_ISv.js} +1 -1
  55. package/dist/assets/index-DmaoBTfT.css +1 -0
  56. package/dist/assets/{index-C4qMdaWk.js → index-DoJNd5TO.js} +1 -1
  57. package/dist/assets/{index-CH-KhRgU.js → index-OpfXYM03.js} +1 -1
  58. package/dist/assets/{index-DU5V1UXh.js → index-bQahjypS.js} +1 -1
  59. package/dist/assets/infoDiagram-LHK5PUON-D4kH3IO6.js +2 -0
  60. package/dist/assets/{journeyDiagram-EWQZEKCU-JatEjWMR.js → journeyDiagram-EWQZEKCU-BHYscvV9.js} +1 -1
  61. package/dist/assets/{kanban-definition-ZSS6B67P-CWf3jJz4.js → kanban-definition-ZSS6B67P-DwjByFqu.js} +1 -1
  62. package/dist/assets/{layout-DSIdkdp6.js → layout-BBBTcalD.js} +1 -1
  63. package/dist/assets/{linear-5RI6BcLf.js → linear-CRzT0Y7Z.js} +1 -1
  64. package/dist/assets/links-BNeucPnM.js +17 -0
  65. package/dist/assets/{mermaid-BFX9YpwT.js → mermaid-CBWSg5mK.js} +4 -4
  66. package/dist/assets/{min-BEQ0qmNL.js → min-D0cY_cmP.js} +1 -1
  67. package/dist/assets/{mindmap-definition-6CBA2TL7-BwwGh_xX.js → mindmap-definition-6CBA2TL7-Bp8ZUhrl.js} +1 -1
  68. package/dist/assets/{number-overlay-editor-CzV-HwJ1.js → number-overlay-editor-Dns19i7x.js} +2 -2
  69. package/dist/assets/{pieDiagram-NIOCPIFQ-CvOXeZeg.js → pieDiagram-NIOCPIFQ-BSdUjCxL.js} +1 -1
  70. package/dist/assets/{quadrantDiagram-2OG54O6I-DWctHQ5M.js → quadrantDiagram-2OG54O6I-BN7rcYOZ.js} +1 -1
  71. package/dist/assets/{react-plotly-7rSO6_pO.js → react-plotly-Cwm_Zws7.js} +1 -1
  72. package/dist/assets/{requirementDiagram-QOLK2EJ7-E5ILV_jW.js → requirementDiagram-QOLK2EJ7-Z0LaSHDM.js} +1 -1
  73. package/dist/assets/run-page-e5zqdLNb.js +1 -0
  74. package/dist/assets/{sankeyDiagram-4UZDY2LN-BbQXWZt4.js → sankeyDiagram-4UZDY2LN-URGiryWU.js} +1 -1
  75. package/dist/assets/{sequenceDiagram-SKLFT4DO-DN-Qt_J3.js → sequenceDiagram-SKLFT4DO-Do-YLmj0.js} +1 -1
  76. package/dist/assets/{slides-component-DhafDKo1.js → slides-component-DaklX30G.js} +1 -1
  77. package/dist/assets/{sortBy-ByqiSfmy.js → sortBy-CyFp7E_N.js} +1 -1
  78. package/dist/assets/{stateDiagram-MI5ZYTHO-C3voiVpG.js → stateDiagram-MI5ZYTHO-BxhxWedO.js} +1 -1
  79. package/dist/assets/stateDiagram-v2-5AN5P6BG-D1pJlR6r.js +1 -0
  80. package/dist/assets/{storage-BwdfKb3e.js → storage-Dr_iHaXY.js} +6 -6
  81. package/dist/assets/{terminal-DnEiY_Di.js → terminal-C_Y6lZQe.js} +1 -1
  82. package/dist/assets/time-BOg6M-VK.js +1 -0
  83. package/dist/assets/{timeline-definition-MYPXXCX6-D2ZXeK1N.js → timeline-definition-MYPXXCX6-GoOe2GO2.js} +1 -1
  84. package/dist/assets/timer-BwIYMJWC.js +1 -0
  85. package/dist/assets/tracing-CSH0Hox7.js +2 -0
  86. package/dist/assets/{transform-CDNfLgV5.js → transform-B8bpuzxV.js} +1 -1
  87. package/dist/assets/{trash-Crss8VH4.js → trash-Dpszkgwx.js} +1 -1
  88. package/dist/assets/{treemap-75Q7IDZK-Cn9k8at_.js → treemap-75Q7IDZK-Dr0M6FZV.js} +1 -1
  89. package/dist/assets/{vega-component-wMB3EDRs.js → vega-component-DeXvh_Gw.js} +1 -1
  90. package/dist/assets/{xychartDiagram-H2YORKM3-qkBu9yox.js → xychartDiagram-H2YORKM3-6T7dRn7U.js} +1 -1
  91. package/dist/index.html +2 -2
  92. package/package.json +1 -1
  93. package/dist/assets/_baseEach-Bt_hy8p5.js +0 -1
  94. package/dist/assets/_baseMap-wg3_pLeD.js +0 -1
  95. package/dist/assets/_baseUniq-LUPmCTek.js +0 -1
  96. package/dist/assets/channel-B5GewZ-i.js +0 -1
  97. package/dist/assets/classDiagram-M3E45YP4-UOaLNaLd.js +0 -1
  98. package/dist/assets/classDiagram-v2-YAWTLIQI-UOaLNaLd.js +0 -1
  99. package/dist/assets/clone-BNsKcv3n.js +0 -1
  100. package/dist/assets/edit-page-Dem5AQ2A.js +0 -148
  101. package/dist/assets/home-page-BtKVarMy.js +0 -9
  102. package/dist/assets/index-BdR5uFJr.css +0 -1
  103. package/dist/assets/infoDiagram-LHK5PUON-CMztT734.js +0 -2
  104. package/dist/assets/links-DhS7HdtO.js +0 -17
  105. package/dist/assets/run-page-CiJgXbRq.js +0 -1
  106. package/dist/assets/stateDiagram-v2-5AN5P6BG-Ct72fLIl.js +0 -1
  107. package/dist/assets/time-DKizHULL.js +0 -1
  108. package/dist/assets/timer-Bqd5yn_a.js +0 -1
  109. package/dist/assets/tracing-Bvs8Nv6U.js +0 -2
  110. package/dist/assets/worker-Bma4sWEs.js +0 -1
@@ -1,8 +1,8 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor-BEStKz7e.js","./index-BRsKX55I.js","./index-BdR5uFJr.css","./trash-Crss8VH4.js","./number-overlay-editor-CzV-HwJ1.js"])))=>i.map(i=>d[i]);
2
- var Lp=Object.defineProperty;var _p=(ur,$n,Rr)=>$n in ur?Lp(ur,$n,{enumerable:!0,configurable:!0,writable:!0,value:Rr}):ur[$n]=Rr;var ft=(ur,$n,Rr)=>_p(ur,typeof $n!="symbol"?$n+"":$n,Rr);import{gS as Ti,z as Sr,T as d,gT as Fa,aF as Go,aG as jp,b as $t,gU as Np,an as L0,fq as _0,L as La,a as j0,j as nt,dr as Bp,gV as Wp,gW as N0,gX as $p,bu as _a,bs as B0,a6 as ja,gY as W0,gZ as $0,g_ as X0,g$ as Xp,dw as Gp,dt as Yp,ds as Kp,du as Vp,am as Up,h0 as qp,dE as Qp,h1 as Hi,aS as Na,aN as Jp,bf as Zp,f1 as G0,b0 as Y0,aV as em,aW as tm,ad as nm,ab as rm,ac as om,__tla as im}from"./index-BRsKX55I.js";import{T as am}from"./trash-Crss8VH4.js";let Ba,Wa,kr,$a,K0,Mr,Xa,Cn,lm=Promise.all([(()=>{try{return im}catch{}})()]).then(async()=>{var ur,$n,Rr,Ga,Ya,Ka,Va,Ua,qa,Qa,Ja,Za,el,tl,nl,rl,ol,il,al,ll,sl,cl,ul,dl,hl,fl,gl,pl,ml,vl,wl,yl,bl,xl,Cl,Sl,kl,Ml,Rl,El,Il,Tl,Hl,Ol,Pl,Dl,zl,Al,Fl,Ll,_l,jl,Nl,Bl,Wl,$l,Xl,Gl,Yl,Kl,Vl,Ul,ql,Ql,Jl,Zl,es,ts,ns,rs,os,is,as,ls,ss,cs,us,ds,hs,fs,gs,ps,ms,vs,ws,ys,bs,xs,Oi,Cs,Ss,ks,Ms,Rs,Pi,Es,Is,Ts,Hs,Os,Ps,Ds,zs,As,Fs,Ls,_s,js,Ns,Bs,Ws,$s,Xs,Gs;function Xn(){if(Ga)return Rr;Ga=1;var e=Array.isArray;return Rr=e}function Ys(){if(Ka)return Ya;Ka=1;var e=typeof Ti=="object"&&Ti&&Ti.Object===Object&&Ti;return Ya=e}function Gn(){if(Ua)return Va;Ua=1;var e=Ys(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Va=n}function oo(){if(Qa)return qa;Qa=1;var e=Gn().Symbol;return qa=e}function io(){if(rl)return nl;rl=1;var e=oo(),t=function(){if(Za)return Ja;Za=1;var o=oo(),i=Object.prototype,l=i.hasOwnProperty,a=i.toString,s=o?o.toStringTag:void 0;return Ja=function(c){var h=l.call(c,s),C=c[s];try{c[s]=void 0;var y=!0}catch{}var b=a.call(c);return y&&(h?c[s]=C:delete c[s]),b}}(),n=function(){if(tl)return el;tl=1;var o=Object.prototype.toString;return el=function(i){return o.call(i)}}(),r=e?e.toStringTag:void 0;return nl=function(o){return o==null?o===void 0?"[object Undefined]":"[object Null]":r&&r in Object(o)?t(o):n(o)}}function ao(){return il?ol:(il=1,ol=function(e){return e!=null&&typeof e=="object"})}function Yo(){if(ll)return al;ll=1;var e=io(),t=ao();return al=function(n){return typeof n=="symbol"||t(n)&&e(n)=="[object Symbol]"}}function Di(){if(cl)return sl;cl=1;var e=Xn(),t=Yo(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;return sl=function(o,i){if(e(o))return!1;var l=typeof o;return!(l!="number"&&l!="symbol"&&l!="boolean"&&o!=null&&!t(o))||r.test(o)||!n.test(o)||i!=null&&o in Object(i)}}function Er(){return dl?ul:(dl=1,ul=function(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")})}function Ks(){if(fl)return hl;fl=1;var e=io(),t=Er();return hl=function(n){if(!t(n))return!1;var r=e(n);return r=="[object Function]"||r=="[object GeneratorFunction]"||r=="[object AsyncFunction]"||r=="[object Proxy]"}}function V0(){if(vl)return ml;vl=1;var e,t=function(){if(pl)return gl;pl=1;var r=Gn()["__core-js_shared__"];return gl=r}(),n=(e=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"";return ml=function(r){return!!n&&n in r}}function Vs(){if(yl)return wl;yl=1;var e=Function.prototype.toString;return wl=function(t){if(t!=null){try{return e.call(t)}catch{}try{return t+""}catch{}}return""}}function Ir(){if(Ml)return kl;Ml=1;var e=function(){if(xl)return bl;xl=1;var n=Ks(),r=V0(),o=Er(),i=Vs(),l=/^\[object .+?Constructor\]$/,a=Function.prototype,s=Object.prototype,c=a.toString,h=s.hasOwnProperty,C=RegExp("^"+c.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return bl=function(y){return!(!o(y)||r(y))&&(n(y)?C:l).test(i(y))}}(),t=Sl?Cl:(Sl=1,Cl=function(n,r){return n==null?void 0:n[r]});return kl=function(n,r){var o=t(n,r);return e(o)?o:void 0}}function Ko(){if(El)return Rl;El=1;var e=Ir()(Object,"create");return Rl=e}function U0(){if(jl)return _l;jl=1;var e=function(){if(Tl)return Il;Tl=1;var l=Ko();return Il=function(){this.__data__=l?l(null):{},this.size=0}}(),t=Ol?Hl:(Ol=1,Hl=function(l){var a=this.has(l)&&delete this.__data__[l];return this.size-=a?1:0,a}),n=function(){if(Dl)return Pl;Dl=1;var l=Ko(),a=Object.prototype.hasOwnProperty;return Pl=function(s){var c=this.__data__;if(l){var h=c[s];return h==="__lodash_hash_undefined__"?void 0:h}return a.call(c,s)?c[s]:void 0}}(),r=function(){if(Al)return zl;Al=1;var l=Ko(),a=Object.prototype.hasOwnProperty;return zl=function(s){var c=this.__data__;return l?c[s]!==void 0:a.call(c,s)}}(),o=function(){if(Ll)return Fl;Ll=1;var l=Ko();return Fl=function(a,s){var c=this.__data__;return this.size+=this.has(a)?0:1,c[a]=l&&s===void 0?"__lodash_hash_undefined__":s,this}}();function i(l){var a=-1,s=l==null?0:l.length;for(this.clear();++a<s;){var c=l[a];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,_l=i}function zi(){return $l?Wl:($l=1,Wl=function(e,t){return e===t||e!=e&&t!=t})}function Vo(){if(Gl)return Xl;Gl=1;var e=zi();return Xl=function(t,n){for(var r=t.length;r--;)if(e(t[r][0],n))return r;return-1}}function Uo(){if(ts)return es;ts=1;var e=Bl?Nl:(Bl=1,Nl=function(){this.__data__=[],this.size=0}),t=function(){if(Kl)return Yl;Kl=1;var l=Vo(),a=Array.prototype.splice;return Yl=function(s){var c=this.__data__,h=l(c,s);return!(h<0||(h==c.length-1?c.pop():a.call(c,h,1),--this.size,0))}}(),n=function(){if(Ul)return Vl;Ul=1;var l=Vo();return Vl=function(a){var s=this.__data__,c=l(s,a);return c<0?void 0:s[c][1]}}(),r=function(){if(Ql)return ql;Ql=1;var l=Vo();return ql=function(a){return l(this.__data__,a)>-1}}(),o=function(){if(Zl)return Jl;Zl=1;var l=Vo();return Jl=function(a,s){var c=this.__data__,h=l(c,a);return h<0?(++this.size,c.push([a,s])):c[h][1]=s,this}}();function i(l){var a=-1,s=l==null?0:l.length;for(this.clear();++a<s;){var c=l[a];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,es=i}function Ai(){if(rs)return ns;rs=1;var e=Ir()(Gn(),"Map");return ns=e}function qo(){if(cs)return ss;cs=1;var e=ls?as:(ls=1,as=function(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null});return ss=function(t,n){var r=t.__data__;return e(n)?r[typeof n=="string"?"string":"hash"]:r.map}}function Fi(){if(ys)return ws;ys=1;var e=function(){if(is)return os;is=1;var l=U0(),a=Uo(),s=Ai();return os=function(){this.size=0,this.__data__={hash:new l,map:new(s||a),string:new l}}}(),t=function(){if(ds)return us;ds=1;var l=qo();return us=function(a){var s=l(this,a).delete(a);return this.size-=s?1:0,s}}(),n=function(){if(fs)return hs;fs=1;var l=qo();return hs=function(a){return l(this,a).get(a)}}(),r=function(){if(ps)return gs;ps=1;var l=qo();return gs=function(a){return l(this,a).has(a)}}(),o=function(){if(vs)return ms;vs=1;var l=qo();return ms=function(a,s){var c=l(this,a),h=c.size;return c.set(a,s),this.size+=c.size==h?0:1,this}}();function i(l){var a=-1,s=l==null?0:l.length;for(this.clear();++a<s;){var c=l[a];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,ws=i}function q0(){if(Cs)return Oi;Cs=1;var e=function(){if(xs)return bs;xs=1;var t=Fi();function n(r,o){if(typeof r!="function"||o!=null&&typeof o!="function")throw new TypeError("Expected a function");var i=function(){var l=arguments,a=o?o.apply(this,l):l[0],s=i.cache;if(s.has(a))return s.get(a);var c=r.apply(this,l);return i.cache=s.set(a,c)||s,c};return i.cache=new(n.Cache||t),i}return n.Cache=t,bs=n}();return Oi=function(t){var n=e(t,function(o){return r.size===500&&r.clear(),o}),r=n.cache;return n},Oi}function Q0(){if(Es)return Pi;Es=1;var e=oo(),t=Rs?Ms:(Rs=1,Ms=function(l,a){for(var s=-1,c=l==null?0:l.length,h=Array(c);++s<c;)h[s]=a(l[s],s,l);return h}),n=Xn(),r=Yo(),o=e?e.prototype:void 0,i=o?o.toString:void 0;return Pi=function l(a){if(typeof a=="string")return a;if(n(a))return t(a,l)+"";if(r(a))return i?i.call(a):"";var s=a+"";return s=="0"&&1/a==-1/0?"-0":s},Pi}function Us(){if(Os)return Hs;Os=1;var e=Xn(),t=Di(),n=function(){if(ks)return Ss;ks=1;var o=q0(),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,l=/\\(\\)?/g,a=o(function(s){var c=[];return s.charCodeAt(0)===46&&c.push(""),s.replace(i,function(h,C,y,b){c.push(y?b.replace(l,"$1"):C||h)}),c});return Ss=a}(),r=function(){if(Ts)return Is;Ts=1;var o=Q0();return Is=function(i){return i==null?"":o(i)}}();return Hs=function(o,i){return e(o)?o:t(o,i)?[o]:n(r(o))}}function Li(){if(As)return zs;As=1;var e=function(){if(Ds)return Ps;Ds=1;var l=io(),a=ao();return Ps=function(s){return a(s)&&l(s)=="[object Arguments]"}}(),t=ao(),n=Object.prototype,r=n.hasOwnProperty,o=n.propertyIsEnumerable,i=e(function(){return arguments}())?e:function(l){return t(l)&&r.call(l,"callee")&&!o.call(l,"callee")};return zs=i}function _i(){if(Ls)return Fs;Ls=1;var e=/^(?:0|[1-9]\d*)$/;return Fs=function(t,n){var r=typeof t;return!!(n=n??9007199254740991)&&(r=="number"||r!="symbol"&&e.test(t))&&t>-1&&t%1==0&&t<n}}function ji(){return js?_s:(js=1,_s=function(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=9007199254740991})}function Qo(){if(Bs)return Ns;Bs=1;var e=Yo();return Ns=function(t){if(typeof t=="string"||e(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}}function qs(){if($s)return Ws;$s=1;var e=Us(),t=Li(),n=Xn(),r=_i(),o=ji(),i=Qo();return Ws=function(l,a,s){for(var c=-1,h=(a=e(a,l)).length,C=!1;++c<h;){var y=i(a[c]);if(!(C=l!=null&&s(l,y)))break;l=l[y]}return C||++c!=h?C:!!(h=l==null?0:l.length)&&o(h)&&r(y,h)&&(n(l)||t(l))}}const J0=Sr(function(){if(Gs)return Xs;Gs=1;var e=function(){if($n)return ur;$n=1;var n=Object.prototype.hasOwnProperty;return ur=function(r,o){return r!=null&&n.call(r,o)}}(),t=qs();return Xs=function(n,r){return n!=null&&t(n,r,e)}}());function Qs(e="This should not happen"){throw new Error(e)}function Rn(e,t="Assertion failed"){if(!e)return Qs(t)}function lo(e,t){return Qs(t??"Hell froze over")}const Js=Object.prototype.hasOwnProperty;function $r(e,t){let n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&$r(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){for(n in r=0,e)if(Js.call(e,n)&&++r&&!Js.call(t,n)||!(n in t)||!$r(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!=e&&t!=t}const Jo=null,Ni=void 0;var me,Qn,Zo,Hn;function ei(e){return"width"in e&&typeof e.width=="number"}async function Zs(e){return typeof e=="object"?e:await e()}Mr=function(e){return e.kind!==me.Loading&&e.kind!==me.Bubble&&e.kind!==me.RowID&&e.kind!==me.Protected&&e.kind!==me.Drilldown},kr=function(e){return e.kind===Hn.Marker||e.kind===Hn.NewRow};function so(e){if(!Mr(e)||e.kind===me.Image)return!1;switch(e.kind){case me.Text:case me.Number:case me.Markdown:case me.Uri:case me.Custom:case me.Boolean:return e.readonly!==!0;default:lo(0,"A cell was passed with an invalid kind")}}$a=function(e){return J0(e,"editor")};function Bi(e){return!e.readonly}let ec;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(me||(me={})),function(e){e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay"}(Qn||(Qn={})),function(e){e.Triangle="triangle",e.Dots="dots"}(Zo||(Zo={})),function(e){e.NewRow="new-row",e.Marker="marker"}(Hn||(Hn={}));const er=class er{constructor(t){ft(this,"items");this.items=t}offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new er(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=function(o){if(o.length===0)return[];const i=[...o],l=[];i.sort(function(a,s){return a[0]-s[0]}),l.push([...i[0]]);for(const a of i.slice(1)){const s=l[l.length-1];s[1]<a[0]?l.push([...a]):s[1]<a[1]&&(s[1]=a[1])}return l}([...this.items,n]);return new er(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],o=typeof t=="number"?t+1:t[1];for(const[i,l]of n.entries()){const[a,s]=l;if(a<=o&&r<=s){const c=[];a<r&&c.push([a,r]),o<s&&c.push([o,s]),n.splice(i,1,...c)}}return new er(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,o]=this.items[n];if(t>=r&&t<o)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],o=this.items[n];if(r[0]!==o[0]||r[1]!==o[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let o=n;o<r;o++)t.push(o);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}};ft(er,"empty",()=>ec??(ec=new er([]))),ft(er,"fromSingleSelection",t=>er.empty().add(t));let yt=er;var tc=function(){const e=Array.prototype.slice.call(arguments).filter(Boolean),t={},n=[];e.forEach(o=>{(o?o.split(" "):[]).forEach(i=>{if(i.startsWith("atm_")){const[,l]=i.split("_");t[l]=i}else n.push(i)})});const r=[];for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.push(t[o]);return r.push(...n),r.join(" ")},nc=(e,t)=>{const n={};return Object.keys(e).filter((r=>o=>r.indexOf(o)===-1)(t)).forEach(r=>{n[r]=e[r]}),n},Z0=(e,t)=>{};Cn=function(e){let t="";return n=>{const r=(i,l)=>{const{as:a=e,class:s=t}=i;var c;const h=function(y,b,p){const m=nc(b,p);if(!y){const E=typeof Fa=="function"?{default:Fa}:Fa;Object.keys(m).forEach(g=>{E.default(g)||delete m[g]})}return m}(n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&(c=a[0],c.toUpperCase()!==c)):n.propsAsIs,i,["as","class"]);h.ref=l,h.className=n.atomic?tc(n.class,h.className||s):tc(h.className||s,n.class);const{vars:C}=n;if(C){const y={};for(const m in C){const E=C[m],g=E[0],w=E[1]||"",x=typeof g=="function"?g(i):g;Z0(0,n.name),y[`--${m}`]=`${x}${w}`}const b=h.style||{},p=Object.keys(b);p.length>0&&p.forEach(m=>{y[m]=b[m]}),h.style=y}return e.__wyw_meta&&e!==a?(h.as=a,d.createElement(e,h)):d.createElement(a,h)},o=d.forwardRef?d.forwardRef(r):i=>{const l=nc(i,["innerRef"]);return r(l,i.innerRef)};return o.displayName=n.name,o.__wyw_meta={className:n.class||t,extends:e},o}};const e1=Cn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var rc,oc,ic={},co={},ac={},lc={};function t1(){return rc||(rc=1,function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.setHasSupportToCaptureOption=b;var r=i(t),o=i(n);function i(g){return g&&g.__esModule?g:{default:g}}var l=Object.assign||function(g){for(var w=1;w<arguments.length;w++){var x=arguments[w];for(var I in x)Object.prototype.hasOwnProperty.call(x,I)&&(g[I]=x[I])}return g};function a(g,w){var x={};for(var I in g)w.indexOf(I)>=0||Object.prototype.hasOwnProperty.call(g,I)&&(x[I]=g[I]);return x}function s(g,w){if(!(g instanceof w))throw new TypeError("Cannot call a class as a function")}var c=function(){function g(w,x){for(var I=0;I<x.length;I++){var v=x[I];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(w,v.key,v)}}return function(w,x,I){return x&&g(w.prototype,x),I&&g(w,I),w}}();function h(g,w){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!w||typeof w!="object"&&typeof w!="function"?g:w}function C(g,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);g.prototype=Object.create(w&&w.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(g,w):g.__proto__=w)}var y=!1;function b(g){y=g}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){b(!0)}}))}catch{}function p(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return y?g:g.capture}function m(g){if("touches"in g){var w=g.touches[0];return{x:w.pageX,y:w.pageY}}return{x:g.screenX,y:g.screenY}}var E=function(g){function w(){var x;s(this,w);for(var I=arguments.length,v=Array(I),M=0;M<I;M++)v[M]=arguments[M];var S=h(this,(x=w.__proto__||Object.getPrototypeOf(w)).call.apply(x,[this].concat(v)));return S._handleSwipeStart=S._handleSwipeStart.bind(S),S._handleSwipeMove=S._handleSwipeMove.bind(S),S._handleSwipeEnd=S._handleSwipeEnd.bind(S),S._onMouseDown=S._onMouseDown.bind(S),S._onMouseMove=S._onMouseMove.bind(S),S._onMouseUp=S._onMouseUp.bind(S),S._setSwiperRef=S._setSwiperRef.bind(S),S}return C(w,g),c(w,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(x){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(x))}},{key:"_onMouseMove",value:function(x){this.mouseDown&&this._handleSwipeMove(x)}},{key:"_onMouseUp",value:function(x){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(x)}},{key:"_handleSwipeStart",value:function(x){var I=m(x),v=I.x,M=I.y;this.moveStart={x:v,y:M},this.props.onSwipeStart(x)}},{key:"_handleSwipeMove",value:function(x){if(this.moveStart){var I=m(x),v=I.x,M=I.y,S=v-this.moveStart.x,H=M-this.moveStart.y;this.moving=!0,this.props.onSwipeMove({x:S,y:H},x)&&x.cancelable&&x.preventDefault(),this.movePosition={deltaX:S,deltaY:H}}}},{key:"_handleSwipeEnd",value:function(x){this.props.onSwipeEnd(x);var I=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-I?this.props.onSwipeLeft(1,x):this.movePosition.deltaX>I&&this.props.onSwipeRight(1,x),this.movePosition.deltaY<-I?this.props.onSwipeUp(1,x):this.movePosition.deltaY>I&&this.props.onSwipeDown(1,x)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(x){this.swiper=x,this.props.innerRef(x)}},{key:"render",value:function(){var x=this.props;x.tagName;var I=x.className,v=x.style,M=x.children;x.allowMouseEvents,x.onSwipeUp,x.onSwipeDown,x.onSwipeLeft,x.onSwipeRight,x.onSwipeStart,x.onSwipeMove,x.onSwipeEnd,x.innerRef,x.tolerance;var S=a(x,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return r.default.createElement(this.props.tagName,l({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:I,style:v},S),M)}}]),w}(t.Component);E.displayName="ReactSwipe",E.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},E.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},e.default=E}(lc,Go(),jp())),lc}function sc(){return oc||(oc=1,function(e,t){Object.defineProperty(e,"__esModule",{value:!0});var n=r(t);function r(o){return o&&o.__esModule?o:{default:o}}e.default=n.default}(ac,t1())),ac}var cc,uc,uo={},dc={exports:{}};function hc(){if(uc)return uo;uc=1,Object.defineProperty(uo,"__esModule",{value:!0}),uo.default=void 0;var e,t,n=(cc||(cc=1,t=dc,function(){var o={}.hasOwnProperty;function i(){for(var s="",c=0;c<arguments.length;c++){var h=arguments[c];h&&(s=a(s,l(h)))}return s}function l(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return i.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var c="";for(var h in s)o.call(s,h)&&s[h]&&(c=a(c,h));return c}function a(s,c){return c?s?s+" "+c:s+c:s}t.exports?(i.default=i,t.exports=i):window.classNames=i}()),(e=dc.exports)&&e.__esModule?e:{default:e}),r={ROOT:function(o){return(0,n.default)(function(i,l,a){return l in i?Object.defineProperty(i,l,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[l]=a,i}({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,n.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,i){return(0,n.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":i==="horizontal","axis-vertical":i!=="horizontal"})},SLIDER:function(o,i){return(0,n.default)({thumbs:!o,slider:o,animated:!i})},ITEM:function(o,i,l){return(0,n.default)({thumb:!o,slide:o,selected:i,previous:l})},ARROW_PREV:function(o){return(0,n.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,n.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,n.default)({dot:!0,selected:o})}};return uo.default=r,uo}var fc,ho={},ti={},gc,fo={};function Wi(){return gc?fo:(gc=1,Object.defineProperty(fo,"__esModule",{value:!0}),fo.default=void 0,fo.default=function(e,t,n){var r=e===0?e:e+t;return"translate3d"+("("+(n==="horizontal"?[r,0,0]:[0,r,0]).join(",")+")")},fo)}var pc,mc,go={};function vc(){return pc?go:(pc=1,Object.defineProperty(go,"__esModule",{value:!0}),go.default=void 0,go.default=function(){return window},go)}function wc(){if(mc)return ho;mc=1,Object.defineProperty(ho,"__esModule",{value:!0}),ho.default=void 0;var e=function(g){if(g&&g.__esModule)return g;if(g===null||s(g)!=="object"&&typeof g!="function")return{default:g};var w=a();if(w&&w.has(g))return w.get(g);var x={},I=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in g)if(Object.prototype.hasOwnProperty.call(g,v)){var M=I?Object.getOwnPropertyDescriptor(g,v):null;M&&(M.get||M.set)?Object.defineProperty(x,v,M):x[v]=g[v]}return x.default=g,w&&w.set(g,x),x}(Go()),t=l(hc()),n=(fc||(fc=1,Object.defineProperty(ti,"__esModule",{value:!0}),ti.outerWidth=void 0,ti.outerWidth=function(g){var w=g.offsetWidth,x=getComputedStyle(g);return w+(parseInt(x.marginLeft)+parseInt(x.marginRight))}),ti),r=l(Wi()),o=l(sc()),i=l(vc());function l(g){return g&&g.__esModule?g:{default:g}}function a(){if(typeof WeakMap!="function")return null;var g=new WeakMap;return a=function(){return g},g}function s(g){return s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},s(g)}function c(){return c=Object.assign||function(g){for(var w=1;w<arguments.length;w++){var x=arguments[w];for(var I in x)Object.prototype.hasOwnProperty.call(x,I)&&(g[I]=x[I])}return g},c.apply(this,arguments)}function h(g,w,x){return w&&function(I,v){for(var M=0;M<v.length;M++){var S=v[M];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(I,S.key,S)}}(g.prototype,w),g}function C(g,w){return C=Object.setPrototypeOf||function(x,I){return x.__proto__=I,x},C(g,w)}function y(g){var w=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var x,I=p(g);if(w){var v=p(this).constructor;x=Reflect.construct(I,arguments,v)}else x=I.apply(this,arguments);return function(M,S){return S&&(s(S)==="object"||typeof S=="function")?S:b(M)}(this,x)}}function b(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function p(g){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(w){return w.__proto__||Object.getPrototypeOf(w)},p(g)}function m(g,w,x){return w in g?Object.defineProperty(g,w,{value:x,enumerable:!0,configurable:!0,writable:!0}):g[w]=x,g}var E=function(g){(function(I,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(v&&v.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),v&&C(I,v)})(x,g);var w=y(x);function x(I){var v;return function(M,S){if(!(M instanceof S))throw new TypeError("Cannot call a class as a function")}(this,x),m(b(v=w.call(this,I)),"itemsWrapperRef",void 0),m(b(v),"itemsListRef",void 0),m(b(v),"thumbsRef",void 0),m(b(v),"setItemsWrapperRef",function(M){v.itemsWrapperRef=M}),m(b(v),"setItemsListRef",function(M){v.itemsListRef=M}),m(b(v),"setThumbsRef",function(M,S){v.thumbsRef||(v.thumbsRef=[]),v.thumbsRef[S]=M}),m(b(v),"updateSizes",function(){if(v.props.children&&v.itemsWrapperRef&&v.thumbsRef){var M=e.Children.count(v.props.children),S=v.itemsWrapperRef.clientWidth,H=v.props.thumbWidth?v.props.thumbWidth:(0,n.outerWidth)(v.thumbsRef[0]),f=Math.floor(S/H),B=f<M,D=B?M-f:0;v.setState(function(O,T){return{itemSize:H,visibleItems:f,firstItem:B?v.getFirstItem(T.selectedItem):0,lastPosition:D,showArrows:B}})}}),m(b(v),"handleClickItem",function(M,S,H){if(!function(B){return B.hasOwnProperty("key")}(H)||H.key==="Enter"){var f=v.props.onSelectItem;typeof f=="function"&&f(M,S)}}),m(b(v),"onSwipeStart",function(){v.setState({swiping:!0})}),m(b(v),"onSwipeEnd",function(){v.setState({swiping:!1})}),m(b(v),"onSwipeMove",function(M){var S=M.x;if(!v.state.itemSize||!v.itemsWrapperRef||!v.state.visibleItems)return!1;var H=e.Children.count(v.props.children),f=-100*v.state.firstItem/v.state.visibleItems;f===0&&S>0&&(S=0),f===100*-Math.max(H-v.state.visibleItems,0)/v.state.visibleItems&&S<0&&(S=0);var B=f+100/(v.itemsWrapperRef.clientWidth/S);return v.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(D){v.itemsListRef.style[D]=(0,r.default)(B,"%",v.props.axis)}),!0}),m(b(v),"slideRight",function(M){v.moveTo(v.state.firstItem-(typeof M=="number"?M:1))}),m(b(v),"slideLeft",function(M){v.moveTo(v.state.firstItem+(typeof M=="number"?M:1))}),m(b(v),"moveTo",function(M){M=(M=M<0?0:M)>=v.state.lastPosition?v.state.lastPosition:M,v.setState({firstItem:M})}),v.state={selectedItem:I.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},v}return h(x,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(I){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==I.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,i.default)().addEventListener("resize",this.updateSizes),(0,i.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,i.default)().removeEventListener("resize",this.updateSizes),(0,i.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(I){var v=I;return I>=this.state.lastPosition&&(v=this.state.lastPosition),I<this.state.firstItem+this.state.visibleItems&&(v=this.state.firstItem),I<this.state.firstItem&&(v=I),v}},{key:"renderItems",value:function(){var I=this;return this.props.children.map(function(v,M){var S=t.default.ITEM(!1,M===I.state.selectedItem),H={key:M,ref:function(f){return I.setThumbsRef(f,M)},className:S,onClick:I.handleClickItem.bind(I,M,I.props.children[M]),onKeyDown:I.handleClickItem.bind(I,M,I.props.children[M]),"aria-label":"".concat(I.props.labels.item," ").concat(M+1),style:{width:I.props.thumbWidth}};return e.default.createElement("li",c({},H,{role:"button",tabIndex:0}),v)})}},{key:"render",value:function(){var I=this;if(!this.props.children)return null;var v,M=e.Children.count(this.props.children)>1,S=this.state.showArrows&&this.state.firstItem>0,H=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,f=-this.state.firstItem*(this.state.itemSize||0),B=(0,r.default)(f,"px",this.props.axis),D=this.props.transitionTime+"ms";return v={WebkitTransform:B,MozTransform:B,MsTransform:B,OTransform:B,transform:B,msTransform:B,WebkitTransitionDuration:D,MozTransitionDuration:D,MsTransitionDuration:D,OTransitionDuration:D,transitionDuration:D,msTransitionDuration:D},e.default.createElement("div",{className:t.default.CAROUSEL(!1)},e.default.createElement("div",{className:t.default.WRAPPER(!1),ref:this.setItemsWrapperRef},e.default.createElement("button",{type:"button",className:t.default.ARROW_PREV(!S),onClick:function(){return I.slideRight()},"aria-label":this.props.labels.leftArrow}),M?e.default.createElement(o.default,{tagName:"ul",className:t.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:v,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(O){return I.setItemsListRef(O)},style:v},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!H),onClick:function(){return I.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),x}(e.Component);return ho.default=E,m(E,"displayName","Thumbs"),m(E,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),ho}var yc,ni={},bc,En={};function xc(){if(bc)return En;bc=1,Object.defineProperty(En,"__esModule",{value:!0}),En.setPosition=En.getPosition=En.isKeyboardEvent=En.defaultStatusFormatter=En.noop=void 0;var e,t=Go(),n=(e=Wi())&&e.__esModule?e:{default:e};return En.noop=function(){},En.defaultStatusFormatter=function(r,o){return"".concat(r," of ").concat(o)},En.isKeyboardEvent=function(r){return!!r&&r.hasOwnProperty("key")},En.getPosition=function(r,o){if(o.infiniteLoop&&++r,r===0)return 0;var i=t.Children.count(o.children);if(o.centerMode&&o.axis==="horizontal"){var l=-r*o.centerSlidePercentage,a=i-1;return r&&(r!==a||o.infiniteLoop)?l+=(100-o.centerSlidePercentage)/2:r===a&&(l+=100-o.centerSlidePercentage),l}return 100*-r},En.setPosition=function(r,o){var i={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(l){i[l]=(0,n.default)(r,"%",o)}),i},En}var Cc,Sc,Fn={};function n1(){if(Sc)return co;Sc=1,Object.defineProperty(co,"__esModule",{value:!0}),co.default=void 0;var e=function(v){if(v&&v.__esModule)return v;if(v===null||h(v)!=="object"&&typeof v!="function")return{default:v};var M=c();if(M&&M.has(v))return M.get(v);var S={},H=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in v)if(Object.prototype.hasOwnProperty.call(v,f)){var B=H?Object.getOwnPropertyDescriptor(v,f):null;B&&(B.get||B.set)?Object.defineProperty(S,f,B):S[f]=v[f]}return S.default=v,M&&M.set(v,S),S}(Go()),t=s(sc()),n=s(hc()),r=s(wc()),o=s((yc||(yc=1,Object.defineProperty(ni,"__esModule",{value:!0}),ni.default=void 0,ni.default=function(){return document}),ni)),i=s(vc()),l=xc(),a=function(){if(Cc)return Fn;Cc=1,Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.fadeAnimationHandler=Fn.slideStopSwipingHandler=Fn.slideSwipeAnimationHandler=Fn.slideAnimationHandler=void 0;var v,M=Go(),S=(v=Wi())&&v.__esModule?v:{default:v},H=xc();function f(O,T){var j=Object.keys(O);if(Object.getOwnPropertySymbols){var V=Object.getOwnPropertySymbols(O);T&&(V=V.filter(function(Z){return Object.getOwnPropertyDescriptor(O,Z).enumerable})),j.push.apply(j,V)}return j}function B(O){for(var T=1;T<arguments.length;T++){var j=arguments[T]!=null?arguments[T]:{};T%2?f(Object(j),!0).forEach(function(V){D(O,V,j[V])}):Object.getOwnPropertyDescriptors?Object.defineProperties(O,Object.getOwnPropertyDescriptors(j)):f(Object(j)).forEach(function(V){Object.defineProperty(O,V,Object.getOwnPropertyDescriptor(j,V))})}return O}function D(O,T,j){return T in O?Object.defineProperty(O,T,{value:j,enumerable:!0,configurable:!0,writable:!0}):O[T]=j,O}return Fn.slideAnimationHandler=function(O,T){var j={},V=T.selectedItem,Z=V,Q=M.Children.count(O.children)-1;if(O.infiniteLoop&&(V<0||V>Q))return Z<0?O.centerMode&&O.centerSlidePercentage&&O.axis==="horizontal"?j.itemListStyle=(0,H.setPosition)(-(Q+2)*O.centerSlidePercentage-(100-O.centerSlidePercentage)/2,O.axis):j.itemListStyle=(0,H.setPosition)(100*-(Q+2),O.axis):Z>Q&&(j.itemListStyle=(0,H.setPosition)(0,O.axis)),j;var ce=(0,H.getPosition)(V,O),le=(0,S.default)(ce,"%",O.axis),q=O.transitionTime+"ms";return j.itemListStyle={WebkitTransform:le,msTransform:le,OTransform:le,transform:le},T.swiping||(j.itemListStyle=B(B({},j.itemListStyle),{},{WebkitTransitionDuration:q,MozTransitionDuration:q,OTransitionDuration:q,transitionDuration:q,msTransitionDuration:q})),j},Fn.slideSwipeAnimationHandler=function(O,T,j,V){var Z={},Q=T.axis==="horizontal",ce=M.Children.count(T.children),le=(0,H.getPosition)(j.selectedItem,T),q=T.infiniteLoop?(0,H.getPosition)(ce-1,T)-100:(0,H.getPosition)(ce-1,T),J=Q?O.x:O.y,fe=J;le===0&&J>0&&(fe=0),le===q&&J<0&&(fe=0);var ee=le+100/(j.itemSize/fe),se=Math.abs(J)>T.swipeScrollTolerance;return T.infiniteLoop&&se&&(j.selectedItem===0&&ee>-100?ee-=100*ce:j.selectedItem===ce-1&&ee<100*-ce&&(ee+=100*ce)),(!T.preventMovementUntilSwipeScrollTolerance||se||j.swipeMovementStarted)&&(j.swipeMovementStarted||V({swipeMovementStarted:!0}),Z.itemListStyle=(0,H.setPosition)(ee,T.axis)),se&&!j.cancelClick&&V({cancelClick:!0}),Z},Fn.slideStopSwipingHandler=function(O,T){var j=(0,H.getPosition)(T.selectedItem,O);return{itemListStyle:(0,H.setPosition)(j,O.axis)}},Fn.fadeAnimationHandler=function(O,T){var j=O.transitionTime+"ms",V="ease-in-out",Z={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:V,msTransitionTimingFunction:V,MozTransitionTimingFunction:V,WebkitTransitionTimingFunction:V,OTransitionTimingFunction:V};return T.swiping||(Z=B(B({},Z),{},{WebkitTransitionDuration:j,MozTransitionDuration:j,OTransitionDuration:j,transitionDuration:j,msTransitionDuration:j})),{slideStyle:Z,selectedStyle:B(B({},Z),{},{opacity:1,position:"relative"}),prevStyle:B({},Z)}},Fn}();function s(v){return v&&v.__esModule?v:{default:v}}function c(){if(typeof WeakMap!="function")return null;var v=new WeakMap;return c=function(){return v},v}function h(v){return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(M){return typeof M}:function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},h(v)}function C(){return C=Object.assign||function(v){for(var M=1;M<arguments.length;M++){var S=arguments[M];for(var H in S)Object.prototype.hasOwnProperty.call(S,H)&&(v[H]=S[H])}return v},C.apply(this,arguments)}function y(v,M){var S=Object.keys(v);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(v);M&&(H=H.filter(function(f){return Object.getOwnPropertyDescriptor(v,f).enumerable})),S.push.apply(S,H)}return S}function b(v){for(var M=1;M<arguments.length;M++){var S=arguments[M]!=null?arguments[M]:{};M%2?y(Object(S),!0).forEach(function(H){x(v,H,S[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(S)):y(Object(S)).forEach(function(H){Object.defineProperty(v,H,Object.getOwnPropertyDescriptor(S,H))})}return v}function p(v,M,S){return M&&function(H,f){for(var B=0;B<f.length;B++){var D=f[B];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(H,D.key,D)}}(v.prototype,M),v}function m(v,M){return m=Object.setPrototypeOf||function(S,H){return S.__proto__=H,S},m(v,M)}function E(v){var M=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var S,H=w(v);if(M){var f=w(this).constructor;S=Reflect.construct(H,arguments,f)}else S=H.apply(this,arguments);return function(B,D){return D&&(h(D)==="object"||typeof D=="function")?D:g(B)}(this,S)}}function g(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function w(v){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(M){return M.__proto__||Object.getPrototypeOf(M)},w(v)}function x(v,M,S){return M in v?Object.defineProperty(v,M,{value:S,enumerable:!0,configurable:!0,writable:!0}):v[M]=S,v}var I=function(v){(function(H,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");H.prototype=Object.create(f&&f.prototype,{constructor:{value:H,writable:!0,configurable:!0}}),f&&m(H,f)})(S,v);var M=E(S);function S(H){var f;(function(D,O){if(!(D instanceof O))throw new TypeError("Cannot call a class as a function")})(this,S),x(g(f=M.call(this,H)),"thumbsRef",void 0),x(g(f),"carouselWrapperRef",void 0),x(g(f),"listRef",void 0),x(g(f),"itemsRef",void 0),x(g(f),"timer",void 0),x(g(f),"animationHandler",void 0),x(g(f),"setThumbsRef",function(D){f.thumbsRef=D}),x(g(f),"setCarouselWrapperRef",function(D){f.carouselWrapperRef=D}),x(g(f),"setListRef",function(D){f.listRef=D}),x(g(f),"setItemsRef",function(D,O){f.itemsRef||(f.itemsRef=[]),f.itemsRef[O]=D}),x(g(f),"autoPlay",function(){e.Children.count(f.props.children)<=1||(f.clearAutoPlay(),f.props.autoPlay&&(f.timer=setTimeout(function(){f.increment()},f.props.interval)))}),x(g(f),"clearAutoPlay",function(){f.timer&&clearTimeout(f.timer)}),x(g(f),"resetAutoPlay",function(){f.clearAutoPlay(),f.autoPlay()}),x(g(f),"stopOnHover",function(){f.setState({isMouseEntered:!0},f.clearAutoPlay)}),x(g(f),"startOnLeave",function(){f.setState({isMouseEntered:!1},f.autoPlay)}),x(g(f),"isFocusWithinTheCarousel",function(){return!!f.carouselWrapperRef&&!((0,o.default)().activeElement!==f.carouselWrapperRef&&!f.carouselWrapperRef.contains((0,o.default)().activeElement))}),x(g(f),"navigateWithKeyboard",function(D){if(f.isFocusWithinTheCarousel()){var O=f.props.axis==="horizontal",T=O?37:38;(O?39:40)===D.keyCode?f.increment():T===D.keyCode&&f.decrement()}}),x(g(f),"updateSizes",function(){if(f.state.initialized&&f.itemsRef&&f.itemsRef.length!==0){var D=f.props.axis==="horizontal",O=f.itemsRef[0];if(O){var T=D?O.clientWidth:O.clientHeight;f.setState({itemSize:T}),f.thumbsRef&&f.thumbsRef.updateSizes()}}}),x(g(f),"setMountState",function(){f.setState({hasMount:!0}),f.updateSizes()}),x(g(f),"handleClickItem",function(D,O){e.Children.count(f.props.children)!==0&&(f.state.cancelClick?f.setState({cancelClick:!1}):(f.props.onClickItem(D,O),D!==f.state.selectedItem&&f.setState({selectedItem:D})))}),x(g(f),"handleOnChange",function(D,O){e.Children.count(f.props.children)<=1||f.props.onChange(D,O)}),x(g(f),"handleClickThumb",function(D,O){f.props.onClickThumb(D,O),f.moveTo(D)}),x(g(f),"onSwipeStart",function(D){f.setState({swiping:!0}),f.props.onSwipeStart(D)}),x(g(f),"onSwipeEnd",function(D){f.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),f.props.onSwipeEnd(D),f.clearAutoPlay(),f.state.autoPlay&&f.autoPlay()}),x(g(f),"onSwipeMove",function(D,O){f.props.onSwipeMove(O);var T=f.props.swipeAnimationHandler(D,f.props,f.state,f.setState.bind(g(f)));return f.setState(b({},T)),!!Object.keys(T).length}),x(g(f),"decrement",function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;f.moveTo(f.state.selectedItem-(typeof D=="number"?D:1))}),x(g(f),"increment",function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;f.moveTo(f.state.selectedItem+(typeof D=="number"?D:1))}),x(g(f),"moveTo",function(D){if(typeof D=="number"){var O=e.Children.count(f.props.children)-1;D<0&&(D=f.props.infiniteLoop?O:0),D>O&&(D=f.props.infiniteLoop?0:O),f.selectItem({selectedItem:D}),f.state.autoPlay&&f.state.isMouseEntered===!1&&f.resetAutoPlay()}}),x(g(f),"onClickNext",function(){f.increment(1)}),x(g(f),"onClickPrev",function(){f.decrement(1)}),x(g(f),"onSwipeForward",function(){f.increment(1),f.props.emulateTouch&&f.setState({cancelClick:!0})}),x(g(f),"onSwipeBackwards",function(){f.decrement(1),f.props.emulateTouch&&f.setState({cancelClick:!0})}),x(g(f),"changeItem",function(D){return function(O){(0,l.isKeyboardEvent)(O)&&O.key!=="Enter"||f.moveTo(D)}}),x(g(f),"selectItem",function(D){f.setState(b({previousItem:f.state.selectedItem},D),function(){f.setState(f.animationHandler(f.props,f.state))}),f.handleOnChange(D.selectedItem,e.Children.toArray(f.props.children)[D.selectedItem])}),x(g(f),"getInitialImage",function(){var D=f.props.selectedItem,O=f.itemsRef&&f.itemsRef[D];return(O&&O.getElementsByTagName("img")||[])[0]}),x(g(f),"getVariableItemHeight",function(D){var O=f.itemsRef&&f.itemsRef[D];if(f.state.hasMount&&O&&O.children.length){var T=O.children[0].getElementsByTagName("img")||[];if(T.length>0){var j=T[0];j.complete||j.addEventListener("load",function Z(){f.forceUpdate(),j.removeEventListener("load",Z)})}var V=(T[0]||O.children[0]).clientHeight;return V>0?V:null}return null});var B={initialized:!1,previousItem:H.selectedItem,selectedItem:H.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:H.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return f.animationHandler=typeof H.animationHandler=="function"&&H.animationHandler||H.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,f.state=b(b({},B),f.animationHandler(H,B)),f}return p(S,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(H,f){H.children||!this.props.children||this.state.initialized||this.setupCarousel(),!H.autoFocus&&this.props.autoFocus&&this.forceFocus(),f.swiping&&!this.state.swiping&&this.setState(b({},this.props.stopSwipingHandler(this.props,this.state))),H.selectedItem===this.props.selectedItem&&H.centerMode===this.props.centerMode||(this.updateSizes(),this.moveTo(this.props.selectedItem)),H.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var H=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var f=H.getInitialImage();f&&!f.complete?f.addEventListener("load",H.setMountState):H.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var H=this.carouselWrapperRef;this.props.stopOnHover&&H&&(H.addEventListener("mouseenter",this.stopOnHover),H.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var H=this.carouselWrapperRef;this.props.stopOnHover&&H&&(H.removeEventListener("mouseenter",this.stopOnHover),H.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,i.default)().addEventListener("resize",this.updateSizes),(0,i.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,o.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,i.default)().removeEventListener("resize",this.updateSizes),(0,i.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var H=this.getInitialImage();H&&H.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,o.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var H;(H=this.carouselWrapperRef)===null||H===void 0||H.focus()}},{key:"renderItems",value:function(H){var f=this;return this.props.children?e.Children.map(this.props.children,function(B,D){var O=D===f.state.selectedItem,T=D===f.state.previousItem,j=O&&f.state.selectedStyle||T&&f.state.prevStyle||f.state.slideStyle||{};f.props.centerMode&&f.props.axis==="horizontal"&&(j=b(b({},j),{},{minWidth:f.props.centerSlidePercentage+"%"})),f.state.swiping&&f.state.swipeMovementStarted&&(j=b(b({},j),{},{pointerEvents:"none"}));var V={ref:function(Z){return f.setItemsRef(Z,D)},key:"itemKey"+D+(H?"clone":""),className:n.default.ITEM(!0,D===f.state.selectedItem,D===f.state.previousItem),onClick:f.handleClickItem.bind(f,D,B),style:j};return e.default.createElement("li",V,f.props.renderItem(B,{isSelected:D===f.state.selectedItem,isPrevious:D===f.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var H=this,f=this.props,B=f.showIndicators,D=f.labels,O=f.renderIndicator,T=f.children;return B?e.default.createElement("ul",{className:"control-dots"},e.Children.map(T,function(j,V){return O&&O(H.changeItem(V),V===H.state.selectedItem,V,D.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return this.props.showThumbs&&this.props.children&&e.Children.count(this.props.children)!==0?e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children)):null}},{key:"render",value:function(){var H=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var f=this.props.swipeable&&e.Children.count(this.props.children)>1,B=this.props.axis==="horizontal",D=this.props.showArrows&&e.Children.count(this.props.children)>1,O=D&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,T=D&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,j=this.renderItems(!0),V=j.shift(),Z=j.pop(),Q={className:n.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},ce={};if(B){if(Q.onSwipeLeft=this.onSwipeForward,Q.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var le=this.getVariableItemHeight(this.state.selectedItem);ce.height=le||"auto"}}else Q.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,Q.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,Q.style=b(b({},Q.style),{},{height:this.state.itemSize}),ce.height=this.state.itemSize;return e.default.createElement("div",{"aria-label":this.props.ariaLabel,className:n.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},e.default.createElement("div",{className:n.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,O,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:ce},f?e.default.createElement(t.default,C({tagName:"ul",innerRef:this.setListRef},Q,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&Z,this.renderItems(),this.props.infiniteLoop&&V):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(q){return H.setListRef(q)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&Z,this.renderItems(),this.props.infiniteLoop&&V)),this.props.renderArrowNext(this.onClickNext,T,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),S}(e.default.Component);return co.default=I,x(I,"displayName","Carousel"),x(I,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:l.noop,onClickThumb:l.noop,onChange:l.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(v,M,S){return e.default.createElement("button",{type:"button","aria-label":S,className:n.default.ARROW_PREV(!M),onClick:v})},renderArrowNext:function(v,M,S){return e.default.createElement("button",{type:"button","aria-label":S,className:n.default.ARROW_NEXT(!M),onClick:v})},renderIndicator:function(v,M,S,H){return e.default.createElement("li",{className:n.default.DOT(M),onClick:v,onKeyDown:v,value:S,key:S,role:"button",tabIndex:0,"aria-label":"".concat(H," ").concat(S+1)})},renderItem:function(v){return v},renderThumbs:function(v){var M=e.Children.map(v,function(S){var H=S;if(S.type!=="img"&&(H=e.Children.toArray(S.props.children).find(function(f){return f.type==="img"})),H)return H});return M.filter(function(S){return S}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):M},statusFormatter:l.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:a.slideSwipeAnimationHandler,stopSwipingHandler:a.slideStopSwipingHandler}),co}var kc,Mc,r1={},Rc,Ec,Ic,Tc,Hc,Oc,Pc,Dc,$i,zc,o1=(Mc||(Mc=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=o(n1()),n=(kc||(kc=1),r1),r=o(wc());function o(i){return i&&i.__esModule?i:{default:i}}}(ic)),ic);function i1(){if(Oc)return Hc;Oc=1;var e=function(){if(Tc)return Ic;Tc=1;var n=/\s/;return Ic=function(r){for(var o=r.length;o--&&n.test(r.charAt(o)););return o}}(),t=/^\s+/;return Hc=function(n){return n&&n.slice(0,e(n)+1).replace(t,"")}}function Xi(){if(Dc)return Pc;Dc=1;var e=i1(),t=Er(),n=Yo(),r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,l=parseInt;return Pc=function(a){if(typeof a=="number")return a;if(n(a))return NaN;if(t(a)){var s=typeof a.valueOf=="function"?a.valueOf():a;a=t(s)?s+"":s}if(typeof a!="string")return a===0?a:+a;a=e(a);var c=o.test(a);return c||i.test(a)?l(a.slice(2),c?2:8):r.test(a)?NaN:+a}}function Ac(){if(zc)return $i;zc=1;var e=Er(),t=function(){if(Ec)return Rc;Ec=1;var i=Gn();return Rc=function(){return i.Date.now()}}(),n=Xi(),r=Math.max,o=Math.min;return $i=function(i,l,a){var s,c,h,C,y,b,p=0,m=!1,E=!1,g=!0;if(typeof i!="function")throw new TypeError("Expected a function");function w(S){var H=s,f=c;return s=c=void 0,p=S,C=i.apply(f,H)}function x(S){var H=S-b;return b===void 0||H>=l||H<0||E&&S-p>=h}function I(){var S=t();if(x(S))return v(S);y=setTimeout(I,function(H){var f=l-(H-b);return E?o(f,h-(H-p)):f}(S))}function v(S){return y=void 0,g&&s?w(S):(s=c=void 0,C)}function M(){var S=t(),H=x(S);if(s=arguments,c=this,b=S,H){if(y===void 0)return function(f){return p=f,y=setTimeout(I,l),m?w(f):C}(b);if(E)return clearTimeout(y),y=setTimeout(I,l),w(b)}return y===void 0&&(y=setTimeout(I,l)),C}return l=n(l)||0,e(a)&&(m=!!a.leading,h=(E="maxWait"in a)?r(n(a.maxWait)||0,l):h,g="trailing"in a?!!a.trailing:g),M.cancel=function(){y!==void 0&&clearTimeout(y),p=0,s=b=c=y=void 0},M.flush=function(){return y===void 0?C:v(t())},M},$i}const Fc=Sr(Ac());function cn(e,t,n,r,o=!1){const i=d.useRef();i.current=t,d.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const l=n,a=s=>{var c;(c=i.current)==null||c.call(l,s)};return l.addEventListener(e,a,{passive:r,capture:o}),()=>{l.removeEventListener(e,a,{capture:o})}},[e,n,r,o])}function dr(e,t){return e===void 0?void 0:t}const a1=Math.PI;function Lc(e){return e*a1/180}const _c=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),jc=(e,t,n,r,o)=>{switch(e){case"left":return Math.floor(t)+r+o/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-o/2}},Nc=(e,t,n)=>Math.min(e,t-2*n),Bc=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Gi=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),d.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},l1=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))},s1=new RegExp("^[^A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF]*[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]");function Yi(e){return s1.test(e)?"rtl":"not-rtl"}let ri;function Ki(){if(typeof document>"u")return 0;if(ri!==void 0)return ri;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),ri=n-r,ri}const Tr=Symbol();function c1(e){const t=d.useRef([Tr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=d.useState(e),[,o]=d.useState(),i=d.useCallback(a=>{const s=t.current[0];s!==Tr&&(a=typeof a=="function"?a(s):a)===s||(s!==Tr&&o({}),r(c=>typeof a=="function"?a(s===Tr?c:s):a),t.current[0]=Tr)},[]),l=d.useCallback(()=>{t.current[0]=Tr,o({})},[]);return[t.current[0]===Tr?n:t.current[0],i,l]}function Wc(e){if(e.length===0)return"";let t=0,n=0;for(const r of e){if(n+=r.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}const u1=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:o}=e,i=t.filter(a=>a!=="");if(i.length===0)return null;const l=i.length>1;return d.createElement(e1,{"data-testid":"GDG-default-image-overlay-editor"},d.createElement(o1.Carousel,{showArrows:l,showThumbs:!1,swipeable:l,emulateTouch:l,infiniteLoop:l},i.map(a=>{const s=(o==null?void 0:o(a))??d.createElement("img",{draggable:!1,src:a});return d.createElement("div",{className:"gdg-centering-container",key:a},s)})),n&&r&&d.createElement("button",{className:"gdg-edit-icon",onClick:r},d.createElement(Gi,null)))},d1=Cn("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class h1 extends $t.PureComponent{constructor(){super(...arguments);ft(this,"targetElement",null);ft(this,"containerRefHook",n=>{this.targetElement=n,this.renderMarkdownIntoDiv()})}renderMarkdownIntoDiv(){const{targetElement:n,props:r}=this;if(n===null)return;const{contents:o,createNode:i}=r,l=Np(o),a=document.createRange();a.selectNodeContents(n),a.deleteContents();let s=i==null?void 0:i(l);if(s===void 0){const h=document.createElement("template");h.innerHTML=l,s=h.content}n.append(s);const c=n.getElementsByTagName("a");for(const h of c)h.target="_blank",h.rel="noreferrer noopener"}render(){return this.renderMarkdownIntoDiv(),$t.createElement(d1,{ref:this.containerRefHook})}}const f1=Cn("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),g1=Cn("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),p1=Cn("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let $c=0;const oi=e=>{const{placeholder:t,value:n,onKeyDown:r,highlight:o,altNewline:i,validatedSelection:l,...a}=e,{onChange:s,className:c}=a,h=d.useRef(null),C=n??"";Rn(s!==void 0,"GrowingEntry must be a controlled input area");const[y]=d.useState(()=>"input-box-"+($c=($c+1)%1e7));d.useEffect(()=>{const p=h.current;if(p===null||p.disabled)return;const m=C.toString().length;p.focus(),p.setSelectionRange(o?0:m,m)},[]),d.useLayoutEffect(()=>{var p;if(l!==void 0){const m=typeof l=="number"?[l,null]:l;(p=h.current)==null||p.setSelectionRange(m[0],m[1])}},[l]);const b=d.useCallback(p=>{p.key==="Enter"&&p.shiftKey&&i===!0||(r==null||r(p))},[i,r]);return d.createElement(p1,{className:"gdg-growing-entry"},d.createElement(g1,{className:c},C+`
3
- `),d.createElement(f1,{...a,className:(c??"")+" gdg-input",id:y,ref:h,onKeyDown:b,value:C,placeholder:t,dir:"auto"}))},Vi={};let hr=null;function Ui(e){const t=e.toLowerCase().trim();if(Vi[t]!==void 0)return Vi[t];hr=hr||function(){const i=document.createElement("div");return i.style.opacity="0",i.style.pointerEvents="none",i.style.position="fixed",document.body.append(i),i}(),hr.style.color="#000",hr.style.color=t;const n=getComputedStyle(hr).color;hr.style.color="#fff",hr.style.color=t;const r=getComputedStyle(hr).color;if(r!==n)return[0,0,0,1];let o=r.replace(/[^\d.,]/g,"").split(",").map(Number.parseFloat);return o.length<4&&o.push(1),o=o.map(i=>Number.isNaN(i)?0:i),Vi[t]=o,o}function Hr(e,t){const[n,r,o]=Ui(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const Xc=new Map;function Gc(e,t){const n=`${e}-${t}`,r=Xc.get(n);if(r!==void 0)return r;const o=In(e,t);return Xc.set(n,o),o}function In(e,t){if(t===void 0)return e;const[n,r,o,i]=Ui(e);if(i===1)return e;const[l,a,s,c]=Ui(t),h=i+c*(1-i);return`rgba(${(i*n+c*l*(1-i))/h}, ${(i*r+c*a*(1-i))/h}, ${(i*o+c*s*(1-i))/h}, ${h})`}var Xr=new Map,Gr=new Map,qi=new Map;function po(e,t,n,r){var o,i;let l=Gr.get(n);if(r&&l!==void 0&&l.count>2e4){let c=qi.get(n);if(c===void 0&&(c=function(C,y){var b;let p=new Map,m=0;for(let x of"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-+=?"){let I=C.measureText(x).width;p.set(x,I),m+=I}let E=m/p.size,g=(y/E+3)/4,w=p.keys();for(let x of w)p.set(x,((b=p.get(x))!=null?b:E)*g);return p}(e,l.size),qi.set(n,c)),l.count>5e5){let C=0;for(let y of t)C+=(o=c.get(y))!=null?o:l.size;return 1.01*C}let h=e.measureText(t);return function(C,y,b,p,m){var E,g,w;let x=0,I={};for(let M of C)x+=(E=b.get(M))!=null?E:m,I[M]=((g=I[M])!=null?g:0)+1;let v=y-x;for(let M of Object.keys(I)){let S=I[M],H=(w=b.get(M))!=null?w:m,f=H+v*(H*S/x)*p/S;b.set(M,f)}}(t,h.width,c,Math.max(.05,1-l.count/2e5),l.size),Gr.set(n,{count:l.count+t.length,size:l.size}),h.width}let a=e.measureText(t),s=a.width/t.length;if(((i=l==null?void 0:l.count)!=null?i:0)>2e4)return a.width;if(l===void 0)Gr.set(n,{count:t.length,size:s});else{let c=s-l.size,h=t.length/(l.count+t.length),C=l.size+c*h;Gr.set(n,{count:l.count+t.length,size:C})}return a.width}function m1(e,t,n,r,o,i,l,a){if(t.length<=1)return t.length;if(o<n)return-1;let s=Math.floor(n/o*i),c=po(e,t.slice(0,Math.max(0,s)),r,l);if(c!==n)if(c<n){for(;c<n;)s++,c=po(e,t.slice(0,Math.max(0,s)),r,l);s--}else for(;c>n;){let h=t.lastIndexOf(" ",s-1);h>0?s=h:s--,c=po(e,t.slice(0,Math.max(0,s)),r,l)}if(t[s]!==" "){let h=0;h=t.lastIndexOf(" ",s),h>0&&(s=h)}return s}function mo(e,t){return(e??"")===(t??"")}function Yc(e,t){const[n,r]=e;return n>=t.x&&n<t.x+t.width&&r>=t.y&&r<t.y+t.height}function vo(e,t){return(e==null?void 0:e[0])===(t==null?void 0:t[0])&&(e==null?void 0:e[1])===(t==null?void 0:t[1])}function Kc(e){return[e.x+e.width-1,e.y+e.height-1]}function Vc(e,t,n){const r=n.x,o=n.x+n.width-1,i=n.y,l=n.y+n.height-1,[a,s]=e;if(s<i||s>l)return!1;if(t.span===void 0)return a>=r&&a<=o;const[c,h]=t.span;return c>=r&&c<=o||h>=r&&c<=o||c<r&&h>o}function Uc(e,t){let n=e;if(t!==void 0){let r=[...e];const o=n[t.src];t.src>t.dest?(r.splice(t.src,1),r.splice(t.dest,0,o)):(r.splice(t.dest+1,0,o),r.splice(t.src,1)),r=r.map((i,l)=>({...i,sticky:e[l].sticky})),n=r}return n}function Yr(e,t){let n=0;const r=Uc(e,t);for(let o=0;o<r.length;o++){const i=r[o];if(!i.sticky)break;n+=i.width}return n}function Or(e,t,n){if(typeof n=="number")return t*n;{let r=0;for(let o=e-t;o<e;o++)r+=n(o);return r}}function Qi(e,t,n,r,o){const i=Uc(e,r),l=[];for(const c of i){if(!c.sticky)break;l.push(c)}if(l.length>0)for(const c of l)n-=c.width;let a=t,s=o??0;for(;s<=n&&a<i.length;)s+=i[a].width,a++;for(let c=t;c<a;c++){const h=i[c];h.sticky||l.push(h)}return l}let ii=0,wo={};const v1=typeof window>"u";function qc(e,t,n,r){return`${e}_${r??(t==null?void 0:t.font)}_${n}`}function Kr(e,t,n,r="middle"){const o=qc(e,t,r,n);let i=wo[o];return i===void 0&&(i=t.measureText(e),wo[o]=i,ii++),ii>1e4&&(wo={},ii=0),i}function Qc(e,t){const n=qc(e,void 0,"middle",t);return wo[n]}function fr(e,t){return typeof t!="string"&&(t=t.baseFontFull),function(n,r){for(const a of Zc)if(a.key===r)return a.val;const o=Jc(n,"alphabetic"),i=Jc(n,"middle"),l=-(i.actualBoundingBoxDescent-o.actualBoundingBoxDescent)+o.actualBoundingBoxAscent/2;return Zc.push({key:r,val:l}),l}(e,t)}function Jc(e,t){e.save(),e.textBaseline=t;const n=e.measureText("ABCDEFGHIJKLMNOPQRSTUVWXYZ");return e.restore(),n}(async function(){var e;v1||((e=document==null?void 0:document.fonts)==null?void 0:e.ready)===void 0||(await document.fonts.ready,ii=0,wo={},Xr.clear(),qi.clear(),Gr.clear())})();const Zc=[];function yo(e,t,n){const{ctx:r,theme:o}=e,i=t??{},l=n??o.textDark;return l!==i.fillStyle&&(r.fillStyle=l,i.fillStyle=l),i}function eu(e,t,n,r,o,i,l,a,s){s==="right"?e.fillText(t,n+o-(a.cellHorizontalPadding+.5),r+i/2+l):s==="center"?e.fillText(t,n+o/2,r+i/2+l):e.fillText(t,n+a.cellHorizontalPadding+.5,r+i/2+l)}function tu(e,t){const n=Kr("ABCi09jgqpy",e,t);return n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}function w1(e,t,n,r,o,i,l,a,s,c){const h=a.baseFontFull,C=function(w,x,I,v,M){let S=`${x}_${I}_${v}px`,H=Xr.get(S);if(H!==void 0)return H;if(v<=0)return[];let f=[],B=x.split(`
4
- `),D=Gr.get(I),O=D===void 0?x.length:v/D.size*1.5,T=M&&D!==void 0&&D.count>2e4;for(let j of B){let V=po(w,j.slice(0,Math.max(0,O)),I,T),Z=Math.min(j.length,O);if(V<=v)f.push(j);else{for(;V>v;){let Q=m1(w,j,v,I,V,Z,T),ce=j.slice(0,Math.max(0,Q));j=j.slice(ce.length),f.push(ce),V=po(w,j.slice(0,Math.max(0,O)),I,T),Z=Math.min(j.length,O)}V>0&&f.push(j)}}return f=f.map((j,V)=>V===0?j.trimEnd():j.trim()),Xr.set(S,f),Xr.size>500&&Xr.delete(Xr.keys().next().value),f}(e,t,h,o-2*a.cellHorizontalPadding,c??!1),y=tu(e,h),b=a.lineHeight*y,p=y+b*(C.length-1),m=p+a.cellVerticalPadding>i;m&&(e.save(),e.rect(n,r,o,i),e.clip());const E=r+i/2-p/2;let g=Math.max(r+a.cellVerticalPadding,E);for(const w of C)if(eu(e,w,n,g,o,y,l,a,s),g+=b,g>r+i)break;m&&e.restore()}function Jn(e,t,n,r,o){const{ctx:i,rect:l,theme:a}=e,{x:s,y:c,width:h,height:C}=l;(r=r??!1)||(t=function(p,m){p.includes(`
5
- `)&&(p=p.split(/\r?\n/,1)[0]);const E=m/4;return p.length>E&&(p=p.slice(0,E)),p}(t,h));const y=fr(i,a),b=Yi(t)==="rtl";if(n===void 0&&b&&(n="right"),b&&(i.direction="rtl"),t.length>0){let p=!1;n==="right"?(i.textAlign="right",p=!0):n!==void 0&&n!=="left"&&(i.textAlign=n,p=!0),r?w1(i,t,s,c,h,C,y,a,n,o):eu(i,t,s,c,h,C,y,a,n),p&&(i.textAlign="start"),b&&(i.direction="inherit")}}function Yn(e,t,n,r,o,i){typeof i=="number"&&(i={tl:i,tr:i,br:i,bl:i}),i={tl:Math.max(0,Math.min(i.tl,o/2,r/2)),tr:Math.max(0,Math.min(i.tr,o/2,r/2)),bl:Math.max(0,Math.min(i.bl,o/2,r/2)),br:Math.max(0,Math.min(i.br,o/2,r/2))},e.moveTo(t+i.tl,n),e.arcTo(t+r,n,t+r,n+i.tr,i.tr),e.arcTo(t+r,n+o,t+r-i.br,n+o,i.br),e.arcTo(t,n+o,t,n+o-i.bl,i.bl),e.arcTo(t,n,t+i.tl,n,i.tl)}function Ji(e,t,n,r,o,i,l,a,s,c,h,C,y,b,p){const m={x:0,y:i+c,width:0,height:0};if(e>=b.length||t>=h||t<-2||e<0)return m;const E=i-o;if(e>=C){const g=l>e?-1:1,w=Yr(b);m.x+=w+s;for(let x=l;x!==e;x+=g)m.x+=b[g===1?x:x-1].width*g}else for(let g=0;g<e;g++)m.x+=b[g].width;if(m.width=b[e].width+1,t===-1)m.y=o,m.height=E;else if(t===-2){m.y=0,m.height=o;let g=e;const w=b[e].group,x=b[e].sticky;for(;g>0&&mo(b[g-1].group,w)&&b[g-1].sticky===x;){const v=b[g-1];m.x-=v.width,m.width+=v.width,g--}let I=e;for(;I+1<b.length&&mo(b[I+1].group,w)&&b[I+1].sticky===x;){const v=b[I+1];m.width+=v.width,I++}if(!x){const v=Yr(b),M=m.x-v;M<0&&(m.x-=M,m.width+=M),m.x+m.width>n&&(m.width=n-m.x)}}else if(t>=h-y){let g=h-t;for(m.y=r;g>0;){const w=t+g-1;m.height=typeof p=="number"?p:p(w),m.y-=m.height,g--}m.height+=1}else{const g=a>t?-1:1;if(typeof p=="number"){const w=t-a;m.y+=w*p}else for(let w=a;w!==t;w+=g)m.y+=p(w)*g;m.height=(typeof p=="number"?p:p(t))+1}return m}const Zi=1<<21;function Ln(e,t){return(t+2)*Zi+e}function nu(e){return e%Zi}function ea(e){return Math.floor(e/Zi)-2}function ta(e){return[nu(e),ea(e)]}class ru{constructor(){ft(this,"visibleWindow",{x:0,y:0,width:0,height:0});ft(this,"freezeCols",0);ft(this,"freezeRows",[]);ft(this,"isInWindow",t=>{const n=nu(t),r=ea(t),o=this.visibleWindow,i=n>=o.x&&n<=o.x+o.width||n<this.freezeCols,l=r>=o.y&&r<=o.y+o.height||this.freezeRows.includes(r);return i&&l})}setWindow(t,n,r){this.visibleWindow.x===t.x&&this.visibleWindow.y===t.y&&this.visibleWindow.width===t.width&&this.visibleWindow.height===t.height&&this.freezeCols===n&&$r(this.freezeRows,r)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=r,this.clearOutOfWindow())}}class y1 extends ru{constructor(){super(...arguments);ft(this,"cache",new Map);ft(this,"setValue",(n,r)=>{this.cache.set(Ln(n[0],n[1]),r)});ft(this,"getValue",n=>this.cache.get(Ln(n[0],n[1])));ft(this,"clearOutOfWindow",()=>{for(const[n]of this.cache.entries())this.isInWindow(n)||this.cache.delete(n)})}}class bo{constructor(t=[]){ft(this,"cells");this.cells=new Set(t.map(n=>Ln(n[0],n[1])))}add(t){this.cells.add(Ln(t[0],t[1]))}has(t){return t!==void 0&&this.cells.has(Ln(t[0],t[1]))}remove(t){this.cells.delete(Ln(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(ea(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n<t.y+t.height;n++)for(let r=t.x;r<t.x+t.width;r++)if(this.cells.has(Ln(r,n)))return!0;return!1}hasItemInRegion(t){for(const n of t)if(this.hasItemInRectangle(n))return!0;return!1}*values(){for(const t of this.cells)yield ta(t)}}Xa=function(e){return{"--gdg-accent-color":e.accentColor,"--gdg-accent-fg":e.accentFg,"--gdg-accent-light":e.accentLight,"--gdg-text-dark":e.textDark,"--gdg-text-medium":e.textMedium,"--gdg-text-light":e.textLight,"--gdg-text-bubble":e.textBubble,"--gdg-bg-icon-header":e.bgIconHeader,"--gdg-fg-icon-header":e.fgIconHeader,"--gdg-text-header":e.textHeader,"--gdg-text-group-header":e.textGroupHeader??e.textHeader,"--gdg-bg-group-header":e.bgGroupHeader??e.bgHeader,"--gdg-bg-group-header-hovered":e.bgGroupHeaderHovered??e.bgHeaderHovered,"--gdg-text-header-selected":e.textHeaderSelected,"--gdg-bg-cell":e.bgCell,"--gdg-bg-cell-medium":e.bgCellMedium,"--gdg-bg-header":e.bgHeader,"--gdg-bg-header-has-focus":e.bgHeaderHasFocus,"--gdg-bg-header-hovered":e.bgHeaderHovered,"--gdg-bg-bubble":e.bgBubble,"--gdg-bg-bubble-selected":e.bgBubbleSelected,"--gdg-bubble-height":`${e.bubbleHeight}px`,"--gdg-bubble-padding":`${e.bubblePadding}px`,"--gdg-bubble-margin":`${e.bubbleMargin}px`,"--gdg-bg-search-result":e.bgSearchResult,"--gdg-border-color":e.borderColor,"--gdg-horizontal-border-color":e.horizontalBorderColor??e.borderColor,"--gdg-drilldown-border":e.drilldownBorder,"--gdg-link-color":e.linkColor,"--gdg-cell-horizontal-padding":`${e.cellHorizontalPadding}px`,"--gdg-cell-vertical-padding":`${e.cellVerticalPadding}px`,"--gdg-header-font-style":e.headerFontStyle,"--gdg-base-font-style":e.baseFontStyle,"--gdg-marker-font-style":e.markerFontStyle,"--gdg-font-family":e.fontFamily,"--gdg-editor-font-size":e.editorFontSize,"--gdg-checkbox-max-size":`${e.checkboxMaxSize}px`,...e.resizeIndicatorColor===void 0?{}:{"--gdg-resize-indicator-color":e.resizeIndicatorColor},...e.headerBottomBorderColor===void 0?{}:{"--gdg-header-bottom-border-color":e.headerBottomBorderColor},...e.roundingRadius===void 0?{}:{"--gdg-rounding-radius":`${e.roundingRadius}px`}}};const ou={accentColor:"#4F5DFF",accentFg:"#FFFFFF",accentLight:"rgba(62, 116, 253, 0.1)",textDark:"#313139",textMedium:"#737383",textLight:"#B2B2C0",textBubble:"#313139",bgIconHeader:"#737383",fgIconHeader:"#FFFFFF",textHeader:"#313139",textGroupHeader:"#313139BB",textHeaderSelected:"#FFFFFF",bgCell:"#FFFFFF",bgCellMedium:"#FAFAFB",bgHeader:"#F7F7F8",bgHeaderHasFocus:"#E9E9EB",bgHeaderHovered:"#EFEFF1",bgBubble:"#EDEDF3",bgBubbleSelected:"#FFFFFF",bubbleHeight:20,bubblePadding:6,bubbleMargin:4,bgSearchResult:"#fff9e3",borderColor:"rgba(115, 116, 131, 0.16)",drilldownBorder:"rgba(0, 0, 0, 0)",linkColor:"#353fb5",cellHorizontalPadding:8,cellVerticalPadding:3,headerIconSize:18,headerFontStyle:"600 13px",baseFontStyle:"13px",markerFontStyle:"9px",fontFamily:"Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif",editorFontSize:"13px",lineHeight:1.4,checkboxMaxSize:18};function iu(){return ou}Wa=$t.createContext(ou);function Zn(e,...t){const n={...e};for(const r of t)if(r!==void 0)for(const o in r)r.hasOwnProperty(o)&&(n[o]=o==="bgCell"?In(r[o],n[o]):r[o]);return n.headerFontFull!==void 0&&e.fontFamily===n.fontFamily&&e.headerFontStyle===n.headerFontStyle||(n.headerFontFull=`${n.headerFontStyle} ${n.fontFamily}`),n.baseFontFull!==void 0&&e.fontFamily===n.fontFamily&&e.baseFontStyle===n.baseFontStyle||(n.baseFontFull=`${n.baseFontStyle} ${n.fontFamily}`),n.markerFontFull!==void 0&&e.fontFamily===n.fontFamily&&e.markerFontStyle===n.markerFontStyle||(n.markerFontFull=`${n.markerFontStyle} ${n.fontFamily}`),n}function au(e,t,n,r,o,i,l,a,s){let c=0;const h=o===void 0?[]:o.map(b=>{const p=function(m,E,g,w){var I;const x=w(E);return((I=x==null?void 0:x.measure)==null?void 0:I.call(x,m,E,g))??150}(e,b[r],t,s);return c=Math.max(c,p),p});if(h.length>5&&a){c=0;let b=0;for(const m of h)b+=m;const p=b/h.length;for(let m=0;m<h.length;m++)h[m]>=2*p?h[m]=0:c=Math.max(c,h[m])}const C=e.font;e.font=t.headerFontFull,c=Math.max(c,e.measureText(n.title).width+2*t.cellHorizontalPadding+(n.icon===void 0?0:28)),e.font=C;const y=Math.max(Math.ceil(i),Math.min(Math.floor(l),Math.ceil(c)));return{...n,width:y}}var lu,su,cu,uu;const On=Sr(function(){if(uu)return cu;uu=1;var e=su?lu:(su=1,lu=function(n,r,o){return n==n&&(o!==void 0&&(n=n<=o?n:o),r!==void 0&&(n=n>=r?n:r)),n}),t=Xi();return cu=function(n,r,o){return o===void 0&&(o=r,r=void 0),o!==void 0&&(o=(o=t(o))==o?o:0),r!==void 0&&(r=(r=t(r))==r?r:0),e(t(n),r,o)}}());var du,hu,fu,gu,pu,mu,vu,wu,yu,bu,xu,Cu,Su,ku,Mu,Ru,Eu,Iu,na,Tu,Hu,Ou,Pu,Du,zu,Au,Fu,Lu,_u,ju,Nu,Bu;function Wu(){if(mu)return pu;mu=1;var e=Fi(),t=hu?du:(hu=1,du=function(o){return this.__data__.set(o,"__lodash_hash_undefined__"),this}),n=gu?fu:(gu=1,fu=function(o){return this.__data__.has(o)});function r(o){var i=-1,l=o==null?0:o.length;for(this.__data__=new e;++i<l;)this.add(o[i])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,pu=r}function b1(){if(ku)return Su;ku=1;var e=wu?vu:(wu=1,vu=function(r,o,i,l){for(var a=r.length,s=i+(l?1:-1);l?s--:++s<a;)if(o(r[s],s,r))return s;return-1}),t=bu?yu:(bu=1,yu=function(r){return r!=r}),n=Cu?xu:(Cu=1,xu=function(r,o,i){for(var l=i-1,a=r.length;++l<a;)if(r[l]===o)return l;return-1});return Su=function(r,o,i){return o==o?n(r,o,i):e(r,t,i)}}function $u(){return Tu||(Tu=1,na=function(e,t){return e.has(t)}),na}function Xu(){if(Ou)return Hu;Ou=1;var e=Ir()(Gn(),"Set");return Hu=e}function ra(){return Au?zu:(Au=1,zu=function(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n})}function x1(){if(Lu)return Fu;Lu=1;var e=Xu(),t=Du?Pu:(Du=1,Pu=function(){}),n=ra(),r=e&&1/n(new e([,-0]))[1]==1/0?function(o){return new e(o)}:t;return Fu=r}function C1(){if(ju)return _u;ju=1;var e=Wu(),t=function(){if(Ru)return Mu;Ru=1;var l=b1();return Mu=function(a,s){return!(a==null||!a.length)&&l(a,s,0)>-1}}(),n=Iu?Eu:(Iu=1,Eu=function(l,a,s){for(var c=-1,h=l==null?0:l.length;++c<h;)if(s(a,l[c]))return!0;return!1}),r=$u(),o=x1(),i=ra();return _u=function(l,a,s){var c=-1,h=t,C=l.length,y=!0,b=[],p=b;if(s)y=!1,h=n;else if(C>=200){var m=a?null:o(l);if(m)return i(m);y=!1,h=r,p=new e}else p=a?[]:b;e:for(;++c<C;){var E=l[c],g=a?a(E):E;if(E=s||E!==0?E:0,y&&g==g){for(var w=p.length;w--;)if(p[w]===g)continue e;a&&p.push(g),b.push(E)}else h(p,g,s)||(p!==b&&p.push(g),b.push(E))}return b}}const S1=Sr(function(){if(Bu)return Nu;Bu=1;var e=C1();return Nu=function(t){return t&&t.length?e(t):[]}}());var Gu,Yu,Ku,Vu,oa,Uu,qu,Qu;function Ju(){return Yu?Gu:(Yu=1,Gu=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e})}function k1(){if(Uu)return oa;Uu=1;var e=Ju(),t=function(){if(Vu)return Ku;Vu=1;var n=oo(),r=Li(),o=Xn(),i=n?n.isConcatSpreadable:void 0;return Ku=function(l){return o(l)||r(l)||!!(i&&l&&l[i])}}();return oa=function n(r,o,i,l,a){var s=-1,c=r.length;for(i||(i=t),a||(a=[]);++s<c;){var h=r[s];o>0&&i(h)?o>1?n(h,o-1,i,l,a):e(a,h):l||(a[a.length]=h)}return a},oa}const Zu=Sr(function(){if(Qu)return qu;Qu=1;var e=k1();return qu=function(t){return t!=null&&t.length?e(t,1):[]}}());var ed,td,nd,rd,od,id,ad,ld,sd,cd,ud,dd;function ia(){if(rd)return nd;rd=1;var e=Ks(),t=ji();return nd=function(n){return n!=null&&t(n.length)&&!e(n)}}function M1(){if(cd)return sd;cd=1;var e=function(){if(td)return ed;td=1;var r=Math.ceil,o=Math.max;return ed=function(i,l,a,s){for(var c=-1,h=o(r((l-i)/(a||1)),0),C=Array(h);h--;)C[s?h:++c]=i,i+=a;return C}}(),t=function(){if(id)return od;id=1;var r=zi(),o=ia(),i=_i(),l=Er();return od=function(a,s,c){if(!l(c))return!1;var h=typeof s;return!!(h=="number"?o(c)&&i(s,c.length):h=="string"&&s in c)&&r(c[s],a)}}(),n=function(){if(ld)return ad;ld=1;var r=Xi(),o=1/0;return ad=function(i){return i?(i=r(i))===o||i===-1/0?17976931348623157e292*(i<0?-1:1):i==i?i:0:i===0?i:0}}();return sd=function(r){return function(o,i,l){return l&&typeof l!="number"&&t(o,i,l)&&(i=l=void 0),o=n(o),i===void 0?(i=o,o=0):i=n(i),l=l===void 0?o<i?1:-1:n(l),e(o,i,l,r)}}}var R1=function(){if(dd)return ud;dd=1;var e=M1()();return ud=e}();const Pr=Sr(R1),Pt='<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">',hd=e=>{const t=e.fgColor,n=e.bgColor;return`${Pt}
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor-BFMjRfym.js","./index-CSPyN4cW.js","./index-DmaoBTfT.css","./trash-Dpszkgwx.js","./number-overlay-editor-Dns19i7x.js"])))=>i.map(i=>d[i]);
2
+ var Lp=Object.defineProperty;var _p=(ur,$n,Rr)=>$n in ur?Lp(ur,$n,{enumerable:!0,configurable:!0,writable:!0,value:Rr}):ur[$n]=Rr;var ft=(ur,$n,Rr)=>_p(ur,typeof $n!="symbol"?$n+"":$n,Rr);import{gD as Ti,z as Sr,U as d,gE as Fa,aF as Go,aG as jp,b as $t,gF as Np,an as L0,fh as _0,L as La,a as j0,j as nt,dl as Bp,gG as Wp,gH as N0,gI as $p,bp as _a,bn as B0,a6 as ja,gJ as W0,gK as $0,gL as X0,gM as Xp,dr as Gp,dn as Yp,dm as Kp,dp as Vp,am as Up,gN as qp,dz as Jp,gO as Hi,aS as Na,aN as Qp,bc as Zp,eY as G0,a_ as Y0,b1 as em,b2 as tm,ad as nm,ab as rm,ac as om,__tla as im}from"./index-CSPyN4cW.js";import{T as am}from"./trash-Dpszkgwx.js";let Ba,Wa,kr,$a,K0,Mr,Xa,Cn,lm=Promise.all([(()=>{try{return im}catch{}})()]).then(async()=>{var ur,$n,Rr,Ga,Ya,Ka,Va,Ua,qa,Ja,Qa,Za,el,tl,nl,rl,ol,il,al,ll,sl,cl,ul,dl,hl,fl,gl,pl,ml,vl,wl,yl,bl,xl,Cl,Sl,kl,Ml,Rl,El,Il,Tl,Hl,Ol,Pl,Dl,zl,Al,Fl,Ll,_l,jl,Nl,Bl,Wl,$l,Xl,Gl,Yl,Kl,Vl,Ul,ql,Jl,Ql,Zl,es,ts,ns,rs,os,is,as,ls,ss,cs,us,ds,hs,fs,gs,ps,ms,vs,ws,ys,bs,xs,Oi,Cs,Ss,ks,Ms,Rs,Pi,Es,Is,Ts,Hs,Os,Ps,Ds,zs,As,Fs,Ls,_s,js,Ns,Bs,Ws,$s,Xs,Gs;function Xn(){if(Ga)return Rr;Ga=1;var e=Array.isArray;return Rr=e}function Ys(){if(Ka)return Ya;Ka=1;var e=typeof Ti=="object"&&Ti&&Ti.Object===Object&&Ti;return Ya=e}function Gn(){if(Ua)return Va;Ua=1;var e=Ys(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Va=n}function oo(){if(Ja)return qa;Ja=1;var e=Gn().Symbol;return qa=e}function io(){if(rl)return nl;rl=1;var e=oo(),t=function(){if(Za)return Qa;Za=1;var o=oo(),i=Object.prototype,l=i.hasOwnProperty,a=i.toString,s=o?o.toStringTag:void 0;return Qa=function(c){var h=l.call(c,s),C=c[s];try{c[s]=void 0;var y=!0}catch{}var b=a.call(c);return y&&(h?c[s]=C:delete c[s]),b}}(),n=function(){if(tl)return el;tl=1;var o=Object.prototype.toString;return el=function(i){return o.call(i)}}(),r=e?e.toStringTag:void 0;return nl=function(o){return o==null?o===void 0?"[object Undefined]":"[object Null]":r&&r in Object(o)?t(o):n(o)}}function ao(){return il?ol:(il=1,ol=function(e){return e!=null&&typeof e=="object"})}function Yo(){if(ll)return al;ll=1;var e=io(),t=ao();return al=function(n){return typeof n=="symbol"||t(n)&&e(n)=="[object Symbol]"}}function Di(){if(cl)return sl;cl=1;var e=Xn(),t=Yo(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;return sl=function(o,i){if(e(o))return!1;var l=typeof o;return!(l!="number"&&l!="symbol"&&l!="boolean"&&o!=null&&!t(o))||r.test(o)||!n.test(o)||i!=null&&o in Object(i)}}function Er(){return dl?ul:(dl=1,ul=function(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")})}function Ks(){if(fl)return hl;fl=1;var e=io(),t=Er();return hl=function(n){if(!t(n))return!1;var r=e(n);return r=="[object Function]"||r=="[object GeneratorFunction]"||r=="[object AsyncFunction]"||r=="[object Proxy]"}}function V0(){if(vl)return ml;vl=1;var e,t=function(){if(pl)return gl;pl=1;var r=Gn()["__core-js_shared__"];return gl=r}(),n=(e=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"";return ml=function(r){return!!n&&n in r}}function Vs(){if(yl)return wl;yl=1;var e=Function.prototype.toString;return wl=function(t){if(t!=null){try{return e.call(t)}catch{}try{return t+""}catch{}}return""}}function Ir(){if(Ml)return kl;Ml=1;var e=function(){if(xl)return bl;xl=1;var n=Ks(),r=V0(),o=Er(),i=Vs(),l=/^\[object .+?Constructor\]$/,a=Function.prototype,s=Object.prototype,c=a.toString,h=s.hasOwnProperty,C=RegExp("^"+c.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return bl=function(y){return!(!o(y)||r(y))&&(n(y)?C:l).test(i(y))}}(),t=Sl?Cl:(Sl=1,Cl=function(n,r){return n==null?void 0:n[r]});return kl=function(n,r){var o=t(n,r);return e(o)?o:void 0}}function Ko(){if(El)return Rl;El=1;var e=Ir()(Object,"create");return Rl=e}function U0(){if(jl)return _l;jl=1;var e=function(){if(Tl)return Il;Tl=1;var l=Ko();return Il=function(){this.__data__=l?l(null):{},this.size=0}}(),t=Ol?Hl:(Ol=1,Hl=function(l){var a=this.has(l)&&delete this.__data__[l];return this.size-=a?1:0,a}),n=function(){if(Dl)return Pl;Dl=1;var l=Ko(),a=Object.prototype.hasOwnProperty;return Pl=function(s){var c=this.__data__;if(l){var h=c[s];return h==="__lodash_hash_undefined__"?void 0:h}return a.call(c,s)?c[s]:void 0}}(),r=function(){if(Al)return zl;Al=1;var l=Ko(),a=Object.prototype.hasOwnProperty;return zl=function(s){var c=this.__data__;return l?c[s]!==void 0:a.call(c,s)}}(),o=function(){if(Ll)return Fl;Ll=1;var l=Ko();return Fl=function(a,s){var c=this.__data__;return this.size+=this.has(a)?0:1,c[a]=l&&s===void 0?"__lodash_hash_undefined__":s,this}}();function i(l){var a=-1,s=l==null?0:l.length;for(this.clear();++a<s;){var c=l[a];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,_l=i}function zi(){return $l?Wl:($l=1,Wl=function(e,t){return e===t||e!=e&&t!=t})}function Vo(){if(Gl)return Xl;Gl=1;var e=zi();return Xl=function(t,n){for(var r=t.length;r--;)if(e(t[r][0],n))return r;return-1}}function Uo(){if(ts)return es;ts=1;var e=Bl?Nl:(Bl=1,Nl=function(){this.__data__=[],this.size=0}),t=function(){if(Kl)return Yl;Kl=1;var l=Vo(),a=Array.prototype.splice;return Yl=function(s){var c=this.__data__,h=l(c,s);return!(h<0||(h==c.length-1?c.pop():a.call(c,h,1),--this.size,0))}}(),n=function(){if(Ul)return Vl;Ul=1;var l=Vo();return Vl=function(a){var s=this.__data__,c=l(s,a);return c<0?void 0:s[c][1]}}(),r=function(){if(Jl)return ql;Jl=1;var l=Vo();return ql=function(a){return l(this.__data__,a)>-1}}(),o=function(){if(Zl)return Ql;Zl=1;var l=Vo();return Ql=function(a,s){var c=this.__data__,h=l(c,a);return h<0?(++this.size,c.push([a,s])):c[h][1]=s,this}}();function i(l){var a=-1,s=l==null?0:l.length;for(this.clear();++a<s;){var c=l[a];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,es=i}function Ai(){if(rs)return ns;rs=1;var e=Ir()(Gn(),"Map");return ns=e}function qo(){if(cs)return ss;cs=1;var e=ls?as:(ls=1,as=function(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null});return ss=function(t,n){var r=t.__data__;return e(n)?r[typeof n=="string"?"string":"hash"]:r.map}}function Fi(){if(ys)return ws;ys=1;var e=function(){if(is)return os;is=1;var l=U0(),a=Uo(),s=Ai();return os=function(){this.size=0,this.__data__={hash:new l,map:new(s||a),string:new l}}}(),t=function(){if(ds)return us;ds=1;var l=qo();return us=function(a){var s=l(this,a).delete(a);return this.size-=s?1:0,s}}(),n=function(){if(fs)return hs;fs=1;var l=qo();return hs=function(a){return l(this,a).get(a)}}(),r=function(){if(ps)return gs;ps=1;var l=qo();return gs=function(a){return l(this,a).has(a)}}(),o=function(){if(vs)return ms;vs=1;var l=qo();return ms=function(a,s){var c=l(this,a),h=c.size;return c.set(a,s),this.size+=c.size==h?0:1,this}}();function i(l){var a=-1,s=l==null?0:l.length;for(this.clear();++a<s;){var c=l[a];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,ws=i}function q0(){if(Cs)return Oi;Cs=1;var e=function(){if(xs)return bs;xs=1;var t=Fi();function n(r,o){if(typeof r!="function"||o!=null&&typeof o!="function")throw new TypeError("Expected a function");var i=function(){var l=arguments,a=o?o.apply(this,l):l[0],s=i.cache;if(s.has(a))return s.get(a);var c=r.apply(this,l);return i.cache=s.set(a,c)||s,c};return i.cache=new(n.Cache||t),i}return n.Cache=t,bs=n}();return Oi=function(t){var n=e(t,function(o){return r.size===500&&r.clear(),o}),r=n.cache;return n},Oi}function J0(){if(Es)return Pi;Es=1;var e=oo(),t=Rs?Ms:(Rs=1,Ms=function(l,a){for(var s=-1,c=l==null?0:l.length,h=Array(c);++s<c;)h[s]=a(l[s],s,l);return h}),n=Xn(),r=Yo(),o=e?e.prototype:void 0,i=o?o.toString:void 0;return Pi=function l(a){if(typeof a=="string")return a;if(n(a))return t(a,l)+"";if(r(a))return i?i.call(a):"";var s=a+"";return s=="0"&&1/a==-1/0?"-0":s},Pi}function Us(){if(Os)return Hs;Os=1;var e=Xn(),t=Di(),n=function(){if(ks)return Ss;ks=1;var o=q0(),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,l=/\\(\\)?/g,a=o(function(s){var c=[];return s.charCodeAt(0)===46&&c.push(""),s.replace(i,function(h,C,y,b){c.push(y?b.replace(l,"$1"):C||h)}),c});return Ss=a}(),r=function(){if(Ts)return Is;Ts=1;var o=J0();return Is=function(i){return i==null?"":o(i)}}();return Hs=function(o,i){return e(o)?o:t(o,i)?[o]:n(r(o))}}function Li(){if(As)return zs;As=1;var e=function(){if(Ds)return Ps;Ds=1;var l=io(),a=ao();return Ps=function(s){return a(s)&&l(s)=="[object Arguments]"}}(),t=ao(),n=Object.prototype,r=n.hasOwnProperty,o=n.propertyIsEnumerable,i=e(function(){return arguments}())?e:function(l){return t(l)&&r.call(l,"callee")&&!o.call(l,"callee")};return zs=i}function _i(){if(Ls)return Fs;Ls=1;var e=/^(?:0|[1-9]\d*)$/;return Fs=function(t,n){var r=typeof t;return!!(n=n??9007199254740991)&&(r=="number"||r!="symbol"&&e.test(t))&&t>-1&&t%1==0&&t<n}}function ji(){return js?_s:(js=1,_s=function(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=9007199254740991})}function Jo(){if(Bs)return Ns;Bs=1;var e=Yo();return Ns=function(t){if(typeof t=="string"||e(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}}function qs(){if($s)return Ws;$s=1;var e=Us(),t=Li(),n=Xn(),r=_i(),o=ji(),i=Jo();return Ws=function(l,a,s){for(var c=-1,h=(a=e(a,l)).length,C=!1;++c<h;){var y=i(a[c]);if(!(C=l!=null&&s(l,y)))break;l=l[y]}return C||++c!=h?C:!!(h=l==null?0:l.length)&&o(h)&&r(y,h)&&(n(l)||t(l))}}const Q0=Sr(function(){if(Gs)return Xs;Gs=1;var e=function(){if($n)return ur;$n=1;var n=Object.prototype.hasOwnProperty;return ur=function(r,o){return r!=null&&n.call(r,o)}}(),t=qs();return Xs=function(n,r){return n!=null&&t(n,r,e)}}());function Js(e="This should not happen"){throw new Error(e)}function Rn(e,t="Assertion failed"){if(!e)return Js(t)}function lo(e,t){return Js(t??"Hell froze over")}const Qs=Object.prototype.hasOwnProperty;function $r(e,t){let n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&$r(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){for(n in r=0,e)if(Qs.call(e,n)&&++r&&!Qs.call(t,n)||!(n in t)||!$r(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!=e&&t!=t}const Qo=null,Ni=void 0;var me,Jn,Zo,Hn;function ei(e){return"width"in e&&typeof e.width=="number"}async function Zs(e){return typeof e=="object"?e:await e()}Mr=function(e){return e.kind!==me.Loading&&e.kind!==me.Bubble&&e.kind!==me.RowID&&e.kind!==me.Protected&&e.kind!==me.Drilldown},kr=function(e){return e.kind===Hn.Marker||e.kind===Hn.NewRow};function so(e){if(!Mr(e)||e.kind===me.Image)return!1;switch(e.kind){case me.Text:case me.Number:case me.Markdown:case me.Uri:case me.Custom:case me.Boolean:return e.readonly!==!0;default:lo(0,"A cell was passed with an invalid kind")}}$a=function(e){return Q0(e,"editor")};function Bi(e){return!e.readonly}let ec;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(me||(me={})),function(e){e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay"}(Jn||(Jn={})),function(e){e.Triangle="triangle",e.Dots="dots"}(Zo||(Zo={})),function(e){e.NewRow="new-row",e.Marker="marker"}(Hn||(Hn={}));const er=class er{constructor(t){ft(this,"items");this.items=t}offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new er(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=function(o){if(o.length===0)return[];const i=[...o],l=[];i.sort(function(a,s){return a[0]-s[0]}),l.push([...i[0]]);for(const a of i.slice(1)){const s=l[l.length-1];s[1]<a[0]?l.push([...a]):s[1]<a[1]&&(s[1]=a[1])}return l}([...this.items,n]);return new er(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],o=typeof t=="number"?t+1:t[1];for(const[i,l]of n.entries()){const[a,s]=l;if(a<=o&&r<=s){const c=[];a<r&&c.push([a,r]),o<s&&c.push([o,s]),n.splice(i,1,...c)}}return new er(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,o]=this.items[n];if(t>=r&&t<o)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],o=this.items[n];if(r[0]!==o[0]||r[1]!==o[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let o=n;o<r;o++)t.push(o);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}};ft(er,"empty",()=>ec??(ec=new er([]))),ft(er,"fromSingleSelection",t=>er.empty().add(t));let yt=er;var tc=function(){const e=Array.prototype.slice.call(arguments).filter(Boolean),t={},n=[];e.forEach(o=>{(o?o.split(" "):[]).forEach(i=>{if(i.startsWith("atm_")){const[,l]=i.split("_");t[l]=i}else n.push(i)})});const r=[];for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.push(t[o]);return r.push(...n),r.join(" ")},nc=(e,t)=>{const n={};return Object.keys(e).filter((r=>o=>r.indexOf(o)===-1)(t)).forEach(r=>{n[r]=e[r]}),n},Z0=(e,t)=>{};Cn=function(e){let t="";return n=>{const r=(i,l)=>{const{as:a=e,class:s=t}=i;var c;const h=function(y,b,p){const m=nc(b,p);if(!y){const E=typeof Fa=="function"?{default:Fa}:Fa;Object.keys(m).forEach(g=>{E.default(g)||delete m[g]})}return m}(n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&(c=a[0],c.toUpperCase()!==c)):n.propsAsIs,i,["as","class"]);h.ref=l,h.className=n.atomic?tc(n.class,h.className||s):tc(h.className||s,n.class);const{vars:C}=n;if(C){const y={};for(const m in C){const E=C[m],g=E[0],w=E[1]||"",x=typeof g=="function"?g(i):g;Z0(0,n.name),y[`--${m}`]=`${x}${w}`}const b=h.style||{},p=Object.keys(b);p.length>0&&p.forEach(m=>{y[m]=b[m]}),h.style=y}return e.__wyw_meta&&e!==a?(h.as=a,d.createElement(e,h)):d.createElement(a,h)},o=d.forwardRef?d.forwardRef(r):i=>{const l=nc(i,["innerRef"]);return r(l,i.innerRef)};return o.displayName=n.name,o.__wyw_meta={className:n.class||t,extends:e},o}};const e1=Cn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var rc,oc,ic={},co={},ac={},lc={};function t1(){return rc||(rc=1,function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.setHasSupportToCaptureOption=b;var r=i(t),o=i(n);function i(g){return g&&g.__esModule?g:{default:g}}var l=Object.assign||function(g){for(var w=1;w<arguments.length;w++){var x=arguments[w];for(var I in x)Object.prototype.hasOwnProperty.call(x,I)&&(g[I]=x[I])}return g};function a(g,w){var x={};for(var I in g)w.indexOf(I)>=0||Object.prototype.hasOwnProperty.call(g,I)&&(x[I]=g[I]);return x}function s(g,w){if(!(g instanceof w))throw new TypeError("Cannot call a class as a function")}var c=function(){function g(w,x){for(var I=0;I<x.length;I++){var v=x[I];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(w,v.key,v)}}return function(w,x,I){return x&&g(w.prototype,x),I&&g(w,I),w}}();function h(g,w){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!w||typeof w!="object"&&typeof w!="function"?g:w}function C(g,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);g.prototype=Object.create(w&&w.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(g,w):g.__proto__=w)}var y=!1;function b(g){y=g}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){b(!0)}}))}catch{}function p(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return y?g:g.capture}function m(g){if("touches"in g){var w=g.touches[0];return{x:w.pageX,y:w.pageY}}return{x:g.screenX,y:g.screenY}}var E=function(g){function w(){var x;s(this,w);for(var I=arguments.length,v=Array(I),M=0;M<I;M++)v[M]=arguments[M];var S=h(this,(x=w.__proto__||Object.getPrototypeOf(w)).call.apply(x,[this].concat(v)));return S._handleSwipeStart=S._handleSwipeStart.bind(S),S._handleSwipeMove=S._handleSwipeMove.bind(S),S._handleSwipeEnd=S._handleSwipeEnd.bind(S),S._onMouseDown=S._onMouseDown.bind(S),S._onMouseMove=S._onMouseMove.bind(S),S._onMouseUp=S._onMouseUp.bind(S),S._setSwiperRef=S._setSwiperRef.bind(S),S}return C(w,g),c(w,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(x){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(x))}},{key:"_onMouseMove",value:function(x){this.mouseDown&&this._handleSwipeMove(x)}},{key:"_onMouseUp",value:function(x){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(x)}},{key:"_handleSwipeStart",value:function(x){var I=m(x),v=I.x,M=I.y;this.moveStart={x:v,y:M},this.props.onSwipeStart(x)}},{key:"_handleSwipeMove",value:function(x){if(this.moveStart){var I=m(x),v=I.x,M=I.y,S=v-this.moveStart.x,H=M-this.moveStart.y;this.moving=!0,this.props.onSwipeMove({x:S,y:H},x)&&x.cancelable&&x.preventDefault(),this.movePosition={deltaX:S,deltaY:H}}}},{key:"_handleSwipeEnd",value:function(x){this.props.onSwipeEnd(x);var I=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-I?this.props.onSwipeLeft(1,x):this.movePosition.deltaX>I&&this.props.onSwipeRight(1,x),this.movePosition.deltaY<-I?this.props.onSwipeUp(1,x):this.movePosition.deltaY>I&&this.props.onSwipeDown(1,x)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(x){this.swiper=x,this.props.innerRef(x)}},{key:"render",value:function(){var x=this.props;x.tagName;var I=x.className,v=x.style,M=x.children;x.allowMouseEvents,x.onSwipeUp,x.onSwipeDown,x.onSwipeLeft,x.onSwipeRight,x.onSwipeStart,x.onSwipeMove,x.onSwipeEnd,x.innerRef,x.tolerance;var S=a(x,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return r.default.createElement(this.props.tagName,l({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:I,style:v},S),M)}}]),w}(t.Component);E.displayName="ReactSwipe",E.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},E.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},e.default=E}(lc,Go(),jp())),lc}function sc(){return oc||(oc=1,function(e,t){Object.defineProperty(e,"__esModule",{value:!0});var n=r(t);function r(o){return o&&o.__esModule?o:{default:o}}e.default=n.default}(ac,t1())),ac}var cc,uc,uo={},dc={exports:{}};function hc(){if(uc)return uo;uc=1,Object.defineProperty(uo,"__esModule",{value:!0}),uo.default=void 0;var e,t,n=(cc||(cc=1,t=dc,function(){var o={}.hasOwnProperty;function i(){for(var s="",c=0;c<arguments.length;c++){var h=arguments[c];h&&(s=a(s,l(h)))}return s}function l(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return i.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var c="";for(var h in s)o.call(s,h)&&s[h]&&(c=a(c,h));return c}function a(s,c){return c?s?s+" "+c:s+c:s}t.exports?(i.default=i,t.exports=i):window.classNames=i}()),(e=dc.exports)&&e.__esModule?e:{default:e}),r={ROOT:function(o){return(0,n.default)(function(i,l,a){return l in i?Object.defineProperty(i,l,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[l]=a,i}({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,n.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,i){return(0,n.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":i==="horizontal","axis-vertical":i!=="horizontal"})},SLIDER:function(o,i){return(0,n.default)({thumbs:!o,slider:o,animated:!i})},ITEM:function(o,i,l){return(0,n.default)({thumb:!o,slide:o,selected:i,previous:l})},ARROW_PREV:function(o){return(0,n.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,n.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,n.default)({dot:!0,selected:o})}};return uo.default=r,uo}var fc,ho={},ti={},gc,fo={};function Wi(){return gc?fo:(gc=1,Object.defineProperty(fo,"__esModule",{value:!0}),fo.default=void 0,fo.default=function(e,t,n){var r=e===0?e:e+t;return"translate3d"+("("+(n==="horizontal"?[r,0,0]:[0,r,0]).join(",")+")")},fo)}var pc,mc,go={};function vc(){return pc?go:(pc=1,Object.defineProperty(go,"__esModule",{value:!0}),go.default=void 0,go.default=function(){return window},go)}function wc(){if(mc)return ho;mc=1,Object.defineProperty(ho,"__esModule",{value:!0}),ho.default=void 0;var e=function(g){if(g&&g.__esModule)return g;if(g===null||s(g)!=="object"&&typeof g!="function")return{default:g};var w=a();if(w&&w.has(g))return w.get(g);var x={},I=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in g)if(Object.prototype.hasOwnProperty.call(g,v)){var M=I?Object.getOwnPropertyDescriptor(g,v):null;M&&(M.get||M.set)?Object.defineProperty(x,v,M):x[v]=g[v]}return x.default=g,w&&w.set(g,x),x}(Go()),t=l(hc()),n=(fc||(fc=1,Object.defineProperty(ti,"__esModule",{value:!0}),ti.outerWidth=void 0,ti.outerWidth=function(g){var w=g.offsetWidth,x=getComputedStyle(g);return w+(parseInt(x.marginLeft)+parseInt(x.marginRight))}),ti),r=l(Wi()),o=l(sc()),i=l(vc());function l(g){return g&&g.__esModule?g:{default:g}}function a(){if(typeof WeakMap!="function")return null;var g=new WeakMap;return a=function(){return g},g}function s(g){return s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},s(g)}function c(){return c=Object.assign||function(g){for(var w=1;w<arguments.length;w++){var x=arguments[w];for(var I in x)Object.prototype.hasOwnProperty.call(x,I)&&(g[I]=x[I])}return g},c.apply(this,arguments)}function h(g,w,x){return w&&function(I,v){for(var M=0;M<v.length;M++){var S=v[M];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(I,S.key,S)}}(g.prototype,w),g}function C(g,w){return C=Object.setPrototypeOf||function(x,I){return x.__proto__=I,x},C(g,w)}function y(g){var w=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var x,I=p(g);if(w){var v=p(this).constructor;x=Reflect.construct(I,arguments,v)}else x=I.apply(this,arguments);return function(M,S){return S&&(s(S)==="object"||typeof S=="function")?S:b(M)}(this,x)}}function b(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function p(g){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(w){return w.__proto__||Object.getPrototypeOf(w)},p(g)}function m(g,w,x){return w in g?Object.defineProperty(g,w,{value:x,enumerable:!0,configurable:!0,writable:!0}):g[w]=x,g}var E=function(g){(function(I,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(v&&v.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),v&&C(I,v)})(x,g);var w=y(x);function x(I){var v;return function(M,S){if(!(M instanceof S))throw new TypeError("Cannot call a class as a function")}(this,x),m(b(v=w.call(this,I)),"itemsWrapperRef",void 0),m(b(v),"itemsListRef",void 0),m(b(v),"thumbsRef",void 0),m(b(v),"setItemsWrapperRef",function(M){v.itemsWrapperRef=M}),m(b(v),"setItemsListRef",function(M){v.itemsListRef=M}),m(b(v),"setThumbsRef",function(M,S){v.thumbsRef||(v.thumbsRef=[]),v.thumbsRef[S]=M}),m(b(v),"updateSizes",function(){if(v.props.children&&v.itemsWrapperRef&&v.thumbsRef){var M=e.Children.count(v.props.children),S=v.itemsWrapperRef.clientWidth,H=v.props.thumbWidth?v.props.thumbWidth:(0,n.outerWidth)(v.thumbsRef[0]),f=Math.floor(S/H),B=f<M,D=B?M-f:0;v.setState(function(O,T){return{itemSize:H,visibleItems:f,firstItem:B?v.getFirstItem(T.selectedItem):0,lastPosition:D,showArrows:B}})}}),m(b(v),"handleClickItem",function(M,S,H){if(!function(B){return B.hasOwnProperty("key")}(H)||H.key==="Enter"){var f=v.props.onSelectItem;typeof f=="function"&&f(M,S)}}),m(b(v),"onSwipeStart",function(){v.setState({swiping:!0})}),m(b(v),"onSwipeEnd",function(){v.setState({swiping:!1})}),m(b(v),"onSwipeMove",function(M){var S=M.x;if(!v.state.itemSize||!v.itemsWrapperRef||!v.state.visibleItems)return!1;var H=e.Children.count(v.props.children),f=-100*v.state.firstItem/v.state.visibleItems;f===0&&S>0&&(S=0),f===100*-Math.max(H-v.state.visibleItems,0)/v.state.visibleItems&&S<0&&(S=0);var B=f+100/(v.itemsWrapperRef.clientWidth/S);return v.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(D){v.itemsListRef.style[D]=(0,r.default)(B,"%",v.props.axis)}),!0}),m(b(v),"slideRight",function(M){v.moveTo(v.state.firstItem-(typeof M=="number"?M:1))}),m(b(v),"slideLeft",function(M){v.moveTo(v.state.firstItem+(typeof M=="number"?M:1))}),m(b(v),"moveTo",function(M){M=(M=M<0?0:M)>=v.state.lastPosition?v.state.lastPosition:M,v.setState({firstItem:M})}),v.state={selectedItem:I.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},v}return h(x,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(I){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==I.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,i.default)().addEventListener("resize",this.updateSizes),(0,i.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,i.default)().removeEventListener("resize",this.updateSizes),(0,i.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(I){var v=I;return I>=this.state.lastPosition&&(v=this.state.lastPosition),I<this.state.firstItem+this.state.visibleItems&&(v=this.state.firstItem),I<this.state.firstItem&&(v=I),v}},{key:"renderItems",value:function(){var I=this;return this.props.children.map(function(v,M){var S=t.default.ITEM(!1,M===I.state.selectedItem),H={key:M,ref:function(f){return I.setThumbsRef(f,M)},className:S,onClick:I.handleClickItem.bind(I,M,I.props.children[M]),onKeyDown:I.handleClickItem.bind(I,M,I.props.children[M]),"aria-label":"".concat(I.props.labels.item," ").concat(M+1),style:{width:I.props.thumbWidth}};return e.default.createElement("li",c({},H,{role:"button",tabIndex:0}),v)})}},{key:"render",value:function(){var I=this;if(!this.props.children)return null;var v,M=e.Children.count(this.props.children)>1,S=this.state.showArrows&&this.state.firstItem>0,H=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,f=-this.state.firstItem*(this.state.itemSize||0),B=(0,r.default)(f,"px",this.props.axis),D=this.props.transitionTime+"ms";return v={WebkitTransform:B,MozTransform:B,MsTransform:B,OTransform:B,transform:B,msTransform:B,WebkitTransitionDuration:D,MozTransitionDuration:D,MsTransitionDuration:D,OTransitionDuration:D,transitionDuration:D,msTransitionDuration:D},e.default.createElement("div",{className:t.default.CAROUSEL(!1)},e.default.createElement("div",{className:t.default.WRAPPER(!1),ref:this.setItemsWrapperRef},e.default.createElement("button",{type:"button",className:t.default.ARROW_PREV(!S),onClick:function(){return I.slideRight()},"aria-label":this.props.labels.leftArrow}),M?e.default.createElement(o.default,{tagName:"ul",className:t.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:v,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(O){return I.setItemsListRef(O)},style:v},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!H),onClick:function(){return I.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),x}(e.Component);return ho.default=E,m(E,"displayName","Thumbs"),m(E,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),ho}var yc,ni={},bc,En={};function xc(){if(bc)return En;bc=1,Object.defineProperty(En,"__esModule",{value:!0}),En.setPosition=En.getPosition=En.isKeyboardEvent=En.defaultStatusFormatter=En.noop=void 0;var e,t=Go(),n=(e=Wi())&&e.__esModule?e:{default:e};return En.noop=function(){},En.defaultStatusFormatter=function(r,o){return"".concat(r," of ").concat(o)},En.isKeyboardEvent=function(r){return!!r&&r.hasOwnProperty("key")},En.getPosition=function(r,o){if(o.infiniteLoop&&++r,r===0)return 0;var i=t.Children.count(o.children);if(o.centerMode&&o.axis==="horizontal"){var l=-r*o.centerSlidePercentage,a=i-1;return r&&(r!==a||o.infiniteLoop)?l+=(100-o.centerSlidePercentage)/2:r===a&&(l+=100-o.centerSlidePercentage),l}return 100*-r},En.setPosition=function(r,o){var i={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(l){i[l]=(0,n.default)(r,"%",o)}),i},En}var Cc,Sc,Fn={};function n1(){if(Sc)return co;Sc=1,Object.defineProperty(co,"__esModule",{value:!0}),co.default=void 0;var e=function(v){if(v&&v.__esModule)return v;if(v===null||h(v)!=="object"&&typeof v!="function")return{default:v};var M=c();if(M&&M.has(v))return M.get(v);var S={},H=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in v)if(Object.prototype.hasOwnProperty.call(v,f)){var B=H?Object.getOwnPropertyDescriptor(v,f):null;B&&(B.get||B.set)?Object.defineProperty(S,f,B):S[f]=v[f]}return S.default=v,M&&M.set(v,S),S}(Go()),t=s(sc()),n=s(hc()),r=s(wc()),o=s((yc||(yc=1,Object.defineProperty(ni,"__esModule",{value:!0}),ni.default=void 0,ni.default=function(){return document}),ni)),i=s(vc()),l=xc(),a=function(){if(Cc)return Fn;Cc=1,Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.fadeAnimationHandler=Fn.slideStopSwipingHandler=Fn.slideSwipeAnimationHandler=Fn.slideAnimationHandler=void 0;var v,M=Go(),S=(v=Wi())&&v.__esModule?v:{default:v},H=xc();function f(O,T){var j=Object.keys(O);if(Object.getOwnPropertySymbols){var V=Object.getOwnPropertySymbols(O);T&&(V=V.filter(function(Z){return Object.getOwnPropertyDescriptor(O,Z).enumerable})),j.push.apply(j,V)}return j}function B(O){for(var T=1;T<arguments.length;T++){var j=arguments[T]!=null?arguments[T]:{};T%2?f(Object(j),!0).forEach(function(V){D(O,V,j[V])}):Object.getOwnPropertyDescriptors?Object.defineProperties(O,Object.getOwnPropertyDescriptors(j)):f(Object(j)).forEach(function(V){Object.defineProperty(O,V,Object.getOwnPropertyDescriptor(j,V))})}return O}function D(O,T,j){return T in O?Object.defineProperty(O,T,{value:j,enumerable:!0,configurable:!0,writable:!0}):O[T]=j,O}return Fn.slideAnimationHandler=function(O,T){var j={},V=T.selectedItem,Z=V,J=M.Children.count(O.children)-1;if(O.infiniteLoop&&(V<0||V>J))return Z<0?O.centerMode&&O.centerSlidePercentage&&O.axis==="horizontal"?j.itemListStyle=(0,H.setPosition)(-(J+2)*O.centerSlidePercentage-(100-O.centerSlidePercentage)/2,O.axis):j.itemListStyle=(0,H.setPosition)(100*-(J+2),O.axis):Z>J&&(j.itemListStyle=(0,H.setPosition)(0,O.axis)),j;var ce=(0,H.getPosition)(V,O),le=(0,S.default)(ce,"%",O.axis),q=O.transitionTime+"ms";return j.itemListStyle={WebkitTransform:le,msTransform:le,OTransform:le,transform:le},T.swiping||(j.itemListStyle=B(B({},j.itemListStyle),{},{WebkitTransitionDuration:q,MozTransitionDuration:q,OTransitionDuration:q,transitionDuration:q,msTransitionDuration:q})),j},Fn.slideSwipeAnimationHandler=function(O,T,j,V){var Z={},J=T.axis==="horizontal",ce=M.Children.count(T.children),le=(0,H.getPosition)(j.selectedItem,T),q=T.infiniteLoop?(0,H.getPosition)(ce-1,T)-100:(0,H.getPosition)(ce-1,T),Q=J?O.x:O.y,fe=Q;le===0&&Q>0&&(fe=0),le===q&&Q<0&&(fe=0);var ee=le+100/(j.itemSize/fe),se=Math.abs(Q)>T.swipeScrollTolerance;return T.infiniteLoop&&se&&(j.selectedItem===0&&ee>-100?ee-=100*ce:j.selectedItem===ce-1&&ee<100*-ce&&(ee+=100*ce)),(!T.preventMovementUntilSwipeScrollTolerance||se||j.swipeMovementStarted)&&(j.swipeMovementStarted||V({swipeMovementStarted:!0}),Z.itemListStyle=(0,H.setPosition)(ee,T.axis)),se&&!j.cancelClick&&V({cancelClick:!0}),Z},Fn.slideStopSwipingHandler=function(O,T){var j=(0,H.getPosition)(T.selectedItem,O);return{itemListStyle:(0,H.setPosition)(j,O.axis)}},Fn.fadeAnimationHandler=function(O,T){var j=O.transitionTime+"ms",V="ease-in-out",Z={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:V,msTransitionTimingFunction:V,MozTransitionTimingFunction:V,WebkitTransitionTimingFunction:V,OTransitionTimingFunction:V};return T.swiping||(Z=B(B({},Z),{},{WebkitTransitionDuration:j,MozTransitionDuration:j,OTransitionDuration:j,transitionDuration:j,msTransitionDuration:j})),{slideStyle:Z,selectedStyle:B(B({},Z),{},{opacity:1,position:"relative"}),prevStyle:B({},Z)}},Fn}();function s(v){return v&&v.__esModule?v:{default:v}}function c(){if(typeof WeakMap!="function")return null;var v=new WeakMap;return c=function(){return v},v}function h(v){return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(M){return typeof M}:function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},h(v)}function C(){return C=Object.assign||function(v){for(var M=1;M<arguments.length;M++){var S=arguments[M];for(var H in S)Object.prototype.hasOwnProperty.call(S,H)&&(v[H]=S[H])}return v},C.apply(this,arguments)}function y(v,M){var S=Object.keys(v);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(v);M&&(H=H.filter(function(f){return Object.getOwnPropertyDescriptor(v,f).enumerable})),S.push.apply(S,H)}return S}function b(v){for(var M=1;M<arguments.length;M++){var S=arguments[M]!=null?arguments[M]:{};M%2?y(Object(S),!0).forEach(function(H){x(v,H,S[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(S)):y(Object(S)).forEach(function(H){Object.defineProperty(v,H,Object.getOwnPropertyDescriptor(S,H))})}return v}function p(v,M,S){return M&&function(H,f){for(var B=0;B<f.length;B++){var D=f[B];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(H,D.key,D)}}(v.prototype,M),v}function m(v,M){return m=Object.setPrototypeOf||function(S,H){return S.__proto__=H,S},m(v,M)}function E(v){var M=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var S,H=w(v);if(M){var f=w(this).constructor;S=Reflect.construct(H,arguments,f)}else S=H.apply(this,arguments);return function(B,D){return D&&(h(D)==="object"||typeof D=="function")?D:g(B)}(this,S)}}function g(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function w(v){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(M){return M.__proto__||Object.getPrototypeOf(M)},w(v)}function x(v,M,S){return M in v?Object.defineProperty(v,M,{value:S,enumerable:!0,configurable:!0,writable:!0}):v[M]=S,v}var I=function(v){(function(H,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");H.prototype=Object.create(f&&f.prototype,{constructor:{value:H,writable:!0,configurable:!0}}),f&&m(H,f)})(S,v);var M=E(S);function S(H){var f;(function(D,O){if(!(D instanceof O))throw new TypeError("Cannot call a class as a function")})(this,S),x(g(f=M.call(this,H)),"thumbsRef",void 0),x(g(f),"carouselWrapperRef",void 0),x(g(f),"listRef",void 0),x(g(f),"itemsRef",void 0),x(g(f),"timer",void 0),x(g(f),"animationHandler",void 0),x(g(f),"setThumbsRef",function(D){f.thumbsRef=D}),x(g(f),"setCarouselWrapperRef",function(D){f.carouselWrapperRef=D}),x(g(f),"setListRef",function(D){f.listRef=D}),x(g(f),"setItemsRef",function(D,O){f.itemsRef||(f.itemsRef=[]),f.itemsRef[O]=D}),x(g(f),"autoPlay",function(){e.Children.count(f.props.children)<=1||(f.clearAutoPlay(),f.props.autoPlay&&(f.timer=setTimeout(function(){f.increment()},f.props.interval)))}),x(g(f),"clearAutoPlay",function(){f.timer&&clearTimeout(f.timer)}),x(g(f),"resetAutoPlay",function(){f.clearAutoPlay(),f.autoPlay()}),x(g(f),"stopOnHover",function(){f.setState({isMouseEntered:!0},f.clearAutoPlay)}),x(g(f),"startOnLeave",function(){f.setState({isMouseEntered:!1},f.autoPlay)}),x(g(f),"isFocusWithinTheCarousel",function(){return!!f.carouselWrapperRef&&!((0,o.default)().activeElement!==f.carouselWrapperRef&&!f.carouselWrapperRef.contains((0,o.default)().activeElement))}),x(g(f),"navigateWithKeyboard",function(D){if(f.isFocusWithinTheCarousel()){var O=f.props.axis==="horizontal",T=O?37:38;(O?39:40)===D.keyCode?f.increment():T===D.keyCode&&f.decrement()}}),x(g(f),"updateSizes",function(){if(f.state.initialized&&f.itemsRef&&f.itemsRef.length!==0){var D=f.props.axis==="horizontal",O=f.itemsRef[0];if(O){var T=D?O.clientWidth:O.clientHeight;f.setState({itemSize:T}),f.thumbsRef&&f.thumbsRef.updateSizes()}}}),x(g(f),"setMountState",function(){f.setState({hasMount:!0}),f.updateSizes()}),x(g(f),"handleClickItem",function(D,O){e.Children.count(f.props.children)!==0&&(f.state.cancelClick?f.setState({cancelClick:!1}):(f.props.onClickItem(D,O),D!==f.state.selectedItem&&f.setState({selectedItem:D})))}),x(g(f),"handleOnChange",function(D,O){e.Children.count(f.props.children)<=1||f.props.onChange(D,O)}),x(g(f),"handleClickThumb",function(D,O){f.props.onClickThumb(D,O),f.moveTo(D)}),x(g(f),"onSwipeStart",function(D){f.setState({swiping:!0}),f.props.onSwipeStart(D)}),x(g(f),"onSwipeEnd",function(D){f.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),f.props.onSwipeEnd(D),f.clearAutoPlay(),f.state.autoPlay&&f.autoPlay()}),x(g(f),"onSwipeMove",function(D,O){f.props.onSwipeMove(O);var T=f.props.swipeAnimationHandler(D,f.props,f.state,f.setState.bind(g(f)));return f.setState(b({},T)),!!Object.keys(T).length}),x(g(f),"decrement",function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;f.moveTo(f.state.selectedItem-(typeof D=="number"?D:1))}),x(g(f),"increment",function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;f.moveTo(f.state.selectedItem+(typeof D=="number"?D:1))}),x(g(f),"moveTo",function(D){if(typeof D=="number"){var O=e.Children.count(f.props.children)-1;D<0&&(D=f.props.infiniteLoop?O:0),D>O&&(D=f.props.infiniteLoop?0:O),f.selectItem({selectedItem:D}),f.state.autoPlay&&f.state.isMouseEntered===!1&&f.resetAutoPlay()}}),x(g(f),"onClickNext",function(){f.increment(1)}),x(g(f),"onClickPrev",function(){f.decrement(1)}),x(g(f),"onSwipeForward",function(){f.increment(1),f.props.emulateTouch&&f.setState({cancelClick:!0})}),x(g(f),"onSwipeBackwards",function(){f.decrement(1),f.props.emulateTouch&&f.setState({cancelClick:!0})}),x(g(f),"changeItem",function(D){return function(O){(0,l.isKeyboardEvent)(O)&&O.key!=="Enter"||f.moveTo(D)}}),x(g(f),"selectItem",function(D){f.setState(b({previousItem:f.state.selectedItem},D),function(){f.setState(f.animationHandler(f.props,f.state))}),f.handleOnChange(D.selectedItem,e.Children.toArray(f.props.children)[D.selectedItem])}),x(g(f),"getInitialImage",function(){var D=f.props.selectedItem,O=f.itemsRef&&f.itemsRef[D];return(O&&O.getElementsByTagName("img")||[])[0]}),x(g(f),"getVariableItemHeight",function(D){var O=f.itemsRef&&f.itemsRef[D];if(f.state.hasMount&&O&&O.children.length){var T=O.children[0].getElementsByTagName("img")||[];if(T.length>0){var j=T[0];j.complete||j.addEventListener("load",function Z(){f.forceUpdate(),j.removeEventListener("load",Z)})}var V=(T[0]||O.children[0]).clientHeight;return V>0?V:null}return null});var B={initialized:!1,previousItem:H.selectedItem,selectedItem:H.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:H.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return f.animationHandler=typeof H.animationHandler=="function"&&H.animationHandler||H.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,f.state=b(b({},B),f.animationHandler(H,B)),f}return p(S,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(H,f){H.children||!this.props.children||this.state.initialized||this.setupCarousel(),!H.autoFocus&&this.props.autoFocus&&this.forceFocus(),f.swiping&&!this.state.swiping&&this.setState(b({},this.props.stopSwipingHandler(this.props,this.state))),H.selectedItem===this.props.selectedItem&&H.centerMode===this.props.centerMode||(this.updateSizes(),this.moveTo(this.props.selectedItem)),H.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var H=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var f=H.getInitialImage();f&&!f.complete?f.addEventListener("load",H.setMountState):H.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var H=this.carouselWrapperRef;this.props.stopOnHover&&H&&(H.addEventListener("mouseenter",this.stopOnHover),H.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var H=this.carouselWrapperRef;this.props.stopOnHover&&H&&(H.removeEventListener("mouseenter",this.stopOnHover),H.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,i.default)().addEventListener("resize",this.updateSizes),(0,i.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,o.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,i.default)().removeEventListener("resize",this.updateSizes),(0,i.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var H=this.getInitialImage();H&&H.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,o.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var H;(H=this.carouselWrapperRef)===null||H===void 0||H.focus()}},{key:"renderItems",value:function(H){var f=this;return this.props.children?e.Children.map(this.props.children,function(B,D){var O=D===f.state.selectedItem,T=D===f.state.previousItem,j=O&&f.state.selectedStyle||T&&f.state.prevStyle||f.state.slideStyle||{};f.props.centerMode&&f.props.axis==="horizontal"&&(j=b(b({},j),{},{minWidth:f.props.centerSlidePercentage+"%"})),f.state.swiping&&f.state.swipeMovementStarted&&(j=b(b({},j),{},{pointerEvents:"none"}));var V={ref:function(Z){return f.setItemsRef(Z,D)},key:"itemKey"+D+(H?"clone":""),className:n.default.ITEM(!0,D===f.state.selectedItem,D===f.state.previousItem),onClick:f.handleClickItem.bind(f,D,B),style:j};return e.default.createElement("li",V,f.props.renderItem(B,{isSelected:D===f.state.selectedItem,isPrevious:D===f.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var H=this,f=this.props,B=f.showIndicators,D=f.labels,O=f.renderIndicator,T=f.children;return B?e.default.createElement("ul",{className:"control-dots"},e.Children.map(T,function(j,V){return O&&O(H.changeItem(V),V===H.state.selectedItem,V,D.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return this.props.showThumbs&&this.props.children&&e.Children.count(this.props.children)!==0?e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children)):null}},{key:"render",value:function(){var H=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var f=this.props.swipeable&&e.Children.count(this.props.children)>1,B=this.props.axis==="horizontal",D=this.props.showArrows&&e.Children.count(this.props.children)>1,O=D&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,T=D&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,j=this.renderItems(!0),V=j.shift(),Z=j.pop(),J={className:n.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},ce={};if(B){if(J.onSwipeLeft=this.onSwipeForward,J.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var le=this.getVariableItemHeight(this.state.selectedItem);ce.height=le||"auto"}}else J.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,J.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,J.style=b(b({},J.style),{},{height:this.state.itemSize}),ce.height=this.state.itemSize;return e.default.createElement("div",{"aria-label":this.props.ariaLabel,className:n.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},e.default.createElement("div",{className:n.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,O,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:ce},f?e.default.createElement(t.default,C({tagName:"ul",innerRef:this.setListRef},J,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&Z,this.renderItems(),this.props.infiniteLoop&&V):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(q){return H.setListRef(q)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&Z,this.renderItems(),this.props.infiniteLoop&&V)),this.props.renderArrowNext(this.onClickNext,T,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),S}(e.default.Component);return co.default=I,x(I,"displayName","Carousel"),x(I,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:l.noop,onClickThumb:l.noop,onChange:l.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(v,M,S){return e.default.createElement("button",{type:"button","aria-label":S,className:n.default.ARROW_PREV(!M),onClick:v})},renderArrowNext:function(v,M,S){return e.default.createElement("button",{type:"button","aria-label":S,className:n.default.ARROW_NEXT(!M),onClick:v})},renderIndicator:function(v,M,S,H){return e.default.createElement("li",{className:n.default.DOT(M),onClick:v,onKeyDown:v,value:S,key:S,role:"button",tabIndex:0,"aria-label":"".concat(H," ").concat(S+1)})},renderItem:function(v){return v},renderThumbs:function(v){var M=e.Children.map(v,function(S){var H=S;if(S.type!=="img"&&(H=e.Children.toArray(S.props.children).find(function(f){return f.type==="img"})),H)return H});return M.filter(function(S){return S}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):M},statusFormatter:l.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:a.slideSwipeAnimationHandler,stopSwipingHandler:a.slideStopSwipingHandler}),co}var kc,Mc,r1={},Rc,Ec,Ic,Tc,Hc,Oc,Pc,Dc,$i,zc,o1=(Mc||(Mc=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=o(n1()),n=(kc||(kc=1),r1),r=o(wc());function o(i){return i&&i.__esModule?i:{default:i}}}(ic)),ic);function i1(){if(Oc)return Hc;Oc=1;var e=function(){if(Tc)return Ic;Tc=1;var n=/\s/;return Ic=function(r){for(var o=r.length;o--&&n.test(r.charAt(o)););return o}}(),t=/^\s+/;return Hc=function(n){return n&&n.slice(0,e(n)+1).replace(t,"")}}function Xi(){if(Dc)return Pc;Dc=1;var e=i1(),t=Er(),n=Yo(),r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,l=parseInt;return Pc=function(a){if(typeof a=="number")return a;if(n(a))return NaN;if(t(a)){var s=typeof a.valueOf=="function"?a.valueOf():a;a=t(s)?s+"":s}if(typeof a!="string")return a===0?a:+a;a=e(a);var c=o.test(a);return c||i.test(a)?l(a.slice(2),c?2:8):r.test(a)?NaN:+a}}function Ac(){if(zc)return $i;zc=1;var e=Er(),t=function(){if(Ec)return Rc;Ec=1;var i=Gn();return Rc=function(){return i.Date.now()}}(),n=Xi(),r=Math.max,o=Math.min;return $i=function(i,l,a){var s,c,h,C,y,b,p=0,m=!1,E=!1,g=!0;if(typeof i!="function")throw new TypeError("Expected a function");function w(S){var H=s,f=c;return s=c=void 0,p=S,C=i.apply(f,H)}function x(S){var H=S-b;return b===void 0||H>=l||H<0||E&&S-p>=h}function I(){var S=t();if(x(S))return v(S);y=setTimeout(I,function(H){var f=l-(H-b);return E?o(f,h-(H-p)):f}(S))}function v(S){return y=void 0,g&&s?w(S):(s=c=void 0,C)}function M(){var S=t(),H=x(S);if(s=arguments,c=this,b=S,H){if(y===void 0)return function(f){return p=f,y=setTimeout(I,l),m?w(f):C}(b);if(E)return clearTimeout(y),y=setTimeout(I,l),w(b)}return y===void 0&&(y=setTimeout(I,l)),C}return l=n(l)||0,e(a)&&(m=!!a.leading,h=(E="maxWait"in a)?r(n(a.maxWait)||0,l):h,g="trailing"in a?!!a.trailing:g),M.cancel=function(){y!==void 0&&clearTimeout(y),p=0,s=b=c=y=void 0},M.flush=function(){return y===void 0?C:v(t())},M},$i}const Fc=Sr(Ac());function cn(e,t,n,r,o=!1){const i=d.useRef();i.current=t,d.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const l=n,a=s=>{var c;(c=i.current)==null||c.call(l,s)};return l.addEventListener(e,a,{passive:r,capture:o}),()=>{l.removeEventListener(e,a,{capture:o})}},[e,n,r,o])}function dr(e,t){return e===void 0?void 0:t}const a1=Math.PI;function Lc(e){return e*a1/180}const _c=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),jc=(e,t,n,r,o)=>{switch(e){case"left":return Math.floor(t)+r+o/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-o/2}},Nc=(e,t,n)=>Math.min(e,t-2*n),Bc=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Gi=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),d.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},l1=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))},s1=new RegExp("^[^A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF]*[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]");function Yi(e){return s1.test(e)?"rtl":"not-rtl"}let ri;function Ki(){if(typeof document>"u")return 0;if(ri!==void 0)return ri;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),ri=n-r,ri}const Tr=Symbol();function c1(e){const t=d.useRef([Tr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=d.useState(e),[,o]=d.useState(),i=d.useCallback(a=>{const s=t.current[0];s!==Tr&&(a=typeof a=="function"?a(s):a)===s||(s!==Tr&&o({}),r(c=>typeof a=="function"?a(s===Tr?c:s):a),t.current[0]=Tr)},[]),l=d.useCallback(()=>{t.current[0]=Tr,o({})},[]);return[t.current[0]===Tr?n:t.current[0],i,l]}function Wc(e){if(e.length===0)return"";let t=0,n=0;for(const r of e){if(n+=r.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}const u1=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:o}=e,i=t.filter(a=>a!=="");if(i.length===0)return null;const l=i.length>1;return d.createElement(e1,{"data-testid":"GDG-default-image-overlay-editor"},d.createElement(o1.Carousel,{showArrows:l,showThumbs:!1,swipeable:l,emulateTouch:l,infiniteLoop:l},i.map(a=>{const s=(o==null?void 0:o(a))??d.createElement("img",{draggable:!1,src:a});return d.createElement("div",{className:"gdg-centering-container",key:a},s)})),n&&r&&d.createElement("button",{className:"gdg-edit-icon",onClick:r},d.createElement(Gi,null)))},d1=Cn("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class h1 extends $t.PureComponent{constructor(){super(...arguments);ft(this,"targetElement",null);ft(this,"containerRefHook",n=>{this.targetElement=n,this.renderMarkdownIntoDiv()})}renderMarkdownIntoDiv(){const{targetElement:n,props:r}=this;if(n===null)return;const{contents:o,createNode:i}=r,l=Np(o),a=document.createRange();a.selectNodeContents(n),a.deleteContents();let s=i==null?void 0:i(l);if(s===void 0){const h=document.createElement("template");h.innerHTML=l,s=h.content}n.append(s);const c=n.getElementsByTagName("a");for(const h of c)h.target="_blank",h.rel="noreferrer noopener"}render(){return this.renderMarkdownIntoDiv(),$t.createElement(d1,{ref:this.containerRefHook})}}const f1=Cn("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),g1=Cn("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),p1=Cn("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let $c=0;const oi=e=>{const{placeholder:t,value:n,onKeyDown:r,highlight:o,altNewline:i,validatedSelection:l,...a}=e,{onChange:s,className:c}=a,h=d.useRef(null),C=n??"";Rn(s!==void 0,"GrowingEntry must be a controlled input area");const[y]=d.useState(()=>"input-box-"+($c=($c+1)%1e7));d.useEffect(()=>{const p=h.current;if(p===null||p.disabled)return;const m=C.toString().length;p.focus(),p.setSelectionRange(o?0:m,m)},[]),d.useLayoutEffect(()=>{var p;if(l!==void 0){const m=typeof l=="number"?[l,null]:l;(p=h.current)==null||p.setSelectionRange(m[0],m[1])}},[l]);const b=d.useCallback(p=>{p.key==="Enter"&&p.shiftKey&&i===!0||(r==null||r(p))},[i,r]);return d.createElement(p1,{className:"gdg-growing-entry"},d.createElement(g1,{className:c},C+`
3
+ `),d.createElement(f1,{...a,className:(c??"")+" gdg-input",id:y,ref:h,onKeyDown:b,value:C,placeholder:t,dir:"auto"}))},Vi={};let hr=null;function Ui(e){const t=e.toLowerCase().trim();if(Vi[t]!==void 0)return Vi[t];hr=hr||function(){const i=document.createElement("div");return i.style.opacity="0",i.style.pointerEvents="none",i.style.position="fixed",document.body.append(i),i}(),hr.style.color="#000",hr.style.color=t;const n=getComputedStyle(hr).color;hr.style.color="#fff",hr.style.color=t;const r=getComputedStyle(hr).color;if(r!==n)return[0,0,0,1];let o=r.replace(/[^\d.,]/g,"").split(",").map(Number.parseFloat);return o.length<4&&o.push(1),o=o.map(i=>Number.isNaN(i)?0:i),Vi[t]=o,o}function Hr(e,t){const[n,r,o]=Ui(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const Xc=new Map;function Gc(e,t){const n=`${e}-${t}`,r=Xc.get(n);if(r!==void 0)return r;const o=In(e,t);return Xc.set(n,o),o}function In(e,t){if(t===void 0)return e;const[n,r,o,i]=Ui(e);if(i===1)return e;const[l,a,s,c]=Ui(t),h=i+c*(1-i);return`rgba(${(i*n+c*l*(1-i))/h}, ${(i*r+c*a*(1-i))/h}, ${(i*o+c*s*(1-i))/h}, ${h})`}var Xr=new Map,Gr=new Map,qi=new Map;function po(e,t,n,r){var o,i;let l=Gr.get(n);if(r&&l!==void 0&&l.count>2e4){let c=qi.get(n);if(c===void 0&&(c=function(C,y){var b;let p=new Map,m=0;for(let x of"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-+=?"){let I=C.measureText(x).width;p.set(x,I),m+=I}let E=m/p.size,g=(y/E+3)/4,w=p.keys();for(let x of w)p.set(x,((b=p.get(x))!=null?b:E)*g);return p}(e,l.size),qi.set(n,c)),l.count>5e5){let C=0;for(let y of t)C+=(o=c.get(y))!=null?o:l.size;return 1.01*C}let h=e.measureText(t);return function(C,y,b,p,m){var E,g,w;let x=0,I={};for(let M of C)x+=(E=b.get(M))!=null?E:m,I[M]=((g=I[M])!=null?g:0)+1;let v=y-x;for(let M of Object.keys(I)){let S=I[M],H=(w=b.get(M))!=null?w:m,f=H+v*(H*S/x)*p/S;b.set(M,f)}}(t,h.width,c,Math.max(.05,1-l.count/2e5),l.size),Gr.set(n,{count:l.count+t.length,size:l.size}),h.width}let a=e.measureText(t),s=a.width/t.length;if(((i=l==null?void 0:l.count)!=null?i:0)>2e4)return a.width;if(l===void 0)Gr.set(n,{count:t.length,size:s});else{let c=s-l.size,h=t.length/(l.count+t.length),C=l.size+c*h;Gr.set(n,{count:l.count+t.length,size:C})}return a.width}function m1(e,t,n,r,o,i,l,a){if(t.length<=1)return t.length;if(o<n)return-1;let s=Math.floor(n/o*i),c=po(e,t.slice(0,Math.max(0,s)),r,l);if(c!==n)if(c<n){for(;c<n;)s++,c=po(e,t.slice(0,Math.max(0,s)),r,l);s--}else for(;c>n;){let h=t.lastIndexOf(" ",s-1);h>0?s=h:s--,c=po(e,t.slice(0,Math.max(0,s)),r,l)}if(t[s]!==" "){let h=0;h=t.lastIndexOf(" ",s),h>0&&(s=h)}return s}function mo(e,t){return(e??"")===(t??"")}function Yc(e,t){const[n,r]=e;return n>=t.x&&n<t.x+t.width&&r>=t.y&&r<t.y+t.height}function vo(e,t){return(e==null?void 0:e[0])===(t==null?void 0:t[0])&&(e==null?void 0:e[1])===(t==null?void 0:t[1])}function Kc(e){return[e.x+e.width-1,e.y+e.height-1]}function Vc(e,t,n){const r=n.x,o=n.x+n.width-1,i=n.y,l=n.y+n.height-1,[a,s]=e;if(s<i||s>l)return!1;if(t.span===void 0)return a>=r&&a<=o;const[c,h]=t.span;return c>=r&&c<=o||h>=r&&c<=o||c<r&&h>o}function Uc(e,t){let n=e;if(t!==void 0){let r=[...e];const o=n[t.src];t.src>t.dest?(r.splice(t.src,1),r.splice(t.dest,0,o)):(r.splice(t.dest+1,0,o),r.splice(t.src,1)),r=r.map((i,l)=>({...i,sticky:e[l].sticky})),n=r}return n}function Yr(e,t){let n=0;const r=Uc(e,t);for(let o=0;o<r.length;o++){const i=r[o];if(!i.sticky)break;n+=i.width}return n}function Or(e,t,n){if(typeof n=="number")return t*n;{let r=0;for(let o=e-t;o<e;o++)r+=n(o);return r}}function Ji(e,t,n,r,o){const i=Uc(e,r),l=[];for(const c of i){if(!c.sticky)break;l.push(c)}if(l.length>0)for(const c of l)n-=c.width;let a=t,s=o??0;for(;s<=n&&a<i.length;)s+=i[a].width,a++;for(let c=t;c<a;c++){const h=i[c];h.sticky||l.push(h)}return l}let ii=0,wo={};const v1=typeof window>"u";function qc(e,t,n,r){return`${e}_${r??(t==null?void 0:t.font)}_${n}`}function Kr(e,t,n,r="middle"){const o=qc(e,t,r,n);let i=wo[o];return i===void 0&&(i=t.measureText(e),wo[o]=i,ii++),ii>1e4&&(wo={},ii=0),i}function Jc(e,t){const n=qc(e,void 0,"middle",t);return wo[n]}function fr(e,t){return typeof t!="string"&&(t=t.baseFontFull),function(n,r){for(const a of Zc)if(a.key===r)return a.val;const o=Qc(n,"alphabetic"),i=Qc(n,"middle"),l=-(i.actualBoundingBoxDescent-o.actualBoundingBoxDescent)+o.actualBoundingBoxAscent/2;return Zc.push({key:r,val:l}),l}(e,t)}function Qc(e,t){e.save(),e.textBaseline=t;const n=e.measureText("ABCDEFGHIJKLMNOPQRSTUVWXYZ");return e.restore(),n}(async function(){var e;v1||((e=document==null?void 0:document.fonts)==null?void 0:e.ready)===void 0||(await document.fonts.ready,ii=0,wo={},Xr.clear(),qi.clear(),Gr.clear())})();const Zc=[];function yo(e,t,n){const{ctx:r,theme:o}=e,i=t??{},l=n??o.textDark;return l!==i.fillStyle&&(r.fillStyle=l,i.fillStyle=l),i}function eu(e,t,n,r,o,i,l,a,s){s==="right"?e.fillText(t,n+o-(a.cellHorizontalPadding+.5),r+i/2+l):s==="center"?e.fillText(t,n+o/2,r+i/2+l):e.fillText(t,n+a.cellHorizontalPadding+.5,r+i/2+l)}function tu(e,t){const n=Kr("ABCi09jgqpy",e,t);return n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}function w1(e,t,n,r,o,i,l,a,s,c){const h=a.baseFontFull,C=function(w,x,I,v,M){let S=`${x}_${I}_${v}px`,H=Xr.get(S);if(H!==void 0)return H;if(v<=0)return[];let f=[],B=x.split(`
4
+ `),D=Gr.get(I),O=D===void 0?x.length:v/D.size*1.5,T=M&&D!==void 0&&D.count>2e4;for(let j of B){let V=po(w,j.slice(0,Math.max(0,O)),I,T),Z=Math.min(j.length,O);if(V<=v)f.push(j);else{for(;V>v;){let J=m1(w,j,v,I,V,Z,T),ce=j.slice(0,Math.max(0,J));j=j.slice(ce.length),f.push(ce),V=po(w,j.slice(0,Math.max(0,O)),I,T),Z=Math.min(j.length,O)}V>0&&f.push(j)}}return f=f.map((j,V)=>V===0?j.trimEnd():j.trim()),Xr.set(S,f),Xr.size>500&&Xr.delete(Xr.keys().next().value),f}(e,t,h,o-2*a.cellHorizontalPadding,c??!1),y=tu(e,h),b=a.lineHeight*y,p=y+b*(C.length-1),m=p+a.cellVerticalPadding>i;m&&(e.save(),e.rect(n,r,o,i),e.clip());const E=r+i/2-p/2;let g=Math.max(r+a.cellVerticalPadding,E);for(const w of C)if(eu(e,w,n,g,o,y,l,a,s),g+=b,g>r+i)break;m&&e.restore()}function Qn(e,t,n,r,o){const{ctx:i,rect:l,theme:a}=e,{x:s,y:c,width:h,height:C}=l;(r=r??!1)||(t=function(p,m){p.includes(`
5
+ `)&&(p=p.split(/\r?\n/,1)[0]);const E=m/4;return p.length>E&&(p=p.slice(0,E)),p}(t,h));const y=fr(i,a),b=Yi(t)==="rtl";if(n===void 0&&b&&(n="right"),b&&(i.direction="rtl"),t.length>0){let p=!1;n==="right"?(i.textAlign="right",p=!0):n!==void 0&&n!=="left"&&(i.textAlign=n,p=!0),r?w1(i,t,s,c,h,C,y,a,n,o):eu(i,t,s,c,h,C,y,a,n),p&&(i.textAlign="start"),b&&(i.direction="inherit")}}function Yn(e,t,n,r,o,i){typeof i=="number"&&(i={tl:i,tr:i,br:i,bl:i}),i={tl:Math.max(0,Math.min(i.tl,o/2,r/2)),tr:Math.max(0,Math.min(i.tr,o/2,r/2)),bl:Math.max(0,Math.min(i.bl,o/2,r/2)),br:Math.max(0,Math.min(i.br,o/2,r/2))},e.moveTo(t+i.tl,n),e.arcTo(t+r,n,t+r,n+i.tr,i.tr),e.arcTo(t+r,n+o,t+r-i.br,n+o,i.br),e.arcTo(t,n+o,t,n+o-i.bl,i.bl),e.arcTo(t,n,t+i.tl,n,i.tl)}function Qi(e,t,n,r,o,i,l,a,s,c,h,C,y,b,p){const m={x:0,y:i+c,width:0,height:0};if(e>=b.length||t>=h||t<-2||e<0)return m;const E=i-o;if(e>=C){const g=l>e?-1:1,w=Yr(b);m.x+=w+s;for(let x=l;x!==e;x+=g)m.x+=b[g===1?x:x-1].width*g}else for(let g=0;g<e;g++)m.x+=b[g].width;if(m.width=b[e].width+1,t===-1)m.y=o,m.height=E;else if(t===-2){m.y=0,m.height=o;let g=e;const w=b[e].group,x=b[e].sticky;for(;g>0&&mo(b[g-1].group,w)&&b[g-1].sticky===x;){const v=b[g-1];m.x-=v.width,m.width+=v.width,g--}let I=e;for(;I+1<b.length&&mo(b[I+1].group,w)&&b[I+1].sticky===x;){const v=b[I+1];m.width+=v.width,I++}if(!x){const v=Yr(b),M=m.x-v;M<0&&(m.x-=M,m.width+=M),m.x+m.width>n&&(m.width=n-m.x)}}else if(t>=h-y){let g=h-t;for(m.y=r;g>0;){const w=t+g-1;m.height=typeof p=="number"?p:p(w),m.y-=m.height,g--}m.height+=1}else{const g=a>t?-1:1;if(typeof p=="number"){const w=t-a;m.y+=w*p}else for(let w=a;w!==t;w+=g)m.y+=p(w)*g;m.height=(typeof p=="number"?p:p(t))+1}return m}const Zi=1<<21;function Ln(e,t){return(t+2)*Zi+e}function nu(e){return e%Zi}function ea(e){return Math.floor(e/Zi)-2}function ta(e){return[nu(e),ea(e)]}class ru{constructor(){ft(this,"visibleWindow",{x:0,y:0,width:0,height:0});ft(this,"freezeCols",0);ft(this,"freezeRows",[]);ft(this,"isInWindow",t=>{const n=nu(t),r=ea(t),o=this.visibleWindow,i=n>=o.x&&n<=o.x+o.width||n<this.freezeCols,l=r>=o.y&&r<=o.y+o.height||this.freezeRows.includes(r);return i&&l})}setWindow(t,n,r){this.visibleWindow.x===t.x&&this.visibleWindow.y===t.y&&this.visibleWindow.width===t.width&&this.visibleWindow.height===t.height&&this.freezeCols===n&&$r(this.freezeRows,r)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=r,this.clearOutOfWindow())}}class y1 extends ru{constructor(){super(...arguments);ft(this,"cache",new Map);ft(this,"setValue",(n,r)=>{this.cache.set(Ln(n[0],n[1]),r)});ft(this,"getValue",n=>this.cache.get(Ln(n[0],n[1])));ft(this,"clearOutOfWindow",()=>{for(const[n]of this.cache.entries())this.isInWindow(n)||this.cache.delete(n)})}}class bo{constructor(t=[]){ft(this,"cells");this.cells=new Set(t.map(n=>Ln(n[0],n[1])))}add(t){this.cells.add(Ln(t[0],t[1]))}has(t){return t!==void 0&&this.cells.has(Ln(t[0],t[1]))}remove(t){this.cells.delete(Ln(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(ea(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n<t.y+t.height;n++)for(let r=t.x;r<t.x+t.width;r++)if(this.cells.has(Ln(r,n)))return!0;return!1}hasItemInRegion(t){for(const n of t)if(this.hasItemInRectangle(n))return!0;return!1}*values(){for(const t of this.cells)yield ta(t)}}Xa=function(e){return{"--gdg-accent-color":e.accentColor,"--gdg-accent-fg":e.accentFg,"--gdg-accent-light":e.accentLight,"--gdg-text-dark":e.textDark,"--gdg-text-medium":e.textMedium,"--gdg-text-light":e.textLight,"--gdg-text-bubble":e.textBubble,"--gdg-bg-icon-header":e.bgIconHeader,"--gdg-fg-icon-header":e.fgIconHeader,"--gdg-text-header":e.textHeader,"--gdg-text-group-header":e.textGroupHeader??e.textHeader,"--gdg-bg-group-header":e.bgGroupHeader??e.bgHeader,"--gdg-bg-group-header-hovered":e.bgGroupHeaderHovered??e.bgHeaderHovered,"--gdg-text-header-selected":e.textHeaderSelected,"--gdg-bg-cell":e.bgCell,"--gdg-bg-cell-medium":e.bgCellMedium,"--gdg-bg-header":e.bgHeader,"--gdg-bg-header-has-focus":e.bgHeaderHasFocus,"--gdg-bg-header-hovered":e.bgHeaderHovered,"--gdg-bg-bubble":e.bgBubble,"--gdg-bg-bubble-selected":e.bgBubbleSelected,"--gdg-bubble-height":`${e.bubbleHeight}px`,"--gdg-bubble-padding":`${e.bubblePadding}px`,"--gdg-bubble-margin":`${e.bubbleMargin}px`,"--gdg-bg-search-result":e.bgSearchResult,"--gdg-border-color":e.borderColor,"--gdg-horizontal-border-color":e.horizontalBorderColor??e.borderColor,"--gdg-drilldown-border":e.drilldownBorder,"--gdg-link-color":e.linkColor,"--gdg-cell-horizontal-padding":`${e.cellHorizontalPadding}px`,"--gdg-cell-vertical-padding":`${e.cellVerticalPadding}px`,"--gdg-header-font-style":e.headerFontStyle,"--gdg-base-font-style":e.baseFontStyle,"--gdg-marker-font-style":e.markerFontStyle,"--gdg-font-family":e.fontFamily,"--gdg-editor-font-size":e.editorFontSize,"--gdg-checkbox-max-size":`${e.checkboxMaxSize}px`,...e.resizeIndicatorColor===void 0?{}:{"--gdg-resize-indicator-color":e.resizeIndicatorColor},...e.headerBottomBorderColor===void 0?{}:{"--gdg-header-bottom-border-color":e.headerBottomBorderColor},...e.roundingRadius===void 0?{}:{"--gdg-rounding-radius":`${e.roundingRadius}px`}}};const ou={accentColor:"#4F5DFF",accentFg:"#FFFFFF",accentLight:"rgba(62, 116, 253, 0.1)",textDark:"#313139",textMedium:"#737383",textLight:"#B2B2C0",textBubble:"#313139",bgIconHeader:"#737383",fgIconHeader:"#FFFFFF",textHeader:"#313139",textGroupHeader:"#313139BB",textHeaderSelected:"#FFFFFF",bgCell:"#FFFFFF",bgCellMedium:"#FAFAFB",bgHeader:"#F7F7F8",bgHeaderHasFocus:"#E9E9EB",bgHeaderHovered:"#EFEFF1",bgBubble:"#EDEDF3",bgBubbleSelected:"#FFFFFF",bubbleHeight:20,bubblePadding:6,bubbleMargin:4,bgSearchResult:"#fff9e3",borderColor:"rgba(115, 116, 131, 0.16)",drilldownBorder:"rgba(0, 0, 0, 0)",linkColor:"#353fb5",cellHorizontalPadding:8,cellVerticalPadding:3,headerIconSize:18,headerFontStyle:"600 13px",baseFontStyle:"13px",markerFontStyle:"9px",fontFamily:"Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif",editorFontSize:"13px",lineHeight:1.4,checkboxMaxSize:18};function iu(){return ou}Wa=$t.createContext(ou);function Zn(e,...t){const n={...e};for(const r of t)if(r!==void 0)for(const o in r)r.hasOwnProperty(o)&&(n[o]=o==="bgCell"?In(r[o],n[o]):r[o]);return n.headerFontFull!==void 0&&e.fontFamily===n.fontFamily&&e.headerFontStyle===n.headerFontStyle||(n.headerFontFull=`${n.headerFontStyle} ${n.fontFamily}`),n.baseFontFull!==void 0&&e.fontFamily===n.fontFamily&&e.baseFontStyle===n.baseFontStyle||(n.baseFontFull=`${n.baseFontStyle} ${n.fontFamily}`),n.markerFontFull!==void 0&&e.fontFamily===n.fontFamily&&e.markerFontStyle===n.markerFontStyle||(n.markerFontFull=`${n.markerFontStyle} ${n.fontFamily}`),n}function au(e,t,n,r,o,i,l,a,s){let c=0;const h=o===void 0?[]:o.map(b=>{const p=function(m,E,g,w){var I;const x=w(E);return((I=x==null?void 0:x.measure)==null?void 0:I.call(x,m,E,g))??150}(e,b[r],t,s);return c=Math.max(c,p),p});if(h.length>5&&a){c=0;let b=0;for(const m of h)b+=m;const p=b/h.length;for(let m=0;m<h.length;m++)h[m]>=2*p?h[m]=0:c=Math.max(c,h[m])}const C=e.font;e.font=t.headerFontFull,c=Math.max(c,e.measureText(n.title).width+2*t.cellHorizontalPadding+(n.icon===void 0?0:28)),e.font=C;const y=Math.max(Math.ceil(i),Math.min(Math.floor(l),Math.ceil(c)));return{...n,width:y}}var lu,su,cu,uu;const On=Sr(function(){if(uu)return cu;uu=1;var e=su?lu:(su=1,lu=function(n,r,o){return n==n&&(o!==void 0&&(n=n<=o?n:o),r!==void 0&&(n=n>=r?n:r)),n}),t=Xi();return cu=function(n,r,o){return o===void 0&&(o=r,r=void 0),o!==void 0&&(o=(o=t(o))==o?o:0),r!==void 0&&(r=(r=t(r))==r?r:0),e(t(n),r,o)}}());var du,hu,fu,gu,pu,mu,vu,wu,yu,bu,xu,Cu,Su,ku,Mu,Ru,Eu,Iu,na,Tu,Hu,Ou,Pu,Du,zu,Au,Fu,Lu,_u,ju,Nu,Bu;function Wu(){if(mu)return pu;mu=1;var e=Fi(),t=hu?du:(hu=1,du=function(o){return this.__data__.set(o,"__lodash_hash_undefined__"),this}),n=gu?fu:(gu=1,fu=function(o){return this.__data__.has(o)});function r(o){var i=-1,l=o==null?0:o.length;for(this.__data__=new e;++i<l;)this.add(o[i])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,pu=r}function b1(){if(ku)return Su;ku=1;var e=wu?vu:(wu=1,vu=function(r,o,i,l){for(var a=r.length,s=i+(l?1:-1);l?s--:++s<a;)if(o(r[s],s,r))return s;return-1}),t=bu?yu:(bu=1,yu=function(r){return r!=r}),n=Cu?xu:(Cu=1,xu=function(r,o,i){for(var l=i-1,a=r.length;++l<a;)if(r[l]===o)return l;return-1});return Su=function(r,o,i){return o==o?n(r,o,i):e(r,t,i)}}function $u(){return Tu||(Tu=1,na=function(e,t){return e.has(t)}),na}function Xu(){if(Ou)return Hu;Ou=1;var e=Ir()(Gn(),"Set");return Hu=e}function ra(){return Au?zu:(Au=1,zu=function(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n})}function x1(){if(Lu)return Fu;Lu=1;var e=Xu(),t=Du?Pu:(Du=1,Pu=function(){}),n=ra(),r=e&&1/n(new e([,-0]))[1]==1/0?function(o){return new e(o)}:t;return Fu=r}function C1(){if(ju)return _u;ju=1;var e=Wu(),t=function(){if(Ru)return Mu;Ru=1;var l=b1();return Mu=function(a,s){return!(a==null||!a.length)&&l(a,s,0)>-1}}(),n=Iu?Eu:(Iu=1,Eu=function(l,a,s){for(var c=-1,h=l==null?0:l.length;++c<h;)if(s(a,l[c]))return!0;return!1}),r=$u(),o=x1(),i=ra();return _u=function(l,a,s){var c=-1,h=t,C=l.length,y=!0,b=[],p=b;if(s)y=!1,h=n;else if(C>=200){var m=a?null:o(l);if(m)return i(m);y=!1,h=r,p=new e}else p=a?[]:b;e:for(;++c<C;){var E=l[c],g=a?a(E):E;if(E=s||E!==0?E:0,y&&g==g){for(var w=p.length;w--;)if(p[w]===g)continue e;a&&p.push(g),b.push(E)}else h(p,g,s)||(p!==b&&p.push(g),b.push(E))}return b}}const S1=Sr(function(){if(Bu)return Nu;Bu=1;var e=C1();return Nu=function(t){return t&&t.length?e(t):[]}}());var Gu,Yu,Ku,Vu,oa,Uu,qu,Ju;function Qu(){return Yu?Gu:(Yu=1,Gu=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e})}function k1(){if(Uu)return oa;Uu=1;var e=Qu(),t=function(){if(Vu)return Ku;Vu=1;var n=oo(),r=Li(),o=Xn(),i=n?n.isConcatSpreadable:void 0;return Ku=function(l){return o(l)||r(l)||!!(i&&l&&l[i])}}();return oa=function n(r,o,i,l,a){var s=-1,c=r.length;for(i||(i=t),a||(a=[]);++s<c;){var h=r[s];o>0&&i(h)?o>1?n(h,o-1,i,l,a):e(a,h):l||(a[a.length]=h)}return a},oa}const Zu=Sr(function(){if(Ju)return qu;Ju=1;var e=k1();return qu=function(t){return t!=null&&t.length?e(t,1):[]}}());var ed,td,nd,rd,od,id,ad,ld,sd,cd,ud,dd;function ia(){if(rd)return nd;rd=1;var e=Ks(),t=ji();return nd=function(n){return n!=null&&t(n.length)&&!e(n)}}function M1(){if(cd)return sd;cd=1;var e=function(){if(td)return ed;td=1;var r=Math.ceil,o=Math.max;return ed=function(i,l,a,s){for(var c=-1,h=o(r((l-i)/(a||1)),0),C=Array(h);h--;)C[s?h:++c]=i,i+=a;return C}}(),t=function(){if(id)return od;id=1;var r=zi(),o=ia(),i=_i(),l=Er();return od=function(a,s,c){if(!l(c))return!1;var h=typeof s;return!!(h=="number"?o(c)&&i(s,c.length):h=="string"&&s in c)&&r(c[s],a)}}(),n=function(){if(ld)return ad;ld=1;var r=Xi(),o=1/0;return ad=function(i){return i?(i=r(i))===o||i===-1/0?17976931348623157e292*(i<0?-1:1):i==i?i:0:i===0?i:0}}();return sd=function(r){return function(o,i,l){return l&&typeof l!="number"&&t(o,i,l)&&(i=l=void 0),o=n(o),i===void 0?(i=o,o=0):i=n(i),l=l===void 0?o<i?1:-1:n(l),e(o,i,l,r)}}}var R1=function(){if(dd)return ud;dd=1;var e=M1()();return ud=e}();const Pr=Sr(R1),Pt='<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">',hd=e=>{const t=e.fgColor,n=e.bgColor;return`${Pt}
6
6
  <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
7
7
  <path fill-rule="evenodd" clip-rule="evenodd" d="M10.29 4.947a3.368 3.368 0 014.723.04 3.375 3.375 0 01.041 4.729l-.009.009-1.596 1.597a3.367 3.367 0 01-5.081-.364.71.71 0 011.136-.85 1.95 1.95 0 002.942.21l1.591-1.593a1.954 1.954 0 00-.027-2.733 1.95 1.95 0 00-2.732-.027l-.91.907a.709.709 0 11-1.001-1.007l.915-.911.007-.007z" fill="${t}"/>
8
8
  <path fill-rule="evenodd" clip-rule="evenodd" d="M6.55 8.678a3.368 3.368 0 015.082.364.71.71 0 01-1.136.85 1.95 1.95 0 00-2.942-.21l-1.591 1.593a1.954 1.954 0 00.027 2.733 1.95 1.95 0 002.73.028l.906-.906a.709.709 0 111.003 1.004l-.91.91-.008.01a3.368 3.368 0 01-4.724-.042 3.375 3.375 0 01-.041-4.728l.009-.009L6.55 8.678z" fill="${t}"/>
@@ -117,16 +117,16 @@ var Lp=Object.defineProperty;var _p=(ur,$n,Rr)=>$n in ur?Lp(ur,$n,{enumerable:!0
117
117
  <path stroke="${t}" stroke-width="2" stroke-linecap="round" d="M10 4h4m-4 12h4"/>
118
118
  <path d="M11 14h4a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3h-4v2h4a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-4v2ZM9.5 8H5a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h4.5v2H5a3 3 0 0 1-3-3V9a3 3 0 0 1 3-3h4.5v2Z" fill="${t}"/>
119
119
  </svg>
120
- `}};class I1{constructor(t,n){ft(this,"onSettled");ft(this,"spriteMap",new Map);ft(this,"headerIcons");ft(this,"inFlight",0);this.onSettled=n,this.headerIcons=t??{}}drawSprite(t,n,r,o,i,l,a,s=1){const[c,h]=function(p,m){return p==="normal"?[m.bgIconHeader,m.fgIconHeader]:p==="selected"?["white",m.accentColor]:[m.accentColor,m.bgHeader]}(n,a),C=l*Math.ceil(window.devicePixelRatio),y=`${c}_${h}_${C}_${t}`;let b=this.spriteMap.get(y);if(b===void 0){const p=this.headerIcons[t];if(p===void 0)return;b=document.createElement("canvas");const m=b.getContext("2d");if(m===null)return;const E=new Image;E.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(p({fgColor:h,bgColor:c}))}`,this.spriteMap.set(y,b);const g=E.decode();if(g===void 0)return;this.inFlight++,g.then(()=>{m.drawImage(E,0,0,C,C)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else s<1&&(r.globalAlpha=s),r.drawImage(b,0,0,C,C,o,i,l,l),s<1&&(r.globalAlpha=1)}}function fd(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y)}function ai(e,t,n,r,o,i,l,a,s){a=a??t;let c=t,h=e;const C=r-i;let y=!1;for(;c<n&&h<C;){const b=o(h);if(c+b>a&&s(c,h,b,!1,l&&h===r-1)===!0){y=!0;break}c+=b,h++}if(!y){c=n;for(let b=0;b<i;b++){h=r-1-b;const p=o(h);c-=p,s(c,h,p,!0,l&&h===r-1)}}}function gr(e,t,n,r,o,i){let l=0,a=0;const s=o+r;for(const c of e){if(i(c,c.sticky?a:l+n,s,c.sticky?0:a,t)===!0)break;l+=c.width,a+=c.sticky?c.width:0}}function gd(e,t,n,r,o){let i=0,l=0;for(let a=0;a<e.length;a++){const s=e[a];let c=a+1,h=s.width;for(s.sticky&&(l+=h);c<e.length&&mo(e[c].group,s.group)&&e[c].sticky===e[a].sticky;){const p=e[c];h+=p.width,c++,a++,p.sticky&&(l+=p.width)}const C=i+(s.sticky?0:n),y=s.sticky?0:Math.max(0,l-C),b=Math.min(h-y,t-(C+y));o([s.sourceIndex,e[c-1].sourceIndex],s.group??"",C+y,0,b,r),i+=h}}function pd(e,t,n,r,o,i,l){var y;const[a,s]=e;let c,h;const C=((y=l.find(b=>!b.sticky))==null?void 0:y.sourceIndex)??0;if(s>C){const b=Math.max(a,C);let p=t,m=r;for(let E=i.sourceIndex-1;E>=b;E--)p-=l[E].width,m+=l[E].width;for(let E=i.sourceIndex+1;E<=s;E++)m+=l[E].width;h={x:p,y:n,width:m,height:o}}if(C>a){const b=Math.min(s,C-1);let p=t,m=r;for(let E=i.sourceIndex-1;E>=a;E--)p-=l[E].width,m+=l[E].width;for(let E=i.sourceIndex+1;E<=b;E++)m+=l[E].width;c={x:p,y:n,width:m,height:o}}return[c,h]}function xo(e,t,n,r,o,i,l,a){return e<=o+l&&o<=e+n&&t<=i+a&&i<=t+r}function Dr(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function md(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x+e.width,t.x+t.width)-n,height:Math.max(e.y+e.height,t.y+t.height)-r}}function T1(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function H1(e,t,n,r){if(e.x>t||e.y>n||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>n)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=n)return e;const o=t+4,i=n+4,l=-4-e.x,a=e.x+e.width-o,s=-4-e.y,c=e.y+e.height-i,h=l>0?e.x+Math.floor(l/r)*r:e.x,C=a>0?e.x+e.width-Math.floor(a/r)*r:e.x+e.width,y=s>0?e.y+Math.floor(s/r)*r:e.y;return{x:h,y,width:C-h,height:(c>0?e.y+e.height-Math.floor(c/r)*r:e.y+e.height)-y}}const O1={kind:me.Loading,allowOverlay:!1};function vd(e,t,n,r,o,i,l,a,s,c,h,C,y,b,p,m,E,g,w,x,I,v,M,S,H,f,B,D,O,T,j,V,Z,Q,ce){let le=(x==null?void 0:x.size)??Number.MAX_SAFE_INTEGER;const q=performance.now();let J=T.baseFontFull;e.font=J;const fe={ctx:e},ee=[0,0],se=E>0?Or(s,E,c):0;let ie,W;const N=fd(w);return gr(t,a,i,l,o,(U,ue,pe,ze,Ue)=>{const He=Math.max(0,ze-ue),$e=ue+He,be=o+1,ye=U.width-He,Fe=r-o-1;if(w.length>0){let qe=!1;for(let Ye=0;Ye<w.length;Ye++){const ot=w[Ye];if(xo($e,be,ye,Fe,ot.x,ot.y,ot.width,ot.height)){qe=!0;break}}if(!qe)return}const Oe=()=>{e.save(),e.beginPath(),e.rect($e,be,ye,Fe),e.clip()},te=I.columns.hasIndex(U.sourceIndex),Ee=C(U.group??"").overrideTheme,ke=U.themeOverride===void 0&&Ee===void 0?T:Zn(T,Ee,U.themeOverride),Xe=ke.baseFontFull;let Re;return Xe!==J&&(J=Xe,e.font=Xe),Oe(),ai(Ue,pe,r,s,c,E,g,N,(qe,Ye,ot,Me,Pe)=>{var wt,dt,xt;if(Ye<0||(ee[0]=U.sourceIndex,ee[1]=Ye,x!==void 0&&!x.has(ee)))return;if(w.length>0){let ve=!1;for(let Ve=0;Ve<w.length;Ve++){const Ke=w[Ve];if(xo(ue,qe,U.width,ot,Ke.x,Ke.y,Ke.width,Ke.height)){ve=!0;break}}if(!ve)return}const ut=I.rows.hasIndex(Ye),tt=b.hasIndex(Ye),pt=Ye<s?h(ee):O1;let Ft=ue,bt=U.width,Ze=!1,Yt=!1;if(pt.span!==void 0){const[ve,Ve]=pt.span,Ke=`${Ye},${ve},${Ve},${U.sticky}`;if(W===void 0&&(W=new Set),W.has(Ke))return void le--;{const mt=pd(pt.span,ue,qe,U.width,ot,U,n),it=U.sticky?mt[0]:mt[1];if(U.sticky||mt[0]===void 0||(Yt=!0),it!==void 0){Ft=it.x,bt=it.width,W.add(Ke),e.restore(),Re=void 0,e.save(),e.beginPath();const at=Math.max(0,ze-it.x);e.rect(it.x+at,qe,it.width-at,ot),ie===void 0&&(ie=[]),ie.push({x:it.x+at,y:qe,width:it.width-at,height:ot}),e.clip(),Ze=!0}}}const nn=y==null?void 0:y(Ye),Kt=Pe&&((wt=U.trailingRowOptions)==null?void 0:wt.themeOverride)!==void 0?(dt=U.trailingRowOptions)==null?void 0:dt.themeOverride:void 0,qt=pt.themeOverride===void 0&&nn===void 0&&Kt===void 0?ke:Zn(ke,nn,Kt,pt.themeOverride);e.beginPath();const un=function(ve,Ve,Ke){return Ke.current!==void 0&&ve[1]===Ke.current.cell[1]&&(Ve.span===void 0?Ke.current.cell[0]===ve[0]:Ke.current.cell[0]>=Ve.span[0]&&Ke.current.cell[0]<=Ve.span[1])}(ee,pt,I);let jt=function(ve,Ve,Ke,mt){let it=0;if(Ke.current===void 0)return it;const at=Ke.current.range;(mt||at.height*at.width>1)&&Vc(ve,Ve,at)&&it++;for(const vt of Ke.current.rangeStack)Vc(ve,Ve,vt)&&it++;return it}(ee,pt,I,m);const Kn=pt.span!==void 0&&I.columns.some(ve=>pt.span!==void 0&&ve>=pt.span[0]&&ve<=pt.span[1]);un&&!p&&m?jt=0:un&&m&&(jt=Math.max(jt,1)),Kn&&jt++,un||(ut&&jt++,te&&!Pe&&jt++);const vr=pt.kind===me.Protected?qt.bgCellMedium:qt.bgCell;let Dt;if((Me||vr!==T.bgCell)&&(Dt=In(vr,Dt)),jt>0||tt){tt&&(Dt=In(qt.bgHeader,Dt));for(let ve=0;ve<jt;ve++)Dt=In(qt.accentLight,Dt)}else if(v!==void 0){for(const ve of v)if(ve[0]===U.sourceIndex&&ve[1]===Ye){Dt=In(qt.bgSearchResult,Dt);break}}if(M!==void 0)for(let ve=0;ve<M.length;ve++){const Ve=M[ve],Ke=Ve.range;Ve.style!=="solid-outline"&&Ke.x<=U.sourceIndex&&U.sourceIndex<Ke.x+Ke.width&&Ke.y<=Ye&&Ye<Ke.y+Ke.height&&(Dt=In(Ve.color,Dt))}let tr=!1;if(x!==void 0){const ve=qe+1,Ve=(Me?ve+ot-1:Math.min(ve+ot-1,r-se))-ve;(Ve!==ot-1||Ft+1<=ze)&&(tr=!0,e.save(),e.beginPath(),e.rect(Ft+1,ve,bt-1,Ve),e.clip()),Dt=Dt===void 0?qt.bgCell:In(Dt,qt.bgCell)}const _n=U.sourceIndex===n.length-1,ne=Ye===s-1;let xe;Dt!==void 0&&(e.fillStyle=Dt,Re!==void 0&&(Re.fillStyle=Dt),x!==void 0?e.fillRect(Ft+1,qe+1,bt-(_n?2:1),ot-(ne?2:1)):e.fillRect(Ft,qe,bt,ot)),pt.style==="faded"&&(e.globalAlpha=.6);for(let ve=0;ve<f.length;ve++){const Ve=f[ve];if(Ve.item[0]===U.sourceIndex&&Ve.item[1]===Ye){xe=Ve;break}}if(bt>ce&&!Yt){const ve=qt.baseFontFull;ve!==J&&(e.font=ve,J=ve),Re=wd(e,pt,U.sourceIndex,Ye,_n,ne,Ft,qe,bt,ot,jt>0,qt,Dt??qt.bgCell,S,H,(xe==null?void 0:xe.hoverAmount)??0,B,O,q,D,Re,j,V,Z,Q)}return tr&&e.restore(),pt.style==="faded"&&(e.globalAlpha=1),le--,Ze&&(e.restore(),(xt=Re==null?void 0:Re.deprep)==null||xt.call(Re,fe),Re=void 0,Oe(),J=Xe,e.font=Xe),le<=0}),e.restore(),le<=0}),ie}const Co=[0,0],So={x:0,y:0,width:0,height:0},aa=[void 0,()=>{}];let la=!1;function P1(){la=!0}function wd(e,t,n,r,o,i,l,a,s,c,h,C,y,b,p,m,E,g,w,x,I,v,M,S,H){var V,Z;let f,B,D;E!==void 0&&E[0][0]===n&&E[0][1]===r&&(f=E[1][0],B=E[1][1]),Co[0]=n,Co[1]=r,So.x=l,So.y=a,So.width=s,So.height=c,aa[0]=M.getValue(Co),aa[1]=Q=>M.setValue(Co,Q),la=!1;const O={ctx:e,theme:C,col:n,row:r,cell:t,rect:So,highlighted:h,cellFillColor:y,hoverAmount:m,frameTime:w,hoverX:f,drawState:aa,hoverY:B,imageLoader:b,spriteManager:p,hyperWrapping:g,overrideCursor:f!==void 0?H:void 0,requestAnimationFrame:P1},T=function(Q,ce,le,q,J,fe){const{ctx:ee,rect:se,theme:ie}=Q;let W=Number.MAX_SAFE_INTEGER;if(ce!==void 0&&(W=le-ce,W<500)){const N=1-W/500;ee.globalAlpha=N,ee.fillStyle=ie.bgSearchResult,ee.fillRect(se.x+1,se.y+1,se.width-(J?2:1),se.height-(fe?2:1)),ee.globalAlpha=1,q!==void 0&&(q.fillStyle=ie.bgSearchResult)}return W<500}(O,t.lastUpdated,w,I,o,i),j=S(t);if(j!==void 0){(I==null?void 0:I.renderer)!==j&&((V=I==null?void 0:I.deprep)==null||V.call(I,O),I=void 0);const Q=(Z=j.drawPrep)==null?void 0:Z.call(j,O,I);x===void 0||kr(O.cell)?j.draw(O,t):x(O,()=>j.draw(O,t)),D=Q===void 0?void 0:{deprep:Q==null?void 0:Q.deprep,fillStyle:Q==null?void 0:Q.fillStyle,font:Q==null?void 0:Q.font,renderer:j}}return(T||la)&&(v==null||v(Co)),D}function sa(e,t,n,r,o,i,l,a,s=-20,c=-20,h=void 0,C="center",y="square"){const b=Math.floor(o+l/2),p=y==="circle"?1e4:t.roundingRadius??4;let m=Nc(h??t.checkboxMaxSize,l,t.cellVerticalPadding),E=m/2;const g=jc(C,r,i,t.cellHorizontalPadding,m),w=_c(g,b,m),x=Bc(r+s,o+c,w);switch(n){case!0:e.beginPath(),Yn(e,g-m/2,b-m/2,m,m,p),y==="circle"&&(E*=.8,m*=.8),e.fillStyle=a?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(g-E+m/4.23,b-E+m/1.97),e.lineTo(g-E+m/2.42,b-E+m/1.44),e.lineTo(g-E+m/1.29,b-E+m/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break;case Jo:case!1:e.beginPath(),Yn(e,g-m/2+.5,b-m/2+.5,m-1,m-1,p),e.lineWidth=1,e.strokeStyle=x?t.textDark:t.textMedium,e.stroke();break;case Ni:e.beginPath(),Yn(e,g-m/2,b-m/2,m,m,p),e.fillStyle=x?t.textMedium:t.textLight,e.fill(),y==="circle"&&(E*=.8,m*=.8),e.beginPath(),e.moveTo(g-m/3,b),e.lineTo(g+m/3,b),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break;default:lo()}}function D1(e,t,n,r,o,i,l,a,s,c,h,C,y,b,p,m,E,g,w){var f,B,D,O;const x=l+a;if(x<=0)return;e.fillStyle=C.bgHeader,e.fillRect(0,0,o,x);const I=(f=r==null?void 0:r[0])==null?void 0:f[0],v=(B=r==null?void 0:r[0])==null?void 0:B[1],M=(D=r==null?void 0:r[1])==null?void 0:D[0],S=(O=r==null?void 0:r[1])==null?void 0:O[1],H=C.headerFontFull;e.font=H,gr(t,0,i,0,x,(T,j,V,Z)=>{var U;if(E!==void 0&&!E.has([T.sourceIndex,-1]))return;const Q=Math.max(0,Z-j);e.save(),e.beginPath(),e.rect(j+Q,a,T.width-Q,l),e.clip();const ce=m(T.group??"").overrideTheme,le=T.themeOverride===void 0&&ce===void 0?C:Zn(C,ce,T.themeOverride);le.bgHeader!==C.bgHeader&&(e.fillStyle=le.bgHeader,e.fill()),le!==C&&(e.font=le.headerFontFull);const q=h.columns.hasIndex(T.sourceIndex),J=s!==void 0||c||T.headerRowMarkerDisabled===!0,fe=!J&&v===-1&&I===T.sourceIndex,ee=J?0:((U=b.find(ue=>ue.item[0]===T.sourceIndex&&ue.item[1]===-1))==null?void 0:U.hoverAmount)??0,se=(h==null?void 0:h.current)!==void 0&&h.current.cell[0]===T.sourceIndex,ie=q?le.accentColor:se?le.bgHeaderHasFocus:le.bgHeader,W=n?a:0,N=T.sourceIndex===0?0:1;q?(e.fillStyle=ie,e.fillRect(j+N,W,T.width-N,l)):(se||ee>0)&&(e.beginPath(),e.rect(j+N,W,T.width-N,l),se&&(e.fillStyle=le.bgHeaderHasFocus,e.fill()),ee>0&&(e.globalAlpha=ee,e.fillStyle=le.bgHeaderHovered,e.fill(),e.globalAlpha=1)),Cd(e,j,W,T.width,l,T,q,le,fe,fe?M:void 0,fe?S:void 0,se,ee,y,g,w),e.restore()}),n&&function(T,j,V,Z,Q,ce,le,q,J,fe,ee,se){const[W,N]=(ce==null?void 0:ce[0])??[];let U=0;gd(j,V,Z,Q,(ue,pe,ze,Ue,He,$e)=>{if(se!==void 0&&!se.hasItemInRectangle({x:ue[0],y:-2,width:ue[1]-ue[0]+1,height:1}))return;T.save(),T.beginPath(),T.rect(ze,Ue,He,$e),T.clip();const be=ee(pe),ye=(be==null?void 0:be.overrideTheme)===void 0?le:Zn(le,be.overrideTheme),Fe=N===-2&&W!==void 0&&W>=ue[0]&&W<=ue[1],Oe=Fe?ye.bgGroupHeaderHovered??ye.bgHeaderHovered:ye.bgGroupHeader??ye.bgHeader;if(Oe!==le.bgHeader&&(T.fillStyle=Oe,T.fill()),T.fillStyle=ye.textGroupHeader??ye.textHeader,be!==void 0){let te=ze;if(be.icon!==void 0&&(q.drawSprite(be.icon,"normal",T,te+8,(Q-20)/2,20,ye),te+=26),T.fillText(be.name,te+8,Q/2+fr(T,le.headerFontFull)),be.actions!==void 0&&Fe){const Ee=yd({x:ze,y:Ue,width:He,height:$e},be.actions);T.beginPath();const ke=Ee[0].x-10,Xe=ze+He-ke;T.rect(ke,0,Xe,Q);const Re=T.createLinearGradient(ke,0,ke+Xe,0),qe=Hr(Oe,0);Re.addColorStop(0,qe),Re.addColorStop(10/Xe,Oe),Re.addColorStop(1,Oe),T.fillStyle=Re,T.fill(),T.globalAlpha=.6;const[Ye,ot]=(ce==null?void 0:ce[1])??[-1,-1];for(let Me=0;Me<be.actions.length;Me++){const Pe=be.actions[Me],ut=Ee[Me],tt=Dr(ut,Ye+ze,ot);tt&&(T.globalAlpha=1),q.drawSprite(Pe.icon,"normal",T,ut.x+ut.width/2-10,ut.y+ut.height/2-10,20,ye),tt&&(T.globalAlpha=.6)}T.globalAlpha=1}}ze!==0&&fe(ue[0])&&(T.beginPath(),T.moveTo(ze+.5,0),T.lineTo(ze+.5,Q),T.strokeStyle=le.borderColor,T.lineWidth=1,T.stroke()),T.restore(),U=ze+He}),T.beginPath(),T.moveTo(U+.5,0),T.lineTo(U+.5,Q),T.moveTo(0,Q+.5),T.lineTo(V,Q+.5),T.strokeStyle=le.borderColor,T.lineWidth=1,T.stroke()}(e,t,o,i,a,r,C,y,0,p,m,E)}const li=30;function yd(e,t){const n=[];let r=e.x+e.width-26*t.length;const o=e.y+e.height/2-13;for(let i=0;i<t.length;i++)n.push({x:r,y:o,width:26,height:26}),r+=26;return n}function ko(e,t,n){return n&&e!==void 0&&(e.x=t-(e.x-t)-e.width),e}function bd(e,t,n,r,o,i,l,a){var g;const s=l.cellHorizontalPadding,c=l.headerIconSize,h=function(w,x,I,v){return{x:w+I-li,y:Math.max(x,x+v/2-li/2),width:li,height:Math.min(li,v)}}(n,r,o,i);let C=n+s;const y=t.icon===void 0?void 0:{x:C,y:r+(i-c)/2,width:c,height:c},b=y===void 0||t.overlayIcon===void 0?void 0:{x:y.x+9,y:y.y+6,width:18,height:18};y!==void 0&&(C+=Math.ceil(1.3*c));const p={x:C,y:r,width:o-C,height:i};let m;if(t.indicatorIcon!==void 0){const w=e===void 0?((g=Qc(t.title,l.headerFontFull))==null?void 0:g.width)??0:Kr(t.title,e,l.headerFontFull).width;p.width=w,C+=w+s,m={x:C,y:r+(i-c)/2,width:c,height:c}}const E=n+o/2;return{menuBounds:ko(h,E,a),iconBounds:ko(y,E,a),iconOverlayBounds:ko(b,E,a),textBounds:ko(p,E,a),indicatorIconBounds:ko(m,E,a)}}function xd(e,t,n,r,o,i,l,a,s,c,h,C,y,b,p,m){if(i.rowMarker!==void 0&&i.headerRowMarkerDisabled!==!0){const w=i.rowMarkerChecked;return w!==!0&&i.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=C),sa(e,i.headerRowMarkerTheme!==void 0?Zn(a,i.headerRowMarkerTheme):a,w,t,n,r,o,!1,void 0,void 0,a.checkboxMaxSize,"center",i.rowMarker),void(w!==!0&&i.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=1))}const E=l?a.textHeaderSelected:a.textHeader,g=i.hasMenu===!0&&(s||b&&l)&&m.menuBounds!==void 0;if(i.icon!==void 0&&m.iconBounds!==void 0){let w=l?"selected":"normal";i.style==="highlight"&&(w=l?"selected":"special"),y.drawSprite(i.icon,w,e,m.iconBounds.x,m.iconBounds.y,m.iconBounds.width,a),i.overlayIcon!==void 0&&m.iconOverlayBounds!==void 0&&y.drawSprite(i.overlayIcon,l?"selected":"special",e,m.iconOverlayBounds.x,m.iconOverlayBounds.y,m.iconOverlayBounds.width,a)}if(g&&r>35){const x=(p?35:r-35)/r,I=(p?.7*35:r-.7*35)/r,v=e.createLinearGradient(t,0,t+r,0),M=Hr(E,0);v.addColorStop(p?1:0,E),v.addColorStop(x,E),v.addColorStop(I,M),v.addColorStop(p?0:1,M),e.fillStyle=v}else e.fillStyle=E;if(p&&(e.textAlign="right"),m.textBounds!==void 0&&e.fillText(i.title,p?m.textBounds.x+m.textBounds.width:m.textBounds.x,n+o/2+fr(e,a.headerFontFull)),p&&(e.textAlign="left"),!(i.indicatorIcon===void 0||m.indicatorIconBounds===void 0||g&&xo(m.menuBounds.x,m.menuBounds.y,m.menuBounds.width,m.menuBounds.height,m.indicatorIconBounds.x,m.indicatorIconBounds.y,m.indicatorIconBounds.width,m.indicatorIconBounds.height))){let w=l?"selected":"normal";i.style==="highlight"&&(w=l?"selected":"special"),y.drawSprite(i.indicatorIcon,w,e,m.indicatorIconBounds.x,m.indicatorIconBounds.y,m.indicatorIconBounds.width,a)}if(g&&m.menuBounds!==void 0){const w=m.menuBounds,x=c!==void 0&&h!==void 0&&Dr(w,c+t,h+n);if(x||(e.globalAlpha=.7),i.menuIcon===void 0||i.menuIcon===Zo.Triangle){e.beginPath();const I=w.x+w.width/2-5.5,v=w.y+w.height/2-3;(function(M,S,H){const f=function(T,j){const V=j.x-T.x,Z=j.y-T.y,Q=Math.sqrt(V*V+Z*Z),ce=V/Q,le=Z/Q;return{x:V,y:j.y-T.y,len:Q,nx:ce,ny:le,ang:Math.atan2(le,ce)}};let B;const D=S.length;let O=S[D-1];for(let T=0;T<D;T++){let j=S[T%D];const V=S[(T+1)%D],Z=f(j,O),Q=f(j,V),ce=Z.nx*Q.ny-Z.ny*Q.nx,le=Z.nx*Q.nx-Z.ny*-Q.ny;let q=Math.asin(ce<-1?-1:ce>1?1:ce),J=1,fe=!1;le<0?q<0?q=Math.PI+q:(q=Math.PI-q,J=-1,fe=!0):q>0&&(J=-1,fe=!0),B=j.radius!==void 0?j.radius:H;const ee=q/2;let se,ie=Math.abs(Math.cos(ee)*B/Math.sin(ee));ie>Math.min(Z.len/2,Q.len/2)?(ie=Math.min(Z.len/2,Q.len/2),se=Math.abs(ie*Math.sin(ee)/Math.cos(ee))):se=B;let W=j.x+Q.nx*ie,N=j.y+Q.ny*ie;W+=-Q.ny*se*J,N+=Q.nx*se*J,M.arc(W,N,se,Z.ang+Math.PI/2*J,Q.ang-Math.PI/2*J,fe),O=j,j=V}M.closePath()})(e,[{x:I,y:v},{x:I+11,y:v},{x:I+5.5,y:v+6}],1),e.fillStyle=E,e.fill()}else if(i.menuIcon===Zo.Dots)e.beginPath(),function(I,v,M){I.arc(v,M-4.375,1.25,0,2*Math.PI,!1),I.arc(v,M,1.25,0,2*Math.PI,!1),I.arc(v,M+4.375,1.25,0,2*Math.PI,!1)}(e,w.x+w.width/2,w.y+w.height/2),e.fillStyle=E,e.fill();else{const I=w.x+(w.width-a.headerIconSize)/2,v=w.y+(w.height-a.headerIconSize)/2;y.drawSprite(i.menuIcon,"normal",e,I,v,a.headerIconSize,a)}x||(e.globalAlpha=1)}}function Cd(e,t,n,r,o,i,l,a,s,c,h,C,y,b,p,m){const E=Yi(i.title)==="rtl",g=bd(e,i,t,n,r,o,a,E);p!==void 0?p({ctx:e,theme:a,rect:{x:t,y:n,width:r,height:o},column:i,columnIndex:i.sourceIndex,isSelected:l,hoverAmount:y,isHovered:s,hasSelectedCell:C,spriteManager:b,menuBounds:(g==null?void 0:g.menuBounds)??{x:0,y:0,height:0,width:0},hoverX:c,hoverY:h},()=>xd(e,t,n,r,o,i,l,a,s,c,h,y,b,m,E,g)):xd(e,t,n,r,o,i,l,a,s,c,h,y,b,m,E,g)}var Sd,kd,Md,Rd,Ed,Id,Td,Hd,Od,Pd,Dd,zd;function z1(){if(Rd)return Md;Rd=1;var e=function(){if(kd)return Sd;kd=1;var t=Ir(),n=function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}}();return Sd=n}();return Md=function(t,n,r){n=="__proto__"&&e?e(t,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[n]=r}}function A1(){if(Pd)return Od;Pd=1;var e=(Hd?Td:(Hd=1,Td=function(t){return function(n,r,o){for(var i=-1,l=Object(n),a=o(n),s=a.length;s--;){var c=a[t?s:++i];if(r(l[c],c,l)===!1)break}return n}}))();return Od=e}var Ad,Fd,Ld,_d,jd,Nd,Bd,ca={exports:{}};function Wd(){return Ld||(Ld=1,function(e,t){var n=Gn(),r=Fd?Ad:(Fd=1,Ad=function(){return!1}),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,l=i&&i.exports===o?n.Buffer:void 0,a=(l?l.isBuffer:void 0)||r;e.exports=a}(ca,ca.exports)),ca.exports}var $d,Xd,Gd,Yd,Kd,Vd,Ud,qd,Qd,Jd,Zd,eh,th,nh,rh,oh,ih,ah,lh,sh,ch,uh,dh,hh,fh,gh,ph,mh,vh,wh,yh,bh,xh,Ch,Sh,kh,Mh,Rh,Eh,Ih,Th,Hh,Oh,Ph,Dh,zh,Ah,Fh,Lh,_h,jh,Nh,Bh,Wh,$h,Xh,Gh,Yh,Kh,Vh,Uh,qh,Qh,Jh,Zh,ef,tf,ua,nf,rf,of,af,lf,sf,cf,uf,df,hf,ff,gf,pf,mf,vf,wf,yf,bf,xf,Cf,Sf,kf,Mf,Rf,Ef,If,Tf,Hf,Of,Pf,Df,zf,Af,Ff,Lf,da={exports:{}};function _f(){if(Gd)return Xd;Gd=1;var e=function(){if(jd)return _d;jd=1;var i=io(),l=ji(),a=ao(),s={};return s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,_d=function(c){return a(c)&&l(c.length)&&!!s[i(c)]}}(),t=Bd?Nd:(Bd=1,Nd=function(i){return function(l){return i(l)}}),n=function(){return $d||($d=1,i=da,l=da.exports,a=Ys(),s=l&&!l.nodeType&&l,c=s&&i&&!i.nodeType&&i,h=c&&c.exports===s&&a.process,C=function(){try{return c&&c.require&&c.require("util").types||h&&h.binding&&h.binding("util")}catch{}}(),i.exports=C),da.exports;var i,l,a,s,c,h,C}(),r=n&&n.isTypedArray,o=r?t(r):e;return Xd=o}function F1(){if(Kd)return Yd;Kd=1;var e=zd?Dd:(zd=1,Dd=function(a,s){for(var c=-1,h=Array(a);++c<a;)h[c]=s(c);return h}),t=Li(),n=Xn(),r=Wd(),o=_i(),i=_f(),l=Object.prototype.hasOwnProperty;return Yd=function(a,s){var c=n(a),h=!c&&t(a),C=!c&&!h&&r(a),y=!c&&!h&&!C&&i(a),b=c||h||C||y,p=b?e(a.length,String):[],m=p.length;for(var E in a)!s&&!l.call(a,E)||b&&(E=="length"||C&&(E=="offset"||E=="parent")||y&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||o(E,m))||p.push(E);return p}}function L1(){if(Zd)return Jd;Zd=1;var e=(Qd?qd:(Qd=1,qd=function(t,n){return function(r){return t(n(r))}}))(Object.keys,Object);return Jd=e}function _1(){if(th)return eh;th=1;var e=function(){if(Ud)return Vd;Ud=1;var r=Object.prototype;return Vd=function(o){var i=o&&o.constructor;return o===(typeof i=="function"&&i.prototype||r)}}(),t=L1(),n=Object.prototype.hasOwnProperty;return eh=function(r){if(!e(r))return t(r);var o=[];for(var i in Object(r))n.call(r,i)&&i!="constructor"&&o.push(i);return o}}function ha(){if(rh)return nh;rh=1;var e=F1(),t=_1(),n=ia();return nh=function(r){return n(r)?e(r):t(r)}}function j1(){if(ch)return sh;ch=1;var e=function(){if(ih)return oh;ih=1;var n=A1(),r=ha();return oh=function(o,i){return o&&n(o,i,r)}}(),t=function(){if(lh)return ah;lh=1;var n=ia();return ah=function(r,o){return function(i,l){if(i==null)return i;if(!n(i))return r(i,l);for(var a=i.length,s=o?a:-1,c=Object(i);(o?s--:++s<a)&&l(c[s],s,c)!==!1;);return i}}}()(e);return sh=t}function jf(){if(Sh)return Ch;Sh=1;var e=Uo(),t=function(){if(fh)return hh;fh=1;var a=Uo();return hh=function(){this.__data__=new a,this.size=0}}(),n=ph?gh:(ph=1,gh=function(a){var s=this.__data__,c=s.delete(a);return this.size=s.size,c}),r=vh?mh:(vh=1,mh=function(a){return this.__data__.get(a)}),o=yh?wh:(yh=1,wh=function(a){return this.__data__.has(a)}),i=function(){if(xh)return bh;xh=1;var a=Uo(),s=Ai(),c=Fi();return bh=function(h,C){var y=this.__data__;if(y instanceof a){var b=y.__data__;if(!s||b.length<199)return b.push([h,C]),this.size=++y.size,this;y=this.__data__=new c(b)}return y.set(h,C),this.size=y.size,this}}();function l(a){var s=this.__data__=new e(a);this.size=s.size}return l.prototype.clear=t,l.prototype.delete=n,l.prototype.get=r,l.prototype.has=o,l.prototype.set=i,Ch=l}function Nf(){if(Eh)return Rh;Eh=1;var e=Wu(),t=Mh?kh:(Mh=1,kh=function(r,o){for(var i=-1,l=r==null?0:r.length;++i<l;)if(o(r[i],i,r))return!0;return!1}),n=$u();return Rh=function(r,o,i,l,a,s){var c=1&i,h=r.length,C=o.length;if(h!=C&&!(c&&C>h))return!1;var y=s.get(r),b=s.get(o);if(y&&b)return y==o&&b==r;var p=-1,m=!0,E=2&i?new e:void 0;for(s.set(r,o),s.set(o,r);++p<h;){var g=r[p],w=o[p];if(l)var x=c?l(w,g,p,o,r,s):l(g,w,p,r,o,s);if(x!==void 0){if(x)continue;m=!1;break}if(E){if(!t(o,function(I,v){if(!n(E,v)&&(g===I||a(g,I,i,l,s)))return E.push(v)})){m=!1;break}}else if(g!==w&&!a(g,w,i,l,s)){m=!1;break}}return s.delete(r),s.delete(o),m}}function N1(){if(Dh)return Ph;Dh=1;var e=oo(),t=function(){if(Th)return Ih;Th=1;var s=Gn().Uint8Array;return Ih=s}(),n=zi(),r=Nf(),o=Oh?Hh:(Oh=1,Hh=function(s){var c=-1,h=Array(s.size);return s.forEach(function(C,y){h[++c]=[y,C]}),h}),i=ra(),l=e?e.prototype:void 0,a=l?l.valueOf:void 0;return Ph=function(s,c,h,C,y,b,p){switch(h){case"[object DataView]":if(s.byteLength!=c.byteLength||s.byteOffset!=c.byteOffset)return!1;s=s.buffer,c=c.buffer;case"[object ArrayBuffer]":return!(s.byteLength!=c.byteLength||!b(new t(s),new t(c)));case"[object Boolean]":case"[object Date]":case"[object Number]":return n(+s,+c);case"[object Error]":return s.name==c.name&&s.message==c.message;case"[object RegExp]":case"[object String]":return s==c+"";case"[object Map]":var m=o;case"[object Set]":var E=1&C;if(m||(m=i),s.size!=c.size&&!E)return!1;var g=p.get(s);if(g)return g==c;C|=2,p.set(s,c);var w=r(m(s),m(c),C,y,b,p);return p.delete(s),w;case"[object Symbol]":if(a)return a.call(s)==a.call(c)}return!1}}function B1(){if(Bh)return Nh;Bh=1;var e=Lh?Fh:(Lh=1,Fh=function(o,i){for(var l=-1,a=o==null?0:o.length,s=0,c=[];++l<a;){var h=o[l];i(h,l,o)&&(c[s++]=h)}return c}),t=jh?_h:(jh=1,_h=function(){return[]}),n=Object.prototype.propertyIsEnumerable,r=Object.getOwnPropertySymbols;return Nh=r?function(o){return o==null?[]:(o=Object(o),e(r(o),function(i){return n.call(o,i)}))}:t}function W1(){if($h)return Wh;$h=1;var e=function(){if(Ah)return zh;Ah=1;var r=Ju(),o=Xn();return zh=function(i,l,a){var s=l(i);return o(i)?s:r(s,a(i))}}(),t=B1(),n=ha();return Wh=function(r){return e(r,n,t)}}function $1(){if(Zh)return Jh;Zh=1;var e=function(){if(Kh)return Yh;Kh=1;var w=Ir()(Gn(),"DataView");return Yh=w}(),t=Ai(),n=function(){if(Uh)return Vh;Uh=1;var w=Ir()(Gn(),"Promise");return Vh=w}(),r=Xu(),o=function(){if(Qh)return qh;Qh=1;var w=Ir()(Gn(),"WeakMap");return qh=w}(),i=io(),l=Vs(),a="[object Map]",s="[object Promise]",c="[object Set]",h="[object WeakMap]",C="[object DataView]",y=l(e),b=l(t),p=l(n),m=l(r),E=l(o),g=i;return(e&&g(new e(new ArrayBuffer(1)))!=C||t&&g(new t)!=a||n&&g(n.resolve())!=s||r&&g(new r)!=c||o&&g(new o)!=h)&&(g=function(w){var x=i(w),I=x=="[object Object]"?w.constructor:void 0,v=I?l(I):"";if(v)switch(v){case y:return C;case b:return a;case p:return s;case m:return c;case E:return h}return x}),Jh=g}function X1(){if(tf)return ef;tf=1;var e=jf(),t=Nf(),n=N1(),r=function(){if(Gh)return Xh;Gh=1;var y=W1(),b=Object.prototype.hasOwnProperty;return Xh=function(p,m,E,g,w,x){var I=1&E,v=y(p),M=v.length;if(M!=y(m).length&&!I)return!1;for(var S=M;S--;){var H=v[S];if(!(I?H in m:b.call(m,H)))return!1}var f=x.get(p),B=x.get(m);if(f&&B)return f==m&&B==p;var D=!0;x.set(p,m),x.set(m,p);for(var O=I;++S<M;){var T=p[H=v[S]],j=m[H];if(g)var V=I?g(j,T,H,m,p,x):g(T,j,H,p,m,x);if(!(V===void 0?T===j||w(T,j,E,g,x):V)){D=!1;break}O||(O=H=="constructor")}if(D&&!O){var Z=p.constructor,Q=m.constructor;Z==Q||!("constructor"in p)||!("constructor"in m)||typeof Z=="function"&&Z instanceof Z&&typeof Q=="function"&&Q instanceof Q||(D=!1)}return x.delete(p),x.delete(m),D}}(),o=$1(),i=Xn(),l=Wd(),a=_f(),s="[object Arguments]",c="[object Array]",h="[object Object]",C=Object.prototype.hasOwnProperty;return ef=function(y,b,p,m,E,g){var w=i(y),x=i(b),I=w?c:o(y),v=x?c:o(b),M=(I=I==s?h:I)==h,S=(v=v==s?h:v)==h,H=I==v;if(H&&l(y)){if(!l(b))return!1;w=!0,M=!1}if(H&&!M)return g||(g=new e),w||a(y)?t(y,b,p,m,E,g):n(y,b,I,p,m,E,g);if(!(1&p)){var f=M&&C.call(y,"__wrapped__"),B=S&&C.call(b,"__wrapped__");if(f||B){var D=f?y.value():y,O=B?b.value():b;return g||(g=new e),E(D,O,p,m,g)}}return!!H&&(g||(g=new e),r(y,b,p,m,E,g))}}function Bf(){if(nf)return ua;nf=1;var e=X1(),t=ao();return ua=function n(r,o,i,l,a){return r===o||(r==null||o==null||!t(r)&&!t(o)?r!=r&&o!=o:e(r,o,i,l,n,a))},ua}function Wf(){if(lf)return af;lf=1;var e=Er();return af=function(t){return t==t&&!e(t)}}function $f(){return df?uf:(df=1,uf=function(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}})}function G1(){if(ff)return hf;ff=1;var e=function(){if(of)return rf;of=1;var r=jf(),o=Bf();return rf=function(i,l,a,s){var c=a.length,h=c,C=!s;if(i==null)return!h;for(i=Object(i);c--;){var y=a[c];if(C&&y[2]?y[1]!==i[y[0]]:!(y[0]in i))return!1}for(;++c<h;){var b=(y=a[c])[0],p=i[b],m=y[1];if(C&&y[2]){if(p===void 0&&!(b in i))return!1}else{var E=new r;if(s)var g=s(p,m,b,i,l,E);if(!(g===void 0?o(m,p,3,s,E):g))return!1}}return!0}}(),t=function(){if(cf)return sf;cf=1;var r=Wf(),o=ha();return sf=function(i){for(var l=o(i),a=l.length;a--;){var s=l[a],c=i[s];l[a]=[s,c,r(c)]}return l}}(),n=$f();return hf=function(r){var o=t(r);return o.length==1&&o[0][2]?n(o[0][0],o[0][1]):function(i){return i===r||e(i,r,o)}}}function Xf(){if(pf)return gf;pf=1;var e=Us(),t=Qo();return gf=function(n,r){for(var o=0,i=(r=e(r,n)).length;n!=null&&o<i;)n=n[t(r[o++])];return o&&o==i?n:void 0}}function Y1(){if(xf)return bf;xf=1;var e=yf?wf:(yf=1,wf=function(n,r){return n!=null&&r in Object(n)}),t=qs();return bf=function(n,r){return n!=null&&t(n,r,e)}}function K1(){if(Sf)return Cf;Sf=1;var e=Bf(),t=function(){if(vf)return mf;vf=1;var a=Xf();return mf=function(s,c,h){var C=s==null?void 0:a(s,c);return C===void 0?h:C}}(),n=Y1(),r=Di(),o=Wf(),i=$f(),l=Qo();return Cf=function(a,s){return r(a)&&o(s)?i(l(a),s):function(c){var h=t(c,a);return h===void 0&&h===s?n(c,a):e(s,h,3)}}}function V1(){if(Of)return Hf;Of=1;var e=Ef?Rf:(Ef=1,Rf=function(o){return function(i){return i==null?void 0:i[o]}}),t=function(){if(Tf)return If;Tf=1;var o=Xf();return If=function(i){return function(l){return o(l,i)}}}(),n=Di(),r=Qo();return Hf=function(o){return n(o)?e(r(o)):t(o)}}function U1(){if(Df)return Pf;Df=1;var e=G1(),t=K1(),n=Mf?kf:(Mf=1,kf=function(i){return i}),r=Xn(),o=V1();return Pf=function(i){return typeof i=="function"?i:i==null?n:typeof i=="object"?r(i)?t(i[0],i[1]):e(i):o(i)}}function q1(){if(Af)return zf;Af=1;var e=Id?Ed:(Id=1,Ed=function(o,i,l,a){for(var s=-1,c=o==null?0:o.length;++s<c;){var h=o[s];i(a,h,l(h),o)}return a}),t=function(){if(dh)return uh;dh=1;var o=j1();return uh=function(i,l,a,s){return o(i,function(c,h,C){l(s,c,a(c),C)}),s}}(),n=U1(),r=Xn();return zf=function(o,i){return function(l,a){var s=r(l)?e:t,c=i?i():{};return s(l,o,n(a,2),c)}}}var Q1=function(){if(Lf)return Ff;Lf=1;var e=z1(),t=q1(),n=Object.prototype.hasOwnProperty,r=t(function(o,i,l){n.call(o,l)?o[l].push(i):e(o,l,[i])});return Ff=r}();const J1=Sr(Q1),Gf=(e,t,n)=>{let r=0,o=t,i=0,l=n;if(e!==void 0&&e.length>0){r=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;for(const a of e)r=Math.min(r,a.x-1),o=Math.max(o,a.x+a.width+1),i=Math.min(i,a.y-1),l=Math.max(l,a.y+a.height+1)}return{minX:r,maxX:o,minY:i,maxY:l}};function Yf(e,t,n,r,o,i,l,a,s,c,h,C,y,b,p,m,E,g=!1){if(s!==void 0){e.beginPath(),e.save(),e.rect(0,0,i,l);for(const O of s)e.rect(O.x+1,O.y+1,O.width-1,O.height-1);e.clip("evenodd")}const w=E.horizontalBorderColor??E.borderColor,x=E.borderColor,{minX:I,maxX:v,minY:M,maxY:S}=Gf(a,i,l),H=[];e.beginPath();let f=.5;for(let O=0;O<t.length;O++){const T=t[O];if(T.width===0)continue;f+=T.width;const j=T.sticky?f:f+r;j>=I&&j<=v&&b(O+1)&&H.push({x1:j,y1:Math.max(c,M),x2:j,y2:Math.min(l,S),color:x})}let B=l+.5;for(let O=m-p;O<m;O++)B-=C(O),H.push({x1:I,y1:B,x2:v,y2:B,color:w});if(g!==!0){let O=h+.5,T=n;const j=B;for(;O+o<j;){const V=O+o;if(V>=M&&V<=S-1){const Z=y==null?void 0:y(T);H.push({x1:I,y1:V,x2:v,y2:V,color:(Z==null?void 0:Z.horizontalBorderColor)??(Z==null?void 0:Z.borderColor)??w})}O+=C(T),T++}}const D=J1(H,O=>O.color);for(const O of Object.keys(D)){e.strokeStyle=O;for(const T of D[O])e.moveTo(T.x1,T.y1),e.lineTo(T.x2,T.y2);e.stroke(),e.beginPath()}s!==void 0&&e.restore()}function Kf(e,t,n,r,o,i,l,a,s,c,h,C,y,b,p,m){const E=p==null?void 0:p.filter(S=>S.style!=="no-outline");if(E===void 0||E.length===0)return;const g=Yr(a),w=Or(b,y,C),x=[s,0,a.length,b-y],I=[g,0,t,n-w],v=E.map(S=>{const H=S.range,f=S.style??"dashed";return function(B,D,O,T,j){const[V,Z,Q,ce]=D,[le,q,J,fe]=j,{x:ee,y:se,width:ie,height:W}=B,N=[];if(ie<=0||W<=0)return N;const U=ee+ie,ue=se+W,pe=ee<V,ze=se<Z,Ue=ee+ie>Q,He=se+W>ce,$e=ee>=V&&ee<Q||U>V&&U<=Q||ee<V&&U>Q,be=se>=Z&&se<ce||ue>Z&&ue<=ce||se<Z&&ue>ce;if($e&&be){const ye=Math.max(ee,V),Fe=Math.max(se,Z),Oe=Math.min(U,Q),te=Math.min(ue,ce);N.push({rect:{x:ye,y:Fe,width:Oe-ye,height:te-Fe},clip:{x:le,y:q,width:J-le+1,height:fe-q+1}})}if(pe&&ze){const ye=ee,Fe=se,Oe=Math.min(U,V),te=Math.min(ue,Z);N.push({rect:{x:ye,y:Fe,width:Oe-ye,height:te-Fe},clip:{x:0,y:0,width:le+1,height:q+1}})}if(ze&&$e){const ye=Math.max(ee,V),Fe=se,Oe=Math.min(U,Q),te=Math.min(ue,Z);N.push({rect:{x:ye,y:Fe,width:Oe-ye,height:te-Fe},clip:{x:le,y:0,width:J-le+1,height:q+1}})}if(ze&&Ue){const ye=Math.max(ee,Q),Fe=se,Oe=U,te=Math.min(ue,Z);N.push({rect:{x:ye,y:Fe,width:Oe-ye,height:te-Fe},clip:{x:J,y:0,width:O-J+1,height:q+1}})}if(pe&&be){const ye=ee,Fe=Math.max(se,Z),Oe=Math.min(U,V),te=Math.min(ue,ce);N.push({rect:{x:ye,y:Fe,width:Oe-ye,height:te-Fe},clip:{x:0,y:q,width:le+1,height:fe-q+1}})}if(Ue&&be){const ye=Math.max(ee,Q),Fe=Math.max(se,Z),Oe=U,te=Math.min(ue,ce);N.push({rect:{x:ye,y:Fe,width:Oe-ye,height:te-Fe},clip:{x:J,y:q,width:O-J+1,height:fe-q+1}})}if(pe&&He){const ye=ee,Fe=Math.max(se,ce),Oe=Math.min(U,V),te=ue;N.push({rect:{x:ye,y:Fe,width:Oe-ye,height:te-Fe},clip:{x:0,y:fe,width:le+1,height:T-fe+1}})}if(He&&$e){const ye=Math.max(ee,V),Fe=Math.max(se,ce),Oe=Math.min(U,Q),te=ue;N.push({rect:{x:ye,y:Fe,width:Oe-ye,height:te-Fe},clip:{x:le,y:fe,width:J-le+1,height:T-fe+1}})}if(Ue&&He){const ye=Math.max(ee,Q),Fe=Math.max(se,ce),Oe=U,te=ue;N.push({rect:{x:ye,y:Fe,width:Oe-ye,height:te-Fe},clip:{x:J,y:fe,width:O-J+1,height:T-fe+1}})}return N}(H,x,t,n,I).map(B=>{const D=B.rect,O=Ji(D.x,D.y,t,n,h,c+h,r,o,i,l,b,s,y,a,C),T=D.width===1&&D.height===1?O:Ji(D.x+D.width-1,D.y+D.height-1,t,n,h,c+h,r,o,i,l,b,s,y,a,C);return D.x+D.width>=a.length&&(T.width-=1),D.y+D.height>=b&&(T.height-=1),{color:S.color,style:f,clip:B.clip,rect:H1({x:O.x,y:O.y,width:T.x+T.width-O.x,height:T.y+T.height-O.y},t,n,8)}})}),M=()=>{e.lineWidth=1;let S=!1;for(const H of v)for(const f of H)if((f==null?void 0:f.rect)!==void 0&&xo(0,0,t,n,f.rect.x,f.rect.y,f.rect.width,f.rect.height)){const B=S,D=!T1(f.clip,f.rect);e.beginPath(),D&&(e.save(),e.rect(f.clip.x,f.clip.y,f.clip.width,f.clip.height),e.clip()),f.style!=="dashed"||S?f.style!=="solid"&&f.style!=="solid-outline"||!S||(e.setLineDash([]),S=!1):(e.setLineDash([5,3]),S=!0),e.strokeStyle=f.style==="solid-outline"?In(In(f.color,m.borderColor),m.bgCell):Hr(f.color,1),e.closePath(),e.strokeRect(f.rect.x+.5,f.rect.y+.5,f.rect.width-1,f.rect.height-1),D&&(e.restore(),S=B)}S&&e.setLineDash([])};return M(),M}function Vf(e,t,n,r,o){e.beginPath(),e.moveTo(t,n),e.lineTo(t,r),e.lineWidth=2,e.strokeStyle=o,e.stroke(),e.globalAlpha=1}function fa(e,t,n,r,o,i,l,a,s,c,h,C,y,b,p,m,E){if(h.current===void 0)return;const g=h.current.range,w=h.current.cell,x=[g.x+g.width-1,g.y+g.height-1];if(w[1]>=E&&x[1]>=E||!l.some(O=>O.sourceIndex===w[0]||O.sourceIndex===x[0]))return;const[I,v]=h.current.cell,M=y(h.current.cell),S=M.span??[I,I],H=b>0&&!(v>=E-b)?Or(E,b,C)-1:0,f=x[1];let B;if(gr(l,r,o,i,c,(O,T,j,V,Z)=>{if(O.sticky&&I>O.sourceIndex)return;const Q=O.sourceIndex<S[0],ce=O.sourceIndex>S[1],le=O.sourceIndex===x[0];return le||!Q&&!ce?(ai(Z,j,n,E,C,b,p,void 0,(q,J,fe)=>{if(J!==v&&J!==f)return;let ee=T,se=O.width;if(M.span!==void 0){const ie=pd(M.span,T,q,O.width,fe,O,a),W=O.sticky?ie[0]:ie[1];W!==void 0&&(ee=W.x,se=W.width)}return J===f&&le&&m&&(B=()=>{var ie;V>ee&&!O.sticky&&(e.beginPath(),e.rect(V,0,t-V,n),e.clip()),e.beginPath(),e.rect(ee+se-4,q+fe-4,4,4),e.fillStyle=((ie=O.themeOverride)==null?void 0:ie.accentColor)??s.accentColor,e.fill()}),B!==void 0}),B!==void 0):void 0}),B===void 0)return;const D=()=>{e.save(),e.beginPath(),e.rect(0,c,t,n-c-H),e.clip(),B==null||B(),e.restore()};return D(),D}function Uf(e,t){var _n;const{canvasCtx:n,headerCanvasCtx:r,width:o,height:i,cellXOffset:l,cellYOffset:a,translateX:s,translateY:c,mappedColumns:h,enableGroups:C,freezeColumns:y,dragAndDropState:b,theme:p,drawFocus:m,headerHeight:E,groupHeaderHeight:g,disabledRows:w,rowHeight:x,verticalBorder:I,overrideCursor:v,isResizing:M,selection:S,fillHandle:H,freezeTrailingRows:f,rows:B,getCellContent:D,getGroupDetails:O,getRowThemeOverride:T,isFocused:j,drawHeaderCallback:V,prelightCells:Z,drawCellCallback:Q,highlightRegions:ce,resizeCol:le,imageLoader:q,lastBlitData:J,hoverValues:fe,hyperWrapping:ee,hoverInfo:se,spriteManager:ie,maxScaleFactor:W,hasAppendRow:N,touchMode:U,enqueue:ue,renderStateProvider:pe,getCellRenderer:ze,renderStrategy:Ue,bufferACtx:He,bufferBCtx:$e,damage:be,minimumCellWidth:ye,resizeIndicator:Fe}=e;if(o===0||i===0)return;const Oe=Ue==="double-buffer",te=Math.min(W,Math.ceil(window.devicePixelRatio??1)),Ee=Ue!=="direct"&&function(ne,xe){if(xe===void 0||ne.width!==xe.width||ne.height!==xe.height||ne.theme!==xe.theme||ne.headerHeight!==xe.headerHeight||ne.rowHeight!==xe.rowHeight||ne.rows!==xe.rows||ne.freezeColumns!==xe.freezeColumns||ne.getRowThemeOverride!==xe.getRowThemeOverride||ne.isFocused!==xe.isFocused||ne.isResizing!==xe.isResizing||ne.verticalBorder!==xe.verticalBorder||ne.getCellContent!==xe.getCellContent||ne.highlightRegions!==xe.highlightRegions||ne.selection!==xe.selection||ne.dragAndDropState!==xe.dragAndDropState||ne.prelightCells!==xe.prelightCells||ne.touchMode!==xe.touchMode||ne.maxScaleFactor!==xe.maxScaleFactor)return!1;if(ne.mappedColumns!==xe.mappedColumns){if(ne.mappedColumns.length>100||ne.mappedColumns.length!==xe.mappedColumns.length)return!1;let wt;for(let dt=0;dt<ne.mappedColumns.length;dt++){const xt=ne.mappedColumns[dt],ve=xe.mappedColumns[dt];if($r(xt,ve))continue;if(wt!==void 0||xt.width===ve.width)return!1;const{width:Ve,...Ke}=xt,{width:mt,...it}=ve;if(!$r(Ke,it))return!1;wt=dt}return wt===void 0||wt}return!0}(e,t),ke=n.canvas;ke.width===o*te&&ke.height===i*te||(ke.width=o*te,ke.height=i*te,ke.style.width=o+"px",ke.style.height=i+"px");const Xe=r.canvas,Re=C?g+E:E,qe=Re+1;Xe.width===o*te&&Xe.height===qe*te||(Xe.width=o*te,Xe.height=qe*te,Xe.style.width=o+"px",Xe.style.height=qe+"px");const Ye=He.canvas,ot=$e.canvas;!Oe||Ye.width===o*te&&Ye.height===i*te||(Ye.width=o*te,Ye.height=i*te,J.current!==void 0&&(J.current.aBufferScroll=void 0)),!Oe||ot.width===o*te&&ot.height===i*te||(ot.width=o*te,ot.height=i*te,J.current!==void 0&&(J.current.bBufferScroll=void 0));const Me=J.current;if(Ee===!0&&l===(Me==null?void 0:Me.cellXOffset)&&a===(Me==null?void 0:Me.cellYOffset)&&s===(Me==null?void 0:Me.translateX)&&c===(Me==null?void 0:Me.translateY))return;let Pe=null;Oe&&(Pe=n);const ut=r;let tt;tt=Oe?be!==void 0?(Me==null?void 0:Me.lastBuffer)==="b"?$e:He:(Me==null?void 0:Me.lastBuffer)==="b"?He:$e:n;const pt=tt.canvas,Ft=Oe?pt===Ye?ot:Ye:ke,bt=typeof x=="number"?()=>x:x;ut.save(),tt.save(),ut.beginPath(),tt.beginPath(),ut.textBaseline="middle",tt.textBaseline="middle",te!==1&&(ut.scale(te,te),tt.scale(te,te));const Ze=Qi(h,l,o,b,s);let Yt=[];const nn=m&&((_n=S.current)==null?void 0:_n.cell[1])===a&&c===0;let Kt=!1;if(ce!==void 0){for(const ne of ce)if(ne.style!=="no-outline"&&ne.range.y===a&&c===0){Kt=!0;break}}const qt=()=>{D1(ut,Ze,C,se,o,s,E,g,b,M,S,p,ie,fe,I,O,be,V,U),Yf(ut,Ze,a,s,c,o,i,void 0,void 0,g,Re,bt,T,I,f,B,p,!0),ut.beginPath(),ut.moveTo(0,qe-.5),ut.lineTo(o,qe-.5),ut.strokeStyle=In(p.headerBottomBorderColor??p.horizontalBorderColor??p.borderColor,p.bgHeader),ut.stroke(),Kt&&Kf(ut,o,i,l,a,s,c,h,y,E,g,x,f,B,ce,p),nn&&fa(ut,o,i,a,s,c,Ze,h,p,Re,S,bt,D,f,N,H,B)};if(be!==void 0){const ne=Ze[Ze.length-1].sourceIndex+1,xe=wt=>{vd(wt,Ze,h,i,Re,s,c,a,B,bt,D,O,T,w,j,m,f,N,Yt,be,S,Z,ce,q,ie,fe,se,Q,ee,p,ue,pe,ze,v,ye);const dt=S.current;H&&m&&dt!==void 0&&be.has(Kc(dt.range))&&fa(wt,o,i,a,s,c,Ze,h,p,Re,S,bt,D,f,N,H,B)};return be.hasItemInRegion([{x:l,y:-2,width:ne,height:2},{x:l,y:a,width:ne,height:300},{x:0,y:a,width:y,height:300},{x:0,y:-2,width:y,height:2},{x:l,y:B-f,width:ne,height:f,when:f>0}])&&(xe(tt),Pe!==null&&(Pe.save(),Pe.scale(te,te),Pe.textBaseline="middle",xe(Pe),Pe.restore()),be.hasHeader()&&(function(wt,dt,xt,ve,Ve,Ke,mt,it,at){at!==void 0&&at.size!==0&&(wt.beginPath(),gd(dt,xt,Ke,ve,(vt,Qe,lt,rt,De,Nt)=>{at.hasItemInRectangle({x:vt[0],y:-2,width:vt[1]-vt[0]+1,height:1})&&wt.rect(lt,rt,De,Nt)}),gr(dt,it,Ke,mt,Ve,(vt,Qe,lt,rt)=>{const De=Math.max(0,rt-Qe),Nt=Qe+De+1,gn=vt.width-De-1;at.has([vt.sourceIndex,-1])&&wt.rect(Nt,ve,gn,Ve-ve)}),wt.clip())}(ut,Ze,o,g,Re,s,c,a,be),qt())),tt.restore(),void ut.restore()}if(Ee===!0&&l===(Me==null?void 0:Me.cellXOffset)&&s===(Me==null?void 0:Me.translateX)&&nn===(Me==null?void 0:Me.mustDrawFocusOnHeader)&&Kt===(Me==null?void 0:Me.mustDrawHighlightRingsOnHeader)||qt(),Ee===!0){Rn(Ft!==void 0&&Me!==void 0);const{regions:ne}=function(xe,wt,dt,xt,ve,Ve,Ke,mt,it,at,vt,Qe,lt,rt,De,Nt,gn,Zt,rn){const Bt=[];xe.imageSmoothingEnabled=!1;const Xt=Math.min(ve.cellYOffset,Ke),Sn=Math.max(ve.cellYOffset,Ke);let Rt=0;if(typeof Zt=="number")Rt+=(Sn-Xt)*Zt;else for(let Je=Xt;Je<Sn;Je++)Rt+=Zt(Je);Ke>ve.cellYOffset&&(Rt=-Rt),Rt+=it-ve.translateY;const kn=Math.min(ve.cellXOffset,Ve),pn=Math.max(ve.cellXOffset,Ve);let kt=0;for(let Je=kn;Je<pn;Je++)kt+=Nt[Je].width;Ve>ve.cellXOffset&&(kt=-kt),kt+=mt-ve.translateX;const It=Yr(gn);if(kt!==0&&Rt!==0)return{regions:[]};const Vt=at>0?Or(lt,at,Zt):0,Et=vt-It-Math.abs(kt),Tt=Qe-rt-Vt-Math.abs(Rt)-1;if(Et>150&&Tt>150){const Je={sx:0,sy:0,sw:vt*De,sh:Qe*De,dx:0,dy:0,dw:vt*De,dh:Qe*De};if(Rt>0?(Je.sy=(rt+1)*De,Je.sh=Tt*De,Je.dy=(Rt+rt+1)*De,Je.dh=Tt*De,Bt.push({x:0,y:rt,width:vt,height:Rt+1})):Rt<0&&(Je.sy=(-Rt+rt+1)*De,Je.sh=Tt*De,Je.dy=(rt+1)*De,Je.dh=Tt*De,Bt.push({x:0,y:Qe+Rt-Vt,width:vt,height:-Rt+Vt})),kt>0?(Je.sx=It*De,Je.sw=Et*De,Je.dx=(kt+It)*De,Je.dw=Et*De,Bt.push({x:It-1,y:0,width:kt+2,height:Qe})):kt<0&&(Je.sx=(It-kt)*De,Je.sw=Et*De,Je.dx=It*De,Je.dw=Et*De,Bt.push({x:vt+kt,y:0,width:-kt,height:Qe})),xe.setTransform(1,0,0,1,0,0),rn){if(It>0&&kt!==0&&Rt===0&&(xt===void 0||(dt==null?void 0:dt[1])!==!1)){const Qt=It*De,Mn=Qe*De;xe.drawImage(wt,0,0,Qt,Mn,0,0,Qt,Mn)}if(Vt>0&&kt===0&&Rt!==0&&(xt===void 0||(dt==null?void 0:dt[0])!==!1)){const Qt=(Qe-Vt)*De,Mn=vt*De,mn=Vt*De;xe.drawImage(wt,0,Qt,Mn,mn,0,Qt,Mn,mn)}}xe.drawImage(wt,Je.sx,Je.sy,Je.sw,Je.sh,Je.dx,Je.dy,Je.dw,Je.dh),xe.scale(De,De)}return xe.imageSmoothingEnabled=!0,{regions:Bt}}(tt,Ft,Ft===Ye?Me.aBufferScroll:Me.bBufferScroll,Ft===Ye?Me.bBufferScroll:Me.aBufferScroll,Me,l,a,s,c,f,o,i,B,Re,te,h,Ze,x,Oe);Yt=ne}else Ee!==!1&&(Rn(Me!==void 0),Yt=function(ne,xe,wt,dt,xt,ve,Ve,Ke,mt,it){const at=[];return xe!==ne.cellXOffset||wt!==ne.cellYOffset||dt!==ne.translateX||xt!==ne.translateY||gr(mt,wt,dt,xt,Ke,(vt,Qe,lt,rt)=>{if(vt.sourceIndex===it){const De=Math.max(Qe,rt)+1;return at.push({x:De,y:0,width:ve-De,height:Ve}),!0}}),at}(Me,l,a,s,c,o,i,Re,Ze,Ee));(function(ne,xe,wt,dt,xt,ve,Ve,Ke,mt){let it=!1;for(const rt of xe)if(!rt.sticky){it=Ve(rt.sourceIndex);break}const at=mt.horizontalBorderColor??mt.borderColor,vt=mt.borderColor,Qe=it?Yr(xe):0;let lt;if(Qe!==0&&(lt=Gc(vt,mt.bgCell),ne.beginPath(),ne.moveTo(Qe+.5,0),ne.lineTo(Qe+.5,dt),ne.strokeStyle=lt,ne.stroke()),xt>0){const rt=vt===at&&lt!==void 0?lt:Gc(at,mt.bgCell),De=Or(ve,xt,Ke);ne.beginPath(),ne.moveTo(0,dt-De+.5),ne.lineTo(wt,dt-De+.5),ne.strokeStyle=rt,ne.stroke()}})(tt,Ze,o,i,f,B,I,bt,p);const un=Kf(tt,o,i,l,a,s,c,h,y,E,g,x,f,B,ce,p),jt=m?fa(tt,o,i,a,s,c,Ze,h,p,Re,S,bt,D,f,N,H,B):void 0;if(tt.fillStyle=p.bgCell,Yt.length>0){tt.beginPath();for(const ne of Yt)tt.rect(ne.x,ne.y,ne.width,ne.height);tt.clip(),tt.fill(),tt.beginPath()}else tt.fillRect(0,0,o,i);const Kn=vd(tt,Ze,h,i,Re,s,c,a,B,bt,D,O,T,w,j,m,f,N,Yt,be,S,Z,ce,q,ie,fe,se,Q,ee,p,ue,pe,ze,v,ye);(function(ne,xe,wt,dt,xt,ve,Ve,Ke,mt,it,at,vt,Qe,lt,rt,De,Nt,gn,Zt){if(gn!==void 0||xe[xe.length-1]!==wt[xe.length-1])return;const rn=fd(Nt);gr(xe,mt,Ve,Ke,ve,(Bt,Xt,Sn,Rt,kn)=>{if(Bt!==xe[xe.length-1])return;Xt+=Bt.width;const pn=Math.max(Xt,Rt);pn>dt||(ne.save(),ne.beginPath(),ne.rect(pn,ve+1,1e4,xt-ve-1),ne.clip(),ai(kn,Sn,xt,it,at,rt,De,rn,(kt,It,Vt,Et)=>{if(!Et&&Nt.length>0&&!Nt.some(mn=>xo(Xt,kt,1e4,Vt,mn.x,mn.y,mn.width,mn.height)))return;const Tt=Qe.hasIndex(It),Je=lt.hasIndex(It);ne.beginPath();const Qt=vt==null?void 0:vt(It),Mn=Qt===void 0?Zt:Zn(Zt,Qt);Mn.bgCell!==Zt.bgCell&&(ne.fillStyle=Mn.bgCell,ne.fillRect(Xt,kt,1e4,Vt)),Je&&(ne.fillStyle=Mn.bgHeader,ne.fillRect(Xt,kt,1e4,Vt)),Tt&&(ne.fillStyle=Mn.accentLight,ne.fillRect(Xt,kt,1e4,Vt))}),ne.restore())})})(tt,Ze,h,o,i,Re,s,c,a,B,bt,T,S.rows,w,f,N,Yt,be,p),function(ne,xe,wt,dt,xt,ve,Ve,Ke,mt,it,at,vt,Qe,lt,rt){var Vt;const De=rt.bgCell,{minX:Nt,maxX:gn,minY:Zt,maxY:rn}=Gf(Ke,ve,Ve),Bt=[],Xt=Ve-Or(lt,Qe,it);let Sn=mt,Rt=wt,kn=0;for(;Sn+xt<Xt;){const Et=Sn+xt,Tt=it(Rt);if(Et>=Zt&&Et<=rn-1){const Je=at==null?void 0:at(Rt),Qt=Je==null?void 0:Je.bgCell;Qt!==void 0&&Qt!==De&&Rt>=lt-Qe&&Bt.push({x:Nt,y:Et,w:gn-Nt,h:Tt,color:Qt})}Sn+=Tt,Rt<lt-Qe&&(kn=Sn),Rt++}let pn=0;const kt=Math.min(Xt,rn)-kn;if(kt>0)for(let Et=0;Et<xe.length;Et++){const Tt=xe[Et];if(Tt.width===0)continue;const Je=Tt.sticky?pn:pn+dt,Qt=(Vt=Tt.themeOverride)==null?void 0:Vt.bgCell;Qt!==void 0&&Qt!==De&&Je>=Nt&&Je<=gn&&vt(Et+1)&&Bt.push({x:Je,y:kn,w:Tt.width,h:kt,color:Qt}),pn+=Tt.width}if(Bt.length===0)return;let It;ne.beginPath();for(let Et=Bt.length-1;Et>=0;Et--){const Tt=Bt[Et];It===void 0?It=Tt.color:Tt.color!==It&&(ne.fillStyle=It,ne.fill(),ne.beginPath(),It=Tt.color),ne.rect(Tt.x,Tt.y,Tt.w,Tt.h)}It!==void 0&&(ne.fillStyle=It,ne.fill()),ne.beginPath()}(tt,Ze,a,s,c,o,i,Yt,Re,bt,T,I,f,B,p),Yf(tt,Ze,a,s,c,o,i,Yt,Kn,g,Re,bt,T,I,f,B,p),un==null||un(),jt==null||jt(),M&&Fe!=="none"&&gr(Ze,0,s,0,Re,(ne,xe)=>ne.sourceIndex===le&&(Vf(ut,xe+ne.width,0,Re+1,In(p.resizeIndicatorColor??p.accentLight,p.bgHeader)),Fe==="full"&&Vf(tt,xe+ne.width,Re,i,In(p.resizeIndicatorColor??p.accentLight,p.bgCell)),!0)),Pe!==null&&(Pe.fillStyle=p.bgCell,Pe.fillRect(0,0,o,i),Pe.drawImage(tt.canvas,0,0));const vr=function(ne,xe,wt,dt,xt,ve,Ve,Ke,mt,it){let at=0;return gr(ne,ve,dt,xt,wt,(vt,Qe,lt,rt,De)=>(ai(De,lt,xe,Ve,Ke,mt,it,void 0,(Nt,gn,Zt,rn)=>{rn||(at=Math.max(gn,at))}),!0)),at}(Ze,i,Re,s,c,a,B,bt,f,N);q==null||q.setWindow({x:l,y:a,width:Ze.length,height:vr-a},y,Array.from({length:f},(ne,xe)=>B-1-xe));const Dt=Me!==void 0&&(l!==Me.cellXOffset||s!==Me.translateX),tr=Me!==void 0&&(a!==Me.cellYOffset||c!==Me.translateY);J.current={cellXOffset:l,cellYOffset:a,translateX:s,translateY:c,mustDrawFocusOnHeader:nn,mustDrawHighlightRingsOnHeader:Kt,lastBuffer:Oe?pt===Ye?"a":"b":void 0,aBufferScroll:pt===Ye?[Dt,tr]:Me==null?void 0:Me.aBufferScroll,bBufferScroll:pt===ot?[Dt,tr]:Me==null?void 0:Me.bBufferScroll},tt.restore(),ut.restore()}function Z1(e){const t=e-1;return t*t*t+1}class eg{constructor(t){ft(this,"callback");ft(this,"currentHoveredItem");ft(this,"leavingItems",[]);ft(this,"lastAnimationTime");ft(this,"addToLeavingItems",t=>{this.leavingItems.some(n=>vo(n.item,t.item))||this.leavingItems.push(t)});ft(this,"removeFromLeavingItems",t=>{const n=this.leavingItems.find(r=>vo(r.item,t));return this.leavingItems=this.leavingItems.filter(r=>r!==n),(n==null?void 0:n.hoverAmount)??0});ft(this,"cleanUpLeavingElements",()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)});ft(this,"shouldStep",()=>{const t=this.leavingItems.length>0,n=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||n});ft(this,"getAnimatingItems",()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>({...t,hoverAmount:Z1(t.hoverAmount)})));ft(this,"step",t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const n=(t-this.lastAnimationTime)/80;for(const o of this.leavingItems)o.hoverAmount=On(o.hoverAmount-n,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=On(this.currentHoveredItem.hoverAmount+n,0,1));const r=this.getAnimatingItems();this.callback(r),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0});ft(this,"setHovered",t=>{var n;if(!vo((n=this.currentHoveredItem)==null?void 0:n.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){const r=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:r}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}});this.callback=t}}class tg{constructor(t){ft(this,"fn");ft(this,"val");this.fn=t}get value(){return this.val??(this.val=this.fn())}}function ga(e){return new tg(e)}const ng=ga(()=>window.navigator.userAgent.includes("Firefox")),si=ga(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),ci=ga(()=>window.navigator.platform.toLowerCase().startsWith("mac")),pr="header",Pn="group-header",ui="out-of-bounds";var Vr;function qf(e,t){return e===t||((e==null?void 0:e.kind)==="out-of-bounds"?(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])&&(e==null?void 0:e.region[0])===(t==null?void 0:t.region[0])&&(e==null?void 0:e.region[1])===(t==null?void 0:t.region[1]):(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1]))}(function(e){e[e.Start=-2]="Start",e[e.StartPadding=-1]="StartPadding",e[e.Center=0]="Center",e[e.EndPadding=1]="EndPadding",e[e.End=2]="End"})(Vr||(Vr={}));const rg=d.memo(d.forwardRef((e,t)=>{const{width:n,height:r,accessibilityHeight:o,columns:i,cellXOffset:l,cellYOffset:a,headerHeight:s,fillHandle:c=!1,groupHeaderHeight:h,rowHeight:C,rows:y,getCellContent:b,getRowThemeOverride:p,onHeaderMenuClick:m,onHeaderIndicatorClick:E,enableGroups:g,isFilling:w,onCanvasFocused:x,onCanvasBlur:I,isFocused:v,selection:M,freezeColumns:S,onContextMenu:H,freezeTrailingRows:f,fixedShadowX:B=!0,fixedShadowY:D=!0,drawFocusRing:O,onMouseDown:T,onMouseUp:j,onMouseMoveRaw:V,onMouseMove:Z,onItemHovered:Q,dragAndDropState:ce,firstColAccessible:le,onKeyDown:q,onKeyUp:J,highlightRegions:fe,canvasRef:ee,onDragStart:se,onDragEnd:ie,eventTargetRef:W,isResizing:N,resizeColumn:U,isDragging:ue,isDraggable:pe=!1,allowResize:ze,disabledRows:Ue,hasAppendRow:He,getGroupDetails:$e,theme:be,prelightCells:ye,headerIcons:Fe,verticalBorder:Oe,drawCell:te,drawHeader:Ee,onCellFocused:ke,onDragOverCell:Xe,onDrop:Re,onDragLeave:qe,imageWindowLoader:Ye,smoothScrollX:ot=!1,smoothScrollY:Me=!1,experimental:Pe,getCellRenderer:ut,resizeIndicator:tt="full"}=e,pt=e.translateX??0,Ft=e.translateY??0,bt=Math.max(S,Math.min(i.length-1,l)),Ze=d.useRef(null),Yt=d.useRef((Pe==null?void 0:Pe.eventTarget)??window),nn=Yt.current,Kt=Ye,qt=d.useRef(),[un,jt]=d.useState(!1),Kn=d.useRef([]),vr=d.useRef(),[Dt,tr]=d.useState(),[_n,ne]=d.useState(),xe=d.useRef(null),[wt,dt]=d.useState(),[xt,ve]=d.useState(!1),Ve=d.useRef(xt);Ve.current=xt;const Ke=d.useMemo(()=>new I1(Fe,()=>{kn.current=void 0,Vt.current()}),[Fe]),mt=g?h+s:s,it=d.useRef(-1),at=((Pe==null?void 0:Pe.enableFirefoxRescaling)??!1)&&ng.value,vt=((Pe==null?void 0:Pe.enableSafariRescaling)??!1)&&si.value;d.useLayoutEffect(()=>{window.devicePixelRatio!==1&&(at||vt)&&(it.current!==-1&&jt(!0),window.clearTimeout(it.current),it.current=window.setTimeout(()=>{jt(!1),it.current=-1},200))},[a,bt,pt,Ft,at,vt]);const Qe=function(L,ae){return $t.useMemo(()=>L.map((de,Ce)=>({group:de.group,grow:de.grow,hasMenu:de.hasMenu,icon:de.icon,id:de.id,menuIcon:de.menuIcon,overlayIcon:de.overlayIcon,sourceIndex:Ce,sticky:Ce<ae,indicatorIcon:de.indicatorIcon,style:de.style,themeOverride:de.themeOverride,title:de.title,trailingRowOptions:de.trailingRowOptions,width:de.width,growOffset:de.growOffset,rowMarker:de.rowMarker,rowMarkerChecked:de.rowMarkerChecked,headerRowMarkerTheme:de.headerRowMarkerTheme,headerRowMarkerAlwaysVisible:de.headerRowMarkerAlwaysVisible,headerRowMarkerDisabled:de.headerRowMarkerDisabled})),[L,ae])}(i,S),lt=d.useMemo(()=>B?Yr(Qe,ce):0,[Qe,ce,B]),rt=d.useCallback((L,ae,de)=>{const Ce=L.getBoundingClientRect();if(ae>=Qe.length||de>=y)return;const he=Ce.width/n,z=Ji(ae,de,n,r,h,mt,bt,a,pt,Ft,y,S,f,Qe,C);return he!==1&&(z.x*=he,z.y*=he,z.width*=he,z.height*=he),z.x+=Ce.x,z.y+=Ce.y,z},[n,r,h,mt,bt,a,pt,Ft,y,S,f,Qe,C]),De=d.useCallback((L,ae,de,Ce)=>{const he=L.getBoundingClientRect(),z=he.width/n,Ie=(ae-he.left)/z,Le=(de-he.top)/z,Be=Qi(Qe,bt,n,void 0,pt);let Mt=0,Ae=0;Ce instanceof MouseEvent&&(Mt=Ce.button,Ae=Ce.buttons);const _e=function(Ne,ht,gt){let yn=0;for(const an of ht){if(Ne<=(an.sticky?yn:yn+(gt??0))+an.width)return an.sourceIndex;yn+=an.width}return-1}(Ie,Be,pt),et=function(Ne,ht,gt,yn,an,lr,Ht,hn,vi,Qr){const sr=yn+an;if(gt&&Ne<=an)return-2;if(Ne<=sr)return-1;let Ao=ht;for(let Gt=0;Gt<Qr;Gt++){const Dn=lr-1-Gt;if(Ao-=typeof Ht=="number"?Ht:Ht(Dn),Ne>=Ao)return Dn}const Fo=lr-Qr,Ct=Ne-(vi??0);if(typeof Ht=="number"){const Gt=Math.floor((Ct-sr)/Ht)+hn;return Gt>=Fo?void 0:Gt}{let Gt=sr;for(let Dn=hn;Dn<Fo;Dn++){const Lo=Ht(Dn);if(Ct<=Gt+Lo)return Dn;Gt+=Lo}return}}(Le,r,g,s,h,y,C,a,Ft,f),dn=(Ce==null?void 0:Ce.shiftKey)===!0,en=(Ce==null?void 0:Ce.ctrlKey)===!0,br=(Ce==null?void 0:Ce.metaKey)===!0,ar=Ce!==void 0&&!(Ce instanceof MouseEvent)||(Ce==null?void 0:Ce.pointerType)==="touch",on=[Ie<0?-1:n<Ie?1:0,Le<mt?-1:r<Le?1:0];let Lt;if(_e===-1||Le<0||Ie<0||et===void 0||Ie>n||Le>r){const Ne=Ie>n?1:Ie<0?-1:0,ht=Le>r?1:Le<0?-1:0;let gt=2*Ne,yn=2*ht;Ne===0&&(gt=_e===-1?Vr.EndPadding:Vr.Center),ht===0&&(yn=et===void 0?Vr.EndPadding:Vr.Center);let an=!1;if(_e===-1&&et===-1){const Ht=rt(L,Qe.length-1,-1);Rn(Ht!==void 0),an=ae<Ht.x+Ht.width+5}const lr=Ie>n&&Ie<n+Ki()||Le>r&&Le<r+Ki();Lt={kind:ui,location:[_e!==-1?_e:Ie<0?0:Qe.length-1,et??y-1],region:[gt,yn],shiftKey:dn,ctrlKey:en,metaKey:br,isEdge:an,isTouch:ar,button:Mt,buttons:Ae,scrollEdge:on,isMaybeScrollbar:lr}}else if(et<=-1){let Ne=rt(L,_e,et);Rn(Ne!==void 0);let ht=Ne!==void 0&&Ne.x+Ne.width-ae<=5;const gt=_e-1;ae-Ne.x<=5&&gt>=0?(ht=!0,Ne=rt(L,gt,et),Rn(Ne!==void 0),Lt={kind:g&&et===-2?Pn:pr,location:[gt,et],bounds:Ne,group:Qe[gt].group??"",isEdge:ht,shiftKey:dn,ctrlKey:en,metaKey:br,isTouch:ar,localEventX:ae-Ne.x,localEventY:de-Ne.y,button:Mt,buttons:Ae,scrollEdge:on}):Lt={kind:g&&et===-2?Pn:pr,group:Qe[_e].group??"",location:[_e,et],bounds:Ne,isEdge:ht,shiftKey:dn,ctrlKey:en,metaKey:br,isTouch:ar,localEventX:ae-Ne.x,localEventY:de-Ne.y,button:Mt,buttons:Ae,scrollEdge:on}}else{const Ne=rt(L,_e,et);Rn(Ne!==void 0);const ht=Ne!==void 0&&Ne.x+Ne.width-ae<5;let gt=!1;if(c&&M.current!==void 0){const yn=Kc(M.current.range),an=rt(L,yn[0],yn[1]);if(an!==void 0){const lr=an.x+an.width-2,Ht=an.y+an.height-2;gt=Math.abs(lr-ae)<6&&Math.abs(Ht-de)<6}}Lt={kind:"cell",location:[_e,et],bounds:Ne,isEdge:ht,shiftKey:dn,ctrlKey:en,isFillHandle:gt,metaKey:br,isTouch:ar,localEventX:ae-Ne.x,localEventY:de-Ne.y,button:Mt,buttons:Ae,scrollEdge:on}}return Lt},[n,Qe,bt,pt,r,g,s,h,y,C,a,Ft,f,rt,c,M,mt]),[Nt]=Dt??[],gn=d.useRef(()=>{}),Zt=d.useRef(Dt);Zt.current=Dt;const[rn,Bt]=d.useMemo(()=>{const L=document.createElement("canvas"),ae=document.createElement("canvas");return L.style.display="none",L.style.opacity="0",L.style.position="fixed",ae.style.display="none",ae.style.opacity="0",ae.style.position="fixed",[L.getContext("2d",{alpha:!1}),ae.getContext("2d",{alpha:!1})]},[]);d.useLayoutEffect(()=>{if(rn!==null&&Bt!==null)return document.documentElement.append(rn.canvas),document.documentElement.append(Bt.canvas),()=>{rn.canvas.remove(),Bt.canvas.remove()}},[rn,Bt]);const Xt=d.useMemo(()=>new y1,[]),Sn=at&&un?1:vt&&un?2:5,Rt=(Pe==null?void 0:Pe.disableMinimumCellWidth)===!0?1:10,kn=d.useRef(),pn=d.useRef(null),kt=d.useRef(null),It=d.useCallback(()=>{var z;const L=Ze.current,ae=xe.current;if(L===null||ae===null||(pn.current===null&&(pn.current=L.getContext("2d",{alpha:!1}),L.width=0,L.height=0),kt.current===null&&(kt.current=ae.getContext("2d",{alpha:!1}),ae.width=0,ae.height=0),pn.current===null||kt.current===null||rn===null||Bt===null))return;let de=!1;const Ce=kn.current,he={headerCanvasCtx:kt.current,canvasCtx:pn.current,bufferACtx:rn,bufferBCtx:Bt,width:n,height:r,cellXOffset:bt,cellYOffset:a,translateX:Math.round(pt),translateY:Math.round(Ft),mappedColumns:Qe,enableGroups:g,freezeColumns:S,dragAndDropState:ce,theme:be,headerHeight:s,groupHeaderHeight:h,disabledRows:Ue??yt.empty(),rowHeight:C,verticalBorder:Oe,isResizing:N,resizeCol:U,isFocused:v,selection:M,fillHandle:c,drawCellCallback:te,hasAppendRow:He,overrideCursor:Ie=>{de=!0,dt(Ie)},maxScaleFactor:Sn,freezeTrailingRows:f,rows:y,drawFocus:O,getCellContent:b,getGroupDetails:$e??(Ie=>({name:Ie})),getRowThemeOverride:p,drawHeaderCallback:Ee,prelightCells:ye,highlightRegions:fe,imageLoader:Kt,lastBlitData:vr,damage:qt.current,hoverValues:Kn.current,hoverInfo:Zt.current,spriteManager:Ke,scrolling:un,hyperWrapping:(Pe==null?void 0:Pe.hyperWrapping)??!1,touchMode:xt,enqueue:gn.current,renderStateProvider:Xt,renderStrategy:(Pe==null?void 0:Pe.renderStrategy)??(si.value?"double-buffer":"single-buffer"),getCellRenderer:ut,minimumCellWidth:Rt,resizeIndicator:tt};he.damage===void 0?(kn.current=he,Uf(he,Ce)):Uf(he,void 0),de||he.damage!==void 0&&!he.damage.has((z=Zt==null?void 0:Zt.current)==null?void 0:z[0])||dt(void 0)},[rn,Bt,n,r,bt,a,pt,Ft,Qe,g,S,ce,be,s,h,Ue,C,Oe,N,He,U,v,M,c,f,y,O,Sn,b,$e,p,te,Ee,ye,fe,Kt,Ke,un,Pe==null?void 0:Pe.hyperWrapping,Pe==null?void 0:Pe.renderStrategy,xt,Xt,ut,Rt,tt]),Vt=d.useRef(It);d.useLayoutEffect(()=>{It(),Vt.current=It},[It]),d.useLayoutEffect(()=>{(async()=>{var L;((L=document==null?void 0:document.fonts)==null?void 0:L.ready)!==void 0&&(await document.fonts.ready,kn.current=void 0,Vt.current())})()},[]);const Et=d.useCallback(L=>{qt.current=L,Vt.current(),qt.current=void 0},[]),Tt=function(L){const ae=d.useRef([]),de=d.useRef(0),Ce=d.useRef(L);Ce.current=L;const he=d.useCallback(()=>{const z=()=>{const Ie=ae.current.map(ta);ae.current=[],Ce.current(new bo(Ie)),ae.current.length>0?de.current++:de.current=0};window.requestAnimationFrame(de.current>600?()=>window.requestAnimationFrame(z):z)},[]);return d.useCallback(z=>{ae.current.length===0&&he();const Ie=Ln(z[0],z[1]);ae.current.includes(Ie)||ae.current.push(Ie)},[he])}(Et);gn.current=Tt;const Je=d.useCallback(L=>{Et(new bo(L.map(ae=>ae.cell)))},[Et]);Kt.setCallback(Et);const[Qt,Mn]=d.useState(!1),[mn,wr]=Nt??[],Ro=mn!==void 0&&wr===-1&&i[mn].headerRowMarkerDisabled!==!0,Ca=mn!==void 0&&wr===-2;let Eo=!1,Io=!1,zr=wt;if(zr===void 0&&mn!==void 0&&wr!==void 0&&wr>-1&&wr<y){const L=b([mn,wr],!0);Eo=L.kind===Hn.NewRow||L.kind===Hn.Marker&&L.markerKind!=="number",Io=L.kind===me.Boolean&&Bi(L),zr=L.cursor}const Ot=ue?"grabbing":(_n??!1)||N?"col-resize":Qt||w?"crosshair":zr!==void 0?zr:Ro||Eo||Io||Ca?"pointer":"default",vn=d.useMemo(()=>({contain:"strict",display:"block",cursor:Ot}),[Ot]),gi=d.useRef("default"),To=W==null?void 0:W.current;To!=null&&gi.current!==vn.cursor&&(To.style.cursor=gi.current=vn.cursor);const nr=d.useCallback((L,ae,de,Ce)=>{if($e===void 0)return;const he=$e(L);if(he.actions!==void 0){const z=yd(ae,he.actions);for(const[Ie,Le]of z.entries())if(Dr(Le,de+ae.x,Ce+Le.y))return he.actions[Ie]}},[$e]),rr=d.useCallback((L,ae,de,Ce)=>{const he=Qe[ae];if(!ue&&!N&&!_n){const z=rt(L,ae,-1);Rn(z!==void 0);const Ie=bd(void 0,he,z.x,z.y,z.width,z.height,be,Yi(he.title)==="rtl");if(he.hasMenu===!0&&Ie.menuBounds!==void 0&&Dr(Ie.menuBounds,de,Ce))return{area:"menu",bounds:Ie.menuBounds};if(he.indicatorIcon!==void 0&&Ie.indicatorIconBounds!==void 0&&Dr(Ie.indicatorIconBounds,de,Ce))return{area:"indicator",bounds:Ie.indicatorIconBounds}}},[Qe,rt,_n,ue,N,be]),qr=d.useRef(0),or=d.useRef(),yr=d.useRef(!1),ir=d.useCallback(L=>{const ae=Ze.current,de=W==null?void 0:W.current;if(ae===null||L.target!==ae&&L.target!==de)return;let Ce,he;if(yr.current=!0,L instanceof MouseEvent?(Ce=L.clientX,he=L.clientY):(Ce=L.touches[0].clientX,he=L.touches[0].clientY),L.target===de&&de!==null){const Ie=de.getBoundingClientRect();if(Ce>Ie.right||he>Ie.bottom)return}const z=De(ae,Ce,he,L);if(or.current=z.location,z.isTouch&&(qr.current=Date.now()),Ve.current!==z.isTouch&&ve(z.isTouch),z.kind!==pr||rr(ae,z.location[0],Ce,he)===void 0){if(z.kind===Pn&&nr(z.group,z.bounds,z.localEventX,z.localEventY)!==void 0)return;T==null||T(z),!z.isTouch&&pe!==!0&&pe!==z.kind&&z.button<3&&z.button!==1&&L.preventDefault()}},[W,pe,De,nr,rr,T]);cn("touchstart",ir,nn,!1),cn("mousedown",ir,nn,!1);const Ar=d.useRef(0),pi=d.useCallback(L=>{var _e,et;const ae=Ar.current;Ar.current=Date.now();const de=Ze.current;if(yr.current=!1,j===void 0||de===null)return;const Ce=W==null?void 0:W.current,he=L.target!==de&&L.target!==Ce;let z,Ie,Le=!0;if(L instanceof MouseEvent){if(z=L.clientX,Ie=L.clientY,Le=L.button<3,L.pointerType==="touch")return}else z=L.changedTouches[0].clientX,Ie=L.changedTouches[0].clientY;let Be=De(de,z,Ie,L);Be.isTouch&&qr.current!==0&&Date.now()-qr.current>500&&(Be={...Be,isLongTouch:!0}),ae!==0&&Date.now()-ae<(Be.isTouch?1e3:500)&&(Be={...Be,isDoubleClick:!0}),Ve.current!==Be.isTouch&&ve(Be.isTouch),!he&&L.cancelable&&Le&&L.preventDefault();const[Mt]=Be.location,Ae=rr(de,Mt,z,Ie);if(Be.kind!==pr||Ae===void 0){if(Be.kind===Pn){const dn=nr(Be.group,Be.bounds,Be.localEventX,Be.localEventY);if(dn!==void 0)return void(Be.button===0&&dn.onClick(Be))}j(Be,he)}else Be.button===0&&((_e=or.current)==null?void 0:_e[0])===Mt&&((et=or.current)==null?void 0:et[1])===-1||j(Be,!0)},[j,W,De,rr,nr]);cn("mouseup",pi,nn,!1),cn("touchend",pi,nn,!1),cn("click",d.useCallback(L=>{var Mt,Ae;const ae=Ze.current;if(ae===null)return;const de=W==null?void 0:W.current,Ce=L.target!==ae&&L.target!==de;let he,z,Ie=!0;L instanceof MouseEvent?(he=L.clientX,z=L.clientY,Ie=L.button<3):(he=L.changedTouches[0].clientX,z=L.changedTouches[0].clientY);const Le=De(ae,he,z,L);Ve.current!==Le.isTouch&&ve(Le.isTouch),!Ce&&L.cancelable&&Ie&&L.preventDefault();const[Be]=Le.location;if(Le.kind===pr){const _e=rr(ae,Be,he,z);_e!==void 0&&Le.button===0&&((Mt=or.current)==null?void 0:Mt[0])===Be&&((Ae=or.current)==null?void 0:Ae[1])===-1&&(_e.area==="menu"?m==null||m(Be,_e.bounds):_e.area==="indicator"&&(E==null||E(Be,_e.bounds)))}else if(Le.kind===Pn){const _e=nr(Le.group,Le.bounds,Le.localEventX,Le.localEventY);_e!==void 0&&Le.button===0&&_e.onClick(Le)}},[W,De,rr,m,E,nr]),nn,!1),cn("contextmenu",d.useCallback(L=>{const ae=Ze.current,de=W==null?void 0:W.current;if(ae===null||L.target!==ae&&L.target!==de||H===void 0)return;const Ce=De(ae,L.clientX,L.clientY,L);H(Ce,()=>{L.cancelable&&L.preventDefault()})},[W,De,H]),(W==null?void 0:W.current)??null,!1);const Ho=d.useCallback(L=>{qt.current=new bo(L.map(ae=>ae.item)),Kn.current=L,Vt.current(),qt.current=void 0},[]),Ge=d.useMemo(()=>new eg(Ho),[Ho]),Oo=d.useRef(Ge);Oo.current=Ge,d.useLayoutEffect(()=>{const L=Oo.current;if(Nt===void 0||Nt[1]<0)return void L.setHovered(Nt);const ae=b(Nt,!0),de=ut(ae),Ce=de===void 0&&ae.kind===me.Custom||(de==null?void 0:de.needsHover)!==void 0&&(typeof de.needsHover=="boolean"?de.needsHover:de.needsHover(ae));L.setHovered(Ce?Nt:void 0)},[b,ut,Nt]);const mi=d.useRef();cn("mousemove",d.useCallback(L=>{var Le;const ae=Ze.current;if(ae===null)return;const de=W==null?void 0:W.current,Ce=L.target!==ae&&L.target!==de,he=De(ae,L.clientX,L.clientY,L);if(he.kind!=="out-of-bounds"&&Ce&&!yr.current&&!he.isTouch)return;const z=(Be,Mt)=>{tr(Ae=>Ae===Be?Ae:(Ae==null?void 0:Ae[0][0])!==(Be==null?void 0:Be[0][0])||(Ae==null?void 0:Ae[0][1])!==(Be==null?void 0:Be[0][1])||((Ae==null?void 0:Ae[1][0])!==(Be==null?void 0:Be[1][0])||(Ae==null?void 0:Ae[1][1])!==(Be==null?void 0:Be[1][1]))&&Mt?Be:Ae)};if(qf(he,mi.current)){if(he.kind==="cell"||he.kind===pr||he.kind===Pn){let Be=!1,Mt=!0;if(he.kind==="cell"){const _e=b(he.location);Mt=((Le=ut(_e))==null?void 0:Le.needsHoverPosition)??_e.kind===me.Custom,Be=Mt}else Be=!0;const Ae=[he.location,[he.localEventX,he.localEventY]];z(Ae,Mt),Zt.current=Ae,Be&&Et(new bo([he.location]))}}else dt(void 0),Q==null||Q(he),z(he.kind===ui?void 0:[he.location,[he.localEventX,he.localEventY]],!0),mi.current=he;const Ie=he.location[0]>=(le?0:1);ne(he.kind===pr&&he.isEdge&&Ie&&ze===!0),Mn(he.kind==="cell"&&he.isFillHandle),V==null||V(L),Z(he)},[W,De,le,ze,V,Z,Q,b,ut,Et]),nn,!0);const jn=d.useCallback(L=>{const ae=Ze.current;if(ae===null)return;let de,Ce;M.current!==void 0&&(de=rt(ae,M.current.cell[0],M.current.cell[1]),Ce=M.current.cell),q==null||q({bounds:de,stopPropagation:()=>L.stopPropagation(),preventDefault:()=>L.preventDefault(),cancel:()=>{},ctrlKey:L.ctrlKey,metaKey:L.metaKey,shiftKey:L.shiftKey,altKey:L.altKey,key:L.key,keyCode:L.keyCode,rawEvent:L,location:Ce})},[q,M,rt]),Sa=d.useCallback(L=>{const ae=Ze.current;if(ae===null)return;let de,Ce;M.current!==void 0&&(de=rt(ae,M.current.cell[0],M.current.cell[1]),Ce=M.current.cell),J==null||J({bounds:de,stopPropagation:()=>L.stopPropagation(),preventDefault:()=>L.preventDefault(),cancel:()=>{},ctrlKey:L.ctrlKey,metaKey:L.metaKey,shiftKey:L.shiftKey,altKey:L.altKey,key:L.key,keyCode:L.keyCode,rawEvent:L,location:Ce})},[J,M,rt]),Vn=d.useCallback(L=>{if(Ze.current=L,ee!==void 0&&(ee.current=L),Pe==null?void 0:Pe.eventTarget)Yt.current=Pe.eventTarget;else if(L===null)Yt.current=window;else{const ae=L.getRootNode();ae===document&&(Yt.current=window),Yt.current=ae}},[ee,Pe==null?void 0:Pe.eventTarget]);cn("dragstart",d.useCallback(L=>{const ae=Ze.current;if(ae===null||pe===!1||N)return void L.preventDefault();let de,Ce;const he=De(ae,L.clientX,L.clientY);if(pe!==!0&&he.kind!==pe)return void L.preventDefault();let z,Ie,Le,Be=!1;if(se==null||se({...he,setData:(Mt,Ae)=>{de=Mt,Ce=Ae},setDragImage:(Mt,Ae,_e)=>{z=Mt,Ie=Ae,Le=_e},preventDefault:()=>Be=!0,defaultPrevented:()=>Be}),Be||de===void 0||Ce===void 0||L.dataTransfer===null)L.preventDefault();else if(L.dataTransfer.setData(de,Ce),L.dataTransfer.effectAllowed="copyLink",z!==void 0&&Ie!==void 0&&Le!==void 0)L.dataTransfer.setDragImage(z,Ie,Le);else{const[Mt,Ae]=he.location;if(Ae!==void 0){const _e=document.createElement("canvas"),et=rt(ae,Mt,Ae);Rn(et!==void 0);const dn=Math.ceil(window.devicePixelRatio??1);_e.width=et.width*dn,_e.height=et.height*dn;const en=_e.getContext("2d");en!==null&&(en.scale(dn,dn),en.textBaseline="middle",Ae===-1?(en.font=be.headerFontFull,en.fillStyle=be.bgHeader,en.fillRect(0,0,_e.width,_e.height),Cd(en,0,0,et.width,et.height,Qe[Mt],!1,be,!1,void 0,void 0,!1,0,Ke,Ee,!1)):(en.font=be.baseFontFull,en.fillStyle=be.bgCell,en.fillRect(0,0,_e.width,_e.height),wd(en,b([Mt,Ae]),0,Ae,!1,!1,0,0,et.width,et.height,!1,be,be.bgCell,Kt,Ke,1,void 0,!1,0,void 0,void 0,void 0,Xt,ut,()=>{}))),_e.style.left="-100%",_e.style.position="absolute",_e.style.width=`${et.width}px`,_e.style.height=`${et.height}px`,document.body.append(_e),L.dataTransfer.setDragImage(_e,et.width/2,et.height/2),window.setTimeout(()=>{_e.remove()},0)}}},[pe,N,De,se,rt,be,Qe,Ke,Ee,b,Kt,Xt,ut]),(W==null?void 0:W.current)??null,!1,!1);const Fr=d.useRef();cn("dragover",d.useCallback(L=>{const ae=Ze.current;if(Re!==void 0&&L.preventDefault(),ae===null||Xe===void 0)return;const de=De(ae,L.clientX,L.clientY),[Ce,he]=de.location,z=Ce-(le?0:1),[Ie,Le]=Fr.current??[];Ie===z&&Le===he||(Fr.current=[z,he],Xe([z,he],L.dataTransfer))},[le,De,Xe,Re]),(W==null?void 0:W.current)??null,!1,!1),cn("dragend",d.useCallback(()=>{Fr.current=void 0,ie==null||ie()},[ie]),(W==null?void 0:W.current)??null,!1,!1),cn("drop",d.useCallback(L=>{const ae=Ze.current;if(ae===null||Re===void 0)return;L.preventDefault();const de=De(ae,L.clientX,L.clientY),[Ce,he]=de.location;Re([Ce-(le?0:1),he],L.dataTransfer)},[le,De,Re]),(W==null?void 0:W.current)??null,!1,!1),cn("dragleave",d.useCallback(()=>{qe==null||qe()},[qe]),(W==null?void 0:W.current)??null,!1,!1);const Po=d.useRef(M);Po.current=M;const Lr=d.useRef(null),Do=d.useCallback(L=>{var ae;Ze.current!==null&&Ze.current.contains(document.activeElement)&&(L===null&&Po.current.current!==void 0?(ae=ee==null?void 0:ee.current)==null||ae.focus({preventScroll:!0}):L!==null&&L.focus({preventScroll:!0}),Lr.current=L)},[ee]);d.useImperativeHandle(t,()=>({focus:()=>{var ae;const L=Lr.current;L!==null&&document.contains(L)?L.focus({preventScroll:!0}):(ae=ee==null?void 0:ee.current)==null||ae.focus({preventScroll:!0})},getBounds:(L,ae)=>{if(ee!==void 0&&ee.current!==null)return rt(ee.current,L??0,ae??-1)},damage:Je,getMouseArgsForPosition:(L,ae,de)=>{if(ee!==void 0&&ee.current!==null)return De(ee.current,L,ae,de)}}),[ee,Je,rt]);const zo=d.useRef(),Un=function(L,ae,de){const[Ce,he]=d.useState(L),z=d.useRef(!0);d.useEffect(()=>()=>{z.current=!1},[]);const Ie=d.useRef(Fc(Le=>{z.current&&he(Le)},de));return d.useLayoutEffect(()=>{z.current&&Ie.current(()=>L())},ae),Ce}(()=>{var Le,Be,Mt;if(n<50||(Pe==null?void 0:Pe.disableAccessibilityTree)===!0)return null;let L=Qi(Qe,bt,n,ce,pt);const ae=le?0:-1;le||((Le=L[0])==null?void 0:Le.sourceIndex)!==0||(L=L.slice(1));const[de,Ce]=((Be=M.current)==null?void 0:Be.cell)??[],he=(Mt=M.current)==null?void 0:Mt.range,z=L.map(Ae=>Ae.sourceIndex),Ie=Pr(a,Math.min(y,a+o));return de===void 0||Ce===void 0||z.includes(de)&&Ie.includes(Ce)||Do(null),d.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":y+1,"aria-multiselectable":"true","aria-colcount":Qe.length+ae},d.createElement("thead",{role:"rowgroup"},d.createElement("tr",{role:"row","aria-rowindex":1},L.map(Ae=>d.createElement("th",{role:"columnheader","aria-selected":M.columns.hasIndex(Ae.sourceIndex),"aria-colindex":Ae.sourceIndex+1+ae,tabIndex:-1,onFocus:_e=>{if(_e.target!==Lr.current)return ke==null?void 0:ke([Ae.sourceIndex,-1])},key:Ae.sourceIndex},Ae.title)))),d.createElement("tbody",{role:"rowgroup"},Ie.map(Ae=>d.createElement("tr",{role:"row","aria-selected":M.rows.hasIndex(Ae),key:Ae,"aria-rowindex":Ae+2},L.map(_e=>{const et=_e.sourceIndex,dn=Ln(et,Ae),en=de===et&&Ce===Ae,br=he!==void 0&&et>=he.x&&et<he.x+he.width&&Ae>=he.y&&Ae<he.y+he.height,ar=`glide-cell-${et}-${Ae}`,on=[et,Ae],Lt=b(on,!0);return d.createElement("td",{key:dn,role:"gridcell","aria-colindex":et+1+ae,"aria-selected":br,"aria-readonly":kr(Lt)||!so(Lt),id:ar,"data-testid":ar,onClick:()=>{const Ne=ee==null?void 0:ee.current;if(Ne!=null)return q==null?void 0:q({bounds:rt(Ne,et,Ae),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:on})},onFocusCapture:Ne=>{var ht,gt;if(Ne.target!==Lr.current&&(((ht=zo.current)==null?void 0:ht[0])!==et||((gt=zo.current)==null?void 0:gt[1])!==Ae))return zo.current=on,ke==null?void 0:ke(on)},ref:en?Do:void 0,tabIndex:-1},((Ne,ht)=>{if(Ne.kind===me.Custom)return Ne.copyData;const gt=ht==null?void 0:ht(Ne);return(gt==null?void 0:gt.getAccessibilityString(Ne))??""})(Lt,ut))})))))},[n,Qe,bt,ce,pt,y,a,o,M,Do,b,ee,q,rt,ke],200),Nn=S!==0&&B?bt>S?1:On(-pt/100,0,1):0,wn=D?On(-(32*-a+Ft)/100,0,1):0,K=d.useMemo(()=>{if(!Nn&&!wn)return null;const L={position:"absolute",top:0,left:lt,width:n-lt,height:r,opacity:Nn,pointerEvents:"none",transition:ot?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},ae={position:"absolute",top:mt,left:0,width:n,height:r,opacity:wn,pointerEvents:"none",transition:Me?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return d.createElement(d.Fragment,null,Nn>0&&d.createElement("div",{id:"shadow-x",style:L}),wn>0&&d.createElement("div",{id:"shadow-y",style:ae}))},[Nn,wn,lt,n,ot,mt,r,Me]),Wt=d.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return d.createElement(d.Fragment,null,d.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:jn,onKeyUp:Sa,onFocus:x,onBlur:I,ref:Vn,style:vn},Un),d.createElement("canvas",{ref:xe,style:Wt}),K)}));function Mo(e,t,n,r){return On(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(r))}const og=e=>{const[t,n]=d.useState(),[r,o]=d.useState(),[i,l]=d.useState(),[a,s]=d.useState(),[c,h]=d.useState(!1),[C,y]=d.useState(),[b,p]=d.useState(),[m,E]=d.useState(),[g,w]=d.useState(!1),[x,I]=d.useState(),{onHeaderMenuClick:v,onHeaderIndicatorClick:M,getCellContent:S,onColumnMoved:H,onColumnResize:f,onColumnResizeStart:B,onColumnResizeEnd:D,gridRef:O,maxColumnWidth:T,minColumnWidth:j,onRowMoved:V,lockColumns:Z,onColumnProposeMove:Q,onMouseDown:ce,onMouseUp:le,onItemHovered:q,onDragStart:J,canvasRef:fe}=e,ee=(f??D??B)!==void 0,{columns:se,selection:ie}=e,W=ie.columns,N=d.useCallback(te=>{const[Ee,ke]=te.location;i!==void 0&&a!==Ee&&Ee>=Z?(h(!0),s(Ee)):b!==void 0&&ke!==void 0?(w(!0),E(Math.max(0,ke))):r!==void 0||c||g||(q==null||q(te))},[i,b,a,q,Z,r,c,g]),U=H!==void 0,ue=d.useCallback(te=>{var Ee;if(te.button===0){const[ke,Xe]=te.location;if(te.kind==="out-of-bounds"&&te.isEdge&&ee){const Re=(Ee=O==null?void 0:O.current)==null?void 0:Ee.getBounds(se.length-1,-1);Re!==void 0&&(n(Re.x),o(se.length-1))}else if(te.kind==="header"&&ke>=Z){const Re=fe==null?void 0:fe.current;if(te.isEdge&&ee&&Re){n(te.bounds.x),o(ke);const qe=Re.getBoundingClientRect().width/Re.offsetWidth,Ye=te.bounds.width/qe;B==null||B(se[ke],Ye,ke,Ye+(se[ke].growOffset??0))}else te.kind==="header"&&U&&(y(te.bounds.x),l(ke))}else te.kind==="cell"&&Z>0&&ke===0&&Xe!==void 0&&V!==void 0&&(I(te.bounds.y),p(Xe))}ce==null||ce(te)},[ce,ee,Z,V,O,se,U,B,fe]),pe=d.useCallback((te,Ee)=>{c||g||(v==null||v(te,Ee))},[c,g,v]),ze=d.useCallback((te,Ee)=>{c||g||(M==null||M(te,Ee))},[c,g,M]),Ue=d.useRef(-1),He=d.useCallback(()=>{Ue.current=-1,p(void 0),E(void 0),I(void 0),w(!1),l(void 0),s(void 0),y(void 0),h(!1),o(void 0),n(void 0)},[]),$e=d.useCallback((te,Ee)=>{if(te.button===0){if(r!==void 0){if((W==null?void 0:W.hasIndex(r))===!0)for(const Xe of W){if(Xe===r)continue;const Re=se[Xe],qe=Mo(Re,Ue.current,j,T);f==null||f(Re,qe,Xe,qe+(Re.growOffset??0))}const ke=Mo(se[r],Ue.current,j,T);if(D==null||D(se[r],ke,r,ke+(se[r].growOffset??0)),W.hasIndex(r))for(const Xe of W){if(Xe===r)continue;const Re=se[Xe],qe=Mo(Re,Ue.current,j,T);D==null||D(Re,qe,Xe,qe+(Re.growOffset??0))}}He(),i!==void 0&&a!==void 0&&(Q==null?void 0:Q(i,a))!==!1&&(H==null||H(i,a)),b!==void 0&&m!==void 0&&(V==null||V(b,m))}le==null||le(te,Ee)},[le,r,i,a,b,m,W,D,se,j,T,f,H,V,He,Q]),be=d.useMemo(()=>{if(i!==void 0&&a!==void 0&&i!==a&&(Q==null?void 0:Q(i,a))!==!1)return{src:i,dest:a}},[i,a,Q]),ye=d.useCallback(te=>{const Ee=fe==null?void 0:fe.current;if(i!==void 0&&C!==void 0)Math.abs(te.clientX-C)>20&&h(!0);else if(b!==void 0&&x!==void 0)Math.abs(te.clientY-x)>20&&w(!0);else if(r!==void 0&&t!==void 0&&Ee){const ke=Ee.getBoundingClientRect().width/Ee.offsetWidth,Xe=(te.clientX-t)/ke,Re=se[r],qe=Mo(Re,Xe,j,T);if(f==null||f(Re,qe,r,qe+(Re.growOffset??0)),Ue.current=Xe,(W==null?void 0:W.first())===r)for(const Ye of W){if(Ye===r)continue;const ot=se[Ye],Me=Mo(ot,Ue.current,j,T);f==null||f(ot,Me,Ye,Me+(ot.growOffset??0))}}},[i,C,b,x,r,t,se,j,T,f,W,fe]),Fe=d.useCallback((te,Ee)=>{if(b===void 0||m===void 0)return S(te,Ee);let[ke,Xe]=te;return Xe===m?Xe=b:(Xe>m&&(Xe-=1),Xe>=b&&(Xe+=1)),S([ke,Xe],Ee)},[b,m,S]),Oe=d.useCallback(te=>{J==null||J(te),te.defaultPrevented()||He()},[He,J]);return d.createElement(rg,{accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,enableGroups:e.enableGroups,eventTargetRef:e.eventTargetRef,experimental:e.experimental,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,headerIcons:e.headerIcons,height:e.height,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,resizeColumn:r,isDraggable:e.isDraggable,isFilling:e.isFilling,isFocused:e.isFocused,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDrop:e.onDrop,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,resizeIndicator:e.resizeIndicator,verticalBorder:e.verticalBorder,width:e.width,getCellContent:Fe,isResizing:r!==void 0,onHeaderMenuClick:pe,onHeaderIndicatorClick:ze,isDragging:c,onItemHovered:N,onDragStart:Oe,onMouseDown:ue,allowResize:ee,onMouseUp:$e,dragAndDropState:be,onMouseMoveRaw:ye,ref:O})},ig=Cn("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[e=>e.isSafari?"scroll":"auto"]}}),ag=e=>{var ie,W;const{children:t,clientHeight:n,scrollHeight:r,scrollWidth:o,update:i,draggable:l,className:a,preventDiagonalScrolling:s=!1,paddingBottom:c=0,paddingRight:h=0,rightElement:C,rightElementProps:y,kineticScrollPerfHack:b=!1,scrollRef:p,initialSize:m}=e,E=[],g=(y==null?void 0:y.sticky)??!1,w=(y==null?void 0:y.fill)??!1,x=d.useRef(0),I=d.useRef(0),v=d.useRef(null),M=typeof window>"u"?1:window.devicePixelRatio,S=d.useRef(M);d.useEffect(()=>{if(S.current!==M){x.current=0,I.current=0,S.current=M;const N=v.current;N!==null&&V.current(N.scrollLeft,N.scrollTop)}},[M]);const H=d.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),f=d.useRef(null),B=function(N){const[U,ue]=d.useState(!1),pe=typeof window>"u"?null:window,ze=d.useRef(0);return cn("touchstart",d.useCallback(()=>{window.clearTimeout(ze.current),ue(!0)},[]),pe,!0,!1),cn("touchend",d.useCallback(Ue=>{Ue.touches.length===0&&(ze.current=window.setTimeout(()=>ue(!1),N))},[N]),pe,!0,!1),U}(200),[D,O]=d.useState(!0),T=d.useRef(0);d.useLayoutEffect(()=>{if(!D||B||H.current.lockDirection===void 0)return;const N=v.current;if(N===null)return;const[U,ue]=H.current.lockDirection;U!==void 0?N.scrollLeft=U:ue!==void 0&&(N.scrollTop=ue),H.current.lockDirection=void 0},[B,D]);const j=d.useCallback((N,U)=>{var ke;const ue=v.current;if(ue===null)return;U=U??ue.scrollTop,N=N??ue.scrollLeft;const pe=H.current.scrollTop,ze=H.current.scrollLeft,Ue=N-ze,He=U-pe;B&&Ue!==0&&He!==0&&(Math.abs(Ue)>3||Math.abs(He)>3)&&s&&H.current.lockDirection===void 0&&(H.current.lockDirection=Math.abs(Ue)<Math.abs(He)?[ze,void 0]:[void 0,pe]);const $e=H.current.lockDirection;N=($e==null?void 0:$e[0])??N,U=($e==null?void 0:$e[1])??U,H.current.scrollLeft=N,H.current.scrollTop=U;const be=ue.clientWidth,ye=ue.clientHeight,Fe=U,Oe=I.current-Fe,te=ue.scrollHeight-ye;let Ee;I.current=Fe,te>0&&r>ue.scrollHeight+5?Math.abs(Oe)>2e3||Fe===0||Fe===te?(Ee=Math.max(0,Math.min(1,Fe/te))*(r-ye),x.current=Ee):(x.current-=Oe,Ee=x.current):(Ee=Fe,x.current=Ee),Ee=Math.max(0,Math.min(Ee,r-ye)),x.current=Ee,$e!==void 0&&(window.clearTimeout(T.current),O(!1),T.current=window.setTimeout(()=>O(!0),200)),i({x:N,y:Ee,width:be-h,height:ye-c,paddingRight:((ke=f.current)==null?void 0:ke.clientWidth)??0})},[c,h,r,i,s,B]);((N,U,ue)=>{const pe=d.useRef(null),ze=d.useRef(null),Ue=d.useRef(null),He=d.useRef(0),$e=d.useRef(U);$e.current=U;const be=ue.current;d.useEffect(()=>{const ye=()=>{var te,Ee;if(ze.current===!1&&be!==null){const ke=[be.scrollLeft,be.scrollTop];if(((te=Ue.current)==null?void 0:te[0])===ke[0]&&((Ee=Ue.current)==null?void 0:Ee[1])===ke[1]){if(He.current>10)return Ue.current=null,void(ze.current=null);He.current++}else He.current=0,$e.current(ke[0],ke[1]),Ue.current=ke;pe.current=window.setTimeout(ye,8.333333333333334)}},Fe=()=>{ze.current=!0,Ue.current=null,pe.current!==null&&(window.clearTimeout(pe.current),pe.current=null)},Oe=te=>{te.touches.length===0&&(ze.current=!1,He.current=0,pe.current=window.setTimeout(ye,8.333333333333334))};if(N&&be!==null){const te=be;return te.addEventListener("touchstart",Fe),te.addEventListener("touchend",Oe),()=>{te.removeEventListener("touchstart",Fe),te.removeEventListener("touchend",Oe),pe.current!==null&&window.clearTimeout(pe.current)}}},[N,be])})(b&&si.value,j,v);const V=d.useRef(j);V.current=j;const Z=d.useRef(),Q=d.useRef(!1);d.useLayoutEffect(()=>{Q.current?j():Q.current=!0},[j,c,h]);const ce=d.useCallback(N=>{v.current=N,p!==void 0&&(p.current=N)},[p]);let le=0,q=0;const J=Math.min(r,33554400);for(E.push(d.createElement("div",{key:le++,style:{width:o,height:0}}));q<J;){const N=Math.min(5e6,J-q);E.push(d.createElement("div",{key:le++,style:{width:0,height:N}})),q+=N}const{ref:fe,width:ee,height:se}=function(N){const U=d.useRef(null),[ue,pe]=d.useState({width:N==null?void 0:N[0],height:N==null?void 0:N[1]});return d.useLayoutEffect(()=>{const ze=new window.ResizeObserver(Ue=>{for(const He of Ue){const{width:$e,height:be}=He&&He.contentRect||{};pe(ye=>ye.width===$e&&ye.height===be?ye:{width:$e,height:be})}});return U.current&&ze.observe(U.current,void 0),()=>{ze.disconnect()}},[U.current]),{ref:U,...ue}}(m);return typeof window>"u"||((ie=Z.current)==null?void 0:ie.height)===se&&((W=Z.current)==null?void 0:W.width)===ee||(window.setTimeout(()=>V.current(),0),Z.current={width:ee,height:se}),(ee??0)===0||(se??0)===0?d.createElement("div",{ref:fe}):d.createElement("div",{ref:fe},d.createElement(ig,{isSafari:si.value},d.createElement("div",{className:"dvn-underlay"},t),d.createElement("div",{ref:ce,style:Z.current,draggable:l,onDragStart:N=>{l||(N.stopPropagation(),N.preventDefault())},className:"dvn-scroller "+(a??""),onScroll:()=>j()},d.createElement("div",{className:"dvn-scroll-inner"+(C===void 0?" dvn-hidden":"")},d.createElement("div",{className:"dvn-stack"},E),C!==void 0&&d.createElement(d.Fragment,null,!w&&d.createElement("div",{className:"dvn-spacer"}),d.createElement("div",{ref:f,style:{height:se,maxHeight:n-Math.ceil(M%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:h,flexGrow:w?1:void 0,right:g?h??0:void 0,pointerEvents:"auto"}},C))))))},lg=e=>{const{columns:t,rows:n,rowHeight:r,headerHeight:o,groupHeaderHeight:i,enableGroups:l,freezeColumns:a,experimental:s,nonGrowWidth:c,clientSize:h,className:C,onVisibleRegionChanged:y,scrollRef:b,preventDiagonalScrolling:p,rightElement:m,rightElementProps:E,overscrollX:g,overscrollY:w,initialSize:x,smoothScrollX:I=!1,smoothScrollY:v=!1,isDraggable:M}=e,{paddingRight:S,paddingBottom:H}=s??{},[f,B]=h,D=d.useRef(),O=d.useRef(),T=d.useRef(),j=d.useRef(),V=c+Math.max(0,g??0);let Z=l?o+i:o;if(typeof r=="number")Z+=n*r;else for(let q=0;q<n;q++)Z+=r(q);w!==void 0&&(Z+=w);const Q=d.useRef(),ce=d.useCallback(()=>{var ze,Ue;if(Q.current===void 0)return;const q={...Q.current};let J=0,fe=q.x<0?-q.x:0,ee=0,se=0;q.x=q.x<0?0:q.x;let ie=0;for(let He=0;He<a;He++)ie+=t[He].width;for(const He of t){const $e=J-ie;if(q.x>=$e+He.width)J+=He.width,se++,ee++;else if(q.x>$e)J+=He.width,I?fe+=$e-q.x:se++,ee++;else{if(!(q.x+q.width>$e))break;J+=He.width,ee++}}let W=0,N=0,U=0;if(typeof r=="number")v?(N=Math.floor(q.y/r),W=N*r-q.y):N=Math.ceil(q.y/r),U=Math.ceil(q.height/r)+N,W<0&&U++;else{let He=0;for(let $e=0;$e<n;$e++){const be=r($e),ye=He+(v?0:be/2);if(q.y>=He+be)He+=be,N++,U++;else if(q.y>ye)He+=be,v?W+=ye-q.y:N++,U++;else{if(!(q.y+q.height>be/2+He))break;He+=be,U++}}}N=Math.max(0,Math.min(N,n-1)),U=Math.max(N,Math.min(U,n));const ue={x:se,y:N,width:ee-se,height:U-N},pe=D.current;pe!==void 0&&pe.y===ue.y&&pe.x===ue.x&&pe.height===ue.height&&pe.width===ue.width&&O.current===fe&&T.current===W&&q.width===((ze=j.current)==null?void 0:ze[0])&&q.height===((Ue=j.current)==null?void 0:Ue[1])||(y==null||y({x:se,y:N,width:ee-se,height:U-N},q.width,q.height,q.paddingRight??0,fe,W),D.current=ue,O.current=fe,T.current=W,j.current=[q.width,q.height])},[t,r,n,y,a,I,v]),le=d.useCallback(q=>{Q.current=q,ce()},[ce]);return d.useEffect(()=>{ce()},[ce]),d.createElement(ag,{scrollRef:b,className:C,kineticScrollPerfHack:s==null?void 0:s.kineticScrollPerfHack,preventDiagonalScrolling:p,draggable:M===!0||typeof M=="string",scrollWidth:V+(S??0),scrollHeight:Z+(H??0),clientHeight:B,rightElement:m,paddingBottom:H,paddingRight:S,rightElementProps:E,update:le,initialSize:x},d.createElement(og,{eventTargetRef:b,width:f,height:B,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}))},sg=Cn("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),cg=d.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},d.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),ug=d.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},d.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),dg=d.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},d.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),hg=e=>{const{canvasRef:t,cellYOffset:n,rows:r,columns:o,searchInputRef:i,searchValue:l,searchResults:a,onSearchValueChange:s,getCellsForSelection:c,onSearchResultsChanged:h,showSearch:C=!1,onSearchClose:y}=e,[b]=d.useState(()=>"search-box-"+Math.round(1e3*Math.random())),[p,m]=d.useState(""),E=l??p,g=d.useCallback(J=>{m(J),s==null||s(J)},[s]),[w,x]=d.useState(),I=d.useRef(w);I.current=w,d.useEffect(()=>{a!==void 0&&(a.length>0?x(J=>({rowsSearched:r,results:a.length,selectedIndex:(J==null?void 0:J.selectedIndex)??-1})):x(void 0))},[r,a]);const v=d.useRef();v.current===void 0&&(v.current=new AbortController);const M=d.useRef(),[S,H]=d.useState([]),f=a??S,B=d.useCallback(()=>{M.current!==void 0&&(window.cancelAnimationFrame(M.current),M.current=void 0,v.current.abort())},[]),D=d.useRef(n);D.current=n;const O=d.useCallback(J=>{const fe=new RegExp(J.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let ee=D.current,se=Math.min(10,r),ie=0;x(void 0),H([]);const W=[],N=async()=>{var ye;if(c===void 0)return;const U=performance.now(),ue=r-ie;let pe=c({x:0,y:ee,width:o.length,height:Math.min(se,ue,r-ee)},v.current.signal);typeof pe=="function"&&(pe=await pe());let ze=!1;for(const[Fe,Oe]of pe.entries())for(const[te,Ee]of Oe.entries()){let ke;switch(Ee.kind){case me.Text:case me.Number:ke=Ee.displayData;break;case me.Uri:case me.Markdown:ke=Ee.data;break;case me.Boolean:ke=typeof Ee.data=="boolean"?Ee.data.toString():void 0;break;case me.Image:case me.Bubble:ke=Ee.data.join("\u{1F433}");break;case me.Custom:ke=Ee.copyData}ke!==void 0&&fe.test(ke)&&(W.push([te,Fe+ee]),ze=!0)}const Ue=performance.now();ze&&H([...W]),ie+=pe.length,Rn(ie<=r);const He=((ye=I.current)==null?void 0:ye.selectedIndex)??-1;x({results:W.length,rowsSearched:ie,selectedIndex:He}),h==null||h(W,He),ee+se>=r?ee=0:ee+=se;const $e=Ue-U,be=10/Math.max($e,1);se=Math.ceil(se*be),ie<r&&W.length<1e3&&(M.current=window.requestAnimationFrame(N))};B(),M.current=window.requestAnimationFrame(N)},[B,o.length,c,h,r]),T=d.useCallback(()=>{var J;y==null||y(),x(void 0),H([]),h==null||h([],-1),B(),(J=t==null?void 0:t.current)==null||J.focus()},[B,t,y,h]),j=d.useCallback(J=>{g(J.target.value),a===void 0&&(J.target.value===""?(x(void 0),H([]),B()):O(J.target.value))},[O,B,g,a]);d.useEffect(()=>{C&&i.current!==null&&(g(""),i.current.focus({preventScroll:!0}))},[C,i,g]);const V=d.useCallback(J=>{var ee;if((ee=J==null?void 0:J.stopPropagation)==null||ee.call(J),w===void 0)return;const fe=(w.selectedIndex+1)%w.results;x({...w,selectedIndex:fe}),h==null||h(f,fe)},[w,h,f]),Z=d.useCallback(J=>{var ee;if((ee=J==null?void 0:J.stopPropagation)==null||ee.call(J),w===void 0)return;let fe=(w.selectedIndex-1)%w.results;fe<0&&(fe+=w.results),x({...w,selectedIndex:fe}),h==null||h(f,fe)},[h,f,w]),Q=d.useCallback(J=>{(J.ctrlKey||J.metaKey)&&J.nativeEvent.code==="KeyF"||J.key==="Escape"?(T(),J.stopPropagation(),J.preventDefault()):J.key==="Enter"&&(J.shiftKey?Z():V())},[T,V,Z]);d.useEffect(()=>()=>{B()},[B]);const[ce,le]=d.useState(!1);d.useEffect(()=>{if(!C){const J=setTimeout(()=>le(!1),150);return()=>clearTimeout(J)}le(!0)},[C]);const q=d.useMemo(()=>{if(!C&&!ce)return null;let J;w!==void 0&&(J=w.results>=1e3?"over 1000":`${w.results} result${w.results!==1?"s":""}`,w.selectedIndex>=0&&(J=`${w.selectedIndex+1} of ${J}`));const fe=se=>{se.stopPropagation()},ee={width:`${Math.floor(((w==null?void 0:w.rowsSearched)??0)/r*100)}%`};return d.createElement(sg,{className:"gdg-search-bar"+(C?"":" out"),onMouseDown:fe,onMouseMove:fe,onMouseUp:fe,onClick:fe},d.createElement("div",{className:"gdg-search-bar-inner"},d.createElement("input",{id:b,"aria-hidden":!C,"data-testid":"search-input",ref:i,onChange:j,value:E,tabIndex:C?void 0:-1,onKeyDownCapture:Q}),d.createElement("button",{type:"button","aria-label":"Previous Result","aria-hidden":!C,tabIndex:C?void 0:-1,onClick:Z,disabled:((w==null?void 0:w.results)??0)===0},cg),d.createElement("button",{type:"button","aria-label":"Next Result","aria-hidden":!C,tabIndex:C?void 0:-1,onClick:V,disabled:((w==null?void 0:w.results)??0)===0},ug),y!==void 0&&d.createElement("button",{type:"button","aria-label":"Close Search","aria-hidden":!C,"data-testid":"search-close-button",tabIndex:C?void 0:-1,onClick:T},dg)),w!==void 0?d.createElement(d.Fragment,null,d.createElement("div",{className:"gdg-search-status"},d.createElement("div",{"data-testid":"search-result-area"},J)),d.createElement("div",{className:"gdg-search-progress",style:ee})):d.createElement("div",{className:"gdg-search-status"},d.createElement("label",{htmlFor:b},"Type to search")))},[C,ce,w,r,b,i,j,E,Q,Z,V,y,T]);return d.createElement(d.Fragment,null,d.createElement(lg,{prelightCells:f,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}),q)};Ba=class extends d.PureComponent{constructor(){super(...arguments);ft(this,"wrapperRef",d.createRef());ft(this,"clickOutside",t=>{if((!this.props.isOutsideClick||this.props.isOutsideClick(t))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(t.target)){let n=t.target;for(;n!==null;){if(n.classList.contains("click-outside-ignore"))return;n=n.parentElement}this.props.onClickOutside()}})}componentDidMount(){const t=this.props.customEventTarget??document;t.addEventListener("touchend",this.clickOutside,!0),t.addEventListener("mousedown",this.clickOutside,!0),t.addEventListener("contextmenu",this.clickOutside,!0)}componentWillUnmount(){const t=this.props.customEventTarget??document;t.removeEventListener("touchend",this.clickOutside,!0),t.removeEventListener("mousedown",this.clickOutside,!0),t.removeEventListener("contextmenu",this.clickOutside,!0)}render(){const{onClickOutside:t,isOutsideClick:n,customEventTarget:r,...o}=this.props;return d.createElement("div",{...o,ref:this.wrapperRef},this.props.children)}};const fg=Cn("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[e=>Math.max(16,e.targetHeight-10),"px"]}}),gg=e=>{const{bounds:t,group:n,onClose:r,canvasBounds:o,onFinish:i}=e,[l,a]=$t.useState(n);return $t.createElement(Ba,{style:{position:"absolute",left:t.x-o.left+1,top:t.y-o.top,width:t.width-2,height:t.height},className:"gdg-c1tqibwd",onClickOutside:r},$t.createElement(fg,{targetHeight:t.height,"data-testid":"group-rename-input",value:l,onBlur:r,onFocus:s=>s.target.setSelectionRange(0,l.length),onChange:s=>a(s.target.value),onKeyDown:s=>{s.key==="Enter"?i(l):s.key==="Escape"&&r()},autoFocus:!0}))};function st(e,t,n){const r=Qf(e,t);return r&&(n.didMatch=!0),r}function Qf(e,t){if(e.length===0)return!1;if(e.includes("|")){const a=e.split("|");for(const s of a)if(Qf(s,t))return!0;return!1}let n=!1,r=!1,o=!1,i=!1;const l=e.split("+");if(!function(a,s){return a===void 0?!1:a.length>1&&a.startsWith("_")?Number.parseInt(a.slice(1))===s.keyCode:a.length===1&&a>="a"&&a<="z"?a.toUpperCase().codePointAt(0)===s.keyCode:a===s.key}(l.pop(),t))return!1;if(l[0]==="any")return!0;for(const a of l)switch(a){case"ctrl":n=!0;break;case"shift":r=!0;break;case"alt":o=!0;break;case"meta":i=!0;break;case"primary":ci.value?i=!0:n=!0}return t.altKey===o&&t.ctrlKey===n&&t.shiftKey===r&&t.metaKey===i}function pg(e,t){return e.map((n,r)=>{const o=t[r];return n.map(i=>i.span!==void 0&&i.span[0]!==o?{formatted:"",rawValue:"",format:"string"}:function(l){if(l.copyData!==void 0)return{formatted:l.copyData,rawValue:l.copyData,format:"string",doNotEscape:!0};switch(l.kind){case me.Boolean:return{formatted:l.data===!0?"TRUE":l.data===!1?"FALSE":l.data===Ni?"INDETERMINATE":"",rawValue:l.data,format:"boolean"};case me.Custom:return{formatted:l.copyData,rawValue:l.copyData,format:"string"};case me.Image:case me.Bubble:return{formatted:l.data,rawValue:l.data,format:"string-array"};case me.Drilldown:return{formatted:l.data.map(a=>a.text),rawValue:l.data.map(a=>a.text),format:"string-array"};case me.Text:return{formatted:l.displayData??l.data,rawValue:l.data,format:"string"};case me.Uri:return{formatted:l.displayData??l.data,rawValue:l.data,format:"url"};case me.Markdown:case me.RowID:return{formatted:l.data,rawValue:l.data,format:"string"};case me.Number:return{formatted:l.displayData,rawValue:l.data,format:"number"};case me.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case me.Protected:return{formatted:"************",rawValue:"",format:"string"};default:lo()}}(i))})}function Jf(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function pa(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>"<span> </span>".repeat(t.length))}function Zf(e){return'"'+e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")+'"'}function mg(e){return e.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function vg(e,t){const n=pg(e,t),r=function(i){var a;const l=[];for(const s of i){const c=[];for(const h of s)h.format==="url"?c.push(((a=h.rawValue)==null?void 0:a.toString())??""):h.format==="string-array"?c.push(h.formatted.map(C=>Jf(C,!0)).join(",")):c.push(h.doNotEscape===!0?h.formatted:Jf(h.formatted,!1));l.push(c.join(" "))}return l.join(`
120
+ `}};class I1{constructor(t,n){ft(this,"onSettled");ft(this,"spriteMap",new Map);ft(this,"headerIcons");ft(this,"inFlight",0);this.onSettled=n,this.headerIcons=t??{}}drawSprite(t,n,r,o,i,l,a,s=1){const[c,h]=function(p,m){return p==="normal"?[m.bgIconHeader,m.fgIconHeader]:p==="selected"?["white",m.accentColor]:[m.accentColor,m.bgHeader]}(n,a),C=l*Math.ceil(window.devicePixelRatio),y=`${c}_${h}_${C}_${t}`;let b=this.spriteMap.get(y);if(b===void 0){const p=this.headerIcons[t];if(p===void 0)return;b=document.createElement("canvas");const m=b.getContext("2d");if(m===null)return;const E=new Image;E.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(p({fgColor:h,bgColor:c}))}`,this.spriteMap.set(y,b);const g=E.decode();if(g===void 0)return;this.inFlight++,g.then(()=>{m.drawImage(E,0,0,C,C)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else s<1&&(r.globalAlpha=s),r.drawImage(b,0,0,C,C,o,i,l,l),s<1&&(r.globalAlpha=1)}}function fd(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y)}function ai(e,t,n,r,o,i,l,a,s){a=a??t;let c=t,h=e;const C=r-i;let y=!1;for(;c<n&&h<C;){const b=o(h);if(c+b>a&&s(c,h,b,!1,l&&h===r-1)===!0){y=!0;break}c+=b,h++}if(!y){c=n;for(let b=0;b<i;b++){h=r-1-b;const p=o(h);c-=p,s(c,h,p,!0,l&&h===r-1)}}}function gr(e,t,n,r,o,i){let l=0,a=0;const s=o+r;for(const c of e){if(i(c,c.sticky?a:l+n,s,c.sticky?0:a,t)===!0)break;l+=c.width,a+=c.sticky?c.width:0}}function gd(e,t,n,r,o){let i=0,l=0;for(let a=0;a<e.length;a++){const s=e[a];let c=a+1,h=s.width;for(s.sticky&&(l+=h);c<e.length&&mo(e[c].group,s.group)&&e[c].sticky===e[a].sticky;){const p=e[c];h+=p.width,c++,a++,p.sticky&&(l+=p.width)}const C=i+(s.sticky?0:n),y=s.sticky?0:Math.max(0,l-C),b=Math.min(h-y,t-(C+y));o([s.sourceIndex,e[c-1].sourceIndex],s.group??"",C+y,0,b,r),i+=h}}function pd(e,t,n,r,o,i,l){var y;const[a,s]=e;let c,h;const C=((y=l.find(b=>!b.sticky))==null?void 0:y.sourceIndex)??0;if(s>C){const b=Math.max(a,C);let p=t,m=r;for(let E=i.sourceIndex-1;E>=b;E--)p-=l[E].width,m+=l[E].width;for(let E=i.sourceIndex+1;E<=s;E++)m+=l[E].width;h={x:p,y:n,width:m,height:o}}if(C>a){const b=Math.min(s,C-1);let p=t,m=r;for(let E=i.sourceIndex-1;E>=a;E--)p-=l[E].width,m+=l[E].width;for(let E=i.sourceIndex+1;E<=b;E++)m+=l[E].width;c={x:p,y:n,width:m,height:o}}return[c,h]}function xo(e,t,n,r,o,i,l,a){return e<=o+l&&o<=e+n&&t<=i+a&&i<=t+r}function Dr(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function md(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x+e.width,t.x+t.width)-n,height:Math.max(e.y+e.height,t.y+t.height)-r}}function T1(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function H1(e,t,n,r){if(e.x>t||e.y>n||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>n)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=n)return e;const o=t+4,i=n+4,l=-4-e.x,a=e.x+e.width-o,s=-4-e.y,c=e.y+e.height-i,h=l>0?e.x+Math.floor(l/r)*r:e.x,C=a>0?e.x+e.width-Math.floor(a/r)*r:e.x+e.width,y=s>0?e.y+Math.floor(s/r)*r:e.y;return{x:h,y,width:C-h,height:(c>0?e.y+e.height-Math.floor(c/r)*r:e.y+e.height)-y}}const O1={kind:me.Loading,allowOverlay:!1};function vd(e,t,n,r,o,i,l,a,s,c,h,C,y,b,p,m,E,g,w,x,I,v,M,S,H,f,B,D,O,T,j,V,Z,J,ce){let le=(x==null?void 0:x.size)??Number.MAX_SAFE_INTEGER;const q=performance.now();let Q=T.baseFontFull;e.font=Q;const fe={ctx:e},ee=[0,0],se=E>0?Or(s,E,c):0;let ie,W;const N=fd(w);return gr(t,a,i,l,o,(U,ue,pe,ze,Ue)=>{const He=Math.max(0,ze-ue),$e=ue+He,be=o+1,ye=U.width-He,Fe=r-o-1;if(w.length>0){let qe=!1;for(let Ye=0;Ye<w.length;Ye++){const ot=w[Ye];if(xo($e,be,ye,Fe,ot.x,ot.y,ot.width,ot.height)){qe=!0;break}}if(!qe)return}const Oe=()=>{e.save(),e.beginPath(),e.rect($e,be,ye,Fe),e.clip()},te=I.columns.hasIndex(U.sourceIndex),Ee=C(U.group??"").overrideTheme,ke=U.themeOverride===void 0&&Ee===void 0?T:Zn(T,Ee,U.themeOverride),Xe=ke.baseFontFull;let Re;return Xe!==Q&&(Q=Xe,e.font=Xe),Oe(),ai(Ue,pe,r,s,c,E,g,N,(qe,Ye,ot,Me,Pe)=>{var wt,dt,xt;if(Ye<0||(ee[0]=U.sourceIndex,ee[1]=Ye,x!==void 0&&!x.has(ee)))return;if(w.length>0){let ve=!1;for(let Ve=0;Ve<w.length;Ve++){const Ke=w[Ve];if(xo(ue,qe,U.width,ot,Ke.x,Ke.y,Ke.width,Ke.height)){ve=!0;break}}if(!ve)return}const ut=I.rows.hasIndex(Ye),tt=b.hasIndex(Ye),pt=Ye<s?h(ee):O1;let Ft=ue,bt=U.width,Ze=!1,Yt=!1;if(pt.span!==void 0){const[ve,Ve]=pt.span,Ke=`${Ye},${ve},${Ve},${U.sticky}`;if(W===void 0&&(W=new Set),W.has(Ke))return void le--;{const mt=pd(pt.span,ue,qe,U.width,ot,U,n),it=U.sticky?mt[0]:mt[1];if(U.sticky||mt[0]===void 0||(Yt=!0),it!==void 0){Ft=it.x,bt=it.width,W.add(Ke),e.restore(),Re=void 0,e.save(),e.beginPath();const at=Math.max(0,ze-it.x);e.rect(it.x+at,qe,it.width-at,ot),ie===void 0&&(ie=[]),ie.push({x:it.x+at,y:qe,width:it.width-at,height:ot}),e.clip(),Ze=!0}}}const nn=y==null?void 0:y(Ye),Kt=Pe&&((wt=U.trailingRowOptions)==null?void 0:wt.themeOverride)!==void 0?(dt=U.trailingRowOptions)==null?void 0:dt.themeOverride:void 0,qt=pt.themeOverride===void 0&&nn===void 0&&Kt===void 0?ke:Zn(ke,nn,Kt,pt.themeOverride);e.beginPath();const un=function(ve,Ve,Ke){return Ke.current!==void 0&&ve[1]===Ke.current.cell[1]&&(Ve.span===void 0?Ke.current.cell[0]===ve[0]:Ke.current.cell[0]>=Ve.span[0]&&Ke.current.cell[0]<=Ve.span[1])}(ee,pt,I);let jt=function(ve,Ve,Ke,mt){let it=0;if(Ke.current===void 0)return it;const at=Ke.current.range;(mt||at.height*at.width>1)&&Vc(ve,Ve,at)&&it++;for(const vt of Ke.current.rangeStack)Vc(ve,Ve,vt)&&it++;return it}(ee,pt,I,m);const Kn=pt.span!==void 0&&I.columns.some(ve=>pt.span!==void 0&&ve>=pt.span[0]&&ve<=pt.span[1]);un&&!p&&m?jt=0:un&&m&&(jt=Math.max(jt,1)),Kn&&jt++,un||(ut&&jt++,te&&!Pe&&jt++);const vr=pt.kind===me.Protected?qt.bgCellMedium:qt.bgCell;let Dt;if((Me||vr!==T.bgCell)&&(Dt=In(vr,Dt)),jt>0||tt){tt&&(Dt=In(qt.bgHeader,Dt));for(let ve=0;ve<jt;ve++)Dt=In(qt.accentLight,Dt)}else if(v!==void 0){for(const ve of v)if(ve[0]===U.sourceIndex&&ve[1]===Ye){Dt=In(qt.bgSearchResult,Dt);break}}if(M!==void 0)for(let ve=0;ve<M.length;ve++){const Ve=M[ve],Ke=Ve.range;Ve.style!=="solid-outline"&&Ke.x<=U.sourceIndex&&U.sourceIndex<Ke.x+Ke.width&&Ke.y<=Ye&&Ye<Ke.y+Ke.height&&(Dt=In(Ve.color,Dt))}let tr=!1;if(x!==void 0){const ve=qe+1,Ve=(Me?ve+ot-1:Math.min(ve+ot-1,r-se))-ve;(Ve!==ot-1||Ft+1<=ze)&&(tr=!0,e.save(),e.beginPath(),e.rect(Ft+1,ve,bt-1,Ve),e.clip()),Dt=Dt===void 0?qt.bgCell:In(Dt,qt.bgCell)}const _n=U.sourceIndex===n.length-1,ne=Ye===s-1;let xe;Dt!==void 0&&(e.fillStyle=Dt,Re!==void 0&&(Re.fillStyle=Dt),x!==void 0?e.fillRect(Ft+1,qe+1,bt-(_n?2:1),ot-(ne?2:1)):e.fillRect(Ft,qe,bt,ot)),pt.style==="faded"&&(e.globalAlpha=.6);for(let ve=0;ve<f.length;ve++){const Ve=f[ve];if(Ve.item[0]===U.sourceIndex&&Ve.item[1]===Ye){xe=Ve;break}}if(bt>ce&&!Yt){const ve=qt.baseFontFull;ve!==Q&&(e.font=ve,Q=ve),Re=wd(e,pt,U.sourceIndex,Ye,_n,ne,Ft,qe,bt,ot,jt>0,qt,Dt??qt.bgCell,S,H,(xe==null?void 0:xe.hoverAmount)??0,B,O,q,D,Re,j,V,Z,J)}return tr&&e.restore(),pt.style==="faded"&&(e.globalAlpha=1),le--,Ze&&(e.restore(),(xt=Re==null?void 0:Re.deprep)==null||xt.call(Re,fe),Re=void 0,Oe(),Q=Xe,e.font=Xe),le<=0}),e.restore(),le<=0}),ie}const Co=[0,0],So={x:0,y:0,width:0,height:0},aa=[void 0,()=>{}];let la=!1;function P1(){la=!0}function wd(e,t,n,r,o,i,l,a,s,c,h,C,y,b,p,m,E,g,w,x,I,v,M,S,H){var V,Z;let f,B,D;E!==void 0&&E[0][0]===n&&E[0][1]===r&&(f=E[1][0],B=E[1][1]),Co[0]=n,Co[1]=r,So.x=l,So.y=a,So.width=s,So.height=c,aa[0]=M.getValue(Co),aa[1]=J=>M.setValue(Co,J),la=!1;const O={ctx:e,theme:C,col:n,row:r,cell:t,rect:So,highlighted:h,cellFillColor:y,hoverAmount:m,frameTime:w,hoverX:f,drawState:aa,hoverY:B,imageLoader:b,spriteManager:p,hyperWrapping:g,overrideCursor:f!==void 0?H:void 0,requestAnimationFrame:P1},T=function(J,ce,le,q,Q,fe){const{ctx:ee,rect:se,theme:ie}=J;let W=Number.MAX_SAFE_INTEGER;if(ce!==void 0&&(W=le-ce,W<500)){const N=1-W/500;ee.globalAlpha=N,ee.fillStyle=ie.bgSearchResult,ee.fillRect(se.x+1,se.y+1,se.width-(Q?2:1),se.height-(fe?2:1)),ee.globalAlpha=1,q!==void 0&&(q.fillStyle=ie.bgSearchResult)}return W<500}(O,t.lastUpdated,w,I,o,i),j=S(t);if(j!==void 0){(I==null?void 0:I.renderer)!==j&&((V=I==null?void 0:I.deprep)==null||V.call(I,O),I=void 0);const J=(Z=j.drawPrep)==null?void 0:Z.call(j,O,I);x===void 0||kr(O.cell)?j.draw(O,t):x(O,()=>j.draw(O,t)),D=J===void 0?void 0:{deprep:J==null?void 0:J.deprep,fillStyle:J==null?void 0:J.fillStyle,font:J==null?void 0:J.font,renderer:j}}return(T||la)&&(v==null||v(Co)),D}function sa(e,t,n,r,o,i,l,a,s=-20,c=-20,h=void 0,C="center",y="square"){const b=Math.floor(o+l/2),p=y==="circle"?1e4:t.roundingRadius??4;let m=Nc(h??t.checkboxMaxSize,l,t.cellVerticalPadding),E=m/2;const g=jc(C,r,i,t.cellHorizontalPadding,m),w=_c(g,b,m),x=Bc(r+s,o+c,w);switch(n){case!0:e.beginPath(),Yn(e,g-m/2,b-m/2,m,m,p),y==="circle"&&(E*=.8,m*=.8),e.fillStyle=a?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(g-E+m/4.23,b-E+m/1.97),e.lineTo(g-E+m/2.42,b-E+m/1.44),e.lineTo(g-E+m/1.29,b-E+m/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break;case Qo:case!1:e.beginPath(),Yn(e,g-m/2+.5,b-m/2+.5,m-1,m-1,p),e.lineWidth=1,e.strokeStyle=x?t.textDark:t.textMedium,e.stroke();break;case Ni:e.beginPath(),Yn(e,g-m/2,b-m/2,m,m,p),e.fillStyle=x?t.textMedium:t.textLight,e.fill(),y==="circle"&&(E*=.8,m*=.8),e.beginPath(),e.moveTo(g-m/3,b),e.lineTo(g+m/3,b),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break;default:lo()}}function D1(e,t,n,r,o,i,l,a,s,c,h,C,y,b,p,m,E,g,w){var f,B,D,O;const x=l+a;if(x<=0)return;e.fillStyle=C.bgHeader,e.fillRect(0,0,o,x);const I=(f=r==null?void 0:r[0])==null?void 0:f[0],v=(B=r==null?void 0:r[0])==null?void 0:B[1],M=(D=r==null?void 0:r[1])==null?void 0:D[0],S=(O=r==null?void 0:r[1])==null?void 0:O[1],H=C.headerFontFull;e.font=H,gr(t,0,i,0,x,(T,j,V,Z)=>{var U;if(E!==void 0&&!E.has([T.sourceIndex,-1]))return;const J=Math.max(0,Z-j);e.save(),e.beginPath(),e.rect(j+J,a,T.width-J,l),e.clip();const ce=m(T.group??"").overrideTheme,le=T.themeOverride===void 0&&ce===void 0?C:Zn(C,ce,T.themeOverride);le.bgHeader!==C.bgHeader&&(e.fillStyle=le.bgHeader,e.fill()),le!==C&&(e.font=le.headerFontFull);const q=h.columns.hasIndex(T.sourceIndex),Q=s!==void 0||c||T.headerRowMarkerDisabled===!0,fe=!Q&&v===-1&&I===T.sourceIndex,ee=Q?0:((U=b.find(ue=>ue.item[0]===T.sourceIndex&&ue.item[1]===-1))==null?void 0:U.hoverAmount)??0,se=(h==null?void 0:h.current)!==void 0&&h.current.cell[0]===T.sourceIndex,ie=q?le.accentColor:se?le.bgHeaderHasFocus:le.bgHeader,W=n?a:0,N=T.sourceIndex===0?0:1;q?(e.fillStyle=ie,e.fillRect(j+N,W,T.width-N,l)):(se||ee>0)&&(e.beginPath(),e.rect(j+N,W,T.width-N,l),se&&(e.fillStyle=le.bgHeaderHasFocus,e.fill()),ee>0&&(e.globalAlpha=ee,e.fillStyle=le.bgHeaderHovered,e.fill(),e.globalAlpha=1)),Cd(e,j,W,T.width,l,T,q,le,fe,fe?M:void 0,fe?S:void 0,se,ee,y,g,w),e.restore()}),n&&function(T,j,V,Z,J,ce,le,q,Q,fe,ee,se){const[W,N]=(ce==null?void 0:ce[0])??[];let U=0;gd(j,V,Z,J,(ue,pe,ze,Ue,He,$e)=>{if(se!==void 0&&!se.hasItemInRectangle({x:ue[0],y:-2,width:ue[1]-ue[0]+1,height:1}))return;T.save(),T.beginPath(),T.rect(ze,Ue,He,$e),T.clip();const be=ee(pe),ye=(be==null?void 0:be.overrideTheme)===void 0?le:Zn(le,be.overrideTheme),Fe=N===-2&&W!==void 0&&W>=ue[0]&&W<=ue[1],Oe=Fe?ye.bgGroupHeaderHovered??ye.bgHeaderHovered:ye.bgGroupHeader??ye.bgHeader;if(Oe!==le.bgHeader&&(T.fillStyle=Oe,T.fill()),T.fillStyle=ye.textGroupHeader??ye.textHeader,be!==void 0){let te=ze;if(be.icon!==void 0&&(q.drawSprite(be.icon,"normal",T,te+8,(J-20)/2,20,ye),te+=26),T.fillText(be.name,te+8,J/2+fr(T,le.headerFontFull)),be.actions!==void 0&&Fe){const Ee=yd({x:ze,y:Ue,width:He,height:$e},be.actions);T.beginPath();const ke=Ee[0].x-10,Xe=ze+He-ke;T.rect(ke,0,Xe,J);const Re=T.createLinearGradient(ke,0,ke+Xe,0),qe=Hr(Oe,0);Re.addColorStop(0,qe),Re.addColorStop(10/Xe,Oe),Re.addColorStop(1,Oe),T.fillStyle=Re,T.fill(),T.globalAlpha=.6;const[Ye,ot]=(ce==null?void 0:ce[1])??[-1,-1];for(let Me=0;Me<be.actions.length;Me++){const Pe=be.actions[Me],ut=Ee[Me],tt=Dr(ut,Ye+ze,ot);tt&&(T.globalAlpha=1),q.drawSprite(Pe.icon,"normal",T,ut.x+ut.width/2-10,ut.y+ut.height/2-10,20,ye),tt&&(T.globalAlpha=.6)}T.globalAlpha=1}}ze!==0&&fe(ue[0])&&(T.beginPath(),T.moveTo(ze+.5,0),T.lineTo(ze+.5,J),T.strokeStyle=le.borderColor,T.lineWidth=1,T.stroke()),T.restore(),U=ze+He}),T.beginPath(),T.moveTo(U+.5,0),T.lineTo(U+.5,J),T.moveTo(0,J+.5),T.lineTo(V,J+.5),T.strokeStyle=le.borderColor,T.lineWidth=1,T.stroke()}(e,t,o,i,a,r,C,y,0,p,m,E)}const li=30;function yd(e,t){const n=[];let r=e.x+e.width-26*t.length;const o=e.y+e.height/2-13;for(let i=0;i<t.length;i++)n.push({x:r,y:o,width:26,height:26}),r+=26;return n}function ko(e,t,n){return n&&e!==void 0&&(e.x=t-(e.x-t)-e.width),e}function bd(e,t,n,r,o,i,l,a){var g;const s=l.cellHorizontalPadding,c=l.headerIconSize,h=function(w,x,I,v){return{x:w+I-li,y:Math.max(x,x+v/2-li/2),width:li,height:Math.min(li,v)}}(n,r,o,i);let C=n+s;const y=t.icon===void 0?void 0:{x:C,y:r+(i-c)/2,width:c,height:c},b=y===void 0||t.overlayIcon===void 0?void 0:{x:y.x+9,y:y.y+6,width:18,height:18};y!==void 0&&(C+=Math.ceil(1.3*c));const p={x:C,y:r,width:o-C,height:i};let m;if(t.indicatorIcon!==void 0){const w=e===void 0?((g=Jc(t.title,l.headerFontFull))==null?void 0:g.width)??0:Kr(t.title,e,l.headerFontFull).width;p.width=w,C+=w+s,m={x:C,y:r+(i-c)/2,width:c,height:c}}const E=n+o/2;return{menuBounds:ko(h,E,a),iconBounds:ko(y,E,a),iconOverlayBounds:ko(b,E,a),textBounds:ko(p,E,a),indicatorIconBounds:ko(m,E,a)}}function xd(e,t,n,r,o,i,l,a,s,c,h,C,y,b,p,m){if(i.rowMarker!==void 0&&i.headerRowMarkerDisabled!==!0){const w=i.rowMarkerChecked;return w!==!0&&i.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=C),sa(e,i.headerRowMarkerTheme!==void 0?Zn(a,i.headerRowMarkerTheme):a,w,t,n,r,o,!1,void 0,void 0,a.checkboxMaxSize,"center",i.rowMarker),void(w!==!0&&i.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=1))}const E=l?a.textHeaderSelected:a.textHeader,g=i.hasMenu===!0&&(s||b&&l)&&m.menuBounds!==void 0;if(i.icon!==void 0&&m.iconBounds!==void 0){let w=l?"selected":"normal";i.style==="highlight"&&(w=l?"selected":"special"),y.drawSprite(i.icon,w,e,m.iconBounds.x,m.iconBounds.y,m.iconBounds.width,a),i.overlayIcon!==void 0&&m.iconOverlayBounds!==void 0&&y.drawSprite(i.overlayIcon,l?"selected":"special",e,m.iconOverlayBounds.x,m.iconOverlayBounds.y,m.iconOverlayBounds.width,a)}if(g&&r>35){const x=(p?35:r-35)/r,I=(p?.7*35:r-.7*35)/r,v=e.createLinearGradient(t,0,t+r,0),M=Hr(E,0);v.addColorStop(p?1:0,E),v.addColorStop(x,E),v.addColorStop(I,M),v.addColorStop(p?0:1,M),e.fillStyle=v}else e.fillStyle=E;if(p&&(e.textAlign="right"),m.textBounds!==void 0&&e.fillText(i.title,p?m.textBounds.x+m.textBounds.width:m.textBounds.x,n+o/2+fr(e,a.headerFontFull)),p&&(e.textAlign="left"),!(i.indicatorIcon===void 0||m.indicatorIconBounds===void 0||g&&xo(m.menuBounds.x,m.menuBounds.y,m.menuBounds.width,m.menuBounds.height,m.indicatorIconBounds.x,m.indicatorIconBounds.y,m.indicatorIconBounds.width,m.indicatorIconBounds.height))){let w=l?"selected":"normal";i.style==="highlight"&&(w=l?"selected":"special"),y.drawSprite(i.indicatorIcon,w,e,m.indicatorIconBounds.x,m.indicatorIconBounds.y,m.indicatorIconBounds.width,a)}if(g&&m.menuBounds!==void 0){const w=m.menuBounds,x=c!==void 0&&h!==void 0&&Dr(w,c+t,h+n);if(x||(e.globalAlpha=.7),i.menuIcon===void 0||i.menuIcon===Zo.Triangle){e.beginPath();const I=w.x+w.width/2-5.5,v=w.y+w.height/2-3;(function(M,S,H){const f=function(T,j){const V=j.x-T.x,Z=j.y-T.y,J=Math.sqrt(V*V+Z*Z),ce=V/J,le=Z/J;return{x:V,y:j.y-T.y,len:J,nx:ce,ny:le,ang:Math.atan2(le,ce)}};let B;const D=S.length;let O=S[D-1];for(let T=0;T<D;T++){let j=S[T%D];const V=S[(T+1)%D],Z=f(j,O),J=f(j,V),ce=Z.nx*J.ny-Z.ny*J.nx,le=Z.nx*J.nx-Z.ny*-J.ny;let q=Math.asin(ce<-1?-1:ce>1?1:ce),Q=1,fe=!1;le<0?q<0?q=Math.PI+q:(q=Math.PI-q,Q=-1,fe=!0):q>0&&(Q=-1,fe=!0),B=j.radius!==void 0?j.radius:H;const ee=q/2;let se,ie=Math.abs(Math.cos(ee)*B/Math.sin(ee));ie>Math.min(Z.len/2,J.len/2)?(ie=Math.min(Z.len/2,J.len/2),se=Math.abs(ie*Math.sin(ee)/Math.cos(ee))):se=B;let W=j.x+J.nx*ie,N=j.y+J.ny*ie;W+=-J.ny*se*Q,N+=J.nx*se*Q,M.arc(W,N,se,Z.ang+Math.PI/2*Q,J.ang-Math.PI/2*Q,fe),O=j,j=V}M.closePath()})(e,[{x:I,y:v},{x:I+11,y:v},{x:I+5.5,y:v+6}],1),e.fillStyle=E,e.fill()}else if(i.menuIcon===Zo.Dots)e.beginPath(),function(I,v,M){I.arc(v,M-4.375,1.25,0,2*Math.PI,!1),I.arc(v,M,1.25,0,2*Math.PI,!1),I.arc(v,M+4.375,1.25,0,2*Math.PI,!1)}(e,w.x+w.width/2,w.y+w.height/2),e.fillStyle=E,e.fill();else{const I=w.x+(w.width-a.headerIconSize)/2,v=w.y+(w.height-a.headerIconSize)/2;y.drawSprite(i.menuIcon,"normal",e,I,v,a.headerIconSize,a)}x||(e.globalAlpha=1)}}function Cd(e,t,n,r,o,i,l,a,s,c,h,C,y,b,p,m){const E=Yi(i.title)==="rtl",g=bd(e,i,t,n,r,o,a,E);p!==void 0?p({ctx:e,theme:a,rect:{x:t,y:n,width:r,height:o},column:i,columnIndex:i.sourceIndex,isSelected:l,hoverAmount:y,isHovered:s,hasSelectedCell:C,spriteManager:b,menuBounds:(g==null?void 0:g.menuBounds)??{x:0,y:0,height:0,width:0},hoverX:c,hoverY:h},()=>xd(e,t,n,r,o,i,l,a,s,c,h,y,b,m,E,g)):xd(e,t,n,r,o,i,l,a,s,c,h,y,b,m,E,g)}var Sd,kd,Md,Rd,Ed,Id,Td,Hd,Od,Pd,Dd,zd;function z1(){if(Rd)return Md;Rd=1;var e=function(){if(kd)return Sd;kd=1;var t=Ir(),n=function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}}();return Sd=n}();return Md=function(t,n,r){n=="__proto__"&&e?e(t,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[n]=r}}function A1(){if(Pd)return Od;Pd=1;var e=(Hd?Td:(Hd=1,Td=function(t){return function(n,r,o){for(var i=-1,l=Object(n),a=o(n),s=a.length;s--;){var c=a[t?s:++i];if(r(l[c],c,l)===!1)break}return n}}))();return Od=e}var Ad,Fd,Ld,_d,jd,Nd,Bd,ca={exports:{}};function Wd(){return Ld||(Ld=1,function(e,t){var n=Gn(),r=Fd?Ad:(Fd=1,Ad=function(){return!1}),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,l=i&&i.exports===o?n.Buffer:void 0,a=(l?l.isBuffer:void 0)||r;e.exports=a}(ca,ca.exports)),ca.exports}var $d,Xd,Gd,Yd,Kd,Vd,Ud,qd,Jd,Qd,Zd,eh,th,nh,rh,oh,ih,ah,lh,sh,ch,uh,dh,hh,fh,gh,ph,mh,vh,wh,yh,bh,xh,Ch,Sh,kh,Mh,Rh,Eh,Ih,Th,Hh,Oh,Ph,Dh,zh,Ah,Fh,Lh,_h,jh,Nh,Bh,Wh,$h,Xh,Gh,Yh,Kh,Vh,Uh,qh,Jh,Qh,Zh,ef,tf,ua,nf,rf,of,af,lf,sf,cf,uf,df,hf,ff,gf,pf,mf,vf,wf,yf,bf,xf,Cf,Sf,kf,Mf,Rf,Ef,If,Tf,Hf,Of,Pf,Df,zf,Af,Ff,Lf,da={exports:{}};function _f(){if(Gd)return Xd;Gd=1;var e=function(){if(jd)return _d;jd=1;var i=io(),l=ji(),a=ao(),s={};return s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,_d=function(c){return a(c)&&l(c.length)&&!!s[i(c)]}}(),t=Bd?Nd:(Bd=1,Nd=function(i){return function(l){return i(l)}}),n=function(){return $d||($d=1,i=da,l=da.exports,a=Ys(),s=l&&!l.nodeType&&l,c=s&&i&&!i.nodeType&&i,h=c&&c.exports===s&&a.process,C=function(){try{return c&&c.require&&c.require("util").types||h&&h.binding&&h.binding("util")}catch{}}(),i.exports=C),da.exports;var i,l,a,s,c,h,C}(),r=n&&n.isTypedArray,o=r?t(r):e;return Xd=o}function F1(){if(Kd)return Yd;Kd=1;var e=zd?Dd:(zd=1,Dd=function(a,s){for(var c=-1,h=Array(a);++c<a;)h[c]=s(c);return h}),t=Li(),n=Xn(),r=Wd(),o=_i(),i=_f(),l=Object.prototype.hasOwnProperty;return Yd=function(a,s){var c=n(a),h=!c&&t(a),C=!c&&!h&&r(a),y=!c&&!h&&!C&&i(a),b=c||h||C||y,p=b?e(a.length,String):[],m=p.length;for(var E in a)!s&&!l.call(a,E)||b&&(E=="length"||C&&(E=="offset"||E=="parent")||y&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||o(E,m))||p.push(E);return p}}function L1(){if(Zd)return Qd;Zd=1;var e=(Jd?qd:(Jd=1,qd=function(t,n){return function(r){return t(n(r))}}))(Object.keys,Object);return Qd=e}function _1(){if(th)return eh;th=1;var e=function(){if(Ud)return Vd;Ud=1;var r=Object.prototype;return Vd=function(o){var i=o&&o.constructor;return o===(typeof i=="function"&&i.prototype||r)}}(),t=L1(),n=Object.prototype.hasOwnProperty;return eh=function(r){if(!e(r))return t(r);var o=[];for(var i in Object(r))n.call(r,i)&&i!="constructor"&&o.push(i);return o}}function ha(){if(rh)return nh;rh=1;var e=F1(),t=_1(),n=ia();return nh=function(r){return n(r)?e(r):t(r)}}function j1(){if(ch)return sh;ch=1;var e=function(){if(ih)return oh;ih=1;var n=A1(),r=ha();return oh=function(o,i){return o&&n(o,i,r)}}(),t=function(){if(lh)return ah;lh=1;var n=ia();return ah=function(r,o){return function(i,l){if(i==null)return i;if(!n(i))return r(i,l);for(var a=i.length,s=o?a:-1,c=Object(i);(o?s--:++s<a)&&l(c[s],s,c)!==!1;);return i}}}()(e);return sh=t}function jf(){if(Sh)return Ch;Sh=1;var e=Uo(),t=function(){if(fh)return hh;fh=1;var a=Uo();return hh=function(){this.__data__=new a,this.size=0}}(),n=ph?gh:(ph=1,gh=function(a){var s=this.__data__,c=s.delete(a);return this.size=s.size,c}),r=vh?mh:(vh=1,mh=function(a){return this.__data__.get(a)}),o=yh?wh:(yh=1,wh=function(a){return this.__data__.has(a)}),i=function(){if(xh)return bh;xh=1;var a=Uo(),s=Ai(),c=Fi();return bh=function(h,C){var y=this.__data__;if(y instanceof a){var b=y.__data__;if(!s||b.length<199)return b.push([h,C]),this.size=++y.size,this;y=this.__data__=new c(b)}return y.set(h,C),this.size=y.size,this}}();function l(a){var s=this.__data__=new e(a);this.size=s.size}return l.prototype.clear=t,l.prototype.delete=n,l.prototype.get=r,l.prototype.has=o,l.prototype.set=i,Ch=l}function Nf(){if(Eh)return Rh;Eh=1;var e=Wu(),t=Mh?kh:(Mh=1,kh=function(r,o){for(var i=-1,l=r==null?0:r.length;++i<l;)if(o(r[i],i,r))return!0;return!1}),n=$u();return Rh=function(r,o,i,l,a,s){var c=1&i,h=r.length,C=o.length;if(h!=C&&!(c&&C>h))return!1;var y=s.get(r),b=s.get(o);if(y&&b)return y==o&&b==r;var p=-1,m=!0,E=2&i?new e:void 0;for(s.set(r,o),s.set(o,r);++p<h;){var g=r[p],w=o[p];if(l)var x=c?l(w,g,p,o,r,s):l(g,w,p,r,o,s);if(x!==void 0){if(x)continue;m=!1;break}if(E){if(!t(o,function(I,v){if(!n(E,v)&&(g===I||a(g,I,i,l,s)))return E.push(v)})){m=!1;break}}else if(g!==w&&!a(g,w,i,l,s)){m=!1;break}}return s.delete(r),s.delete(o),m}}function N1(){if(Dh)return Ph;Dh=1;var e=oo(),t=function(){if(Th)return Ih;Th=1;var s=Gn().Uint8Array;return Ih=s}(),n=zi(),r=Nf(),o=Oh?Hh:(Oh=1,Hh=function(s){var c=-1,h=Array(s.size);return s.forEach(function(C,y){h[++c]=[y,C]}),h}),i=ra(),l=e?e.prototype:void 0,a=l?l.valueOf:void 0;return Ph=function(s,c,h,C,y,b,p){switch(h){case"[object DataView]":if(s.byteLength!=c.byteLength||s.byteOffset!=c.byteOffset)return!1;s=s.buffer,c=c.buffer;case"[object ArrayBuffer]":return!(s.byteLength!=c.byteLength||!b(new t(s),new t(c)));case"[object Boolean]":case"[object Date]":case"[object Number]":return n(+s,+c);case"[object Error]":return s.name==c.name&&s.message==c.message;case"[object RegExp]":case"[object String]":return s==c+"";case"[object Map]":var m=o;case"[object Set]":var E=1&C;if(m||(m=i),s.size!=c.size&&!E)return!1;var g=p.get(s);if(g)return g==c;C|=2,p.set(s,c);var w=r(m(s),m(c),C,y,b,p);return p.delete(s),w;case"[object Symbol]":if(a)return a.call(s)==a.call(c)}return!1}}function B1(){if(Bh)return Nh;Bh=1;var e=Lh?Fh:(Lh=1,Fh=function(o,i){for(var l=-1,a=o==null?0:o.length,s=0,c=[];++l<a;){var h=o[l];i(h,l,o)&&(c[s++]=h)}return c}),t=jh?_h:(jh=1,_h=function(){return[]}),n=Object.prototype.propertyIsEnumerable,r=Object.getOwnPropertySymbols;return Nh=r?function(o){return o==null?[]:(o=Object(o),e(r(o),function(i){return n.call(o,i)}))}:t}function W1(){if($h)return Wh;$h=1;var e=function(){if(Ah)return zh;Ah=1;var r=Qu(),o=Xn();return zh=function(i,l,a){var s=l(i);return o(i)?s:r(s,a(i))}}(),t=B1(),n=ha();return Wh=function(r){return e(r,n,t)}}function $1(){if(Zh)return Qh;Zh=1;var e=function(){if(Kh)return Yh;Kh=1;var w=Ir()(Gn(),"DataView");return Yh=w}(),t=Ai(),n=function(){if(Uh)return Vh;Uh=1;var w=Ir()(Gn(),"Promise");return Vh=w}(),r=Xu(),o=function(){if(Jh)return qh;Jh=1;var w=Ir()(Gn(),"WeakMap");return qh=w}(),i=io(),l=Vs(),a="[object Map]",s="[object Promise]",c="[object Set]",h="[object WeakMap]",C="[object DataView]",y=l(e),b=l(t),p=l(n),m=l(r),E=l(o),g=i;return(e&&g(new e(new ArrayBuffer(1)))!=C||t&&g(new t)!=a||n&&g(n.resolve())!=s||r&&g(new r)!=c||o&&g(new o)!=h)&&(g=function(w){var x=i(w),I=x=="[object Object]"?w.constructor:void 0,v=I?l(I):"";if(v)switch(v){case y:return C;case b:return a;case p:return s;case m:return c;case E:return h}return x}),Qh=g}function X1(){if(tf)return ef;tf=1;var e=jf(),t=Nf(),n=N1(),r=function(){if(Gh)return Xh;Gh=1;var y=W1(),b=Object.prototype.hasOwnProperty;return Xh=function(p,m,E,g,w,x){var I=1&E,v=y(p),M=v.length;if(M!=y(m).length&&!I)return!1;for(var S=M;S--;){var H=v[S];if(!(I?H in m:b.call(m,H)))return!1}var f=x.get(p),B=x.get(m);if(f&&B)return f==m&&B==p;var D=!0;x.set(p,m),x.set(m,p);for(var O=I;++S<M;){var T=p[H=v[S]],j=m[H];if(g)var V=I?g(j,T,H,m,p,x):g(T,j,H,p,m,x);if(!(V===void 0?T===j||w(T,j,E,g,x):V)){D=!1;break}O||(O=H=="constructor")}if(D&&!O){var Z=p.constructor,J=m.constructor;Z==J||!("constructor"in p)||!("constructor"in m)||typeof Z=="function"&&Z instanceof Z&&typeof J=="function"&&J instanceof J||(D=!1)}return x.delete(p),x.delete(m),D}}(),o=$1(),i=Xn(),l=Wd(),a=_f(),s="[object Arguments]",c="[object Array]",h="[object Object]",C=Object.prototype.hasOwnProperty;return ef=function(y,b,p,m,E,g){var w=i(y),x=i(b),I=w?c:o(y),v=x?c:o(b),M=(I=I==s?h:I)==h,S=(v=v==s?h:v)==h,H=I==v;if(H&&l(y)){if(!l(b))return!1;w=!0,M=!1}if(H&&!M)return g||(g=new e),w||a(y)?t(y,b,p,m,E,g):n(y,b,I,p,m,E,g);if(!(1&p)){var f=M&&C.call(y,"__wrapped__"),B=S&&C.call(b,"__wrapped__");if(f||B){var D=f?y.value():y,O=B?b.value():b;return g||(g=new e),E(D,O,p,m,g)}}return!!H&&(g||(g=new e),r(y,b,p,m,E,g))}}function Bf(){if(nf)return ua;nf=1;var e=X1(),t=ao();return ua=function n(r,o,i,l,a){return r===o||(r==null||o==null||!t(r)&&!t(o)?r!=r&&o!=o:e(r,o,i,l,n,a))},ua}function Wf(){if(lf)return af;lf=1;var e=Er();return af=function(t){return t==t&&!e(t)}}function $f(){return df?uf:(df=1,uf=function(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}})}function G1(){if(ff)return hf;ff=1;var e=function(){if(of)return rf;of=1;var r=jf(),o=Bf();return rf=function(i,l,a,s){var c=a.length,h=c,C=!s;if(i==null)return!h;for(i=Object(i);c--;){var y=a[c];if(C&&y[2]?y[1]!==i[y[0]]:!(y[0]in i))return!1}for(;++c<h;){var b=(y=a[c])[0],p=i[b],m=y[1];if(C&&y[2]){if(p===void 0&&!(b in i))return!1}else{var E=new r;if(s)var g=s(p,m,b,i,l,E);if(!(g===void 0?o(m,p,3,s,E):g))return!1}}return!0}}(),t=function(){if(cf)return sf;cf=1;var r=Wf(),o=ha();return sf=function(i){for(var l=o(i),a=l.length;a--;){var s=l[a],c=i[s];l[a]=[s,c,r(c)]}return l}}(),n=$f();return hf=function(r){var o=t(r);return o.length==1&&o[0][2]?n(o[0][0],o[0][1]):function(i){return i===r||e(i,r,o)}}}function Xf(){if(pf)return gf;pf=1;var e=Us(),t=Jo();return gf=function(n,r){for(var o=0,i=(r=e(r,n)).length;n!=null&&o<i;)n=n[t(r[o++])];return o&&o==i?n:void 0}}function Y1(){if(xf)return bf;xf=1;var e=yf?wf:(yf=1,wf=function(n,r){return n!=null&&r in Object(n)}),t=qs();return bf=function(n,r){return n!=null&&t(n,r,e)}}function K1(){if(Sf)return Cf;Sf=1;var e=Bf(),t=function(){if(vf)return mf;vf=1;var a=Xf();return mf=function(s,c,h){var C=s==null?void 0:a(s,c);return C===void 0?h:C}}(),n=Y1(),r=Di(),o=Wf(),i=$f(),l=Jo();return Cf=function(a,s){return r(a)&&o(s)?i(l(a),s):function(c){var h=t(c,a);return h===void 0&&h===s?n(c,a):e(s,h,3)}}}function V1(){if(Of)return Hf;Of=1;var e=Ef?Rf:(Ef=1,Rf=function(o){return function(i){return i==null?void 0:i[o]}}),t=function(){if(Tf)return If;Tf=1;var o=Xf();return If=function(i){return function(l){return o(l,i)}}}(),n=Di(),r=Jo();return Hf=function(o){return n(o)?e(r(o)):t(o)}}function U1(){if(Df)return Pf;Df=1;var e=G1(),t=K1(),n=Mf?kf:(Mf=1,kf=function(i){return i}),r=Xn(),o=V1();return Pf=function(i){return typeof i=="function"?i:i==null?n:typeof i=="object"?r(i)?t(i[0],i[1]):e(i):o(i)}}function q1(){if(Af)return zf;Af=1;var e=Id?Ed:(Id=1,Ed=function(o,i,l,a){for(var s=-1,c=o==null?0:o.length;++s<c;){var h=o[s];i(a,h,l(h),o)}return a}),t=function(){if(dh)return uh;dh=1;var o=j1();return uh=function(i,l,a,s){return o(i,function(c,h,C){l(s,c,a(c),C)}),s}}(),n=U1(),r=Xn();return zf=function(o,i){return function(l,a){var s=r(l)?e:t,c=i?i():{};return s(l,o,n(a,2),c)}}}var J1=function(){if(Lf)return Ff;Lf=1;var e=z1(),t=q1(),n=Object.prototype.hasOwnProperty,r=t(function(o,i,l){n.call(o,l)?o[l].push(i):e(o,l,[i])});return Ff=r}();const Q1=Sr(J1),Gf=(e,t,n)=>{let r=0,o=t,i=0,l=n;if(e!==void 0&&e.length>0){r=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;for(const a of e)r=Math.min(r,a.x-1),o=Math.max(o,a.x+a.width+1),i=Math.min(i,a.y-1),l=Math.max(l,a.y+a.height+1)}return{minX:r,maxX:o,minY:i,maxY:l}};function Yf(e,t,n,r,o,i,l,a,s,c,h,C,y,b,p,m,E,g=!1){if(s!==void 0){e.beginPath(),e.save(),e.rect(0,0,i,l);for(const O of s)e.rect(O.x+1,O.y+1,O.width-1,O.height-1);e.clip("evenodd")}const w=E.horizontalBorderColor??E.borderColor,x=E.borderColor,{minX:I,maxX:v,minY:M,maxY:S}=Gf(a,i,l),H=[];e.beginPath();let f=.5;for(let O=0;O<t.length;O++){const T=t[O];if(T.width===0)continue;f+=T.width;const j=T.sticky?f:f+r;j>=I&&j<=v&&b(O+1)&&H.push({x1:j,y1:Math.max(c,M),x2:j,y2:Math.min(l,S),color:x})}let B=l+.5;for(let O=m-p;O<m;O++)B-=C(O),H.push({x1:I,y1:B,x2:v,y2:B,color:w});if(g!==!0){let O=h+.5,T=n;const j=B;for(;O+o<j;){const V=O+o;if(V>=M&&V<=S-1){const Z=y==null?void 0:y(T);H.push({x1:I,y1:V,x2:v,y2:V,color:(Z==null?void 0:Z.horizontalBorderColor)??(Z==null?void 0:Z.borderColor)??w})}O+=C(T),T++}}const D=Q1(H,O=>O.color);for(const O of Object.keys(D)){e.strokeStyle=O;for(const T of D[O])e.moveTo(T.x1,T.y1),e.lineTo(T.x2,T.y2);e.stroke(),e.beginPath()}s!==void 0&&e.restore()}function Kf(e,t,n,r,o,i,l,a,s,c,h,C,y,b,p,m){const E=p==null?void 0:p.filter(S=>S.style!=="no-outline");if(E===void 0||E.length===0)return;const g=Yr(a),w=Or(b,y,C),x=[s,0,a.length,b-y],I=[g,0,t,n-w],v=E.map(S=>{const H=S.range,f=S.style??"dashed";return function(B,D,O,T,j){const[V,Z,J,ce]=D,[le,q,Q,fe]=j,{x:ee,y:se,width:ie,height:W}=B,N=[];if(ie<=0||W<=0)return N;const U=ee+ie,ue=se+W,pe=ee<V,ze=se<Z,Ue=ee+ie>J,He=se+W>ce,$e=ee>=V&&ee<J||U>V&&U<=J||ee<V&&U>J,be=se>=Z&&se<ce||ue>Z&&ue<=ce||se<Z&&ue>ce;if($e&&be){const ye=Math.max(ee,V),Fe=Math.max(se,Z),Oe=Math.min(U,J),te=Math.min(ue,ce);N.push({rect:{x:ye,y:Fe,width:Oe-ye,height:te-Fe},clip:{x:le,y:q,width:Q-le+1,height:fe-q+1}})}if(pe&&ze){const ye=ee,Fe=se,Oe=Math.min(U,V),te=Math.min(ue,Z);N.push({rect:{x:ye,y:Fe,width:Oe-ye,height:te-Fe},clip:{x:0,y:0,width:le+1,height:q+1}})}if(ze&&$e){const ye=Math.max(ee,V),Fe=se,Oe=Math.min(U,J),te=Math.min(ue,Z);N.push({rect:{x:ye,y:Fe,width:Oe-ye,height:te-Fe},clip:{x:le,y:0,width:Q-le+1,height:q+1}})}if(ze&&Ue){const ye=Math.max(ee,J),Fe=se,Oe=U,te=Math.min(ue,Z);N.push({rect:{x:ye,y:Fe,width:Oe-ye,height:te-Fe},clip:{x:Q,y:0,width:O-Q+1,height:q+1}})}if(pe&&be){const ye=ee,Fe=Math.max(se,Z),Oe=Math.min(U,V),te=Math.min(ue,ce);N.push({rect:{x:ye,y:Fe,width:Oe-ye,height:te-Fe},clip:{x:0,y:q,width:le+1,height:fe-q+1}})}if(Ue&&be){const ye=Math.max(ee,J),Fe=Math.max(se,Z),Oe=U,te=Math.min(ue,ce);N.push({rect:{x:ye,y:Fe,width:Oe-ye,height:te-Fe},clip:{x:Q,y:q,width:O-Q+1,height:fe-q+1}})}if(pe&&He){const ye=ee,Fe=Math.max(se,ce),Oe=Math.min(U,V),te=ue;N.push({rect:{x:ye,y:Fe,width:Oe-ye,height:te-Fe},clip:{x:0,y:fe,width:le+1,height:T-fe+1}})}if(He&&$e){const ye=Math.max(ee,V),Fe=Math.max(se,ce),Oe=Math.min(U,J),te=ue;N.push({rect:{x:ye,y:Fe,width:Oe-ye,height:te-Fe},clip:{x:le,y:fe,width:Q-le+1,height:T-fe+1}})}if(Ue&&He){const ye=Math.max(ee,J),Fe=Math.max(se,ce),Oe=U,te=ue;N.push({rect:{x:ye,y:Fe,width:Oe-ye,height:te-Fe},clip:{x:Q,y:fe,width:O-Q+1,height:T-fe+1}})}return N}(H,x,t,n,I).map(B=>{const D=B.rect,O=Qi(D.x,D.y,t,n,h,c+h,r,o,i,l,b,s,y,a,C),T=D.width===1&&D.height===1?O:Qi(D.x+D.width-1,D.y+D.height-1,t,n,h,c+h,r,o,i,l,b,s,y,a,C);return D.x+D.width>=a.length&&(T.width-=1),D.y+D.height>=b&&(T.height-=1),{color:S.color,style:f,clip:B.clip,rect:H1({x:O.x,y:O.y,width:T.x+T.width-O.x,height:T.y+T.height-O.y},t,n,8)}})}),M=()=>{e.lineWidth=1;let S=!1;for(const H of v)for(const f of H)if((f==null?void 0:f.rect)!==void 0&&xo(0,0,t,n,f.rect.x,f.rect.y,f.rect.width,f.rect.height)){const B=S,D=!T1(f.clip,f.rect);e.beginPath(),D&&(e.save(),e.rect(f.clip.x,f.clip.y,f.clip.width,f.clip.height),e.clip()),f.style!=="dashed"||S?f.style!=="solid"&&f.style!=="solid-outline"||!S||(e.setLineDash([]),S=!1):(e.setLineDash([5,3]),S=!0),e.strokeStyle=f.style==="solid-outline"?In(In(f.color,m.borderColor),m.bgCell):Hr(f.color,1),e.closePath(),e.strokeRect(f.rect.x+.5,f.rect.y+.5,f.rect.width-1,f.rect.height-1),D&&(e.restore(),S=B)}S&&e.setLineDash([])};return M(),M}function Vf(e,t,n,r,o){e.beginPath(),e.moveTo(t,n),e.lineTo(t,r),e.lineWidth=2,e.strokeStyle=o,e.stroke(),e.globalAlpha=1}function fa(e,t,n,r,o,i,l,a,s,c,h,C,y,b,p,m,E){if(h.current===void 0)return;const g=h.current.range,w=h.current.cell,x=[g.x+g.width-1,g.y+g.height-1];if(w[1]>=E&&x[1]>=E||!l.some(O=>O.sourceIndex===w[0]||O.sourceIndex===x[0]))return;const[I,v]=h.current.cell,M=y(h.current.cell),S=M.span??[I,I],H=b>0&&!(v>=E-b)?Or(E,b,C)-1:0,f=x[1];let B;if(gr(l,r,o,i,c,(O,T,j,V,Z)=>{if(O.sticky&&I>O.sourceIndex)return;const J=O.sourceIndex<S[0],ce=O.sourceIndex>S[1],le=O.sourceIndex===x[0];return le||!J&&!ce?(ai(Z,j,n,E,C,b,p,void 0,(q,Q,fe)=>{if(Q!==v&&Q!==f)return;let ee=T,se=O.width;if(M.span!==void 0){const ie=pd(M.span,T,q,O.width,fe,O,a),W=O.sticky?ie[0]:ie[1];W!==void 0&&(ee=W.x,se=W.width)}return Q===f&&le&&m&&(B=()=>{var ie;V>ee&&!O.sticky&&(e.beginPath(),e.rect(V,0,t-V,n),e.clip()),e.beginPath(),e.rect(ee+se-4,q+fe-4,4,4),e.fillStyle=((ie=O.themeOverride)==null?void 0:ie.accentColor)??s.accentColor,e.fill()}),B!==void 0}),B!==void 0):void 0}),B===void 0)return;const D=()=>{e.save(),e.beginPath(),e.rect(0,c,t,n-c-H),e.clip(),B==null||B(),e.restore()};return D(),D}function Uf(e,t){var _n;const{canvasCtx:n,headerCanvasCtx:r,width:o,height:i,cellXOffset:l,cellYOffset:a,translateX:s,translateY:c,mappedColumns:h,enableGroups:C,freezeColumns:y,dragAndDropState:b,theme:p,drawFocus:m,headerHeight:E,groupHeaderHeight:g,disabledRows:w,rowHeight:x,verticalBorder:I,overrideCursor:v,isResizing:M,selection:S,fillHandle:H,freezeTrailingRows:f,rows:B,getCellContent:D,getGroupDetails:O,getRowThemeOverride:T,isFocused:j,drawHeaderCallback:V,prelightCells:Z,drawCellCallback:J,highlightRegions:ce,resizeCol:le,imageLoader:q,lastBlitData:Q,hoverValues:fe,hyperWrapping:ee,hoverInfo:se,spriteManager:ie,maxScaleFactor:W,hasAppendRow:N,touchMode:U,enqueue:ue,renderStateProvider:pe,getCellRenderer:ze,renderStrategy:Ue,bufferACtx:He,bufferBCtx:$e,damage:be,minimumCellWidth:ye,resizeIndicator:Fe}=e;if(o===0||i===0)return;const Oe=Ue==="double-buffer",te=Math.min(W,Math.ceil(window.devicePixelRatio??1)),Ee=Ue!=="direct"&&function(ne,xe){if(xe===void 0||ne.width!==xe.width||ne.height!==xe.height||ne.theme!==xe.theme||ne.headerHeight!==xe.headerHeight||ne.rowHeight!==xe.rowHeight||ne.rows!==xe.rows||ne.freezeColumns!==xe.freezeColumns||ne.getRowThemeOverride!==xe.getRowThemeOverride||ne.isFocused!==xe.isFocused||ne.isResizing!==xe.isResizing||ne.verticalBorder!==xe.verticalBorder||ne.getCellContent!==xe.getCellContent||ne.highlightRegions!==xe.highlightRegions||ne.selection!==xe.selection||ne.dragAndDropState!==xe.dragAndDropState||ne.prelightCells!==xe.prelightCells||ne.touchMode!==xe.touchMode||ne.maxScaleFactor!==xe.maxScaleFactor)return!1;if(ne.mappedColumns!==xe.mappedColumns){if(ne.mappedColumns.length>100||ne.mappedColumns.length!==xe.mappedColumns.length)return!1;let wt;for(let dt=0;dt<ne.mappedColumns.length;dt++){const xt=ne.mappedColumns[dt],ve=xe.mappedColumns[dt];if($r(xt,ve))continue;if(wt!==void 0||xt.width===ve.width)return!1;const{width:Ve,...Ke}=xt,{width:mt,...it}=ve;if(!$r(Ke,it))return!1;wt=dt}return wt===void 0||wt}return!0}(e,t),ke=n.canvas;ke.width===o*te&&ke.height===i*te||(ke.width=o*te,ke.height=i*te,ke.style.width=o+"px",ke.style.height=i+"px");const Xe=r.canvas,Re=C?g+E:E,qe=Re+1;Xe.width===o*te&&Xe.height===qe*te||(Xe.width=o*te,Xe.height=qe*te,Xe.style.width=o+"px",Xe.style.height=qe+"px");const Ye=He.canvas,ot=$e.canvas;!Oe||Ye.width===o*te&&Ye.height===i*te||(Ye.width=o*te,Ye.height=i*te,Q.current!==void 0&&(Q.current.aBufferScroll=void 0)),!Oe||ot.width===o*te&&ot.height===i*te||(ot.width=o*te,ot.height=i*te,Q.current!==void 0&&(Q.current.bBufferScroll=void 0));const Me=Q.current;if(Ee===!0&&l===(Me==null?void 0:Me.cellXOffset)&&a===(Me==null?void 0:Me.cellYOffset)&&s===(Me==null?void 0:Me.translateX)&&c===(Me==null?void 0:Me.translateY))return;let Pe=null;Oe&&(Pe=n);const ut=r;let tt;tt=Oe?be!==void 0?(Me==null?void 0:Me.lastBuffer)==="b"?$e:He:(Me==null?void 0:Me.lastBuffer)==="b"?He:$e:n;const pt=tt.canvas,Ft=Oe?pt===Ye?ot:Ye:ke,bt=typeof x=="number"?()=>x:x;ut.save(),tt.save(),ut.beginPath(),tt.beginPath(),ut.textBaseline="middle",tt.textBaseline="middle",te!==1&&(ut.scale(te,te),tt.scale(te,te));const Ze=Ji(h,l,o,b,s);let Yt=[];const nn=m&&((_n=S.current)==null?void 0:_n.cell[1])===a&&c===0;let Kt=!1;if(ce!==void 0){for(const ne of ce)if(ne.style!=="no-outline"&&ne.range.y===a&&c===0){Kt=!0;break}}const qt=()=>{D1(ut,Ze,C,se,o,s,E,g,b,M,S,p,ie,fe,I,O,be,V,U),Yf(ut,Ze,a,s,c,o,i,void 0,void 0,g,Re,bt,T,I,f,B,p,!0),ut.beginPath(),ut.moveTo(0,qe-.5),ut.lineTo(o,qe-.5),ut.strokeStyle=In(p.headerBottomBorderColor??p.horizontalBorderColor??p.borderColor,p.bgHeader),ut.stroke(),Kt&&Kf(ut,o,i,l,a,s,c,h,y,E,g,x,f,B,ce,p),nn&&fa(ut,o,i,a,s,c,Ze,h,p,Re,S,bt,D,f,N,H,B)};if(be!==void 0){const ne=Ze[Ze.length-1].sourceIndex+1,xe=wt=>{vd(wt,Ze,h,i,Re,s,c,a,B,bt,D,O,T,w,j,m,f,N,Yt,be,S,Z,ce,q,ie,fe,se,J,ee,p,ue,pe,ze,v,ye);const dt=S.current;H&&m&&dt!==void 0&&be.has(Kc(dt.range))&&fa(wt,o,i,a,s,c,Ze,h,p,Re,S,bt,D,f,N,H,B)};return be.hasItemInRegion([{x:l,y:-2,width:ne,height:2},{x:l,y:a,width:ne,height:300},{x:0,y:a,width:y,height:300},{x:0,y:-2,width:y,height:2},{x:l,y:B-f,width:ne,height:f,when:f>0}])&&(xe(tt),Pe!==null&&(Pe.save(),Pe.scale(te,te),Pe.textBaseline="middle",xe(Pe),Pe.restore()),be.hasHeader()&&(function(wt,dt,xt,ve,Ve,Ke,mt,it,at){at!==void 0&&at.size!==0&&(wt.beginPath(),gd(dt,xt,Ke,ve,(vt,Je,lt,rt,De,Nt)=>{at.hasItemInRectangle({x:vt[0],y:-2,width:vt[1]-vt[0]+1,height:1})&&wt.rect(lt,rt,De,Nt)}),gr(dt,it,Ke,mt,Ve,(vt,Je,lt,rt)=>{const De=Math.max(0,rt-Je),Nt=Je+De+1,gn=vt.width-De-1;at.has([vt.sourceIndex,-1])&&wt.rect(Nt,ve,gn,Ve-ve)}),wt.clip())}(ut,Ze,o,g,Re,s,c,a,be),qt())),tt.restore(),void ut.restore()}if(Ee===!0&&l===(Me==null?void 0:Me.cellXOffset)&&s===(Me==null?void 0:Me.translateX)&&nn===(Me==null?void 0:Me.mustDrawFocusOnHeader)&&Kt===(Me==null?void 0:Me.mustDrawHighlightRingsOnHeader)||qt(),Ee===!0){Rn(Ft!==void 0&&Me!==void 0);const{regions:ne}=function(xe,wt,dt,xt,ve,Ve,Ke,mt,it,at,vt,Je,lt,rt,De,Nt,gn,Zt,rn){const Bt=[];xe.imageSmoothingEnabled=!1;const Xt=Math.min(ve.cellYOffset,Ke),Sn=Math.max(ve.cellYOffset,Ke);let Rt=0;if(typeof Zt=="number")Rt+=(Sn-Xt)*Zt;else for(let Qe=Xt;Qe<Sn;Qe++)Rt+=Zt(Qe);Ke>ve.cellYOffset&&(Rt=-Rt),Rt+=it-ve.translateY;const kn=Math.min(ve.cellXOffset,Ve),pn=Math.max(ve.cellXOffset,Ve);let kt=0;for(let Qe=kn;Qe<pn;Qe++)kt+=Nt[Qe].width;Ve>ve.cellXOffset&&(kt=-kt),kt+=mt-ve.translateX;const It=Yr(gn);if(kt!==0&&Rt!==0)return{regions:[]};const Vt=at>0?Or(lt,at,Zt):0,Et=vt-It-Math.abs(kt),Tt=Je-rt-Vt-Math.abs(Rt)-1;if(Et>150&&Tt>150){const Qe={sx:0,sy:0,sw:vt*De,sh:Je*De,dx:0,dy:0,dw:vt*De,dh:Je*De};if(Rt>0?(Qe.sy=(rt+1)*De,Qe.sh=Tt*De,Qe.dy=(Rt+rt+1)*De,Qe.dh=Tt*De,Bt.push({x:0,y:rt,width:vt,height:Rt+1})):Rt<0&&(Qe.sy=(-Rt+rt+1)*De,Qe.sh=Tt*De,Qe.dy=(rt+1)*De,Qe.dh=Tt*De,Bt.push({x:0,y:Je+Rt-Vt,width:vt,height:-Rt+Vt})),kt>0?(Qe.sx=It*De,Qe.sw=Et*De,Qe.dx=(kt+It)*De,Qe.dw=Et*De,Bt.push({x:It-1,y:0,width:kt+2,height:Je})):kt<0&&(Qe.sx=(It-kt)*De,Qe.sw=Et*De,Qe.dx=It*De,Qe.dw=Et*De,Bt.push({x:vt+kt,y:0,width:-kt,height:Je})),xe.setTransform(1,0,0,1,0,0),rn){if(It>0&&kt!==0&&Rt===0&&(xt===void 0||(dt==null?void 0:dt[1])!==!1)){const Jt=It*De,Mn=Je*De;xe.drawImage(wt,0,0,Jt,Mn,0,0,Jt,Mn)}if(Vt>0&&kt===0&&Rt!==0&&(xt===void 0||(dt==null?void 0:dt[0])!==!1)){const Jt=(Je-Vt)*De,Mn=vt*De,mn=Vt*De;xe.drawImage(wt,0,Jt,Mn,mn,0,Jt,Mn,mn)}}xe.drawImage(wt,Qe.sx,Qe.sy,Qe.sw,Qe.sh,Qe.dx,Qe.dy,Qe.dw,Qe.dh),xe.scale(De,De)}return xe.imageSmoothingEnabled=!0,{regions:Bt}}(tt,Ft,Ft===Ye?Me.aBufferScroll:Me.bBufferScroll,Ft===Ye?Me.bBufferScroll:Me.aBufferScroll,Me,l,a,s,c,f,o,i,B,Re,te,h,Ze,x,Oe);Yt=ne}else Ee!==!1&&(Rn(Me!==void 0),Yt=function(ne,xe,wt,dt,xt,ve,Ve,Ke,mt,it){const at=[];return xe!==ne.cellXOffset||wt!==ne.cellYOffset||dt!==ne.translateX||xt!==ne.translateY||gr(mt,wt,dt,xt,Ke,(vt,Je,lt,rt)=>{if(vt.sourceIndex===it){const De=Math.max(Je,rt)+1;return at.push({x:De,y:0,width:ve-De,height:Ve}),!0}}),at}(Me,l,a,s,c,o,i,Re,Ze,Ee));(function(ne,xe,wt,dt,xt,ve,Ve,Ke,mt){let it=!1;for(const rt of xe)if(!rt.sticky){it=Ve(rt.sourceIndex);break}const at=mt.horizontalBorderColor??mt.borderColor,vt=mt.borderColor,Je=it?Yr(xe):0;let lt;if(Je!==0&&(lt=Gc(vt,mt.bgCell),ne.beginPath(),ne.moveTo(Je+.5,0),ne.lineTo(Je+.5,dt),ne.strokeStyle=lt,ne.stroke()),xt>0){const rt=vt===at&&lt!==void 0?lt:Gc(at,mt.bgCell),De=Or(ve,xt,Ke);ne.beginPath(),ne.moveTo(0,dt-De+.5),ne.lineTo(wt,dt-De+.5),ne.strokeStyle=rt,ne.stroke()}})(tt,Ze,o,i,f,B,I,bt,p);const un=Kf(tt,o,i,l,a,s,c,h,y,E,g,x,f,B,ce,p),jt=m?fa(tt,o,i,a,s,c,Ze,h,p,Re,S,bt,D,f,N,H,B):void 0;if(tt.fillStyle=p.bgCell,Yt.length>0){tt.beginPath();for(const ne of Yt)tt.rect(ne.x,ne.y,ne.width,ne.height);tt.clip(),tt.fill(),tt.beginPath()}else tt.fillRect(0,0,o,i);const Kn=vd(tt,Ze,h,i,Re,s,c,a,B,bt,D,O,T,w,j,m,f,N,Yt,be,S,Z,ce,q,ie,fe,se,J,ee,p,ue,pe,ze,v,ye);(function(ne,xe,wt,dt,xt,ve,Ve,Ke,mt,it,at,vt,Je,lt,rt,De,Nt,gn,Zt){if(gn!==void 0||xe[xe.length-1]!==wt[xe.length-1])return;const rn=fd(Nt);gr(xe,mt,Ve,Ke,ve,(Bt,Xt,Sn,Rt,kn)=>{if(Bt!==xe[xe.length-1])return;Xt+=Bt.width;const pn=Math.max(Xt,Rt);pn>dt||(ne.save(),ne.beginPath(),ne.rect(pn,ve+1,1e4,xt-ve-1),ne.clip(),ai(kn,Sn,xt,it,at,rt,De,rn,(kt,It,Vt,Et)=>{if(!Et&&Nt.length>0&&!Nt.some(mn=>xo(Xt,kt,1e4,Vt,mn.x,mn.y,mn.width,mn.height)))return;const Tt=Je.hasIndex(It),Qe=lt.hasIndex(It);ne.beginPath();const Jt=vt==null?void 0:vt(It),Mn=Jt===void 0?Zt:Zn(Zt,Jt);Mn.bgCell!==Zt.bgCell&&(ne.fillStyle=Mn.bgCell,ne.fillRect(Xt,kt,1e4,Vt)),Qe&&(ne.fillStyle=Mn.bgHeader,ne.fillRect(Xt,kt,1e4,Vt)),Tt&&(ne.fillStyle=Mn.accentLight,ne.fillRect(Xt,kt,1e4,Vt))}),ne.restore())})})(tt,Ze,h,o,i,Re,s,c,a,B,bt,T,S.rows,w,f,N,Yt,be,p),function(ne,xe,wt,dt,xt,ve,Ve,Ke,mt,it,at,vt,Je,lt,rt){var Vt;const De=rt.bgCell,{minX:Nt,maxX:gn,minY:Zt,maxY:rn}=Gf(Ke,ve,Ve),Bt=[],Xt=Ve-Or(lt,Je,it);let Sn=mt,Rt=wt,kn=0;for(;Sn+xt<Xt;){const Et=Sn+xt,Tt=it(Rt);if(Et>=Zt&&Et<=rn-1){const Qe=at==null?void 0:at(Rt),Jt=Qe==null?void 0:Qe.bgCell;Jt!==void 0&&Jt!==De&&Rt>=lt-Je&&Bt.push({x:Nt,y:Et,w:gn-Nt,h:Tt,color:Jt})}Sn+=Tt,Rt<lt-Je&&(kn=Sn),Rt++}let pn=0;const kt=Math.min(Xt,rn)-kn;if(kt>0)for(let Et=0;Et<xe.length;Et++){const Tt=xe[Et];if(Tt.width===0)continue;const Qe=Tt.sticky?pn:pn+dt,Jt=(Vt=Tt.themeOverride)==null?void 0:Vt.bgCell;Jt!==void 0&&Jt!==De&&Qe>=Nt&&Qe<=gn&&vt(Et+1)&&Bt.push({x:Qe,y:kn,w:Tt.width,h:kt,color:Jt}),pn+=Tt.width}if(Bt.length===0)return;let It;ne.beginPath();for(let Et=Bt.length-1;Et>=0;Et--){const Tt=Bt[Et];It===void 0?It=Tt.color:Tt.color!==It&&(ne.fillStyle=It,ne.fill(),ne.beginPath(),It=Tt.color),ne.rect(Tt.x,Tt.y,Tt.w,Tt.h)}It!==void 0&&(ne.fillStyle=It,ne.fill()),ne.beginPath()}(tt,Ze,a,s,c,o,i,Yt,Re,bt,T,I,f,B,p),Yf(tt,Ze,a,s,c,o,i,Yt,Kn,g,Re,bt,T,I,f,B,p),un==null||un(),jt==null||jt(),M&&Fe!=="none"&&gr(Ze,0,s,0,Re,(ne,xe)=>ne.sourceIndex===le&&(Vf(ut,xe+ne.width,0,Re+1,In(p.resizeIndicatorColor??p.accentLight,p.bgHeader)),Fe==="full"&&Vf(tt,xe+ne.width,Re,i,In(p.resizeIndicatorColor??p.accentLight,p.bgCell)),!0)),Pe!==null&&(Pe.fillStyle=p.bgCell,Pe.fillRect(0,0,o,i),Pe.drawImage(tt.canvas,0,0));const vr=function(ne,xe,wt,dt,xt,ve,Ve,Ke,mt,it){let at=0;return gr(ne,ve,dt,xt,wt,(vt,Je,lt,rt,De)=>(ai(De,lt,xe,Ve,Ke,mt,it,void 0,(Nt,gn,Zt,rn)=>{rn||(at=Math.max(gn,at))}),!0)),at}(Ze,i,Re,s,c,a,B,bt,f,N);q==null||q.setWindow({x:l,y:a,width:Ze.length,height:vr-a},y,Array.from({length:f},(ne,xe)=>B-1-xe));const Dt=Me!==void 0&&(l!==Me.cellXOffset||s!==Me.translateX),tr=Me!==void 0&&(a!==Me.cellYOffset||c!==Me.translateY);Q.current={cellXOffset:l,cellYOffset:a,translateX:s,translateY:c,mustDrawFocusOnHeader:nn,mustDrawHighlightRingsOnHeader:Kt,lastBuffer:Oe?pt===Ye?"a":"b":void 0,aBufferScroll:pt===Ye?[Dt,tr]:Me==null?void 0:Me.aBufferScroll,bBufferScroll:pt===ot?[Dt,tr]:Me==null?void 0:Me.bBufferScroll},tt.restore(),ut.restore()}function Z1(e){const t=e-1;return t*t*t+1}class eg{constructor(t){ft(this,"callback");ft(this,"currentHoveredItem");ft(this,"leavingItems",[]);ft(this,"lastAnimationTime");ft(this,"addToLeavingItems",t=>{this.leavingItems.some(n=>vo(n.item,t.item))||this.leavingItems.push(t)});ft(this,"removeFromLeavingItems",t=>{const n=this.leavingItems.find(r=>vo(r.item,t));return this.leavingItems=this.leavingItems.filter(r=>r!==n),(n==null?void 0:n.hoverAmount)??0});ft(this,"cleanUpLeavingElements",()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)});ft(this,"shouldStep",()=>{const t=this.leavingItems.length>0,n=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||n});ft(this,"getAnimatingItems",()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>({...t,hoverAmount:Z1(t.hoverAmount)})));ft(this,"step",t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const n=(t-this.lastAnimationTime)/80;for(const o of this.leavingItems)o.hoverAmount=On(o.hoverAmount-n,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=On(this.currentHoveredItem.hoverAmount+n,0,1));const r=this.getAnimatingItems();this.callback(r),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0});ft(this,"setHovered",t=>{var n;if(!vo((n=this.currentHoveredItem)==null?void 0:n.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){const r=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:r}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}});this.callback=t}}class tg{constructor(t){ft(this,"fn");ft(this,"val");this.fn=t}get value(){return this.val??(this.val=this.fn())}}function ga(e){return new tg(e)}const ng=ga(()=>window.navigator.userAgent.includes("Firefox")),si=ga(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),ci=ga(()=>window.navigator.platform.toLowerCase().startsWith("mac")),pr="header",Pn="group-header",ui="out-of-bounds";var Vr;function qf(e,t){return e===t||((e==null?void 0:e.kind)==="out-of-bounds"?(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])&&(e==null?void 0:e.region[0])===(t==null?void 0:t.region[0])&&(e==null?void 0:e.region[1])===(t==null?void 0:t.region[1]):(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1]))}(function(e){e[e.Start=-2]="Start",e[e.StartPadding=-1]="StartPadding",e[e.Center=0]="Center",e[e.EndPadding=1]="EndPadding",e[e.End=2]="End"})(Vr||(Vr={}));const rg=d.memo(d.forwardRef((e,t)=>{const{width:n,height:r,accessibilityHeight:o,columns:i,cellXOffset:l,cellYOffset:a,headerHeight:s,fillHandle:c=!1,groupHeaderHeight:h,rowHeight:C,rows:y,getCellContent:b,getRowThemeOverride:p,onHeaderMenuClick:m,onHeaderIndicatorClick:E,enableGroups:g,isFilling:w,onCanvasFocused:x,onCanvasBlur:I,isFocused:v,selection:M,freezeColumns:S,onContextMenu:H,freezeTrailingRows:f,fixedShadowX:B=!0,fixedShadowY:D=!0,drawFocusRing:O,onMouseDown:T,onMouseUp:j,onMouseMoveRaw:V,onMouseMove:Z,onItemHovered:J,dragAndDropState:ce,firstColAccessible:le,onKeyDown:q,onKeyUp:Q,highlightRegions:fe,canvasRef:ee,onDragStart:se,onDragEnd:ie,eventTargetRef:W,isResizing:N,resizeColumn:U,isDragging:ue,isDraggable:pe=!1,allowResize:ze,disabledRows:Ue,hasAppendRow:He,getGroupDetails:$e,theme:be,prelightCells:ye,headerIcons:Fe,verticalBorder:Oe,drawCell:te,drawHeader:Ee,onCellFocused:ke,onDragOverCell:Xe,onDrop:Re,onDragLeave:qe,imageWindowLoader:Ye,smoothScrollX:ot=!1,smoothScrollY:Me=!1,experimental:Pe,getCellRenderer:ut,resizeIndicator:tt="full"}=e,pt=e.translateX??0,Ft=e.translateY??0,bt=Math.max(S,Math.min(i.length-1,l)),Ze=d.useRef(null),Yt=d.useRef((Pe==null?void 0:Pe.eventTarget)??window),nn=Yt.current,Kt=Ye,qt=d.useRef(),[un,jt]=d.useState(!1),Kn=d.useRef([]),vr=d.useRef(),[Dt,tr]=d.useState(),[_n,ne]=d.useState(),xe=d.useRef(null),[wt,dt]=d.useState(),[xt,ve]=d.useState(!1),Ve=d.useRef(xt);Ve.current=xt;const Ke=d.useMemo(()=>new I1(Fe,()=>{kn.current=void 0,Vt.current()}),[Fe]),mt=g?h+s:s,it=d.useRef(-1),at=((Pe==null?void 0:Pe.enableFirefoxRescaling)??!1)&&ng.value,vt=((Pe==null?void 0:Pe.enableSafariRescaling)??!1)&&si.value;d.useLayoutEffect(()=>{window.devicePixelRatio!==1&&(at||vt)&&(it.current!==-1&&jt(!0),window.clearTimeout(it.current),it.current=window.setTimeout(()=>{jt(!1),it.current=-1},200))},[a,bt,pt,Ft,at,vt]);const Je=function(L,ae){return $t.useMemo(()=>L.map((de,Ce)=>({group:de.group,grow:de.grow,hasMenu:de.hasMenu,icon:de.icon,id:de.id,menuIcon:de.menuIcon,overlayIcon:de.overlayIcon,sourceIndex:Ce,sticky:Ce<ae,indicatorIcon:de.indicatorIcon,style:de.style,themeOverride:de.themeOverride,title:de.title,trailingRowOptions:de.trailingRowOptions,width:de.width,growOffset:de.growOffset,rowMarker:de.rowMarker,rowMarkerChecked:de.rowMarkerChecked,headerRowMarkerTheme:de.headerRowMarkerTheme,headerRowMarkerAlwaysVisible:de.headerRowMarkerAlwaysVisible,headerRowMarkerDisabled:de.headerRowMarkerDisabled})),[L,ae])}(i,S),lt=d.useMemo(()=>B?Yr(Je,ce):0,[Je,ce,B]),rt=d.useCallback((L,ae,de)=>{const Ce=L.getBoundingClientRect();if(ae>=Je.length||de>=y)return;const he=Ce.width/n,z=Qi(ae,de,n,r,h,mt,bt,a,pt,Ft,y,S,f,Je,C);return he!==1&&(z.x*=he,z.y*=he,z.width*=he,z.height*=he),z.x+=Ce.x,z.y+=Ce.y,z},[n,r,h,mt,bt,a,pt,Ft,y,S,f,Je,C]),De=d.useCallback((L,ae,de,Ce)=>{const he=L.getBoundingClientRect(),z=he.width/n,Ie=(ae-he.left)/z,Le=(de-he.top)/z,Be=Ji(Je,bt,n,void 0,pt);let Mt=0,Ae=0;Ce instanceof MouseEvent&&(Mt=Ce.button,Ae=Ce.buttons);const _e=function(Ne,ht,gt){let yn=0;for(const an of ht){if(Ne<=(an.sticky?yn:yn+(gt??0))+an.width)return an.sourceIndex;yn+=an.width}return-1}(Ie,Be,pt),et=function(Ne,ht,gt,yn,an,lr,Ht,hn,vi,Jr){const sr=yn+an;if(gt&&Ne<=an)return-2;if(Ne<=sr)return-1;let Ao=ht;for(let Gt=0;Gt<Jr;Gt++){const Dn=lr-1-Gt;if(Ao-=typeof Ht=="number"?Ht:Ht(Dn),Ne>=Ao)return Dn}const Fo=lr-Jr,Ct=Ne-(vi??0);if(typeof Ht=="number"){const Gt=Math.floor((Ct-sr)/Ht)+hn;return Gt>=Fo?void 0:Gt}{let Gt=sr;for(let Dn=hn;Dn<Fo;Dn++){const Lo=Ht(Dn);if(Ct<=Gt+Lo)return Dn;Gt+=Lo}return}}(Le,r,g,s,h,y,C,a,Ft,f),dn=(Ce==null?void 0:Ce.shiftKey)===!0,en=(Ce==null?void 0:Ce.ctrlKey)===!0,br=(Ce==null?void 0:Ce.metaKey)===!0,ar=Ce!==void 0&&!(Ce instanceof MouseEvent)||(Ce==null?void 0:Ce.pointerType)==="touch",on=[Ie<0?-1:n<Ie?1:0,Le<mt?-1:r<Le?1:0];let Lt;if(_e===-1||Le<0||Ie<0||et===void 0||Ie>n||Le>r){const Ne=Ie>n?1:Ie<0?-1:0,ht=Le>r?1:Le<0?-1:0;let gt=2*Ne,yn=2*ht;Ne===0&&(gt=_e===-1?Vr.EndPadding:Vr.Center),ht===0&&(yn=et===void 0?Vr.EndPadding:Vr.Center);let an=!1;if(_e===-1&&et===-1){const Ht=rt(L,Je.length-1,-1);Rn(Ht!==void 0),an=ae<Ht.x+Ht.width+5}const lr=Ie>n&&Ie<n+Ki()||Le>r&&Le<r+Ki();Lt={kind:ui,location:[_e!==-1?_e:Ie<0?0:Je.length-1,et??y-1],region:[gt,yn],shiftKey:dn,ctrlKey:en,metaKey:br,isEdge:an,isTouch:ar,button:Mt,buttons:Ae,scrollEdge:on,isMaybeScrollbar:lr}}else if(et<=-1){let Ne=rt(L,_e,et);Rn(Ne!==void 0);let ht=Ne!==void 0&&Ne.x+Ne.width-ae<=5;const gt=_e-1;ae-Ne.x<=5&&gt>=0?(ht=!0,Ne=rt(L,gt,et),Rn(Ne!==void 0),Lt={kind:g&&et===-2?Pn:pr,location:[gt,et],bounds:Ne,group:Je[gt].group??"",isEdge:ht,shiftKey:dn,ctrlKey:en,metaKey:br,isTouch:ar,localEventX:ae-Ne.x,localEventY:de-Ne.y,button:Mt,buttons:Ae,scrollEdge:on}):Lt={kind:g&&et===-2?Pn:pr,group:Je[_e].group??"",location:[_e,et],bounds:Ne,isEdge:ht,shiftKey:dn,ctrlKey:en,metaKey:br,isTouch:ar,localEventX:ae-Ne.x,localEventY:de-Ne.y,button:Mt,buttons:Ae,scrollEdge:on}}else{const Ne=rt(L,_e,et);Rn(Ne!==void 0);const ht=Ne!==void 0&&Ne.x+Ne.width-ae<5;let gt=!1;if(c&&M.current!==void 0){const yn=Kc(M.current.range),an=rt(L,yn[0],yn[1]);if(an!==void 0){const lr=an.x+an.width-2,Ht=an.y+an.height-2;gt=Math.abs(lr-ae)<6&&Math.abs(Ht-de)<6}}Lt={kind:"cell",location:[_e,et],bounds:Ne,isEdge:ht,shiftKey:dn,ctrlKey:en,isFillHandle:gt,metaKey:br,isTouch:ar,localEventX:ae-Ne.x,localEventY:de-Ne.y,button:Mt,buttons:Ae,scrollEdge:on}}return Lt},[n,Je,bt,pt,r,g,s,h,y,C,a,Ft,f,rt,c,M,mt]),[Nt]=Dt??[],gn=d.useRef(()=>{}),Zt=d.useRef(Dt);Zt.current=Dt;const[rn,Bt]=d.useMemo(()=>{const L=document.createElement("canvas"),ae=document.createElement("canvas");return L.style.display="none",L.style.opacity="0",L.style.position="fixed",ae.style.display="none",ae.style.opacity="0",ae.style.position="fixed",[L.getContext("2d",{alpha:!1}),ae.getContext("2d",{alpha:!1})]},[]);d.useLayoutEffect(()=>{if(rn!==null&&Bt!==null)return document.documentElement.append(rn.canvas),document.documentElement.append(Bt.canvas),()=>{rn.canvas.remove(),Bt.canvas.remove()}},[rn,Bt]);const Xt=d.useMemo(()=>new y1,[]),Sn=at&&un?1:vt&&un?2:5,Rt=(Pe==null?void 0:Pe.disableMinimumCellWidth)===!0?1:10,kn=d.useRef(),pn=d.useRef(null),kt=d.useRef(null),It=d.useCallback(()=>{var z;const L=Ze.current,ae=xe.current;if(L===null||ae===null||(pn.current===null&&(pn.current=L.getContext("2d",{alpha:!1}),L.width=0,L.height=0),kt.current===null&&(kt.current=ae.getContext("2d",{alpha:!1}),ae.width=0,ae.height=0),pn.current===null||kt.current===null||rn===null||Bt===null))return;let de=!1;const Ce=kn.current,he={headerCanvasCtx:kt.current,canvasCtx:pn.current,bufferACtx:rn,bufferBCtx:Bt,width:n,height:r,cellXOffset:bt,cellYOffset:a,translateX:Math.round(pt),translateY:Math.round(Ft),mappedColumns:Je,enableGroups:g,freezeColumns:S,dragAndDropState:ce,theme:be,headerHeight:s,groupHeaderHeight:h,disabledRows:Ue??yt.empty(),rowHeight:C,verticalBorder:Oe,isResizing:N,resizeCol:U,isFocused:v,selection:M,fillHandle:c,drawCellCallback:te,hasAppendRow:He,overrideCursor:Ie=>{de=!0,dt(Ie)},maxScaleFactor:Sn,freezeTrailingRows:f,rows:y,drawFocus:O,getCellContent:b,getGroupDetails:$e??(Ie=>({name:Ie})),getRowThemeOverride:p,drawHeaderCallback:Ee,prelightCells:ye,highlightRegions:fe,imageLoader:Kt,lastBlitData:vr,damage:qt.current,hoverValues:Kn.current,hoverInfo:Zt.current,spriteManager:Ke,scrolling:un,hyperWrapping:(Pe==null?void 0:Pe.hyperWrapping)??!1,touchMode:xt,enqueue:gn.current,renderStateProvider:Xt,renderStrategy:(Pe==null?void 0:Pe.renderStrategy)??(si.value?"double-buffer":"single-buffer"),getCellRenderer:ut,minimumCellWidth:Rt,resizeIndicator:tt};he.damage===void 0?(kn.current=he,Uf(he,Ce)):Uf(he,void 0),de||he.damage!==void 0&&!he.damage.has((z=Zt==null?void 0:Zt.current)==null?void 0:z[0])||dt(void 0)},[rn,Bt,n,r,bt,a,pt,Ft,Je,g,S,ce,be,s,h,Ue,C,Oe,N,He,U,v,M,c,f,y,O,Sn,b,$e,p,te,Ee,ye,fe,Kt,Ke,un,Pe==null?void 0:Pe.hyperWrapping,Pe==null?void 0:Pe.renderStrategy,xt,Xt,ut,Rt,tt]),Vt=d.useRef(It);d.useLayoutEffect(()=>{It(),Vt.current=It},[It]),d.useLayoutEffect(()=>{(async()=>{var L;((L=document==null?void 0:document.fonts)==null?void 0:L.ready)!==void 0&&(await document.fonts.ready,kn.current=void 0,Vt.current())})()},[]);const Et=d.useCallback(L=>{qt.current=L,Vt.current(),qt.current=void 0},[]),Tt=function(L){const ae=d.useRef([]),de=d.useRef(0),Ce=d.useRef(L);Ce.current=L;const he=d.useCallback(()=>{const z=()=>{const Ie=ae.current.map(ta);ae.current=[],Ce.current(new bo(Ie)),ae.current.length>0?de.current++:de.current=0};window.requestAnimationFrame(de.current>600?()=>window.requestAnimationFrame(z):z)},[]);return d.useCallback(z=>{ae.current.length===0&&he();const Ie=Ln(z[0],z[1]);ae.current.includes(Ie)||ae.current.push(Ie)},[he])}(Et);gn.current=Tt;const Qe=d.useCallback(L=>{Et(new bo(L.map(ae=>ae.cell)))},[Et]);Kt.setCallback(Et);const[Jt,Mn]=d.useState(!1),[mn,wr]=Nt??[],Ro=mn!==void 0&&wr===-1&&i[mn].headerRowMarkerDisabled!==!0,Ca=mn!==void 0&&wr===-2;let Eo=!1,Io=!1,zr=wt;if(zr===void 0&&mn!==void 0&&wr!==void 0&&wr>-1&&wr<y){const L=b([mn,wr],!0);Eo=L.kind===Hn.NewRow||L.kind===Hn.Marker&&L.markerKind!=="number",Io=L.kind===me.Boolean&&Bi(L),zr=L.cursor}const Ot=ue?"grabbing":(_n??!1)||N?"col-resize":Jt||w?"crosshair":zr!==void 0?zr:Ro||Eo||Io||Ca?"pointer":"default",vn=d.useMemo(()=>({contain:"strict",display:"block",cursor:Ot}),[Ot]),gi=d.useRef("default"),To=W==null?void 0:W.current;To!=null&&gi.current!==vn.cursor&&(To.style.cursor=gi.current=vn.cursor);const nr=d.useCallback((L,ae,de,Ce)=>{if($e===void 0)return;const he=$e(L);if(he.actions!==void 0){const z=yd(ae,he.actions);for(const[Ie,Le]of z.entries())if(Dr(Le,de+ae.x,Ce+Le.y))return he.actions[Ie]}},[$e]),rr=d.useCallback((L,ae,de,Ce)=>{const he=Je[ae];if(!ue&&!N&&!_n){const z=rt(L,ae,-1);Rn(z!==void 0);const Ie=bd(void 0,he,z.x,z.y,z.width,z.height,be,Yi(he.title)==="rtl");if(he.hasMenu===!0&&Ie.menuBounds!==void 0&&Dr(Ie.menuBounds,de,Ce))return{area:"menu",bounds:Ie.menuBounds};if(he.indicatorIcon!==void 0&&Ie.indicatorIconBounds!==void 0&&Dr(Ie.indicatorIconBounds,de,Ce))return{area:"indicator",bounds:Ie.indicatorIconBounds}}},[Je,rt,_n,ue,N,be]),qr=d.useRef(0),or=d.useRef(),yr=d.useRef(!1),ir=d.useCallback(L=>{const ae=Ze.current,de=W==null?void 0:W.current;if(ae===null||L.target!==ae&&L.target!==de)return;let Ce,he;if(yr.current=!0,L instanceof MouseEvent?(Ce=L.clientX,he=L.clientY):(Ce=L.touches[0].clientX,he=L.touches[0].clientY),L.target===de&&de!==null){const Ie=de.getBoundingClientRect();if(Ce>Ie.right||he>Ie.bottom)return}const z=De(ae,Ce,he,L);if(or.current=z.location,z.isTouch&&(qr.current=Date.now()),Ve.current!==z.isTouch&&ve(z.isTouch),z.kind!==pr||rr(ae,z.location[0],Ce,he)===void 0){if(z.kind===Pn&&nr(z.group,z.bounds,z.localEventX,z.localEventY)!==void 0)return;T==null||T(z),!z.isTouch&&pe!==!0&&pe!==z.kind&&z.button<3&&z.button!==1&&L.preventDefault()}},[W,pe,De,nr,rr,T]);cn("touchstart",ir,nn,!1),cn("mousedown",ir,nn,!1);const Ar=d.useRef(0),pi=d.useCallback(L=>{var _e,et;const ae=Ar.current;Ar.current=Date.now();const de=Ze.current;if(yr.current=!1,j===void 0||de===null)return;const Ce=W==null?void 0:W.current,he=L.target!==de&&L.target!==Ce;let z,Ie,Le=!0;if(L instanceof MouseEvent){if(z=L.clientX,Ie=L.clientY,Le=L.button<3,L.pointerType==="touch")return}else z=L.changedTouches[0].clientX,Ie=L.changedTouches[0].clientY;let Be=De(de,z,Ie,L);Be.isTouch&&qr.current!==0&&Date.now()-qr.current>500&&(Be={...Be,isLongTouch:!0}),ae!==0&&Date.now()-ae<(Be.isTouch?1e3:500)&&(Be={...Be,isDoubleClick:!0}),Ve.current!==Be.isTouch&&ve(Be.isTouch),!he&&L.cancelable&&Le&&L.preventDefault();const[Mt]=Be.location,Ae=rr(de,Mt,z,Ie);if(Be.kind!==pr||Ae===void 0){if(Be.kind===Pn){const dn=nr(Be.group,Be.bounds,Be.localEventX,Be.localEventY);if(dn!==void 0)return void(Be.button===0&&dn.onClick(Be))}j(Be,he)}else Be.button===0&&((_e=or.current)==null?void 0:_e[0])===Mt&&((et=or.current)==null?void 0:et[1])===-1||j(Be,!0)},[j,W,De,rr,nr]);cn("mouseup",pi,nn,!1),cn("touchend",pi,nn,!1),cn("click",d.useCallback(L=>{var Mt,Ae;const ae=Ze.current;if(ae===null)return;const de=W==null?void 0:W.current,Ce=L.target!==ae&&L.target!==de;let he,z,Ie=!0;L instanceof MouseEvent?(he=L.clientX,z=L.clientY,Ie=L.button<3):(he=L.changedTouches[0].clientX,z=L.changedTouches[0].clientY);const Le=De(ae,he,z,L);Ve.current!==Le.isTouch&&ve(Le.isTouch),!Ce&&L.cancelable&&Ie&&L.preventDefault();const[Be]=Le.location;if(Le.kind===pr){const _e=rr(ae,Be,he,z);_e!==void 0&&Le.button===0&&((Mt=or.current)==null?void 0:Mt[0])===Be&&((Ae=or.current)==null?void 0:Ae[1])===-1&&(_e.area==="menu"?m==null||m(Be,_e.bounds):_e.area==="indicator"&&(E==null||E(Be,_e.bounds)))}else if(Le.kind===Pn){const _e=nr(Le.group,Le.bounds,Le.localEventX,Le.localEventY);_e!==void 0&&Le.button===0&&_e.onClick(Le)}},[W,De,rr,m,E,nr]),nn,!1),cn("contextmenu",d.useCallback(L=>{const ae=Ze.current,de=W==null?void 0:W.current;if(ae===null||L.target!==ae&&L.target!==de||H===void 0)return;const Ce=De(ae,L.clientX,L.clientY,L);H(Ce,()=>{L.cancelable&&L.preventDefault()})},[W,De,H]),(W==null?void 0:W.current)??null,!1);const Ho=d.useCallback(L=>{qt.current=new bo(L.map(ae=>ae.item)),Kn.current=L,Vt.current(),qt.current=void 0},[]),Ge=d.useMemo(()=>new eg(Ho),[Ho]),Oo=d.useRef(Ge);Oo.current=Ge,d.useLayoutEffect(()=>{const L=Oo.current;if(Nt===void 0||Nt[1]<0)return void L.setHovered(Nt);const ae=b(Nt,!0),de=ut(ae),Ce=de===void 0&&ae.kind===me.Custom||(de==null?void 0:de.needsHover)!==void 0&&(typeof de.needsHover=="boolean"?de.needsHover:de.needsHover(ae));L.setHovered(Ce?Nt:void 0)},[b,ut,Nt]);const mi=d.useRef();cn("mousemove",d.useCallback(L=>{var Le;const ae=Ze.current;if(ae===null)return;const de=W==null?void 0:W.current,Ce=L.target!==ae&&L.target!==de,he=De(ae,L.clientX,L.clientY,L);if(he.kind!=="out-of-bounds"&&Ce&&!yr.current&&!he.isTouch)return;const z=(Be,Mt)=>{tr(Ae=>Ae===Be?Ae:(Ae==null?void 0:Ae[0][0])!==(Be==null?void 0:Be[0][0])||(Ae==null?void 0:Ae[0][1])!==(Be==null?void 0:Be[0][1])||((Ae==null?void 0:Ae[1][0])!==(Be==null?void 0:Be[1][0])||(Ae==null?void 0:Ae[1][1])!==(Be==null?void 0:Be[1][1]))&&Mt?Be:Ae)};if(qf(he,mi.current)){if(he.kind==="cell"||he.kind===pr||he.kind===Pn){let Be=!1,Mt=!0;if(he.kind==="cell"){const _e=b(he.location);Mt=((Le=ut(_e))==null?void 0:Le.needsHoverPosition)??_e.kind===me.Custom,Be=Mt}else Be=!0;const Ae=[he.location,[he.localEventX,he.localEventY]];z(Ae,Mt),Zt.current=Ae,Be&&Et(new bo([he.location]))}}else dt(void 0),J==null||J(he),z(he.kind===ui?void 0:[he.location,[he.localEventX,he.localEventY]],!0),mi.current=he;const Ie=he.location[0]>=(le?0:1);ne(he.kind===pr&&he.isEdge&&Ie&&ze===!0),Mn(he.kind==="cell"&&he.isFillHandle),V==null||V(L),Z(he)},[W,De,le,ze,V,Z,J,b,ut,Et]),nn,!0);const jn=d.useCallback(L=>{const ae=Ze.current;if(ae===null)return;let de,Ce;M.current!==void 0&&(de=rt(ae,M.current.cell[0],M.current.cell[1]),Ce=M.current.cell),q==null||q({bounds:de,stopPropagation:()=>L.stopPropagation(),preventDefault:()=>L.preventDefault(),cancel:()=>{},ctrlKey:L.ctrlKey,metaKey:L.metaKey,shiftKey:L.shiftKey,altKey:L.altKey,key:L.key,keyCode:L.keyCode,rawEvent:L,location:Ce})},[q,M,rt]),Sa=d.useCallback(L=>{const ae=Ze.current;if(ae===null)return;let de,Ce;M.current!==void 0&&(de=rt(ae,M.current.cell[0],M.current.cell[1]),Ce=M.current.cell),Q==null||Q({bounds:de,stopPropagation:()=>L.stopPropagation(),preventDefault:()=>L.preventDefault(),cancel:()=>{},ctrlKey:L.ctrlKey,metaKey:L.metaKey,shiftKey:L.shiftKey,altKey:L.altKey,key:L.key,keyCode:L.keyCode,rawEvent:L,location:Ce})},[Q,M,rt]),Vn=d.useCallback(L=>{if(Ze.current=L,ee!==void 0&&(ee.current=L),Pe==null?void 0:Pe.eventTarget)Yt.current=Pe.eventTarget;else if(L===null)Yt.current=window;else{const ae=L.getRootNode();ae===document&&(Yt.current=window),Yt.current=ae}},[ee,Pe==null?void 0:Pe.eventTarget]);cn("dragstart",d.useCallback(L=>{const ae=Ze.current;if(ae===null||pe===!1||N)return void L.preventDefault();let de,Ce;const he=De(ae,L.clientX,L.clientY);if(pe!==!0&&he.kind!==pe)return void L.preventDefault();let z,Ie,Le,Be=!1;if(se==null||se({...he,setData:(Mt,Ae)=>{de=Mt,Ce=Ae},setDragImage:(Mt,Ae,_e)=>{z=Mt,Ie=Ae,Le=_e},preventDefault:()=>Be=!0,defaultPrevented:()=>Be}),Be||de===void 0||Ce===void 0||L.dataTransfer===null)L.preventDefault();else if(L.dataTransfer.setData(de,Ce),L.dataTransfer.effectAllowed="copyLink",z!==void 0&&Ie!==void 0&&Le!==void 0)L.dataTransfer.setDragImage(z,Ie,Le);else{const[Mt,Ae]=he.location;if(Ae!==void 0){const _e=document.createElement("canvas"),et=rt(ae,Mt,Ae);Rn(et!==void 0);const dn=Math.ceil(window.devicePixelRatio??1);_e.width=et.width*dn,_e.height=et.height*dn;const en=_e.getContext("2d");en!==null&&(en.scale(dn,dn),en.textBaseline="middle",Ae===-1?(en.font=be.headerFontFull,en.fillStyle=be.bgHeader,en.fillRect(0,0,_e.width,_e.height),Cd(en,0,0,et.width,et.height,Je[Mt],!1,be,!1,void 0,void 0,!1,0,Ke,Ee,!1)):(en.font=be.baseFontFull,en.fillStyle=be.bgCell,en.fillRect(0,0,_e.width,_e.height),wd(en,b([Mt,Ae]),0,Ae,!1,!1,0,0,et.width,et.height,!1,be,be.bgCell,Kt,Ke,1,void 0,!1,0,void 0,void 0,void 0,Xt,ut,()=>{}))),_e.style.left="-100%",_e.style.position="absolute",_e.style.width=`${et.width}px`,_e.style.height=`${et.height}px`,document.body.append(_e),L.dataTransfer.setDragImage(_e,et.width/2,et.height/2),window.setTimeout(()=>{_e.remove()},0)}}},[pe,N,De,se,rt,be,Je,Ke,Ee,b,Kt,Xt,ut]),(W==null?void 0:W.current)??null,!1,!1);const Fr=d.useRef();cn("dragover",d.useCallback(L=>{const ae=Ze.current;if(Re!==void 0&&L.preventDefault(),ae===null||Xe===void 0)return;const de=De(ae,L.clientX,L.clientY),[Ce,he]=de.location,z=Ce-(le?0:1),[Ie,Le]=Fr.current??[];Ie===z&&Le===he||(Fr.current=[z,he],Xe([z,he],L.dataTransfer))},[le,De,Xe,Re]),(W==null?void 0:W.current)??null,!1,!1),cn("dragend",d.useCallback(()=>{Fr.current=void 0,ie==null||ie()},[ie]),(W==null?void 0:W.current)??null,!1,!1),cn("drop",d.useCallback(L=>{const ae=Ze.current;if(ae===null||Re===void 0)return;L.preventDefault();const de=De(ae,L.clientX,L.clientY),[Ce,he]=de.location;Re([Ce-(le?0:1),he],L.dataTransfer)},[le,De,Re]),(W==null?void 0:W.current)??null,!1,!1),cn("dragleave",d.useCallback(()=>{qe==null||qe()},[qe]),(W==null?void 0:W.current)??null,!1,!1);const Po=d.useRef(M);Po.current=M;const Lr=d.useRef(null),Do=d.useCallback(L=>{var ae;Ze.current!==null&&Ze.current.contains(document.activeElement)&&(L===null&&Po.current.current!==void 0?(ae=ee==null?void 0:ee.current)==null||ae.focus({preventScroll:!0}):L!==null&&L.focus({preventScroll:!0}),Lr.current=L)},[ee]);d.useImperativeHandle(t,()=>({focus:()=>{var ae;const L=Lr.current;L!==null&&document.contains(L)?L.focus({preventScroll:!0}):(ae=ee==null?void 0:ee.current)==null||ae.focus({preventScroll:!0})},getBounds:(L,ae)=>{if(ee!==void 0&&ee.current!==null)return rt(ee.current,L??0,ae??-1)},damage:Qe,getMouseArgsForPosition:(L,ae,de)=>{if(ee!==void 0&&ee.current!==null)return De(ee.current,L,ae,de)}}),[ee,Qe,rt]);const zo=d.useRef(),Un=function(L,ae,de){const[Ce,he]=d.useState(L),z=d.useRef(!0);d.useEffect(()=>()=>{z.current=!1},[]);const Ie=d.useRef(Fc(Le=>{z.current&&he(Le)},de));return d.useLayoutEffect(()=>{z.current&&Ie.current(()=>L())},ae),Ce}(()=>{var Le,Be,Mt;if(n<50||(Pe==null?void 0:Pe.disableAccessibilityTree)===!0)return null;let L=Ji(Je,bt,n,ce,pt);const ae=le?0:-1;le||((Le=L[0])==null?void 0:Le.sourceIndex)!==0||(L=L.slice(1));const[de,Ce]=((Be=M.current)==null?void 0:Be.cell)??[],he=(Mt=M.current)==null?void 0:Mt.range,z=L.map(Ae=>Ae.sourceIndex),Ie=Pr(a,Math.min(y,a+o));return de===void 0||Ce===void 0||z.includes(de)&&Ie.includes(Ce)||Do(null),d.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":y+1,"aria-multiselectable":"true","aria-colcount":Je.length+ae},d.createElement("thead",{role:"rowgroup"},d.createElement("tr",{role:"row","aria-rowindex":1},L.map(Ae=>d.createElement("th",{role:"columnheader","aria-selected":M.columns.hasIndex(Ae.sourceIndex),"aria-colindex":Ae.sourceIndex+1+ae,tabIndex:-1,onFocus:_e=>{if(_e.target!==Lr.current)return ke==null?void 0:ke([Ae.sourceIndex,-1])},key:Ae.sourceIndex},Ae.title)))),d.createElement("tbody",{role:"rowgroup"},Ie.map(Ae=>d.createElement("tr",{role:"row","aria-selected":M.rows.hasIndex(Ae),key:Ae,"aria-rowindex":Ae+2},L.map(_e=>{const et=_e.sourceIndex,dn=Ln(et,Ae),en=de===et&&Ce===Ae,br=he!==void 0&&et>=he.x&&et<he.x+he.width&&Ae>=he.y&&Ae<he.y+he.height,ar=`glide-cell-${et}-${Ae}`,on=[et,Ae],Lt=b(on,!0);return d.createElement("td",{key:dn,role:"gridcell","aria-colindex":et+1+ae,"aria-selected":br,"aria-readonly":kr(Lt)||!so(Lt),id:ar,"data-testid":ar,onClick:()=>{const Ne=ee==null?void 0:ee.current;if(Ne!=null)return q==null?void 0:q({bounds:rt(Ne,et,Ae),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:on})},onFocusCapture:Ne=>{var ht,gt;if(Ne.target!==Lr.current&&(((ht=zo.current)==null?void 0:ht[0])!==et||((gt=zo.current)==null?void 0:gt[1])!==Ae))return zo.current=on,ke==null?void 0:ke(on)},ref:en?Do:void 0,tabIndex:-1},((Ne,ht)=>{if(Ne.kind===me.Custom)return Ne.copyData;const gt=ht==null?void 0:ht(Ne);return(gt==null?void 0:gt.getAccessibilityString(Ne))??""})(Lt,ut))})))))},[n,Je,bt,ce,pt,y,a,o,M,Do,b,ee,q,rt,ke],200),Nn=S!==0&&B?bt>S?1:On(-pt/100,0,1):0,wn=D?On(-(32*-a+Ft)/100,0,1):0,K=d.useMemo(()=>{if(!Nn&&!wn)return null;const L={position:"absolute",top:0,left:lt,width:n-lt,height:r,opacity:Nn,pointerEvents:"none",transition:ot?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},ae={position:"absolute",top:mt,left:0,width:n,height:r,opacity:wn,pointerEvents:"none",transition:Me?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return d.createElement(d.Fragment,null,Nn>0&&d.createElement("div",{id:"shadow-x",style:L}),wn>0&&d.createElement("div",{id:"shadow-y",style:ae}))},[Nn,wn,lt,n,ot,mt,r,Me]),Wt=d.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return d.createElement(d.Fragment,null,d.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:jn,onKeyUp:Sa,onFocus:x,onBlur:I,ref:Vn,style:vn},Un),d.createElement("canvas",{ref:xe,style:Wt}),K)}));function Mo(e,t,n,r){return On(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(r))}const og=e=>{const[t,n]=d.useState(),[r,o]=d.useState(),[i,l]=d.useState(),[a,s]=d.useState(),[c,h]=d.useState(!1),[C,y]=d.useState(),[b,p]=d.useState(),[m,E]=d.useState(),[g,w]=d.useState(!1),[x,I]=d.useState(),{onHeaderMenuClick:v,onHeaderIndicatorClick:M,getCellContent:S,onColumnMoved:H,onColumnResize:f,onColumnResizeStart:B,onColumnResizeEnd:D,gridRef:O,maxColumnWidth:T,minColumnWidth:j,onRowMoved:V,lockColumns:Z,onColumnProposeMove:J,onMouseDown:ce,onMouseUp:le,onItemHovered:q,onDragStart:Q,canvasRef:fe}=e,ee=(f??D??B)!==void 0,{columns:se,selection:ie}=e,W=ie.columns,N=d.useCallback(te=>{const[Ee,ke]=te.location;i!==void 0&&a!==Ee&&Ee>=Z?(h(!0),s(Ee)):b!==void 0&&ke!==void 0?(w(!0),E(Math.max(0,ke))):r!==void 0||c||g||(q==null||q(te))},[i,b,a,q,Z,r,c,g]),U=H!==void 0,ue=d.useCallback(te=>{var Ee;if(te.button===0){const[ke,Xe]=te.location;if(te.kind==="out-of-bounds"&&te.isEdge&&ee){const Re=(Ee=O==null?void 0:O.current)==null?void 0:Ee.getBounds(se.length-1,-1);Re!==void 0&&(n(Re.x),o(se.length-1))}else if(te.kind==="header"&&ke>=Z){const Re=fe==null?void 0:fe.current;if(te.isEdge&&ee&&Re){n(te.bounds.x),o(ke);const qe=Re.getBoundingClientRect().width/Re.offsetWidth,Ye=te.bounds.width/qe;B==null||B(se[ke],Ye,ke,Ye+(se[ke].growOffset??0))}else te.kind==="header"&&U&&(y(te.bounds.x),l(ke))}else te.kind==="cell"&&Z>0&&ke===0&&Xe!==void 0&&V!==void 0&&(I(te.bounds.y),p(Xe))}ce==null||ce(te)},[ce,ee,Z,V,O,se,U,B,fe]),pe=d.useCallback((te,Ee)=>{c||g||(v==null||v(te,Ee))},[c,g,v]),ze=d.useCallback((te,Ee)=>{c||g||(M==null||M(te,Ee))},[c,g,M]),Ue=d.useRef(-1),He=d.useCallback(()=>{Ue.current=-1,p(void 0),E(void 0),I(void 0),w(!1),l(void 0),s(void 0),y(void 0),h(!1),o(void 0),n(void 0)},[]),$e=d.useCallback((te,Ee)=>{if(te.button===0){if(r!==void 0){if((W==null?void 0:W.hasIndex(r))===!0)for(const Xe of W){if(Xe===r)continue;const Re=se[Xe],qe=Mo(Re,Ue.current,j,T);f==null||f(Re,qe,Xe,qe+(Re.growOffset??0))}const ke=Mo(se[r],Ue.current,j,T);if(D==null||D(se[r],ke,r,ke+(se[r].growOffset??0)),W.hasIndex(r))for(const Xe of W){if(Xe===r)continue;const Re=se[Xe],qe=Mo(Re,Ue.current,j,T);D==null||D(Re,qe,Xe,qe+(Re.growOffset??0))}}He(),i!==void 0&&a!==void 0&&(J==null?void 0:J(i,a))!==!1&&(H==null||H(i,a)),b!==void 0&&m!==void 0&&(V==null||V(b,m))}le==null||le(te,Ee)},[le,r,i,a,b,m,W,D,se,j,T,f,H,V,He,J]),be=d.useMemo(()=>{if(i!==void 0&&a!==void 0&&i!==a&&(J==null?void 0:J(i,a))!==!1)return{src:i,dest:a}},[i,a,J]),ye=d.useCallback(te=>{const Ee=fe==null?void 0:fe.current;if(i!==void 0&&C!==void 0)Math.abs(te.clientX-C)>20&&h(!0);else if(b!==void 0&&x!==void 0)Math.abs(te.clientY-x)>20&&w(!0);else if(r!==void 0&&t!==void 0&&Ee){const ke=Ee.getBoundingClientRect().width/Ee.offsetWidth,Xe=(te.clientX-t)/ke,Re=se[r],qe=Mo(Re,Xe,j,T);if(f==null||f(Re,qe,r,qe+(Re.growOffset??0)),Ue.current=Xe,(W==null?void 0:W.first())===r)for(const Ye of W){if(Ye===r)continue;const ot=se[Ye],Me=Mo(ot,Ue.current,j,T);f==null||f(ot,Me,Ye,Me+(ot.growOffset??0))}}},[i,C,b,x,r,t,se,j,T,f,W,fe]),Fe=d.useCallback((te,Ee)=>{if(b===void 0||m===void 0)return S(te,Ee);let[ke,Xe]=te;return Xe===m?Xe=b:(Xe>m&&(Xe-=1),Xe>=b&&(Xe+=1)),S([ke,Xe],Ee)},[b,m,S]),Oe=d.useCallback(te=>{Q==null||Q(te),te.defaultPrevented()||He()},[He,Q]);return d.createElement(rg,{accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,enableGroups:e.enableGroups,eventTargetRef:e.eventTargetRef,experimental:e.experimental,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,headerIcons:e.headerIcons,height:e.height,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,resizeColumn:r,isDraggable:e.isDraggable,isFilling:e.isFilling,isFocused:e.isFocused,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDrop:e.onDrop,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,resizeIndicator:e.resizeIndicator,verticalBorder:e.verticalBorder,width:e.width,getCellContent:Fe,isResizing:r!==void 0,onHeaderMenuClick:pe,onHeaderIndicatorClick:ze,isDragging:c,onItemHovered:N,onDragStart:Oe,onMouseDown:ue,allowResize:ee,onMouseUp:$e,dragAndDropState:be,onMouseMoveRaw:ye,ref:O})},ig=Cn("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[e=>e.isSafari?"scroll":"auto"]}}),ag=e=>{var ie,W;const{children:t,clientHeight:n,scrollHeight:r,scrollWidth:o,update:i,draggable:l,className:a,preventDiagonalScrolling:s=!1,paddingBottom:c=0,paddingRight:h=0,rightElement:C,rightElementProps:y,kineticScrollPerfHack:b=!1,scrollRef:p,initialSize:m}=e,E=[],g=(y==null?void 0:y.sticky)??!1,w=(y==null?void 0:y.fill)??!1,x=d.useRef(0),I=d.useRef(0),v=d.useRef(null),M=typeof window>"u"?1:window.devicePixelRatio,S=d.useRef(M);d.useEffect(()=>{if(S.current!==M){x.current=0,I.current=0,S.current=M;const N=v.current;N!==null&&V.current(N.scrollLeft,N.scrollTop)}},[M]);const H=d.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),f=d.useRef(null),B=function(N){const[U,ue]=d.useState(!1),pe=typeof window>"u"?null:window,ze=d.useRef(0);return cn("touchstart",d.useCallback(()=>{window.clearTimeout(ze.current),ue(!0)},[]),pe,!0,!1),cn("touchend",d.useCallback(Ue=>{Ue.touches.length===0&&(ze.current=window.setTimeout(()=>ue(!1),N))},[N]),pe,!0,!1),U}(200),[D,O]=d.useState(!0),T=d.useRef(0);d.useLayoutEffect(()=>{if(!D||B||H.current.lockDirection===void 0)return;const N=v.current;if(N===null)return;const[U,ue]=H.current.lockDirection;U!==void 0?N.scrollLeft=U:ue!==void 0&&(N.scrollTop=ue),H.current.lockDirection=void 0},[B,D]);const j=d.useCallback((N,U)=>{var ke;const ue=v.current;if(ue===null)return;U=U??ue.scrollTop,N=N??ue.scrollLeft;const pe=H.current.scrollTop,ze=H.current.scrollLeft,Ue=N-ze,He=U-pe;B&&Ue!==0&&He!==0&&(Math.abs(Ue)>3||Math.abs(He)>3)&&s&&H.current.lockDirection===void 0&&(H.current.lockDirection=Math.abs(Ue)<Math.abs(He)?[ze,void 0]:[void 0,pe]);const $e=H.current.lockDirection;N=($e==null?void 0:$e[0])??N,U=($e==null?void 0:$e[1])??U,H.current.scrollLeft=N,H.current.scrollTop=U;const be=ue.clientWidth,ye=ue.clientHeight,Fe=U,Oe=I.current-Fe,te=ue.scrollHeight-ye;let Ee;I.current=Fe,te>0&&r>ue.scrollHeight+5?Math.abs(Oe)>2e3||Fe===0||Fe===te?(Ee=Math.max(0,Math.min(1,Fe/te))*(r-ye),x.current=Ee):(x.current-=Oe,Ee=x.current):(Ee=Fe,x.current=Ee),Ee=Math.max(0,Math.min(Ee,r-ye)),x.current=Ee,$e!==void 0&&(window.clearTimeout(T.current),O(!1),T.current=window.setTimeout(()=>O(!0),200)),i({x:N,y:Ee,width:be-h,height:ye-c,paddingRight:((ke=f.current)==null?void 0:ke.clientWidth)??0})},[c,h,r,i,s,B]);((N,U,ue)=>{const pe=d.useRef(null),ze=d.useRef(null),Ue=d.useRef(null),He=d.useRef(0),$e=d.useRef(U);$e.current=U;const be=ue.current;d.useEffect(()=>{const ye=()=>{var te,Ee;if(ze.current===!1&&be!==null){const ke=[be.scrollLeft,be.scrollTop];if(((te=Ue.current)==null?void 0:te[0])===ke[0]&&((Ee=Ue.current)==null?void 0:Ee[1])===ke[1]){if(He.current>10)return Ue.current=null,void(ze.current=null);He.current++}else He.current=0,$e.current(ke[0],ke[1]),Ue.current=ke;pe.current=window.setTimeout(ye,8.333333333333334)}},Fe=()=>{ze.current=!0,Ue.current=null,pe.current!==null&&(window.clearTimeout(pe.current),pe.current=null)},Oe=te=>{te.touches.length===0&&(ze.current=!1,He.current=0,pe.current=window.setTimeout(ye,8.333333333333334))};if(N&&be!==null){const te=be;return te.addEventListener("touchstart",Fe),te.addEventListener("touchend",Oe),()=>{te.removeEventListener("touchstart",Fe),te.removeEventListener("touchend",Oe),pe.current!==null&&window.clearTimeout(pe.current)}}},[N,be])})(b&&si.value,j,v);const V=d.useRef(j);V.current=j;const Z=d.useRef(),J=d.useRef(!1);d.useLayoutEffect(()=>{J.current?j():J.current=!0},[j,c,h]);const ce=d.useCallback(N=>{v.current=N,p!==void 0&&(p.current=N)},[p]);let le=0,q=0;const Q=Math.min(r,33554400);for(E.push(d.createElement("div",{key:le++,style:{width:o,height:0}}));q<Q;){const N=Math.min(5e6,Q-q);E.push(d.createElement("div",{key:le++,style:{width:0,height:N}})),q+=N}const{ref:fe,width:ee,height:se}=function(N){const U=d.useRef(null),[ue,pe]=d.useState({width:N==null?void 0:N[0],height:N==null?void 0:N[1]});return d.useLayoutEffect(()=>{const ze=new window.ResizeObserver(Ue=>{for(const He of Ue){const{width:$e,height:be}=He&&He.contentRect||{};pe(ye=>ye.width===$e&&ye.height===be?ye:{width:$e,height:be})}});return U.current&&ze.observe(U.current,void 0),()=>{ze.disconnect()}},[U.current]),{ref:U,...ue}}(m);return typeof window>"u"||((ie=Z.current)==null?void 0:ie.height)===se&&((W=Z.current)==null?void 0:W.width)===ee||(window.setTimeout(()=>V.current(),0),Z.current={width:ee,height:se}),(ee??0)===0||(se??0)===0?d.createElement("div",{ref:fe}):d.createElement("div",{ref:fe},d.createElement(ig,{isSafari:si.value},d.createElement("div",{className:"dvn-underlay"},t),d.createElement("div",{ref:ce,style:Z.current,draggable:l,onDragStart:N=>{l||(N.stopPropagation(),N.preventDefault())},className:"dvn-scroller "+(a??""),onScroll:()=>j()},d.createElement("div",{className:"dvn-scroll-inner"+(C===void 0?" dvn-hidden":"")},d.createElement("div",{className:"dvn-stack"},E),C!==void 0&&d.createElement(d.Fragment,null,!w&&d.createElement("div",{className:"dvn-spacer"}),d.createElement("div",{ref:f,style:{height:se,maxHeight:n-Math.ceil(M%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:h,flexGrow:w?1:void 0,right:g?h??0:void 0,pointerEvents:"auto"}},C))))))},lg=e=>{const{columns:t,rows:n,rowHeight:r,headerHeight:o,groupHeaderHeight:i,enableGroups:l,freezeColumns:a,experimental:s,nonGrowWidth:c,clientSize:h,className:C,onVisibleRegionChanged:y,scrollRef:b,preventDiagonalScrolling:p,rightElement:m,rightElementProps:E,overscrollX:g,overscrollY:w,initialSize:x,smoothScrollX:I=!1,smoothScrollY:v=!1,isDraggable:M}=e,{paddingRight:S,paddingBottom:H}=s??{},[f,B]=h,D=d.useRef(),O=d.useRef(),T=d.useRef(),j=d.useRef(),V=c+Math.max(0,g??0);let Z=l?o+i:o;if(typeof r=="number")Z+=n*r;else for(let q=0;q<n;q++)Z+=r(q);w!==void 0&&(Z+=w);const J=d.useRef(),ce=d.useCallback(()=>{var ze,Ue;if(J.current===void 0)return;const q={...J.current};let Q=0,fe=q.x<0?-q.x:0,ee=0,se=0;q.x=q.x<0?0:q.x;let ie=0;for(let He=0;He<a;He++)ie+=t[He].width;for(const He of t){const $e=Q-ie;if(q.x>=$e+He.width)Q+=He.width,se++,ee++;else if(q.x>$e)Q+=He.width,I?fe+=$e-q.x:se++,ee++;else{if(!(q.x+q.width>$e))break;Q+=He.width,ee++}}let W=0,N=0,U=0;if(typeof r=="number")v?(N=Math.floor(q.y/r),W=N*r-q.y):N=Math.ceil(q.y/r),U=Math.ceil(q.height/r)+N,W<0&&U++;else{let He=0;for(let $e=0;$e<n;$e++){const be=r($e),ye=He+(v?0:be/2);if(q.y>=He+be)He+=be,N++,U++;else if(q.y>ye)He+=be,v?W+=ye-q.y:N++,U++;else{if(!(q.y+q.height>be/2+He))break;He+=be,U++}}}N=Math.max(0,Math.min(N,n-1)),U=Math.max(N,Math.min(U,n));const ue={x:se,y:N,width:ee-se,height:U-N},pe=D.current;pe!==void 0&&pe.y===ue.y&&pe.x===ue.x&&pe.height===ue.height&&pe.width===ue.width&&O.current===fe&&T.current===W&&q.width===((ze=j.current)==null?void 0:ze[0])&&q.height===((Ue=j.current)==null?void 0:Ue[1])||(y==null||y({x:se,y:N,width:ee-se,height:U-N},q.width,q.height,q.paddingRight??0,fe,W),D.current=ue,O.current=fe,T.current=W,j.current=[q.width,q.height])},[t,r,n,y,a,I,v]),le=d.useCallback(q=>{J.current=q,ce()},[ce]);return d.useEffect(()=>{ce()},[ce]),d.createElement(ag,{scrollRef:b,className:C,kineticScrollPerfHack:s==null?void 0:s.kineticScrollPerfHack,preventDiagonalScrolling:p,draggable:M===!0||typeof M=="string",scrollWidth:V+(S??0),scrollHeight:Z+(H??0),clientHeight:B,rightElement:m,paddingBottom:H,paddingRight:S,rightElementProps:E,update:le,initialSize:x},d.createElement(og,{eventTargetRef:b,width:f,height:B,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}))},sg=Cn("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),cg=d.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},d.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),ug=d.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},d.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),dg=d.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},d.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),hg=e=>{const{canvasRef:t,cellYOffset:n,rows:r,columns:o,searchInputRef:i,searchValue:l,searchResults:a,onSearchValueChange:s,getCellsForSelection:c,onSearchResultsChanged:h,showSearch:C=!1,onSearchClose:y}=e,[b]=d.useState(()=>"search-box-"+Math.round(1e3*Math.random())),[p,m]=d.useState(""),E=l??p,g=d.useCallback(Q=>{m(Q),s==null||s(Q)},[s]),[w,x]=d.useState(),I=d.useRef(w);I.current=w,d.useEffect(()=>{a!==void 0&&(a.length>0?x(Q=>({rowsSearched:r,results:a.length,selectedIndex:(Q==null?void 0:Q.selectedIndex)??-1})):x(void 0))},[r,a]);const v=d.useRef();v.current===void 0&&(v.current=new AbortController);const M=d.useRef(),[S,H]=d.useState([]),f=a??S,B=d.useCallback(()=>{M.current!==void 0&&(window.cancelAnimationFrame(M.current),M.current=void 0,v.current.abort())},[]),D=d.useRef(n);D.current=n;const O=d.useCallback(Q=>{const fe=new RegExp(Q.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let ee=D.current,se=Math.min(10,r),ie=0;x(void 0),H([]);const W=[],N=async()=>{var ye;if(c===void 0)return;const U=performance.now(),ue=r-ie;let pe=c({x:0,y:ee,width:o.length,height:Math.min(se,ue,r-ee)},v.current.signal);typeof pe=="function"&&(pe=await pe());let ze=!1;for(const[Fe,Oe]of pe.entries())for(const[te,Ee]of Oe.entries()){let ke;switch(Ee.kind){case me.Text:case me.Number:ke=Ee.displayData;break;case me.Uri:case me.Markdown:ke=Ee.data;break;case me.Boolean:ke=typeof Ee.data=="boolean"?Ee.data.toString():void 0;break;case me.Image:case me.Bubble:ke=Ee.data.join("\u{1F433}");break;case me.Custom:ke=Ee.copyData}ke!==void 0&&fe.test(ke)&&(W.push([te,Fe+ee]),ze=!0)}const Ue=performance.now();ze&&H([...W]),ie+=pe.length,Rn(ie<=r);const He=((ye=I.current)==null?void 0:ye.selectedIndex)??-1;x({results:W.length,rowsSearched:ie,selectedIndex:He}),h==null||h(W,He),ee+se>=r?ee=0:ee+=se;const $e=Ue-U,be=10/Math.max($e,1);se=Math.ceil(se*be),ie<r&&W.length<1e3&&(M.current=window.requestAnimationFrame(N))};B(),M.current=window.requestAnimationFrame(N)},[B,o.length,c,h,r]),T=d.useCallback(()=>{var Q;y==null||y(),x(void 0),H([]),h==null||h([],-1),B(),(Q=t==null?void 0:t.current)==null||Q.focus()},[B,t,y,h]),j=d.useCallback(Q=>{g(Q.target.value),a===void 0&&(Q.target.value===""?(x(void 0),H([]),B()):O(Q.target.value))},[O,B,g,a]);d.useEffect(()=>{C&&i.current!==null&&(g(""),i.current.focus({preventScroll:!0}))},[C,i,g]);const V=d.useCallback(Q=>{var ee;if((ee=Q==null?void 0:Q.stopPropagation)==null||ee.call(Q),w===void 0)return;const fe=(w.selectedIndex+1)%w.results;x({...w,selectedIndex:fe}),h==null||h(f,fe)},[w,h,f]),Z=d.useCallback(Q=>{var ee;if((ee=Q==null?void 0:Q.stopPropagation)==null||ee.call(Q),w===void 0)return;let fe=(w.selectedIndex-1)%w.results;fe<0&&(fe+=w.results),x({...w,selectedIndex:fe}),h==null||h(f,fe)},[h,f,w]),J=d.useCallback(Q=>{(Q.ctrlKey||Q.metaKey)&&Q.nativeEvent.code==="KeyF"||Q.key==="Escape"?(T(),Q.stopPropagation(),Q.preventDefault()):Q.key==="Enter"&&(Q.shiftKey?Z():V())},[T,V,Z]);d.useEffect(()=>()=>{B()},[B]);const[ce,le]=d.useState(!1);d.useEffect(()=>{if(!C){const Q=setTimeout(()=>le(!1),150);return()=>clearTimeout(Q)}le(!0)},[C]);const q=d.useMemo(()=>{if(!C&&!ce)return null;let Q;w!==void 0&&(Q=w.results>=1e3?"over 1000":`${w.results} result${w.results!==1?"s":""}`,w.selectedIndex>=0&&(Q=`${w.selectedIndex+1} of ${Q}`));const fe=se=>{se.stopPropagation()},ee={width:`${Math.floor(((w==null?void 0:w.rowsSearched)??0)/r*100)}%`};return d.createElement(sg,{className:"gdg-search-bar"+(C?"":" out"),onMouseDown:fe,onMouseMove:fe,onMouseUp:fe,onClick:fe},d.createElement("div",{className:"gdg-search-bar-inner"},d.createElement("input",{id:b,"aria-hidden":!C,"data-testid":"search-input",ref:i,onChange:j,value:E,tabIndex:C?void 0:-1,onKeyDownCapture:J}),d.createElement("button",{type:"button","aria-label":"Previous Result","aria-hidden":!C,tabIndex:C?void 0:-1,onClick:Z,disabled:((w==null?void 0:w.results)??0)===0},cg),d.createElement("button",{type:"button","aria-label":"Next Result","aria-hidden":!C,tabIndex:C?void 0:-1,onClick:V,disabled:((w==null?void 0:w.results)??0)===0},ug),y!==void 0&&d.createElement("button",{type:"button","aria-label":"Close Search","aria-hidden":!C,"data-testid":"search-close-button",tabIndex:C?void 0:-1,onClick:T},dg)),w!==void 0?d.createElement(d.Fragment,null,d.createElement("div",{className:"gdg-search-status"},d.createElement("div",{"data-testid":"search-result-area"},Q)),d.createElement("div",{className:"gdg-search-progress",style:ee})):d.createElement("div",{className:"gdg-search-status"},d.createElement("label",{htmlFor:b},"Type to search")))},[C,ce,w,r,b,i,j,E,J,Z,V,y,T]);return d.createElement(d.Fragment,null,d.createElement(lg,{prelightCells:f,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}),q)};Ba=class extends d.PureComponent{constructor(){super(...arguments);ft(this,"wrapperRef",d.createRef());ft(this,"clickOutside",t=>{if((!this.props.isOutsideClick||this.props.isOutsideClick(t))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(t.target)){let n=t.target;for(;n!==null;){if(n.classList.contains("click-outside-ignore"))return;n=n.parentElement}this.props.onClickOutside()}})}componentDidMount(){const t=this.props.customEventTarget??document;t.addEventListener("touchend",this.clickOutside,!0),t.addEventListener("mousedown",this.clickOutside,!0),t.addEventListener("contextmenu",this.clickOutside,!0)}componentWillUnmount(){const t=this.props.customEventTarget??document;t.removeEventListener("touchend",this.clickOutside,!0),t.removeEventListener("mousedown",this.clickOutside,!0),t.removeEventListener("contextmenu",this.clickOutside,!0)}render(){const{onClickOutside:t,isOutsideClick:n,customEventTarget:r,...o}=this.props;return d.createElement("div",{...o,ref:this.wrapperRef},this.props.children)}};const fg=Cn("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[e=>Math.max(16,e.targetHeight-10),"px"]}}),gg=e=>{const{bounds:t,group:n,onClose:r,canvasBounds:o,onFinish:i}=e,[l,a]=$t.useState(n);return $t.createElement(Ba,{style:{position:"absolute",left:t.x-o.left+1,top:t.y-o.top,width:t.width-2,height:t.height},className:"gdg-c1tqibwd",onClickOutside:r},$t.createElement(fg,{targetHeight:t.height,"data-testid":"group-rename-input",value:l,onBlur:r,onFocus:s=>s.target.setSelectionRange(0,l.length),onChange:s=>a(s.target.value),onKeyDown:s=>{s.key==="Enter"?i(l):s.key==="Escape"&&r()},autoFocus:!0}))};function st(e,t,n){const r=Jf(e,t);return r&&(n.didMatch=!0),r}function Jf(e,t){if(e.length===0)return!1;if(e.includes("|")){const a=e.split("|");for(const s of a)if(Jf(s,t))return!0;return!1}let n=!1,r=!1,o=!1,i=!1;const l=e.split("+");if(!function(a,s){return a===void 0?!1:a.length>1&&a.startsWith("_")?Number.parseInt(a.slice(1))===s.keyCode:a.length===1&&a>="a"&&a<="z"?a.toUpperCase().codePointAt(0)===s.keyCode:a===s.key}(l.pop(),t))return!1;if(l[0]==="any")return!0;for(const a of l)switch(a){case"ctrl":n=!0;break;case"shift":r=!0;break;case"alt":o=!0;break;case"meta":i=!0;break;case"primary":ci.value?i=!0:n=!0}return t.altKey===o&&t.ctrlKey===n&&t.shiftKey===r&&t.metaKey===i}function pg(e,t){return e.map((n,r)=>{const o=t[r];return n.map(i=>i.span!==void 0&&i.span[0]!==o?{formatted:"",rawValue:"",format:"string"}:function(l){if(l.copyData!==void 0)return{formatted:l.copyData,rawValue:l.copyData,format:"string",doNotEscape:!0};switch(l.kind){case me.Boolean:return{formatted:l.data===!0?"TRUE":l.data===!1?"FALSE":l.data===Ni?"INDETERMINATE":"",rawValue:l.data,format:"boolean"};case me.Custom:return{formatted:l.copyData,rawValue:l.copyData,format:"string"};case me.Image:case me.Bubble:return{formatted:l.data,rawValue:l.data,format:"string-array"};case me.Drilldown:return{formatted:l.data.map(a=>a.text),rawValue:l.data.map(a=>a.text),format:"string-array"};case me.Text:return{formatted:l.displayData??l.data,rawValue:l.data,format:"string"};case me.Uri:return{formatted:l.displayData??l.data,rawValue:l.data,format:"url"};case me.Markdown:case me.RowID:return{formatted:l.data,rawValue:l.data,format:"string"};case me.Number:return{formatted:l.displayData,rawValue:l.data,format:"number"};case me.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case me.Protected:return{formatted:"************",rawValue:"",format:"string"};default:lo()}}(i))})}function Qf(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function pa(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>"<span> </span>".repeat(t.length))}function Zf(e){return'"'+e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")+'"'}function mg(e){return e.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function vg(e,t){const n=pg(e,t),r=function(i){var a;const l=[];for(const s of i){const c=[];for(const h of s)h.format==="url"?c.push(((a=h.rawValue)==null?void 0:a.toString())??""):h.format==="string-array"?c.push(h.formatted.map(C=>Qf(C,!0)).join(",")):c.push(h.doNotEscape===!0?h.formatted:Qf(h.formatted,!1));l.push(c.join(" "))}return l.join(`
121
121
  `)}(n),o=function(i){var a;const l=[];l.push('<style type="text/css"><!--br {mso-data-placement:same-cell;}--></style>',"<table><tbody>");for(const s of i){l.push("<tr>");for(const c of s){const h=`gdg-format="${c.format}"`;c.format==="url"?l.push(`<td ${h}><a href="${c.rawValue}">${pa(c.formatted)}</a></td>`):c.format==="string-array"?l.push(`<td ${h}><ol>${c.formatted.map((C,y)=>`<li gdg-raw-value=${Zf(c.rawValue[y])}>`+pa(C)+"</li>").join("")}</ol></td>`):l.push(`<td gdg-raw-value=${Zf(((a=c.rawValue)==null?void 0:a.toString())??"")} ${h}>${pa(c.formatted)}</td>`)}l.push("</tr>")}return l.push("</tbody></table>"),l.join("")}(n);return{textPlain:r,textHtml:o}}function e0(e){var l;const t=document.createElement("html");t.innerHTML=e.replace(/&nbsp;/g," ");const n=t.querySelector("table");if(n===null)return;const r=[n],o=[];let i;for(;r.length>0;){const a=r.pop();if(a===void 0)break;if(a instanceof HTMLTableElement||a.nodeName==="TBODY")r.push(...[...a.children].reverse());else if(a instanceof HTMLTableRowElement)i!==void 0&&o.push(i),i=[],r.push(...[...a.children].reverse());else if(a instanceof HTMLTableCellElement){const s=a.cloneNode(!0),c=s.children.length===1&&s.children[0].nodeName==="P"?s.children[0]:null,h=(c==null?void 0:c.children.length)===1&&c.children[0].nodeName==="FONT",C=s.querySelectorAll("br");for(const p of C)p.replaceWith(`
122
122
  `);const y=s.getAttribute("gdg-raw-value"),b=s.getAttribute("gdg-format")??"string";if(s.querySelector("a")!==null)i==null||i.push({rawValue:((l=s.querySelector("a"))==null?void 0:l.getAttribute("href"))??"",formatted:s.textContent??"",format:b});else if(s.querySelector("ol")!==null){const p=s.querySelectorAll("li");i==null||i.push({rawValue:[...p].map(m=>m.getAttribute("gdg-raw-value")??""),formatted:[...p].map(m=>m.textContent??""),format:"string-array"})}else if(y!==null)i==null||i.push({rawValue:mg(y),formatted:s.textContent??"",format:b});else{let p=s.textContent??"";h&&(p=p.replace(/\n(?!\n)/g,"")),i==null||i.push({rawValue:p??"",formatted:p??"",format:b})}}}return i!==void 0&&o.push(i),o}function t0(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function wg(e){let t;(function(a){a[a.None=0]="None",a[a.inString=1]="inString",a[a.inStringPostQuote=2]="inStringPostQuote"})(t||(t={}));const n=[];let r=[],o=0,i=t.None;e=e.replace(/\r\n/g,`
123
123
  `);let l=0;for(const a of e){switch(i){case t.None:a===" "||a===`
124
124
  `?(r.push(e.slice(o,l)),o=l+1,a===`
125
125
  `&&(n.push(r),r=[])):a==='"'&&(i=t.inString);break;case t.inString:a==='"'&&(i=t.inStringPostQuote);break;case t.inStringPostQuote:a==='"'?i=t.inString:((a===" "||a===`
126
126
  `)&&(r.push(t0(e.slice(o,l))),o=l+1,a===`
127
- `&&(n.push(r),r=[])),i=t.None)}l++}return o<e.length&&r.push(t0(e.slice(o,e.length))),n.push(r),n.map(a=>a.map(s=>({rawValue:s,formatted:s,format:"string"})))}function n0(e,t,n){var l;const r=vg(e,t),o=a=>{var s;(s=window.navigator.clipboard)==null||s.writeText(a)},i=(a,s)=>{var c,h;try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");(c=n==null?void 0:n.clipboardData)==null||c.setData("text/plain",a),(h=n==null?void 0:n.clipboardData)==null||h.setData("text/html",s)}catch{((C,y)=>{var b;return((b=window.navigator.clipboard)==null?void 0:b.write)!==void 0&&(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([C],{type:"text/plain"}),"text/html":new Blob([y],{type:"text/html"})})]),!0)})(a,s)||o(a)}};((l=window.navigator.clipboard)==null?void 0:l.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?i(r.textPlain,r.textHtml):o(r.textPlain),n==null||n.preventDefault()}function r0(e){return e!==!0}function o0(e){return typeof e=="string"?e:`${e}px`}const yg=Cn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[e=>e.innerWidth],"wmyidgi-1":[e=>e.innerHeight]}}),bg=e=>{const{inWidth:t,inHeight:n,children:r,...o}=e;return d.createElement(yg,{innerHeight:o0(n),innerWidth:o0(t),...o},r)},mr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function ct(e,t){return e===!0?t:e===!1?"":e}function i0(e){const t=ci.value;return{activateCell:ct(e.activateCell," |Enter|shift+Enter"),clear:ct(e.clear,"any+Escape"),closeOverlay:ct(e.closeOverlay,"any+Escape"),acceptOverlayDown:ct(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ct(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ct(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ct(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ct(e.delete,t?"Backspace|Delete":"Delete"),downFill:ct(e.downFill,"primary+_68"),scrollToSelectedCell:ct(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ct(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ct(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ct(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ct(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ct(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ct(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ct(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ct(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ct(e.goToFirstCell,"primary+Home"),goToFirstColumn:ct(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ct(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ct(e.goToLastCell,"primary+End"),goToLastColumn:ct(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ct(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ct(e.goToNextPage,"PageDown"),goToPreviousPage:ct(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ct(e.rightFill,"primary+_82"),search:ct(e.search,"primary+f"),selectAll:ct(e.selectAll,"primary+a"),selectColumn:ct(e.selectColumn,"ctrl+ "),selectGrowDown:ct(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ct(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ct(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ct(e.selectGrowUp,"shift+ArrowUp"),selectRow:ct(e.selectRow,"shift+ "),selectToFirstCell:ct(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ct(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ct(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ct(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ct(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ct(e.selectToLastRow,"primary+shift+ArrowDown")}}function xg(e){const t=function(n){const r=d.useRef(n);return $r(n,r.current)||(r.current=n),r.current}(e);return $t.useMemo(()=>{if(t===void 0)return i0(mr);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??mr.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??mr.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??mr.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??mr.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??mr.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??mr.selectToLastCell};return i0({...mr,...n})},[t])}function Cg(e){function t(n,r,o){if(typeof n=="number")return{headerIndex:n,isCollapsed:!1,depth:r,path:o};const i={headerIndex:n.headerIndex,isCollapsed:n.isCollapsed,depth:r,path:o};return n.subGroups!==void 0&&(i.subGroups=n.subGroups.map((l,a)=>t(l,r+1,[...o,a])).sort((l,a)=>l.headerIndex-a.headerIndex)),i}return e.map((n,r)=>t(n,0,[r])).sort((n,r)=>n.headerIndex-r.headerIndex)}function ma(e,t){const n=[];function r(a,s,c=!1){let h=s!==null?s-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(h=a.subGroups[0].headerIndex-a.headerIndex),h--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:c,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:h}),a.subGroups)for(let C=0;C<a.subGroups.length;C++){const y=C<a.subGroups.length-1?a.subGroups[C+1].headerIndex:s;r(a.subGroups[C],y,c||a.isCollapsed)}}const o=Cg(e.groups);for(let a=0;a<o.length;a++){const s=a<o.length-1?o[a+1].headerIndex:null;r(o[a],s)}let i=0,l=0;for(const a of n)a.contentIndex=l,l+=a.rows,a.rowIndex=i,i+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:s,...c}=a;return c})}function va(e,t){if(t===void 0||ma.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(r.isCollapsed)n--;else{if(n<=r.rows)return{path:[...r.path,n-1],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n-1,contentIndex:r.contentIndex+n-1,groupRows:r.rows};n=n-r.rows-1}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function a0(e,t,n){const[r,...o]=t;return o[0]===-1?e.map((i,l)=>l===r?{...i,...n}:i):e.map((i,l)=>l===r?{...i,subGroups:a0(i.subGroups??[],o,n)}:i)}function l0(e,t){const[n,...r]=t;return r[0]===-1?e[n]:l0(e[n].subGroups??[],r)}function Sg(e,t,n,r,o){const[i,l]=d.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-t%n:0],[t,n]),a=d.useMemo(()=>({x:r.current.x,y:i,width:r.current.width??1,height:r.current.height??1,ty:l}),[r,l,i]),[s,c,h]=c1(a),C=d.useRef(o);C.current=o;const y=function(m,E){const[g]=d.useState(()=>({value:m,callback:E,facade:{get current(){return g.value},set current(w){const x=g.value;x!==w&&(g.value=w,g.callback(w,x))}}}));return g.callback=E,g.facade}(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),b=(s.height??1)>1;d.useLayoutEffect(()=>{if(t!==void 0&&y.current!==null&&b){if(y.current.scrollTop===t)return;y.current.scrollTop=t,y.current.scrollTop!==t&&h(),C.current()}},[t,b,h,y]);const p=(s.width??1)>1;return d.useLayoutEffect(()=>{if(e!==void 0&&y.current!==null&&p){if(y.current.scrollLeft===e)return;y.current.scrollLeft=e,y.current.scrollLeft!==e&&h(),C.current()}},[e,p,h,y]),{visibleRegion:s,setVisibleRegion:c,scrollRef:y}}const kg=d.lazy(async()=>await L0(()=>import("./data-grid-overlay-editor-BEStKz7e.js"),__vite__mapDeps([0,1,2,3]),import.meta.url));let Mg=0;function di(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const hi={kind:me.Loading,allowOverlay:!1},fi={columns:yt.empty(),rows:yt.empty(),current:void 0},Rg=d.forwardRef((e,t)=>{var z0,A0,F0;const[n,r]=d.useState(fi),[o,i]=d.useState(),l=d.useRef(null),a=d.useRef(null),[s,c]=d.useState(),h=d.useRef(),C=typeof window>"u"?null:window,{imageEditorOverride:y,getRowThemeOverride:b,markdownDivCreateNode:p,width:m,height:E,columns:g,rows:w,getCellContent:x,onCellClicked:I,onCellActivated:v,onFillPattern:M,onFinishedEditing:S,coercePasteValue:H,drawHeader:f,drawCell:B,editorBloom:D,onHeaderClicked:O,onColumnProposeMove:T,rangeSelectionColumnSpanning:j=!0,spanRangeBehavior:V="default",onGroupHeaderClicked:Z,onCellContextMenu:Q,className:ce,onHeaderContextMenu:le,getCellsForSelection:q,onGroupHeaderContextMenu:J,onGroupHeaderRenamed:fe,onCellEdited:ee,onCellsEdited:se,onSearchResultsChanged:ie,searchResults:W,onSearchValueChange:N,searchValue:U,onKeyDown:ue,onKeyUp:pe,keybindings:ze,editOnType:Ue=!0,onRowAppended:He,onColumnMoved:$e,validateCell:be,highlightRegions:ye,rangeSelect:Fe="rect",columnSelect:Oe="multi",rowSelect:te="multi",rangeSelectionBlending:Ee="exclusive",columnSelectionBlending:ke="exclusive",rowSelectionBlending:Xe="exclusive",onDelete:Re,onDragStart:qe,onMouseMove:Ye,onPaste:ot,copyHeaders:Me=!1,freezeColumns:Pe=0,cellActivationBehavior:ut="second-click",rowSelectionMode:tt="auto",onHeaderMenuClick:pt,onHeaderIndicatorClick:Ft,getGroupDetails:bt,rowGrouping:Ze,onSearchClose:Yt,onItemHovered:nn,onSelectionCleared:Kt,showSearch:qt,onVisibleRegionChanged:un,gridSelection:jt,onGridSelectionChange:Kn,minColumnWidth:vr=50,maxColumnWidth:Dt=500,maxColumnAutoWidth:tr,provideEditor:_n,trailingRowOptions:ne,freezeTrailingRows:xe=0,allowedFillDirections:wt="orthogonal",scrollOffsetX:dt,scrollOffsetY:xt,verticalBorder:ve,onDragOverCell:Ve,onDrop:Ke,onColumnResize:mt,onColumnResizeEnd:it,onColumnResizeStart:at,customRenderers:vt,fillHandle:Qe,experimental:lt,fixedShadowX:rt,fixedShadowY:De,headerIcons:Nt,imageWindowLoader:gn,initialSize:Zt,isDraggable:rn,onDragLeave:Bt,onRowMoved:Xt,overscrollX:Sn,overscrollY:Rt,preventDiagonalScrolling:kn,rightElement:pn,rightElementProps:kt,trapFocus:It=!1,smoothScrollX:Vt,smoothScrollY:Et,scaleToRem:Tt=!1,rowHeight:Je=34,headerHeight:Qt=36,groupHeaderHeight:Mn=Qt,theme:mn,isOutsideClick:wr,renderers:Ro,resizeIndicator:Ca,scrollToActiveCell:Eo=!0,drawFocusRing:Io=!0}=e,zr=Io==="no-editor"?o===void 0:Io,Ot=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,vn=(Ot==null?void 0:Ot.kind)??e.rowMarkers??"none",gi=(Ot==null?void 0:Ot.width)??e.rowMarkerWidth,To=(Ot==null?void 0:Ot.startIndex)??e.rowMarkerStartIndex??1,nr=(Ot==null?void 0:Ot.theme)??e.rowMarkerTheme,rr=Ot==null?void 0:Ot.headerTheme,qr=Ot==null?void 0:Ot.headerAlwaysVisible,or=te!=="multi"||(Ot==null?void 0:Ot.headerDisabled)===!0,yr=(Ot==null?void 0:Ot.checkboxStyle)??"square",ir=Math.max(vr,20),Ar=Math.max(Dt,ir),pi=Math.max(tr??Ar,ir),Ho=d.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Ge,rowNumberMapper:Oo,rowHeight:mi,getRowThemeOverride:jn}=function(u,R,k,P){const A=$t.useMemo(()=>u===void 0?void 0:ma(u,R),[u,R]),G=$t.useMemo(()=>A==null?void 0:A.reduce((F,oe)=>(F[oe.rowIndex]=oe,F),{}),[A]),$=$t.useMemo(()=>A===void 0?R:A.reduce((F,oe)=>F+(oe.isCollapsed?1:oe.rows+1),0),[A,R]),_=$t.useMemo(()=>u===void 0||typeof k=="number"&&u.height===k?k:F=>G!=null&&G[F]?u.height:typeof k=="number"?k:k(F),[G,u,k]),X=$t.useCallback(F=>{if(A===void 0)return F;let oe=F;for(const re of A){if(oe===0)return;if(oe--,!re.isCollapsed){if(oe<re.rows)return re.contentIndex+oe;oe-=re.rows}}return F},[A]),Y=dr(P??(u==null?void 0:u.themeOverride),$t.useCallback(F=>{if(u===void 0)return P==null?void 0:P(F,F,F);if(P===void 0&&(u==null?void 0:u.themeOverride)===void 0)return;const{isGroupHeader:oe,contentIndex:re,groupIndex:ge}=va(F,A);return oe?u.themeOverride:P==null?void 0:P(F,ge,re)},[A,P,u]));return u===void 0?{rowHeight:_,rows:R,rowNumberMapper:X,getRowThemeOverride:Y}:{rowHeight:_,rows:$,rowNumberMapper:X,getRowThemeOverride:Y}}(Ze,w,Je,b),Sa=d.useMemo(()=>Number.parseFloat(Ho.fontSize),[Ho]),{rowHeight:Vn,headerHeight:Fr,groupHeaderHeight:Po,theme:Lr,overscrollX:Do,overscrollY:zo}=function({rowHeight:u,headerHeight:R,groupHeaderHeight:k,theme:P,overscrollX:A,overscrollY:G,scaleToRem:$,remSize:_}){const[X,Y,F,oe,re,ge]=$t.useMemo(()=>{if(!$||_===16)return[u,R,k,P,A,G];const we=_/16,je=u,Se=iu();return[typeof je=="number"?je*we:Te=>Math.ceil(je(Te)*we),Math.ceil(R*we),Math.ceil(k*we),{...P,headerIconSize:((P==null?void 0:P.headerIconSize)??Se.headerIconSize)*we,cellHorizontalPadding:((P==null?void 0:P.cellHorizontalPadding)??Se.cellHorizontalPadding)*we,cellVerticalPadding:((P==null?void 0:P.cellVerticalPadding)??Se.cellVerticalPadding)*we},Math.ceil((A??0)*we),Math.ceil((G??0)*we)]},[k,R,A,G,_,u,$,P]);return{rowHeight:X,headerHeight:Y,groupHeaderHeight:F,theme:oe,overscrollX:re,overscrollY:ge}}({groupHeaderHeight:Mn,headerHeight:Qt,overscrollX:Sn,overscrollY:Rt,remSize:Sa,rowHeight:mi,scaleToRem:Tt,theme:mn}),Un=xg(ze),Nn=gi??(w>1e4?48:w>1e3?44:w>100?36:32),wn=vn!=="none",K=wn?1:0,Wt=He!==void 0,L=(ne==null?void 0:ne.sticky)===!0,[ae,de]=d.useState(!1),Ce=qt??ae,he=d.useCallback(()=>{Yt!==void 0?Yt():de(!1)},[Yt]),z=d.useMemo(()=>jt===void 0?void 0:di(jt,K),[jt,K])??n,Ie=d.useRef();Ie.current===void 0&&(Ie.current=new AbortController),d.useEffect(()=>()=>Ie==null?void 0:Ie.current.abort(),[]);const[Le,Be]=function(u,R,k,P,A){const G=d.useCallback(X=>{if(u===!0){const Y=[];for(let F=X.y;F<X.y+X.height;F++){const oe=[];for(let re=X.x;re<X.x+X.width;re++)re<0||F>=A?oe.push({kind:me.Loading,allowOverlay:!1}):oe.push(R([re,F]));Y.push(oe)}return Y}return(u==null?void 0:u(X,P.signal))??[]},[P.signal,R,u,A]),$=u!==void 0?G:void 0,_=d.useCallback(X=>{if($===void 0)return[];const Y={...X,x:X.x-k};if(Y.x<0){Y.x=0,Y.width--;const F=$(Y,P.signal);return typeof F=="function"?async()=>(await F()).map(oe=>[{kind:me.Loading,allowOverlay:!1},...oe]):F.map(oe=>[{kind:me.Loading,allowOverlay:!1},...oe])}return $(Y,P.signal)},[P.signal,$,k]);return[u!==void 0?_:void 0,$]}(q,x,K,Ie.current,Ge),Mt=d.useCallback((u,R,k)=>{if(be===void 0)return!0;const P=[u[0]-K,u[1]];return be==null?void 0:be(P,R,k)},[K,be]),Ae=d.useRef(jt),_e=d.useCallback((u,R)=>{R&&(u=function(k,P,A,G,$){var Y;const _=k;if(G==="allowPartial"||k.current===void 0||P===void 0)return k;let X=!1;do{if((k==null?void 0:k.current)===void 0)break;const F=(Y=k.current)==null?void 0:Y.range,oe=[];if(F.width>2){const we=P({x:F.x,y:F.y,width:1,height:F.height},$.signal);if(typeof we=="function")return _;oe.push(...we);const je=P({x:F.x+F.width-1,y:F.y,width:1,height:F.height},$.signal);if(typeof je=="function")return _;oe.push(...je)}else{const we=P({x:F.x,y:F.y,width:F.width,height:F.height},$.signal);if(typeof we=="function")return _;oe.push(...we)}let re=F.x-A,ge=F.x+F.width-1-A;for(const we of oe)for(const je of we)je.span!==void 0&&(re=Math.min(je.span[0],re),ge=Math.max(je.span[1],ge));re===F.x-A&&ge===F.x+F.width-1-A?X=!0:k={current:{cell:k.current.cell??[0,0],range:{x:re+A,y:F.y,width:ge-re+1,height:F.height},rangeStack:k.current.rangeStack},columns:k.columns,rows:k.rows}}while(!X);return k}(u,Le,K,V,Ie.current)),Kn!==void 0?(Ae.current=di(u,-K),Kn(Ae.current)):r(u)},[Kn,Le,K,V]),et=dr(mt,d.useCallback((u,R,k,P)=>{mt==null||mt(g[k-K],R,k-K,P)},[mt,K,g])),dn=dr(it,d.useCallback((u,R,k,P)=>{it==null||it(g[k-K],R,k-K,P)},[it,K,g])),en=dr(at,d.useCallback((u,R,k,P)=>{at==null||at(g[k-K],R,k-K,P)},[at,K,g])),br=dr(f,d.useCallback((u,R)=>(f==null?void 0:f({...u,columnIndex:u.columnIndex-K},R))??!1,[f,K])),ar=dr(B,d.useCallback((u,R)=>(B==null?void 0:B({...u,col:u.col-K},R))??!1,[B,K])),on=d.useCallback(u=>{if(Re!==void 0){const R=Re(di(u,-K));return typeof R=="boolean"?R:di(R,K)}return!0},[Re,K]),[Lt,Ne,ht]=function(u,R,k,P,A,G,$){return[$t.useCallback((_,X,Y,F)=>{var je;G!=="cell"&&G!=="multi-cell"||_===void 0||(_={..._,range:{x:_.cell[0],y:_.cell[1],width:1,height:1}}),!$&&_!==void 0&&_.range.width>1&&(_={..._,range:{..._.range,width:1,x:_.cell[0]}});const oe=k==="mixed"&&(Y||F==="drag"),re=P==="mixed"&&oe,ge=A==="mixed"&&oe;let we={current:_===void 0?void 0:{..._,rangeStack:F==="drag"?((je=u.current)==null?void 0:je.rangeStack)??[]:[]},columns:re?u.columns:yt.empty(),rows:ge?u.rows:yt.empty()};Y&&(G==="multi-rect"||G==="multi-cell")&&we.current!==void 0&&u.current!==void 0&&(we={...we,current:{...we.current,rangeStack:[...u.current.rangeStack,u.current.range]}}),R(we,X)},[P,u,k,G,$,A,R]),$t.useCallback((_,X,Y)=>{let F;if(_=_??u.rows,X!==void 0&&(_=_.add(X)),A==="exclusive"&&_.length>0)F={current:void 0,columns:yt.empty(),rows:_};else{const oe=Y&&P==="mixed";F={current:Y&&k==="mixed"?u.current:void 0,columns:oe?u.columns:yt.empty(),rows:_}}R(F,!1)},[P,u,k,A,R]),$t.useCallback((_,X,Y)=>{let F;if(_=_??u.columns,X!==void 0&&(_=_.add(X)),P==="exclusive"&&_.length>0)F={current:void 0,rows:yt.empty(),columns:_};else{const oe=Y&&A==="mixed";F={current:Y&&k==="mixed"?u.current:void 0,rows:oe?u.rows:yt.empty(),columns:_}}R(F,!1)},[P,u,k,A,R])]}(z,_e,Ee,ke,Xe,Fe,j),gt=d.useMemo(()=>Zn(iu(),Lr),[Lr]),[yn,an]=d.useState([0,0,0]),lr=d.useMemo(()=>{if(Ro===void 0)return{};const u={};for(const R of Ro)u[R.kind]=R;return u},[Ro]),Ht=d.useCallback(u=>u.kind!==me.Custom?lr[u.kind]:vt==null?void 0:vt.find(R=>R.isMatch(u)),[vt,lr]);let{sizedColumns:hn,nonGrowWidth:vi}=function(u,R,k,P,A,G,$,_,X){const Y=d.useRef(R),F=d.useRef(k),oe=d.useRef($);Y.current=R,F.current=k,oe.current=$;const[re,ge]=d.useMemo(()=>{if(typeof window>"u")return[null,null];const We=document.createElement("canvas");return We.style.display="none",We.style.opacity="0",We.style.position="fixed",[We,We.getContext("2d",{alpha:!1})]},[]);d.useLayoutEffect(()=>(re&&document.documentElement.append(re),()=>{re==null||re.remove()}),[re]);const we=d.useRef({}),je=d.useRef(),[Se,Te]=d.useState();return d.useLayoutEffect(()=>{const We=F.current;if(We===void 0||u.every(ei))return;let _t=Math.max(1,10-Math.floor(u.length/1e4)),Ut=0;_t<Y.current&&_t>1&&(_t--,Ut=1);const tn={x:0,y:0,width:u.length,height:Math.min(Y.current,_t)},St={x:0,y:Y.current-1,width:u.length,height:1};(async()=>{const At=We(tn,X.signal),sn=Ut>0?We(St,X.signal):void 0;let xn;xn=typeof At=="object"?At:await Zs(At),sn!==void 0&&(xn=typeof sn=="object"?[...xn,...sn]:[...xn,...await Zs(sn)]),je.current=u,Te(xn)})()},[X.signal,u]),d.useMemo(()=>{let We=u.every(ei)?u:ge===null?u.map(St=>ei(St)?St:{...St,width:150}):(ge.font=oe.current.baseFontFull,u.map((St,At)=>{if(ei(St))return St;if(we.current[St.id]!==void 0)return{...St,width:we.current[St.id]};if(Se===void 0||je.current!==u||St.id===void 0)return{...St,width:150};const sn=au(ge,$,St,At,Se,A,G,!0,_);return we.current[St.id]=sn.width,sn})),_t=0,Ut=0;const tn=[];for(const[St,At]of We.entries())_t+=At.width,At.grow!==void 0&&At.grow>0&&(Ut+=At.grow,tn.push(St));if(_t<P&&tn.length>0){const St=[...We],At=P-_t;let sn=At;for(let xn=0;xn<tn.length;xn++){const cr=tn[xn],Xo=(We[cr].grow??0)/Ut,Aa=xn===tn.length-1?sn:Math.min(sn,Math.floor(At*Xo));St[cr]={...We[cr],growOffset:Aa,width:We[cr].width+Aa},sn-=Aa}We=St}return{sizedColumns:We,nonGrowWidth:_t}},[P,u,ge,Se,$,A,G,_])}(g,Ge,Be,yn[0]-(K===0?0:Nn)-yn[2],ir,pi,gt,Ht,Ie.current);vn!=="none"&&(vi+=Nn);const Qr=d.useMemo(()=>hn.some(u=>u.group!==void 0),[hn]),sr=Qr?Fr+Po:Fr,Ao=z.rows.length,Fo=vn==="none"?void 0:Ao!==0&&(Ao===Ge||void 0),Ct=d.useMemo(()=>vn==="none"?hn:[{title:"",width:Nn,icon:void 0,hasMenu:!1,style:"normal",themeOverride:nr,rowMarker:yr,rowMarkerChecked:Fo,headerRowMarkerTheme:rr,headerRowMarkerAlwaysVisible:qr,headerRowMarkerDisabled:or},...hn],[vn,hn,Nn,nr,yr,Fo,rr,qr,or]),Gt=d.useRef({height:1,width:1,x:0,y:0}),Dn=d.useRef(!1),{setVisibleRegion:Lo,visibleRegion:_r,scrollRef:zt}=Sg(dt,xt,Vn,Gt,()=>Dn.current=!0);Gt.current=_r;const lp=_r.x+K,wi=_r.y,ln=d.useRef(null),bn=d.useCallback(u=>{var R;u===!0?(R=ln.current)==null||R.focus():window.requestAnimationFrame(()=>{var k;(k=ln.current)==null||k.focus()})},[]),fn=Wt?Ge+1:Ge,zn=d.useCallback(u=>{const R=K===0?u:u.map(P=>({...P,location:[P.location[0]-K,P.location[1]]})),k=se==null?void 0:se(R);if(k!==!0)for(const P of R)ee==null||ee(P.location,P.value);return k},[ee,se,K]),[jr,ka]=d.useState(),yi=z.current!==void 0&&z.current.range.width*z.current.range.height>1?z.current.range:void 0,Jr=zr?(z0=z.current)==null?void 0:z0.cell:void 0,bi=Jr==null?void 0:Jr[0],xi=Jr==null?void 0:Jr[1],sp=d.useMemo(()=>{if((ye===void 0||ye.length===0)&&(yi??bi??xi??jr)===void 0)return;const u=[];if(ye!==void 0)for(const R of ye){const k=Ct.length-R.range.x-K;k>0&&u.push({color:R.color,range:{...R.range,x:R.range.x+K,width:Math.min(k,R.range.width)},style:R.style})}return jr!==void 0&&u.push({color:Hr(gt.accentColor,0),range:jr,style:"dashed"}),yi!==void 0&&u.push({color:Hr(gt.accentColor,.5),range:yi,style:"solid-outline"}),bi!==void 0&&xi!==void 0&&u.push({color:gt.accentColor,range:{x:bi,y:xi,width:1,height:1},style:"solid-outline"}),u.length>0?u:void 0},[jr,yi,bi,xi,ye,Ct.length,gt.accentColor,K]),b0=d.useRef(Ct);b0.current=Ct;const Tn=d.useCallback(([u,R],k=!1)=>{var A,G,$,_,X,Y,F;const P=Wt&&R===fn-1;if(u===0&&wn){if(P)return hi;const oe=Oo(R);return oe===void 0?hi:{kind:Hn.Marker,allowOverlay:!1,checkboxStyle:yr,checked:(z==null?void 0:z.rows.hasIndex(R))===!0,markerKind:vn==="clickable-number"?"number":vn,row:To+oe,drawHandle:Xt!==void 0,cursor:vn==="clickable-number"?"pointer":void 0}}if(P){const oe=u===K?(ne==null?void 0:ne.hint)??"":"",re=b0.current[u];if(((A=re==null?void 0:re.trailingRowOptions)==null?void 0:A.disabled)===!0)return hi;{const ge=((G=re==null?void 0:re.trailingRowOptions)==null?void 0:G.hint)??oe,we=(($=re==null?void 0:re.trailingRowOptions)==null?void 0:$.addIcon)??(ne==null?void 0:ne.addIcon);return{kind:Hn.NewRow,hint:ge,allowOverlay:!1,icon:we}}}{const oe=u-K;if(k||(lt==null?void 0:lt.strict)===!0){const ge=Gt.current,we=ge.x>oe||oe>ge.x+ge.width||ge.y>R||R>ge.y+ge.height||R>=Ra.current,je=oe===((X=(_=ge.extras)==null?void 0:_.selected)==null?void 0:X[0])&&R===((Y=ge.extras)==null?void 0:Y.selected[1]);let Se=!1;if(((F=ge.extras)==null?void 0:F.freezeRegions)!==void 0){for(const Te of ge.extras.freezeRegions)if(Dr(Te,oe,R)){Se=!0;break}}if(we&&!je&&!Se)return hi}let re=x([oe,R]);return K!==0&&re.span!==void 0&&(re={...re,span:[re.span[0]+K,re.span[1]+K]}),re}},[Wt,fn,wn,Oo,yr,z==null?void 0:z.rows,vn,To,Xt,K,ne==null?void 0:ne.hint,ne==null?void 0:ne.addIcon,lt==null?void 0:lt.strict,x]),Ma=d.useCallback(u=>{let R=(bt==null?void 0:bt(u))??{name:u};return fe!==void 0&&u!==""&&(R={icon:R.icon,name:R.name,overrideTheme:R.overrideTheme,actions:[...R.actions??[],{title:"Rename",icon:"renameIcon",onClick:k=>Ia({group:R.name,bounds:k.bounds})}]}),R},[bt,fe]),Ci=d.useCallback(u=>{var _;const[R,k]=u.cell,P=Ct[R],A=(P==null?void 0:P.group)!==void 0?(_=Ma(P.group))==null?void 0:_.overrideTheme:void 0,G=P==null?void 0:P.themeOverride,$=jn==null?void 0:jn(k);i({...u,theme:Zn(gt,A,G,$,u.content.themeOverride)})},[jn,Ct,Ma,gt]),Zr=d.useCallback((u,R,k)=>{var $;if(z.current===void 0)return;const[P,A]=z.current.cell,G=Tn([P,A]);if(G.kind!==me.Boolean&&G.allowOverlay){let _=G;if(k!==void 0)switch(_.kind){case me.Number:{const X=function(Y,F){try{return Y()}catch{return F}}(()=>k==="-"?-0:Number.parseFloat(k),0);_={..._,data:Number.isNaN(X)?0:X};break}case me.Text:case me.Markdown:case me.Uri:_={..._,data:k}}Ci({target:u,content:_,initialValue:k,cell:[P,A],highlight:k===void 0,forceEditMode:k!==void 0})}else G.kind===me.Boolean&&R&&G.readonly!==!0&&(zn([{location:z.current.cell,value:{...G,data:r0(G.data)}}]),($=ln.current)==null||$.damage([{cell:z.current.cell}]))},[Tn,z,zn,Ci]),x0=d.useCallback((u,R)=>{var A;const k=(A=ln.current)==null?void 0:A.getBounds(u,R);if(k===void 0||zt.current===null)return;const P=Tn([u,R]);P.allowOverlay&&Ci({target:k,content:P,initialValue:void 0,highlight:!0,cell:[u,R],forceEditMode:!0})},[Tn,zt,Ci]),Jt=d.useCallback((u,R,k="both",P=0,A=0,G=void 0)=>{if(zt.current!==null){const $=ln.current,_=a.current,X=typeof u!="number"?u.unit==="cell"?u.amount:void 0:u,Y=typeof R!="number"?R.unit==="cell"?R.amount:void 0:R,F=typeof u!="number"&&u.unit==="px"?u.amount:void 0,oe=typeof R!="number"&&R.unit==="px"?R.amount:void 0;if($!==null&&_!==null){let re={x:0,y:0,width:0,height:0},ge=0,we=0;if((X!==void 0||Y!==void 0)&&(re=$.getBounds((X??0)+K,Y??0)??re,re.width===0||re.height===0))return;const je=_.getBoundingClientRect(),Se=je.width/_.offsetWidth;if(F!==void 0&&(re={...re,x:F-je.left-zt.current.scrollLeft,width:1}),oe!==void 0&&(re={...re,y:oe+je.top-zt.current.scrollTop,height:1}),re!==void 0){const Te={x:re.x-P,y:re.y-A,width:re.width+2*P,height:re.height+2*A};let We=0;for(let Xo=0;Xo<Pe;Xo++)We+=hn[Xo].width;let _t=0;const Ut=xe+(L?1:0);Ut>0&&(_t=Or(fn,Ut,Vn));let tn=We*Se+je.left+K*Nn*Se,St=je.right,At=je.top+sr*Se,sn=je.bottom-_t*Se;const xn=re.width+2*P;switch(G==null?void 0:G.hAlign){case"start":St=tn+xn;break;case"end":tn=St-xn;break;case"center":tn=Math.floor((tn+St)/2)-xn/2,St=tn+xn}const cr=re.height+2*A;switch(G==null?void 0:G.vAlign){case"start":sn=At+cr;break;case"end":At=sn-cr;break;case"center":At=Math.floor((At+sn)/2)-cr/2,sn=At+cr}tn>Te.x?ge=Te.x-tn:St<Te.x+Te.width&&(ge=Te.x+Te.width-St),At>Te.y?we=Te.y-At:sn<Te.y+Te.height&&(we=Te.y+Te.height-sn),k==="vertical"||typeof u=="number"&&u<Pe?ge=0:(k==="horizontal"||typeof R=="number"&&R>=fn-Ut)&&(we=0),ge===0&&we===0||(Se!==1&&(ge/=Se,we/=Se),zt.current.scrollTo({left:ge+zt.current.scrollLeft,top:we+zt.current.scrollTop,behavior:(G==null?void 0:G.behavior)??"auto"}))}}}},[K,xe,Nn,zt,sr,Pe,hn,fn,L,Vn]),C0=d.useRef(x0),S0=d.useRef(x),Ra=d.useRef(Ge);C0.current=x0,S0.current=x,Ra.current=Ge;const eo=d.useCallback(async(u,R=!0,k)=>{var Y;const P=Ct[u];if(((Y=P==null?void 0:P.trailingRowOptions)==null?void 0:Y.disabled)===!0)return;const A=He==null?void 0:He();let G,$=!0;A!==void 0&&(G=await A,G==="top"&&($=!1),typeof G=="number"&&($=!1));let _=0;const X=()=>{if(Ra.current<=Ge)return _<500&&window.setTimeout(X,_),void(_=50+2*_);const F=typeof G=="number"?G:$?Ge:0;Ii.current(u-K,F,"both",0,0,k?{behavior:k}:void 0),Lt({cell:[u,F],range:{x:u,y:F,width:1,height:1}},!1,!1,"edit");const oe=S0.current([u-K,F]);oe.allowOverlay&&so(oe)&&oe.readonly!==!0&&R&&window.setTimeout(()=>{C0.current(u,F)},0)};X()},[Ct,He,K,Ge,Lt]),Si=d.useCallback(u=>{var k,P;const R=((P=(k=hn[u])==null?void 0:k.trailingRowOptions)==null?void 0:P.targetColumn)??(ne==null?void 0:ne.targetColumn);if(typeof R=="number")return R+(wn?1:0);if(typeof R=="object"){const A=g.indexOf(R);if(A>=0)return A+(wn?1:0)}},[hn,g,wn,ne==null?void 0:ne.targetColumn]),xr=d.useRef(),to=d.useRef(),_o=d.useCallback((u,R)=>{var A;const[k,P]=R;return Zn(gt,(A=Ct[k])==null?void 0:A.themeOverride,jn==null?void 0:jn(P),u.themeOverride)},[jn,Ct,gt]),{mapper:Nr}=function(u,R){const k=$t.useMemo(()=>u===void 0?void 0:ma(u,R),[u,R]);return{getRowGroupingForPath:l0,updateRowGroupingByPath:a0,mapper:$t.useCallback(P=>{if(typeof P=="number")return va(P,k);const A=va(P[1],k);return{...A,originalIndex:[P[0],A.originalIndex]}},[k])}}(Ze,w),Bn=Ze==null?void 0:Ze.navigationBehavior,jo=d.useCallback(u=>{var F,oe,re;const R=ci.value?u.metaKey:u.ctrlKey,k=R&&te==="multi",P=R&&Oe==="multi",[A,G]=u.location,$=z.columns,_=z.rows,[X,Y]=((F=z.current)==null?void 0:F.cell)??[];if(u.kind==="cell"){if(to.current=void 0,Br.current=[A,G],A===0&&wn){if(Wt===!0&&G===Ge||vn==="number"||te==="none")return;const ge=Tn(u.location);if(ge.kind!==Hn.Marker)return;if(Xt!==void 0){const Se=Ht(ge);Rn((Se==null?void 0:Se.kind)===Hn.Marker);const Te=(oe=Se==null?void 0:Se.onClick)==null?void 0:oe.call(Se,{...u,cell:ge,posX:u.localEventX,posY:u.localEventY,bounds:u.bounds,theme:_o(ge,u.location),preventDefault:()=>{}});if(Te===void 0||Te.checked===ge.checked)return}i(void 0),bn();const we=_.hasIndex(G),je=xr.current;if(te==="multi"&&(u.shiftKey||u.isLongTouch===!0)&&je!==void 0&&_.hasIndex(je)){const Se=[Math.min(je,G),Math.max(je,G)+1];k||tt==="multi"?Ne(void 0,Se,!0):Ne(yt.fromSingleSelection(Se),void 0,k)}else te==="multi"&&(k||u.isTouch||tt==="multi")?we?Ne(_.remove(G),void 0,!0):(Ne(void 0,G,!0),xr.current=G):we&&_.length===1?Ne(yt.empty(),void 0,R):(Ne(yt.fromSingleSelection(G),void 0,R),xr.current=G)}else if(A>=K&&Wt&&G===Ge){const ge=Si(A);eo(ge??A)}else if(X!==A||Y!==G){const ge=Tn(u.location),we=Ht(ge);if((we==null?void 0:we.onSelect)!==void 0){let Te=!1;if(we.onSelect({...u,cell:ge,posX:u.localEventX,posY:u.localEventY,bounds:u.bounds,preventDefault:()=>Te=!0,theme:_o(ge,u.location)}),Te)return}if(Bn==="block"&&Nr(G).isGroupHeader)return;const je=L&&G===Ge,Se=L&&z!==void 0&&((re=z.current)==null?void 0:re.cell[1])===Ge;if(!u.shiftKey&&u.isLongTouch!==!0||X===void 0||Y===void 0||z.current===void 0||Se)Lt({cell:[A,G],range:{x:A,y:G,width:1,height:1}},!0,R,"click"),xr.current=void 0,i(void 0),bn();else{if(je)return;const Te=Math.min(A,X),We=Math.max(A,X),_t=Math.min(G,Y),Ut=Math.max(G,Y);Lt({...z.current,range:{x:Te,y:_t,width:We-Te+1,height:Ut-_t+1}},!0,R,"click"),xr.current=void 0,bn()}}}else if(u.kind==="header")if(Br.current=[A,G],i(void 0),wn&&A===0)xr.current=void 0,to.current=void 0,or||te!=="multi"||(_.length!==Ge?Ne(yt.fromSingleSelection([0,Ge]),void 0,R):Ne(yt.empty(),void 0,R),bn());else{const ge=to.current;if(Oe==="multi"&&(u.shiftKey||u.isLongTouch===!0)&&ge!==void 0&&$.hasIndex(ge)){const we=[Math.min(ge,A),Math.max(ge,A)+1];P?ht(void 0,we,R):ht(yt.fromSingleSelection(we),void 0,R)}else P?($.hasIndex(A)?ht($.remove(A),void 0,R):ht(void 0,A,R),to.current=A):Oe!=="none"&&($.hasIndex(A)?ht($.remove(A),void 0,R):ht(yt.fromSingleSelection(A),void 0,R),to.current=A);xr.current=void 0,bn()}else u.kind===Pn?Br.current=[A,G]:u.kind!==ui||u.isMaybeScrollbar||(_e(fi,!1),i(void 0),bn(),Kt==null||Kt(),xr.current=void 0,to.current=void 0)},[te,Oe,z,wn,K,Wt,Ge,vn,Tn,Xt,bn,tt,Ht,_o,Ne,Si,eo,Bn,Nr,L,Lt,ht,_e,Kt]),No=d.useRef(!1),Br=d.useRef(),k0=d.useRef(_r),An=d.useRef(),cp=d.useCallback(u=>{if(no.current=!1,k0.current=Gt.current,u.button!==0&&u.button!==1)return void(An.current=void 0);const R=performance.now();An.current={button:u.button,time:R,location:u.location},(u==null?void 0:u.kind)==="header"&&(No.current=!0);const k=u.kind==="cell"&&u.isFillHandle;!k&&u.kind!=="cell"&&u.isEdge||(c({previousSelection:z,fillHandle:k}),Br.current=void 0,u.isTouch||u.button!==0||k?u.isTouch||u.button!==1||(Br.current=u.location):jo(u))},[z,jo]),[Ea,Ia]=d.useState(),M0=d.useCallback(u=>{if(u.kind!==Pn||Oe!=="multi")return;const R=ci.value?u.metaKey:u.ctrlKey,[k]=u.location,P=z.columns;if(k<K)return;const A=Ct[k];let G=k,$=k;for(let _=k-1;_>=K&&mo(A.group,Ct[_].group);_--)G--;for(let _=k+1;_<Ct.length&&mo(A.group,Ct[_].group);_++)$++;if(bn(),R)if(P.hasAll([G,$+1])){let _=P;for(let X=G;X<=$;X++)_=_.remove(X);ht(_,void 0,R)}else ht(void 0,[G,$+1],R);else ht(yt.fromSingleSelection([G,$+1]),void 0,R)},[Oe,bn,z.columns,Ct,K,ht]),no=d.useRef(!1),ki=d.useCallback(async u=>{if(Le!==void 0&&et!==void 0){const R=Gt.current.y,k=Gt.current.height;let P=Le({x:u,y:R,width:1,height:Math.min(k,Ge-R)},Ie.current.signal);typeof P!="object"&&(P=await P());const A=hn[u-K],G=document.createElement("canvas").getContext("2d",{alpha:!1});if(G!==null){G.font=gt.baseFontFull;const $=au(G,gt,A,0,P,ir,Ar,!1,Ht);et==null||et(A,$.width,u,$.width)}}},[hn,Le,Ar,gt,ir,et,K,Ge,Ht]),[up,Ta]=d.useState(),ro=d.useCallback(async(u,R)=>{var _,X;const k=(_=u.current)==null?void 0:_.range;if(k===void 0||Le===void 0||R.current===void 0)return;const P=R.current.range;if(M!==void 0){let Y=!1;if(M({fillDestination:{...P,x:P.x-K},patternSource:{...k,x:k.x-K},preventDefault:()=>Y=!0}),Y)return}let A=Le(k,Ie.current.signal);typeof A!="object"&&(A=await A());const G=A,$=[];for(let Y=0;Y<P.width;Y++)for(let F=0;F<P.height;F++){const oe=[P.x+Y,P.y+F];if(Yc(oe,k))continue;const re=G[F%k.height][Y%k.width];!kr(re)&&so(re)&&$.push({location:oe,value:{...re}})}zn($),(X=ln.current)==null||X.damage($.map(Y=>({cell:Y.location})))},[Le,zn,M,K]),R0=d.useCallback(()=>{if(z.current===void 0||z.current.range.width<=1)return;const u={...z,current:{...z.current,range:{...z.current.range,width:1}}};ro(u,z)},[ro,z]),E0=d.useCallback(()=>{if(z.current===void 0||z.current.range.height<=1)return;const u={...z,current:{...z.current,range:{...z.current.range,height:1}}};ro(u,z)},[ro,z]),dp=d.useCallback((u,R)=>{var F,oe;const k=s;if(c(void 0),ka(void 0),Ta(void 0),No.current=!1,R)return;if((k==null?void 0:k.fillHandle)===!0&&z.current!==void 0&&((F=k.previousSelection)==null?void 0:F.current)!==void 0){if(jr===void 0)return;const re={...z,current:{...z.current,range:md(k.previousSelection.current.range,jr)}};return ro(k.previousSelection,re),void _e(re,!0)}const[P,A]=u.location,[G,$]=Br.current??[],_=()=>{no.current=!0},X=re=>{var we,je,Se;const ge=re.isTouch||G===P&&$===A;if(ge&&(I==null||I([P-K,A],{...re,preventDefault:_})),re.button===1)return!no.current;if(!no.current){const Te=Tn(u.location),We=Ht(Te);if(We!==void 0&&We.onClick!==void 0&&ge){const Ut=We.onClick({...re,cell:Te,posX:re.localEventX,posY:re.localEventY,bounds:re.bounds,theme:_o(Te,u.location),preventDefault:_});Ut!==void 0&&!kr(Ut)&&Mr(Ut)&&(zn([{location:re.location,value:Ut}]),(we=ln.current)==null||we.damage([{cell:re.location}]))}if(no.current||z.current===void 0)return!1;let _t=!1;switch(Te.activationBehaviorOverride??ut){case"double-click":case"second-click":{if(((Se=(je=k==null?void 0:k.previousSelection)==null?void 0:je.current)==null?void 0:Se.cell)===void 0)break;const[Ut,tn]=z.current.cell,[St,At]=k.previousSelection.current.cell;_t=P===Ut&&P===St&&A===tn&&A===At&&(re.isDoubleClick===!0||ut==="second-click");break}case"single-click":_t=!0}if(_t)return v==null||v([P-K,A]),Zr(re.bounds,!1),!0}return!1},Y=u.location[0]-K;if(u.isTouch){const re=Gt.current,ge=k0.current;if(re.x!==ge.x||re.y!==ge.y)return;if(u.isLongTouch===!0){if(u.kind==="cell"&&vo((oe=z.current)==null?void 0:oe.cell,u.location))return void(Q==null?void 0:Q([Y,u.location[1]],{...u,preventDefault:_}));if(u.kind==="header"&&z.columns.hasIndex(P))return void(le==null?void 0:le(Y,{...u,preventDefault:_}));if(u.kind===Pn)return Y<0?void 0:void(J==null?void 0:J(Y,{...u,preventDefault:_}))}return void(u.kind==="cell"?X(u)||jo(u):u.kind===Pn?Z==null?void 0:Z(Y,{...u,preventDefault:_}):(u.kind===pr&&(O==null||O(Y,{...u,preventDefault:_})),jo(u)))}if(u.kind==="header"){if(Y<0)return;u.isEdge?u.isDoubleClick===!0&&ki(P):u.button===0&&P===G&&A===$&&(O==null||O(Y,{...u,preventDefault:_}))}if(u.kind===Pn){if(Y<0)return;u.button===0&&P===G&&A===$&&(Z==null||Z(Y,{...u,preventDefault:_}),no.current||M0(u))}u.kind!=="cell"||u.button!==0&&u.button!==1||X(u),Br.current=void 0},[s,z,K,jr,ro,_e,I,Tn,Ht,ut,_o,zn,v,Zr,Q,le,J,jo,Z,O,ki,M0]),hp=d.useCallback(u=>{const R={...u,location:[u.location[0]-K,u.location[1]]};Ye==null||Ye(R),s!==void 0&&u.buttons===0&&(c(void 0),ka(void 0),Ta(void 0),No.current=!1),Ta(k=>{var P;return No.current?[u.scrollEdge[0],0]:u.scrollEdge[0]===(k==null?void 0:k[0])&&u.scrollEdge[1]===k[1]?k:s===void 0||(((P=An.current)==null?void 0:P.location[0])??0)<K?void 0:u.scrollEdge})},[s,Ye,K]),fp=d.useCallback((u,R)=>{pt==null||pt(u-K,R)},[pt,K]),gp=d.useCallback((u,R)=>{Ft==null||Ft(u-K,R)},[Ft,K]),qn=(A0=z==null?void 0:z.current)==null?void 0:A0.cell,pp=d.useCallback((u,R,k,P,A,G)=>{Dn.current=!1;let $=qn;$!==void 0&&($=[$[0]-K,$[1]]);const _=Pe===0?void 0:{x:0,y:u.y,width:Pe,height:u.height},X=[];_!==void 0&&X.push(_),xe>0&&(X.push({x:u.x-K,y:Ge-xe,width:u.width,height:xe}),Pe>0&&X.push({x:0,y:Ge-xe,width:Pe,height:xe}));const Y={x:u.x-K,y:u.y,width:u.width,height:Wt&&u.y+u.height>=Ge?u.height-1:u.height,tx:A,ty:G,extras:{selected:$,freezeRegion:_,freezeRegions:X}};Gt.current=Y,Lo(Y),an([R,k,P]),un==null||un(Y,Y.tx,Y.ty,Y.extras)},[qn,K,Wt,Ge,Pe,xe,Lo,un]),mp=dr(T,d.useCallback((u,R)=>(T==null?void 0:T(u-K,R-K))!==!1,[T,K])),vp=dr($e,d.useCallback((u,R)=>{$e==null||$e(u-K,R-K),Oe!=="none"&&ht(yt.fromSingleSelection(R),void 0,!0)},[Oe,$e,K,ht])),Ha=d.useRef(!1),wp=d.useCallback(u=>{u.location[0]===0&&K>0?u.preventDefault():(qe==null||qe({...u,location:[u.location[0]-K,u.location[1]]}),u.defaultPrevented()||(Ha.current=!0),c(void 0))},[qe,K]),yp=d.useCallback(()=>{Ha.current=!1},[]),I0=Ze==null?void 0:Ze.selectionBehavior,Mi=d.useCallback(u=>{if(I0!=="block-spanning")return;const{isGroupHeader:R,path:k,groupRows:P}=Nr(u);if(R)return[u,u];const A=k[k.length-1];return[u-A,u+P-A-1]},[Nr,I0]),Oa=d.useRef(),Pa=d.useCallback(u=>{var R,k,P;if(!(qf(u,Oa.current)||(Oa.current=u,((R=An==null?void 0:An.current)==null?void 0:R.button)!==void 0&&An.current.button>=1))){if(u.buttons!==0&&s!==void 0&&((k=An.current)==null?void 0:k.location[0])===0&&u.location[0]===0&&K===1&&te==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(An.current.location[1])&&z.rows.hasIndex(An.current.location[1])){const A=Math.min(An.current.location[1],u.location[1]),G=Math.max(An.current.location[1],u.location[1])+1;Ne(yt.fromSingleSelection([A,G]),void 0,!1)}if(!(u.buttons===0||s===void 0||z.current===void 0||Ha.current||No.current||Fe!=="rect"&&Fe!=="multi-rect")){const[A,G]=z.current.cell;let[$,_]=u.location;if(_<0&&(_=Gt.current.y),s.fillHandle===!0&&((P=s.previousSelection)==null?void 0:P.current)!==void 0){const X=s.previousSelection.current.range;_=Math.min(_,Wt?Ge-1:Ge);const Y=function(F,oe,re,ge){if(ge==="any")return md(F,{x:oe,y:re,width:1,height:1});if(ge==="vertical"&&(oe=F.x),ge==="horizontal"&&(re=F.y),Yc([oe,re],F))return;const we=oe-F.x,je=F.x+F.width-oe,Se=re-F.y+1,Te=F.y+F.height-re,We=Math.min(ge==="vertical"?Number.MAX_SAFE_INTEGER:we,ge==="vertical"?Number.MAX_SAFE_INTEGER:je,ge==="horizontal"?Number.MAX_SAFE_INTEGER:Se,ge==="horizontal"?Number.MAX_SAFE_INTEGER:Te);return We===Te?{x:F.x,y:F.y+F.height,width:F.width,height:re-F.y-F.height+1}:We===Se?{x:F.x,y:re,width:F.width,height:F.y-re}:We===je?{x:F.x+F.width,y:F.y,width:oe-F.x-F.width+1,height:F.height}:{x:oe,y:F.y,width:F.x-oe,height:F.height}}(X,$,_,wt);ka(Y)}else{if(Wt&&G===Ge)return;if(Wt&&_===Ge){if(u.kind!==ui)return;_--}$=Math.max($,K);const X=Mi(G);_=X===void 0?_:On(_,X[0],X[1]);const Y=$-A,F=_-G,oe={x:Y>=0?A:$,y:F>=0?G:_,width:Math.abs(Y)+1,height:Math.abs(F)+1};Lt({...z.current,range:oe},!0,!1,"drag")}}nn==null||nn({...u,location:[u.location[0]-K,u.location[1]]})}},[s,K,te,z,Fe,nn,Ne,Wt,Ge,wt,Mi,Lt]),bp=d.useCallback(()=>{var $,_;const u=Oa.current;if(u===void 0)return;const[R,k]=u.scrollEdge;let[P,A]=u.location;const G=Gt.current;R===-1?P=((_=($=G.extras)==null?void 0:$.freezeRegion)==null?void 0:_.x)??G.x:R===1&&(P=G.x+G.width),k===-1?A=Math.max(0,G.y):k===1&&(A=Math.min(Ge-1,G.y+G.height)),P=On(P,0,Ct.length-1),A=On(A,0,Ge-1),Pa({...u,location:[P,A]})},[Ct.length,Pa,Ge]);(function(u,R,k){const P=$t.useRef(0),[A,G]=u??[0,0];$t.useEffect(()=>{if(A===0&&G===0)return void(P.current=0);let $=!1,_=0;const X=Y=>{var F;if(!$){if(_===0)_=Y;else{const oe=Y-_;P.current=Math.min(1,P.current+oe/1300);const re=P.current**1.618*oe*2;(F=R.current)==null||F.scrollBy(A*re,G*re),_=Y,k==null||k()}window.requestAnimationFrame(X)}};return window.requestAnimationFrame(X),()=>{$=!0}},[R,A,G,k])})(up,zt,bp);const Wn=d.useCallback(u=>{if(z.current===void 0)return;const[R,k]=u,[P,A]=z.current.cell,G=z.current.range;let $=G.x,_=G.x+G.width,X=G.y,Y=G.y+G.height;const[F,oe]=Mi(A)??[0,Ge-1],re=oe+1;if(k!==0)switch(k){case 2:Y=re,X=A,Jt(0,Y,"vertical");break;case-2:X=F,Y=A+1,Jt(0,X,"vertical");break;case 1:X<A?(X++,Jt(0,X,"vertical")):(Y=Math.min(re,Y+1),Jt(0,Y,"vertical"));break;case-1:Y>A+1?(Y--,Jt(0,Y,"vertical")):(X=Math.max(F,X-1),Jt(0,X,"vertical"));break;default:lo()}if(R!==0)if(R===2)_=Ct.length,$=P,Jt(_-1-K,0,"horizontal");else if(R===-2)$=K,_=P+1,Jt($-K,0,"horizontal");else{let ge=[];if(Le!==void 0){const we=Le({x:$,y:X,width:_-$-K,height:Y-X},Ie.current.signal);typeof we=="object"&&(ge=function(je){return S1(Zu(Zu(je).filter(Se=>Se.span!==void 0).map(Se=>{var Te,We;return Pr((((Te=Se.span)==null?void 0:Te[0])??0)+1,(((We=Se.span)==null?void 0:We[1])??0)+1)})))}(we))}if(R===1){let we=!1;if($<P){if(ge.length>0){const je=Pr($+1,P+1).find(Se=>!ge.includes(Se-K));je!==void 0&&($=je,we=!0)}else $++,we=!0;we&&Jt($,0,"horizontal")}we||(_=Math.min(Ct.length,_+1),Jt(_-1-K,0,"horizontal"))}else if(R===-1){let we=!1;if(_>P+1){if(ge.length>0){const je=Pr(_-1,P,-1).find(Se=>!ge.includes(Se-K));je!==void 0&&(_=je,we=!0)}else _--,we=!0;we&&Jt(_-K,0,"horizontal")}we||($=Math.max(K,$-1),Jt($-K,0,"horizontal"))}else lo()}Lt({cell:z.current.cell,range:{x:$,y:X,width:_-$,height:Y-X}},!0,!1,"keyboard-select")},[Le,Mi,z,Ct.length,K,Ge,Jt,Lt]),Da=d.useRef(Eo);Da.current=Eo;const Cr=d.useCallback((u,R,k,P)=>{const A=fn-(k?0:1);u=On(u,K,hn.length-1+K),R=On(R,0,A);const G=qn==null?void 0:qn[0],$=qn==null?void 0:qn[1];if(u===G&&R===$)return!1;if(P&&z.current!==void 0){const _=[...z.current.rangeStack];(z.current.range.width>1||z.current.range.height>1)&&_.push(z.current.range),_e({...z,current:{cell:[u,R],range:{x:u,y:R,width:1,height:1},rangeStack:_}},!0)}else Lt({cell:[u,R],range:{x:u,y:R,width:1,height:1}},!0,!1,"keyboard-nav");return h.current!==void 0&&h.current[0]===u&&h.current[1]===R&&(h.current=void 0),Da.current&&Jt(u-K,R),!0},[fn,K,hn.length,qn,z,Jt,_e,Lt]),xp=d.useCallback((u,R)=>{(o==null?void 0:o.cell)!==void 0&&u!==void 0&&Mr(u)&&(zn([{location:o.cell,value:u}]),window.requestAnimationFrame(()=>{var A;(A=ln.current)==null||A.damage([{cell:o.cell}])})),bn(!0),i(void 0);const[k,P]=R;if(z.current!==void 0&&(k!==0||P!==0)){const A=z.current.cell[1]===fn-1&&u!==void 0;Cr(On(z.current.cell[0]+k,0,Ct.length-1),On(z.current.cell[1]+P,0,fn-1),A,!1)}S==null||S(u,R)},[o==null?void 0:o.cell,bn,z,S,zn,fn,Cr,Ct.length]),Cp=d.useMemo(()=>"gdg-overlay-"+Mg++,[]),Wr=d.useCallback(u=>{var k,P,A,G;bn();const R=[];for(let $=u.x;$<u.x+u.width;$++)for(let _=u.y;_<u.y+u.height;_++){const X=x([$-K,_]);if(!X.allowOverlay&&X.kind!==me.Boolean)continue;let Y;if(X.kind===me.Custom){const F=Ht(X),oe=(k=F==null?void 0:F.provideEditor)==null?void 0:k.call(F,{...X,location:[$-K,_]});(F==null?void 0:F.onDelete)!==void 0?Y=F.onDelete(X):$a(oe)&&(Y=(P=oe==null?void 0:oe.deletedValue)==null?void 0:P.call(oe,X))}else if(Mr(X)&&X.allowOverlay||X.kind===me.Boolean){const F=Ht(X);Y=(A=F==null?void 0:F.onDelete)==null?void 0:A.call(F,X)}Y!==void 0&&!kr(Y)&&Mr(Y)&&R.push({location:[$,_],value:Y})}zn(R),(G=ln.current)==null||G.damage(R.map($=>({cell:$.location})))},[bn,x,Ht,zn,K]),Bo=o!==void 0,T0=d.useCallback(u=>{var we,je;const R=()=>{u.stopPropagation(),u.preventDefault()},k={didMatch:!1},{bounds:P}=u,A=z.columns,G=z.rows,$=Un;if(!Bo&&st($.clear,u,k))_e(fi,!1),Kt==null||Kt();else if(!Bo&&st($.selectAll,u,k))_e({columns:yt.empty(),rows:yt.empty(),current:{cell:((we=z.current)==null?void 0:we.cell)??[K,0],range:{x:K,y:0,width:g.length,height:Ge},rangeStack:[]}},!1);else if(st($.search,u,k))(je=l==null?void 0:l.current)==null||je.focus({preventScroll:!0}),de(!0);else if(st($.delete,u,k)){const Se=(on==null?void 0:on(z))??!0;if(Se!==!1){const Te=Se===!0?z:Se;if(Te.current!==void 0){Wr(Te.current.range);for(const We of Te.current.rangeStack)Wr(We)}for(const We of Te.rows)Wr({x:K,y:We,width:g.length,height:1});for(const We of Te.columns)Wr({x:We,y:0,width:1,height:Ge})}}if(k.didMatch)return R(),!0;if(z.current===void 0)return!1;let[_,X]=z.current.cell;const[,Y]=z.current.cell;let F=!1,oe=!1;if(st($.scrollToSelectedCell,u,k)?Ii.current(_-K,X):Oe!=="none"&&st($.selectColumn,u,k)?A.hasIndex(_)?ht(A.remove(_),void 0,!0):Oe==="single"?ht(yt.fromSingleSelection(_),void 0,!0):ht(void 0,_,!0):te!=="none"&&st($.selectRow,u,k)?G.hasIndex(X)?Ne(G.remove(X),void 0,!0):te==="single"?Ne(yt.fromSingleSelection(X),void 0,!0):Ne(void 0,X,!0):!Bo&&P!==void 0&&st($.activateCell,u,k)?X===Ge&&Wt?window.setTimeout(()=>{const Se=Si(_);eo(Se??_)},0):(v==null||v([_-K,X]),Zr(P,!0)):z.current.range.height>1&&st($.downFill,u,k)?E0():z.current.range.width>1&&st($.rightFill,u,k)?R0():st($.goToNextPage,u,k)?X+=Math.max(1,Gt.current.height-4):st($.goToPreviousPage,u,k)?X-=Math.max(1,Gt.current.height-4):st($.goToFirstCell,u,k)?(i(void 0),X=0,_=0):st($.goToLastCell,u,k)?(i(void 0),X=Number.MAX_SAFE_INTEGER,_=Number.MAX_SAFE_INTEGER):st($.selectToFirstCell,u,k)?(i(void 0),Wn([-2,-2])):st($.selectToLastCell,u,k)?(i(void 0),Wn([2,2])):Bo?(st($.closeOverlay,u,k)&&i(void 0),st($.acceptOverlayDown,u,k)&&(i(void 0),X++),st($.acceptOverlayUp,u,k)&&(i(void 0),X--),st($.acceptOverlayLeft,u,k)&&(i(void 0),_--),st($.acceptOverlayRight,u,k)&&(i(void 0),_++)):(st($.goDownCell,u,k)?X+=1:st($.goUpCell,u,k)?X-=1:st($.goRightCell,u,k)?_+=1:st($.goLeftCell,u,k)?_-=1:st($.goDownCellRetainSelection,u,k)?(X+=1,F=!0):st($.goUpCellRetainSelection,u,k)?(X-=1,F=!0):st($.goRightCellRetainSelection,u,k)?(_+=1,F=!0):st($.goLeftCellRetainSelection,u,k)?(_-=1,F=!0):st($.goToLastRow,u,k)?X=Ge-1:st($.goToFirstRow,u,k)?X=Number.MIN_SAFE_INTEGER:st($.goToLastColumn,u,k)?_=Number.MAX_SAFE_INTEGER:st($.goToFirstColumn,u,k)?_=Number.MIN_SAFE_INTEGER:Fe!=="rect"&&Fe!=="multi-rect"||(st($.selectGrowDown,u,k)?Wn([0,1]):st($.selectGrowUp,u,k)?Wn([0,-1]):st($.selectGrowRight,u,k)?Wn([1,0]):st($.selectGrowLeft,u,k)?Wn([-1,0]):st($.selectToLastRow,u,k)?Wn([0,2]):st($.selectToFirstRow,u,k)?Wn([0,-2]):st($.selectToLastColumn,u,k)?Wn([2,0]):st($.selectToFirstColumn,u,k)&&Wn([-2,0])),oe=k.didMatch),Bn!==void 0&&Bn!=="normal"&&X!==Y){const Se=Bn==="skip-down"||Bn==="skip"||Bn==="block",Te=X<Y;if(Te&&(Bn==="skip-up"||Bn==="skip"||Bn==="block")){for(;X>=0&&Nr(X).isGroupHeader;)X--;X<0&&(X=Y)}else if(!Te&&Se){for(;X<Ge&&Nr(X).isGroupHeader;)X++;X>=Ge&&(X=Y)}}const re=Cr(_,X,!1,F),ge=k.didMatch;return ge&&(re||!oe||It)&&R(),ge},[Bn,Bo,z,Un,Oe,te,Fe,K,Nr,Ge,Cr,_e,Kt,g.length,on,It,Wr,ht,Ne,Wt,Si,eo,v,Zr,E0,R0,Wn]),Wo=d.useCallback(u=>{let R=!1;if(ue!==void 0&&ue({...u,...u.location&&{location:[u.location[0]-K,u.location[1]]},cancel:()=>{R=!0}}),R||T0(u)||z.current===void 0)return;const[k,P]=z.current.cell,A=Gt.current;if(Ue&&!u.metaKey&&!u.ctrlKey&&z.current!==void 0&&u.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(u.key)&&u.bounds!==void 0&&so(x([k-K,Math.max(0,Math.min(P,Ge-1))]))){if((!Wt||P!==Ge)&&(A.y>P||P>A.y+A.height||A.x>k||k>A.x+A.width))return;v==null||v([k-K,P]),Zr(u.bounds,!0,u.key),u.stopPropagation(),u.preventDefault()}},[Ue,ue,T0,z,x,K,Ge,Wt,v,Zr]),Sp=d.useCallback((u,R)=>{const k=u.location[0]-K;if(u.kind==="header"&&(le==null||le(k,{...u,preventDefault:R})),u.kind===Pn){if(k<0)return;J==null||J(k,{...u,preventDefault:R})}if(u.kind==="cell"){const[P,A]=u.location;Q==null||Q([k,A],{...u,preventDefault:R}),function(G,$){const[_,X]=$;if(G.columns.hasIndex(_)||G.rows.hasIndex(X))return!0;if(G.current!==void 0){if(vo(G.current.cell,$))return!0;const Y=[G.current.range,...G.current.rangeStack];for(const F of Y)if(_>=F.x&&_<F.x+F.width&&X>=F.y&&X<F.y+F.height)return!0}return!1}(z,u.location)||Cr(P,A,!1,!1)}},[z,Q,J,le,K,Cr]),za=d.useCallback(async u=>{var $,_,X;if(!Un.paste)return;function R(Y,F,oe,re){var we,je;const ge=typeof oe=="object"?(oe==null?void 0:oe.join(`
127
+ `&&(n.push(r),r=[])),i=t.None)}l++}return o<e.length&&r.push(t0(e.slice(o,e.length))),n.push(r),n.map(a=>a.map(s=>({rawValue:s,formatted:s,format:"string"})))}function n0(e,t,n){var l;const r=vg(e,t),o=a=>{var s;(s=window.navigator.clipboard)==null||s.writeText(a)},i=(a,s)=>{var c,h;try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");(c=n==null?void 0:n.clipboardData)==null||c.setData("text/plain",a),(h=n==null?void 0:n.clipboardData)==null||h.setData("text/html",s)}catch{((C,y)=>{var b;return((b=window.navigator.clipboard)==null?void 0:b.write)!==void 0&&(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([C],{type:"text/plain"}),"text/html":new Blob([y],{type:"text/html"})})]),!0)})(a,s)||o(a)}};((l=window.navigator.clipboard)==null?void 0:l.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?i(r.textPlain,r.textHtml):o(r.textPlain),n==null||n.preventDefault()}function r0(e){return e!==!0}function o0(e){return typeof e=="string"?e:`${e}px`}const yg=Cn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[e=>e.innerWidth],"wmyidgi-1":[e=>e.innerHeight]}}),bg=e=>{const{inWidth:t,inHeight:n,children:r,...o}=e;return d.createElement(yg,{innerHeight:o0(n),innerWidth:o0(t),...o},r)},mr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function ct(e,t){return e===!0?t:e===!1?"":e}function i0(e){const t=ci.value;return{activateCell:ct(e.activateCell," |Enter|shift+Enter"),clear:ct(e.clear,"any+Escape"),closeOverlay:ct(e.closeOverlay,"any+Escape"),acceptOverlayDown:ct(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ct(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ct(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ct(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ct(e.delete,t?"Backspace|Delete":"Delete"),downFill:ct(e.downFill,"primary+_68"),scrollToSelectedCell:ct(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ct(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ct(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ct(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ct(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ct(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ct(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ct(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ct(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ct(e.goToFirstCell,"primary+Home"),goToFirstColumn:ct(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ct(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ct(e.goToLastCell,"primary+End"),goToLastColumn:ct(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ct(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ct(e.goToNextPage,"PageDown"),goToPreviousPage:ct(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ct(e.rightFill,"primary+_82"),search:ct(e.search,"primary+f"),selectAll:ct(e.selectAll,"primary+a"),selectColumn:ct(e.selectColumn,"ctrl+ "),selectGrowDown:ct(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ct(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ct(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ct(e.selectGrowUp,"shift+ArrowUp"),selectRow:ct(e.selectRow,"shift+ "),selectToFirstCell:ct(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ct(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ct(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ct(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ct(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ct(e.selectToLastRow,"primary+shift+ArrowDown")}}function xg(e){const t=function(n){const r=d.useRef(n);return $r(n,r.current)||(r.current=n),r.current}(e);return $t.useMemo(()=>{if(t===void 0)return i0(mr);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??mr.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??mr.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??mr.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??mr.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??mr.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??mr.selectToLastCell};return i0({...mr,...n})},[t])}function Cg(e){function t(n,r,o){if(typeof n=="number")return{headerIndex:n,isCollapsed:!1,depth:r,path:o};const i={headerIndex:n.headerIndex,isCollapsed:n.isCollapsed,depth:r,path:o};return n.subGroups!==void 0&&(i.subGroups=n.subGroups.map((l,a)=>t(l,r+1,[...o,a])).sort((l,a)=>l.headerIndex-a.headerIndex)),i}return e.map((n,r)=>t(n,0,[r])).sort((n,r)=>n.headerIndex-r.headerIndex)}function ma(e,t){const n=[];function r(a,s,c=!1){let h=s!==null?s-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(h=a.subGroups[0].headerIndex-a.headerIndex),h--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:c,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:h}),a.subGroups)for(let C=0;C<a.subGroups.length;C++){const y=C<a.subGroups.length-1?a.subGroups[C+1].headerIndex:s;r(a.subGroups[C],y,c||a.isCollapsed)}}const o=Cg(e.groups);for(let a=0;a<o.length;a++){const s=a<o.length-1?o[a+1].headerIndex:null;r(o[a],s)}let i=0,l=0;for(const a of n)a.contentIndex=l,l+=a.rows,a.rowIndex=i,i+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:s,...c}=a;return c})}function va(e,t){if(t===void 0||ma.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(r.isCollapsed)n--;else{if(n<=r.rows)return{path:[...r.path,n-1],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n-1,contentIndex:r.contentIndex+n-1,groupRows:r.rows};n=n-r.rows-1}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function a0(e,t,n){const[r,...o]=t;return o[0]===-1?e.map((i,l)=>l===r?{...i,...n}:i):e.map((i,l)=>l===r?{...i,subGroups:a0(i.subGroups??[],o,n)}:i)}function l0(e,t){const[n,...r]=t;return r[0]===-1?e[n]:l0(e[n].subGroups??[],r)}function Sg(e,t,n,r,o){const[i,l]=d.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-t%n:0],[t,n]),a=d.useMemo(()=>({x:r.current.x,y:i,width:r.current.width??1,height:r.current.height??1,ty:l}),[r,l,i]),[s,c,h]=c1(a),C=d.useRef(o);C.current=o;const y=function(m,E){const[g]=d.useState(()=>({value:m,callback:E,facade:{get current(){return g.value},set current(w){const x=g.value;x!==w&&(g.value=w,g.callback(w,x))}}}));return g.callback=E,g.facade}(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),b=(s.height??1)>1;d.useLayoutEffect(()=>{if(t!==void 0&&y.current!==null&&b){if(y.current.scrollTop===t)return;y.current.scrollTop=t,y.current.scrollTop!==t&&h(),C.current()}},[t,b,h,y]);const p=(s.width??1)>1;return d.useLayoutEffect(()=>{if(e!==void 0&&y.current!==null&&p){if(y.current.scrollLeft===e)return;y.current.scrollLeft=e,y.current.scrollLeft!==e&&h(),C.current()}},[e,p,h,y]),{visibleRegion:s,setVisibleRegion:c,scrollRef:y}}const kg=d.lazy(async()=>await L0(()=>import("./data-grid-overlay-editor-BFMjRfym.js"),__vite__mapDeps([0,1,2,3]),import.meta.url));let Mg=0;function di(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const hi={kind:me.Loading,allowOverlay:!1},fi={columns:yt.empty(),rows:yt.empty(),current:void 0},Rg=d.forwardRef((e,t)=>{var z0,A0,F0;const[n,r]=d.useState(fi),[o,i]=d.useState(),l=d.useRef(null),a=d.useRef(null),[s,c]=d.useState(),h=d.useRef(),C=typeof window>"u"?null:window,{imageEditorOverride:y,getRowThemeOverride:b,markdownDivCreateNode:p,width:m,height:E,columns:g,rows:w,getCellContent:x,onCellClicked:I,onCellActivated:v,onFillPattern:M,onFinishedEditing:S,coercePasteValue:H,drawHeader:f,drawCell:B,editorBloom:D,onHeaderClicked:O,onColumnProposeMove:T,rangeSelectionColumnSpanning:j=!0,spanRangeBehavior:V="default",onGroupHeaderClicked:Z,onCellContextMenu:J,className:ce,onHeaderContextMenu:le,getCellsForSelection:q,onGroupHeaderContextMenu:Q,onGroupHeaderRenamed:fe,onCellEdited:ee,onCellsEdited:se,onSearchResultsChanged:ie,searchResults:W,onSearchValueChange:N,searchValue:U,onKeyDown:ue,onKeyUp:pe,keybindings:ze,editOnType:Ue=!0,onRowAppended:He,onColumnMoved:$e,validateCell:be,highlightRegions:ye,rangeSelect:Fe="rect",columnSelect:Oe="multi",rowSelect:te="multi",rangeSelectionBlending:Ee="exclusive",columnSelectionBlending:ke="exclusive",rowSelectionBlending:Xe="exclusive",onDelete:Re,onDragStart:qe,onMouseMove:Ye,onPaste:ot,copyHeaders:Me=!1,freezeColumns:Pe=0,cellActivationBehavior:ut="second-click",rowSelectionMode:tt="auto",onHeaderMenuClick:pt,onHeaderIndicatorClick:Ft,getGroupDetails:bt,rowGrouping:Ze,onSearchClose:Yt,onItemHovered:nn,onSelectionCleared:Kt,showSearch:qt,onVisibleRegionChanged:un,gridSelection:jt,onGridSelectionChange:Kn,minColumnWidth:vr=50,maxColumnWidth:Dt=500,maxColumnAutoWidth:tr,provideEditor:_n,trailingRowOptions:ne,freezeTrailingRows:xe=0,allowedFillDirections:wt="orthogonal",scrollOffsetX:dt,scrollOffsetY:xt,verticalBorder:ve,onDragOverCell:Ve,onDrop:Ke,onColumnResize:mt,onColumnResizeEnd:it,onColumnResizeStart:at,customRenderers:vt,fillHandle:Je,experimental:lt,fixedShadowX:rt,fixedShadowY:De,headerIcons:Nt,imageWindowLoader:gn,initialSize:Zt,isDraggable:rn,onDragLeave:Bt,onRowMoved:Xt,overscrollX:Sn,overscrollY:Rt,preventDiagonalScrolling:kn,rightElement:pn,rightElementProps:kt,trapFocus:It=!1,smoothScrollX:Vt,smoothScrollY:Et,scaleToRem:Tt=!1,rowHeight:Qe=34,headerHeight:Jt=36,groupHeaderHeight:Mn=Jt,theme:mn,isOutsideClick:wr,renderers:Ro,resizeIndicator:Ca,scrollToActiveCell:Eo=!0,drawFocusRing:Io=!0}=e,zr=Io==="no-editor"?o===void 0:Io,Ot=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,vn=(Ot==null?void 0:Ot.kind)??e.rowMarkers??"none",gi=(Ot==null?void 0:Ot.width)??e.rowMarkerWidth,To=(Ot==null?void 0:Ot.startIndex)??e.rowMarkerStartIndex??1,nr=(Ot==null?void 0:Ot.theme)??e.rowMarkerTheme,rr=Ot==null?void 0:Ot.headerTheme,qr=Ot==null?void 0:Ot.headerAlwaysVisible,or=te!=="multi"||(Ot==null?void 0:Ot.headerDisabled)===!0,yr=(Ot==null?void 0:Ot.checkboxStyle)??"square",ir=Math.max(vr,20),Ar=Math.max(Dt,ir),pi=Math.max(tr??Ar,ir),Ho=d.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Ge,rowNumberMapper:Oo,rowHeight:mi,getRowThemeOverride:jn}=function(u,R,k,P){const A=$t.useMemo(()=>u===void 0?void 0:ma(u,R),[u,R]),G=$t.useMemo(()=>A==null?void 0:A.reduce((F,oe)=>(F[oe.rowIndex]=oe,F),{}),[A]),$=$t.useMemo(()=>A===void 0?R:A.reduce((F,oe)=>F+(oe.isCollapsed?1:oe.rows+1),0),[A,R]),_=$t.useMemo(()=>u===void 0||typeof k=="number"&&u.height===k?k:F=>G!=null&&G[F]?u.height:typeof k=="number"?k:k(F),[G,u,k]),X=$t.useCallback(F=>{if(A===void 0)return F;let oe=F;for(const re of A){if(oe===0)return;if(oe--,!re.isCollapsed){if(oe<re.rows)return re.contentIndex+oe;oe-=re.rows}}return F},[A]),Y=dr(P??(u==null?void 0:u.themeOverride),$t.useCallback(F=>{if(u===void 0)return P==null?void 0:P(F,F,F);if(P===void 0&&(u==null?void 0:u.themeOverride)===void 0)return;const{isGroupHeader:oe,contentIndex:re,groupIndex:ge}=va(F,A);return oe?u.themeOverride:P==null?void 0:P(F,ge,re)},[A,P,u]));return u===void 0?{rowHeight:_,rows:R,rowNumberMapper:X,getRowThemeOverride:Y}:{rowHeight:_,rows:$,rowNumberMapper:X,getRowThemeOverride:Y}}(Ze,w,Qe,b),Sa=d.useMemo(()=>Number.parseFloat(Ho.fontSize),[Ho]),{rowHeight:Vn,headerHeight:Fr,groupHeaderHeight:Po,theme:Lr,overscrollX:Do,overscrollY:zo}=function({rowHeight:u,headerHeight:R,groupHeaderHeight:k,theme:P,overscrollX:A,overscrollY:G,scaleToRem:$,remSize:_}){const[X,Y,F,oe,re,ge]=$t.useMemo(()=>{if(!$||_===16)return[u,R,k,P,A,G];const we=_/16,je=u,Se=iu();return[typeof je=="number"?je*we:Te=>Math.ceil(je(Te)*we),Math.ceil(R*we),Math.ceil(k*we),{...P,headerIconSize:((P==null?void 0:P.headerIconSize)??Se.headerIconSize)*we,cellHorizontalPadding:((P==null?void 0:P.cellHorizontalPadding)??Se.cellHorizontalPadding)*we,cellVerticalPadding:((P==null?void 0:P.cellVerticalPadding)??Se.cellVerticalPadding)*we},Math.ceil((A??0)*we),Math.ceil((G??0)*we)]},[k,R,A,G,_,u,$,P]);return{rowHeight:X,headerHeight:Y,groupHeaderHeight:F,theme:oe,overscrollX:re,overscrollY:ge}}({groupHeaderHeight:Mn,headerHeight:Jt,overscrollX:Sn,overscrollY:Rt,remSize:Sa,rowHeight:mi,scaleToRem:Tt,theme:mn}),Un=xg(ze),Nn=gi??(w>1e4?48:w>1e3?44:w>100?36:32),wn=vn!=="none",K=wn?1:0,Wt=He!==void 0,L=(ne==null?void 0:ne.sticky)===!0,[ae,de]=d.useState(!1),Ce=qt??ae,he=d.useCallback(()=>{Yt!==void 0?Yt():de(!1)},[Yt]),z=d.useMemo(()=>jt===void 0?void 0:di(jt,K),[jt,K])??n,Ie=d.useRef();Ie.current===void 0&&(Ie.current=new AbortController),d.useEffect(()=>()=>Ie==null?void 0:Ie.current.abort(),[]);const[Le,Be]=function(u,R,k,P,A){const G=d.useCallback(X=>{if(u===!0){const Y=[];for(let F=X.y;F<X.y+X.height;F++){const oe=[];for(let re=X.x;re<X.x+X.width;re++)re<0||F>=A?oe.push({kind:me.Loading,allowOverlay:!1}):oe.push(R([re,F]));Y.push(oe)}return Y}return(u==null?void 0:u(X,P.signal))??[]},[P.signal,R,u,A]),$=u!==void 0?G:void 0,_=d.useCallback(X=>{if($===void 0)return[];const Y={...X,x:X.x-k};if(Y.x<0){Y.x=0,Y.width--;const F=$(Y,P.signal);return typeof F=="function"?async()=>(await F()).map(oe=>[{kind:me.Loading,allowOverlay:!1},...oe]):F.map(oe=>[{kind:me.Loading,allowOverlay:!1},...oe])}return $(Y,P.signal)},[P.signal,$,k]);return[u!==void 0?_:void 0,$]}(q,x,K,Ie.current,Ge),Mt=d.useCallback((u,R,k)=>{if(be===void 0)return!0;const P=[u[0]-K,u[1]];return be==null?void 0:be(P,R,k)},[K,be]),Ae=d.useRef(jt),_e=d.useCallback((u,R)=>{R&&(u=function(k,P,A,G,$){var Y;const _=k;if(G==="allowPartial"||k.current===void 0||P===void 0)return k;let X=!1;do{if((k==null?void 0:k.current)===void 0)break;const F=(Y=k.current)==null?void 0:Y.range,oe=[];if(F.width>2){const we=P({x:F.x,y:F.y,width:1,height:F.height},$.signal);if(typeof we=="function")return _;oe.push(...we);const je=P({x:F.x+F.width-1,y:F.y,width:1,height:F.height},$.signal);if(typeof je=="function")return _;oe.push(...je)}else{const we=P({x:F.x,y:F.y,width:F.width,height:F.height},$.signal);if(typeof we=="function")return _;oe.push(...we)}let re=F.x-A,ge=F.x+F.width-1-A;for(const we of oe)for(const je of we)je.span!==void 0&&(re=Math.min(je.span[0],re),ge=Math.max(je.span[1],ge));re===F.x-A&&ge===F.x+F.width-1-A?X=!0:k={current:{cell:k.current.cell??[0,0],range:{x:re+A,y:F.y,width:ge-re+1,height:F.height},rangeStack:k.current.rangeStack},columns:k.columns,rows:k.rows}}while(!X);return k}(u,Le,K,V,Ie.current)),Kn!==void 0?(Ae.current=di(u,-K),Kn(Ae.current)):r(u)},[Kn,Le,K,V]),et=dr(mt,d.useCallback((u,R,k,P)=>{mt==null||mt(g[k-K],R,k-K,P)},[mt,K,g])),dn=dr(it,d.useCallback((u,R,k,P)=>{it==null||it(g[k-K],R,k-K,P)},[it,K,g])),en=dr(at,d.useCallback((u,R,k,P)=>{at==null||at(g[k-K],R,k-K,P)},[at,K,g])),br=dr(f,d.useCallback((u,R)=>(f==null?void 0:f({...u,columnIndex:u.columnIndex-K},R))??!1,[f,K])),ar=dr(B,d.useCallback((u,R)=>(B==null?void 0:B({...u,col:u.col-K},R))??!1,[B,K])),on=d.useCallback(u=>{if(Re!==void 0){const R=Re(di(u,-K));return typeof R=="boolean"?R:di(R,K)}return!0},[Re,K]),[Lt,Ne,ht]=function(u,R,k,P,A,G,$){return[$t.useCallback((_,X,Y,F)=>{var je;G!=="cell"&&G!=="multi-cell"||_===void 0||(_={..._,range:{x:_.cell[0],y:_.cell[1],width:1,height:1}}),!$&&_!==void 0&&_.range.width>1&&(_={..._,range:{..._.range,width:1,x:_.cell[0]}});const oe=k==="mixed"&&(Y||F==="drag"),re=P==="mixed"&&oe,ge=A==="mixed"&&oe;let we={current:_===void 0?void 0:{..._,rangeStack:F==="drag"?((je=u.current)==null?void 0:je.rangeStack)??[]:[]},columns:re?u.columns:yt.empty(),rows:ge?u.rows:yt.empty()};Y&&(G==="multi-rect"||G==="multi-cell")&&we.current!==void 0&&u.current!==void 0&&(we={...we,current:{...we.current,rangeStack:[...u.current.rangeStack,u.current.range]}}),R(we,X)},[P,u,k,G,$,A,R]),$t.useCallback((_,X,Y)=>{let F;if(_=_??u.rows,X!==void 0&&(_=_.add(X)),A==="exclusive"&&_.length>0)F={current:void 0,columns:yt.empty(),rows:_};else{const oe=Y&&P==="mixed";F={current:Y&&k==="mixed"?u.current:void 0,columns:oe?u.columns:yt.empty(),rows:_}}R(F,!1)},[P,u,k,A,R]),$t.useCallback((_,X,Y)=>{let F;if(_=_??u.columns,X!==void 0&&(_=_.add(X)),P==="exclusive"&&_.length>0)F={current:void 0,rows:yt.empty(),columns:_};else{const oe=Y&&A==="mixed";F={current:Y&&k==="mixed"?u.current:void 0,rows:oe?u.rows:yt.empty(),columns:_}}R(F,!1)},[P,u,k,A,R])]}(z,_e,Ee,ke,Xe,Fe,j),gt=d.useMemo(()=>Zn(iu(),Lr),[Lr]),[yn,an]=d.useState([0,0,0]),lr=d.useMemo(()=>{if(Ro===void 0)return{};const u={};for(const R of Ro)u[R.kind]=R;return u},[Ro]),Ht=d.useCallback(u=>u.kind!==me.Custom?lr[u.kind]:vt==null?void 0:vt.find(R=>R.isMatch(u)),[vt,lr]);let{sizedColumns:hn,nonGrowWidth:vi}=function(u,R,k,P,A,G,$,_,X){const Y=d.useRef(R),F=d.useRef(k),oe=d.useRef($);Y.current=R,F.current=k,oe.current=$;const[re,ge]=d.useMemo(()=>{if(typeof window>"u")return[null,null];const We=document.createElement("canvas");return We.style.display="none",We.style.opacity="0",We.style.position="fixed",[We,We.getContext("2d",{alpha:!1})]},[]);d.useLayoutEffect(()=>(re&&document.documentElement.append(re),()=>{re==null||re.remove()}),[re]);const we=d.useRef({}),je=d.useRef(),[Se,Te]=d.useState();return d.useLayoutEffect(()=>{const We=F.current;if(We===void 0||u.every(ei))return;let _t=Math.max(1,10-Math.floor(u.length/1e4)),Ut=0;_t<Y.current&&_t>1&&(_t--,Ut=1);const tn={x:0,y:0,width:u.length,height:Math.min(Y.current,_t)},St={x:0,y:Y.current-1,width:u.length,height:1};(async()=>{const At=We(tn,X.signal),sn=Ut>0?We(St,X.signal):void 0;let xn;xn=typeof At=="object"?At:await Zs(At),sn!==void 0&&(xn=typeof sn=="object"?[...xn,...sn]:[...xn,...await Zs(sn)]),je.current=u,Te(xn)})()},[X.signal,u]),d.useMemo(()=>{let We=u.every(ei)?u:ge===null?u.map(St=>ei(St)?St:{...St,width:150}):(ge.font=oe.current.baseFontFull,u.map((St,At)=>{if(ei(St))return St;if(we.current[St.id]!==void 0)return{...St,width:we.current[St.id]};if(Se===void 0||je.current!==u||St.id===void 0)return{...St,width:150};const sn=au(ge,$,St,At,Se,A,G,!0,_);return we.current[St.id]=sn.width,sn})),_t=0,Ut=0;const tn=[];for(const[St,At]of We.entries())_t+=At.width,At.grow!==void 0&&At.grow>0&&(Ut+=At.grow,tn.push(St));if(_t<P&&tn.length>0){const St=[...We],At=P-_t;let sn=At;for(let xn=0;xn<tn.length;xn++){const cr=tn[xn],Xo=(We[cr].grow??0)/Ut,Aa=xn===tn.length-1?sn:Math.min(sn,Math.floor(At*Xo));St[cr]={...We[cr],growOffset:Aa,width:We[cr].width+Aa},sn-=Aa}We=St}return{sizedColumns:We,nonGrowWidth:_t}},[P,u,ge,Se,$,A,G,_])}(g,Ge,Be,yn[0]-(K===0?0:Nn)-yn[2],ir,pi,gt,Ht,Ie.current);vn!=="none"&&(vi+=Nn);const Jr=d.useMemo(()=>hn.some(u=>u.group!==void 0),[hn]),sr=Jr?Fr+Po:Fr,Ao=z.rows.length,Fo=vn==="none"?void 0:Ao!==0&&(Ao===Ge||void 0),Ct=d.useMemo(()=>vn==="none"?hn:[{title:"",width:Nn,icon:void 0,hasMenu:!1,style:"normal",themeOverride:nr,rowMarker:yr,rowMarkerChecked:Fo,headerRowMarkerTheme:rr,headerRowMarkerAlwaysVisible:qr,headerRowMarkerDisabled:or},...hn],[vn,hn,Nn,nr,yr,Fo,rr,qr,or]),Gt=d.useRef({height:1,width:1,x:0,y:0}),Dn=d.useRef(!1),{setVisibleRegion:Lo,visibleRegion:_r,scrollRef:zt}=Sg(dt,xt,Vn,Gt,()=>Dn.current=!0);Gt.current=_r;const lp=_r.x+K,wi=_r.y,ln=d.useRef(null),bn=d.useCallback(u=>{var R;u===!0?(R=ln.current)==null||R.focus():window.requestAnimationFrame(()=>{var k;(k=ln.current)==null||k.focus()})},[]),fn=Wt?Ge+1:Ge,zn=d.useCallback(u=>{const R=K===0?u:u.map(P=>({...P,location:[P.location[0]-K,P.location[1]]})),k=se==null?void 0:se(R);if(k!==!0)for(const P of R)ee==null||ee(P.location,P.value);return k},[ee,se,K]),[jr,ka]=d.useState(),yi=z.current!==void 0&&z.current.range.width*z.current.range.height>1?z.current.range:void 0,Qr=zr?(z0=z.current)==null?void 0:z0.cell:void 0,bi=Qr==null?void 0:Qr[0],xi=Qr==null?void 0:Qr[1],sp=d.useMemo(()=>{if((ye===void 0||ye.length===0)&&(yi??bi??xi??jr)===void 0)return;const u=[];if(ye!==void 0)for(const R of ye){const k=Ct.length-R.range.x-K;k>0&&u.push({color:R.color,range:{...R.range,x:R.range.x+K,width:Math.min(k,R.range.width)},style:R.style})}return jr!==void 0&&u.push({color:Hr(gt.accentColor,0),range:jr,style:"dashed"}),yi!==void 0&&u.push({color:Hr(gt.accentColor,.5),range:yi,style:"solid-outline"}),bi!==void 0&&xi!==void 0&&u.push({color:gt.accentColor,range:{x:bi,y:xi,width:1,height:1},style:"solid-outline"}),u.length>0?u:void 0},[jr,yi,bi,xi,ye,Ct.length,gt.accentColor,K]),b0=d.useRef(Ct);b0.current=Ct;const Tn=d.useCallback(([u,R],k=!1)=>{var A,G,$,_,X,Y,F;const P=Wt&&R===fn-1;if(u===0&&wn){if(P)return hi;const oe=Oo(R);return oe===void 0?hi:{kind:Hn.Marker,allowOverlay:!1,checkboxStyle:yr,checked:(z==null?void 0:z.rows.hasIndex(R))===!0,markerKind:vn==="clickable-number"?"number":vn,row:To+oe,drawHandle:Xt!==void 0,cursor:vn==="clickable-number"?"pointer":void 0}}if(P){const oe=u===K?(ne==null?void 0:ne.hint)??"":"",re=b0.current[u];if(((A=re==null?void 0:re.trailingRowOptions)==null?void 0:A.disabled)===!0)return hi;{const ge=((G=re==null?void 0:re.trailingRowOptions)==null?void 0:G.hint)??oe,we=(($=re==null?void 0:re.trailingRowOptions)==null?void 0:$.addIcon)??(ne==null?void 0:ne.addIcon);return{kind:Hn.NewRow,hint:ge,allowOverlay:!1,icon:we}}}{const oe=u-K;if(k||(lt==null?void 0:lt.strict)===!0){const ge=Gt.current,we=ge.x>oe||oe>ge.x+ge.width||ge.y>R||R>ge.y+ge.height||R>=Ra.current,je=oe===((X=(_=ge.extras)==null?void 0:_.selected)==null?void 0:X[0])&&R===((Y=ge.extras)==null?void 0:Y.selected[1]);let Se=!1;if(((F=ge.extras)==null?void 0:F.freezeRegions)!==void 0){for(const Te of ge.extras.freezeRegions)if(Dr(Te,oe,R)){Se=!0;break}}if(we&&!je&&!Se)return hi}let re=x([oe,R]);return K!==0&&re.span!==void 0&&(re={...re,span:[re.span[0]+K,re.span[1]+K]}),re}},[Wt,fn,wn,Oo,yr,z==null?void 0:z.rows,vn,To,Xt,K,ne==null?void 0:ne.hint,ne==null?void 0:ne.addIcon,lt==null?void 0:lt.strict,x]),Ma=d.useCallback(u=>{let R=(bt==null?void 0:bt(u))??{name:u};return fe!==void 0&&u!==""&&(R={icon:R.icon,name:R.name,overrideTheme:R.overrideTheme,actions:[...R.actions??[],{title:"Rename",icon:"renameIcon",onClick:k=>Ia({group:R.name,bounds:k.bounds})}]}),R},[bt,fe]),Ci=d.useCallback(u=>{var _;const[R,k]=u.cell,P=Ct[R],A=(P==null?void 0:P.group)!==void 0?(_=Ma(P.group))==null?void 0:_.overrideTheme:void 0,G=P==null?void 0:P.themeOverride,$=jn==null?void 0:jn(k);i({...u,theme:Zn(gt,A,G,$,u.content.themeOverride)})},[jn,Ct,Ma,gt]),Zr=d.useCallback((u,R,k)=>{var $;if(z.current===void 0)return;const[P,A]=z.current.cell,G=Tn([P,A]);if(G.kind!==me.Boolean&&G.allowOverlay){let _=G;if(k!==void 0)switch(_.kind){case me.Number:{const X=function(Y,F){try{return Y()}catch{return F}}(()=>k==="-"?-0:Number.parseFloat(k),0);_={..._,data:Number.isNaN(X)?0:X};break}case me.Text:case me.Markdown:case me.Uri:_={..._,data:k}}Ci({target:u,content:_,initialValue:k,cell:[P,A],highlight:k===void 0,forceEditMode:k!==void 0})}else G.kind===me.Boolean&&R&&G.readonly!==!0&&(zn([{location:z.current.cell,value:{...G,data:r0(G.data)}}]),($=ln.current)==null||$.damage([{cell:z.current.cell}]))},[Tn,z,zn,Ci]),x0=d.useCallback((u,R)=>{var A;const k=(A=ln.current)==null?void 0:A.getBounds(u,R);if(k===void 0||zt.current===null)return;const P=Tn([u,R]);P.allowOverlay&&Ci({target:k,content:P,initialValue:void 0,highlight:!0,cell:[u,R],forceEditMode:!0})},[Tn,zt,Ci]),Qt=d.useCallback((u,R,k="both",P=0,A=0,G=void 0)=>{if(zt.current!==null){const $=ln.current,_=a.current,X=typeof u!="number"?u.unit==="cell"?u.amount:void 0:u,Y=typeof R!="number"?R.unit==="cell"?R.amount:void 0:R,F=typeof u!="number"&&u.unit==="px"?u.amount:void 0,oe=typeof R!="number"&&R.unit==="px"?R.amount:void 0;if($!==null&&_!==null){let re={x:0,y:0,width:0,height:0},ge=0,we=0;if((X!==void 0||Y!==void 0)&&(re=$.getBounds((X??0)+K,Y??0)??re,re.width===0||re.height===0))return;const je=_.getBoundingClientRect(),Se=je.width/_.offsetWidth;if(F!==void 0&&(re={...re,x:F-je.left-zt.current.scrollLeft,width:1}),oe!==void 0&&(re={...re,y:oe+je.top-zt.current.scrollTop,height:1}),re!==void 0){const Te={x:re.x-P,y:re.y-A,width:re.width+2*P,height:re.height+2*A};let We=0;for(let Xo=0;Xo<Pe;Xo++)We+=hn[Xo].width;let _t=0;const Ut=xe+(L?1:0);Ut>0&&(_t=Or(fn,Ut,Vn));let tn=We*Se+je.left+K*Nn*Se,St=je.right,At=je.top+sr*Se,sn=je.bottom-_t*Se;const xn=re.width+2*P;switch(G==null?void 0:G.hAlign){case"start":St=tn+xn;break;case"end":tn=St-xn;break;case"center":tn=Math.floor((tn+St)/2)-xn/2,St=tn+xn}const cr=re.height+2*A;switch(G==null?void 0:G.vAlign){case"start":sn=At+cr;break;case"end":At=sn-cr;break;case"center":At=Math.floor((At+sn)/2)-cr/2,sn=At+cr}tn>Te.x?ge=Te.x-tn:St<Te.x+Te.width&&(ge=Te.x+Te.width-St),At>Te.y?we=Te.y-At:sn<Te.y+Te.height&&(we=Te.y+Te.height-sn),k==="vertical"||typeof u=="number"&&u<Pe?ge=0:(k==="horizontal"||typeof R=="number"&&R>=fn-Ut)&&(we=0),ge===0&&we===0||(Se!==1&&(ge/=Se,we/=Se),zt.current.scrollTo({left:ge+zt.current.scrollLeft,top:we+zt.current.scrollTop,behavior:(G==null?void 0:G.behavior)??"auto"}))}}}},[K,xe,Nn,zt,sr,Pe,hn,fn,L,Vn]),C0=d.useRef(x0),S0=d.useRef(x),Ra=d.useRef(Ge);C0.current=x0,S0.current=x,Ra.current=Ge;const eo=d.useCallback(async(u,R=!0,k)=>{var Y;const P=Ct[u];if(((Y=P==null?void 0:P.trailingRowOptions)==null?void 0:Y.disabled)===!0)return;const A=He==null?void 0:He();let G,$=!0;A!==void 0&&(G=await A,G==="top"&&($=!1),typeof G=="number"&&($=!1));let _=0;const X=()=>{if(Ra.current<=Ge)return _<500&&window.setTimeout(X,_),void(_=50+2*_);const F=typeof G=="number"?G:$?Ge:0;Ii.current(u-K,F,"both",0,0,k?{behavior:k}:void 0),Lt({cell:[u,F],range:{x:u,y:F,width:1,height:1}},!1,!1,"edit");const oe=S0.current([u-K,F]);oe.allowOverlay&&so(oe)&&oe.readonly!==!0&&R&&window.setTimeout(()=>{C0.current(u,F)},0)};X()},[Ct,He,K,Ge,Lt]),Si=d.useCallback(u=>{var k,P;const R=((P=(k=hn[u])==null?void 0:k.trailingRowOptions)==null?void 0:P.targetColumn)??(ne==null?void 0:ne.targetColumn);if(typeof R=="number")return R+(wn?1:0);if(typeof R=="object"){const A=g.indexOf(R);if(A>=0)return A+(wn?1:0)}},[hn,g,wn,ne==null?void 0:ne.targetColumn]),xr=d.useRef(),to=d.useRef(),_o=d.useCallback((u,R)=>{var A;const[k,P]=R;return Zn(gt,(A=Ct[k])==null?void 0:A.themeOverride,jn==null?void 0:jn(P),u.themeOverride)},[jn,Ct,gt]),{mapper:Nr}=function(u,R){const k=$t.useMemo(()=>u===void 0?void 0:ma(u,R),[u,R]);return{getRowGroupingForPath:l0,updateRowGroupingByPath:a0,mapper:$t.useCallback(P=>{if(typeof P=="number")return va(P,k);const A=va(P[1],k);return{...A,originalIndex:[P[0],A.originalIndex]}},[k])}}(Ze,w),Bn=Ze==null?void 0:Ze.navigationBehavior,jo=d.useCallback(u=>{var F,oe,re;const R=ci.value?u.metaKey:u.ctrlKey,k=R&&te==="multi",P=R&&Oe==="multi",[A,G]=u.location,$=z.columns,_=z.rows,[X,Y]=((F=z.current)==null?void 0:F.cell)??[];if(u.kind==="cell"){if(to.current=void 0,Br.current=[A,G],A===0&&wn){if(Wt===!0&&G===Ge||vn==="number"||te==="none")return;const ge=Tn(u.location);if(ge.kind!==Hn.Marker)return;if(Xt!==void 0){const Se=Ht(ge);Rn((Se==null?void 0:Se.kind)===Hn.Marker);const Te=(oe=Se==null?void 0:Se.onClick)==null?void 0:oe.call(Se,{...u,cell:ge,posX:u.localEventX,posY:u.localEventY,bounds:u.bounds,theme:_o(ge,u.location),preventDefault:()=>{}});if(Te===void 0||Te.checked===ge.checked)return}i(void 0),bn();const we=_.hasIndex(G),je=xr.current;if(te==="multi"&&(u.shiftKey||u.isLongTouch===!0)&&je!==void 0&&_.hasIndex(je)){const Se=[Math.min(je,G),Math.max(je,G)+1];k||tt==="multi"?Ne(void 0,Se,!0):Ne(yt.fromSingleSelection(Se),void 0,k)}else te==="multi"&&(k||u.isTouch||tt==="multi")?we?Ne(_.remove(G),void 0,!0):(Ne(void 0,G,!0),xr.current=G):we&&_.length===1?Ne(yt.empty(),void 0,R):(Ne(yt.fromSingleSelection(G),void 0,R),xr.current=G)}else if(A>=K&&Wt&&G===Ge){const ge=Si(A);eo(ge??A)}else if(X!==A||Y!==G){const ge=Tn(u.location),we=Ht(ge);if((we==null?void 0:we.onSelect)!==void 0){let Te=!1;if(we.onSelect({...u,cell:ge,posX:u.localEventX,posY:u.localEventY,bounds:u.bounds,preventDefault:()=>Te=!0,theme:_o(ge,u.location)}),Te)return}if(Bn==="block"&&Nr(G).isGroupHeader)return;const je=L&&G===Ge,Se=L&&z!==void 0&&((re=z.current)==null?void 0:re.cell[1])===Ge;if(!u.shiftKey&&u.isLongTouch!==!0||X===void 0||Y===void 0||z.current===void 0||Se)Lt({cell:[A,G],range:{x:A,y:G,width:1,height:1}},!0,R,"click"),xr.current=void 0,i(void 0),bn();else{if(je)return;const Te=Math.min(A,X),We=Math.max(A,X),_t=Math.min(G,Y),Ut=Math.max(G,Y);Lt({...z.current,range:{x:Te,y:_t,width:We-Te+1,height:Ut-_t+1}},!0,R,"click"),xr.current=void 0,bn()}}}else if(u.kind==="header")if(Br.current=[A,G],i(void 0),wn&&A===0)xr.current=void 0,to.current=void 0,or||te!=="multi"||(_.length!==Ge?Ne(yt.fromSingleSelection([0,Ge]),void 0,R):Ne(yt.empty(),void 0,R),bn());else{const ge=to.current;if(Oe==="multi"&&(u.shiftKey||u.isLongTouch===!0)&&ge!==void 0&&$.hasIndex(ge)){const we=[Math.min(ge,A),Math.max(ge,A)+1];P?ht(void 0,we,R):ht(yt.fromSingleSelection(we),void 0,R)}else P?($.hasIndex(A)?ht($.remove(A),void 0,R):ht(void 0,A,R),to.current=A):Oe!=="none"&&($.hasIndex(A)?ht($.remove(A),void 0,R):ht(yt.fromSingleSelection(A),void 0,R),to.current=A);xr.current=void 0,bn()}else u.kind===Pn?Br.current=[A,G]:u.kind!==ui||u.isMaybeScrollbar||(_e(fi,!1),i(void 0),bn(),Kt==null||Kt(),xr.current=void 0,to.current=void 0)},[te,Oe,z,wn,K,Wt,Ge,vn,Tn,Xt,bn,tt,Ht,_o,Ne,Si,eo,Bn,Nr,L,Lt,ht,_e,Kt]),No=d.useRef(!1),Br=d.useRef(),k0=d.useRef(_r),An=d.useRef(),cp=d.useCallback(u=>{if(no.current=!1,k0.current=Gt.current,u.button!==0&&u.button!==1)return void(An.current=void 0);const R=performance.now();An.current={button:u.button,time:R,location:u.location},(u==null?void 0:u.kind)==="header"&&(No.current=!0);const k=u.kind==="cell"&&u.isFillHandle;!k&&u.kind!=="cell"&&u.isEdge||(c({previousSelection:z,fillHandle:k}),Br.current=void 0,u.isTouch||u.button!==0||k?u.isTouch||u.button!==1||(Br.current=u.location):jo(u))},[z,jo]),[Ea,Ia]=d.useState(),M0=d.useCallback(u=>{if(u.kind!==Pn||Oe!=="multi")return;const R=ci.value?u.metaKey:u.ctrlKey,[k]=u.location,P=z.columns;if(k<K)return;const A=Ct[k];let G=k,$=k;for(let _=k-1;_>=K&&mo(A.group,Ct[_].group);_--)G--;for(let _=k+1;_<Ct.length&&mo(A.group,Ct[_].group);_++)$++;if(bn(),R)if(P.hasAll([G,$+1])){let _=P;for(let X=G;X<=$;X++)_=_.remove(X);ht(_,void 0,R)}else ht(void 0,[G,$+1],R);else ht(yt.fromSingleSelection([G,$+1]),void 0,R)},[Oe,bn,z.columns,Ct,K,ht]),no=d.useRef(!1),ki=d.useCallback(async u=>{if(Le!==void 0&&et!==void 0){const R=Gt.current.y,k=Gt.current.height;let P=Le({x:u,y:R,width:1,height:Math.min(k,Ge-R)},Ie.current.signal);typeof P!="object"&&(P=await P());const A=hn[u-K],G=document.createElement("canvas").getContext("2d",{alpha:!1});if(G!==null){G.font=gt.baseFontFull;const $=au(G,gt,A,0,P,ir,Ar,!1,Ht);et==null||et(A,$.width,u,$.width)}}},[hn,Le,Ar,gt,ir,et,K,Ge,Ht]),[up,Ta]=d.useState(),ro=d.useCallback(async(u,R)=>{var _,X;const k=(_=u.current)==null?void 0:_.range;if(k===void 0||Le===void 0||R.current===void 0)return;const P=R.current.range;if(M!==void 0){let Y=!1;if(M({fillDestination:{...P,x:P.x-K},patternSource:{...k,x:k.x-K},preventDefault:()=>Y=!0}),Y)return}let A=Le(k,Ie.current.signal);typeof A!="object"&&(A=await A());const G=A,$=[];for(let Y=0;Y<P.width;Y++)for(let F=0;F<P.height;F++){const oe=[P.x+Y,P.y+F];if(Yc(oe,k))continue;const re=G[F%k.height][Y%k.width];!kr(re)&&so(re)&&$.push({location:oe,value:{...re}})}zn($),(X=ln.current)==null||X.damage($.map(Y=>({cell:Y.location})))},[Le,zn,M,K]),R0=d.useCallback(()=>{if(z.current===void 0||z.current.range.width<=1)return;const u={...z,current:{...z.current,range:{...z.current.range,width:1}}};ro(u,z)},[ro,z]),E0=d.useCallback(()=>{if(z.current===void 0||z.current.range.height<=1)return;const u={...z,current:{...z.current,range:{...z.current.range,height:1}}};ro(u,z)},[ro,z]),dp=d.useCallback((u,R)=>{var F,oe;const k=s;if(c(void 0),ka(void 0),Ta(void 0),No.current=!1,R)return;if((k==null?void 0:k.fillHandle)===!0&&z.current!==void 0&&((F=k.previousSelection)==null?void 0:F.current)!==void 0){if(jr===void 0)return;const re={...z,current:{...z.current,range:md(k.previousSelection.current.range,jr)}};return ro(k.previousSelection,re),void _e(re,!0)}const[P,A]=u.location,[G,$]=Br.current??[],_=()=>{no.current=!0},X=re=>{var we,je,Se;const ge=re.isTouch||G===P&&$===A;if(ge&&(I==null||I([P-K,A],{...re,preventDefault:_})),re.button===1)return!no.current;if(!no.current){const Te=Tn(u.location),We=Ht(Te);if(We!==void 0&&We.onClick!==void 0&&ge){const Ut=We.onClick({...re,cell:Te,posX:re.localEventX,posY:re.localEventY,bounds:re.bounds,theme:_o(Te,u.location),preventDefault:_});Ut!==void 0&&!kr(Ut)&&Mr(Ut)&&(zn([{location:re.location,value:Ut}]),(we=ln.current)==null||we.damage([{cell:re.location}]))}if(no.current||z.current===void 0)return!1;let _t=!1;switch(Te.activationBehaviorOverride??ut){case"double-click":case"second-click":{if(((Se=(je=k==null?void 0:k.previousSelection)==null?void 0:je.current)==null?void 0:Se.cell)===void 0)break;const[Ut,tn]=z.current.cell,[St,At]=k.previousSelection.current.cell;_t=P===Ut&&P===St&&A===tn&&A===At&&(re.isDoubleClick===!0||ut==="second-click");break}case"single-click":_t=!0}if(_t)return v==null||v([P-K,A]),Zr(re.bounds,!1),!0}return!1},Y=u.location[0]-K;if(u.isTouch){const re=Gt.current,ge=k0.current;if(re.x!==ge.x||re.y!==ge.y)return;if(u.isLongTouch===!0){if(u.kind==="cell"&&vo((oe=z.current)==null?void 0:oe.cell,u.location))return void(J==null?void 0:J([Y,u.location[1]],{...u,preventDefault:_}));if(u.kind==="header"&&z.columns.hasIndex(P))return void(le==null?void 0:le(Y,{...u,preventDefault:_}));if(u.kind===Pn)return Y<0?void 0:void(Q==null?void 0:Q(Y,{...u,preventDefault:_}))}return void(u.kind==="cell"?X(u)||jo(u):u.kind===Pn?Z==null?void 0:Z(Y,{...u,preventDefault:_}):(u.kind===pr&&(O==null||O(Y,{...u,preventDefault:_})),jo(u)))}if(u.kind==="header"){if(Y<0)return;u.isEdge?u.isDoubleClick===!0&&ki(P):u.button===0&&P===G&&A===$&&(O==null||O(Y,{...u,preventDefault:_}))}if(u.kind===Pn){if(Y<0)return;u.button===0&&P===G&&A===$&&(Z==null||Z(Y,{...u,preventDefault:_}),no.current||M0(u))}u.kind!=="cell"||u.button!==0&&u.button!==1||X(u),Br.current=void 0},[s,z,K,jr,ro,_e,I,Tn,Ht,ut,_o,zn,v,Zr,J,le,Q,jo,Z,O,ki,M0]),hp=d.useCallback(u=>{const R={...u,location:[u.location[0]-K,u.location[1]]};Ye==null||Ye(R),s!==void 0&&u.buttons===0&&(c(void 0),ka(void 0),Ta(void 0),No.current=!1),Ta(k=>{var P;return No.current?[u.scrollEdge[0],0]:u.scrollEdge[0]===(k==null?void 0:k[0])&&u.scrollEdge[1]===k[1]?k:s===void 0||(((P=An.current)==null?void 0:P.location[0])??0)<K?void 0:u.scrollEdge})},[s,Ye,K]),fp=d.useCallback((u,R)=>{pt==null||pt(u-K,R)},[pt,K]),gp=d.useCallback((u,R)=>{Ft==null||Ft(u-K,R)},[Ft,K]),qn=(A0=z==null?void 0:z.current)==null?void 0:A0.cell,pp=d.useCallback((u,R,k,P,A,G)=>{Dn.current=!1;let $=qn;$!==void 0&&($=[$[0]-K,$[1]]);const _=Pe===0?void 0:{x:0,y:u.y,width:Pe,height:u.height},X=[];_!==void 0&&X.push(_),xe>0&&(X.push({x:u.x-K,y:Ge-xe,width:u.width,height:xe}),Pe>0&&X.push({x:0,y:Ge-xe,width:Pe,height:xe}));const Y={x:u.x-K,y:u.y,width:u.width,height:Wt&&u.y+u.height>=Ge?u.height-1:u.height,tx:A,ty:G,extras:{selected:$,freezeRegion:_,freezeRegions:X}};Gt.current=Y,Lo(Y),an([R,k,P]),un==null||un(Y,Y.tx,Y.ty,Y.extras)},[qn,K,Wt,Ge,Pe,xe,Lo,un]),mp=dr(T,d.useCallback((u,R)=>(T==null?void 0:T(u-K,R-K))!==!1,[T,K])),vp=dr($e,d.useCallback((u,R)=>{$e==null||$e(u-K,R-K),Oe!=="none"&&ht(yt.fromSingleSelection(R),void 0,!0)},[Oe,$e,K,ht])),Ha=d.useRef(!1),wp=d.useCallback(u=>{u.location[0]===0&&K>0?u.preventDefault():(qe==null||qe({...u,location:[u.location[0]-K,u.location[1]]}),u.defaultPrevented()||(Ha.current=!0),c(void 0))},[qe,K]),yp=d.useCallback(()=>{Ha.current=!1},[]),I0=Ze==null?void 0:Ze.selectionBehavior,Mi=d.useCallback(u=>{if(I0!=="block-spanning")return;const{isGroupHeader:R,path:k,groupRows:P}=Nr(u);if(R)return[u,u];const A=k[k.length-1];return[u-A,u+P-A-1]},[Nr,I0]),Oa=d.useRef(),Pa=d.useCallback(u=>{var R,k,P;if(!(qf(u,Oa.current)||(Oa.current=u,((R=An==null?void 0:An.current)==null?void 0:R.button)!==void 0&&An.current.button>=1))){if(u.buttons!==0&&s!==void 0&&((k=An.current)==null?void 0:k.location[0])===0&&u.location[0]===0&&K===1&&te==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(An.current.location[1])&&z.rows.hasIndex(An.current.location[1])){const A=Math.min(An.current.location[1],u.location[1]),G=Math.max(An.current.location[1],u.location[1])+1;Ne(yt.fromSingleSelection([A,G]),void 0,!1)}if(!(u.buttons===0||s===void 0||z.current===void 0||Ha.current||No.current||Fe!=="rect"&&Fe!=="multi-rect")){const[A,G]=z.current.cell;let[$,_]=u.location;if(_<0&&(_=Gt.current.y),s.fillHandle===!0&&((P=s.previousSelection)==null?void 0:P.current)!==void 0){const X=s.previousSelection.current.range;_=Math.min(_,Wt?Ge-1:Ge);const Y=function(F,oe,re,ge){if(ge==="any")return md(F,{x:oe,y:re,width:1,height:1});if(ge==="vertical"&&(oe=F.x),ge==="horizontal"&&(re=F.y),Yc([oe,re],F))return;const we=oe-F.x,je=F.x+F.width-oe,Se=re-F.y+1,Te=F.y+F.height-re,We=Math.min(ge==="vertical"?Number.MAX_SAFE_INTEGER:we,ge==="vertical"?Number.MAX_SAFE_INTEGER:je,ge==="horizontal"?Number.MAX_SAFE_INTEGER:Se,ge==="horizontal"?Number.MAX_SAFE_INTEGER:Te);return We===Te?{x:F.x,y:F.y+F.height,width:F.width,height:re-F.y-F.height+1}:We===Se?{x:F.x,y:re,width:F.width,height:F.y-re}:We===je?{x:F.x+F.width,y:F.y,width:oe-F.x-F.width+1,height:F.height}:{x:oe,y:F.y,width:F.x-oe,height:F.height}}(X,$,_,wt);ka(Y)}else{if(Wt&&G===Ge)return;if(Wt&&_===Ge){if(u.kind!==ui)return;_--}$=Math.max($,K);const X=Mi(G);_=X===void 0?_:On(_,X[0],X[1]);const Y=$-A,F=_-G,oe={x:Y>=0?A:$,y:F>=0?G:_,width:Math.abs(Y)+1,height:Math.abs(F)+1};Lt({...z.current,range:oe},!0,!1,"drag")}}nn==null||nn({...u,location:[u.location[0]-K,u.location[1]]})}},[s,K,te,z,Fe,nn,Ne,Wt,Ge,wt,Mi,Lt]),bp=d.useCallback(()=>{var $,_;const u=Oa.current;if(u===void 0)return;const[R,k]=u.scrollEdge;let[P,A]=u.location;const G=Gt.current;R===-1?P=((_=($=G.extras)==null?void 0:$.freezeRegion)==null?void 0:_.x)??G.x:R===1&&(P=G.x+G.width),k===-1?A=Math.max(0,G.y):k===1&&(A=Math.min(Ge-1,G.y+G.height)),P=On(P,0,Ct.length-1),A=On(A,0,Ge-1),Pa({...u,location:[P,A]})},[Ct.length,Pa,Ge]);(function(u,R,k){const P=$t.useRef(0),[A,G]=u??[0,0];$t.useEffect(()=>{if(A===0&&G===0)return void(P.current=0);let $=!1,_=0;const X=Y=>{var F;if(!$){if(_===0)_=Y;else{const oe=Y-_;P.current=Math.min(1,P.current+oe/1300);const re=P.current**1.618*oe*2;(F=R.current)==null||F.scrollBy(A*re,G*re),_=Y,k==null||k()}window.requestAnimationFrame(X)}};return window.requestAnimationFrame(X),()=>{$=!0}},[R,A,G,k])})(up,zt,bp);const Wn=d.useCallback(u=>{if(z.current===void 0)return;const[R,k]=u,[P,A]=z.current.cell,G=z.current.range;let $=G.x,_=G.x+G.width,X=G.y,Y=G.y+G.height;const[F,oe]=Mi(A)??[0,Ge-1],re=oe+1;if(k!==0)switch(k){case 2:Y=re,X=A,Qt(0,Y,"vertical");break;case-2:X=F,Y=A+1,Qt(0,X,"vertical");break;case 1:X<A?(X++,Qt(0,X,"vertical")):(Y=Math.min(re,Y+1),Qt(0,Y,"vertical"));break;case-1:Y>A+1?(Y--,Qt(0,Y,"vertical")):(X=Math.max(F,X-1),Qt(0,X,"vertical"));break;default:lo()}if(R!==0)if(R===2)_=Ct.length,$=P,Qt(_-1-K,0,"horizontal");else if(R===-2)$=K,_=P+1,Qt($-K,0,"horizontal");else{let ge=[];if(Le!==void 0){const we=Le({x:$,y:X,width:_-$-K,height:Y-X},Ie.current.signal);typeof we=="object"&&(ge=function(je){return S1(Zu(Zu(je).filter(Se=>Se.span!==void 0).map(Se=>{var Te,We;return Pr((((Te=Se.span)==null?void 0:Te[0])??0)+1,(((We=Se.span)==null?void 0:We[1])??0)+1)})))}(we))}if(R===1){let we=!1;if($<P){if(ge.length>0){const je=Pr($+1,P+1).find(Se=>!ge.includes(Se-K));je!==void 0&&($=je,we=!0)}else $++,we=!0;we&&Qt($,0,"horizontal")}we||(_=Math.min(Ct.length,_+1),Qt(_-1-K,0,"horizontal"))}else if(R===-1){let we=!1;if(_>P+1){if(ge.length>0){const je=Pr(_-1,P,-1).find(Se=>!ge.includes(Se-K));je!==void 0&&(_=je,we=!0)}else _--,we=!0;we&&Qt(_-K,0,"horizontal")}we||($=Math.max(K,$-1),Qt($-K,0,"horizontal"))}else lo()}Lt({cell:z.current.cell,range:{x:$,y:X,width:_-$,height:Y-X}},!0,!1,"keyboard-select")},[Le,Mi,z,Ct.length,K,Ge,Qt,Lt]),Da=d.useRef(Eo);Da.current=Eo;const Cr=d.useCallback((u,R,k,P)=>{const A=fn-(k?0:1);u=On(u,K,hn.length-1+K),R=On(R,0,A);const G=qn==null?void 0:qn[0],$=qn==null?void 0:qn[1];if(u===G&&R===$)return!1;if(P&&z.current!==void 0){const _=[...z.current.rangeStack];(z.current.range.width>1||z.current.range.height>1)&&_.push(z.current.range),_e({...z,current:{cell:[u,R],range:{x:u,y:R,width:1,height:1},rangeStack:_}},!0)}else Lt({cell:[u,R],range:{x:u,y:R,width:1,height:1}},!0,!1,"keyboard-nav");return h.current!==void 0&&h.current[0]===u&&h.current[1]===R&&(h.current=void 0),Da.current&&Qt(u-K,R),!0},[fn,K,hn.length,qn,z,Qt,_e,Lt]),xp=d.useCallback((u,R)=>{(o==null?void 0:o.cell)!==void 0&&u!==void 0&&Mr(u)&&(zn([{location:o.cell,value:u}]),window.requestAnimationFrame(()=>{var A;(A=ln.current)==null||A.damage([{cell:o.cell}])})),bn(!0),i(void 0);const[k,P]=R;if(z.current!==void 0&&(k!==0||P!==0)){const A=z.current.cell[1]===fn-1&&u!==void 0;Cr(On(z.current.cell[0]+k,0,Ct.length-1),On(z.current.cell[1]+P,0,fn-1),A,!1)}S==null||S(u,R)},[o==null?void 0:o.cell,bn,z,S,zn,fn,Cr,Ct.length]),Cp=d.useMemo(()=>"gdg-overlay-"+Mg++,[]),Wr=d.useCallback(u=>{var k,P,A,G;bn();const R=[];for(let $=u.x;$<u.x+u.width;$++)for(let _=u.y;_<u.y+u.height;_++){const X=x([$-K,_]);if(!X.allowOverlay&&X.kind!==me.Boolean)continue;let Y;if(X.kind===me.Custom){const F=Ht(X),oe=(k=F==null?void 0:F.provideEditor)==null?void 0:k.call(F,{...X,location:[$-K,_]});(F==null?void 0:F.onDelete)!==void 0?Y=F.onDelete(X):$a(oe)&&(Y=(P=oe==null?void 0:oe.deletedValue)==null?void 0:P.call(oe,X))}else if(Mr(X)&&X.allowOverlay||X.kind===me.Boolean){const F=Ht(X);Y=(A=F==null?void 0:F.onDelete)==null?void 0:A.call(F,X)}Y!==void 0&&!kr(Y)&&Mr(Y)&&R.push({location:[$,_],value:Y})}zn(R),(G=ln.current)==null||G.damage(R.map($=>({cell:$.location})))},[bn,x,Ht,zn,K]),Bo=o!==void 0,T0=d.useCallback(u=>{var we,je;const R=()=>{u.stopPropagation(),u.preventDefault()},k={didMatch:!1},{bounds:P}=u,A=z.columns,G=z.rows,$=Un;if(!Bo&&st($.clear,u,k))_e(fi,!1),Kt==null||Kt();else if(!Bo&&st($.selectAll,u,k))_e({columns:yt.empty(),rows:yt.empty(),current:{cell:((we=z.current)==null?void 0:we.cell)??[K,0],range:{x:K,y:0,width:g.length,height:Ge},rangeStack:[]}},!1);else if(st($.search,u,k))(je=l==null?void 0:l.current)==null||je.focus({preventScroll:!0}),de(!0);else if(st($.delete,u,k)){const Se=(on==null?void 0:on(z))??!0;if(Se!==!1){const Te=Se===!0?z:Se;if(Te.current!==void 0){Wr(Te.current.range);for(const We of Te.current.rangeStack)Wr(We)}for(const We of Te.rows)Wr({x:K,y:We,width:g.length,height:1});for(const We of Te.columns)Wr({x:We,y:0,width:1,height:Ge})}}if(k.didMatch)return R(),!0;if(z.current===void 0)return!1;let[_,X]=z.current.cell;const[,Y]=z.current.cell;let F=!1,oe=!1;if(st($.scrollToSelectedCell,u,k)?Ii.current(_-K,X):Oe!=="none"&&st($.selectColumn,u,k)?A.hasIndex(_)?ht(A.remove(_),void 0,!0):Oe==="single"?ht(yt.fromSingleSelection(_),void 0,!0):ht(void 0,_,!0):te!=="none"&&st($.selectRow,u,k)?G.hasIndex(X)?Ne(G.remove(X),void 0,!0):te==="single"?Ne(yt.fromSingleSelection(X),void 0,!0):Ne(void 0,X,!0):!Bo&&P!==void 0&&st($.activateCell,u,k)?X===Ge&&Wt?window.setTimeout(()=>{const Se=Si(_);eo(Se??_)},0):(v==null||v([_-K,X]),Zr(P,!0)):z.current.range.height>1&&st($.downFill,u,k)?E0():z.current.range.width>1&&st($.rightFill,u,k)?R0():st($.goToNextPage,u,k)?X+=Math.max(1,Gt.current.height-4):st($.goToPreviousPage,u,k)?X-=Math.max(1,Gt.current.height-4):st($.goToFirstCell,u,k)?(i(void 0),X=0,_=0):st($.goToLastCell,u,k)?(i(void 0),X=Number.MAX_SAFE_INTEGER,_=Number.MAX_SAFE_INTEGER):st($.selectToFirstCell,u,k)?(i(void 0),Wn([-2,-2])):st($.selectToLastCell,u,k)?(i(void 0),Wn([2,2])):Bo?(st($.closeOverlay,u,k)&&i(void 0),st($.acceptOverlayDown,u,k)&&(i(void 0),X++),st($.acceptOverlayUp,u,k)&&(i(void 0),X--),st($.acceptOverlayLeft,u,k)&&(i(void 0),_--),st($.acceptOverlayRight,u,k)&&(i(void 0),_++)):(st($.goDownCell,u,k)?X+=1:st($.goUpCell,u,k)?X-=1:st($.goRightCell,u,k)?_+=1:st($.goLeftCell,u,k)?_-=1:st($.goDownCellRetainSelection,u,k)?(X+=1,F=!0):st($.goUpCellRetainSelection,u,k)?(X-=1,F=!0):st($.goRightCellRetainSelection,u,k)?(_+=1,F=!0):st($.goLeftCellRetainSelection,u,k)?(_-=1,F=!0):st($.goToLastRow,u,k)?X=Ge-1:st($.goToFirstRow,u,k)?X=Number.MIN_SAFE_INTEGER:st($.goToLastColumn,u,k)?_=Number.MAX_SAFE_INTEGER:st($.goToFirstColumn,u,k)?_=Number.MIN_SAFE_INTEGER:Fe!=="rect"&&Fe!=="multi-rect"||(st($.selectGrowDown,u,k)?Wn([0,1]):st($.selectGrowUp,u,k)?Wn([0,-1]):st($.selectGrowRight,u,k)?Wn([1,0]):st($.selectGrowLeft,u,k)?Wn([-1,0]):st($.selectToLastRow,u,k)?Wn([0,2]):st($.selectToFirstRow,u,k)?Wn([0,-2]):st($.selectToLastColumn,u,k)?Wn([2,0]):st($.selectToFirstColumn,u,k)&&Wn([-2,0])),oe=k.didMatch),Bn!==void 0&&Bn!=="normal"&&X!==Y){const Se=Bn==="skip-down"||Bn==="skip"||Bn==="block",Te=X<Y;if(Te&&(Bn==="skip-up"||Bn==="skip"||Bn==="block")){for(;X>=0&&Nr(X).isGroupHeader;)X--;X<0&&(X=Y)}else if(!Te&&Se){for(;X<Ge&&Nr(X).isGroupHeader;)X++;X>=Ge&&(X=Y)}}const re=Cr(_,X,!1,F),ge=k.didMatch;return ge&&(re||!oe||It)&&R(),ge},[Bn,Bo,z,Un,Oe,te,Fe,K,Nr,Ge,Cr,_e,Kt,g.length,on,It,Wr,ht,Ne,Wt,Si,eo,v,Zr,E0,R0,Wn]),Wo=d.useCallback(u=>{let R=!1;if(ue!==void 0&&ue({...u,...u.location&&{location:[u.location[0]-K,u.location[1]]},cancel:()=>{R=!0}}),R||T0(u)||z.current===void 0)return;const[k,P]=z.current.cell,A=Gt.current;if(Ue&&!u.metaKey&&!u.ctrlKey&&z.current!==void 0&&u.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(u.key)&&u.bounds!==void 0&&so(x([k-K,Math.max(0,Math.min(P,Ge-1))]))){if((!Wt||P!==Ge)&&(A.y>P||P>A.y+A.height||A.x>k||k>A.x+A.width))return;v==null||v([k-K,P]),Zr(u.bounds,!0,u.key),u.stopPropagation(),u.preventDefault()}},[Ue,ue,T0,z,x,K,Ge,Wt,v,Zr]),Sp=d.useCallback((u,R)=>{const k=u.location[0]-K;if(u.kind==="header"&&(le==null||le(k,{...u,preventDefault:R})),u.kind===Pn){if(k<0)return;Q==null||Q(k,{...u,preventDefault:R})}if(u.kind==="cell"){const[P,A]=u.location;J==null||J([k,A],{...u,preventDefault:R}),function(G,$){const[_,X]=$;if(G.columns.hasIndex(_)||G.rows.hasIndex(X))return!0;if(G.current!==void 0){if(vo(G.current.cell,$))return!0;const Y=[G.current.range,...G.current.rangeStack];for(const F of Y)if(_>=F.x&&_<F.x+F.width&&X>=F.y&&X<F.y+F.height)return!0}return!1}(z,u.location)||Cr(P,A,!1,!1)}},[z,J,Q,le,K,Cr]),za=d.useCallback(async u=>{var $,_,X;if(!Un.paste)return;function R(Y,F,oe,re){var we,je;const ge=typeof oe=="object"?(oe==null?void 0:oe.join(`
128
128
  `))??"":(oe==null?void 0:oe.toString())??"";if(!kr(Y)&&so(Y)&&Y.readonly!==!0){const Se=H==null?void 0:H(ge,Y);if(Se!==void 0&&Mr(Se))return{location:F,value:Se};const Te=Ht(Y);if(Te===void 0)return;if(Te.kind===me.Custom){Rn(Y.kind===me.Custom);const We=(we=Te.onPaste)==null?void 0:we.call(Te,ge,Y.data);return We===void 0?void 0:{location:F,value:{...Y,data:We}}}{const We=(je=Te.onPaste)==null?void 0:je.call(Te,ge,Y,{formatted:re,formattedString:typeof re=="string"?re:re==null?void 0:re.join(`
129
- `),rawValue:oe});return We===void 0?void 0:(Rn(We.kind===Y.kind),{location:F,value:We})}}}const k=z.columns,P=z.rows,A=(($=zt.current)==null?void 0:$.contains(document.activeElement))===!0||((_=a.current)==null?void 0:_.contains(document.activeElement))===!0;let G;if(z.current!==void 0?G=[z.current.range.x,z.current.range.y]:k.length===1?G=[k.first()??0,0]:P.length===1&&(G=[K,P.first()??0]),A&&G!==void 0){let Y,F;const oe="text/plain",re="text/html";if(navigator.clipboard.read!==void 0){const Se=await navigator.clipboard.read();for(const Te of Se){if(Te.types.includes(re)){const We=await Te.getType(re),_t=e0(await We.text());if(_t!==void 0){Y=_t;break}}Te.types.includes(oe)&&(F=await(await Te.getType(oe)).text())}}else if(navigator.clipboard.readText!==void 0)F=await navigator.clipboard.readText();else{if(u===void 0||(u==null?void 0:u.clipboardData)===null)return;u.clipboardData.types.includes(re)&&(Y=e0(u.clipboardData.getData(re))),Y===void 0&&u.clipboardData.types.includes(oe)&&(F=u.clipboardData.getData(oe))}const[ge,we]=G,je=[];do{if(ot===void 0){const Se=R(Tn(G),G,F??(Y==null?void 0:Y.map(Te=>Te.map(We=>We.rawValue).join(" ")).join(" "))??"",void 0);Se!==void 0&&je.push(Se);break}if(Y===void 0){if(F===void 0)return;Y=wg(F)}if(ot===!1||typeof ot=="function"&&(ot==null?void 0:ot([G[0]-K,G[1]],Y.map(Se=>Se.map(Te=>{var We;return((We=Te.rawValue)==null?void 0:We.toString())??""}))))!==!0)return;for(const[Se,Te]of Y.entries()){if(Se+we>=Ge)break;for(const[We,_t]of Te.entries()){const Ut=[We+ge,Se+we],[tn,St]=Ut;if(tn>=Ct.length||St>=fn)continue;const At=R(Tn(Ut),Ut,_t.rawValue,_t.formatted);At!==void 0&&je.push(At)}}}while(!1);zn(je),(X=ln.current)==null||X.damage(je.map(Se=>({cell:Se.location})))}},[H,Ht,Tn,z,Un.paste,zt,Ct.length,zn,fn,ot,K,Ge]);cn("paste",za,C,!1,!0);const $o=d.useCallback(async(u,R)=>{var $,_;if(!Un.copy)return;const k=R===!0||(($=zt.current)==null?void 0:$.contains(document.activeElement))===!0||((_=a.current)==null?void 0:_.contains(document.activeElement))===!0,P=z.columns,A=z.rows,G=(X,Y)=>{n0(Me?[Y.map(F=>({kind:me.Text,data:g[F].title,displayData:g[F].title,allowOverlay:!1})),...X]:X,Y,u)};if(k&&Le!==void 0){if(z.current!==void 0){let X=Le(z.current.range,Ie.current.signal);typeof X!="object"&&(X=await X()),G(X,Pr(z.current.range.x-K,z.current.range.x+z.current.range.width-K))}else if(A!==void 0&&A.length>0){const X=[...A].map(Y=>{const F=Le({x:K,y:Y,width:g.length,height:1},Ie.current.signal);return typeof F=="object"?F[0]:F().then(oe=>oe[0])});X.some(Y=>Y instanceof Promise)?G(await Promise.all(X),Pr(g.length)):G(X,Pr(g.length))}else if(P.length>0){const X=[],Y=[];for(const F of P){let oe=Le({x:F,y:0,width:1,height:Ge},Ie.current.signal);typeof oe!="object"&&(oe=await oe()),X.push(oe),Y.push(F-K)}X.length===1?G(X[0],Y):G(X.reduce((F,oe)=>F.map((re,ge)=>[...re,...oe[ge]])),Y)}}},[g,Le,z,Un.copy,K,zt,Ge,Me]);cn("copy",$o,C,!1,!1),cn("cut",d.useCallback(async u=>{var R,k;if(Un.cut&&(((R=zt.current)==null?void 0:R.contains(document.activeElement))===!0||((k=a.current)==null?void 0:k.contains(document.activeElement))===!0)&&(await $o(u),z.current!==void 0)){let P={current:{cell:z.current.cell,range:z.current.range,rangeStack:[]},rows:yt.empty(),columns:yt.empty()};const A=on==null?void 0:on(P);if(A===!1||(P=A===!0?P:A,P.current===void 0))return;Wr(P.current.range)}},[Wr,z,Un.cut,$o,zt,on]),C,!1,!1);const kp=d.useCallback((u,R)=>{if(ie!==void 0)return K!==0&&(u=u.map(A=>[A[0]-K,A[1]])),void ie(u,R);if(u.length===0||R===-1)return;const[k,P]=u[R];h.current!==void 0&&h.current[0]===k&&h.current[1]===P||(h.current=[k,P],Cr(k,P,!1,!1))},[ie,K,Cr]),[Ri,Ei]=((F0=jt==null?void 0:jt.current)==null?void 0:F0.cell)??[],Ii=d.useRef(Jt);Ii.current=Jt,d.useLayoutEffect(()=>{var u,R,k,P;!Da.current||Dn.current||Ri===void 0||Ei===void 0||Ri===((R=(u=Ae.current)==null?void 0:u.current)==null?void 0:R.cell[0])&&Ei===((P=(k=Ae.current)==null?void 0:k.current)==null?void 0:P.cell[1])||Ii.current(Ri,Ei),Dn.current=!1},[Ri,Ei]);const H0=z.current!==void 0&&(z.current.cell[0]>=Ct.length||z.current.cell[1]>=fn);d.useLayoutEffect(()=>{H0&&_e(fi,!1)},[H0,_e]);const Mp=d.useMemo(()=>Wt===!0&&(ne==null?void 0:ne.tint)===!0?yt.fromSingleSelection(fn-1):yt.empty(),[fn,Wt,ne==null?void 0:ne.tint]),Rp=d.useCallback(u=>typeof ve=="boolean"?ve:(ve==null?void 0:ve(u-K))??!0,[K,ve]),Ep=d.useMemo(()=>{if(Ea===void 0||a.current===null)return null;const{bounds:u,group:R}=Ea,k=a.current.getBoundingClientRect();return d.createElement(gg,{bounds:u,group:R,canvasBounds:k,onClose:()=>Ia(void 0),onFinish:P=>{Ia(void 0),fe==null||fe(R,P)}})},[fe,Ea]),Ip=Math.min(Ct.length,Pe+(wn?1:0));d.useImperativeHandle(t,()=>({appendRow:(u,R)=>eo(u+K,R),updateCells:u=>{var R;return K!==0&&(u=u.map(k=>({cell:[k.cell[0]+K,k.cell[1]]}))),(R=ln.current)==null?void 0:R.damage(u)},getBounds:(u,R)=>{var k;if((a==null?void 0:a.current)!==null&&(zt==null?void 0:zt.current)!==null){if(u===void 0&&R===void 0){const P=a.current.getBoundingClientRect(),A=P.width/zt.current.clientWidth;return{x:P.x-zt.current.scrollLeft*A,y:P.y-zt.current.scrollTop*A,width:zt.current.scrollWidth*A,height:zt.current.scrollHeight*A}}return(k=ln.current)==null?void 0:k.getBounds((u??0)+K,R)}},focus:()=>{var u;return(u=ln.current)==null?void 0:u.focus()},emit:async u=>{switch(u){case"delete":Wo({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!1,key:"Delete",keyCode:46,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-right":Wo({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"r",keyCode:82,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-down":Wo({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"d",keyCode:68,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"copy":await $o(void 0,!0);break;case"paste":await za()}},scrollTo:Jt,remeasureColumns:u=>{for(const R of u)ki(R+K)},getMouseArgsForPosition:(u,R,k)=>{if((ln==null?void 0:ln.current)===null)return;const P=ln.current.getMouseArgsForPosition(u,R,k);return P!==void 0?{...P,location:[P.location[0]-K,P.location[1]]}:void 0}}),[eo,ki,zt,$o,Wo,za,K,Jt]);const[O0,P0]=qn??[],Tp=d.useCallback(u=>{const[R,k]=u;k!==-1?O0===R&&P0===k||(Lt({cell:u,range:{x:R,y:k,width:1,height:1}},!0,!1,"keyboard-nav"),Jt(R,k)):Oe!=="none"&&(ht(yt.fromSingleSelection(R),void 0,!1),bn())},[Oe,bn,Jt,O0,P0,Lt,ht]),[Hp,Op]=d.useState(!1),D0=d.useRef(Fc(u=>{Op(u)},5)),Pp=d.useCallback(()=>{D0.current(!0),z.current===void 0&&z.columns.length===0&&z.rows.length===0&&s===void 0&&Lt({cell:[K,wi],range:{x:K,y:wi,width:1,height:1}},!0,!1,"keyboard-select")},[wi,z,s,K,Lt]),Dp=d.useCallback(()=>{D0.current(!1)},[]),[zp,Ap]=d.useMemo(()=>{let u;const R=(lt==null?void 0:lt.scrollbarWidthOverride)??Ki(),k=Ge+(Wt?1:0);if(typeof Vn=="number")u=sr+k*Vn;else{let A=0;const G=Math.min(k,10);for(let $=0;$<G;$++)A+=Vn($);A=Math.floor(A/G),u=sr+k*A}u+=R;const P=Ct.reduce((A,G)=>G.width+A,0)+R;return[`${Math.min(1e5,P)}px`,`${Math.min(1e5,u)}px`]},[Ct,lt==null?void 0:lt.scrollbarWidthOverride,Vn,Ge,Wt,sr]),Fp=d.useMemo(()=>Xa(gt),[gt]);return d.createElement(Wa.Provider,{value:gt},d.createElement(bg,{style:Fp,className:ce,inWidth:m??zp,inHeight:E??Ap},d.createElement(hg,{fillHandle:Qe,drawFocusRing:zr,experimental:lt,fixedShadowX:rt,fixedShadowY:De,getRowThemeOverride:jn,headerIcons:Nt,imageWindowLoader:gn,initialSize:Zt,isDraggable:rn,onDragLeave:Bt,onRowMoved:Xt,overscrollX:Do,overscrollY:zo,preventDiagonalScrolling:kn,rightElement:pn,rightElementProps:kt,smoothScrollX:Vt,smoothScrollY:Et,className:ce,enableGroups:Qr,onCanvasFocused:Pp,onCanvasBlur:Dp,canvasRef:a,onContextMenu:Sp,theme:gt,cellXOffset:lp,cellYOffset:wi,accessibilityHeight:_r.height,onDragEnd:yp,columns:Ct,nonGrowWidth:vi,drawHeader:br,onColumnProposeMove:mp,drawCell:ar,disabledRows:Mp,freezeColumns:Ip,lockColumns:K,firstColAccessible:K===0,getCellContent:Tn,minColumnWidth:ir,maxColumnWidth:Ar,searchInputRef:l,showSearch:Ce,onSearchClose:he,highlightRegions:sp,getCellsForSelection:Le,getGroupDetails:Ma,headerHeight:Fr,isFocused:Hp,groupHeaderHeight:Qr?Po:0,freezeTrailingRows:xe+(Wt&&(ne==null?void 0:ne.sticky)===!0?1:0),hasAppendRow:Wt,onColumnResize:et,onColumnResizeEnd:dn,onColumnResizeStart:en,onCellFocused:Tp,onColumnMoved:vp,onDragStart:wp,onHeaderMenuClick:fp,onHeaderIndicatorClick:gp,onItemHovered:Pa,isFilling:(s==null?void 0:s.fillHandle)===!0,onMouseMove:hp,onKeyDown:Wo,onKeyUp:pe,onMouseDown:cp,onMouseUp:dp,onDragOverCell:Ve,onDrop:Ke,onSearchResultsChanged:kp,onVisibleRegionChanged:pp,clientSize:yn,rowHeight:Vn,searchResults:W,searchValue:U,onSearchValueChange:N,rows:fn,scrollRef:zt,selection:z,translateX:_r.tx,translateY:_r.ty,verticalBorder:Rp,gridRef:ln,getCellRenderer:Ht,resizeIndicator:Ca}),Ep,o!==void 0&&d.createElement(d.Suspense,{fallback:null},d.createElement(kg,{...o,validateCell:Mt,bloom:D,id:Cp,getCellRenderer:Ht,className:(lt==null?void 0:lt.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:_n,imageEditorOverride:y,onFinishEditing:xp,markdownDivCreateNode:p,isOutsideClick:wr,customEventTarget:lt==null?void 0:lt.eventTarget}))))});function s0(e){const{cell:t,posX:n,posY:r,bounds:o,theme:i}=e,{width:l,height:a,x:s,y:c}=o,h=t.maxSize??i.checkboxMaxSize,C=Math.floor(o.y+a/2),y=Nc(h,a,i.cellVerticalPadding),b=jc(t.contentAlign??"center",s,l,i.cellHorizontalPadding,y),p=_c(b,C,y),m=Bc(s+n,c+r,p);return Bi(t)&&m}const Eg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??"false"},kind:me.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>function(t,n,r,o,i){if(!r&&n===Jo)return;const{ctx:l,hoverAmount:a,theme:s,rect:c,highlighted:h,hoverX:C,hoverY:y,cell:{contentAlign:b}}=t,{x:p,y:m,width:E,height:g}=c;let w=!1;if(i>0){let x=r?1-i+i*a:.4;if(n===Jo&&(x*=a),x===0)return;x<1&&(w=!0,l.globalAlpha=x)}sa(l,s,n,p,m,E,g,h,C,y,o,b),w&&(l.globalAlpha=1)}(e,e.cell.data,Bi(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{s0(e)&&e.preventDefault()},onClick:e=>{if(s0(e))return{...e.cell,data:r0(e.cell.data)}},onPaste:(e,t)=>{let n=Jo;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=Ni),n===t.data?void 0:{...t,data:n}}},Ig=Cn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),Tg=e=>{const{bubbles:t}=e;return d.createElement(Ig,null,t.map((n,r)=>d.createElement("div",{key:r,className:"boe-bubble"},n)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},Hg={getAccessibilityString:e=>Wc(e.data),kind:me.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>{const r=t.data.reduce((o,i)=>e.measureText(i).width+o+2*n.bubblePadding+n.bubbleMargin,0);return t.data.length===0?2*n.cellHorizontalPadding:r+2*n.cellHorizontalPadding-n.bubbleMargin},draw:e=>function(t,n){const{rect:r,theme:o,ctx:i,highlighted:l}=t,{x:a,y:s,width:c,height:h}=r;let C=a+o.cellHorizontalPadding;const y=[];for(const b of n){if(C>a+c)break;const p=Kr(b,i,o.baseFontFull).width;y.push({x:C,width:p}),C+=p+2*o.bubblePadding+o.bubbleMargin}i.beginPath();for(const b of y)Yn(i,b.x,s+(h-o.bubbleHeight)/2,b.width+2*o.bubblePadding,o.bubbleHeight,o.roundingRadius??o.bubbleHeight/2);i.fillStyle=l?o.bgBubbleSelected:o.bgBubble,i.fill();for(const[b,p]of y.entries())i.beginPath(),i.fillStyle=o.textBubble,i.fillText(n[b],p.x+o.bubblePadding,s+h/2+fr(i,o))}(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(Tg,{bubbles:t.data})},onPaste:()=>{}},Og=Cn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),Pg=e=>{const{drilldowns:t}=e;return d.createElement(Og,null,t.map((n,r)=>d.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&d.createElement("img",{src:n.img}),d.createElement("div",null,n.text))))},Dg={getAccessibilityString:e=>Wc(e.data.map(t=>t.text)),kind:me.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,o)=>e.measureText(o.text).width+r+2*n.bubblePadding+n.bubbleMargin+(o.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>function(t,n){const{rect:r,theme:o,ctx:i,imageLoader:l,col:a,row:s}=t,{x:c,width:h}=r,C=o.baseFontFull,y=tu(i,C),b=Math.min(r.height,Math.max(16,2*Math.ceil(y*o.lineHeight))),p=Math.floor(r.y+(r.height-b)/2),m=b-10,E=o.bubblePadding,g=o.bubbleMargin;let w=c+o.cellHorizontalPadding;const x=o.roundingRadius??6,I=function(M,S,H,f){const B=Math.ceil(window.devicePixelRatio),D=5,O=H-2*D,T=4,j=H*B,V=f+D,Z=3*f,Q=(Z+2*D)*B,ce=`${M},${S},${B},${H}`;if(wa[ce]!==void 0)return{el:wa[ce],height:j,width:Q,middleWidth:T*B,sideWidth:V*B,padding:D*B,dpr:B};const le=document.createElement("canvas"),q=le.getContext("2d");return q===null?null:(le.width=Q,le.height=j,q.scale(B,B),wa[ce]=le,q.beginPath(),Yn(q,D,D,Z,O,f),q.shadowColor="rgba(24, 25, 34, 0.4)",q.shadowBlur=1,q.fillStyle=M,q.fill(),q.shadowColor="rgba(24, 25, 34, 0.3)",q.shadowOffsetY=1,q.shadowBlur=5,q.fillStyle=M,q.fill(),q.shadowOffsetY=0,q.shadowBlur=0,q.shadowBlur=0,q.beginPath(),Yn(q,D+.5,D+.5,Z,O,f),q.strokeStyle=S,q.lineWidth=1,q.stroke(),{el:le,height:j,width:Q,sideWidth:V*B,middleWidth:f*B,padding:D*B,dpr:B})}(o.bgCell,o.drilldownBorder,b,x),v=[];for(const M of n){if(w>c+h)break;const S=Kr(M.text,i,C).width;let H=0;M.img!==void 0&&l.loadOrGetImage(M.img,a,s)!==void 0&&(H=m-8+4);const f=S+H+2*E;v.push({x:w,width:f}),w+=f+g}if(I!==null){const{el:M,height:S,middleWidth:H,sideWidth:f,width:B,dpr:D,padding:O}=I,T=f/D,j=O/D;for(const V of v){const Z=Math.floor(V.x),Q=Math.floor(V.width),ce=Q-2*(T-j);i.imageSmoothingEnabled=!1,i.drawImage(M,0,0,f,S,Z-j,p,T,b),ce>0&&i.drawImage(M,f,0,H,S,Z+(T-j),p,ce,b),i.drawImage(M,B-f,0,f,S,Z+Q-(T-j),p,T,b),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[M,S]of v.entries()){const H=n[M];let f=S.x+E;if(H.img!==void 0){const B=l.loadOrGetImage(H.img,a,s);if(B!==void 0){const D=m-8;let O=0,T=0,j=B.width,V=B.height;j>V?(O+=(j-V)/2,j=V):V>j&&(T+=(V-j)/2,V=j),i.beginPath(),Yn(i,f,p+b/2-D/2,D,D,o.roundingRadius??3),i.save(),i.clip(),i.drawImage(B,O,T,j,V,f,p+b/2-D/2,D,D),i.restore(),f+=D+4}}i.beginPath(),i.fillStyle=o.textBubble,i.fillText(H.text,f,p+b/2+fr(i,o))}}(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(Pg,{drilldowns:t.data})},onPaste:()=>{}},wa={},zg={getAccessibilityString:e=>e.data.join(", "),kind:me.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>function(t,n,r,o){const{rect:i,col:l,row:a,theme:s,ctx:c,imageLoader:h}=t,{x:C,y,height:b,width:p}=i,m=b-2*s.cellVerticalPadding,E=[];let g=0;for(let x=0;x<n.length;x++){const I=n[x];if(I.length===0)continue;const v=h.loadOrGetImage(I,l,a);v!==void 0&&(E[x]=v,g+=v.width*(m/v.height)+ya)}if(g===0)return;g-=ya;let w=C+s.cellHorizontalPadding;o==="right"?w=Math.floor(C+p-s.cellHorizontalPadding-g):o==="center"&&(w=Math.floor(C+p/2-g/2));for(const x of E){if(x===void 0)continue;const I=x.width*(m/x.height);r>0&&(c.beginPath(),Yn(c,w,y+s.cellVerticalPadding,I,m,r),c.save(),c.clip()),c.drawImage(x,w,y+s.cellVerticalPadding,I,m),r>0&&c.restore(),w+=I+ya}}(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>50*t.data.length,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:r}=e,o=r??u1;return d.createElement(o,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:i=>{n({...t,data:[i]})}})},onPaste:(e,t)=>{const n=(e=e.trim()).split(",").map(r=>{try{return new URL(r),r}catch{return}}).filter(r=>r!==void 0);if(n.length!==t.data.length||!n.every((r,o)=>r===t.data[o]))return{...t,data:n}}},ya=4,Ag={getAccessibilityString:()=>"",kind:me.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:o,rect:i,theme:l}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let a=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(a+=Math.round(function(h,C){let y=49632*h+325176*C;return y^=y<<13,y^=y>>17,y^=y<<5,y/4294967295*2}(n,r)*t.skeletonWidthVariability));const s=l.cellHorizontalPadding;a+2*s>=i.width&&(a=i.width-2*s-1);const c=t.skeletonHeight??Math.min(18,i.height-2*l.cellVerticalPadding);Yn(o,i.x+s,i.y+(i.height-c)/2,a,c,l.roundingRadius??3),o.fillStyle=Hr(l.textDark,.1),o.fill()},onPaste:()=>{}},c0=Cn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[e=>e.targetWidth,"px"]}}),Fg=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:o,targetRect:i,onFinish:l,validatedSelection:a}=e,s=t.data,c=t.readonly===!0,[h,C]=d.useState(s===""||r),y=d.useCallback(()=>{C(p=>!p)},[]),b=s?"gdg-ml-6":"";return h?d.createElement(c0,{targetWidth:i.width-20},d.createElement(oi,{autoFocus:!0,highlight:!1,validatedSelection:a,value:s,onKeyDown:p=>{p.key==="Enter"&&p.stopPropagation()},onChange:n}),d.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${b}`,onClick:()=>l(t)},d.createElement(l1,null))):d.createElement(c0,{targetWidth:i.width},d.createElement(h1,{contents:s,createNode:o}),!c&&d.createElement(d.Fragment,null,d.createElement("div",{className:"spacer"}),d.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${b}`,onClick:y},d.createElement(Gi,null))),d.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Lg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:me.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:yo,measure:(e,t,n)=>{const r=t.data.split(`
130
- `)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>Jn(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:o,markdownDivCreateNode:i,forceEditMode:l,validatedSelection:a}=e;return d.createElement(Fg,{onFinish:o,targetRect:r,value:n,validatedSelection:a,onChange:s=>t({...n,data:s.target.value}),forceEditMode:l,createNode:i})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},_g={getAccessibilityString:e=>e.row.toString(),kind:Hn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:function(e,t){const{ctx:n,theme:r}=e,o=r.markerFontFull,i=t??{};return(i==null?void 0:i.font)!==o&&(n.font=o,i.font=o),i.deprep=jg,n.textAlign="center",i},measure:()=>44,draw:e=>function(t,n,r,o,i,l){const{ctx:a,rect:s,hoverAmount:c,theme:h}=t,{x:C,y,width:b,height:p}=s,m=r?1:o==="checkbox-visible"?.6+.4*c:c;if(o!=="number"&&m>0){a.globalAlpha=m;const E=7*(r?c:1);if(sa(a,h,r,i?C+E:C,y,i?b-E:b,p,!0,void 0,void 0,h.checkboxMaxSize,"center",l),i){a.globalAlpha=c,a.beginPath();for(const g of[3,6])for(const w of[-5,-1,3])a.rect(C+g,y+p/2+w,2,2);a.fillStyle=h.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(o==="number"||o==="both"&&!r){const E=n.toString(),g=h.markerFontFull,w=C+b/2;o==="both"&&c!==0&&(a.globalAlpha=1-c),a.fillStyle=h.textLight,a.font=g,a.fillText(E,w,y+p/2+fr(a,g)),c!==0&&(a.globalAlpha=1)}}(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:o}=e,{width:i,height:l}=t,a=n.drawHandle?7+(i-7)/2:i/2,s=l/2;if(Math.abs(r-a)<=10&&Math.abs(o-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function jg(e){const{ctx:t}=e;t.textAlign="start"}const Ng={getAccessibilityString:()=>"",kind:Hn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>function(t,n,r){const{ctx:o,rect:i,hoverAmount:l,theme:a,spriteManager:s}=t,{x:c,y:h,width:C,height:y}=i;o.beginPath(),o.globalAlpha=l,o.rect(c+1,h+1,C,y-2),o.fillStyle=a.bgHeaderHovered,o.fill(),o.globalAlpha=1,o.beginPath();const b=n!=="";let p=0;if(r!==void 0){const E=y-8,g=c+8/2,w=h+8/2;s.drawSprite(r,"normal",o,g,w,E,a,b?1:l),p=E}else{p=24;const m=12,E=b?m:l*m,g=b?0:(1-l)*m*.5,w=a.cellHorizontalPadding+4;E>0&&(o.moveTo(c+w+g,h+y/2),o.lineTo(c+w+g+E,h+y/2),o.moveTo(c+w+g+.5*E,h+y/2-.5*E),o.lineTo(c+w+g+.5*E,h+y/2+.5*E),o.lineWidth=2,o.strokeStyle=a.bgIconHeader,o.lineCap="round",o.stroke())}o.fillStyle=a.textMedium,o.fillText(n,p+c+a.cellHorizontalPadding+.5,h+y/2+fr(o,a)),o.beginPath()}(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function u0(e,t,n,r,o,i,l){e.textBaseline="alphabetic";const a=function(s,c,h,C,y){const b=C.cellHorizontalPadding,p=C.cellVerticalPadding;if(y)return{x:c.x+b/2,y:c.y+p/2+1,width:c.width-b,height:c.height-p-1};const m=Kr(h,s,C.baseFontFull,"alphabetic"),E=c.height-p,g=Math.min(E,2.5*m.actualBoundingBoxAscent);return{x:c.x+b/2,y:c.y+(c.height-g)/2+1,width:m.width+3*b,height:g-1}}(e,o,r,t,(n==null?void 0:n.fullSize)??!1);e.beginPath(),Yn(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=i,e.fillStyle=(n==null?void 0:n.bgColor)??Hr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",l==null||l("text")}const Bg=d.lazy(async()=>await L0(()=>import("./number-overlay-editor-CzV-HwJ1.js"),__vite__mapDeps([4,1,2,3]),import.meta.url)),Wg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:me.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:yo,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:o,rect:i,overrideCursor:l}=e,{hoverEffect:a,displayData:s,hoverEffectTheme:c}=n;a===!0&&t>0&&u0(r,o,c,s,i,t,l),Jn(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+2*n.cellHorizontalPadding,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return d.createElement(d.Suspense,{fallback:null},d.createElement(Bg,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:o,onChange:i=>n({...r,data:Number.isNaN(i.floatValue??0)?0:i.floatValue})}))},onPaste:(e,t,n)=>{const r=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!Number.isNaN(r)&&t.data!==r)return{...t,data:r,displayData:n.formattedString??t.displayData}}},$g={getAccessibilityString:()=>"",measure:()=>108,kind:me.Protected,needsHover:!1,needsHoverPosition:!1,draw:function(e){const{ctx:t,theme:n,rect:r}=e,{x:o,y:i,height:l}=r;t.beginPath();const a=2.5;let s=o+n.cellHorizontalPadding+a;const c=i+l/2,h=Math.cos(Lc(30))*a,C=Math.sin(Lc(30))*a;for(let y=0;y<12;y++)t.moveTo(s,c-a),t.lineTo(s,c+a),t.moveTo(s+h,c-C),t.lineTo(s-h,c+C),t.moveTo(s-h,c-C),t.lineTo(s+h,c+C),s+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()},onPaste:()=>{}},Xg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:me.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>yo(e,t,e.theme.textLight),draw:e=>Jn(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+2*n.cellHorizontalPadding,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return $t.createElement(oi,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:o,onChange:i=>n({...r,data:i.target.value})})},onPaste:()=>{}},Gg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:me.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:yo,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:o,rect:i,theme:l,overrideCursor:a}=e,{displayData:s,contentAlign:c,hoverEffect:h,allowWrapping:C,hoverEffectTheme:y}=t;h===!0&&n>0&&u0(o,l,y,s,i,n,a),Jn(e,s,c,C,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
131
- `,t.allowWrapping===!0?void 0:1);let o=0;for(const i of r)o=Math.max(o,e.measureText(i).width);return o+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:r,value:o,validatedSelection:i}=t;return d.createElement(oi,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:o.readonly!==!0,disabled:o.readonly===!0,altNewline:!0,value:o.data,validatedSelection:i,onChange:l=>r({...o,data:l.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Yg=Cn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Kg=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:o,validatedSelection:i,preview:l}=e,[a,s]=d.useState(!o&&(t===""||r)),c=d.useCallback(()=>{s(!0)},[]);return a?d.createElement(oi,{validatedSelection:i,highlight:!0,autoFocus:!0,value:t,onChange:n}):d.createElement(Yg,null,d.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},l),!o&&d.createElement("div",{className:"gdg-edit-icon",onClick:c},d.createElement(Gi,null)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function d0(e,t,n,r){let o=n.cellHorizontalPadding;const i=t.height/2-e.actualBoundingBoxAscent/2,l=e.width,a=e.actualBoundingBoxAscent;return r==="right"?o=t.width-l-n.cellHorizontalPadding:r==="center"&&(o=t.width/2-l/2),{x:o,y:i,width:l,height:a}}function h0(e){const{cell:t,bounds:n,posX:r,posY:o,theme:i}=e,l=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const a=Qc(l,i.baseFontFull);if(a===void 0)return!1;const s=d0(a,n,i,t.contentAlign);return Dr({x:s.x-4,y:s.y-4,width:s.width+8,height:s.height+8},r,o)}const Vg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:me.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:yo,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:o,hoverY:i,rect:l,ctx:a}=e,s=t.displayData??t.data,c=t.hoverEffect===!0;if(r!==void 0&&c&&o!==void 0&&i!==void 0){const h=d0(Kr(s,a,n.baseFontFull),l,n,t.contentAlign),{x:C,y,width:b,height:p}=h;if(o>=C-4&&o<=C-4+b+8&&i>=y-4&&i<=y-4+p+8){const m=fr(a,n.baseFontFull);r("pointer");const E=5,g=y-m;a.beginPath(),a.moveTo(l.x+C,Math.floor(l.y+g+p+E)+.5),a.lineTo(l.x+C+b,Math.floor(l.y+g+p+E)+.5),a.strokeStyle=n.linkColor,a.stroke(),a.save(),a.fillStyle=e.cellFillColor,Jn({...e,rect:{...l,x:l.x-1}},s,t.contentAlign),Jn({...e,rect:{...l,x:l.x-2}},s,t.contentAlign),Jn({...e,rect:{...l,x:l.x+1}},s,t.contentAlign),Jn({...e,rect:{...l,x:l.x+2}},s,t.contentAlign),a.restore()}}a.fillStyle=c?n.linkColor:n.textDark,Jn(e,s,t.contentAlign)},onSelect:e=>{h0(e)&&e.preventDefault()},onClick:e=>{var n;const{cell:t}=e;h0(e)&&((n=t.onClickUri)==null||n.call(t,e))},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+2*n.cellHorizontalPadding,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:r,forceEditMode:o,validatedSelection:i}=t;return d.createElement(Kg,{forceEditMode:r.readonly!==!0&&(o||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:i,readonly:r.readonly===!0,onChange:l=>n({...r,data:l.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Ug=[_g,Ng,Eg,Hg,Dg,zg,Ag,Lg,Wg,$g,Xg,Gg,Vg];var f0,g0,qg=function(){if(g0)return f0;g0=1;var e=Ac(),t=Er();return f0=function(n,r,o){var i=!0,l=!0;if(typeof n!="function")throw new TypeError("Expected a function");return t(o)&&(i="leading"in o?!!o.leading:i,l="trailing"in o?!!o.trailing:l),e(n,r,{leading:i,maxWait:r,trailing:l})}}();const Qg=Sr(qg),ba=[];class Jg extends ru{constructor(){super(...arguments);ft(this,"imageLoaded",()=>{});ft(this,"loadedLocations",[]);ft(this,"cache",{});ft(this,"sendLoaded",Qg(()=>{this.imageLoaded(new bo(this.loadedLocations)),this.loadedLocations=[]},20));ft(this,"clearOutOfWindow",()=>{const n=Object.keys(this.cache);for(const r of n){const o=this.cache[r];let i=!1;for(let l=0;l<o.cells.length;l++){const a=o.cells[l];if(this.isInWindow(a)){i=!0;break}}i?o.cells=o.cells.filter(this.isInWindow):(o.cancel(),delete this.cache[r])}})}setCallback(n){this.imageLoaded=n}loadImage(n,r,o,i){let l=!1;const a=ba.pop()??new Image;let s=!1;const c={img:void 0,cells:[Ln(r,o)],url:n,cancel:()=>{s||(s=!0,ba.length<12?ba.unshift(a):l||(a.src=""))}},h=new Promise(C=>a.addEventListener("load",()=>C(null)));requestAnimationFrame(async()=>{try{a.src=n,await h,await a.decode();const C=this.cache[i];if(C!==void 0&&!s){C.img=a;for(const y of C.cells)this.loadedLocations.push(ta(y));l=!0,this.sendLoaded()}}catch{c.cancel()}}),this.cache[i]=c}loadOrGetImage(n,r,o){const i=n,l=this.cache[i];if(l!==void 0){const a=Ln(r,o);return l.cells.includes(a)||l.cells.push(a),l.img}this.loadImage(n,r,o,i)}}const Zg=d.forwardRef((e,t)=>{const n=d.useMemo(()=>({...E1,...e.headerIcons}),[e.headerIcons]),r=d.useMemo(()=>e.renderers??Ug,[e.renderers]),o=d.useMemo(()=>e.imageWindowLoader??new Jg,[e.imageWindowLoader]);return d.createElement(Rg,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:o})});function ep(e){switch(e){case"string":default:return me.Text;case"number":return me.Number;case"boolean":return me.Boolean}}function tp(e){switch(e){case"string":case"unknown":return Qn.HeaderString;case"number":case"integer":return Qn.HeaderNumber;case"boolean":return Qn.HeaderBoolean;case"date":case"datetime":return Qn.HeaderDate;case"time":return Qn.HeaderTime;default:return _0(e),Qn.HeaderString}}function p0(e){return"rowIdx"in e&&"columnId"in e&&"value"in e}function np(e){return"rowIdx"in e&&"type"in e}function rp(e){return"columnIdx"in e&&"type"in e}function op(e){return e==="light"?{lineHeight:1.25}:{lineHeight:1.25,accentColor:"#7c3aed",accentLight:"rgba(124, 58, 237, 0.15)",textDark:"#f4f4f5",textMedium:"#a1a1aa",textLight:"#71717a",textBubble:"#f4f4f5",bgIconHeader:"#a1a1aa",fgIconHeader:"#18181b",textHeader:"#d4d4d8",textHeaderSelected:"#18181b",bgCell:"#18181b",bgCellMedium:"#27272a",bgHeader:"#27272a",bgHeaderHasFocus:"#3f3f46",bgHeaderHovered:"#3f3f46",bgBubble:"#27272a",bgBubbleSelected:"#7c3aed",bgSearchResult:"#312e81",borderColor:"#27272a",drilldownBorder:"#7c3aed",linkColor:"#818cf8",headerFontStyle:"bold 14px",baseFontStyle:"13px"}}const ip=e=>{const t=j0.c(19),{currentColumnName:n,onRename:r,onCancel:o}=e,[i,l]=d.useState("");let a;t[0]!==n||t[1]!==i||t[2]!==r?(a=()=>{i.trim()&&(r(i.trim()),l(n))},t[0]=n,t[1]=i,t[2]=r,t[3]=a):a=t[3];const s=a;let c;t[4]!==s||t[5]!==o?(c=w=>{w.key==="Enter"?s():w.key==="Escape"&&o()},t[4]=s,t[5]=o,t[6]=c):c=t[6];const h=c;let C,y,b,p;t[7]===Symbol.for("react.memo_cache_sentinel")?(C=nt.jsxs(N0,{children:[nt.jsx($p,{className:"mr-2 h-3.5 w-3.5"}),"Rename column"]}),t[7]=C):C=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(y=nt.jsx(_a,{htmlFor:"rename-input",children:"Column name"}),t[8]=y):y=t[8],t[9]===Symbol.for("react.memo_cache_sentinel")?(b=w=>l(w.target.value),t[9]=b):b=t[9],t[10]!==h||t[11]!==i?(p=nt.jsxs("div",{children:[y,nt.jsx(B0,{value:i,onChange:b,placeholder:"Enter new column name",className:"mt-1",onKeyDown:h})]}),t[10]=h,t[11]=i,t[12]=p):p=t[12];const m=!i.trim();let E,g;return t[13]!==s||t[14]!==m?(E=nt.jsx(ja,{onClick:s,disabled:m,size:"sm",className:"w-full",children:"Rename"}),t[13]=s,t[14]=m,t[15]=E):E=t[15],t[16]!==p||t[17]!==E?(g=nt.jsxs(W0,{children:[C,nt.jsx($0,{children:nt.jsx(X0,{className:"w-64 p-4",children:nt.jsxs("div",{className:"space-y-3",children:[p,E]})})})]}),t[16]=p,t[17]=E,t[18]=g):g=t[18],g},m0=e=>{const t=j0.c(77),{direction:n,onAdd:r,onCancel:o}=e,[i,l]=d.useState(""),[a,s]=d.useState("string");let c,h,C,y,b,p,m,E,g,w,x,I,v,M,S,H,f,B;if(t[0]!==i||t[1]!==a||t[2]!==n||t[3]!==r||t[4]!==o){const Q=["string","number","boolean","datetime"];let ce,le;t[20]!==i||t[21]!==a||t[22]!==r?(ce=()=>{i.trim()&&(r(i.trim(),a),l(""),s("string"))},t[20]=i,t[21]=a,t[22]=r,t[23]=ce):ce=t[23],p=ce,t[24]!==p||t[25]!==o?(le=pe=>{pe.key==="Enter"?p():pe.key==="Escape"&&o()},t[24]=p,t[25]=o,t[26]=le):le=t[26];const q=le;let J;b=W0,t[27]===Symbol.for("react.memo_cache_sentinel")?(J=nt.jsx(Xp,{className:"mr-2 h-3.5 w-3.5"}),t[27]=J):J=t[27],t[28]!==n?(S=nt.jsxs(N0,{children:[J,"Add column to the ",n]}),t[28]=n,t[29]=S):S=t[29],y=$0,C=X0,M="w-64 p-4",I="space-y-3";const fe=`add-column-input-${n}`;let ee;t[30]!==fe?(ee=nt.jsx(_a,{htmlFor:fe,children:"Column name"}),t[30]=fe,t[31]=ee):ee=t[31];const se=`add-column-input-${n}`;let ie,W;t[32]===Symbol.for("react.memo_cache_sentinel")?(ie=pe=>l(pe.target.value),t[32]=ie):ie=t[32],t[33]!==i||t[34]!==q||t[35]!==se?(W=nt.jsx(B0,{id:se,value:i,onChange:ie,placeholder:"Enter column name",className:"mt-1",onKeyDown:q}),t[33]=i,t[34]=q,t[35]=se,t[36]=W):W=t[36],t[37]!==ee||t[38]!==W?(v=nt.jsxs("div",{children:[ee,W]}),t[37]=ee,t[38]=W,t[39]=v):v=t[39];const N=`add-column-type-${n}`;t[40]!==N?(x=nt.jsx(_a,{htmlFor:N,children:"Data type"}),t[40]=N,t[41]=x):x=t[41],h=Gp,E=a,t[42]===Symbol.for("react.memo_cache_sentinel")?(g=pe=>s(pe),t[42]=g):g=t[42];const U=`add-column-type-${n}`;let ue;t[43]===Symbol.for("react.memo_cache_sentinel")?(ue=nt.jsx(Yp,{}),t[43]=ue):ue=t[43],t[44]!==U?(w=nt.jsx(Kp,{id:U,className:"mt-1",children:ue}),t[44]=U,t[45]=w):w=t[45],c=Vp,m=Q.map(ap),t[0]=i,t[1]=a,t[2]=n,t[3]=r,t[4]=o,t[5]=c,t[6]=h,t[7]=C,t[8]=y,t[9]=b,t[10]=p,t[11]=m,t[12]=E,t[13]=g,t[14]=w,t[15]=x,t[16]=I,t[17]=v,t[18]=M,t[19]=S}else c=t[5],h=t[6],C=t[7],y=t[8],b=t[9],p=t[10],m=t[11],E=t[12],g=t[13],w=t[14],x=t[15],I=t[16],v=t[17],M=t[18],S=t[19];t[46]!==c||t[47]!==m?(H=nt.jsx(c,{children:m}),t[46]=c,t[47]=m,t[48]=H):H=t[48],t[49]!==h||t[50]!==H||t[51]!==E||t[52]!==g||t[53]!==w?(f=nt.jsxs(h,{value:E,onValueChange:g,children:[w,H]}),t[49]=h,t[50]=H,t[51]=E,t[52]=g,t[53]=w,t[54]=f):f=t[54],t[55]!==f||t[56]!==x?(B=nt.jsxs("div",{children:[x,f]}),t[55]=f,t[56]=x,t[57]=B):B=t[57];const D=!i.trim();let O,T,j,V,Z;return t[58]!==p||t[59]!==D?(O=nt.jsx(ja,{onClick:p,disabled:D,size:"sm",className:"w-full",children:"Add"}),t[58]=p,t[59]=D,t[60]=O):O=t[60],t[61]!==B||t[62]!==O||t[63]!==I||t[64]!==v?(T=nt.jsxs("div",{className:I,children:[v,B,O]}),t[61]=B,t[62]=O,t[63]=I,t[64]=v,t[65]=T):T=t[65],t[66]!==C||t[67]!==T||t[68]!==M?(j=nt.jsx(C,{className:M,children:T}),t[66]=C,t[67]=T,t[68]=M,t[69]=j):j=t[69],t[70]!==y||t[71]!==j?(V=nt.jsx(y,{children:j}),t[70]=y,t[71]=j,t[72]=V):V=t[72],t[73]!==b||t[74]!==V||t[75]!==S?(Z=nt.jsxs(b,{children:[S,V]}),t[73]=b,t[74]=V,t[75]=S,t[76]=Z):Z=t[76],Z};function ap(e){return nt.jsx(Bp,{value:e,children:Wp(e)},e)}function v0(e,t){return e.map(n=>{const r=n,o=Object.keys(r);if(t<0||t>=o.length)return r;const i=o[t],{[i]:l,...a}=r;return a})}function w0(e,t){return t?e.map(n=>({...n,[t]:""})):e}function y0(e,t,n){return t&&n&&t!==n?e.map(r=>{const o=r,{[t]:i,...l}=o;return{...l,[n]:o[t]}}):e}function Ur(e){var l;const{columnFields:t,columnIdx:n,type:r,dataType:o,newColumnName:i}=e;switch(r){case"insert":{if(!i)return La.error("newName is required for insert"),t;const a=Object.entries(t),s=[...a.slice(0,n),[i,o||"string"],...a.slice(n)];return Object.fromEntries(s)}case"remove":{if(n<0||n>=Object.keys(t).length)return t;const a=Object.entries(t),s=(l=a[n])==null?void 0:l[0];if(s){const{[s]:c,...h}=t;return h}return t}case"rename":{if(!i)return La.error("newName is required for rename"),t;if(n<0||n>=Object.keys(t).length)return t;const a=Object.entries(t),s=[...a.slice(0,n),[i,o||"string"],...a.slice(n+1)];return Object.fromEntries(s)}}}let xa;xa=({data:e,setData:t,columnFields:n,setColumnFields:r,editableColumns:o,edits:i,onAddEdits:l,onAddRows:a,onDeleteRows:s,onRenameColumn:c,onDeleteColumn:h,onAddColumn:C})=>{const{theme:y}=Up(),b=d.useRef(null),[p,m]=d.useState(),[E,g]=d.useState(!1),[w,x]=$t.useState({columns:yt.empty(),rows:yt.empty()}),[I,v]=d.useState({}),M=qp();Qp(()=>{if(i.length===0)return;const ie=new Map;for(const N of i)if(p0(N))if(N.rowIdx>=e.length){ie.has(N.rowIdx)||ie.set(N.rowIdx,{});const U=ie.get(N.rowIdx);U&&(U[N.columnId]=N.value)}else t(U=>{const ue=[...U];return ue[N.rowIdx][N.columnId]=N.value,ue});else if(np(N)&&N.type===Hi.Remove)t(U=>U.filter((ue,pe)=>pe!==N.rowIdx));else if(rp(N))switch(N.type){case Hi.Remove:t(U=>v0(U,N.columnIdx)),r(U=>Ur({columnFields:U,columnIdx:N.columnIdx,type:"remove"}));break;case Hi.Insert:r(U=>Ur({columnFields:U,columnIdx:N.columnIdx,type:"insert",newColumnName:N.newName})),t(U=>w0(U,N.newName));break;case Hi.Rename:{const U=S[N.columnIdx].title,ue=N.newName;if(!U||!ue)return;r(pe=>Ur({columnFields:pe,columnIdx:N.columnIdx,type:"rename",newColumnName:ue})),t(pe=>y0(pe,U,ue));break}}const W=[...ie.entries()].sort(([N],[U])=>N-U).map(([,N])=>N);W.length>0&&t(N=>[...N,...W]),M()});const S=d.useMemo(()=>{const ie=[];for(const[W,N]of Object.entries(n)){const U=o==="all"||o.includes(W);ie.push({id:W,title:W,width:I[W],icon:U?tp(N):Qn.ProtectedColumnOverlay,style:"normal",kind:ep(N),dataType:N,hasMenu:!0,themeOverride:U?void 0:{bgCell:y==="light"?"#F9F9FA":"#1e1e21"}})}return ie},[n,I,o,y]),H=d.useCallback(ie=>{const[W,N]=ie,U=e[N][S[W].title],ue=S[W].kind,pe=o==="all"||o.includes(S[W].title);if(ue===me.Boolean){const ze=!!U;return{kind:me.Boolean,allowOverlay:!1,readonly:!pe,data:ze}}return ue===me.Number&&typeof U=="number"?{kind:me.Number,allowOverlay:pe,readonly:!pe,displayData:String(U),data:U}:{kind:me.Text,allowOverlay:pe,readonly:!pe,displayData:String(U),data:String(U)}},[S,e,o]),f=d.useCallback((ie,W)=>{const[N,U]=ie,ue=S[N],pe=ue.title;let ze=W.data;ue.dataType!=="number"&&ue.dataType!=="integer"||W.data!==void 0&&W.data!==""||(ze=null),t(Ue=>{const He=[...Ue];return He[U][pe]=ze,He}),l([{rowIdx:U,columnId:pe,value:ze}])},[S,l,t]),B=d.useCallback((ie,W)=>{v(N=>({...N,[ie.title]:W}))},[]),D=d.useCallback((ie,W,N)=>{const[U,ue]=ie,pe=S[U].title;switch(n[pe]){case"number":case"integer":if(Number.isNaN(Number(W.data)))return!1;break;case"boolean":if(typeof W.data!="boolean")return!1}return!0},[n,S]),O=d.useCallback(ie=>{if(b.current)if(Na.isMetaOrCtrl(ie)&&ie.key==="c")b.current.emit("copy");else{if(!Na.isMetaOrCtrl(ie)||ie.key!=="v")return Na.isMetaOrCtrl(ie)&&ie.key==="f"?(g(W=>!W),ie.stopPropagation(),void ie.preventDefault()):void(ie.key!=="Escape"||g(!1));(function(W){const{selection:N,data:U,setData:ue,onAddEdits:pe,columns:ze,editableColumns:Ue}=W;if(!N.current)return;const{range:He}=N.current,{x:$e,y:be}=He;navigator.clipboard.readText().then(ye=>{if(!ye.trim())return;const Fe=ye.split(`
132
- `).filter(Ee=>Ee.trim()),Oe=[];for(const Ee of Fe){const ke=Ee.split(" ");Oe.push(ke)}if(Oe.length===0)return;const te=[];for(const[Ee,ke]of Oe.entries()){if(!ke)continue;const Xe=be+Ee;if(Xe>=U.length)break;for(const[Re,qe]of ke.entries()){if(qe===void 0)continue;const Ye=$e+Re;if(!ze||Ye>=ze.length)break;const ot=ze[Ye],Me=ot.dataType;if(Ue!=="all"&&!Ue.includes(ot.title))continue;let Pe=qe;switch(Me){case"integer":case"number":{const tt=Number(qe);if(Number.isNaN(tt))continue;Pe=tt;break}case"boolean":{const tt=qe.toLowerCase();Pe=tt==="true"||tt==="1";break}}const ut=ze[Ye].title;te.push({rowIdx:Xe,columnId:ut,value:Pe})}}te.length>0&&(pe(te),ue(Ee=>{const ke=[...Ee];for(const Xe of te)if(p0(Xe)){const Re=Xe.rowIdx,qe=Xe.columnId;if(Re<ke.length){const Ye=ke[Re];qe in Ye&&(Ye[qe]=Xe.value)}}return ke}))}).catch(ye=>{La.error("Failed to read clipboard data",ye)})})({selection:w,data:e,setData:t,columns:S,editableColumns:o,onAddEdits:l})}},[S,e,o,l,w,t]),T=d.useCallback(()=>{const ie=Object.fromEntries(S.map(W=>{const N=W.dataType;switch(N){case"boolean":return[W.title,!1];case"number":case"integer":return[W.title,null];case"date":case"datetime":case"time":return[W.title,new Date];case"string":case"unknown":return[W.title,""];default:return _0(N),[W.title,""]}}));a([ie]),t(W=>[...W,ie])},[S,a,t]),j=Jp((ie,W)=>{m({col:ie,bounds:W})}),V=async()=>{if(p){const ie=S[p.col].title;await rm(ie),m(void 0)}};function Z(ie){om({title:`Column '${ie}' already exists`,description:"Please enter a different column name",variant:"danger"})}const Q=ie=>{if(p){const W=S[p.col].title;if(n[ie])return void Z(ie);const N=S[p.col].dataType;c(p.col,ie),r(U=>Ur({columnFields:U,columnIdx:p.col,type:"rename",dataType:N,newColumnName:ie})),t(U=>y0(U,W,ie)),m(void 0)}},ce=()=>{p&&(h(p.col),r(ie=>Ur({columnFields:ie,columnIdx:p.col,type:"remove"})),t(ie=>v0(ie,p.col)),m(void 0))},le=ie=>{const{direction:W,columnName:N,dataType:U}=ie;if(p){const ue=p.col+(W==="left"?0:1),pe=Math.max(0,Math.min(ue,S.length));if(n[N])return void Z(N);C(pe,N),r(ze=>Ur({columnFields:ze,columnIdx:pe,type:"insert",dataType:U,newColumnName:N})),t(ze=>w0(ze,N)),m(void 0)}},q=(p==null?void 0:p.col)===S.length-1,J=p!==void 0,fe="mr-2 h-3.5 w-3.5",ee=e.length>1e5,se=o==="all";return nt.jsxs("div",{className:"relative",children:[nt.jsx(Zp,{children:nt.jsx(Zg,{ref:b,getCellContent:H,columns:S,gridSelection:w,onGridSelectionChange:x,rows:e.length,overscrollX:50,smoothScrollX:!ee,smoothScrollY:!ee,validateCell:D,getCellsForSelection:!0,onPaste:!0,showSearch:E,fillHandle:!0,allowedFillDirections:"vertical",onKeyDown:O,height:e.length>10?450:void 0,width:"100%",rowMarkers:{kind:"both"},rowSelectionMode:"multi",onCellEdited:f,onColumnResize:B,onHeaderMenuClick:j,theme:op(y),trailingRowOptions:{hint:"New row",sticky:!0,tint:!0},onRowAppended:T,maxColumnAutoWidth:600,maxColumnWidth:600})}),(()=>{if(!J)return;const ie=nt.jsxs(nt.Fragment,{children:[se&&nt.jsx(ip,{currentColumnName:S[p.col].title,onRename:Q,onCancel:()=>m(void 0)}),nt.jsx(G0,{}),nt.jsx(m0,{direction:"left",onAdd:(W,N)=>le({direction:"left",columnName:W,dataType:N}),onCancel:()=>m(void 0)}),nt.jsx(m0,{direction:"right",onAdd:(W,N)=>le({direction:"right",columnName:W,dataType:N}),onCancel:()=>m(void 0)}),nt.jsx(G0,{}),!q&&se&&nt.jsxs(Y0,{onClick:ce,className:"text-destructive focus:text-destructive",children:[nt.jsx(am,{className:fe}),"Delete column"]})]});return nt.jsx(em,{open:J,onOpenChange:W=>!W&&m(void 0),children:nt.jsxs(tm,{style:{left:(p==null?void 0:p.bounds.x)??0,top:((p==null?void 0:p.bounds.y)??0)+((p==null?void 0:p.bounds.height)??0)},className:"fixed w-52",children:[nt.jsxs(Y0,{onClick:V,children:[nt.jsx(nm,{className:fe}),"Copy column name"]}),!ee&&ie]})})})(),nt.jsx("div",{className:"absolute bottom-1 right-2 w-26",children:nt.jsx(ja,{variant:"destructive",size:"sm",disabled:w.rows.length===0,className:"right-2 h-7",onClick:()=>{const ie=w.rows.toArray();s(ie);let W=0;for(const N of ie){const U=N-W;t(ue=>ue.filter((pe,ze)=>ze!==U)),W++}x({columns:yt.empty(),rows:yt.empty()})},children:w.rows.length<=1?"Delete row":"Delete rows"})})]})},K0=Object.freeze(Object.defineProperty({__proto__:null,GlideDataEditor:xa,default:xa},Symbol.toStringTag,{value:"Module"}))});export{Ba as C,Wa as T,lm as __tla,kr as a,$a as b,K0 as g,Mr as i,Xa as m,Cn as s};
129
+ `),rawValue:oe});return We===void 0?void 0:(Rn(We.kind===Y.kind),{location:F,value:We})}}}const k=z.columns,P=z.rows,A=(($=zt.current)==null?void 0:$.contains(document.activeElement))===!0||((_=a.current)==null?void 0:_.contains(document.activeElement))===!0;let G;if(z.current!==void 0?G=[z.current.range.x,z.current.range.y]:k.length===1?G=[k.first()??0,0]:P.length===1&&(G=[K,P.first()??0]),A&&G!==void 0){let Y,F;const oe="text/plain",re="text/html";if(navigator.clipboard.read!==void 0){const Se=await navigator.clipboard.read();for(const Te of Se){if(Te.types.includes(re)){const We=await Te.getType(re),_t=e0(await We.text());if(_t!==void 0){Y=_t;break}}Te.types.includes(oe)&&(F=await(await Te.getType(oe)).text())}}else if(navigator.clipboard.readText!==void 0)F=await navigator.clipboard.readText();else{if(u===void 0||(u==null?void 0:u.clipboardData)===null)return;u.clipboardData.types.includes(re)&&(Y=e0(u.clipboardData.getData(re))),Y===void 0&&u.clipboardData.types.includes(oe)&&(F=u.clipboardData.getData(oe))}const[ge,we]=G,je=[];do{if(ot===void 0){const Se=R(Tn(G),G,F??(Y==null?void 0:Y.map(Te=>Te.map(We=>We.rawValue).join(" ")).join(" "))??"",void 0);Se!==void 0&&je.push(Se);break}if(Y===void 0){if(F===void 0)return;Y=wg(F)}if(ot===!1||typeof ot=="function"&&(ot==null?void 0:ot([G[0]-K,G[1]],Y.map(Se=>Se.map(Te=>{var We;return((We=Te.rawValue)==null?void 0:We.toString())??""}))))!==!0)return;for(const[Se,Te]of Y.entries()){if(Se+we>=Ge)break;for(const[We,_t]of Te.entries()){const Ut=[We+ge,Se+we],[tn,St]=Ut;if(tn>=Ct.length||St>=fn)continue;const At=R(Tn(Ut),Ut,_t.rawValue,_t.formatted);At!==void 0&&je.push(At)}}}while(!1);zn(je),(X=ln.current)==null||X.damage(je.map(Se=>({cell:Se.location})))}},[H,Ht,Tn,z,Un.paste,zt,Ct.length,zn,fn,ot,K,Ge]);cn("paste",za,C,!1,!0);const $o=d.useCallback(async(u,R)=>{var $,_;if(!Un.copy)return;const k=R===!0||(($=zt.current)==null?void 0:$.contains(document.activeElement))===!0||((_=a.current)==null?void 0:_.contains(document.activeElement))===!0,P=z.columns,A=z.rows,G=(X,Y)=>{n0(Me?[Y.map(F=>({kind:me.Text,data:g[F].title,displayData:g[F].title,allowOverlay:!1})),...X]:X,Y,u)};if(k&&Le!==void 0){if(z.current!==void 0){let X=Le(z.current.range,Ie.current.signal);typeof X!="object"&&(X=await X()),G(X,Pr(z.current.range.x-K,z.current.range.x+z.current.range.width-K))}else if(A!==void 0&&A.length>0){const X=[...A].map(Y=>{const F=Le({x:K,y:Y,width:g.length,height:1},Ie.current.signal);return typeof F=="object"?F[0]:F().then(oe=>oe[0])});X.some(Y=>Y instanceof Promise)?G(await Promise.all(X),Pr(g.length)):G(X,Pr(g.length))}else if(P.length>0){const X=[],Y=[];for(const F of P){let oe=Le({x:F,y:0,width:1,height:Ge},Ie.current.signal);typeof oe!="object"&&(oe=await oe()),X.push(oe),Y.push(F-K)}X.length===1?G(X[0],Y):G(X.reduce((F,oe)=>F.map((re,ge)=>[...re,...oe[ge]])),Y)}}},[g,Le,z,Un.copy,K,zt,Ge,Me]);cn("copy",$o,C,!1,!1),cn("cut",d.useCallback(async u=>{var R,k;if(Un.cut&&(((R=zt.current)==null?void 0:R.contains(document.activeElement))===!0||((k=a.current)==null?void 0:k.contains(document.activeElement))===!0)&&(await $o(u),z.current!==void 0)){let P={current:{cell:z.current.cell,range:z.current.range,rangeStack:[]},rows:yt.empty(),columns:yt.empty()};const A=on==null?void 0:on(P);if(A===!1||(P=A===!0?P:A,P.current===void 0))return;Wr(P.current.range)}},[Wr,z,Un.cut,$o,zt,on]),C,!1,!1);const kp=d.useCallback((u,R)=>{if(ie!==void 0)return K!==0&&(u=u.map(A=>[A[0]-K,A[1]])),void ie(u,R);if(u.length===0||R===-1)return;const[k,P]=u[R];h.current!==void 0&&h.current[0]===k&&h.current[1]===P||(h.current=[k,P],Cr(k,P,!1,!1))},[ie,K,Cr]),[Ri,Ei]=((F0=jt==null?void 0:jt.current)==null?void 0:F0.cell)??[],Ii=d.useRef(Qt);Ii.current=Qt,d.useLayoutEffect(()=>{var u,R,k,P;!Da.current||Dn.current||Ri===void 0||Ei===void 0||Ri===((R=(u=Ae.current)==null?void 0:u.current)==null?void 0:R.cell[0])&&Ei===((P=(k=Ae.current)==null?void 0:k.current)==null?void 0:P.cell[1])||Ii.current(Ri,Ei),Dn.current=!1},[Ri,Ei]);const H0=z.current!==void 0&&(z.current.cell[0]>=Ct.length||z.current.cell[1]>=fn);d.useLayoutEffect(()=>{H0&&_e(fi,!1)},[H0,_e]);const Mp=d.useMemo(()=>Wt===!0&&(ne==null?void 0:ne.tint)===!0?yt.fromSingleSelection(fn-1):yt.empty(),[fn,Wt,ne==null?void 0:ne.tint]),Rp=d.useCallback(u=>typeof ve=="boolean"?ve:(ve==null?void 0:ve(u-K))??!0,[K,ve]),Ep=d.useMemo(()=>{if(Ea===void 0||a.current===null)return null;const{bounds:u,group:R}=Ea,k=a.current.getBoundingClientRect();return d.createElement(gg,{bounds:u,group:R,canvasBounds:k,onClose:()=>Ia(void 0),onFinish:P=>{Ia(void 0),fe==null||fe(R,P)}})},[fe,Ea]),Ip=Math.min(Ct.length,Pe+(wn?1:0));d.useImperativeHandle(t,()=>({appendRow:(u,R)=>eo(u+K,R),updateCells:u=>{var R;return K!==0&&(u=u.map(k=>({cell:[k.cell[0]+K,k.cell[1]]}))),(R=ln.current)==null?void 0:R.damage(u)},getBounds:(u,R)=>{var k;if((a==null?void 0:a.current)!==null&&(zt==null?void 0:zt.current)!==null){if(u===void 0&&R===void 0){const P=a.current.getBoundingClientRect(),A=P.width/zt.current.clientWidth;return{x:P.x-zt.current.scrollLeft*A,y:P.y-zt.current.scrollTop*A,width:zt.current.scrollWidth*A,height:zt.current.scrollHeight*A}}return(k=ln.current)==null?void 0:k.getBounds((u??0)+K,R)}},focus:()=>{var u;return(u=ln.current)==null?void 0:u.focus()},emit:async u=>{switch(u){case"delete":Wo({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!1,key:"Delete",keyCode:46,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-right":Wo({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"r",keyCode:82,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-down":Wo({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"d",keyCode:68,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"copy":await $o(void 0,!0);break;case"paste":await za()}},scrollTo:Qt,remeasureColumns:u=>{for(const R of u)ki(R+K)},getMouseArgsForPosition:(u,R,k)=>{if((ln==null?void 0:ln.current)===null)return;const P=ln.current.getMouseArgsForPosition(u,R,k);return P!==void 0?{...P,location:[P.location[0]-K,P.location[1]]}:void 0}}),[eo,ki,zt,$o,Wo,za,K,Qt]);const[O0,P0]=qn??[],Tp=d.useCallback(u=>{const[R,k]=u;k!==-1?O0===R&&P0===k||(Lt({cell:u,range:{x:R,y:k,width:1,height:1}},!0,!1,"keyboard-nav"),Qt(R,k)):Oe!=="none"&&(ht(yt.fromSingleSelection(R),void 0,!1),bn())},[Oe,bn,Qt,O0,P0,Lt,ht]),[Hp,Op]=d.useState(!1),D0=d.useRef(Fc(u=>{Op(u)},5)),Pp=d.useCallback(()=>{D0.current(!0),z.current===void 0&&z.columns.length===0&&z.rows.length===0&&s===void 0&&Lt({cell:[K,wi],range:{x:K,y:wi,width:1,height:1}},!0,!1,"keyboard-select")},[wi,z,s,K,Lt]),Dp=d.useCallback(()=>{D0.current(!1)},[]),[zp,Ap]=d.useMemo(()=>{let u;const R=(lt==null?void 0:lt.scrollbarWidthOverride)??Ki(),k=Ge+(Wt?1:0);if(typeof Vn=="number")u=sr+k*Vn;else{let A=0;const G=Math.min(k,10);for(let $=0;$<G;$++)A+=Vn($);A=Math.floor(A/G),u=sr+k*A}u+=R;const P=Ct.reduce((A,G)=>G.width+A,0)+R;return[`${Math.min(1e5,P)}px`,`${Math.min(1e5,u)}px`]},[Ct,lt==null?void 0:lt.scrollbarWidthOverride,Vn,Ge,Wt,sr]),Fp=d.useMemo(()=>Xa(gt),[gt]);return d.createElement(Wa.Provider,{value:gt},d.createElement(bg,{style:Fp,className:ce,inWidth:m??zp,inHeight:E??Ap},d.createElement(hg,{fillHandle:Je,drawFocusRing:zr,experimental:lt,fixedShadowX:rt,fixedShadowY:De,getRowThemeOverride:jn,headerIcons:Nt,imageWindowLoader:gn,initialSize:Zt,isDraggable:rn,onDragLeave:Bt,onRowMoved:Xt,overscrollX:Do,overscrollY:zo,preventDiagonalScrolling:kn,rightElement:pn,rightElementProps:kt,smoothScrollX:Vt,smoothScrollY:Et,className:ce,enableGroups:Jr,onCanvasFocused:Pp,onCanvasBlur:Dp,canvasRef:a,onContextMenu:Sp,theme:gt,cellXOffset:lp,cellYOffset:wi,accessibilityHeight:_r.height,onDragEnd:yp,columns:Ct,nonGrowWidth:vi,drawHeader:br,onColumnProposeMove:mp,drawCell:ar,disabledRows:Mp,freezeColumns:Ip,lockColumns:K,firstColAccessible:K===0,getCellContent:Tn,minColumnWidth:ir,maxColumnWidth:Ar,searchInputRef:l,showSearch:Ce,onSearchClose:he,highlightRegions:sp,getCellsForSelection:Le,getGroupDetails:Ma,headerHeight:Fr,isFocused:Hp,groupHeaderHeight:Jr?Po:0,freezeTrailingRows:xe+(Wt&&(ne==null?void 0:ne.sticky)===!0?1:0),hasAppendRow:Wt,onColumnResize:et,onColumnResizeEnd:dn,onColumnResizeStart:en,onCellFocused:Tp,onColumnMoved:vp,onDragStart:wp,onHeaderMenuClick:fp,onHeaderIndicatorClick:gp,onItemHovered:Pa,isFilling:(s==null?void 0:s.fillHandle)===!0,onMouseMove:hp,onKeyDown:Wo,onKeyUp:pe,onMouseDown:cp,onMouseUp:dp,onDragOverCell:Ve,onDrop:Ke,onSearchResultsChanged:kp,onVisibleRegionChanged:pp,clientSize:yn,rowHeight:Vn,searchResults:W,searchValue:U,onSearchValueChange:N,rows:fn,scrollRef:zt,selection:z,translateX:_r.tx,translateY:_r.ty,verticalBorder:Rp,gridRef:ln,getCellRenderer:Ht,resizeIndicator:Ca}),Ep,o!==void 0&&d.createElement(d.Suspense,{fallback:null},d.createElement(kg,{...o,validateCell:Mt,bloom:D,id:Cp,getCellRenderer:Ht,className:(lt==null?void 0:lt.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:_n,imageEditorOverride:y,onFinishEditing:xp,markdownDivCreateNode:p,isOutsideClick:wr,customEventTarget:lt==null?void 0:lt.eventTarget}))))});function s0(e){const{cell:t,posX:n,posY:r,bounds:o,theme:i}=e,{width:l,height:a,x:s,y:c}=o,h=t.maxSize??i.checkboxMaxSize,C=Math.floor(o.y+a/2),y=Nc(h,a,i.cellVerticalPadding),b=jc(t.contentAlign??"center",s,l,i.cellHorizontalPadding,y),p=_c(b,C,y),m=Bc(s+n,c+r,p);return Bi(t)&&m}const Eg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??"false"},kind:me.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>function(t,n,r,o,i){if(!r&&n===Qo)return;const{ctx:l,hoverAmount:a,theme:s,rect:c,highlighted:h,hoverX:C,hoverY:y,cell:{contentAlign:b}}=t,{x:p,y:m,width:E,height:g}=c;let w=!1;if(i>0){let x=r?1-i+i*a:.4;if(n===Qo&&(x*=a),x===0)return;x<1&&(w=!0,l.globalAlpha=x)}sa(l,s,n,p,m,E,g,h,C,y,o,b),w&&(l.globalAlpha=1)}(e,e.cell.data,Bi(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{s0(e)&&e.preventDefault()},onClick:e=>{if(s0(e))return{...e.cell,data:r0(e.cell.data)}},onPaste:(e,t)=>{let n=Qo;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=Ni),n===t.data?void 0:{...t,data:n}}},Ig=Cn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),Tg=e=>{const{bubbles:t}=e;return d.createElement(Ig,null,t.map((n,r)=>d.createElement("div",{key:r,className:"boe-bubble"},n)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},Hg={getAccessibilityString:e=>Wc(e.data),kind:me.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>{const r=t.data.reduce((o,i)=>e.measureText(i).width+o+2*n.bubblePadding+n.bubbleMargin,0);return t.data.length===0?2*n.cellHorizontalPadding:r+2*n.cellHorizontalPadding-n.bubbleMargin},draw:e=>function(t,n){const{rect:r,theme:o,ctx:i,highlighted:l}=t,{x:a,y:s,width:c,height:h}=r;let C=a+o.cellHorizontalPadding;const y=[];for(const b of n){if(C>a+c)break;const p=Kr(b,i,o.baseFontFull).width;y.push({x:C,width:p}),C+=p+2*o.bubblePadding+o.bubbleMargin}i.beginPath();for(const b of y)Yn(i,b.x,s+(h-o.bubbleHeight)/2,b.width+2*o.bubblePadding,o.bubbleHeight,o.roundingRadius??o.bubbleHeight/2);i.fillStyle=l?o.bgBubbleSelected:o.bgBubble,i.fill();for(const[b,p]of y.entries())i.beginPath(),i.fillStyle=o.textBubble,i.fillText(n[b],p.x+o.bubblePadding,s+h/2+fr(i,o))}(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(Tg,{bubbles:t.data})},onPaste:()=>{}},Og=Cn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),Pg=e=>{const{drilldowns:t}=e;return d.createElement(Og,null,t.map((n,r)=>d.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&d.createElement("img",{src:n.img}),d.createElement("div",null,n.text))))},Dg={getAccessibilityString:e=>Wc(e.data.map(t=>t.text)),kind:me.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,o)=>e.measureText(o.text).width+r+2*n.bubblePadding+n.bubbleMargin+(o.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>function(t,n){const{rect:r,theme:o,ctx:i,imageLoader:l,col:a,row:s}=t,{x:c,width:h}=r,C=o.baseFontFull,y=tu(i,C),b=Math.min(r.height,Math.max(16,2*Math.ceil(y*o.lineHeight))),p=Math.floor(r.y+(r.height-b)/2),m=b-10,E=o.bubblePadding,g=o.bubbleMargin;let w=c+o.cellHorizontalPadding;const x=o.roundingRadius??6,I=function(M,S,H,f){const B=Math.ceil(window.devicePixelRatio),D=5,O=H-2*D,T=4,j=H*B,V=f+D,Z=3*f,J=(Z+2*D)*B,ce=`${M},${S},${B},${H}`;if(wa[ce]!==void 0)return{el:wa[ce],height:j,width:J,middleWidth:T*B,sideWidth:V*B,padding:D*B,dpr:B};const le=document.createElement("canvas"),q=le.getContext("2d");return q===null?null:(le.width=J,le.height=j,q.scale(B,B),wa[ce]=le,q.beginPath(),Yn(q,D,D,Z,O,f),q.shadowColor="rgba(24, 25, 34, 0.4)",q.shadowBlur=1,q.fillStyle=M,q.fill(),q.shadowColor="rgba(24, 25, 34, 0.3)",q.shadowOffsetY=1,q.shadowBlur=5,q.fillStyle=M,q.fill(),q.shadowOffsetY=0,q.shadowBlur=0,q.shadowBlur=0,q.beginPath(),Yn(q,D+.5,D+.5,Z,O,f),q.strokeStyle=S,q.lineWidth=1,q.stroke(),{el:le,height:j,width:J,sideWidth:V*B,middleWidth:f*B,padding:D*B,dpr:B})}(o.bgCell,o.drilldownBorder,b,x),v=[];for(const M of n){if(w>c+h)break;const S=Kr(M.text,i,C).width;let H=0;M.img!==void 0&&l.loadOrGetImage(M.img,a,s)!==void 0&&(H=m-8+4);const f=S+H+2*E;v.push({x:w,width:f}),w+=f+g}if(I!==null){const{el:M,height:S,middleWidth:H,sideWidth:f,width:B,dpr:D,padding:O}=I,T=f/D,j=O/D;for(const V of v){const Z=Math.floor(V.x),J=Math.floor(V.width),ce=J-2*(T-j);i.imageSmoothingEnabled=!1,i.drawImage(M,0,0,f,S,Z-j,p,T,b),ce>0&&i.drawImage(M,f,0,H,S,Z+(T-j),p,ce,b),i.drawImage(M,B-f,0,f,S,Z+J-(T-j),p,T,b),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[M,S]of v.entries()){const H=n[M];let f=S.x+E;if(H.img!==void 0){const B=l.loadOrGetImage(H.img,a,s);if(B!==void 0){const D=m-8;let O=0,T=0,j=B.width,V=B.height;j>V?(O+=(j-V)/2,j=V):V>j&&(T+=(V-j)/2,V=j),i.beginPath(),Yn(i,f,p+b/2-D/2,D,D,o.roundingRadius??3),i.save(),i.clip(),i.drawImage(B,O,T,j,V,f,p+b/2-D/2,D,D),i.restore(),f+=D+4}}i.beginPath(),i.fillStyle=o.textBubble,i.fillText(H.text,f,p+b/2+fr(i,o))}}(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(Pg,{drilldowns:t.data})},onPaste:()=>{}},wa={},zg={getAccessibilityString:e=>e.data.join(", "),kind:me.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>function(t,n,r,o){const{rect:i,col:l,row:a,theme:s,ctx:c,imageLoader:h}=t,{x:C,y,height:b,width:p}=i,m=b-2*s.cellVerticalPadding,E=[];let g=0;for(let x=0;x<n.length;x++){const I=n[x];if(I.length===0)continue;const v=h.loadOrGetImage(I,l,a);v!==void 0&&(E[x]=v,g+=v.width*(m/v.height)+ya)}if(g===0)return;g-=ya;let w=C+s.cellHorizontalPadding;o==="right"?w=Math.floor(C+p-s.cellHorizontalPadding-g):o==="center"&&(w=Math.floor(C+p/2-g/2));for(const x of E){if(x===void 0)continue;const I=x.width*(m/x.height);r>0&&(c.beginPath(),Yn(c,w,y+s.cellVerticalPadding,I,m,r),c.save(),c.clip()),c.drawImage(x,w,y+s.cellVerticalPadding,I,m),r>0&&c.restore(),w+=I+ya}}(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>50*t.data.length,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:r}=e,o=r??u1;return d.createElement(o,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:i=>{n({...t,data:[i]})}})},onPaste:(e,t)=>{const n=(e=e.trim()).split(",").map(r=>{try{return new URL(r),r}catch{return}}).filter(r=>r!==void 0);if(n.length!==t.data.length||!n.every((r,o)=>r===t.data[o]))return{...t,data:n}}},ya=4,Ag={getAccessibilityString:()=>"",kind:me.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:o,rect:i,theme:l}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let a=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(a+=Math.round(function(h,C){let y=49632*h+325176*C;return y^=y<<13,y^=y>>17,y^=y<<5,y/4294967295*2}(n,r)*t.skeletonWidthVariability));const s=l.cellHorizontalPadding;a+2*s>=i.width&&(a=i.width-2*s-1);const c=t.skeletonHeight??Math.min(18,i.height-2*l.cellVerticalPadding);Yn(o,i.x+s,i.y+(i.height-c)/2,a,c,l.roundingRadius??3),o.fillStyle=Hr(l.textDark,.1),o.fill()},onPaste:()=>{}},c0=Cn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[e=>e.targetWidth,"px"]}}),Fg=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:o,targetRect:i,onFinish:l,validatedSelection:a}=e,s=t.data,c=t.readonly===!0,[h,C]=d.useState(s===""||r),y=d.useCallback(()=>{C(p=>!p)},[]),b=s?"gdg-ml-6":"";return h?d.createElement(c0,{targetWidth:i.width-20},d.createElement(oi,{autoFocus:!0,highlight:!1,validatedSelection:a,value:s,onKeyDown:p=>{p.key==="Enter"&&p.stopPropagation()},onChange:n}),d.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${b}`,onClick:()=>l(t)},d.createElement(l1,null))):d.createElement(c0,{targetWidth:i.width},d.createElement(h1,{contents:s,createNode:o}),!c&&d.createElement(d.Fragment,null,d.createElement("div",{className:"spacer"}),d.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${b}`,onClick:y},d.createElement(Gi,null))),d.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Lg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:me.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:yo,measure:(e,t,n)=>{const r=t.data.split(`
130
+ `)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>Qn(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:o,markdownDivCreateNode:i,forceEditMode:l,validatedSelection:a}=e;return d.createElement(Fg,{onFinish:o,targetRect:r,value:n,validatedSelection:a,onChange:s=>t({...n,data:s.target.value}),forceEditMode:l,createNode:i})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},_g={getAccessibilityString:e=>e.row.toString(),kind:Hn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:function(e,t){const{ctx:n,theme:r}=e,o=r.markerFontFull,i=t??{};return(i==null?void 0:i.font)!==o&&(n.font=o,i.font=o),i.deprep=jg,n.textAlign="center",i},measure:()=>44,draw:e=>function(t,n,r,o,i,l){const{ctx:a,rect:s,hoverAmount:c,theme:h}=t,{x:C,y,width:b,height:p}=s,m=r?1:o==="checkbox-visible"?.6+.4*c:c;if(o!=="number"&&m>0){a.globalAlpha=m;const E=7*(r?c:1);if(sa(a,h,r,i?C+E:C,y,i?b-E:b,p,!0,void 0,void 0,h.checkboxMaxSize,"center",l),i){a.globalAlpha=c,a.beginPath();for(const g of[3,6])for(const w of[-5,-1,3])a.rect(C+g,y+p/2+w,2,2);a.fillStyle=h.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(o==="number"||o==="both"&&!r){const E=n.toString(),g=h.markerFontFull,w=C+b/2;o==="both"&&c!==0&&(a.globalAlpha=1-c),a.fillStyle=h.textLight,a.font=g,a.fillText(E,w,y+p/2+fr(a,g)),c!==0&&(a.globalAlpha=1)}}(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:o}=e,{width:i,height:l}=t,a=n.drawHandle?7+(i-7)/2:i/2,s=l/2;if(Math.abs(r-a)<=10&&Math.abs(o-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function jg(e){const{ctx:t}=e;t.textAlign="start"}const Ng={getAccessibilityString:()=>"",kind:Hn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>function(t,n,r){const{ctx:o,rect:i,hoverAmount:l,theme:a,spriteManager:s}=t,{x:c,y:h,width:C,height:y}=i;o.beginPath(),o.globalAlpha=l,o.rect(c+1,h+1,C,y-2),o.fillStyle=a.bgHeaderHovered,o.fill(),o.globalAlpha=1,o.beginPath();const b=n!=="";let p=0;if(r!==void 0){const E=y-8,g=c+8/2,w=h+8/2;s.drawSprite(r,"normal",o,g,w,E,a,b?1:l),p=E}else{p=24;const m=12,E=b?m:l*m,g=b?0:(1-l)*m*.5,w=a.cellHorizontalPadding+4;E>0&&(o.moveTo(c+w+g,h+y/2),o.lineTo(c+w+g+E,h+y/2),o.moveTo(c+w+g+.5*E,h+y/2-.5*E),o.lineTo(c+w+g+.5*E,h+y/2+.5*E),o.lineWidth=2,o.strokeStyle=a.bgIconHeader,o.lineCap="round",o.stroke())}o.fillStyle=a.textMedium,o.fillText(n,p+c+a.cellHorizontalPadding+.5,h+y/2+fr(o,a)),o.beginPath()}(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function u0(e,t,n,r,o,i,l){e.textBaseline="alphabetic";const a=function(s,c,h,C,y){const b=C.cellHorizontalPadding,p=C.cellVerticalPadding;if(y)return{x:c.x+b/2,y:c.y+p/2+1,width:c.width-b,height:c.height-p-1};const m=Kr(h,s,C.baseFontFull,"alphabetic"),E=c.height-p,g=Math.min(E,2.5*m.actualBoundingBoxAscent);return{x:c.x+b/2,y:c.y+(c.height-g)/2+1,width:m.width+3*b,height:g-1}}(e,o,r,t,(n==null?void 0:n.fullSize)??!1);e.beginPath(),Yn(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=i,e.fillStyle=(n==null?void 0:n.bgColor)??Hr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",l==null||l("text")}const Bg=d.lazy(async()=>await L0(()=>import("./number-overlay-editor-Dns19i7x.js"),__vite__mapDeps([4,1,2,3]),import.meta.url)),Wg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:me.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:yo,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:o,rect:i,overrideCursor:l}=e,{hoverEffect:a,displayData:s,hoverEffectTheme:c}=n;a===!0&&t>0&&u0(r,o,c,s,i,t,l),Qn(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+2*n.cellHorizontalPadding,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return d.createElement(d.Suspense,{fallback:null},d.createElement(Bg,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:o,onChange:i=>n({...r,data:Number.isNaN(i.floatValue??0)?0:i.floatValue})}))},onPaste:(e,t,n)=>{const r=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!Number.isNaN(r)&&t.data!==r)return{...t,data:r,displayData:n.formattedString??t.displayData}}},$g={getAccessibilityString:()=>"",measure:()=>108,kind:me.Protected,needsHover:!1,needsHoverPosition:!1,draw:function(e){const{ctx:t,theme:n,rect:r}=e,{x:o,y:i,height:l}=r;t.beginPath();const a=2.5;let s=o+n.cellHorizontalPadding+a;const c=i+l/2,h=Math.cos(Lc(30))*a,C=Math.sin(Lc(30))*a;for(let y=0;y<12;y++)t.moveTo(s,c-a),t.lineTo(s,c+a),t.moveTo(s+h,c-C),t.lineTo(s-h,c+C),t.moveTo(s-h,c-C),t.lineTo(s+h,c+C),s+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()},onPaste:()=>{}},Xg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:me.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>yo(e,t,e.theme.textLight),draw:e=>Qn(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+2*n.cellHorizontalPadding,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return $t.createElement(oi,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:o,onChange:i=>n({...r,data:i.target.value})})},onPaste:()=>{}},Gg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:me.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:yo,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:o,rect:i,theme:l,overrideCursor:a}=e,{displayData:s,contentAlign:c,hoverEffect:h,allowWrapping:C,hoverEffectTheme:y}=t;h===!0&&n>0&&u0(o,l,y,s,i,n,a),Qn(e,s,c,C,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
131
+ `,t.allowWrapping===!0?void 0:1);let o=0;for(const i of r)o=Math.max(o,e.measureText(i).width);return o+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:r,value:o,validatedSelection:i}=t;return d.createElement(oi,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:o.readonly!==!0,disabled:o.readonly===!0,altNewline:!0,value:o.data,validatedSelection:i,onChange:l=>r({...o,data:l.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Yg=Cn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Kg=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:o,validatedSelection:i,preview:l}=e,[a,s]=d.useState(!o&&(t===""||r)),c=d.useCallback(()=>{s(!0)},[]);return a?d.createElement(oi,{validatedSelection:i,highlight:!0,autoFocus:!0,value:t,onChange:n}):d.createElement(Yg,null,d.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},l),!o&&d.createElement("div",{className:"gdg-edit-icon",onClick:c},d.createElement(Gi,null)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function d0(e,t,n,r){let o=n.cellHorizontalPadding;const i=t.height/2-e.actualBoundingBoxAscent/2,l=e.width,a=e.actualBoundingBoxAscent;return r==="right"?o=t.width-l-n.cellHorizontalPadding:r==="center"&&(o=t.width/2-l/2),{x:o,y:i,width:l,height:a}}function h0(e){const{cell:t,bounds:n,posX:r,posY:o,theme:i}=e,l=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const a=Jc(l,i.baseFontFull);if(a===void 0)return!1;const s=d0(a,n,i,t.contentAlign);return Dr({x:s.x-4,y:s.y-4,width:s.width+8,height:s.height+8},r,o)}const Vg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:me.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:yo,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:o,hoverY:i,rect:l,ctx:a}=e,s=t.displayData??t.data,c=t.hoverEffect===!0;if(r!==void 0&&c&&o!==void 0&&i!==void 0){const h=d0(Kr(s,a,n.baseFontFull),l,n,t.contentAlign),{x:C,y,width:b,height:p}=h;if(o>=C-4&&o<=C-4+b+8&&i>=y-4&&i<=y-4+p+8){const m=fr(a,n.baseFontFull);r("pointer");const E=5,g=y-m;a.beginPath(),a.moveTo(l.x+C,Math.floor(l.y+g+p+E)+.5),a.lineTo(l.x+C+b,Math.floor(l.y+g+p+E)+.5),a.strokeStyle=n.linkColor,a.stroke(),a.save(),a.fillStyle=e.cellFillColor,Qn({...e,rect:{...l,x:l.x-1}},s,t.contentAlign),Qn({...e,rect:{...l,x:l.x-2}},s,t.contentAlign),Qn({...e,rect:{...l,x:l.x+1}},s,t.contentAlign),Qn({...e,rect:{...l,x:l.x+2}},s,t.contentAlign),a.restore()}}a.fillStyle=c?n.linkColor:n.textDark,Qn(e,s,t.contentAlign)},onSelect:e=>{h0(e)&&e.preventDefault()},onClick:e=>{var n;const{cell:t}=e;h0(e)&&((n=t.onClickUri)==null||n.call(t,e))},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+2*n.cellHorizontalPadding,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:r,forceEditMode:o,validatedSelection:i}=t;return d.createElement(Kg,{forceEditMode:r.readonly!==!0&&(o||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:i,readonly:r.readonly===!0,onChange:l=>n({...r,data:l.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Ug=[_g,Ng,Eg,Hg,Dg,zg,Ag,Lg,Wg,$g,Xg,Gg,Vg];var f0,g0,qg=function(){if(g0)return f0;g0=1;var e=Ac(),t=Er();return f0=function(n,r,o){var i=!0,l=!0;if(typeof n!="function")throw new TypeError("Expected a function");return t(o)&&(i="leading"in o?!!o.leading:i,l="trailing"in o?!!o.trailing:l),e(n,r,{leading:i,maxWait:r,trailing:l})}}();const Jg=Sr(qg),ba=[];class Qg extends ru{constructor(){super(...arguments);ft(this,"imageLoaded",()=>{});ft(this,"loadedLocations",[]);ft(this,"cache",{});ft(this,"sendLoaded",Jg(()=>{this.imageLoaded(new bo(this.loadedLocations)),this.loadedLocations=[]},20));ft(this,"clearOutOfWindow",()=>{const n=Object.keys(this.cache);for(const r of n){const o=this.cache[r];let i=!1;for(let l=0;l<o.cells.length;l++){const a=o.cells[l];if(this.isInWindow(a)){i=!0;break}}i?o.cells=o.cells.filter(this.isInWindow):(o.cancel(),delete this.cache[r])}})}setCallback(n){this.imageLoaded=n}loadImage(n,r,o,i){let l=!1;const a=ba.pop()??new Image;let s=!1;const c={img:void 0,cells:[Ln(r,o)],url:n,cancel:()=>{s||(s=!0,ba.length<12?ba.unshift(a):l||(a.src=""))}},h=new Promise(C=>a.addEventListener("load",()=>C(null)));requestAnimationFrame(async()=>{try{a.src=n,await h,await a.decode();const C=this.cache[i];if(C!==void 0&&!s){C.img=a;for(const y of C.cells)this.loadedLocations.push(ta(y));l=!0,this.sendLoaded()}}catch{c.cancel()}}),this.cache[i]=c}loadOrGetImage(n,r,o){const i=n,l=this.cache[i];if(l!==void 0){const a=Ln(r,o);return l.cells.includes(a)||l.cells.push(a),l.img}this.loadImage(n,r,o,i)}}const Zg=d.forwardRef((e,t)=>{const n=d.useMemo(()=>({...E1,...e.headerIcons}),[e.headerIcons]),r=d.useMemo(()=>e.renderers??Ug,[e.renderers]),o=d.useMemo(()=>e.imageWindowLoader??new Qg,[e.imageWindowLoader]);return d.createElement(Rg,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:o})});function ep(e){switch(e){case"string":default:return me.Text;case"number":return me.Number;case"boolean":return me.Boolean}}function tp(e){switch(e){case"string":case"unknown":return Jn.HeaderString;case"number":case"integer":return Jn.HeaderNumber;case"boolean":return Jn.HeaderBoolean;case"date":case"datetime":return Jn.HeaderDate;case"time":return Jn.HeaderTime;default:return _0(e),Jn.HeaderString}}function p0(e){return"rowIdx"in e&&"columnId"in e&&"value"in e}function np(e){return"rowIdx"in e&&"type"in e}function rp(e){return"columnIdx"in e&&"type"in e}function op(e){return e==="light"?{lineHeight:1.25}:{lineHeight:1.25,accentColor:"#7c3aed",accentLight:"rgba(124, 58, 237, 0.15)",textDark:"#f4f4f5",textMedium:"#a1a1aa",textLight:"#71717a",textBubble:"#f4f4f5",bgIconHeader:"#a1a1aa",fgIconHeader:"#18181b",textHeader:"#d4d4d8",textHeaderSelected:"#18181b",bgCell:"#18181b",bgCellMedium:"#27272a",bgHeader:"#27272a",bgHeaderHasFocus:"#3f3f46",bgHeaderHovered:"#3f3f46",bgBubble:"#27272a",bgBubbleSelected:"#7c3aed",bgSearchResult:"#312e81",borderColor:"#27272a",drilldownBorder:"#7c3aed",linkColor:"#818cf8",headerFontStyle:"bold 14px",baseFontStyle:"13px"}}const ip=e=>{const t=j0.c(19),{currentColumnName:n,onRename:r,onCancel:o}=e,[i,l]=d.useState("");let a;t[0]!==n||t[1]!==i||t[2]!==r?(a=()=>{i.trim()&&(r(i.trim()),l(n))},t[0]=n,t[1]=i,t[2]=r,t[3]=a):a=t[3];const s=a;let c;t[4]!==s||t[5]!==o?(c=w=>{w.key==="Enter"?s():w.key==="Escape"&&o()},t[4]=s,t[5]=o,t[6]=c):c=t[6];const h=c;let C,y,b,p;t[7]===Symbol.for("react.memo_cache_sentinel")?(C=nt.jsxs(N0,{children:[nt.jsx($p,{className:"mr-2 h-3.5 w-3.5"}),"Rename column"]}),t[7]=C):C=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(y=nt.jsx(_a,{htmlFor:"rename-input",children:"Column name"}),t[8]=y):y=t[8],t[9]===Symbol.for("react.memo_cache_sentinel")?(b=w=>l(w.target.value),t[9]=b):b=t[9],t[10]!==h||t[11]!==i?(p=nt.jsxs("div",{children:[y,nt.jsx(B0,{value:i,onChange:b,placeholder:"Enter new column name",className:"mt-1",onKeyDown:h})]}),t[10]=h,t[11]=i,t[12]=p):p=t[12];const m=!i.trim();let E,g;return t[13]!==s||t[14]!==m?(E=nt.jsx(ja,{onClick:s,disabled:m,size:"sm",className:"w-full",children:"Rename"}),t[13]=s,t[14]=m,t[15]=E):E=t[15],t[16]!==p||t[17]!==E?(g=nt.jsxs(W0,{children:[C,nt.jsx($0,{children:nt.jsx(X0,{className:"w-64 p-4",children:nt.jsxs("div",{className:"space-y-3",children:[p,E]})})})]}),t[16]=p,t[17]=E,t[18]=g):g=t[18],g},m0=e=>{const t=j0.c(77),{direction:n,onAdd:r,onCancel:o}=e,[i,l]=d.useState(""),[a,s]=d.useState("string");let c,h,C,y,b,p,m,E,g,w,x,I,v,M,S,H,f,B;if(t[0]!==i||t[1]!==a||t[2]!==n||t[3]!==r||t[4]!==o){const J=["string","number","boolean","datetime"];let ce,le;t[20]!==i||t[21]!==a||t[22]!==r?(ce=()=>{i.trim()&&(r(i.trim(),a),l(""),s("string"))},t[20]=i,t[21]=a,t[22]=r,t[23]=ce):ce=t[23],p=ce,t[24]!==p||t[25]!==o?(le=pe=>{pe.key==="Enter"?p():pe.key==="Escape"&&o()},t[24]=p,t[25]=o,t[26]=le):le=t[26];const q=le;let Q;b=W0,t[27]===Symbol.for("react.memo_cache_sentinel")?(Q=nt.jsx(Xp,{className:"mr-2 h-3.5 w-3.5"}),t[27]=Q):Q=t[27],t[28]!==n?(S=nt.jsxs(N0,{children:[Q,"Add column to the ",n]}),t[28]=n,t[29]=S):S=t[29],y=$0,C=X0,M="w-64 p-4",I="space-y-3";const fe=`add-column-input-${n}`;let ee;t[30]!==fe?(ee=nt.jsx(_a,{htmlFor:fe,children:"Column name"}),t[30]=fe,t[31]=ee):ee=t[31];const se=`add-column-input-${n}`;let ie,W;t[32]===Symbol.for("react.memo_cache_sentinel")?(ie=pe=>l(pe.target.value),t[32]=ie):ie=t[32],t[33]!==i||t[34]!==q||t[35]!==se?(W=nt.jsx(B0,{id:se,value:i,onChange:ie,placeholder:"Enter column name",className:"mt-1",onKeyDown:q}),t[33]=i,t[34]=q,t[35]=se,t[36]=W):W=t[36],t[37]!==ee||t[38]!==W?(v=nt.jsxs("div",{children:[ee,W]}),t[37]=ee,t[38]=W,t[39]=v):v=t[39];const N=`add-column-type-${n}`;t[40]!==N?(x=nt.jsx(_a,{htmlFor:N,children:"Data type"}),t[40]=N,t[41]=x):x=t[41],h=Gp,E=a,t[42]===Symbol.for("react.memo_cache_sentinel")?(g=pe=>s(pe),t[42]=g):g=t[42];const U=`add-column-type-${n}`;let ue;t[43]===Symbol.for("react.memo_cache_sentinel")?(ue=nt.jsx(Yp,{}),t[43]=ue):ue=t[43],t[44]!==U?(w=nt.jsx(Kp,{id:U,className:"mt-1",children:ue}),t[44]=U,t[45]=w):w=t[45],c=Vp,m=J.map(ap),t[0]=i,t[1]=a,t[2]=n,t[3]=r,t[4]=o,t[5]=c,t[6]=h,t[7]=C,t[8]=y,t[9]=b,t[10]=p,t[11]=m,t[12]=E,t[13]=g,t[14]=w,t[15]=x,t[16]=I,t[17]=v,t[18]=M,t[19]=S}else c=t[5],h=t[6],C=t[7],y=t[8],b=t[9],p=t[10],m=t[11],E=t[12],g=t[13],w=t[14],x=t[15],I=t[16],v=t[17],M=t[18],S=t[19];t[46]!==c||t[47]!==m?(H=nt.jsx(c,{children:m}),t[46]=c,t[47]=m,t[48]=H):H=t[48],t[49]!==h||t[50]!==H||t[51]!==E||t[52]!==g||t[53]!==w?(f=nt.jsxs(h,{value:E,onValueChange:g,children:[w,H]}),t[49]=h,t[50]=H,t[51]=E,t[52]=g,t[53]=w,t[54]=f):f=t[54],t[55]!==f||t[56]!==x?(B=nt.jsxs("div",{children:[x,f]}),t[55]=f,t[56]=x,t[57]=B):B=t[57];const D=!i.trim();let O,T,j,V,Z;return t[58]!==p||t[59]!==D?(O=nt.jsx(ja,{onClick:p,disabled:D,size:"sm",className:"w-full",children:"Add"}),t[58]=p,t[59]=D,t[60]=O):O=t[60],t[61]!==B||t[62]!==O||t[63]!==I||t[64]!==v?(T=nt.jsxs("div",{className:I,children:[v,B,O]}),t[61]=B,t[62]=O,t[63]=I,t[64]=v,t[65]=T):T=t[65],t[66]!==C||t[67]!==T||t[68]!==M?(j=nt.jsx(C,{className:M,children:T}),t[66]=C,t[67]=T,t[68]=M,t[69]=j):j=t[69],t[70]!==y||t[71]!==j?(V=nt.jsx(y,{children:j}),t[70]=y,t[71]=j,t[72]=V):V=t[72],t[73]!==b||t[74]!==V||t[75]!==S?(Z=nt.jsxs(b,{children:[S,V]}),t[73]=b,t[74]=V,t[75]=S,t[76]=Z):Z=t[76],Z};function ap(e){return nt.jsx(Bp,{value:e,children:Wp(e)},e)}function v0(e,t){return e.map(n=>{const r=n,o=Object.keys(r);if(t<0||t>=o.length)return r;const i=o[t],{[i]:l,...a}=r;return a})}function w0(e,t){return t?e.map(n=>({...n,[t]:""})):e}function y0(e,t,n){return t&&n&&t!==n?e.map(r=>{const o=r,{[t]:i,...l}=o;return{...l,[n]:o[t]}}):e}function Ur(e){var l;const{columnFields:t,columnIdx:n,type:r,dataType:o,newColumnName:i}=e;switch(r){case"insert":{if(!i)return La.error("newName is required for insert"),t;const a=Object.entries(t),s=[...a.slice(0,n),[i,o||"string"],...a.slice(n)];return Object.fromEntries(s)}case"remove":{if(n<0||n>=Object.keys(t).length)return t;const a=Object.entries(t),s=(l=a[n])==null?void 0:l[0];if(s){const{[s]:c,...h}=t;return h}return t}case"rename":{if(!i)return La.error("newName is required for rename"),t;if(n<0||n>=Object.keys(t).length)return t;const a=Object.entries(t),s=[...a.slice(0,n),[i,o||"string"],...a.slice(n+1)];return Object.fromEntries(s)}}}let xa;xa=({data:e,setData:t,columnFields:n,setColumnFields:r,editableColumns:o,edits:i,onAddEdits:l,onAddRows:a,onDeleteRows:s,onRenameColumn:c,onDeleteColumn:h,onAddColumn:C})=>{const{theme:y}=Up(),b=d.useRef(null),[p,m]=d.useState(),[E,g]=d.useState(!1),[w,x]=$t.useState({columns:yt.empty(),rows:yt.empty()}),[I,v]=d.useState({}),M=qp();Jp(()=>{if(i.length===0)return;const ie=new Map;for(const N of i)if(p0(N))if(N.rowIdx>=e.length){ie.has(N.rowIdx)||ie.set(N.rowIdx,{});const U=ie.get(N.rowIdx);U&&(U[N.columnId]=N.value)}else t(U=>{const ue=[...U];return ue[N.rowIdx][N.columnId]=N.value,ue});else if(np(N)&&N.type===Hi.Remove)t(U=>U.filter((ue,pe)=>pe!==N.rowIdx));else if(rp(N))switch(N.type){case Hi.Remove:t(U=>v0(U,N.columnIdx)),r(U=>Ur({columnFields:U,columnIdx:N.columnIdx,type:"remove"}));break;case Hi.Insert:r(U=>Ur({columnFields:U,columnIdx:N.columnIdx,type:"insert",newColumnName:N.newName})),t(U=>w0(U,N.newName));break;case Hi.Rename:{const U=S[N.columnIdx].title,ue=N.newName;if(!U||!ue)return;r(pe=>Ur({columnFields:pe,columnIdx:N.columnIdx,type:"rename",newColumnName:ue})),t(pe=>y0(pe,U,ue));break}}const W=[...ie.entries()].sort(([N],[U])=>N-U).map(([,N])=>N);W.length>0&&t(N=>[...N,...W]),M()});const S=d.useMemo(()=>{const ie=[];for(const[W,N]of Object.entries(n)){const U=o==="all"||o.includes(W);ie.push({id:W,title:W,width:I[W],icon:U?tp(N):Jn.ProtectedColumnOverlay,style:"normal",kind:ep(N),dataType:N,hasMenu:!0,themeOverride:U?void 0:{bgCell:y==="light"?"#F9F9FA":"#1e1e21"}})}return ie},[n,I,o,y]),H=d.useCallback(ie=>{const[W,N]=ie,U=e[N][S[W].title],ue=S[W].kind,pe=o==="all"||o.includes(S[W].title);if(ue===me.Boolean){const ze=!!U;return{kind:me.Boolean,allowOverlay:!1,readonly:!pe,data:ze}}return ue===me.Number&&typeof U=="number"?{kind:me.Number,allowOverlay:pe,readonly:!pe,displayData:String(U),data:U}:{kind:me.Text,allowOverlay:pe,readonly:!pe,displayData:String(U),data:String(U)}},[S,e,o]),f=d.useCallback((ie,W)=>{const[N,U]=ie,ue=S[N],pe=ue.title;let ze=W.data;ue.dataType!=="number"&&ue.dataType!=="integer"||W.data!==void 0&&W.data!==""||(ze=null),t(Ue=>{const He=[...Ue];return He[U][pe]=ze,He}),l([{rowIdx:U,columnId:pe,value:ze}])},[S,l,t]),B=d.useCallback((ie,W)=>{v(N=>({...N,[ie.title]:W}))},[]),D=d.useCallback((ie,W,N)=>{const[U,ue]=ie,pe=S[U].title;switch(n[pe]){case"number":case"integer":if(Number.isNaN(Number(W.data)))return!1;break;case"boolean":if(typeof W.data!="boolean")return!1}return!0},[n,S]),O=d.useCallback(ie=>{if(b.current)if(Na.isMetaOrCtrl(ie)&&ie.key==="c")b.current.emit("copy");else{if(!Na.isMetaOrCtrl(ie)||ie.key!=="v")return Na.isMetaOrCtrl(ie)&&ie.key==="f"?(g(W=>!W),ie.stopPropagation(),void ie.preventDefault()):void(ie.key!=="Escape"||g(!1));(function(W){const{selection:N,data:U,setData:ue,onAddEdits:pe,columns:ze,editableColumns:Ue}=W;if(!N.current)return;const{range:He}=N.current,{x:$e,y:be}=He;navigator.clipboard.readText().then(ye=>{if(!ye.trim())return;const Fe=ye.split(`
132
+ `).filter(Ee=>Ee.trim()),Oe=[];for(const Ee of Fe){const ke=Ee.split(" ");Oe.push(ke)}if(Oe.length===0)return;const te=[];for(const[Ee,ke]of Oe.entries()){if(!ke)continue;const Xe=be+Ee;if(Xe>=U.length)break;for(const[Re,qe]of ke.entries()){if(qe===void 0)continue;const Ye=$e+Re;if(!ze||Ye>=ze.length)break;const ot=ze[Ye],Me=ot.dataType;if(Ue!=="all"&&!Ue.includes(ot.title))continue;let Pe=qe;switch(Me){case"integer":case"number":{const tt=Number(qe);if(Number.isNaN(tt))continue;Pe=tt;break}case"boolean":{const tt=qe.toLowerCase();Pe=tt==="true"||tt==="1";break}}const ut=ze[Ye].title;te.push({rowIdx:Xe,columnId:ut,value:Pe})}}te.length>0&&(pe(te),ue(Ee=>{const ke=[...Ee];for(const Xe of te)if(p0(Xe)){const Re=Xe.rowIdx,qe=Xe.columnId;if(Re<ke.length){const Ye=ke[Re];qe in Ye&&(Ye[qe]=Xe.value)}}return ke}))}).catch(ye=>{La.error("Failed to read clipboard data",ye)})})({selection:w,data:e,setData:t,columns:S,editableColumns:o,onAddEdits:l})}},[S,e,o,l,w,t]),T=d.useCallback(()=>{const ie=Object.fromEntries(S.map(W=>{const N=W.dataType;switch(N){case"boolean":return[W.title,!1];case"number":case"integer":return[W.title,null];case"date":case"datetime":case"time":return[W.title,new Date];case"string":case"unknown":return[W.title,""];default:return _0(N),[W.title,""]}}));a([ie]),t(W=>[...W,ie])},[S,a,t]),j=Qp((ie,W)=>{m({col:ie,bounds:W})}),V=async()=>{if(p){const ie=S[p.col].title;await rm(ie),m(void 0)}};function Z(ie){om({title:`Column '${ie}' already exists`,description:"Please enter a different column name",variant:"danger"})}const J=ie=>{if(p){const W=S[p.col].title;if(n[ie])return void Z(ie);const N=S[p.col].dataType;c(p.col,ie),r(U=>Ur({columnFields:U,columnIdx:p.col,type:"rename",dataType:N,newColumnName:ie})),t(U=>y0(U,W,ie)),m(void 0)}},ce=()=>{p&&(h(p.col),r(ie=>Ur({columnFields:ie,columnIdx:p.col,type:"remove"})),t(ie=>v0(ie,p.col)),m(void 0))},le=ie=>{const{direction:W,columnName:N,dataType:U}=ie;if(p){const ue=p.col+(W==="left"?0:1),pe=Math.max(0,Math.min(ue,S.length));if(n[N])return void Z(N);C(pe,N),r(ze=>Ur({columnFields:ze,columnIdx:pe,type:"insert",dataType:U,newColumnName:N})),t(ze=>w0(ze,N)),m(void 0)}},q=(p==null?void 0:p.col)===S.length-1,Q=p!==void 0,fe="mr-2 h-3.5 w-3.5",ee=e.length>1e5,se=o==="all";return nt.jsxs("div",{className:"relative",children:[nt.jsx(Zp,{children:nt.jsx(Zg,{ref:b,getCellContent:H,columns:S,gridSelection:w,onGridSelectionChange:x,rows:e.length,overscrollX:50,smoothScrollX:!ee,smoothScrollY:!ee,validateCell:D,getCellsForSelection:!0,onPaste:!0,showSearch:E,fillHandle:!0,allowedFillDirections:"vertical",onKeyDown:O,height:e.length>10?450:void 0,width:"100%",rowMarkers:{kind:"both"},rowSelectionMode:"multi",onCellEdited:f,onColumnResize:B,onHeaderMenuClick:j,theme:op(y),trailingRowOptions:{hint:"New row",sticky:!0,tint:!0},onRowAppended:T,maxColumnAutoWidth:600,maxColumnWidth:600})}),(()=>{if(!Q)return;const ie=nt.jsxs(nt.Fragment,{children:[se&&nt.jsx(ip,{currentColumnName:S[p.col].title,onRename:J,onCancel:()=>m(void 0)}),nt.jsx(G0,{}),nt.jsx(m0,{direction:"left",onAdd:(W,N)=>le({direction:"left",columnName:W,dataType:N}),onCancel:()=>m(void 0)}),nt.jsx(m0,{direction:"right",onAdd:(W,N)=>le({direction:"right",columnName:W,dataType:N}),onCancel:()=>m(void 0)}),nt.jsx(G0,{}),!q&&se&&nt.jsxs(Y0,{onClick:ce,className:"text-destructive focus:text-destructive",children:[nt.jsx(am,{className:fe}),"Delete column"]})]});return nt.jsx(em,{open:Q,onOpenChange:W=>!W&&m(void 0),children:nt.jsxs(tm,{style:{left:(p==null?void 0:p.bounds.x)??0,top:((p==null?void 0:p.bounds.y)??0)+((p==null?void 0:p.bounds.height)??0)},className:"fixed w-52",children:[nt.jsxs(Y0,{onClick:V,children:[nt.jsx(nm,{className:fe}),"Copy column name"]}),!ee&&ie]})})})(),nt.jsx("div",{className:"absolute bottom-1 right-2 w-26",children:nt.jsx(ja,{variant:"destructive",size:"sm",disabled:w.rows.length===0,className:"right-2 h-7",onClick:()=>{const ie=w.rows.toArray();s(ie);let W=0;for(const N of ie){const U=N-W;t(ue=>ue.filter((pe,ze)=>ze!==U)),W++}x({columns:yt.empty(),rows:yt.empty()})},children:w.rows.length<=1?"Delete row":"Delete rows"})})]})},K0=Object.freeze(Object.defineProperty({__proto__:null,GlideDataEditor:xa,default:xa},Symbol.toStringTag,{value:"Module"}))});export{Ba as C,Wa as T,lm as __tla,kr as a,$a as b,K0 as g,Mr as i,Xa as m,Cn as s};