@marimo-team/frontend 0.14.16-dev2 → 0.14.16-dev8

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 (96) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-DyHRk2Se.js → ConnectedDataExplorerComponent-DsNQfyLH.js} +1 -1
  2. package/dist/assets/{ImageComparisonComponent-HD9PBam2.js → ImageComparisonComponent-DNQSDlqm.js} +1 -1
  3. package/dist/assets/{VegaLite-DsTTfoej.js → VegaLite-Dd73NVPw.js} +1 -1
  4. package/dist/assets/{_baseEach-BkG7xKK8.js → _baseEach-DUr-YE2t.js} +1 -1
  5. package/dist/assets/_baseMap-DwlzGHJj.js +1 -0
  6. package/dist/assets/{_baseUniq-DgvV3ib1.js → _baseUniq-BER37pj6.js} +1 -1
  7. package/dist/assets/{_createAggregator-BunF8rVI.js → _createAggregator-UY6QhV5l.js} +1 -1
  8. package/dist/assets/{any-language-editor-yTNs0DK2.js → any-language-editor-DOBKAuB7.js} +1 -1
  9. package/dist/assets/{architectureDiagram-SUXI7LT5-B6Z-iVBo.js → architectureDiagram-SUXI7LT5-Nbz3TnM8.js} +1 -1
  10. package/dist/assets/{blockDiagram-6J76NXCF-CRQL49QS.js → blockDiagram-6J76NXCF-Bnx1Xazt.js} +1 -1
  11. package/dist/assets/{c4Diagram-6F6E4RAY-Dh2do2aP.js → c4Diagram-6F6E4RAY-CsALZu64.js} +1 -1
  12. package/dist/assets/channel-BrBV0RkZ.js +1 -0
  13. package/dist/assets/{chunk-353BL4L5-G49pRs0R.js → chunk-353BL4L5-BvxJ_yl5.js} +1 -1
  14. package/dist/assets/{chunk-67H74DCK-vLuCyPIb.js → chunk-67H74DCK-Cngg4afk.js} +1 -1
  15. package/dist/assets/{chunk-AACKK3MU-Bs5H2sZg.js → chunk-AACKK3MU-CozTRXAR.js} +1 -1
  16. package/dist/assets/{chunk-BFAMUDN2-BpFKQ3Uf.js → chunk-BFAMUDN2-DVrl3Zsu.js} +1 -1
  17. package/dist/assets/{chunk-E2GYISFI-Q87U9W2b.js → chunk-E2GYISFI-D3Hf8XHY.js} +1 -1
  18. package/dist/assets/{chunk-OW32GOEJ-xTn5nZHI.js → chunk-OW32GOEJ-QEcUm6Lh.js} +1 -1
  19. package/dist/assets/{chunk-SKB7J2MH-R1xSq7mw.js → chunk-SKB7J2MH-DCzd-8z9.js} +1 -1
  20. package/dist/assets/{chunk-SZ463SBG-0kuauVyz.js → chunk-SZ463SBG-jYHYDZhZ.js} +1 -1
  21. package/dist/assets/{circle-play-BbqPWv4H.js → circle-play-4E5p3Y1T.js} +1 -1
  22. package/dist/assets/classDiagram-M3E45YP4-BOmz8niL.js +1 -0
  23. package/dist/assets/classDiagram-v2-YAWTLIQI-BOmz8niL.js +1 -0
  24. package/dist/assets/clone-kqx7Ncoe.js +1 -0
  25. package/dist/assets/{compile-Cskh3b_l.js → compile-DarE-RyI.js} +1 -1
  26. package/dist/assets/{dagre-JOIXM2OF-DAjAIcth.js → dagre-JOIXM2OF-BBm2GW4h.js} +1 -1
  27. package/dist/assets/{data-grid-overlay-editor-BlpRLmjI.js → data-grid-overlay-editor-BR_18m9z.js} +1 -1
  28. package/dist/assets/{diagram-5UYTHUR4-BlEyq9lT.js → diagram-5UYTHUR4-8rH064pN.js} +1 -1
  29. package/dist/assets/{diagram-VMROVX33-lGkvFvJh.js → diagram-VMROVX33-CAXkuDch.js} +1 -1
  30. package/dist/assets/{diagram-ZTM2IBQH-CWo8ihe5.js → diagram-ZTM2IBQH-Awz5fQFD.js} +1 -1
  31. package/dist/assets/{edit-page-p9NwlRE-.js → edit-page-CKns465Y.js} +10 -10
  32. package/dist/assets/{erDiagram-3M52JZNH-DjPR2H4h.js → erDiagram-3M52JZNH-W3SUEzsg.js} +1 -1
  33. package/dist/assets/{flowDiagram-KYDEHFYC-C_SO2Q80.js → flowDiagram-KYDEHFYC-BeGEkN2T.js} +1 -1
  34. package/dist/assets/{ganttDiagram-EK5VF46D-7SMjuxma.js → ganttDiagram-EK5VF46D-DGGEdm1C.js} +1 -1
  35. package/dist/assets/{gitGraphDiagram-GW3U2K7C-B4hPIdoH.js → gitGraphDiagram-GW3U2K7C-hhbsSnZA.js} +1 -1
  36. package/dist/assets/{glide-data-editor-aapCqnDs.js → glide-data-editor-D3qPy6Qm.js} +4 -4
  37. package/dist/assets/{graph-CsCCspx3.js → graph-CBbG5NUF.js} +1 -1
  38. package/dist/assets/{home-page-xwIGmiP5.js → home-page-DHDnCP2J.js} +1 -1
  39. package/dist/assets/{index-CL5EyDti.js → index-1KF7vsi_.js} +1 -1
  40. package/dist/assets/{index-NkBiy8EH.js → index-21KTK6Hh.js} +1 -1
  41. package/dist/assets/{index-CFOA0glY.js → index-25jlv87M.js} +1 -1
  42. package/dist/assets/{index-DGfUnXdC.js → index-63SEZ54I.js} +158 -158
  43. package/dist/assets/{index-D7puMBws.js → index-B0tOYKHG.js} +1 -1
  44. package/dist/assets/{index-CM6n0v_P.js → index-B5m6VcJ7.js} +1 -1
  45. package/dist/assets/{index-BYg2oKt6.js → index-B7PsbvdB.js} +1 -1
  46. package/dist/assets/{index-CSJ3JzxU.js → index-BJae5nEI.js} +1 -1
  47. package/dist/assets/{index-ReojBaRV.js → index-BRDBO_RS.js} +1 -1
  48. package/dist/assets/{index-BFEX8QLh.js → index-BW8brQAQ.js} +1 -1
  49. package/dist/assets/{index-gjGDq_TH.js → index-Bxnk2GWP.js} +1 -1
  50. package/dist/assets/{index-sFjyIlUt.js → index-By64iYJ1.js} +1 -1
  51. package/dist/assets/{index-BRsYrjWO.js → index-C2r-9hHz.js} +1 -1
  52. package/dist/assets/{index-BaepCD0Q.js → index-CY2HYWog.js} +1 -1
  53. package/dist/assets/{index-CjwU127_.js → index-CvehEPCQ.js} +1 -1
  54. package/dist/assets/{index-DtB3P2bz.js → index-DaaHHL7r.js} +1 -1
  55. package/dist/assets/{index-BWA2lV_V.js → index-DkpR6RHl.js} +1 -1
  56. package/dist/assets/{index-CcraSHcO.js → index-DsffC9-F.js} +1 -1
  57. package/dist/assets/{index-Cshuz4C4.js → index-_apHFttj.js} +1 -1
  58. package/dist/assets/infoDiagram-LHK5PUON--l7jWeNB.js +2 -0
  59. package/dist/assets/{journeyDiagram-EWQZEKCU-CmTsJcig.js → journeyDiagram-EWQZEKCU-B2DdkHdi.js} +1 -1
  60. package/dist/assets/{kanban-definition-ZSS6B67P-BoZS3jQ9.js → kanban-definition-ZSS6B67P-B18kn7Vj.js} +1 -1
  61. package/dist/assets/{layout-DL2iBBx0.js → layout-qWciEJAT.js} +1 -1
  62. package/dist/assets/{linear-CRQPBHMT.js → linear-C7jvcX9f.js} +1 -1
  63. package/dist/assets/{links-BLZFB-4I.js → links-Dr9aAp-9.js} +11 -11
  64. package/dist/assets/{mermaid-BuGlwpcr.js → mermaid-Byb7bI_8.js} +4 -4
  65. package/dist/assets/{min-bgqrp99k.js → min-loQyKbYc.js} +1 -1
  66. package/dist/assets/{mindmap-definition-6CBA2TL7-DMPaJzY-.js → mindmap-definition-6CBA2TL7-BZKcGnhv.js} +1 -1
  67. package/dist/assets/{number-overlay-editor-DvLlDwhp.js → number-overlay-editor-BT3S9IO8.js} +1 -1
  68. package/dist/assets/{pieDiagram-NIOCPIFQ-DX2pF8uY.js → pieDiagram-NIOCPIFQ-DvAZGtSj.js} +1 -1
  69. package/dist/assets/{quadrantDiagram-2OG54O6I-BtdsOD88.js → quadrantDiagram-2OG54O6I-Cgih41IE.js} +1 -1
  70. package/dist/assets/{react-plotly-Ct2jQdMc.js → react-plotly-CKx9Bk6B.js} +1 -1
  71. package/dist/assets/{requirementDiagram-QOLK2EJ7-BD83p9mr.js → requirementDiagram-QOLK2EJ7-1ArxLR8Q.js} +1 -1
  72. package/dist/assets/{run-page-BUzqE4oQ.js → run-page-Hp777KBy.js} +1 -1
  73. package/dist/assets/{sankeyDiagram-4UZDY2LN-CirWnsdt.js → sankeyDiagram-4UZDY2LN-DDOlnKuB.js} +1 -1
  74. package/dist/assets/{sequenceDiagram-SKLFT4DO-Cd_hqlk8.js → sequenceDiagram-SKLFT4DO-CB_4qMki.js} +1 -1
  75. package/dist/assets/{slides-component-BjTAsxhg.js → slides-component-D7Sn6cMu.js} +1 -1
  76. package/dist/assets/{sortBy-M1LM3ikx.js → sortBy-BG-nwCCg.js} +1 -1
  77. package/dist/assets/{stateDiagram-MI5ZYTHO-DsKF-grP.js → stateDiagram-MI5ZYTHO-FLyZNEdO.js} +1 -1
  78. package/dist/assets/stateDiagram-v2-5AN5P6BG-fwS8V5NX.js +1 -0
  79. package/dist/assets/{storage-DG2SQOPv.js → storage-B7OMPS8y.js} +3 -3
  80. package/dist/assets/{terminal-4sq-VZW5.js → terminal-C6L3JbAl.js} +1 -1
  81. package/dist/assets/{time-D6ytgu-l.js → time-C1GC5Yd7.js} +1 -1
  82. package/dist/assets/{timeline-definition-MYPXXCX6-B4SMvaUL.js → timeline-definition-MYPXXCX6-f9NFUf6t.js} +1 -1
  83. package/dist/assets/{tracing-DyhcrsYa.js → tracing-CjHQXoC9.js} +2 -2
  84. package/dist/assets/{trash-C7XIzpau.js → trash-GQgE0NJi.js} +1 -1
  85. package/dist/assets/{treemap-75Q7IDZK-DEJplpUM.js → treemap-75Q7IDZK-DRJAJp1M.js} +1 -1
  86. package/dist/assets/{vega-component-n7_q0OfM.js → vega-component-BsUro96f.js} +1 -1
  87. package/dist/assets/{xychartDiagram-H2YORKM3-BPpRWpYI.js → xychartDiagram-H2YORKM3-D1MQAMY-.js} +1 -1
  88. package/dist/index.html +1 -1
  89. package/package.json +1 -1
  90. package/dist/assets/_baseMap-CO6O2T00.js +0 -1
  91. package/dist/assets/channel-Htn_NZF_.js +0 -1
  92. package/dist/assets/classDiagram-M3E45YP4-NhaLY7TQ.js +0 -1
  93. package/dist/assets/classDiagram-v2-YAWTLIQI-NhaLY7TQ.js +0 -1
  94. package/dist/assets/clone-DV8WpmJn.js +0 -1
  95. package/dist/assets/infoDiagram-LHK5PUON-rxESjCgK.js +0 -2
  96. package/dist/assets/stateDiagram-v2-5AN5P6BG-BdR1EezY.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor-BlpRLmjI.js","./index-DGfUnXdC.js","./index-B-OhZVlA.css","./trash-C7XIzpau.js","./number-overlay-editor-DvLlDwhp.js"])))=>i.map(i=>d[i]);
2
- var Lp=Object.defineProperty;var _p=(cr,$n,Rr)=>$n in cr?Lp(cr,$n,{enumerable:!0,configurable:!0,writable:!0,value:Rr}):cr[$n]=Rr;var ft=(cr,$n,Rr)=>_p(cr,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 et,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-DGfUnXdC.js";import{T as am}from"./trash-C7XIzpau.js";let Ba,Wa,kr,$a,K0,Mr,Xa,Cn,lm=Promise.all([(()=>{try{return im}catch{}})()]).then(async()=>{var cr,$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 p=a.call(c);return y&&(h?c[s]=C:delete c[s]),p}}(),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,p){c.push(y?p.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 cr;$n=1;var n=Object.prototype.hasOwnProperty;return cr=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 pe,ur,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!==pe.Loading&&e.kind!==pe.Bubble&&e.kind!==pe.RowID&&e.kind!==pe.Protected&&e.kind!==pe.Drilldown},kr=function(e){return e.kind===Hn.Marker||e.kind===Hn.NewRow};function so(e){if(!Mr(e)||e.kind===pe.Image)return!1;switch(e.kind){case pe.Text:case pe.Number:case pe.Markdown:case pe.Uri:case pe.Custom:case pe.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"})(pe||(pe={})),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"}(ur||(ur={})),function(e){e.Triangle="triangle",e.Dots="dots"}(Zo||(Zo={})),function(e){e.NewRow="new-row",e.Marker="marker"}(Hn||(Hn={}));const Zn=class Zn{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 Zn(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 Zn(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 Zn(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(Zn,"empty",()=>ec??(ec=new Zn([]))),ft(Zn,"fromSingleSelection",t=>Zn.empty().add(t));let yt=Zn;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,p,w){const v=nc(p,w);if(!y){const E=typeof Fa=="function"?{default:Fa}:Fa;Object.keys(v).forEach(g=>{E.default(g)||delete v[g]})}return v}(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 v in C){const E=C[v],g=E[0],b=E[1]||"",x=typeof g=="function"?g(i):g;Z0(0,n.name),y[`--${v}`]=`${x}${b}`}const p=h.style||{},w=Object.keys(p);w.length>0&&w.forEach(v=>{y[v]=p[v]}),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=p;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 b=1;b<arguments.length;b++){var x=arguments[b];for(var I in x)Object.prototype.hasOwnProperty.call(x,I)&&(g[I]=x[I])}return g};function a(g,b){var x={};for(var I in g)b.indexOf(I)>=0||Object.prototype.hasOwnProperty.call(g,I)&&(x[I]=g[I]);return x}function s(g,b){if(!(g instanceof b))throw new TypeError("Cannot call a class as a function")}var c=function(){function g(b,x){for(var I=0;I<x.length;I++){var m=x[I];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(b,m.key,m)}}return function(b,x,I){return x&&g(b.prototype,x),I&&g(b,I),b}}();function h(g,b){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||typeof b!="object"&&typeof b!="function"?g:b}function C(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(g,b):g.__proto__=b)}var y=!1;function p(g){y=g}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){p(!0)}}))}catch{}function w(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return y?g:g.capture}function v(g){if("touches"in g){var b=g.touches[0];return{x:b.pageX,y:b.pageY}}return{x:g.screenX,y:g.screenY}}var E=function(g){function b(){var x;s(this,b);for(var I=arguments.length,m=Array(I),S=0;S<I;S++)m[S]=arguments[S];var R=h(this,(x=b.__proto__||Object.getPrototypeOf(b)).call.apply(x,[this].concat(m)));return R._handleSwipeStart=R._handleSwipeStart.bind(R),R._handleSwipeMove=R._handleSwipeMove.bind(R),R._handleSwipeEnd=R._handleSwipeEnd.bind(R),R._onMouseDown=R._onMouseDown.bind(R),R._onMouseMove=R._onMouseMove.bind(R),R._onMouseUp=R._onMouseUp.bind(R),R._setSwiperRef=R._setSwiperRef.bind(R),R}return C(b,g),c(b,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,w({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,w({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=v(x),m=I.x,S=I.y;this.moveStart={x:m,y:S},this.props.onSwipeStart(x)}},{key:"_handleSwipeMove",value:function(x){if(this.moveStart){var I=v(x),m=I.x,S=I.y,R=m-this.moveStart.x,H=S-this.moveStart.y;this.moving=!0,this.props.onSwipeMove({x:R,y:H},x)&&x.cancelable&&x.preventDefault(),this.movePosition={deltaX:R,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,m=x.style,S=x.children;x.allowMouseEvents,x.onSwipeUp,x.onSwipeDown,x.onSwipeLeft,x.onSwipeRight,x.onSwipeStart,x.onSwipeMove,x.onSwipeEnd,x.innerRef,x.tolerance;var R=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:m},R),S)}}]),b}(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 b=a();if(b&&b.has(g))return b.get(g);var x={},I=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var m in g)if(Object.prototype.hasOwnProperty.call(g,m)){var S=I?Object.getOwnPropertyDescriptor(g,m):null;S&&(S.get||S.set)?Object.defineProperty(x,m,S):x[m]=g[m]}return x.default=g,b&&b.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 b=g.offsetWidth,x=getComputedStyle(g);return b+(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(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},s(g)}function c(){return c=Object.assign||function(g){for(var b=1;b<arguments.length;b++){var x=arguments[b];for(var I in x)Object.prototype.hasOwnProperty.call(x,I)&&(g[I]=x[I])}return g},c.apply(this,arguments)}function h(g,b,x){return b&&function(I,m){for(var S=0;S<m.length;S++){var R=m[S];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(I,R.key,R)}}(g.prototype,b),g}function C(g,b){return C=Object.setPrototypeOf||function(x,I){return x.__proto__=I,x},C(g,b)}function y(g){var b=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=w(g);if(b){var m=w(this).constructor;x=Reflect.construct(I,arguments,m)}else x=I.apply(this,arguments);return function(S,R){return R&&(s(R)==="object"||typeof R=="function")?R:p(S)}(this,x)}}function p(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function w(g){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(b){return b.__proto__||Object.getPrototypeOf(b)},w(g)}function v(g,b,x){return b in g?Object.defineProperty(g,b,{value:x,enumerable:!0,configurable:!0,writable:!0}):g[b]=x,g}var E=function(g){(function(I,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(m&&m.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),m&&C(I,m)})(x,g);var b=y(x);function x(I){var m;return function(S,R){if(!(S instanceof R))throw new TypeError("Cannot call a class as a function")}(this,x),v(p(m=b.call(this,I)),"itemsWrapperRef",void 0),v(p(m),"itemsListRef",void 0),v(p(m),"thumbsRef",void 0),v(p(m),"setItemsWrapperRef",function(S){m.itemsWrapperRef=S}),v(p(m),"setItemsListRef",function(S){m.itemsListRef=S}),v(p(m),"setThumbsRef",function(S,R){m.thumbsRef||(m.thumbsRef=[]),m.thumbsRef[R]=S}),v(p(m),"updateSizes",function(){if(m.props.children&&m.itemsWrapperRef&&m.thumbsRef){var S=e.Children.count(m.props.children),R=m.itemsWrapperRef.clientWidth,H=m.props.thumbWidth?m.props.thumbWidth:(0,n.outerWidth)(m.thumbsRef[0]),f=Math.floor(R/H),B=f<S,D=B?S-f:0;m.setState(function(O,T){return{itemSize:H,visibleItems:f,firstItem:B?m.getFirstItem(T.selectedItem):0,lastPosition:D,showArrows:B}})}}),v(p(m),"handleClickItem",function(S,R,H){if(!function(B){return B.hasOwnProperty("key")}(H)||H.key==="Enter"){var f=m.props.onSelectItem;typeof f=="function"&&f(S,R)}}),v(p(m),"onSwipeStart",function(){m.setState({swiping:!0})}),v(p(m),"onSwipeEnd",function(){m.setState({swiping:!1})}),v(p(m),"onSwipeMove",function(S){var R=S.x;if(!m.state.itemSize||!m.itemsWrapperRef||!m.state.visibleItems)return!1;var H=e.Children.count(m.props.children),f=-100*m.state.firstItem/m.state.visibleItems;f===0&&R>0&&(R=0),f===100*-Math.max(H-m.state.visibleItems,0)/m.state.visibleItems&&R<0&&(R=0);var B=f+100/(m.itemsWrapperRef.clientWidth/R);return m.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(D){m.itemsListRef.style[D]=(0,r.default)(B,"%",m.props.axis)}),!0}),v(p(m),"slideRight",function(S){m.moveTo(m.state.firstItem-(typeof S=="number"?S:1))}),v(p(m),"slideLeft",function(S){m.moveTo(m.state.firstItem+(typeof S=="number"?S:1))}),v(p(m),"moveTo",function(S){S=(S=S<0?0:S)>=m.state.lastPosition?m.state.lastPosition:S,m.setState({firstItem:S})}),m.state={selectedItem:I.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},m}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 m=I;return I>=this.state.lastPosition&&(m=this.state.lastPosition),I<this.state.firstItem+this.state.visibleItems&&(m=this.state.firstItem),I<this.state.firstItem&&(m=I),m}},{key:"renderItems",value:function(){var I=this;return this.props.children.map(function(m,S){var R=t.default.ITEM(!1,S===I.state.selectedItem),H={key:S,ref:function(f){return I.setThumbsRef(f,S)},className:R,onClick:I.handleClickItem.bind(I,S,I.props.children[S]),onKeyDown:I.handleClickItem.bind(I,S,I.props.children[S]),"aria-label":"".concat(I.props.labels.item," ").concat(S+1),style:{width:I.props.thumbWidth}};return e.default.createElement("li",c({},H,{role:"button",tabIndex:0}),m)})}},{key:"render",value:function(){var I=this;if(!this.props.children)return null;var m,S=e.Children.count(this.props.children)>1,R=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 m={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(!R),onClick:function(){return I.slideRight()},"aria-label":this.props.labels.leftArrow}),S?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:m,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:m},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,v(E,"displayName","Thumbs"),v(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(m){if(m&&m.__esModule)return m;if(m===null||h(m)!=="object"&&typeof m!="function")return{default:m};var S=c();if(S&&S.has(m))return S.get(m);var R={},H=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in m)if(Object.prototype.hasOwnProperty.call(m,f)){var B=H?Object.getOwnPropertyDescriptor(m,f):null;B&&(B.get||B.set)?Object.defineProperty(R,f,B):R[f]=m[f]}return R.default=m,S&&S.set(m,R),R}(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 m,S=Go(),R=(m=Wi())&&m.__esModule?m:{default:m},H=xc();function f(O,T){var j=Object.keys(O);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(O);T&&(U=U.filter(function(te){return Object.getOwnPropertyDescriptor(O,te).enumerable})),j.push.apply(j,U)}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(U){D(O,U,j[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(O,Object.getOwnPropertyDescriptors(j)):f(Object(j)).forEach(function(U){Object.defineProperty(O,U,Object.getOwnPropertyDescriptor(j,U))})}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={},U=T.selectedItem,te=U,Q=S.Children.count(O.children)-1;if(O.infiniteLoop&&(U<0||U>Q))return te<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):te>Q&&(j.itemListStyle=(0,H.setPosition)(0,O.axis)),j;var ce=(0,H.getPosition)(U,O),se=(0,R.default)(ce,"%",O.axis),q=O.transitionTime+"ms";return j.itemListStyle={WebkitTransform:se,msTransform:se,OTransform:se,transform:se},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,U){var te={},Q=T.axis==="horizontal",ce=S.Children.count(T.children),se=(0,H.getPosition)(j.selectedItem,T),q=T.infiniteLoop?(0,H.getPosition)(ce-1,T)-100:(0,H.getPosition)(ce-1,T),Z=Q?O.x:O.y,fe=Z;se===0&&Z>0&&(fe=0),se===q&&Z<0&&(fe=0);var N=se+100/(j.itemSize/fe),K=Math.abs(Z)>T.swipeScrollTolerance;return T.infiniteLoop&&K&&(j.selectedItem===0&&N>-100?N-=100*ce:j.selectedItem===ce-1&&N<100*-ce&&(N+=100*ce)),(!T.preventMovementUntilSwipeScrollTolerance||K||j.swipeMovementStarted)&&(j.swipeMovementStarted||U({swipeMovementStarted:!0}),te.itemListStyle=(0,H.setPosition)(N,T.axis)),K&&!j.cancelClick&&U({cancelClick:!0}),te},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",U="ease-in-out",te={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:U,msTransitionTimingFunction:U,MozTransitionTimingFunction:U,WebkitTransitionTimingFunction:U,OTransitionTimingFunction:U};return T.swiping||(te=B(B({},te),{},{WebkitTransitionDuration:j,MozTransitionDuration:j,OTransitionDuration:j,transitionDuration:j,msTransitionDuration:j})),{slideStyle:te,selectedStyle:B(B({},te),{},{opacity:1,position:"relative"}),prevStyle:B({},te)}},Fn}();function s(m){return m&&m.__esModule?m:{default:m}}function c(){if(typeof WeakMap!="function")return null;var m=new WeakMap;return c=function(){return m},m}function h(m){return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(S){return typeof S}:function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},h(m)}function C(){return C=Object.assign||function(m){for(var S=1;S<arguments.length;S++){var R=arguments[S];for(var H in R)Object.prototype.hasOwnProperty.call(R,H)&&(m[H]=R[H])}return m},C.apply(this,arguments)}function y(m,S){var R=Object.keys(m);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(m);S&&(H=H.filter(function(f){return Object.getOwnPropertyDescriptor(m,f).enumerable})),R.push.apply(R,H)}return R}function p(m){for(var S=1;S<arguments.length;S++){var R=arguments[S]!=null?arguments[S]:{};S%2?y(Object(R),!0).forEach(function(H){x(m,H,R[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(R)):y(Object(R)).forEach(function(H){Object.defineProperty(m,H,Object.getOwnPropertyDescriptor(R,H))})}return m}function w(m,S,R){return S&&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)}}(m.prototype,S),m}function v(m,S){return v=Object.setPrototypeOf||function(R,H){return R.__proto__=H,R},v(m,S)}function E(m){var S=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 R,H=b(m);if(S){var f=b(this).constructor;R=Reflect.construct(H,arguments,f)}else R=H.apply(this,arguments);return function(B,D){return D&&(h(D)==="object"||typeof D=="function")?D:g(B)}(this,R)}}function g(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m}function b(m){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)},b(m)}function x(m,S,R){return S in m?Object.defineProperty(m,S,{value:R,enumerable:!0,configurable:!0,writable:!0}):m[S]=R,m}var I=function(m){(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&&v(H,f)})(R,m);var S=E(R);function R(H){var f;(function(D,O){if(!(D instanceof O))throw new TypeError("Cannot call a class as a function")})(this,R),x(g(f=S.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(p({},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(p({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 te(){f.forceUpdate(),j.removeEventListener("load",te)})}var U=(T[0]||O.children[0]).clientHeight;return U>0?U: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=p(p({},B),f.animationHandler(H,B)),f}return w(R,[{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(p({},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=p(p({},j),{},{minWidth:f.props.centerSlidePercentage+"%"})),f.state.swiping&&f.state.swipeMovementStarted&&(j=p(p({},j),{},{pointerEvents:"none"}));var U={ref:function(te){return f.setItemsRef(te,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",U,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,U){return O&&O(H.changeItem(U),U===H.state.selectedItem,U,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),U=j.shift(),te=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 se=this.getVariableItemHeight(this.state.selectedItem);ce.height=se||"auto"}}else Q.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,Q.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,Q.style=p(p({},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&&te,this.renderItems(),this.props.infiniteLoop&&U):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&&te,this.renderItems(),this.props.infiniteLoop&&U)),this.props.renderArrowNext(this.onClickNext,T,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),R}(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(m,S,R){return e.default.createElement("button",{type:"button","aria-label":R,className:n.default.ARROW_PREV(!S),onClick:m})},renderArrowNext:function(m,S,R){return e.default.createElement("button",{type:"button","aria-label":R,className:n.default.ARROW_NEXT(!S),onClick:m})},renderIndicator:function(m,S,R,H){return e.default.createElement("li",{className:n.default.DOT(S),onClick:m,onKeyDown:m,value:R,key:R,role:"button",tabIndex:0,"aria-label":"".concat(H," ").concat(R+1)})},renderItem:function(m){return m},renderThumbs:function(m){var S=e.Children.map(m,function(R){var H=R;if(R.type!=="img"&&(H=e.Children.toArray(R.props.children).find(function(f){return f.type==="img"})),H)return H});return S.filter(function(R){return R}).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"),[]):S},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,p,w=0,v=!1,E=!1,g=!0;if(typeof i!="function")throw new TypeError("Expected a function");function b(R){var H=s,f=c;return s=c=void 0,w=R,C=i.apply(f,H)}function x(R){var H=R-p;return p===void 0||H>=l||H<0||E&&R-w>=h}function I(){var R=t();if(x(R))return m(R);y=setTimeout(I,function(H){var f=l-(H-p);return E?o(f,h-(H-w)):f}(R))}function m(R){return y=void 0,g&&s?b(R):(s=c=void 0,C)}function S(){var R=t(),H=x(R);if(s=arguments,c=this,p=R,H){if(y===void 0)return function(f){return w=f,y=setTimeout(I,l),v?b(f):C}(p);if(E)return clearTimeout(y),y=setTimeout(I,l),b(p)}return y===void 0&&(y=setTimeout(I,l)),C}return l=n(l)||0,e(a)&&(v=!!a.leading,h=(E="maxWait"in a)?r(n(a.maxWait)||0,l):h,g="trailing"in a?!!a.trailing:g),S.cancel=function(){y!==void 0&&clearTimeout(y),w=0,s=p=c=y=void 0},S.flush=function(){return y===void 0?C:m(t())},S},$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 w=h.current;if(w===null||w.disabled)return;const v=C.toString().length;w.focus(),w.setSelectionRange(o?0:v,v)},[]),d.useLayoutEffect(()=>{var w;if(l!==void 0){const v=typeof l=="number"?[l,null]:l;(w=h.current)==null||w.setSelectionRange(v[0],v[1])}},[l]);const p=d.useCallback(w=>{w.key==="Enter"&&w.shiftKey&&i===!0||(r==null||r(w))},[i,r]);return d.createElement(p1,{className:"gdg-growing-entry"},d.createElement(g1,{className:c},C+`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor-BR_18m9z.js","./index-63SEZ54I.js","./index-B-OhZVlA.css","./trash-GQgE0NJi.js","./number-overlay-editor-BT3S9IO8.js"])))=>i.map(i=>d[i]);
2
+ var Lp=Object.defineProperty;var _p=(cr,$n,Rr)=>$n in cr?Lp(cr,$n,{enumerable:!0,configurable:!0,writable:!0,value:Rr}):cr[$n]=Rr;var ft=(cr,$n,Rr)=>_p(cr,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 et,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-63SEZ54I.js";import{T as am}from"./trash-GQgE0NJi.js";let Ba,Wa,kr,$a,K0,Mr,Xa,Cn,lm=Promise.all([(()=>{try{return im}catch{}})()]).then(async()=>{var cr,$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 p=a.call(c);return y&&(h?c[s]=C:delete c[s]),p}}(),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,p){c.push(y?p.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 cr;$n=1;var n=Object.prototype.hasOwnProperty;return cr=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 pe,ur,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!==pe.Loading&&e.kind!==pe.Bubble&&e.kind!==pe.RowID&&e.kind!==pe.Protected&&e.kind!==pe.Drilldown},kr=function(e){return e.kind===Hn.Marker||e.kind===Hn.NewRow};function so(e){if(!Mr(e)||e.kind===pe.Image)return!1;switch(e.kind){case pe.Text:case pe.Number:case pe.Markdown:case pe.Uri:case pe.Custom:case pe.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"})(pe||(pe={})),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"}(ur||(ur={})),function(e){e.Triangle="triangle",e.Dots="dots"}(Zo||(Zo={})),function(e){e.NewRow="new-row",e.Marker="marker"}(Hn||(Hn={}));const Zn=class Zn{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 Zn(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 Zn(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 Zn(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(Zn,"empty",()=>ec??(ec=new Zn([]))),ft(Zn,"fromSingleSelection",t=>Zn.empty().add(t));let yt=Zn;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,p,w){const v=nc(p,w);if(!y){const E=typeof Fa=="function"?{default:Fa}:Fa;Object.keys(v).forEach(g=>{E.default(g)||delete v[g]})}return v}(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 v in C){const E=C[v],g=E[0],b=E[1]||"",x=typeof g=="function"?g(i):g;Z0(0,n.name),y[`--${v}`]=`${x}${b}`}const p=h.style||{},w=Object.keys(p);w.length>0&&w.forEach(v=>{y[v]=p[v]}),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=p;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 b=1;b<arguments.length;b++){var x=arguments[b];for(var I in x)Object.prototype.hasOwnProperty.call(x,I)&&(g[I]=x[I])}return g};function a(g,b){var x={};for(var I in g)b.indexOf(I)>=0||Object.prototype.hasOwnProperty.call(g,I)&&(x[I]=g[I]);return x}function s(g,b){if(!(g instanceof b))throw new TypeError("Cannot call a class as a function")}var c=function(){function g(b,x){for(var I=0;I<x.length;I++){var m=x[I];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(b,m.key,m)}}return function(b,x,I){return x&&g(b.prototype,x),I&&g(b,I),b}}();function h(g,b){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||typeof b!="object"&&typeof b!="function"?g:b}function C(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(g,b):g.__proto__=b)}var y=!1;function p(g){y=g}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){p(!0)}}))}catch{}function w(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return y?g:g.capture}function v(g){if("touches"in g){var b=g.touches[0];return{x:b.pageX,y:b.pageY}}return{x:g.screenX,y:g.screenY}}var E=function(g){function b(){var x;s(this,b);for(var I=arguments.length,m=Array(I),S=0;S<I;S++)m[S]=arguments[S];var R=h(this,(x=b.__proto__||Object.getPrototypeOf(b)).call.apply(x,[this].concat(m)));return R._handleSwipeStart=R._handleSwipeStart.bind(R),R._handleSwipeMove=R._handleSwipeMove.bind(R),R._handleSwipeEnd=R._handleSwipeEnd.bind(R),R._onMouseDown=R._onMouseDown.bind(R),R._onMouseMove=R._onMouseMove.bind(R),R._onMouseUp=R._onMouseUp.bind(R),R._setSwiperRef=R._setSwiperRef.bind(R),R}return C(b,g),c(b,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,w({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,w({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=v(x),m=I.x,S=I.y;this.moveStart={x:m,y:S},this.props.onSwipeStart(x)}},{key:"_handleSwipeMove",value:function(x){if(this.moveStart){var I=v(x),m=I.x,S=I.y,R=m-this.moveStart.x,H=S-this.moveStart.y;this.moving=!0,this.props.onSwipeMove({x:R,y:H},x)&&x.cancelable&&x.preventDefault(),this.movePosition={deltaX:R,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,m=x.style,S=x.children;x.allowMouseEvents,x.onSwipeUp,x.onSwipeDown,x.onSwipeLeft,x.onSwipeRight,x.onSwipeStart,x.onSwipeMove,x.onSwipeEnd,x.innerRef,x.tolerance;var R=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:m},R),S)}}]),b}(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 b=a();if(b&&b.has(g))return b.get(g);var x={},I=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var m in g)if(Object.prototype.hasOwnProperty.call(g,m)){var S=I?Object.getOwnPropertyDescriptor(g,m):null;S&&(S.get||S.set)?Object.defineProperty(x,m,S):x[m]=g[m]}return x.default=g,b&&b.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 b=g.offsetWidth,x=getComputedStyle(g);return b+(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(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},s(g)}function c(){return c=Object.assign||function(g){for(var b=1;b<arguments.length;b++){var x=arguments[b];for(var I in x)Object.prototype.hasOwnProperty.call(x,I)&&(g[I]=x[I])}return g},c.apply(this,arguments)}function h(g,b,x){return b&&function(I,m){for(var S=0;S<m.length;S++){var R=m[S];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(I,R.key,R)}}(g.prototype,b),g}function C(g,b){return C=Object.setPrototypeOf||function(x,I){return x.__proto__=I,x},C(g,b)}function y(g){var b=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=w(g);if(b){var m=w(this).constructor;x=Reflect.construct(I,arguments,m)}else x=I.apply(this,arguments);return function(S,R){return R&&(s(R)==="object"||typeof R=="function")?R:p(S)}(this,x)}}function p(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function w(g){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(b){return b.__proto__||Object.getPrototypeOf(b)},w(g)}function v(g,b,x){return b in g?Object.defineProperty(g,b,{value:x,enumerable:!0,configurable:!0,writable:!0}):g[b]=x,g}var E=function(g){(function(I,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(m&&m.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),m&&C(I,m)})(x,g);var b=y(x);function x(I){var m;return function(S,R){if(!(S instanceof R))throw new TypeError("Cannot call a class as a function")}(this,x),v(p(m=b.call(this,I)),"itemsWrapperRef",void 0),v(p(m),"itemsListRef",void 0),v(p(m),"thumbsRef",void 0),v(p(m),"setItemsWrapperRef",function(S){m.itemsWrapperRef=S}),v(p(m),"setItemsListRef",function(S){m.itemsListRef=S}),v(p(m),"setThumbsRef",function(S,R){m.thumbsRef||(m.thumbsRef=[]),m.thumbsRef[R]=S}),v(p(m),"updateSizes",function(){if(m.props.children&&m.itemsWrapperRef&&m.thumbsRef){var S=e.Children.count(m.props.children),R=m.itemsWrapperRef.clientWidth,H=m.props.thumbWidth?m.props.thumbWidth:(0,n.outerWidth)(m.thumbsRef[0]),f=Math.floor(R/H),B=f<S,D=B?S-f:0;m.setState(function(O,T){return{itemSize:H,visibleItems:f,firstItem:B?m.getFirstItem(T.selectedItem):0,lastPosition:D,showArrows:B}})}}),v(p(m),"handleClickItem",function(S,R,H){if(!function(B){return B.hasOwnProperty("key")}(H)||H.key==="Enter"){var f=m.props.onSelectItem;typeof f=="function"&&f(S,R)}}),v(p(m),"onSwipeStart",function(){m.setState({swiping:!0})}),v(p(m),"onSwipeEnd",function(){m.setState({swiping:!1})}),v(p(m),"onSwipeMove",function(S){var R=S.x;if(!m.state.itemSize||!m.itemsWrapperRef||!m.state.visibleItems)return!1;var H=e.Children.count(m.props.children),f=-100*m.state.firstItem/m.state.visibleItems;f===0&&R>0&&(R=0),f===100*-Math.max(H-m.state.visibleItems,0)/m.state.visibleItems&&R<0&&(R=0);var B=f+100/(m.itemsWrapperRef.clientWidth/R);return m.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(D){m.itemsListRef.style[D]=(0,r.default)(B,"%",m.props.axis)}),!0}),v(p(m),"slideRight",function(S){m.moveTo(m.state.firstItem-(typeof S=="number"?S:1))}),v(p(m),"slideLeft",function(S){m.moveTo(m.state.firstItem+(typeof S=="number"?S:1))}),v(p(m),"moveTo",function(S){S=(S=S<0?0:S)>=m.state.lastPosition?m.state.lastPosition:S,m.setState({firstItem:S})}),m.state={selectedItem:I.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},m}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 m=I;return I>=this.state.lastPosition&&(m=this.state.lastPosition),I<this.state.firstItem+this.state.visibleItems&&(m=this.state.firstItem),I<this.state.firstItem&&(m=I),m}},{key:"renderItems",value:function(){var I=this;return this.props.children.map(function(m,S){var R=t.default.ITEM(!1,S===I.state.selectedItem),H={key:S,ref:function(f){return I.setThumbsRef(f,S)},className:R,onClick:I.handleClickItem.bind(I,S,I.props.children[S]),onKeyDown:I.handleClickItem.bind(I,S,I.props.children[S]),"aria-label":"".concat(I.props.labels.item," ").concat(S+1),style:{width:I.props.thumbWidth}};return e.default.createElement("li",c({},H,{role:"button",tabIndex:0}),m)})}},{key:"render",value:function(){var I=this;if(!this.props.children)return null;var m,S=e.Children.count(this.props.children)>1,R=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 m={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(!R),onClick:function(){return I.slideRight()},"aria-label":this.props.labels.leftArrow}),S?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:m,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:m},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,v(E,"displayName","Thumbs"),v(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(m){if(m&&m.__esModule)return m;if(m===null||h(m)!=="object"&&typeof m!="function")return{default:m};var S=c();if(S&&S.has(m))return S.get(m);var R={},H=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in m)if(Object.prototype.hasOwnProperty.call(m,f)){var B=H?Object.getOwnPropertyDescriptor(m,f):null;B&&(B.get||B.set)?Object.defineProperty(R,f,B):R[f]=m[f]}return R.default=m,S&&S.set(m,R),R}(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 m,S=Go(),R=(m=Wi())&&m.__esModule?m:{default:m},H=xc();function f(O,T){var j=Object.keys(O);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(O);T&&(U=U.filter(function(te){return Object.getOwnPropertyDescriptor(O,te).enumerable})),j.push.apply(j,U)}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(U){D(O,U,j[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(O,Object.getOwnPropertyDescriptors(j)):f(Object(j)).forEach(function(U){Object.defineProperty(O,U,Object.getOwnPropertyDescriptor(j,U))})}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={},U=T.selectedItem,te=U,Q=S.Children.count(O.children)-1;if(O.infiniteLoop&&(U<0||U>Q))return te<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):te>Q&&(j.itemListStyle=(0,H.setPosition)(0,O.axis)),j;var ce=(0,H.getPosition)(U,O),se=(0,R.default)(ce,"%",O.axis),q=O.transitionTime+"ms";return j.itemListStyle={WebkitTransform:se,msTransform:se,OTransform:se,transform:se},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,U){var te={},Q=T.axis==="horizontal",ce=S.Children.count(T.children),se=(0,H.getPosition)(j.selectedItem,T),q=T.infiniteLoop?(0,H.getPosition)(ce-1,T)-100:(0,H.getPosition)(ce-1,T),Z=Q?O.x:O.y,fe=Z;se===0&&Z>0&&(fe=0),se===q&&Z<0&&(fe=0);var N=se+100/(j.itemSize/fe),K=Math.abs(Z)>T.swipeScrollTolerance;return T.infiniteLoop&&K&&(j.selectedItem===0&&N>-100?N-=100*ce:j.selectedItem===ce-1&&N<100*-ce&&(N+=100*ce)),(!T.preventMovementUntilSwipeScrollTolerance||K||j.swipeMovementStarted)&&(j.swipeMovementStarted||U({swipeMovementStarted:!0}),te.itemListStyle=(0,H.setPosition)(N,T.axis)),K&&!j.cancelClick&&U({cancelClick:!0}),te},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",U="ease-in-out",te={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:U,msTransitionTimingFunction:U,MozTransitionTimingFunction:U,WebkitTransitionTimingFunction:U,OTransitionTimingFunction:U};return T.swiping||(te=B(B({},te),{},{WebkitTransitionDuration:j,MozTransitionDuration:j,OTransitionDuration:j,transitionDuration:j,msTransitionDuration:j})),{slideStyle:te,selectedStyle:B(B({},te),{},{opacity:1,position:"relative"}),prevStyle:B({},te)}},Fn}();function s(m){return m&&m.__esModule?m:{default:m}}function c(){if(typeof WeakMap!="function")return null;var m=new WeakMap;return c=function(){return m},m}function h(m){return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(S){return typeof S}:function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},h(m)}function C(){return C=Object.assign||function(m){for(var S=1;S<arguments.length;S++){var R=arguments[S];for(var H in R)Object.prototype.hasOwnProperty.call(R,H)&&(m[H]=R[H])}return m},C.apply(this,arguments)}function y(m,S){var R=Object.keys(m);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(m);S&&(H=H.filter(function(f){return Object.getOwnPropertyDescriptor(m,f).enumerable})),R.push.apply(R,H)}return R}function p(m){for(var S=1;S<arguments.length;S++){var R=arguments[S]!=null?arguments[S]:{};S%2?y(Object(R),!0).forEach(function(H){x(m,H,R[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(R)):y(Object(R)).forEach(function(H){Object.defineProperty(m,H,Object.getOwnPropertyDescriptor(R,H))})}return m}function w(m,S,R){return S&&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)}}(m.prototype,S),m}function v(m,S){return v=Object.setPrototypeOf||function(R,H){return R.__proto__=H,R},v(m,S)}function E(m){var S=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 R,H=b(m);if(S){var f=b(this).constructor;R=Reflect.construct(H,arguments,f)}else R=H.apply(this,arguments);return function(B,D){return D&&(h(D)==="object"||typeof D=="function")?D:g(B)}(this,R)}}function g(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m}function b(m){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)},b(m)}function x(m,S,R){return S in m?Object.defineProperty(m,S,{value:R,enumerable:!0,configurable:!0,writable:!0}):m[S]=R,m}var I=function(m){(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&&v(H,f)})(R,m);var S=E(R);function R(H){var f;(function(D,O){if(!(D instanceof O))throw new TypeError("Cannot call a class as a function")})(this,R),x(g(f=S.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(p({},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(p({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 te(){f.forceUpdate(),j.removeEventListener("load",te)})}var U=(T[0]||O.children[0]).clientHeight;return U>0?U: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=p(p({},B),f.animationHandler(H,B)),f}return w(R,[{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(p({},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=p(p({},j),{},{minWidth:f.props.centerSlidePercentage+"%"})),f.state.swiping&&f.state.swipeMovementStarted&&(j=p(p({},j),{},{pointerEvents:"none"}));var U={ref:function(te){return f.setItemsRef(te,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",U,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,U){return O&&O(H.changeItem(U),U===H.state.selectedItem,U,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),U=j.shift(),te=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 se=this.getVariableItemHeight(this.state.selectedItem);ce.height=se||"auto"}}else Q.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,Q.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,Q.style=p(p({},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&&te,this.renderItems(),this.props.infiniteLoop&&U):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&&te,this.renderItems(),this.props.infiniteLoop&&U)),this.props.renderArrowNext(this.onClickNext,T,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),R}(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(m,S,R){return e.default.createElement("button",{type:"button","aria-label":R,className:n.default.ARROW_PREV(!S),onClick:m})},renderArrowNext:function(m,S,R){return e.default.createElement("button",{type:"button","aria-label":R,className:n.default.ARROW_NEXT(!S),onClick:m})},renderIndicator:function(m,S,R,H){return e.default.createElement("li",{className:n.default.DOT(S),onClick:m,onKeyDown:m,value:R,key:R,role:"button",tabIndex:0,"aria-label":"".concat(H," ").concat(R+1)})},renderItem:function(m){return m},renderThumbs:function(m){var S=e.Children.map(m,function(R){var H=R;if(R.type!=="img"&&(H=e.Children.toArray(R.props.children).find(function(f){return f.type==="img"})),H)return H});return S.filter(function(R){return R}).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"),[]):S},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,p,w=0,v=!1,E=!1,g=!0;if(typeof i!="function")throw new TypeError("Expected a function");function b(R){var H=s,f=c;return s=c=void 0,w=R,C=i.apply(f,H)}function x(R){var H=R-p;return p===void 0||H>=l||H<0||E&&R-w>=h}function I(){var R=t();if(x(R))return m(R);y=setTimeout(I,function(H){var f=l-(H-p);return E?o(f,h-(H-w)):f}(R))}function m(R){return y=void 0,g&&s?b(R):(s=c=void 0,C)}function S(){var R=t(),H=x(R);if(s=arguments,c=this,p=R,H){if(y===void 0)return function(f){return w=f,y=setTimeout(I,l),v?b(f):C}(p);if(E)return clearTimeout(y),y=setTimeout(I,l),b(p)}return y===void 0&&(y=setTimeout(I,l)),C}return l=n(l)||0,e(a)&&(v=!!a.leading,h=(E="maxWait"in a)?r(n(a.maxWait)||0,l):h,g="trailing"in a?!!a.trailing:g),S.cancel=function(){y!==void 0&&clearTimeout(y),w=0,s=p=c=y=void 0},S.flush=function(){return y===void 0?C:m(t())},S},$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 w=h.current;if(w===null||w.disabled)return;const v=C.toString().length;w.focus(),w.setSelectionRange(o?0:v,v)},[]),d.useLayoutEffect(()=>{var w;if(l!==void 0){const v=typeof l=="number"?[l,null]:l;(w=h.current)==null||w.setSelectionRange(v[0],v[1])}},[l]);const p=d.useCallback(w=>{w.key==="Enter"&&w.shiftKey&&i===!0||(r==null||r(w))},[i,r]);return d.createElement(p1,{className:"gdg-growing-entry"},d.createElement(g1,{className:c},C+`
3
3
  `),d.createElement(f1,{...a,className:(c??"")+" gdg-input",id:y,ref:h,onKeyDown:p,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 p;let w=new Map,v=0;for(let x of"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-+=?"){let I=C.measureText(x).width;w.set(x,I),v+=I}let E=v/w.size,g=(y/E+3)/4,b=w.keys();for(let x of b)w.set(x,((p=w.get(x))!=null?p:E)*g);return w}(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,p,w,v){var E,g,b;let x=0,I={};for(let S of C)x+=(E=p.get(S))!=null?E:v,I[S]=((g=I[S])!=null?g:0)+1;let m=y-x;for(let S of Object.keys(I)){let R=I[S],H=(b=p.get(S))!=null?b:v,f=H+m*(H*R/x)*w/R;p.set(S,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(b,x,I,m,S){let R=`${x}_${I}_${m}px`,H=Xr.get(R);if(H!==void 0)return H;if(m<=0)return[];let f=[],B=x.split(`
4
4
  `),D=Gr.get(I),O=D===void 0?x.length:m/D.size*1.5,T=S&&D!==void 0&&D.count>2e4;for(let j of B){let U=po(b,j.slice(0,Math.max(0,O)),I,T),te=Math.min(j.length,O);if(U<=m)f.push(j);else{for(;U>m;){let Q=m1(b,j,m,I,U,te,T),ce=j.slice(0,Math.max(0,Q));j=j.slice(ce.length),f.push(ce),U=po(b,j.slice(0,Math.max(0,O)),I,T),te=Math.min(j.length,O)}U>0&&f.push(j)}}return f=f.map((j,U)=>U===0?j.trimEnd():j.trim()),Xr.set(R,f),Xr.size>500&&Xr.delete(Xr.keys().next().value),f}(e,t,h,o-2*a.cellHorizontalPadding,c??!1),y=tu(e,h),p=a.lineHeight*y,w=y+p*(C.length-1),v=w+a.cellVerticalPadding>i;v&&(e.save(),e.rect(n,r,o,i),e.clip());const E=r+i/2-w/2;let g=Math.max(r+a.cellVerticalPadding,E);for(const b of C)if(eu(e,b,n,g,o,y,l,a,s),g+=p,g>r+i)break;v&&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(w,v){w.includes(`
5
5
  `)&&(w=w.split(/\r?\n/,1)[0]);const E=v/4;return w.length>E&&(w=w.slice(0,E)),w}(t,h));const y=fr(i,a),p=Yi(t)==="rtl";if(n===void 0&&p&&(n="right"),p&&(i.direction="rtl"),t.length>0){let w=!1;n==="right"?(i.textAlign="right",w=!0):n!==void 0&&n!=="left"&&(i.textAlign=n,w=!0),r?w1(i,t,s,c,h,C,y,a,n,o):eu(i,t,s,c,h,C,y,a,n),w&&(i.textAlign="start"),p&&(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,p,w){const v={x:0,y:i+c,width:0,height:0};if(e>=p.length||t>=h||t<-2||e<0)return v;const E=i-o;if(e>=C){const g=l>e?-1:1,b=Yr(p);v.x+=b+s;for(let x=l;x!==e;x+=g)v.x+=p[g===1?x:x-1].width*g}else for(let g=0;g<e;g++)v.x+=p[g].width;if(v.width=p[e].width+1,t===-1)v.y=o,v.height=E;else if(t===-2){v.y=0,v.height=o;let g=e;const b=p[e].group,x=p[e].sticky;for(;g>0&&mo(p[g-1].group,b)&&p[g-1].sticky===x;){const m=p[g-1];v.x-=m.width,v.width+=m.width,g--}let I=e;for(;I+1<p.length&&mo(p[I+1].group,b)&&p[I+1].sticky===x;){const m=p[I+1];v.width+=m.width,I++}if(!x){const m=Yr(p),S=v.x-m;S<0&&(v.x-=S,v.width+=S),v.x+v.width>n&&(v.width=n-v.x)}}else if(t>=h-y){let g=h-t;for(v.y=r;g>0;){const b=t+g-1;v.height=typeof w=="number"?w:w(b),v.y-=v.height,g--}v.height+=1}else{const g=a>t?-1:1;if(typeof w=="number"){const b=t-a;v.y+=b*w}else for(let b=a;b!==t;b+=g)v.y+=w(b)*g;v.height=(typeof w=="number"?w:w(t))+1}return v}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 Jn(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(p=>{const w=function(v,E,g,b){var I;const x=b(E);return((I=x==null?void 0:x.measure)==null?void 0:I.call(x,v,E,g))??150}(e,p[r],t,s);return c=Math.max(c,w),w});if(h.length>5&&a){c=0;let p=0;for(const v of h)p+=v;const w=p/h.length;for(let v=0;v<h.length;v++)h[v]>=2*w?h[v]=0:c=Math.max(c,h[v])}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,p=[],w=p;if(s)y=!1,h=n;else if(C>=200){var v=a?null:o(l);if(v)return i(v);y=!1,h=r,w=new e}else w=a?[]:p;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 b=w.length;b--;)if(w[b]===g)continue e;a&&w.push(g),p.push(E)}else h(w,g,s)||(w!==p&&w.push(g),p.push(E))}return p}}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}
@@ -124,9 +124,9 @@ var Lp=Object.defineProperty;var _p=(cr,$n,Rr)=>$n in cr?Lp(cr,$n,{enumerable:!0
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 p;return((p=window.navigator.clipboard)==null?void 0:p.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 lt(e,t){return e===!0?t:e===!1?"":e}function i0(e){const t=ci.value;return{activateCell:lt(e.activateCell," |Enter|shift+Enter"),clear:lt(e.clear,"any+Escape"),closeOverlay:lt(e.closeOverlay,"any+Escape"),acceptOverlayDown:lt(e.acceptOverlayDown,"Enter"),acceptOverlayUp:lt(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:lt(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:lt(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:lt(e.delete,t?"Backspace|Delete":"Delete"),downFill:lt(e.downFill,"primary+_68"),scrollToSelectedCell:lt(e.scrollToSelectedCell,"primary+Enter"),goDownCell:lt(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:lt(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:lt(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:lt(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:lt(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:lt(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:lt(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:lt(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:lt(e.goToFirstCell,"primary+Home"),goToFirstColumn:lt(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:lt(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:lt(e.goToLastCell,"primary+End"),goToLastColumn:lt(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:lt(e.goToLastRow,"primary+ArrowDown"),goToNextPage:lt(e.goToNextPage,"PageDown"),goToPreviousPage:lt(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:lt(e.rightFill,"primary+_82"),search:lt(e.search,"primary+f"),selectAll:lt(e.selectAll,"primary+a"),selectColumn:lt(e.selectColumn,"ctrl+ "),selectGrowDown:lt(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:lt(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:lt(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:lt(e.selectGrowUp,"shift+ArrowUp"),selectRow:lt(e.selectRow,"shift+ "),selectToFirstCell:lt(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:lt(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:lt(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:lt(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:lt(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:lt(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(v,E){const[g]=d.useState(()=>({value:v,callback:E,facade:{get current(){return g.value},set current(b){const x=g.value;x!==b&&(g.value=b,g.callback(b,x))}}}));return g.callback=E,g.facade}(null,v=>{v!==null&&t!==void 0?v.scrollTop=t:v!==null&&e!==void 0&&(v.scrollLeft=e)}),p=(s.height??1)>1;d.useLayoutEffect(()=>{if(t!==void 0&&y.current!==null&&p){if(y.current.scrollTop===t)return;y.current.scrollTop=t,y.current.scrollTop!==t&&h(),C.current()}},[t,p,h,y]);const w=(s.width??1)>1;return d.useLayoutEffect(()=>{if(e!==void 0&&y.current!==null&&w){if(y.current.scrollLeft===e)return;y.current.scrollLeft=e,y.current.scrollLeft!==e&&h(),C.current()}},[e,w,h,y]),{visibleRegion:s,setVisibleRegion:c,scrollRef:y}}const kg=d.lazy(async()=>await L0(()=>import("./data-grid-overlay-editor-BlpRLmjI.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:pe.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:p,markdownDivCreateNode:w,width:v,height:E,columns:g,rows:b,getCellContent:x,onCellClicked:I,onCellActivated:m,onFillPattern:S,onFinishedEditing:R,coercePasteValue:H,drawHeader:f,drawCell:B,editorBloom:D,onHeaderClicked:O,onColumnProposeMove:T,rangeSelectionColumnSpanning:j=!0,spanRangeBehavior:U="default",onGroupHeaderClicked:te,onCellContextMenu:Q,className:ce,onHeaderContextMenu:se,getCellsForSelection:q,onGroupHeaderContextMenu:Z,onGroupHeaderRenamed:fe,onCellEdited:N,onCellsEdited:K,onSearchResultsChanged:ne,searchResults:X,onSearchValueChange:J,searchValue:ae,onKeyDown:he,onKeyUp:ze,keybindings:$e,editOnType:Ze=!0,onRowAppended:He,onColumnMoved:We,validateCell:me,highlightRegions:ye,rangeSelect:Me="rect",columnSelect:Se="multi",rowSelect:ee="multi",rangeSelectionBlending:Pe="exclusive",columnSelectionBlending:ke="exclusive",rowSelectionBlending:Ge="exclusive",onDelete:Re,onDragStart:nt,onMouseMove:Ke,onPaste:ct,copyHeaders:Ee=!1,freezeColumns:Ae=0,cellActivationBehavior:ut="second-click",rowSelectionMode:dt="auto",onHeaderMenuClick:pt,onHeaderIndicatorClick:Ft,getGroupDetails:bt,rowGrouping:Qe,onSearchClose:Yt,onItemHovered:nn,onSelectionCleared:Kt,showSearch:qt,onVisibleRegionChanged:un,gridSelection:jt,onGridSelectionChange:Kn,minColumnWidth:vr=50,maxColumnWidth:Dt=500,maxColumnAutoWidth:er,provideEditor:_n,trailingRowOptions:re,freezeTrailingRows:be=0,allowedFillDirections:wt="orthogonal",scrollOffsetX:st,scrollOffsetY:xt,verticalBorder:ve,onDragOverCell:Ve,onDrop:Ye,onColumnResize:mt,onColumnResizeEnd:rt,onColumnResizeStart:ot,customRenderers:vt,fillHandle:Ue,experimental:it,fixedShadowX:tt,fixedShadowY:Oe,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: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,tr=(Ot==null?void 0:Ot.theme)??e.rowMarkerTheme,nr=Ot==null?void 0:Ot.headerTheme,qr=Ot==null?void 0:Ot.headerAlwaysVisible,rr=ee!=="multi"||(Ot==null?void 0:Ot.headerDisabled)===!0,yr=(Ot==null?void 0:Ot.checkboxStyle)??"square",or=Math.max(vr,20),Ar=Math.max(Dt,or),pi=Math.max(er??Ar,or),Ho=d.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Xe,rowNumberMapper:Oo,rowHeight:mi,getRowThemeOverride:jn}=function(u,M,k,P){const A=$t.useMemo(()=>u===void 0?void 0:ma(u,M),[u,M]),G=$t.useMemo(()=>A==null?void 0:A.reduce((F,ie)=>(F[ie.rowIndex]=ie,F),{}),[A]),W=$t.useMemo(()=>A===void 0?M:A.reduce((F,ie)=>F+(ie.isCollapsed?1:ie.rows+1),0),[A,M]),_=$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]),$=$t.useCallback(F=>{if(A===void 0)return F;let ie=F;for(const oe of A){if(ie===0)return;if(ie--,!oe.isCollapsed){if(ie<oe.rows)return oe.contentIndex+ie;ie-=oe.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:ie,contentIndex:oe,groupIndex:ge}=va(F,A);return ie?u.themeOverride:P==null?void 0:P(F,ge,oe)},[A,P,u]));return u===void 0?{rowHeight:_,rows:M,rowNumberMapper:$,getRowThemeOverride:Y}:{rowHeight:_,rows:W,rowNumberMapper:$,getRowThemeOverride:Y}}(Qe,b,qe,p),Sa=d.useMemo(()=>Number.parseFloat(Ho.fontSize),[Ho]),{rowHeight:Vn,headerHeight:Fr,groupHeaderHeight:Po,theme:Lr,overscrollX:Do,overscrollY:zo}=function({rowHeight:u,headerHeight:M,groupHeaderHeight:k,theme:P,overscrollX:A,overscrollY:G,scaleToRem:W,remSize:_}){const[$,Y,F,ie,oe,ge]=$t.useMemo(()=>{if(!W||_===16)return[u,M,k,P,A,G];const we=_/16,_e=u,Ce=iu();return[typeof _e=="number"?_e*we:Te=>Math.ceil(_e(Te)*we),Math.ceil(M*we),Math.ceil(k*we),{...P,headerIconSize:((P==null?void 0:P.headerIconSize)??Ce.headerIconSize)*we,cellHorizontalPadding:((P==null?void 0:P.cellHorizontalPadding)??Ce.cellHorizontalPadding)*we,cellVerticalPadding:((P==null?void 0:P.cellVerticalPadding)??Ce.cellVerticalPadding)*we},Math.ceil((A??0)*we),Math.ceil((G??0)*we)]},[k,M,A,G,_,u,W,P]);return{rowHeight:$,headerHeight:Y,groupHeaderHeight:F,theme:ie,overscrollX:oe,overscrollY:ge}}({groupHeaderHeight:Mn,headerHeight:Qt,overscrollX:Sn,overscrollY:Rt,remSize:Sa,rowHeight:mi,scaleToRem:Tt,theme:mn}),Un=xg($e),Nn=gi??(b>1e4?48:b>1e3?44:b>100?36:32),wn=vn!=="none",V=wn?1:0,Wt=He!==void 0,L=(re==null?void 0:re.sticky)===!0,[le,ue]=d.useState(!1),xe=qt??le,de=d.useCallback(()=>{Yt!==void 0?Yt():ue(!1)},[Yt]),z=d.useMemo(()=>jt===void 0?void 0:di(jt,V),[jt,V])??n,Ie=d.useRef();Ie.current===void 0&&(Ie.current=new AbortController),d.useEffect(()=>()=>Ie==null?void 0:Ie.current.abort(),[]);const[Fe,Ne]=function(u,M,k,P,A){const G=d.useCallback($=>{if(u===!0){const Y=[];for(let F=$.y;F<$.y+$.height;F++){const ie=[];for(let oe=$.x;oe<$.x+$.width;oe++)oe<0||F>=A?ie.push({kind:pe.Loading,allowOverlay:!1}):ie.push(M([oe,F]));Y.push(ie)}return Y}return(u==null?void 0:u($,P.signal))??[]},[P.signal,M,u,A]),W=u!==void 0?G:void 0,_=d.useCallback($=>{if(W===void 0)return[];const Y={...$,x:$.x-k};if(Y.x<0){Y.x=0,Y.width--;const F=W(Y,P.signal);return typeof F=="function"?async()=>(await F()).map(ie=>[{kind:pe.Loading,allowOverlay:!1},...ie]):F.map(ie=>[{kind:pe.Loading,allowOverlay:!1},...ie])}return W(Y,P.signal)},[P.signal,W,k]);return[u!==void 0?_:void 0,W]}(q,x,V,Ie.current,Xe),Mt=d.useCallback((u,M,k)=>{if(me===void 0)return!0;const P=[u[0]-V,u[1]];return me==null?void 0:me(P,M,k)},[V,me]),De=d.useRef(jt),Le=d.useCallback((u,M)=>{M&&(u=function(k,P,A,G,W){var Y;const _=k;if(G==="allowPartial"||k.current===void 0||P===void 0)return k;let $=!1;do{if((k==null?void 0:k.current)===void 0)break;const F=(Y=k.current)==null?void 0:Y.range,ie=[];if(F.width>2){const we=P({x:F.x,y:F.y,width:1,height:F.height},W.signal);if(typeof we=="function")return _;ie.push(...we);const _e=P({x:F.x+F.width-1,y:F.y,width:1,height:F.height},W.signal);if(typeof _e=="function")return _;ie.push(..._e)}else{const we=P({x:F.x,y:F.y,width:F.width,height:F.height},W.signal);if(typeof we=="function")return _;ie.push(...we)}let oe=F.x-A,ge=F.x+F.width-1-A;for(const we of ie)for(const _e of we)_e.span!==void 0&&(oe=Math.min(_e.span[0],oe),ge=Math.max(_e.span[1],ge));oe===F.x-A&&ge===F.x+F.width-1-A?$=!0:k={current:{cell:k.current.cell??[0,0],range:{x:oe+A,y:F.y,width:ge-oe+1,height:F.height},rangeStack:k.current.rangeStack},columns:k.columns,rows:k.rows}}while(!$);return k}(u,Fe,V,U,Ie.current)),Kn!==void 0?(De.current=di(u,-V),Kn(De.current)):r(u)},[Kn,Fe,V,U]),Je=dr(mt,d.useCallback((u,M,k,P)=>{mt==null||mt(g[k-V],M,k-V,P)},[mt,V,g])),dn=dr(rt,d.useCallback((u,M,k,P)=>{rt==null||rt(g[k-V],M,k-V,P)},[rt,V,g])),en=dr(ot,d.useCallback((u,M,k,P)=>{ot==null||ot(g[k-V],M,k-V,P)},[ot,V,g])),br=dr(f,d.useCallback((u,M)=>(f==null?void 0:f({...u,columnIndex:u.columnIndex-V},M))??!1,[f,V])),ir=dr(B,d.useCallback((u,M)=>(B==null?void 0:B({...u,col:u.col-V},M))??!1,[B,V])),on=d.useCallback(u=>{if(Re!==void 0){const M=Re(di(u,-V));return typeof M=="boolean"?M:di(M,V)}return!0},[Re,V]),[Lt,je,ht]=function(u,M,k,P,A,G,W){return[$t.useCallback((_,$,Y,F)=>{var _e;G!=="cell"&&G!=="multi-cell"||_===void 0||(_={..._,range:{x:_.cell[0],y:_.cell[1],width:1,height:1}}),!W&&_!==void 0&&_.range.width>1&&(_={..._,range:{..._.range,width:1,x:_.cell[0]}});const ie=k==="mixed"&&(Y||F==="drag"),oe=P==="mixed"&&ie,ge=A==="mixed"&&ie;let we={current:_===void 0?void 0:{..._,rangeStack:F==="drag"?((_e=u.current)==null?void 0:_e.rangeStack)??[]:[]},columns:oe?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]}}),M(we,$)},[P,u,k,G,W,A,M]),$t.useCallback((_,$,Y)=>{let F;if(_=_??u.rows,$!==void 0&&(_=_.add($)),A==="exclusive"&&_.length>0)F={current:void 0,columns:yt.empty(),rows:_};else{const ie=Y&&P==="mixed";F={current:Y&&k==="mixed"?u.current:void 0,columns:ie?u.columns:yt.empty(),rows:_}}M(F,!1)},[P,u,k,A,M]),$t.useCallback((_,$,Y)=>{let F;if(_=_??u.columns,$!==void 0&&(_=_.add($)),P==="exclusive"&&_.length>0)F={current:void 0,rows:yt.empty(),columns:_};else{const ie=Y&&A==="mixed";F={current:Y&&k==="mixed"?u.current:void 0,rows:ie?u.rows:yt.empty(),columns:_}}M(F,!1)},[P,u,k,A,M])]}(z,Le,Pe,ke,Ge,Me,j),gt=d.useMemo(()=>Jn(iu(),Lr),[Lr]),[yn,an]=d.useState([0,0,0]),ar=d.useMemo(()=>{if(Ro===void 0)return{};const u={};for(const M of Ro)u[M.kind]=M;return u},[Ro]),Ht=d.useCallback(u=>u.kind!==pe.Custom?ar[u.kind]:vt==null?void 0:vt.find(M=>M.isMatch(u)),[vt,ar]);let{sizedColumns:hn,nonGrowWidth:vi}=function(u,M,k,P,A,G,W,_,$){const Y=d.useRef(M),F=d.useRef(k),ie=d.useRef(W);Y.current=M,F.current=k,ie.current=W;const[oe,ge]=d.useMemo(()=>{if(typeof window>"u")return[null,null];const Be=document.createElement("canvas");return Be.style.display="none",Be.style.opacity="0",Be.style.position="fixed",[Be,Be.getContext("2d",{alpha:!1})]},[]);d.useLayoutEffect(()=>(oe&&document.documentElement.append(oe),()=>{oe==null||oe.remove()}),[oe]);const we=d.useRef({}),_e=d.useRef(),[Ce,Te]=d.useState();return d.useLayoutEffect(()=>{const Be=F.current;if(Be===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=Be(tn,$.signal),sn=Ut>0?Be(St,$.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)]),_e.current=u,Te(xn)})()},[$.signal,u]),d.useMemo(()=>{let Be=u.every(ei)?u:ge===null?u.map(St=>ei(St)?St:{...St,width:150}):(ge.font=ie.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(Ce===void 0||_e.current!==u||St.id===void 0)return{...St,width:150};const sn=au(ge,W,St,At,Ce,A,G,!0,_);return we.current[St.id]=sn.width,sn})),_t=0,Ut=0;const tn=[];for(const[St,At]of Be.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=[...Be],At=P-_t;let sn=At;for(let xn=0;xn<tn.length;xn++){const sr=tn[xn],Xo=(Be[sr].grow??0)/Ut,Aa=xn===tn.length-1?sn:Math.min(sn,Math.floor(At*Xo));St[sr]={...Be[sr],growOffset:Aa,width:Be[sr].width+Aa},sn-=Aa}Be=St}return{sizedColumns:Be,nonGrowWidth:_t}},[P,u,ge,Ce,W,A,G,_])}(g,Xe,Ne,yn[0]-(V===0?0:Nn)-yn[2],or,pi,gt,Ht,Ie.current);vn!=="none"&&(vi+=Nn);const Qr=d.useMemo(()=>hn.some(u=>u.group!==void 0),[hn]),lr=Qr?Fr+Po:Fr,Ao=z.rows.length,Fo=vn==="none"?void 0:Ao!==0&&(Ao===Xe||void 0),Ct=d.useMemo(()=>vn==="none"?hn:[{title:"",width:Nn,icon:void 0,hasMenu:!1,style:"normal",themeOverride:tr,rowMarker:yr,rowMarkerChecked:Fo,headerRowMarkerTheme:nr,headerRowMarkerAlwaysVisible:qr,headerRowMarkerDisabled:rr},...hn],[vn,hn,Nn,tr,yr,Fo,nr,qr,rr]),Gt=d.useRef({height:1,width:1,x:0,y:0}),Dn=d.useRef(!1),{setVisibleRegion:Lo,visibleRegion:_r,scrollRef:zt}=Sg(st,xt,Vn,Gt,()=>Dn.current=!0);Gt.current=_r;const lp=_r.x+V,wi=_r.y,ln=d.useRef(null),bn=d.useCallback(u=>{var M;u===!0?(M=ln.current)==null||M.focus():window.requestAnimationFrame(()=>{var k;(k=ln.current)==null||k.focus()})},[]),fn=Wt?Xe+1:Xe,zn=d.useCallback(u=>{const M=V===0?u:u.map(P=>({...P,location:[P.location[0]-V,P.location[1]]})),k=K==null?void 0:K(M);if(k!==!0)for(const P of M)N==null||N(P.location,P.value);return k},[N,K,V]),[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 M of ye){const k=Ct.length-M.range.x-V;k>0&&u.push({color:M.color,range:{...M.range,x:M.range.x+V,width:Math.min(k,M.range.width)},style:M.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,V]),b0=d.useRef(Ct);b0.current=Ct;const Tn=d.useCallback(([u,M],k=!1)=>{var A,G,W,_,$,Y,F;const P=Wt&&M===fn-1;if(u===0&&wn){if(P)return hi;const ie=Oo(M);return ie===void 0?hi:{kind:Hn.Marker,allowOverlay:!1,checkboxStyle:yr,checked:(z==null?void 0:z.rows.hasIndex(M))===!0,markerKind:vn==="clickable-number"?"number":vn,row:To+ie,drawHandle:Xt!==void 0,cursor:vn==="clickable-number"?"pointer":void 0}}if(P){const ie=u===V?(re==null?void 0:re.hint)??"":"",oe=b0.current[u];if(((A=oe==null?void 0:oe.trailingRowOptions)==null?void 0:A.disabled)===!0)return hi;{const ge=((G=oe==null?void 0:oe.trailingRowOptions)==null?void 0:G.hint)??ie,we=((W=oe==null?void 0:oe.trailingRowOptions)==null?void 0:W.addIcon)??(re==null?void 0:re.addIcon);return{kind:Hn.NewRow,hint:ge,allowOverlay:!1,icon:we}}}{const ie=u-V;if(k||(it==null?void 0:it.strict)===!0){const ge=Gt.current,we=ge.x>ie||ie>ge.x+ge.width||ge.y>M||M>ge.y+ge.height||M>=Ra.current,_e=ie===(($=(_=ge.extras)==null?void 0:_.selected)==null?void 0:$[0])&&M===((Y=ge.extras)==null?void 0:Y.selected[1]);let Ce=!1;if(((F=ge.extras)==null?void 0:F.freezeRegions)!==void 0){for(const Te of ge.extras.freezeRegions)if(Dr(Te,ie,M)){Ce=!0;break}}if(we&&!_e&&!Ce)return hi}let oe=x([ie,M]);return V!==0&&oe.span!==void 0&&(oe={...oe,span:[oe.span[0]+V,oe.span[1]+V]}),oe}},[Wt,fn,wn,Oo,yr,z==null?void 0:z.rows,vn,To,Xt,V,re==null?void 0:re.hint,re==null?void 0:re.addIcon,it==null?void 0:it.strict,x]),Ma=d.useCallback(u=>{let M=(bt==null?void 0:bt(u))??{name:u};return fe!==void 0&&u!==""&&(M={icon:M.icon,name:M.name,overrideTheme:M.overrideTheme,actions:[...M.actions??[],{title:"Rename",icon:"renameIcon",onClick:k=>Ia({group:M.name,bounds:k.bounds})}]}),M},[bt,fe]),Ci=d.useCallback(u=>{var _;const[M,k]=u.cell,P=Ct[M],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,W=jn==null?void 0:jn(k);i({...u,theme:Jn(gt,A,G,W,u.content.themeOverride)})},[jn,Ct,Ma,gt]),Zr=d.useCallback((u,M,k)=>{var W;if(z.current===void 0)return;const[P,A]=z.current.cell,G=Tn([P,A]);if(G.kind!==pe.Boolean&&G.allowOverlay){let _=G;if(k!==void 0)switch(_.kind){case pe.Number:{const $=function(Y,F){try{return Y()}catch{return F}}(()=>k==="-"?-0:Number.parseFloat(k),0);_={..._,data:Number.isNaN($)?0:$};break}case pe.Text:case pe.Markdown:case pe.Uri:_={..._,data:k}}Ci({target:u,content:_,initialValue:k,cell:[P,A],highlight:k===void 0,forceEditMode:k!==void 0})}else G.kind===pe.Boolean&&M&&G.readonly!==!0&&(zn([{location:z.current.cell,value:{...G,data:r0(G.data)}}]),(W=ln.current)==null||W.damage([{cell:z.current.cell}]))},[Tn,z,zn,Ci]),x0=d.useCallback((u,M)=>{var A;const k=(A=ln.current)==null?void 0:A.getBounds(u,M);if(k===void 0||zt.current===null)return;const P=Tn([u,M]);P.allowOverlay&&Ci({target:k,content:P,initialValue:void 0,highlight:!0,cell:[u,M],forceEditMode:!0})},[Tn,zt,Ci]),Jt=d.useCallback((u,M,k="both",P=0,A=0,G=void 0)=>{if(zt.current!==null){const W=ln.current,_=a.current,$=typeof u!="number"?u.unit==="cell"?u.amount:void 0:u,Y=typeof M!="number"?M.unit==="cell"?M.amount:void 0:M,F=typeof u!="number"&&u.unit==="px"?u.amount:void 0,ie=typeof M!="number"&&M.unit==="px"?M.amount:void 0;if(W!==null&&_!==null){let oe={x:0,y:0,width:0,height:0},ge=0,we=0;if(($!==void 0||Y!==void 0)&&(oe=W.getBounds(($??0)+V,Y??0)??oe,oe.width===0||oe.height===0))return;const _e=_.getBoundingClientRect(),Ce=_e.width/_.offsetWidth;if(F!==void 0&&(oe={...oe,x:F-_e.left-zt.current.scrollLeft,width:1}),ie!==void 0&&(oe={...oe,y:ie+_e.top-zt.current.scrollTop,height:1}),oe!==void 0){const Te={x:oe.x-P,y:oe.y-A,width:oe.width+2*P,height:oe.height+2*A};let Be=0;for(let Xo=0;Xo<Ae;Xo++)Be+=hn[Xo].width;let _t=0;const Ut=be+(L?1:0);Ut>0&&(_t=Or(fn,Ut,Vn));let tn=Be*Ce+_e.left+V*Nn*Ce,St=_e.right,At=_e.top+lr*Ce,sn=_e.bottom-_t*Ce;const xn=oe.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 sr=oe.height+2*A;switch(G==null?void 0:G.vAlign){case"start":sn=At+sr;break;case"end":At=sn-sr;break;case"center":At=Math.floor((At+sn)/2)-sr/2,sn=At+sr}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<Ae?ge=0:(k==="horizontal"||typeof M=="number"&&M>=fn-Ut)&&(we=0),ge===0&&we===0||(Ce!==1&&(ge/=Ce,we/=Ce),zt.current.scrollTo({left:ge+zt.current.scrollLeft,top:we+zt.current.scrollTop,behavior:(G==null?void 0:G.behavior)??"auto"}))}}}},[V,be,Nn,zt,lr,Ae,hn,fn,L,Vn]),C0=d.useRef(x0),S0=d.useRef(x),Ra=d.useRef(Xe);C0.current=x0,S0.current=x,Ra.current=Xe;const eo=d.useCallback(async(u,M=!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,W=!0;A!==void 0&&(G=await A,G==="top"&&(W=!1),typeof G=="number"&&(W=!1));let _=0;const $=()=>{if(Ra.current<=Xe)return _<500&&window.setTimeout($,_),void(_=50+2*_);const F=typeof G=="number"?G:W?Xe:0;Ii.current(u-V,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 ie=S0.current([u-V,F]);ie.allowOverlay&&so(ie)&&ie.readonly!==!0&&M&&window.setTimeout(()=>{C0.current(u,F)},0)};$()},[Ct,He,V,Xe,Lt]),Si=d.useCallback(u=>{var k,P;const M=((P=(k=hn[u])==null?void 0:k.trailingRowOptions)==null?void 0:P.targetColumn)??(re==null?void 0:re.targetColumn);if(typeof M=="number")return M+(wn?1:0);if(typeof M=="object"){const A=g.indexOf(M);if(A>=0)return A+(wn?1:0)}},[hn,g,wn,re==null?void 0:re.targetColumn]),xr=d.useRef(),to=d.useRef(),_o=d.useCallback((u,M)=>{var A;const[k,P]=M;return Jn(gt,(A=Ct[k])==null?void 0:A.themeOverride,jn==null?void 0:jn(P),u.themeOverride)},[jn,Ct,gt]),{mapper:Nr}=function(u,M){const k=$t.useMemo(()=>u===void 0?void 0:ma(u,M),[u,M]);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])}}(Qe,b),Bn=Qe==null?void 0:Qe.navigationBehavior,jo=d.useCallback(u=>{var F,ie,oe;const M=ci.value?u.metaKey:u.ctrlKey,k=M&&ee==="multi",P=M&&Se==="multi",[A,G]=u.location,W=z.columns,_=z.rows,[$,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===Xe||vn==="number"||ee==="none")return;const ge=Tn(u.location);if(ge.kind!==Hn.Marker)return;if(Xt!==void 0){const Ce=Ht(ge);Rn((Ce==null?void 0:Ce.kind)===Hn.Marker);const Te=(ie=Ce==null?void 0:Ce.onClick)==null?void 0:ie.call(Ce,{...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),_e=xr.current;if(ee==="multi"&&(u.shiftKey||u.isLongTouch===!0)&&_e!==void 0&&_.hasIndex(_e)){const Ce=[Math.min(_e,G),Math.max(_e,G)+1];k||dt==="multi"?je(void 0,Ce,!0):je(yt.fromSingleSelection(Ce),void 0,k)}else ee==="multi"&&(k||u.isTouch||dt==="multi")?we?je(_.remove(G),void 0,!0):(je(void 0,G,!0),xr.current=G):we&&_.length===1?je(yt.empty(),void 0,M):(je(yt.fromSingleSelection(G),void 0,M),xr.current=G)}else if(A>=V&&Wt&&G===Xe){const ge=Si(A);eo(ge??A)}else if($!==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 _e=L&&G===Xe,Ce=L&&z!==void 0&&((oe=z.current)==null?void 0:oe.cell[1])===Xe;if(!u.shiftKey&&u.isLongTouch!==!0||$===void 0||Y===void 0||z.current===void 0||Ce)Lt({cell:[A,G],range:{x:A,y:G,width:1,height:1}},!0,M,"click"),xr.current=void 0,i(void 0),bn();else{if(_e)return;const Te=Math.min(A,$),Be=Math.max(A,$),_t=Math.min(G,Y),Ut=Math.max(G,Y);Lt({...z.current,range:{x:Te,y:_t,width:Be-Te+1,height:Ut-_t+1}},!0,M,"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,rr||ee!=="multi"||(_.length!==Xe?je(yt.fromSingleSelection([0,Xe]),void 0,M):je(yt.empty(),void 0,M),bn());else{const ge=to.current;if(Se==="multi"&&(u.shiftKey||u.isLongTouch===!0)&&ge!==void 0&&W.hasIndex(ge)){const we=[Math.min(ge,A),Math.max(ge,A)+1];P?ht(void 0,we,M):ht(yt.fromSingleSelection(we),void 0,M)}else P?(W.hasIndex(A)?ht(W.remove(A),void 0,M):ht(void 0,A,M),to.current=A):Se!=="none"&&(W.hasIndex(A)?ht(W.remove(A),void 0,M):ht(yt.fromSingleSelection(A),void 0,M),to.current=A);xr.current=void 0,bn()}else u.kind===Pn?Br.current=[A,G]:u.kind!==ui||u.isMaybeScrollbar||(Le(fi,!1),i(void 0),bn(),Kt==null||Kt(),xr.current=void 0,to.current=void 0)},[ee,Se,z,wn,V,Wt,Xe,vn,Tn,Xt,bn,dt,Ht,_o,je,Si,eo,Bn,Nr,L,Lt,ht,Le,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 M=performance.now();An.current={button:u.button,time:M,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||Se!=="multi")return;const M=ci.value?u.metaKey:u.ctrlKey,[k]=u.location,P=z.columns;if(k<V)return;const A=Ct[k];let G=k,W=k;for(let _=k-1;_>=V&&mo(A.group,Ct[_].group);_--)G--;for(let _=k+1;_<Ct.length&&mo(A.group,Ct[_].group);_++)W++;if(bn(),M)if(P.hasAll([G,W+1])){let _=P;for(let $=G;$<=W;$++)_=_.remove($);ht(_,void 0,M)}else ht(void 0,[G,W+1],M);else ht(yt.fromSingleSelection([G,W+1]),void 0,M)},[Se,bn,z.columns,Ct,V,ht]),no=d.useRef(!1),ki=d.useCallback(async u=>{if(Fe!==void 0&&Je!==void 0){const M=Gt.current.y,k=Gt.current.height;let P=Fe({x:u,y:M,width:1,height:Math.min(k,Xe-M)},Ie.current.signal);typeof P!="object"&&(P=await P());const A=hn[u-V],G=document.createElement("canvas").getContext("2d",{alpha:!1});if(G!==null){G.font=gt.baseFontFull;const W=au(G,gt,A,0,P,or,Ar,!1,Ht);Je==null||Je(A,W.width,u,W.width)}}},[hn,Fe,Ar,gt,or,Je,V,Xe,Ht]),[up,Ta]=d.useState(),ro=d.useCallback(async(u,M)=>{var _,$;const k=(_=u.current)==null?void 0:_.range;if(k===void 0||Fe===void 0||M.current===void 0)return;const P=M.current.range;if(S!==void 0){let Y=!1;if(S({fillDestination:{...P,x:P.x-V},patternSource:{...k,x:k.x-V},preventDefault:()=>Y=!0}),Y)return}let A=Fe(k,Ie.current.signal);typeof A!="object"&&(A=await A());const G=A,W=[];for(let Y=0;Y<P.width;Y++)for(let F=0;F<P.height;F++){const ie=[P.x+Y,P.y+F];if(Yc(ie,k))continue;const oe=G[F%k.height][Y%k.width];!kr(oe)&&so(oe)&&W.push({location:ie,value:{...oe}})}zn(W),($=ln.current)==null||$.damage(W.map(Y=>({cell:Y.location})))},[Fe,zn,S,V]),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,M)=>{var F,ie;const k=s;if(c(void 0),ka(void 0),Ta(void 0),No.current=!1,M)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 oe={...z,current:{...z.current,range:md(k.previousSelection.current.range,jr)}};return ro(k.previousSelection,oe),void Le(oe,!0)}const[P,A]=u.location,[G,W]=Br.current??[],_=()=>{no.current=!0},$=oe=>{var we,_e,Ce;const ge=oe.isTouch||G===P&&W===A;if(ge&&(I==null||I([P-V,A],{...oe,preventDefault:_})),oe.button===1)return!no.current;if(!no.current){const Te=Tn(u.location),Be=Ht(Te);if(Be!==void 0&&Be.onClick!==void 0&&ge){const Ut=Be.onClick({...oe,cell:Te,posX:oe.localEventX,posY:oe.localEventY,bounds:oe.bounds,theme:_o(Te,u.location),preventDefault:_});Ut!==void 0&&!kr(Ut)&&Mr(Ut)&&(zn([{location:oe.location,value:Ut}]),(we=ln.current)==null||we.damage([{cell:oe.location}]))}if(no.current||z.current===void 0)return!1;let _t=!1;switch(Te.activationBehaviorOverride??ut){case"double-click":case"second-click":{if(((Ce=(_e=k==null?void 0:k.previousSelection)==null?void 0:_e.current)==null?void 0:Ce.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&&(oe.isDoubleClick===!0||ut==="second-click");break}case"single-click":_t=!0}if(_t)return m==null||m([P-V,A]),Zr(oe.bounds,!1),!0}return!1},Y=u.location[0]-V;if(u.isTouch){const oe=Gt.current,ge=k0.current;if(oe.x!==ge.x||oe.y!==ge.y)return;if(u.isLongTouch===!0){if(u.kind==="cell"&&vo((ie=z.current)==null?void 0:ie.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(se==null?void 0:se(Y,{...u,preventDefault:_}));if(u.kind===Pn)return Y<0?void 0:void(Z==null?void 0:Z(Y,{...u,preventDefault:_}))}return void(u.kind==="cell"?$(u)||jo(u):u.kind===Pn?te==null?void 0:te(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===W&&(O==null||O(Y,{...u,preventDefault:_}))}if(u.kind===Pn){if(Y<0)return;u.button===0&&P===G&&A===W&&(te==null||te(Y,{...u,preventDefault:_}),no.current||M0(u))}u.kind!=="cell"||u.button!==0&&u.button!==1||$(u),Br.current=void 0},[s,z,V,jr,ro,Le,I,Tn,Ht,ut,_o,zn,m,Zr,Q,se,Z,jo,te,O,ki,M0]),hp=d.useCallback(u=>{const M={...u,location:[u.location[0]-V,u.location[1]]};Ke==null||Ke(M),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)<V?void 0:u.scrollEdge})},[s,Ke,V]),fp=d.useCallback((u,M)=>{pt==null||pt(u-V,M)},[pt,V]),gp=d.useCallback((u,M)=>{Ft==null||Ft(u-V,M)},[Ft,V]),qn=(A0=z==null?void 0:z.current)==null?void 0:A0.cell,pp=d.useCallback((u,M,k,P,A,G)=>{Dn.current=!1;let W=qn;W!==void 0&&(W=[W[0]-V,W[1]]);const _=Ae===0?void 0:{x:0,y:u.y,width:Ae,height:u.height},$=[];_!==void 0&&$.push(_),be>0&&($.push({x:u.x-V,y:Xe-be,width:u.width,height:be}),Ae>0&&$.push({x:0,y:Xe-be,width:Ae,height:be}));const Y={x:u.x-V,y:u.y,width:u.width,height:Wt&&u.y+u.height>=Xe?u.height-1:u.height,tx:A,ty:G,extras:{selected:W,freezeRegion:_,freezeRegions:$}};Gt.current=Y,Lo(Y),an([M,k,P]),un==null||un(Y,Y.tx,Y.ty,Y.extras)},[qn,V,Wt,Xe,Ae,be,Lo,un]),mp=dr(T,d.useCallback((u,M)=>(T==null?void 0:T(u-V,M-V))!==!1,[T,V])),vp=dr(We,d.useCallback((u,M)=>{We==null||We(u-V,M-V),Se!=="none"&&ht(yt.fromSingleSelection(M),void 0,!0)},[Se,We,V,ht])),Ha=d.useRef(!1),wp=d.useCallback(u=>{u.location[0]===0&&V>0?u.preventDefault():(nt==null||nt({...u,location:[u.location[0]-V,u.location[1]]}),u.defaultPrevented()||(Ha.current=!0),c(void 0))},[nt,V]),yp=d.useCallback(()=>{Ha.current=!1},[]),I0=Qe==null?void 0:Qe.selectionBehavior,Mi=d.useCallback(u=>{if(I0!=="block-spanning")return;const{isGroupHeader:M,path:k,groupRows:P}=Nr(u);if(M)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 M,k,P;if(!(qf(u,Oa.current)||(Oa.current=u,((M=An==null?void 0:An.current)==null?void 0:M.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&&V===1&&ee==="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;je(yt.fromSingleSelection([A,G]),void 0,!1)}if(!(u.buttons===0||s===void 0||z.current===void 0||Ha.current||No.current||Me!=="rect"&&Me!=="multi-rect")){const[A,G]=z.current.cell;let[W,_]=u.location;if(_<0&&(_=Gt.current.y),s.fillHandle===!0&&((P=s.previousSelection)==null?void 0:P.current)!==void 0){const $=s.previousSelection.current.range;_=Math.min(_,Wt?Xe-1:Xe);const Y=function(F,ie,oe,ge){if(ge==="any")return md(F,{x:ie,y:oe,width:1,height:1});if(ge==="vertical"&&(ie=F.x),ge==="horizontal"&&(oe=F.y),Yc([ie,oe],F))return;const we=ie-F.x,_e=F.x+F.width-ie,Ce=oe-F.y+1,Te=F.y+F.height-oe,Be=Math.min(ge==="vertical"?Number.MAX_SAFE_INTEGER:we,ge==="vertical"?Number.MAX_SAFE_INTEGER:_e,ge==="horizontal"?Number.MAX_SAFE_INTEGER:Ce,ge==="horizontal"?Number.MAX_SAFE_INTEGER:Te);return Be===Te?{x:F.x,y:F.y+F.height,width:F.width,height:oe-F.y-F.height+1}:Be===Ce?{x:F.x,y:oe,width:F.width,height:F.y-oe}:Be===_e?{x:F.x+F.width,y:F.y,width:ie-F.x-F.width+1,height:F.height}:{x:ie,y:F.y,width:F.x-ie,height:F.height}}($,W,_,wt);ka(Y)}else{if(Wt&&G===Xe)return;if(Wt&&_===Xe){if(u.kind!==ui)return;_--}W=Math.max(W,V);const $=Mi(G);_=$===void 0?_:On(_,$[0],$[1]);const Y=W-A,F=_-G,ie={x:Y>=0?A:W,y:F>=0?G:_,width:Math.abs(Y)+1,height:Math.abs(F)+1};Lt({...z.current,range:ie},!0,!1,"drag")}}nn==null||nn({...u,location:[u.location[0]-V,u.location[1]]})}},[s,V,ee,z,Me,nn,je,Wt,Xe,wt,Mi,Lt]),bp=d.useCallback(()=>{var W,_;const u=Oa.current;if(u===void 0)return;const[M,k]=u.scrollEdge;let[P,A]=u.location;const G=Gt.current;M===-1?P=((_=(W=G.extras)==null?void 0:W.freezeRegion)==null?void 0:_.x)??G.x:M===1&&(P=G.x+G.width),k===-1?A=Math.max(0,G.y):k===1&&(A=Math.min(Xe-1,G.y+G.height)),P=On(P,0,Ct.length-1),A=On(A,0,Xe-1),Pa({...u,location:[P,A]})},[Ct.length,Pa,Xe]);(function(u,M,k){const P=$t.useRef(0),[A,G]=u??[0,0];$t.useEffect(()=>{if(A===0&&G===0)return void(P.current=0);let W=!1,_=0;const $=Y=>{var F;if(!W){if(_===0)_=Y;else{const ie=Y-_;P.current=Math.min(1,P.current+ie/1300);const oe=P.current**1.618*ie*2;(F=M.current)==null||F.scrollBy(A*oe,G*oe),_=Y,k==null||k()}window.requestAnimationFrame($)}};return window.requestAnimationFrame($),()=>{W=!0}},[M,A,G,k])})(up,zt,bp);const Wn=d.useCallback(u=>{if(z.current===void 0)return;const[M,k]=u,[P,A]=z.current.cell,G=z.current.range;let W=G.x,_=G.x+G.width,$=G.y,Y=G.y+G.height;const[F,ie]=Mi(A)??[0,Xe-1],oe=ie+1;if(k!==0)switch(k){case 2:Y=oe,$=A,Jt(0,Y,"vertical");break;case-2:$=F,Y=A+1,Jt(0,$,"vertical");break;case 1:$<A?($++,Jt(0,$,"vertical")):(Y=Math.min(oe,Y+1),Jt(0,Y,"vertical"));break;case-1:Y>A+1?(Y--,Jt(0,Y,"vertical")):($=Math.max(F,$-1),Jt(0,$,"vertical"));break;default:lo()}if(M!==0)if(M===2)_=Ct.length,W=P,Jt(_-1-V,0,"horizontal");else if(M===-2)W=V,_=P+1,Jt(W-V,0,"horizontal");else{let ge=[];if(Fe!==void 0){const we=Fe({x:W,y:$,width:_-W-V,height:Y-$},Ie.current.signal);typeof we=="object"&&(ge=function(_e){return S1(Zu(Zu(_e).filter(Ce=>Ce.span!==void 0).map(Ce=>{var Te,Be;return Pr((((Te=Ce.span)==null?void 0:Te[0])??0)+1,(((Be=Ce.span)==null?void 0:Be[1])??0)+1)})))}(we))}if(M===1){let we=!1;if(W<P){if(ge.length>0){const _e=Pr(W+1,P+1).find(Ce=>!ge.includes(Ce-V));_e!==void 0&&(W=_e,we=!0)}else W++,we=!0;we&&Jt(W,0,"horizontal")}we||(_=Math.min(Ct.length,_+1),Jt(_-1-V,0,"horizontal"))}else if(M===-1){let we=!1;if(_>P+1){if(ge.length>0){const _e=Pr(_-1,P,-1).find(Ce=>!ge.includes(Ce-V));_e!==void 0&&(_=_e,we=!0)}else _--,we=!0;we&&Jt(_-V,0,"horizontal")}we||(W=Math.max(V,W-1),Jt(W-V,0,"horizontal"))}else lo()}Lt({cell:z.current.cell,range:{x:W,y:$,width:_-W,height:Y-$}},!0,!1,"keyboard-select")},[Fe,Mi,z,Ct.length,V,Xe,Jt,Lt]),Da=d.useRef(Eo);Da.current=Eo;const Cr=d.useCallback((u,M,k,P)=>{const A=fn-(k?0:1);u=On(u,V,hn.length-1+V),M=On(M,0,A);const G=qn==null?void 0:qn[0],W=qn==null?void 0:qn[1];if(u===G&&M===W)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),Le({...z,current:{cell:[u,M],range:{x:u,y:M,width:1,height:1},rangeStack:_}},!0)}else Lt({cell:[u,M],range:{x:u,y:M,width:1,height:1}},!0,!1,"keyboard-nav");return h.current!==void 0&&h.current[0]===u&&h.current[1]===M&&(h.current=void 0),Da.current&&Jt(u-V,M),!0},[fn,V,hn.length,qn,z,Jt,Le,Lt]),xp=d.useCallback((u,M)=>{(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]=M;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)}R==null||R(u,M)},[o==null?void 0:o.cell,bn,z,R,zn,fn,Cr,Ct.length]),Cp=d.useMemo(()=>"gdg-overlay-"+Mg++,[]),Wr=d.useCallback(u=>{var k,P,A,G;bn();const M=[];for(let W=u.x;W<u.x+u.width;W++)for(let _=u.y;_<u.y+u.height;_++){const $=x([W-V,_]);if(!$.allowOverlay&&$.kind!==pe.Boolean)continue;let Y;if($.kind===pe.Custom){const F=Ht($),ie=(k=F==null?void 0:F.provideEditor)==null?void 0:k.call(F,{...$,location:[W-V,_]});(F==null?void 0:F.onDelete)!==void 0?Y=F.onDelete($):$a(ie)&&(Y=(P=ie==null?void 0:ie.deletedValue)==null?void 0:P.call(ie,$))}else if(Mr($)&&$.allowOverlay||$.kind===pe.Boolean){const F=Ht($);Y=(A=F==null?void 0:F.onDelete)==null?void 0:A.call(F,$)}Y!==void 0&&!kr(Y)&&Mr(Y)&&M.push({location:[W,_],value:Y})}zn(M),(G=ln.current)==null||G.damage(M.map(W=>({cell:W.location})))},[bn,x,Ht,zn,V]),Bo=o!==void 0,T0=d.useCallback(u=>{var we,_e;const M=()=>{u.stopPropagation(),u.preventDefault()},k={didMatch:!1},{bounds:P}=u,A=z.columns,G=z.rows,W=Un;if(!Bo&&at(W.clear,u,k))Le(fi,!1),Kt==null||Kt();else if(!Bo&&at(W.selectAll,u,k))Le({columns:yt.empty(),rows:yt.empty(),current:{cell:((we=z.current)==null?void 0:we.cell)??[V,0],range:{x:V,y:0,width:g.length,height:Xe},rangeStack:[]}},!1);else if(at(W.search,u,k))(_e=l==null?void 0:l.current)==null||_e.focus({preventScroll:!0}),ue(!0);else if(at(W.delete,u,k)){const Ce=(on==null?void 0:on(z))??!0;if(Ce!==!1){const Te=Ce===!0?z:Ce;if(Te.current!==void 0){Wr(Te.current.range);for(const Be of Te.current.rangeStack)Wr(Be)}for(const Be of Te.rows)Wr({x:V,y:Be,width:g.length,height:1});for(const Be of Te.columns)Wr({x:Be,y:0,width:1,height:Xe})}}if(k.didMatch)return M(),!0;if(z.current===void 0)return!1;let[_,$]=z.current.cell;const[,Y]=z.current.cell;let F=!1,ie=!1;if(at(W.scrollToSelectedCell,u,k)?Ii.current(_-V,$):Se!=="none"&&at(W.selectColumn,u,k)?A.hasIndex(_)?ht(A.remove(_),void 0,!0):Se==="single"?ht(yt.fromSingleSelection(_),void 0,!0):ht(void 0,_,!0):ee!=="none"&&at(W.selectRow,u,k)?G.hasIndex($)?je(G.remove($),void 0,!0):ee==="single"?je(yt.fromSingleSelection($),void 0,!0):je(void 0,$,!0):!Bo&&P!==void 0&&at(W.activateCell,u,k)?$===Xe&&Wt?window.setTimeout(()=>{const Ce=Si(_);eo(Ce??_)},0):(m==null||m([_-V,$]),Zr(P,!0)):z.current.range.height>1&&at(W.downFill,u,k)?E0():z.current.range.width>1&&at(W.rightFill,u,k)?R0():at(W.goToNextPage,u,k)?$+=Math.max(1,Gt.current.height-4):at(W.goToPreviousPage,u,k)?$-=Math.max(1,Gt.current.height-4):at(W.goToFirstCell,u,k)?(i(void 0),$=0,_=0):at(W.goToLastCell,u,k)?(i(void 0),$=Number.MAX_SAFE_INTEGER,_=Number.MAX_SAFE_INTEGER):at(W.selectToFirstCell,u,k)?(i(void 0),Wn([-2,-2])):at(W.selectToLastCell,u,k)?(i(void 0),Wn([2,2])):Bo?(at(W.closeOverlay,u,k)&&i(void 0),at(W.acceptOverlayDown,u,k)&&(i(void 0),$++),at(W.acceptOverlayUp,u,k)&&(i(void 0),$--),at(W.acceptOverlayLeft,u,k)&&(i(void 0),_--),at(W.acceptOverlayRight,u,k)&&(i(void 0),_++)):(at(W.goDownCell,u,k)?$+=1:at(W.goUpCell,u,k)?$-=1:at(W.goRightCell,u,k)?_+=1:at(W.goLeftCell,u,k)?_-=1:at(W.goDownCellRetainSelection,u,k)?($+=1,F=!0):at(W.goUpCellRetainSelection,u,k)?($-=1,F=!0):at(W.goRightCellRetainSelection,u,k)?(_+=1,F=!0):at(W.goLeftCellRetainSelection,u,k)?(_-=1,F=!0):at(W.goToLastRow,u,k)?$=Xe-1:at(W.goToFirstRow,u,k)?$=Number.MIN_SAFE_INTEGER:at(W.goToLastColumn,u,k)?_=Number.MAX_SAFE_INTEGER:at(W.goToFirstColumn,u,k)?_=Number.MIN_SAFE_INTEGER:Me!=="rect"&&Me!=="multi-rect"||(at(W.selectGrowDown,u,k)?Wn([0,1]):at(W.selectGrowUp,u,k)?Wn([0,-1]):at(W.selectGrowRight,u,k)?Wn([1,0]):at(W.selectGrowLeft,u,k)?Wn([-1,0]):at(W.selectToLastRow,u,k)?Wn([0,2]):at(W.selectToFirstRow,u,k)?Wn([0,-2]):at(W.selectToLastColumn,u,k)?Wn([2,0]):at(W.selectToFirstColumn,u,k)&&Wn([-2,0])),ie=k.didMatch),Bn!==void 0&&Bn!=="normal"&&$!==Y){const Ce=Bn==="skip-down"||Bn==="skip"||Bn==="block",Te=$<Y;if(Te&&(Bn==="skip-up"||Bn==="skip"||Bn==="block")){for(;$>=0&&Nr($).isGroupHeader;)$--;$<0&&($=Y)}else if(!Te&&Ce){for(;$<Xe&&Nr($).isGroupHeader;)$++;$>=Xe&&($=Y)}}const oe=Cr(_,$,!1,F),ge=k.didMatch;return ge&&(oe||!ie||It)&&M(),ge},[Bn,Bo,z,Un,Se,ee,Me,V,Nr,Xe,Cr,Le,Kt,g.length,on,It,Wr,ht,je,Wt,Si,eo,m,Zr,E0,R0,Wn]),Wo=d.useCallback(u=>{let M=!1;if(he!==void 0&&he({...u,...u.location&&{location:[u.location[0]-V,u.location[1]]},cancel:()=>{M=!0}}),M||T0(u)||z.current===void 0)return;const[k,P]=z.current.cell,A=Gt.current;if(Ze&&!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-V,Math.max(0,Math.min(P,Xe-1))]))){if((!Wt||P!==Xe)&&(A.y>P||P>A.y+A.height||A.x>k||k>A.x+A.width))return;m==null||m([k-V,P]),Zr(u.bounds,!0,u.key),u.stopPropagation(),u.preventDefault()}},[Ze,he,T0,z,x,V,Xe,Wt,m,Zr]),Sp=d.useCallback((u,M)=>{const k=u.location[0]-V;if(u.kind==="header"&&(se==null||se(k,{...u,preventDefault:M})),u.kind===Pn){if(k<0)return;Z==null||Z(k,{...u,preventDefault:M})}if(u.kind==="cell"){const[P,A]=u.location;Q==null||Q([k,A],{...u,preventDefault:M}),function(G,W){const[_,$]=W;if(G.columns.hasIndex(_)||G.rows.hasIndex($))return!0;if(G.current!==void 0){if(vo(G.current.cell,W))return!0;const Y=[G.current.range,...G.current.rangeStack];for(const F of Y)if(_>=F.x&&_<F.x+F.width&&$>=F.y&&$<F.y+F.height)return!0}return!1}(z,u.location)||Cr(P,A,!1,!1)}},[z,Q,Z,se,V,Cr]),za=d.useCallback(async u=>{var W,_,$;if(!Un.paste)return;function M(Y,F,ie,oe){var we,_e;const ge=typeof ie=="object"?(ie==null?void 0:ie.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 p;return((p=window.navigator.clipboard)==null?void 0:p.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 lt(e,t){return e===!0?t:e===!1?"":e}function i0(e){const t=ci.value;return{activateCell:lt(e.activateCell," |Enter|shift+Enter"),clear:lt(e.clear,"any+Escape"),closeOverlay:lt(e.closeOverlay,"any+Escape"),acceptOverlayDown:lt(e.acceptOverlayDown,"Enter"),acceptOverlayUp:lt(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:lt(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:lt(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:lt(e.delete,t?"Backspace|Delete":"Delete"),downFill:lt(e.downFill,"primary+_68"),scrollToSelectedCell:lt(e.scrollToSelectedCell,"primary+Enter"),goDownCell:lt(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:lt(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:lt(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:lt(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:lt(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:lt(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:lt(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:lt(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:lt(e.goToFirstCell,"primary+Home"),goToFirstColumn:lt(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:lt(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:lt(e.goToLastCell,"primary+End"),goToLastColumn:lt(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:lt(e.goToLastRow,"primary+ArrowDown"),goToNextPage:lt(e.goToNextPage,"PageDown"),goToPreviousPage:lt(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:lt(e.rightFill,"primary+_82"),search:lt(e.search,"primary+f"),selectAll:lt(e.selectAll,"primary+a"),selectColumn:lt(e.selectColumn,"ctrl+ "),selectGrowDown:lt(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:lt(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:lt(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:lt(e.selectGrowUp,"shift+ArrowUp"),selectRow:lt(e.selectRow,"shift+ "),selectToFirstCell:lt(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:lt(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:lt(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:lt(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:lt(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:lt(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(v,E){const[g]=d.useState(()=>({value:v,callback:E,facade:{get current(){return g.value},set current(b){const x=g.value;x!==b&&(g.value=b,g.callback(b,x))}}}));return g.callback=E,g.facade}(null,v=>{v!==null&&t!==void 0?v.scrollTop=t:v!==null&&e!==void 0&&(v.scrollLeft=e)}),p=(s.height??1)>1;d.useLayoutEffect(()=>{if(t!==void 0&&y.current!==null&&p){if(y.current.scrollTop===t)return;y.current.scrollTop=t,y.current.scrollTop!==t&&h(),C.current()}},[t,p,h,y]);const w=(s.width??1)>1;return d.useLayoutEffect(()=>{if(e!==void 0&&y.current!==null&&w){if(y.current.scrollLeft===e)return;y.current.scrollLeft=e,y.current.scrollLeft!==e&&h(),C.current()}},[e,w,h,y]),{visibleRegion:s,setVisibleRegion:c,scrollRef:y}}const kg=d.lazy(async()=>await L0(()=>import("./data-grid-overlay-editor-BR_18m9z.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:pe.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:p,markdownDivCreateNode:w,width:v,height:E,columns:g,rows:b,getCellContent:x,onCellClicked:I,onCellActivated:m,onFillPattern:S,onFinishedEditing:R,coercePasteValue:H,drawHeader:f,drawCell:B,editorBloom:D,onHeaderClicked:O,onColumnProposeMove:T,rangeSelectionColumnSpanning:j=!0,spanRangeBehavior:U="default",onGroupHeaderClicked:te,onCellContextMenu:Q,className:ce,onHeaderContextMenu:se,getCellsForSelection:q,onGroupHeaderContextMenu:Z,onGroupHeaderRenamed:fe,onCellEdited:N,onCellsEdited:K,onSearchResultsChanged:ne,searchResults:X,onSearchValueChange:J,searchValue:ae,onKeyDown:he,onKeyUp:ze,keybindings:$e,editOnType:Ze=!0,onRowAppended:He,onColumnMoved:We,validateCell:me,highlightRegions:ye,rangeSelect:Me="rect",columnSelect:Se="multi",rowSelect:ee="multi",rangeSelectionBlending:Pe="exclusive",columnSelectionBlending:ke="exclusive",rowSelectionBlending:Ge="exclusive",onDelete:Re,onDragStart:nt,onMouseMove:Ke,onPaste:ct,copyHeaders:Ee=!1,freezeColumns:Ae=0,cellActivationBehavior:ut="second-click",rowSelectionMode:dt="auto",onHeaderMenuClick:pt,onHeaderIndicatorClick:Ft,getGroupDetails:bt,rowGrouping:Qe,onSearchClose:Yt,onItemHovered:nn,onSelectionCleared:Kt,showSearch:qt,onVisibleRegionChanged:un,gridSelection:jt,onGridSelectionChange:Kn,minColumnWidth:vr=50,maxColumnWidth:Dt=500,maxColumnAutoWidth:er,provideEditor:_n,trailingRowOptions:re,freezeTrailingRows:be=0,allowedFillDirections:wt="orthogonal",scrollOffsetX:st,scrollOffsetY:xt,verticalBorder:ve,onDragOverCell:Ve,onDrop:Ye,onColumnResize:mt,onColumnResizeEnd:rt,onColumnResizeStart:ot,customRenderers:vt,fillHandle:Ue,experimental:it,fixedShadowX:tt,fixedShadowY:Oe,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: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,tr=(Ot==null?void 0:Ot.theme)??e.rowMarkerTheme,nr=Ot==null?void 0:Ot.headerTheme,qr=Ot==null?void 0:Ot.headerAlwaysVisible,rr=ee!=="multi"||(Ot==null?void 0:Ot.headerDisabled)===!0,yr=(Ot==null?void 0:Ot.checkboxStyle)??"square",or=Math.max(vr,20),Ar=Math.max(Dt,or),pi=Math.max(er??Ar,or),Ho=d.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Xe,rowNumberMapper:Oo,rowHeight:mi,getRowThemeOverride:jn}=function(u,M,k,P){const A=$t.useMemo(()=>u===void 0?void 0:ma(u,M),[u,M]),G=$t.useMemo(()=>A==null?void 0:A.reduce((F,ie)=>(F[ie.rowIndex]=ie,F),{}),[A]),W=$t.useMemo(()=>A===void 0?M:A.reduce((F,ie)=>F+(ie.isCollapsed?1:ie.rows+1),0),[A,M]),_=$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]),$=$t.useCallback(F=>{if(A===void 0)return F;let ie=F;for(const oe of A){if(ie===0)return;if(ie--,!oe.isCollapsed){if(ie<oe.rows)return oe.contentIndex+ie;ie-=oe.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:ie,contentIndex:oe,groupIndex:ge}=va(F,A);return ie?u.themeOverride:P==null?void 0:P(F,ge,oe)},[A,P,u]));return u===void 0?{rowHeight:_,rows:M,rowNumberMapper:$,getRowThemeOverride:Y}:{rowHeight:_,rows:W,rowNumberMapper:$,getRowThemeOverride:Y}}(Qe,b,qe,p),Sa=d.useMemo(()=>Number.parseFloat(Ho.fontSize),[Ho]),{rowHeight:Vn,headerHeight:Fr,groupHeaderHeight:Po,theme:Lr,overscrollX:Do,overscrollY:zo}=function({rowHeight:u,headerHeight:M,groupHeaderHeight:k,theme:P,overscrollX:A,overscrollY:G,scaleToRem:W,remSize:_}){const[$,Y,F,ie,oe,ge]=$t.useMemo(()=>{if(!W||_===16)return[u,M,k,P,A,G];const we=_/16,_e=u,Ce=iu();return[typeof _e=="number"?_e*we:Te=>Math.ceil(_e(Te)*we),Math.ceil(M*we),Math.ceil(k*we),{...P,headerIconSize:((P==null?void 0:P.headerIconSize)??Ce.headerIconSize)*we,cellHorizontalPadding:((P==null?void 0:P.cellHorizontalPadding)??Ce.cellHorizontalPadding)*we,cellVerticalPadding:((P==null?void 0:P.cellVerticalPadding)??Ce.cellVerticalPadding)*we},Math.ceil((A??0)*we),Math.ceil((G??0)*we)]},[k,M,A,G,_,u,W,P]);return{rowHeight:$,headerHeight:Y,groupHeaderHeight:F,theme:ie,overscrollX:oe,overscrollY:ge}}({groupHeaderHeight:Mn,headerHeight:Qt,overscrollX:Sn,overscrollY:Rt,remSize:Sa,rowHeight:mi,scaleToRem:Tt,theme:mn}),Un=xg($e),Nn=gi??(b>1e4?48:b>1e3?44:b>100?36:32),wn=vn!=="none",V=wn?1:0,Wt=He!==void 0,L=(re==null?void 0:re.sticky)===!0,[le,ue]=d.useState(!1),xe=qt??le,de=d.useCallback(()=>{Yt!==void 0?Yt():ue(!1)},[Yt]),z=d.useMemo(()=>jt===void 0?void 0:di(jt,V),[jt,V])??n,Ie=d.useRef();Ie.current===void 0&&(Ie.current=new AbortController),d.useEffect(()=>()=>Ie==null?void 0:Ie.current.abort(),[]);const[Fe,Ne]=function(u,M,k,P,A){const G=d.useCallback($=>{if(u===!0){const Y=[];for(let F=$.y;F<$.y+$.height;F++){const ie=[];for(let oe=$.x;oe<$.x+$.width;oe++)oe<0||F>=A?ie.push({kind:pe.Loading,allowOverlay:!1}):ie.push(M([oe,F]));Y.push(ie)}return Y}return(u==null?void 0:u($,P.signal))??[]},[P.signal,M,u,A]),W=u!==void 0?G:void 0,_=d.useCallback($=>{if(W===void 0)return[];const Y={...$,x:$.x-k};if(Y.x<0){Y.x=0,Y.width--;const F=W(Y,P.signal);return typeof F=="function"?async()=>(await F()).map(ie=>[{kind:pe.Loading,allowOverlay:!1},...ie]):F.map(ie=>[{kind:pe.Loading,allowOverlay:!1},...ie])}return W(Y,P.signal)},[P.signal,W,k]);return[u!==void 0?_:void 0,W]}(q,x,V,Ie.current,Xe),Mt=d.useCallback((u,M,k)=>{if(me===void 0)return!0;const P=[u[0]-V,u[1]];return me==null?void 0:me(P,M,k)},[V,me]),De=d.useRef(jt),Le=d.useCallback((u,M)=>{M&&(u=function(k,P,A,G,W){var Y;const _=k;if(G==="allowPartial"||k.current===void 0||P===void 0)return k;let $=!1;do{if((k==null?void 0:k.current)===void 0)break;const F=(Y=k.current)==null?void 0:Y.range,ie=[];if(F.width>2){const we=P({x:F.x,y:F.y,width:1,height:F.height},W.signal);if(typeof we=="function")return _;ie.push(...we);const _e=P({x:F.x+F.width-1,y:F.y,width:1,height:F.height},W.signal);if(typeof _e=="function")return _;ie.push(..._e)}else{const we=P({x:F.x,y:F.y,width:F.width,height:F.height},W.signal);if(typeof we=="function")return _;ie.push(...we)}let oe=F.x-A,ge=F.x+F.width-1-A;for(const we of ie)for(const _e of we)_e.span!==void 0&&(oe=Math.min(_e.span[0],oe),ge=Math.max(_e.span[1],ge));oe===F.x-A&&ge===F.x+F.width-1-A?$=!0:k={current:{cell:k.current.cell??[0,0],range:{x:oe+A,y:F.y,width:ge-oe+1,height:F.height},rangeStack:k.current.rangeStack},columns:k.columns,rows:k.rows}}while(!$);return k}(u,Fe,V,U,Ie.current)),Kn!==void 0?(De.current=di(u,-V),Kn(De.current)):r(u)},[Kn,Fe,V,U]),Je=dr(mt,d.useCallback((u,M,k,P)=>{mt==null||mt(g[k-V],M,k-V,P)},[mt,V,g])),dn=dr(rt,d.useCallback((u,M,k,P)=>{rt==null||rt(g[k-V],M,k-V,P)},[rt,V,g])),en=dr(ot,d.useCallback((u,M,k,P)=>{ot==null||ot(g[k-V],M,k-V,P)},[ot,V,g])),br=dr(f,d.useCallback((u,M)=>(f==null?void 0:f({...u,columnIndex:u.columnIndex-V},M))??!1,[f,V])),ir=dr(B,d.useCallback((u,M)=>(B==null?void 0:B({...u,col:u.col-V},M))??!1,[B,V])),on=d.useCallback(u=>{if(Re!==void 0){const M=Re(di(u,-V));return typeof M=="boolean"?M:di(M,V)}return!0},[Re,V]),[Lt,je,ht]=function(u,M,k,P,A,G,W){return[$t.useCallback((_,$,Y,F)=>{var _e;G!=="cell"&&G!=="multi-cell"||_===void 0||(_={..._,range:{x:_.cell[0],y:_.cell[1],width:1,height:1}}),!W&&_!==void 0&&_.range.width>1&&(_={..._,range:{..._.range,width:1,x:_.cell[0]}});const ie=k==="mixed"&&(Y||F==="drag"),oe=P==="mixed"&&ie,ge=A==="mixed"&&ie;let we={current:_===void 0?void 0:{..._,rangeStack:F==="drag"?((_e=u.current)==null?void 0:_e.rangeStack)??[]:[]},columns:oe?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]}}),M(we,$)},[P,u,k,G,W,A,M]),$t.useCallback((_,$,Y)=>{let F;if(_=_??u.rows,$!==void 0&&(_=_.add($)),A==="exclusive"&&_.length>0)F={current:void 0,columns:yt.empty(),rows:_};else{const ie=Y&&P==="mixed";F={current:Y&&k==="mixed"?u.current:void 0,columns:ie?u.columns:yt.empty(),rows:_}}M(F,!1)},[P,u,k,A,M]),$t.useCallback((_,$,Y)=>{let F;if(_=_??u.columns,$!==void 0&&(_=_.add($)),P==="exclusive"&&_.length>0)F={current:void 0,rows:yt.empty(),columns:_};else{const ie=Y&&A==="mixed";F={current:Y&&k==="mixed"?u.current:void 0,rows:ie?u.rows:yt.empty(),columns:_}}M(F,!1)},[P,u,k,A,M])]}(z,Le,Pe,ke,Ge,Me,j),gt=d.useMemo(()=>Jn(iu(),Lr),[Lr]),[yn,an]=d.useState([0,0,0]),ar=d.useMemo(()=>{if(Ro===void 0)return{};const u={};for(const M of Ro)u[M.kind]=M;return u},[Ro]),Ht=d.useCallback(u=>u.kind!==pe.Custom?ar[u.kind]:vt==null?void 0:vt.find(M=>M.isMatch(u)),[vt,ar]);let{sizedColumns:hn,nonGrowWidth:vi}=function(u,M,k,P,A,G,W,_,$){const Y=d.useRef(M),F=d.useRef(k),ie=d.useRef(W);Y.current=M,F.current=k,ie.current=W;const[oe,ge]=d.useMemo(()=>{if(typeof window>"u")return[null,null];const Be=document.createElement("canvas");return Be.style.display="none",Be.style.opacity="0",Be.style.position="fixed",[Be,Be.getContext("2d",{alpha:!1})]},[]);d.useLayoutEffect(()=>(oe&&document.documentElement.append(oe),()=>{oe==null||oe.remove()}),[oe]);const we=d.useRef({}),_e=d.useRef(),[Ce,Te]=d.useState();return d.useLayoutEffect(()=>{const Be=F.current;if(Be===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=Be(tn,$.signal),sn=Ut>0?Be(St,$.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)]),_e.current=u,Te(xn)})()},[$.signal,u]),d.useMemo(()=>{let Be=u.every(ei)?u:ge===null?u.map(St=>ei(St)?St:{...St,width:150}):(ge.font=ie.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(Ce===void 0||_e.current!==u||St.id===void 0)return{...St,width:150};const sn=au(ge,W,St,At,Ce,A,G,!0,_);return we.current[St.id]=sn.width,sn})),_t=0,Ut=0;const tn=[];for(const[St,At]of Be.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=[...Be],At=P-_t;let sn=At;for(let xn=0;xn<tn.length;xn++){const sr=tn[xn],Xo=(Be[sr].grow??0)/Ut,Aa=xn===tn.length-1?sn:Math.min(sn,Math.floor(At*Xo));St[sr]={...Be[sr],growOffset:Aa,width:Be[sr].width+Aa},sn-=Aa}Be=St}return{sizedColumns:Be,nonGrowWidth:_t}},[P,u,ge,Ce,W,A,G,_])}(g,Xe,Ne,yn[0]-(V===0?0:Nn)-yn[2],or,pi,gt,Ht,Ie.current);vn!=="none"&&(vi+=Nn);const Qr=d.useMemo(()=>hn.some(u=>u.group!==void 0),[hn]),lr=Qr?Fr+Po:Fr,Ao=z.rows.length,Fo=vn==="none"?void 0:Ao!==0&&(Ao===Xe||void 0),Ct=d.useMemo(()=>vn==="none"?hn:[{title:"",width:Nn,icon:void 0,hasMenu:!1,style:"normal",themeOverride:tr,rowMarker:yr,rowMarkerChecked:Fo,headerRowMarkerTheme:nr,headerRowMarkerAlwaysVisible:qr,headerRowMarkerDisabled:rr},...hn],[vn,hn,Nn,tr,yr,Fo,nr,qr,rr]),Gt=d.useRef({height:1,width:1,x:0,y:0}),Dn=d.useRef(!1),{setVisibleRegion:Lo,visibleRegion:_r,scrollRef:zt}=Sg(st,xt,Vn,Gt,()=>Dn.current=!0);Gt.current=_r;const lp=_r.x+V,wi=_r.y,ln=d.useRef(null),bn=d.useCallback(u=>{var M;u===!0?(M=ln.current)==null||M.focus():window.requestAnimationFrame(()=>{var k;(k=ln.current)==null||k.focus()})},[]),fn=Wt?Xe+1:Xe,zn=d.useCallback(u=>{const M=V===0?u:u.map(P=>({...P,location:[P.location[0]-V,P.location[1]]})),k=K==null?void 0:K(M);if(k!==!0)for(const P of M)N==null||N(P.location,P.value);return k},[N,K,V]),[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 M of ye){const k=Ct.length-M.range.x-V;k>0&&u.push({color:M.color,range:{...M.range,x:M.range.x+V,width:Math.min(k,M.range.width)},style:M.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,V]),b0=d.useRef(Ct);b0.current=Ct;const Tn=d.useCallback(([u,M],k=!1)=>{var A,G,W,_,$,Y,F;const P=Wt&&M===fn-1;if(u===0&&wn){if(P)return hi;const ie=Oo(M);return ie===void 0?hi:{kind:Hn.Marker,allowOverlay:!1,checkboxStyle:yr,checked:(z==null?void 0:z.rows.hasIndex(M))===!0,markerKind:vn==="clickable-number"?"number":vn,row:To+ie,drawHandle:Xt!==void 0,cursor:vn==="clickable-number"?"pointer":void 0}}if(P){const ie=u===V?(re==null?void 0:re.hint)??"":"",oe=b0.current[u];if(((A=oe==null?void 0:oe.trailingRowOptions)==null?void 0:A.disabled)===!0)return hi;{const ge=((G=oe==null?void 0:oe.trailingRowOptions)==null?void 0:G.hint)??ie,we=((W=oe==null?void 0:oe.trailingRowOptions)==null?void 0:W.addIcon)??(re==null?void 0:re.addIcon);return{kind:Hn.NewRow,hint:ge,allowOverlay:!1,icon:we}}}{const ie=u-V;if(k||(it==null?void 0:it.strict)===!0){const ge=Gt.current,we=ge.x>ie||ie>ge.x+ge.width||ge.y>M||M>ge.y+ge.height||M>=Ra.current,_e=ie===(($=(_=ge.extras)==null?void 0:_.selected)==null?void 0:$[0])&&M===((Y=ge.extras)==null?void 0:Y.selected[1]);let Ce=!1;if(((F=ge.extras)==null?void 0:F.freezeRegions)!==void 0){for(const Te of ge.extras.freezeRegions)if(Dr(Te,ie,M)){Ce=!0;break}}if(we&&!_e&&!Ce)return hi}let oe=x([ie,M]);return V!==0&&oe.span!==void 0&&(oe={...oe,span:[oe.span[0]+V,oe.span[1]+V]}),oe}},[Wt,fn,wn,Oo,yr,z==null?void 0:z.rows,vn,To,Xt,V,re==null?void 0:re.hint,re==null?void 0:re.addIcon,it==null?void 0:it.strict,x]),Ma=d.useCallback(u=>{let M=(bt==null?void 0:bt(u))??{name:u};return fe!==void 0&&u!==""&&(M={icon:M.icon,name:M.name,overrideTheme:M.overrideTheme,actions:[...M.actions??[],{title:"Rename",icon:"renameIcon",onClick:k=>Ia({group:M.name,bounds:k.bounds})}]}),M},[bt,fe]),Ci=d.useCallback(u=>{var _;const[M,k]=u.cell,P=Ct[M],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,W=jn==null?void 0:jn(k);i({...u,theme:Jn(gt,A,G,W,u.content.themeOverride)})},[jn,Ct,Ma,gt]),Zr=d.useCallback((u,M,k)=>{var W;if(z.current===void 0)return;const[P,A]=z.current.cell,G=Tn([P,A]);if(G.kind!==pe.Boolean&&G.allowOverlay){let _=G;if(k!==void 0)switch(_.kind){case pe.Number:{const $=function(Y,F){try{return Y()}catch{return F}}(()=>k==="-"?-0:Number.parseFloat(k),0);_={..._,data:Number.isNaN($)?0:$};break}case pe.Text:case pe.Markdown:case pe.Uri:_={..._,data:k}}Ci({target:u,content:_,initialValue:k,cell:[P,A],highlight:k===void 0,forceEditMode:k!==void 0})}else G.kind===pe.Boolean&&M&&G.readonly!==!0&&(zn([{location:z.current.cell,value:{...G,data:r0(G.data)}}]),(W=ln.current)==null||W.damage([{cell:z.current.cell}]))},[Tn,z,zn,Ci]),x0=d.useCallback((u,M)=>{var A;const k=(A=ln.current)==null?void 0:A.getBounds(u,M);if(k===void 0||zt.current===null)return;const P=Tn([u,M]);P.allowOverlay&&Ci({target:k,content:P,initialValue:void 0,highlight:!0,cell:[u,M],forceEditMode:!0})},[Tn,zt,Ci]),Jt=d.useCallback((u,M,k="both",P=0,A=0,G=void 0)=>{if(zt.current!==null){const W=ln.current,_=a.current,$=typeof u!="number"?u.unit==="cell"?u.amount:void 0:u,Y=typeof M!="number"?M.unit==="cell"?M.amount:void 0:M,F=typeof u!="number"&&u.unit==="px"?u.amount:void 0,ie=typeof M!="number"&&M.unit==="px"?M.amount:void 0;if(W!==null&&_!==null){let oe={x:0,y:0,width:0,height:0},ge=0,we=0;if(($!==void 0||Y!==void 0)&&(oe=W.getBounds(($??0)+V,Y??0)??oe,oe.width===0||oe.height===0))return;const _e=_.getBoundingClientRect(),Ce=_e.width/_.offsetWidth;if(F!==void 0&&(oe={...oe,x:F-_e.left-zt.current.scrollLeft,width:1}),ie!==void 0&&(oe={...oe,y:ie+_e.top-zt.current.scrollTop,height:1}),oe!==void 0){const Te={x:oe.x-P,y:oe.y-A,width:oe.width+2*P,height:oe.height+2*A};let Be=0;for(let Xo=0;Xo<Ae;Xo++)Be+=hn[Xo].width;let _t=0;const Ut=be+(L?1:0);Ut>0&&(_t=Or(fn,Ut,Vn));let tn=Be*Ce+_e.left+V*Nn*Ce,St=_e.right,At=_e.top+lr*Ce,sn=_e.bottom-_t*Ce;const xn=oe.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 sr=oe.height+2*A;switch(G==null?void 0:G.vAlign){case"start":sn=At+sr;break;case"end":At=sn-sr;break;case"center":At=Math.floor((At+sn)/2)-sr/2,sn=At+sr}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<Ae?ge=0:(k==="horizontal"||typeof M=="number"&&M>=fn-Ut)&&(we=0),ge===0&&we===0||(Ce!==1&&(ge/=Ce,we/=Ce),zt.current.scrollTo({left:ge+zt.current.scrollLeft,top:we+zt.current.scrollTop,behavior:(G==null?void 0:G.behavior)??"auto"}))}}}},[V,be,Nn,zt,lr,Ae,hn,fn,L,Vn]),C0=d.useRef(x0),S0=d.useRef(x),Ra=d.useRef(Xe);C0.current=x0,S0.current=x,Ra.current=Xe;const eo=d.useCallback(async(u,M=!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,W=!0;A!==void 0&&(G=await A,G==="top"&&(W=!1),typeof G=="number"&&(W=!1));let _=0;const $=()=>{if(Ra.current<=Xe)return _<500&&window.setTimeout($,_),void(_=50+2*_);const F=typeof G=="number"?G:W?Xe:0;Ii.current(u-V,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 ie=S0.current([u-V,F]);ie.allowOverlay&&so(ie)&&ie.readonly!==!0&&M&&window.setTimeout(()=>{C0.current(u,F)},0)};$()},[Ct,He,V,Xe,Lt]),Si=d.useCallback(u=>{var k,P;const M=((P=(k=hn[u])==null?void 0:k.trailingRowOptions)==null?void 0:P.targetColumn)??(re==null?void 0:re.targetColumn);if(typeof M=="number")return M+(wn?1:0);if(typeof M=="object"){const A=g.indexOf(M);if(A>=0)return A+(wn?1:0)}},[hn,g,wn,re==null?void 0:re.targetColumn]),xr=d.useRef(),to=d.useRef(),_o=d.useCallback((u,M)=>{var A;const[k,P]=M;return Jn(gt,(A=Ct[k])==null?void 0:A.themeOverride,jn==null?void 0:jn(P),u.themeOverride)},[jn,Ct,gt]),{mapper:Nr}=function(u,M){const k=$t.useMemo(()=>u===void 0?void 0:ma(u,M),[u,M]);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])}}(Qe,b),Bn=Qe==null?void 0:Qe.navigationBehavior,jo=d.useCallback(u=>{var F,ie,oe;const M=ci.value?u.metaKey:u.ctrlKey,k=M&&ee==="multi",P=M&&Se==="multi",[A,G]=u.location,W=z.columns,_=z.rows,[$,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===Xe||vn==="number"||ee==="none")return;const ge=Tn(u.location);if(ge.kind!==Hn.Marker)return;if(Xt!==void 0){const Ce=Ht(ge);Rn((Ce==null?void 0:Ce.kind)===Hn.Marker);const Te=(ie=Ce==null?void 0:Ce.onClick)==null?void 0:ie.call(Ce,{...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),_e=xr.current;if(ee==="multi"&&(u.shiftKey||u.isLongTouch===!0)&&_e!==void 0&&_.hasIndex(_e)){const Ce=[Math.min(_e,G),Math.max(_e,G)+1];k||dt==="multi"?je(void 0,Ce,!0):je(yt.fromSingleSelection(Ce),void 0,k)}else ee==="multi"&&(k||u.isTouch||dt==="multi")?we?je(_.remove(G),void 0,!0):(je(void 0,G,!0),xr.current=G):we&&_.length===1?je(yt.empty(),void 0,M):(je(yt.fromSingleSelection(G),void 0,M),xr.current=G)}else if(A>=V&&Wt&&G===Xe){const ge=Si(A);eo(ge??A)}else if($!==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 _e=L&&G===Xe,Ce=L&&z!==void 0&&((oe=z.current)==null?void 0:oe.cell[1])===Xe;if(!u.shiftKey&&u.isLongTouch!==!0||$===void 0||Y===void 0||z.current===void 0||Ce)Lt({cell:[A,G],range:{x:A,y:G,width:1,height:1}},!0,M,"click"),xr.current=void 0,i(void 0),bn();else{if(_e)return;const Te=Math.min(A,$),Be=Math.max(A,$),_t=Math.min(G,Y),Ut=Math.max(G,Y);Lt({...z.current,range:{x:Te,y:_t,width:Be-Te+1,height:Ut-_t+1}},!0,M,"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,rr||ee!=="multi"||(_.length!==Xe?je(yt.fromSingleSelection([0,Xe]),void 0,M):je(yt.empty(),void 0,M),bn());else{const ge=to.current;if(Se==="multi"&&(u.shiftKey||u.isLongTouch===!0)&&ge!==void 0&&W.hasIndex(ge)){const we=[Math.min(ge,A),Math.max(ge,A)+1];P?ht(void 0,we,M):ht(yt.fromSingleSelection(we),void 0,M)}else P?(W.hasIndex(A)?ht(W.remove(A),void 0,M):ht(void 0,A,M),to.current=A):Se!=="none"&&(W.hasIndex(A)?ht(W.remove(A),void 0,M):ht(yt.fromSingleSelection(A),void 0,M),to.current=A);xr.current=void 0,bn()}else u.kind===Pn?Br.current=[A,G]:u.kind!==ui||u.isMaybeScrollbar||(Le(fi,!1),i(void 0),bn(),Kt==null||Kt(),xr.current=void 0,to.current=void 0)},[ee,Se,z,wn,V,Wt,Xe,vn,Tn,Xt,bn,dt,Ht,_o,je,Si,eo,Bn,Nr,L,Lt,ht,Le,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 M=performance.now();An.current={button:u.button,time:M,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||Se!=="multi")return;const M=ci.value?u.metaKey:u.ctrlKey,[k]=u.location,P=z.columns;if(k<V)return;const A=Ct[k];let G=k,W=k;for(let _=k-1;_>=V&&mo(A.group,Ct[_].group);_--)G--;for(let _=k+1;_<Ct.length&&mo(A.group,Ct[_].group);_++)W++;if(bn(),M)if(P.hasAll([G,W+1])){let _=P;for(let $=G;$<=W;$++)_=_.remove($);ht(_,void 0,M)}else ht(void 0,[G,W+1],M);else ht(yt.fromSingleSelection([G,W+1]),void 0,M)},[Se,bn,z.columns,Ct,V,ht]),no=d.useRef(!1),ki=d.useCallback(async u=>{if(Fe!==void 0&&Je!==void 0){const M=Gt.current.y,k=Gt.current.height;let P=Fe({x:u,y:M,width:1,height:Math.min(k,Xe-M)},Ie.current.signal);typeof P!="object"&&(P=await P());const A=hn[u-V],G=document.createElement("canvas").getContext("2d",{alpha:!1});if(G!==null){G.font=gt.baseFontFull;const W=au(G,gt,A,0,P,or,Ar,!1,Ht);Je==null||Je(A,W.width,u,W.width)}}},[hn,Fe,Ar,gt,or,Je,V,Xe,Ht]),[up,Ta]=d.useState(),ro=d.useCallback(async(u,M)=>{var _,$;const k=(_=u.current)==null?void 0:_.range;if(k===void 0||Fe===void 0||M.current===void 0)return;const P=M.current.range;if(S!==void 0){let Y=!1;if(S({fillDestination:{...P,x:P.x-V},patternSource:{...k,x:k.x-V},preventDefault:()=>Y=!0}),Y)return}let A=Fe(k,Ie.current.signal);typeof A!="object"&&(A=await A());const G=A,W=[];for(let Y=0;Y<P.width;Y++)for(let F=0;F<P.height;F++){const ie=[P.x+Y,P.y+F];if(Yc(ie,k))continue;const oe=G[F%k.height][Y%k.width];!kr(oe)&&so(oe)&&W.push({location:ie,value:{...oe}})}zn(W),($=ln.current)==null||$.damage(W.map(Y=>({cell:Y.location})))},[Fe,zn,S,V]),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,M)=>{var F,ie;const k=s;if(c(void 0),ka(void 0),Ta(void 0),No.current=!1,M)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 oe={...z,current:{...z.current,range:md(k.previousSelection.current.range,jr)}};return ro(k.previousSelection,oe),void Le(oe,!0)}const[P,A]=u.location,[G,W]=Br.current??[],_=()=>{no.current=!0},$=oe=>{var we,_e,Ce;const ge=oe.isTouch||G===P&&W===A;if(ge&&(I==null||I([P-V,A],{...oe,preventDefault:_})),oe.button===1)return!no.current;if(!no.current){const Te=Tn(u.location),Be=Ht(Te);if(Be!==void 0&&Be.onClick!==void 0&&ge){const Ut=Be.onClick({...oe,cell:Te,posX:oe.localEventX,posY:oe.localEventY,bounds:oe.bounds,theme:_o(Te,u.location),preventDefault:_});Ut!==void 0&&!kr(Ut)&&Mr(Ut)&&(zn([{location:oe.location,value:Ut}]),(we=ln.current)==null||we.damage([{cell:oe.location}]))}if(no.current||z.current===void 0)return!1;let _t=!1;switch(Te.activationBehaviorOverride??ut){case"double-click":case"second-click":{if(((Ce=(_e=k==null?void 0:k.previousSelection)==null?void 0:_e.current)==null?void 0:Ce.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&&(oe.isDoubleClick===!0||ut==="second-click");break}case"single-click":_t=!0}if(_t)return m==null||m([P-V,A]),Zr(oe.bounds,!1),!0}return!1},Y=u.location[0]-V;if(u.isTouch){const oe=Gt.current,ge=k0.current;if(oe.x!==ge.x||oe.y!==ge.y)return;if(u.isLongTouch===!0){if(u.kind==="cell"&&vo((ie=z.current)==null?void 0:ie.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(se==null?void 0:se(Y,{...u,preventDefault:_}));if(u.kind===Pn)return Y<0?void 0:void(Z==null?void 0:Z(Y,{...u,preventDefault:_}))}return void(u.kind==="cell"?$(u)||jo(u):u.kind===Pn?te==null?void 0:te(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===W&&(O==null||O(Y,{...u,preventDefault:_}))}if(u.kind===Pn){if(Y<0)return;u.button===0&&P===G&&A===W&&(te==null||te(Y,{...u,preventDefault:_}),no.current||M0(u))}u.kind!=="cell"||u.button!==0&&u.button!==1||$(u),Br.current=void 0},[s,z,V,jr,ro,Le,I,Tn,Ht,ut,_o,zn,m,Zr,Q,se,Z,jo,te,O,ki,M0]),hp=d.useCallback(u=>{const M={...u,location:[u.location[0]-V,u.location[1]]};Ke==null||Ke(M),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)<V?void 0:u.scrollEdge})},[s,Ke,V]),fp=d.useCallback((u,M)=>{pt==null||pt(u-V,M)},[pt,V]),gp=d.useCallback((u,M)=>{Ft==null||Ft(u-V,M)},[Ft,V]),qn=(A0=z==null?void 0:z.current)==null?void 0:A0.cell,pp=d.useCallback((u,M,k,P,A,G)=>{Dn.current=!1;let W=qn;W!==void 0&&(W=[W[0]-V,W[1]]);const _=Ae===0?void 0:{x:0,y:u.y,width:Ae,height:u.height},$=[];_!==void 0&&$.push(_),be>0&&($.push({x:u.x-V,y:Xe-be,width:u.width,height:be}),Ae>0&&$.push({x:0,y:Xe-be,width:Ae,height:be}));const Y={x:u.x-V,y:u.y,width:u.width,height:Wt&&u.y+u.height>=Xe?u.height-1:u.height,tx:A,ty:G,extras:{selected:W,freezeRegion:_,freezeRegions:$}};Gt.current=Y,Lo(Y),an([M,k,P]),un==null||un(Y,Y.tx,Y.ty,Y.extras)},[qn,V,Wt,Xe,Ae,be,Lo,un]),mp=dr(T,d.useCallback((u,M)=>(T==null?void 0:T(u-V,M-V))!==!1,[T,V])),vp=dr(We,d.useCallback((u,M)=>{We==null||We(u-V,M-V),Se!=="none"&&ht(yt.fromSingleSelection(M),void 0,!0)},[Se,We,V,ht])),Ha=d.useRef(!1),wp=d.useCallback(u=>{u.location[0]===0&&V>0?u.preventDefault():(nt==null||nt({...u,location:[u.location[0]-V,u.location[1]]}),u.defaultPrevented()||(Ha.current=!0),c(void 0))},[nt,V]),yp=d.useCallback(()=>{Ha.current=!1},[]),I0=Qe==null?void 0:Qe.selectionBehavior,Mi=d.useCallback(u=>{if(I0!=="block-spanning")return;const{isGroupHeader:M,path:k,groupRows:P}=Nr(u);if(M)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 M,k,P;if(!(qf(u,Oa.current)||(Oa.current=u,((M=An==null?void 0:An.current)==null?void 0:M.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&&V===1&&ee==="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;je(yt.fromSingleSelection([A,G]),void 0,!1)}if(!(u.buttons===0||s===void 0||z.current===void 0||Ha.current||No.current||Me!=="rect"&&Me!=="multi-rect")){const[A,G]=z.current.cell;let[W,_]=u.location;if(_<0&&(_=Gt.current.y),s.fillHandle===!0&&((P=s.previousSelection)==null?void 0:P.current)!==void 0){const $=s.previousSelection.current.range;_=Math.min(_,Wt?Xe-1:Xe);const Y=function(F,ie,oe,ge){if(ge==="any")return md(F,{x:ie,y:oe,width:1,height:1});if(ge==="vertical"&&(ie=F.x),ge==="horizontal"&&(oe=F.y),Yc([ie,oe],F))return;const we=ie-F.x,_e=F.x+F.width-ie,Ce=oe-F.y+1,Te=F.y+F.height-oe,Be=Math.min(ge==="vertical"?Number.MAX_SAFE_INTEGER:we,ge==="vertical"?Number.MAX_SAFE_INTEGER:_e,ge==="horizontal"?Number.MAX_SAFE_INTEGER:Ce,ge==="horizontal"?Number.MAX_SAFE_INTEGER:Te);return Be===Te?{x:F.x,y:F.y+F.height,width:F.width,height:oe-F.y-F.height+1}:Be===Ce?{x:F.x,y:oe,width:F.width,height:F.y-oe}:Be===_e?{x:F.x+F.width,y:F.y,width:ie-F.x-F.width+1,height:F.height}:{x:ie,y:F.y,width:F.x-ie,height:F.height}}($,W,_,wt);ka(Y)}else{if(Wt&&G===Xe)return;if(Wt&&_===Xe){if(u.kind!==ui)return;_--}W=Math.max(W,V);const $=Mi(G);_=$===void 0?_:On(_,$[0],$[1]);const Y=W-A,F=_-G,ie={x:Y>=0?A:W,y:F>=0?G:_,width:Math.abs(Y)+1,height:Math.abs(F)+1};Lt({...z.current,range:ie},!0,!1,"drag")}}nn==null||nn({...u,location:[u.location[0]-V,u.location[1]]})}},[s,V,ee,z,Me,nn,je,Wt,Xe,wt,Mi,Lt]),bp=d.useCallback(()=>{var W,_;const u=Oa.current;if(u===void 0)return;const[M,k]=u.scrollEdge;let[P,A]=u.location;const G=Gt.current;M===-1?P=((_=(W=G.extras)==null?void 0:W.freezeRegion)==null?void 0:_.x)??G.x:M===1&&(P=G.x+G.width),k===-1?A=Math.max(0,G.y):k===1&&(A=Math.min(Xe-1,G.y+G.height)),P=On(P,0,Ct.length-1),A=On(A,0,Xe-1),Pa({...u,location:[P,A]})},[Ct.length,Pa,Xe]);(function(u,M,k){const P=$t.useRef(0),[A,G]=u??[0,0];$t.useEffect(()=>{if(A===0&&G===0)return void(P.current=0);let W=!1,_=0;const $=Y=>{var F;if(!W){if(_===0)_=Y;else{const ie=Y-_;P.current=Math.min(1,P.current+ie/1300);const oe=P.current**1.618*ie*2;(F=M.current)==null||F.scrollBy(A*oe,G*oe),_=Y,k==null||k()}window.requestAnimationFrame($)}};return window.requestAnimationFrame($),()=>{W=!0}},[M,A,G,k])})(up,zt,bp);const Wn=d.useCallback(u=>{if(z.current===void 0)return;const[M,k]=u,[P,A]=z.current.cell,G=z.current.range;let W=G.x,_=G.x+G.width,$=G.y,Y=G.y+G.height;const[F,ie]=Mi(A)??[0,Xe-1],oe=ie+1;if(k!==0)switch(k){case 2:Y=oe,$=A,Jt(0,Y,"vertical");break;case-2:$=F,Y=A+1,Jt(0,$,"vertical");break;case 1:$<A?($++,Jt(0,$,"vertical")):(Y=Math.min(oe,Y+1),Jt(0,Y,"vertical"));break;case-1:Y>A+1?(Y--,Jt(0,Y,"vertical")):($=Math.max(F,$-1),Jt(0,$,"vertical"));break;default:lo()}if(M!==0)if(M===2)_=Ct.length,W=P,Jt(_-1-V,0,"horizontal");else if(M===-2)W=V,_=P+1,Jt(W-V,0,"horizontal");else{let ge=[];if(Fe!==void 0){const we=Fe({x:W,y:$,width:_-W-V,height:Y-$},Ie.current.signal);typeof we=="object"&&(ge=function(_e){return S1(Zu(Zu(_e).filter(Ce=>Ce.span!==void 0).map(Ce=>{var Te,Be;return Pr((((Te=Ce.span)==null?void 0:Te[0])??0)+1,(((Be=Ce.span)==null?void 0:Be[1])??0)+1)})))}(we))}if(M===1){let we=!1;if(W<P){if(ge.length>0){const _e=Pr(W+1,P+1).find(Ce=>!ge.includes(Ce-V));_e!==void 0&&(W=_e,we=!0)}else W++,we=!0;we&&Jt(W,0,"horizontal")}we||(_=Math.min(Ct.length,_+1),Jt(_-1-V,0,"horizontal"))}else if(M===-1){let we=!1;if(_>P+1){if(ge.length>0){const _e=Pr(_-1,P,-1).find(Ce=>!ge.includes(Ce-V));_e!==void 0&&(_=_e,we=!0)}else _--,we=!0;we&&Jt(_-V,0,"horizontal")}we||(W=Math.max(V,W-1),Jt(W-V,0,"horizontal"))}else lo()}Lt({cell:z.current.cell,range:{x:W,y:$,width:_-W,height:Y-$}},!0,!1,"keyboard-select")},[Fe,Mi,z,Ct.length,V,Xe,Jt,Lt]),Da=d.useRef(Eo);Da.current=Eo;const Cr=d.useCallback((u,M,k,P)=>{const A=fn-(k?0:1);u=On(u,V,hn.length-1+V),M=On(M,0,A);const G=qn==null?void 0:qn[0],W=qn==null?void 0:qn[1];if(u===G&&M===W)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),Le({...z,current:{cell:[u,M],range:{x:u,y:M,width:1,height:1},rangeStack:_}},!0)}else Lt({cell:[u,M],range:{x:u,y:M,width:1,height:1}},!0,!1,"keyboard-nav");return h.current!==void 0&&h.current[0]===u&&h.current[1]===M&&(h.current=void 0),Da.current&&Jt(u-V,M),!0},[fn,V,hn.length,qn,z,Jt,Le,Lt]),xp=d.useCallback((u,M)=>{(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]=M;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)}R==null||R(u,M)},[o==null?void 0:o.cell,bn,z,R,zn,fn,Cr,Ct.length]),Cp=d.useMemo(()=>"gdg-overlay-"+Mg++,[]),Wr=d.useCallback(u=>{var k,P,A,G;bn();const M=[];for(let W=u.x;W<u.x+u.width;W++)for(let _=u.y;_<u.y+u.height;_++){const $=x([W-V,_]);if(!$.allowOverlay&&$.kind!==pe.Boolean)continue;let Y;if($.kind===pe.Custom){const F=Ht($),ie=(k=F==null?void 0:F.provideEditor)==null?void 0:k.call(F,{...$,location:[W-V,_]});(F==null?void 0:F.onDelete)!==void 0?Y=F.onDelete($):$a(ie)&&(Y=(P=ie==null?void 0:ie.deletedValue)==null?void 0:P.call(ie,$))}else if(Mr($)&&$.allowOverlay||$.kind===pe.Boolean){const F=Ht($);Y=(A=F==null?void 0:F.onDelete)==null?void 0:A.call(F,$)}Y!==void 0&&!kr(Y)&&Mr(Y)&&M.push({location:[W,_],value:Y})}zn(M),(G=ln.current)==null||G.damage(M.map(W=>({cell:W.location})))},[bn,x,Ht,zn,V]),Bo=o!==void 0,T0=d.useCallback(u=>{var we,_e;const M=()=>{u.stopPropagation(),u.preventDefault()},k={didMatch:!1},{bounds:P}=u,A=z.columns,G=z.rows,W=Un;if(!Bo&&at(W.clear,u,k))Le(fi,!1),Kt==null||Kt();else if(!Bo&&at(W.selectAll,u,k))Le({columns:yt.empty(),rows:yt.empty(),current:{cell:((we=z.current)==null?void 0:we.cell)??[V,0],range:{x:V,y:0,width:g.length,height:Xe},rangeStack:[]}},!1);else if(at(W.search,u,k))(_e=l==null?void 0:l.current)==null||_e.focus({preventScroll:!0}),ue(!0);else if(at(W.delete,u,k)){const Ce=(on==null?void 0:on(z))??!0;if(Ce!==!1){const Te=Ce===!0?z:Ce;if(Te.current!==void 0){Wr(Te.current.range);for(const Be of Te.current.rangeStack)Wr(Be)}for(const Be of Te.rows)Wr({x:V,y:Be,width:g.length,height:1});for(const Be of Te.columns)Wr({x:Be,y:0,width:1,height:Xe})}}if(k.didMatch)return M(),!0;if(z.current===void 0)return!1;let[_,$]=z.current.cell;const[,Y]=z.current.cell;let F=!1,ie=!1;if(at(W.scrollToSelectedCell,u,k)?Ii.current(_-V,$):Se!=="none"&&at(W.selectColumn,u,k)?A.hasIndex(_)?ht(A.remove(_),void 0,!0):Se==="single"?ht(yt.fromSingleSelection(_),void 0,!0):ht(void 0,_,!0):ee!=="none"&&at(W.selectRow,u,k)?G.hasIndex($)?je(G.remove($),void 0,!0):ee==="single"?je(yt.fromSingleSelection($),void 0,!0):je(void 0,$,!0):!Bo&&P!==void 0&&at(W.activateCell,u,k)?$===Xe&&Wt?window.setTimeout(()=>{const Ce=Si(_);eo(Ce??_)},0):(m==null||m([_-V,$]),Zr(P,!0)):z.current.range.height>1&&at(W.downFill,u,k)?E0():z.current.range.width>1&&at(W.rightFill,u,k)?R0():at(W.goToNextPage,u,k)?$+=Math.max(1,Gt.current.height-4):at(W.goToPreviousPage,u,k)?$-=Math.max(1,Gt.current.height-4):at(W.goToFirstCell,u,k)?(i(void 0),$=0,_=0):at(W.goToLastCell,u,k)?(i(void 0),$=Number.MAX_SAFE_INTEGER,_=Number.MAX_SAFE_INTEGER):at(W.selectToFirstCell,u,k)?(i(void 0),Wn([-2,-2])):at(W.selectToLastCell,u,k)?(i(void 0),Wn([2,2])):Bo?(at(W.closeOverlay,u,k)&&i(void 0),at(W.acceptOverlayDown,u,k)&&(i(void 0),$++),at(W.acceptOverlayUp,u,k)&&(i(void 0),$--),at(W.acceptOverlayLeft,u,k)&&(i(void 0),_--),at(W.acceptOverlayRight,u,k)&&(i(void 0),_++)):(at(W.goDownCell,u,k)?$+=1:at(W.goUpCell,u,k)?$-=1:at(W.goRightCell,u,k)?_+=1:at(W.goLeftCell,u,k)?_-=1:at(W.goDownCellRetainSelection,u,k)?($+=1,F=!0):at(W.goUpCellRetainSelection,u,k)?($-=1,F=!0):at(W.goRightCellRetainSelection,u,k)?(_+=1,F=!0):at(W.goLeftCellRetainSelection,u,k)?(_-=1,F=!0):at(W.goToLastRow,u,k)?$=Xe-1:at(W.goToFirstRow,u,k)?$=Number.MIN_SAFE_INTEGER:at(W.goToLastColumn,u,k)?_=Number.MAX_SAFE_INTEGER:at(W.goToFirstColumn,u,k)?_=Number.MIN_SAFE_INTEGER:Me!=="rect"&&Me!=="multi-rect"||(at(W.selectGrowDown,u,k)?Wn([0,1]):at(W.selectGrowUp,u,k)?Wn([0,-1]):at(W.selectGrowRight,u,k)?Wn([1,0]):at(W.selectGrowLeft,u,k)?Wn([-1,0]):at(W.selectToLastRow,u,k)?Wn([0,2]):at(W.selectToFirstRow,u,k)?Wn([0,-2]):at(W.selectToLastColumn,u,k)?Wn([2,0]):at(W.selectToFirstColumn,u,k)&&Wn([-2,0])),ie=k.didMatch),Bn!==void 0&&Bn!=="normal"&&$!==Y){const Ce=Bn==="skip-down"||Bn==="skip"||Bn==="block",Te=$<Y;if(Te&&(Bn==="skip-up"||Bn==="skip"||Bn==="block")){for(;$>=0&&Nr($).isGroupHeader;)$--;$<0&&($=Y)}else if(!Te&&Ce){for(;$<Xe&&Nr($).isGroupHeader;)$++;$>=Xe&&($=Y)}}const oe=Cr(_,$,!1,F),ge=k.didMatch;return ge&&(oe||!ie||It)&&M(),ge},[Bn,Bo,z,Un,Se,ee,Me,V,Nr,Xe,Cr,Le,Kt,g.length,on,It,Wr,ht,je,Wt,Si,eo,m,Zr,E0,R0,Wn]),Wo=d.useCallback(u=>{let M=!1;if(he!==void 0&&he({...u,...u.location&&{location:[u.location[0]-V,u.location[1]]},cancel:()=>{M=!0}}),M||T0(u)||z.current===void 0)return;const[k,P]=z.current.cell,A=Gt.current;if(Ze&&!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-V,Math.max(0,Math.min(P,Xe-1))]))){if((!Wt||P!==Xe)&&(A.y>P||P>A.y+A.height||A.x>k||k>A.x+A.width))return;m==null||m([k-V,P]),Zr(u.bounds,!0,u.key),u.stopPropagation(),u.preventDefault()}},[Ze,he,T0,z,x,V,Xe,Wt,m,Zr]),Sp=d.useCallback((u,M)=>{const k=u.location[0]-V;if(u.kind==="header"&&(se==null||se(k,{...u,preventDefault:M})),u.kind===Pn){if(k<0)return;Z==null||Z(k,{...u,preventDefault:M})}if(u.kind==="cell"){const[P,A]=u.location;Q==null||Q([k,A],{...u,preventDefault:M}),function(G,W){const[_,$]=W;if(G.columns.hasIndex(_)||G.rows.hasIndex($))return!0;if(G.current!==void 0){if(vo(G.current.cell,W))return!0;const Y=[G.current.range,...G.current.rangeStack];for(const F of Y)if(_>=F.x&&_<F.x+F.width&&$>=F.y&&$<F.y+F.height)return!0}return!1}(z,u.location)||Cr(P,A,!1,!1)}},[z,Q,Z,se,V,Cr]),za=d.useCallback(async u=>{var W,_,$;if(!Un.paste)return;function M(Y,F,ie,oe){var we,_e;const ge=typeof ie=="object"?(ie==null?void 0:ie.join(`
128
128
  `))??"":(ie==null?void 0:ie.toString())??"";if(!kr(Y)&&so(Y)&&Y.readonly!==!0){const Ce=H==null?void 0:H(ge,Y);if(Ce!==void 0&&Mr(Ce))return{location:F,value:Ce};const Te=Ht(Y);if(Te===void 0)return;if(Te.kind===pe.Custom){Rn(Y.kind===pe.Custom);const Be=(we=Te.onPaste)==null?void 0:we.call(Te,ge,Y.data);return Be===void 0?void 0:{location:F,value:{...Y,data:Be}}}{const Be=(_e=Te.onPaste)==null?void 0:_e.call(Te,ge,Y,{formatted:oe,formattedString:typeof oe=="string"?oe:oe==null?void 0:oe.join(`
129
129
  `),rawValue:ie});return Be===void 0?void 0:(Rn(Be.kind===Y.kind),{location:F,value:Be})}}}const k=z.columns,P=z.rows,A=((W=zt.current)==null?void 0:W.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=[V,P.first()??0]),A&&G!==void 0){let Y,F;const ie="text/plain",oe="text/html";if(navigator.clipboard.read!==void 0){const Ce=await navigator.clipboard.read();for(const Te of Ce){if(Te.types.includes(oe)){const Be=await Te.getType(oe),_t=e0(await Be.text());if(_t!==void 0){Y=_t;break}}Te.types.includes(ie)&&(F=await(await Te.getType(ie)).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(oe)&&(Y=e0(u.clipboardData.getData(oe))),Y===void 0&&u.clipboardData.types.includes(ie)&&(F=u.clipboardData.getData(ie))}const[ge,we]=G,_e=[];do{if(ct===void 0){const Ce=M(Tn(G),G,F??(Y==null?void 0:Y.map(Te=>Te.map(Be=>Be.rawValue).join(" ")).join(" "))??"",void 0);Ce!==void 0&&_e.push(Ce);break}if(Y===void 0){if(F===void 0)return;Y=wg(F)}if(ct===!1||typeof ct=="function"&&(ct==null?void 0:ct([G[0]-V,G[1]],Y.map(Ce=>Ce.map(Te=>{var Be;return((Be=Te.rawValue)==null?void 0:Be.toString())??""}))))!==!0)return;for(const[Ce,Te]of Y.entries()){if(Ce+we>=Xe)break;for(const[Be,_t]of Te.entries()){const Ut=[Be+ge,Ce+we],[tn,St]=Ut;if(tn>=Ct.length||St>=fn)continue;const At=M(Tn(Ut),Ut,_t.rawValue,_t.formatted);At!==void 0&&_e.push(At)}}}while(!1);zn(_e),($=ln.current)==null||$.damage(_e.map(Ce=>({cell:Ce.location})))}},[H,Ht,Tn,z,Un.paste,zt,Ct.length,zn,fn,ct,V,Xe]);cn("paste",za,C,!1,!0);const $o=d.useCallback(async(u,M)=>{var W,_;if(!Un.copy)return;const k=M===!0||((W=zt.current)==null?void 0:W.contains(document.activeElement))===!0||((_=a.current)==null?void 0:_.contains(document.activeElement))===!0,P=z.columns,A=z.rows,G=($,Y)=>{n0(Ee?[Y.map(F=>({kind:pe.Text,data:g[F].title,displayData:g[F].title,allowOverlay:!1})),...$]:$,Y,u)};if(k&&Fe!==void 0){if(z.current!==void 0){let $=Fe(z.current.range,Ie.current.signal);typeof $!="object"&&($=await $()),G($,Pr(z.current.range.x-V,z.current.range.x+z.current.range.width-V))}else if(A!==void 0&&A.length>0){const $=[...A].map(Y=>{const F=Fe({x:V,y:Y,width:g.length,height:1},Ie.current.signal);return typeof F=="object"?F[0]:F().then(ie=>ie[0])});$.some(Y=>Y instanceof Promise)?G(await Promise.all($),Pr(g.length)):G($,Pr(g.length))}else if(P.length>0){const $=[],Y=[];for(const F of P){let ie=Fe({x:F,y:0,width:1,height:Xe},Ie.current.signal);typeof ie!="object"&&(ie=await ie()),$.push(ie),Y.push(F-V)}$.length===1?G($[0],Y):G($.reduce((F,ie)=>F.map((oe,ge)=>[...oe,...ie[ge]])),Y)}}},[g,Fe,z,Un.copy,V,zt,Xe,Ee]);cn("copy",$o,C,!1,!1),cn("cut",d.useCallback(async u=>{var M,k;if(Un.cut&&(((M=zt.current)==null?void 0:M.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,M)=>{if(ne!==void 0)return V!==0&&(u=u.map(A=>[A[0]-V,A[1]])),void ne(u,M);if(u.length===0||M===-1)return;const[k,P]=u[M];h.current!==void 0&&h.current[0]===k&&h.current[1]===P||(h.current=[k,P],Cr(k,P,!1,!1))},[ne,V,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,M,k,P;!Da.current||Dn.current||Ri===void 0||Ei===void 0||Ri===((M=(u=De.current)==null?void 0:u.current)==null?void 0:M.cell[0])&&Ei===((P=(k=De.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&&Le(fi,!1)},[H0,Le]);const Mp=d.useMemo(()=>Wt===!0&&(re==null?void 0:re.tint)===!0?yt.fromSingleSelection(fn-1):yt.empty(),[fn,Wt,re==null?void 0:re.tint]),Rp=d.useCallback(u=>typeof ve=="boolean"?ve:(ve==null?void 0:ve(u-V))??!0,[V,ve]),Ep=d.useMemo(()=>{if(Ea===void 0||a.current===null)return null;const{bounds:u,group:M}=Ea,k=a.current.getBoundingClientRect();return d.createElement(gg,{bounds:u,group:M,canvasBounds:k,onClose:()=>Ia(void 0),onFinish:P=>{Ia(void 0),fe==null||fe(M,P)}})},[fe,Ea]),Ip=Math.min(Ct.length,Ae+(wn?1:0));d.useImperativeHandle(t,()=>({appendRow:(u,M)=>eo(u+V,M),updateCells:u=>{var M;return V!==0&&(u=u.map(k=>({cell:[k.cell[0]+V,k.cell[1]]}))),(M=ln.current)==null?void 0:M.damage(u)},getBounds:(u,M)=>{var k;if((a==null?void 0:a.current)!==null&&(zt==null?void 0:zt.current)!==null){if(u===void 0&&M===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)+V,M)}},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 M of u)ki(M+V)},getMouseArgsForPosition:(u,M,k)=>{if((ln==null?void 0:ln.current)===null)return;const P=ln.current.getMouseArgsForPosition(u,M,k);return P!==void 0?{...P,location:[P.location[0]-V,P.location[1]]}:void 0}}),[eo,ki,zt,$o,Wo,za,V,Jt]);const[O0,P0]=qn??[],Tp=d.useCallback(u=>{const[M,k]=u;k!==-1?O0===M&&P0===k||(Lt({cell:u,range:{x:M,y:k,width:1,height:1}},!0,!1,"keyboard-nav"),Jt(M,k)):Se!=="none"&&(ht(yt.fromSingleSelection(M),void 0,!1),bn())},[Se,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:[V,wi],range:{x:V,y:wi,width:1,height:1}},!0,!1,"keyboard-select")},[wi,z,s,V,Lt]),Dp=d.useCallback(()=>{D0.current(!1)},[]),[zp,Ap]=d.useMemo(()=>{let u;const M=(it==null?void 0:it.scrollbarWidthOverride)??Ki(),k=Xe+(Wt?1:0);if(typeof Vn=="number")u=lr+k*Vn;else{let A=0;const G=Math.min(k,10);for(let W=0;W<G;W++)A+=Vn(W);A=Math.floor(A/G),u=lr+k*A}u+=M;const P=Ct.reduce((A,G)=>G.width+A,0)+M;return[`${Math.min(1e5,P)}px`,`${Math.min(1e5,u)}px`]},[Ct,it==null?void 0:it.scrollbarWidthOverride,Vn,Xe,Wt,lr]),Fp=d.useMemo(()=>Xa(gt),[gt]);return d.createElement(Wa.Provider,{value:gt},d.createElement(bg,{style:Fp,className:ce,inWidth:v??zp,inHeight:E??Ap},d.createElement(hg,{fillHandle:Ue,drawFocusRing:zr,experimental:it,fixedShadowX:tt,fixedShadowY:Oe,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:ir,disabledRows:Mp,freezeColumns:Ip,lockColumns:V,firstColAccessible:V===0,getCellContent:Tn,minColumnWidth:or,maxColumnWidth:Ar,searchInputRef:l,showSearch:xe,onSearchClose:de,highlightRegions:sp,getCellsForSelection:Fe,getGroupDetails:Ma,headerHeight:Fr,isFocused:Hp,groupHeaderHeight:Qr?Po:0,freezeTrailingRows:be+(Wt&&(re==null?void 0:re.sticky)===!0?1:0),hasAppendRow:Wt,onColumnResize:Je,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:ze,onMouseDown:cp,onMouseUp:dp,onDragOverCell:Ve,onDrop:Ye,onSearchResultsChanged:kp,onVisibleRegionChanged:pp,clientSize:yn,rowHeight:Vn,searchResults:X,searchValue:ae,onSearchValueChange:J,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:(it==null?void 0:it.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:_n,imageEditorOverride:y,onFinishEditing:xp,markdownDivCreateNode:w,isOutsideClick:wr,customEventTarget:it==null?void 0:it.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),p=jc(t.contentAlign??"center",s,l,i.cellHorizontalPadding,y),w=_c(p,C,y),v=Bc(s+n,c+r,w);return Bi(t)&&v}const Eg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??"false"},kind:pe.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:p}}=t,{x:w,y:v,width:E,height:g}=c;let b=!1;if(i>0){let x=r?1-i+i*a:.4;if(n===Jo&&(x*=a),x===0)return;x<1&&(b=!0,l.globalAlpha=x)}sa(l,s,n,w,v,E,g,h,C,y,o,p),b&&(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:pe.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 p of n){if(C>a+c)break;const w=Kr(p,i,o.baseFontFull).width;y.push({x:C,width:w}),C+=w+2*o.bubblePadding+o.bubbleMargin}i.beginPath();for(const p of y)Yn(i,p.x,s+(h-o.bubbleHeight)/2,p.width+2*o.bubblePadding,o.bubbleHeight,o.roundingRadius??o.bubbleHeight/2);i.fillStyle=l?o.bgBubbleSelected:o.bgBubble,i.fill();for(const[p,w]of y.entries())i.beginPath(),i.fillStyle=o.textBubble,i.fillText(n[p],w.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:pe.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),p=Math.min(r.height,Math.max(16,2*Math.ceil(y*o.lineHeight))),w=Math.floor(r.y+(r.height-p)/2),v=p-10,E=o.bubblePadding,g=o.bubbleMargin;let b=c+o.cellHorizontalPadding;const x=o.roundingRadius??6,I=function(S,R,H,f){const B=Math.ceil(window.devicePixelRatio),D=5,O=H-2*D,T=4,j=H*B,U=f+D,te=3*f,Q=(te+2*D)*B,ce=`${S},${R},${B},${H}`;if(wa[ce]!==void 0)return{el:wa[ce],height:j,width:Q,middleWidth:T*B,sideWidth:U*B,padding:D*B,dpr:B};const se=document.createElement("canvas"),q=se.getContext("2d");return q===null?null:(se.width=Q,se.height=j,q.scale(B,B),wa[ce]=se,q.beginPath(),Yn(q,D,D,te,O,f),q.shadowColor="rgba(24, 25, 34, 0.4)",q.shadowBlur=1,q.fillStyle=S,q.fill(),q.shadowColor="rgba(24, 25, 34, 0.3)",q.shadowOffsetY=1,q.shadowBlur=5,q.fillStyle=S,q.fill(),q.shadowOffsetY=0,q.shadowBlur=0,q.shadowBlur=0,q.beginPath(),Yn(q,D+.5,D+.5,te,O,f),q.strokeStyle=R,q.lineWidth=1,q.stroke(),{el:se,height:j,width:Q,sideWidth:U*B,middleWidth:f*B,padding:D*B,dpr:B})}(o.bgCell,o.drilldownBorder,p,x),m=[];for(const S of n){if(b>c+h)break;const R=Kr(S.text,i,C).width;let H=0;S.img!==void 0&&l.loadOrGetImage(S.img,a,s)!==void 0&&(H=v-8+4);const f=R+H+2*E;m.push({x:b,width:f}),b+=f+g}if(I!==null){const{el:S,height:R,middleWidth:H,sideWidth:f,width:B,dpr:D,padding:O}=I,T=f/D,j=O/D;for(const U of m){const te=Math.floor(U.x),Q=Math.floor(U.width),ce=Q-2*(T-j);i.imageSmoothingEnabled=!1,i.drawImage(S,0,0,f,R,te-j,w,T,p),ce>0&&i.drawImage(S,f,0,H,R,te+(T-j),w,ce,p),i.drawImage(S,B-f,0,f,R,te+Q-(T-j),w,T,p),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[S,R]of m.entries()){const H=n[S];let f=R.x+E;if(H.img!==void 0){const B=l.loadOrGetImage(H.img,a,s);if(B!==void 0){const D=v-8;let O=0,T=0,j=B.width,U=B.height;j>U?(O+=(j-U)/2,j=U):U>j&&(T+=(U-j)/2,U=j),i.beginPath(),Yn(i,f,w+p/2-D/2,D,D,o.roundingRadius??3),i.save(),i.clip(),i.drawImage(B,O,T,j,U,f,w+p/2-D/2,D,D),i.restore(),f+=D+4}}i.beginPath(),i.fillStyle=o.textBubble,i.fillText(H.text,f,w+p/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:pe.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:p,width:w}=i,v=p-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 m=h.loadOrGetImage(I,l,a);m!==void 0&&(E[x]=m,g+=m.width*(v/m.height)+ya)}if(g===0)return;g-=ya;let b=C+s.cellHorizontalPadding;o==="right"?b=Math.floor(C+w-s.cellHorizontalPadding-g):o==="center"&&(b=Math.floor(C+w/2-g/2));for(const x of E){if(x===void 0)continue;const I=x.width*(v/x.height);r>0&&(c.beginPath(),Yn(c,b,y+s.cellVerticalPadding,I,v,r),c.save(),c.clip()),c.drawImage(x,b,y+s.cellVerticalPadding,I,v),r>0&&c.restore(),b+=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:pe.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(w=>!w)},[]),p=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:w=>{w.key==="Enter"&&w.stopPropagation()},onChange:n}),d.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${p}`,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 ${p}`,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:pe.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:p,height:w}=s,v=r?1:o==="checkbox-visible"?.6+.4*c:c;if(o!=="number"&&v>0){a.globalAlpha=v;const E=7*(r?c:1);if(sa(a,h,r,i?C+E:C,y,i?p-E:p,w,!0,void 0,void 0,h.checkboxMaxSize,"center",l),i){a.globalAlpha=c,a.beginPath();for(const g of[3,6])for(const b of[-5,-1,3])a.rect(C+g,y+w/2+b,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,b=C+p/2;o==="both"&&c!==0&&(a.globalAlpha=1-c),a.fillStyle=h.textLight,a.font=g,a.fillText(E,b,y+w/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 p=n!=="";let w=0;if(r!==void 0){const E=y-8,g=c+8/2,b=h+8/2;s.drawSprite(r,"normal",o,g,b,E,a,p?1:l),w=E}else{w=24;const v=12,E=p?v:l*v,g=p?0:(1-l)*v*.5,b=a.cellHorizontalPadding+4;E>0&&(o.moveTo(c+b+g,h+y/2),o.lineTo(c+b+g+E,h+y/2),o.moveTo(c+b+g+.5*E,h+y/2-.5*E),o.lineTo(c+b+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,w+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 p=C.cellHorizontalPadding,w=C.cellVerticalPadding;if(y)return{x:c.x+p/2,y:c.y+w/2+1,width:c.width-p,height:c.height-w-1};const v=Kr(h,s,C.baseFontFull,"alphabetic"),E=c.height-w,g=Math.min(E,2.5*v.actualBoundingBoxAscent);return{x:c.x+p/2,y:c.y+(c.height-g)/2+1,width:v.width+3*p,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-DvLlDwhp.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:pe.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:pe.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:pe.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:pe.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(`
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:p,height:w}=s,v=r?1:o==="checkbox-visible"?.6+.4*c:c;if(o!=="number"&&v>0){a.globalAlpha=v;const E=7*(r?c:1);if(sa(a,h,r,i?C+E:C,y,i?p-E:p,w,!0,void 0,void 0,h.checkboxMaxSize,"center",l),i){a.globalAlpha=c,a.beginPath();for(const g of[3,6])for(const b of[-5,-1,3])a.rect(C+g,y+w/2+b,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,b=C+p/2;o==="both"&&c!==0&&(a.globalAlpha=1-c),a.fillStyle=h.textLight,a.font=g,a.fillText(E,b,y+w/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 p=n!=="";let w=0;if(r!==void 0){const E=y-8,g=c+8/2,b=h+8/2;s.drawSprite(r,"normal",o,g,b,E,a,p?1:l),w=E}else{w=24;const v=12,E=p?v:l*v,g=p?0:(1-l)*v*.5,b=a.cellHorizontalPadding+4;E>0&&(o.moveTo(c+b+g,h+y/2),o.lineTo(c+b+g+E,h+y/2),o.moveTo(c+b+g+.5*E,h+y/2-.5*E),o.lineTo(c+b+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,w+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 p=C.cellHorizontalPadding,w=C.cellVerticalPadding;if(y)return{x:c.x+p/2,y:c.y+w/2+1,width:c.width-p,height:c.height-w-1};const v=Kr(h,s,C.baseFontFull,"alphabetic"),E=c.height-w,g=Math.min(E,2.5*v.actualBoundingBoxAscent);return{x:c.x+p/2,y:c.y+(c.height-g)/2+1,width:v.width+3*p,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-BT3S9IO8.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:pe.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:pe.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:pe.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:pe.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
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:pe.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:p,height:w}=h;if(o>=C-4&&o<=C-4+p+8&&i>=y-4&&i<=y-4+w+8){const v=fr(a,n.baseFontFull);r("pointer");const E=5,g=y-v;a.beginPath(),a.moveTo(l.x+C,Math.floor(l.y+g+w+E)+.5),a.lineTo(l.x+C+p,Math.floor(l.y+g+w+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 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 pe.Text;case"number":return pe.Number;case"boolean":return pe.Boolean}}function tp(e){switch(e){case"string":case"unknown":return ur.HeaderString;case"number":case"integer":return ur.HeaderNumber;case"boolean":return ur.HeaderBoolean;case"date":case"datetime":return ur.HeaderDate;case"time":return ur.HeaderTime;default:return _0(e),ur.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=b=>{b.key==="Enter"?s():b.key==="Escape"&&o()},t[4]=s,t[5]=o,t[6]=c):c=t[6];const h=c;let C,y,p,w;t[7]===Symbol.for("react.memo_cache_sentinel")?(C=et.jsxs(N0,{children:[et.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=et.jsx(_a,{htmlFor:"rename-input",children:"Column name"}),t[8]=y):y=t[8],t[9]===Symbol.for("react.memo_cache_sentinel")?(p=b=>l(b.target.value),t[9]=p):p=t[9],t[10]!==h||t[11]!==i?(w=et.jsxs("div",{children:[y,et.jsx(B0,{value:i,onChange:p,placeholder:"Enter new column name",className:"mt-1",onKeyDown:h})]}),t[10]=h,t[11]=i,t[12]=w):w=t[12];const v=!i.trim();let E,g;return t[13]!==s||t[14]!==v?(E=et.jsx(ja,{onClick:s,disabled:v,size:"sm",className:"w-full",children:"Rename"}),t[13]=s,t[14]=v,t[15]=E):E=t[15],t[16]!==w||t[17]!==E?(g=et.jsxs(W0,{children:[C,et.jsx($0,{children:et.jsx(X0,{className:"w-64 p-4",children:et.jsxs("div",{className:"space-y-3",children:[w,E]})})})]}),t[16]=w,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,p,w,v,E,g,b,x,I,m,S,R,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,se;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],w=ce,t[24]!==w||t[25]!==o?(se=ze=>{ze.key==="Enter"?w():ze.key==="Escape"&&o()},t[24]=w,t[25]=o,t[26]=se):se=t[26];const q=se;let Z;p=W0,t[27]===Symbol.for("react.memo_cache_sentinel")?(Z=et.jsx(Xp,{className:"mr-2 h-3.5 w-3.5"}),t[27]=Z):Z=t[27],t[28]!==n?(R=et.jsxs(N0,{children:[Z,"Add column to the ",n]}),t[28]=n,t[29]=R):R=t[29],y=$0,C=X0,S="w-64 p-4",I="space-y-3";const fe=`add-column-input-${n}`;let N;t[30]!==fe?(N=et.jsx(_a,{htmlFor:fe,children:"Column name"}),t[30]=fe,t[31]=N):N=t[31];const K=`add-column-input-${n}`;let ne,X;t[32]===Symbol.for("react.memo_cache_sentinel")?(ne=ze=>l(ze.target.value),t[32]=ne):ne=t[32],t[33]!==i||t[34]!==q||t[35]!==K?(X=et.jsx(B0,{id:K,value:i,onChange:ne,placeholder:"Enter column name",className:"mt-1",onKeyDown:q}),t[33]=i,t[34]=q,t[35]=K,t[36]=X):X=t[36],t[37]!==N||t[38]!==X?(m=et.jsxs("div",{children:[N,X]}),t[37]=N,t[38]=X,t[39]=m):m=t[39];const J=`add-column-type-${n}`;t[40]!==J?(x=et.jsx(_a,{htmlFor:J,children:"Data type"}),t[40]=J,t[41]=x):x=t[41],h=Gp,E=a,t[42]===Symbol.for("react.memo_cache_sentinel")?(g=ze=>s(ze),t[42]=g):g=t[42];const ae=`add-column-type-${n}`;let he;t[43]===Symbol.for("react.memo_cache_sentinel")?(he=et.jsx(Yp,{}),t[43]=he):he=t[43],t[44]!==ae?(b=et.jsx(Kp,{id:ae,className:"mt-1",children:he}),t[44]=ae,t[45]=b):b=t[45],c=Vp,v=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]=p,t[10]=w,t[11]=v,t[12]=E,t[13]=g,t[14]=b,t[15]=x,t[16]=I,t[17]=m,t[18]=S,t[19]=R}else c=t[5],h=t[6],C=t[7],y=t[8],p=t[9],w=t[10],v=t[11],E=t[12],g=t[13],b=t[14],x=t[15],I=t[16],m=t[17],S=t[18],R=t[19];t[46]!==c||t[47]!==v?(H=et.jsx(c,{children:v}),t[46]=c,t[47]=v,t[48]=H):H=t[48],t[49]!==h||t[50]!==H||t[51]!==E||t[52]!==g||t[53]!==b?(f=et.jsxs(h,{value:E,onValueChange:g,children:[b,H]}),t[49]=h,t[50]=H,t[51]=E,t[52]=g,t[53]=b,t[54]=f):f=t[54],t[55]!==f||t[56]!==x?(B=et.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,U,te;return t[58]!==w||t[59]!==D?(O=et.jsx(ja,{onClick:w,disabled:D,size:"sm",className:"w-full",children:"Add"}),t[58]=w,t[59]=D,t[60]=O):O=t[60],t[61]!==B||t[62]!==O||t[63]!==I||t[64]!==m?(T=et.jsxs("div",{className:I,children:[m,B,O]}),t[61]=B,t[62]=O,t[63]=I,t[64]=m,t[65]=T):T=t[65],t[66]!==C||t[67]!==T||t[68]!==S?(j=et.jsx(C,{className:S,children:T}),t[66]=C,t[67]=T,t[68]=S,t[69]=j):j=t[69],t[70]!==y||t[71]!==j?(U=et.jsx(y,{children:j}),t[70]=y,t[71]=j,t[72]=U):U=t[72],t[73]!==p||t[74]!==U||t[75]!==R?(te=et.jsxs(p,{children:[R,U]}),t[73]=p,t[74]=U,t[75]=R,t[76]=te):te=t[76],te};function ap(e){return et.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,edits:o,onAddEdits:i,onAddRows:l,onDeleteRows:a,onRenameColumn:s,onDeleteColumn:c,onAddColumn:h})=>{const{theme:C}=Up(),y=d.useRef(null),[p,w]=d.useState(),[v,E]=d.useState(!1),[g,b]=$t.useState({columns:yt.empty(),rows:yt.empty()}),[x,I]=d.useState({}),m=qp();Qp(()=>{if(o.length===0)return;const N=new Map;for(const ne of o)if(p0(ne))if(ne.rowIdx>=e.length){N.has(ne.rowIdx)||N.set(ne.rowIdx,{});const X=N.get(ne.rowIdx);X&&(X[ne.columnId]=ne.value)}else t(X=>{const J=[...X];return J[ne.rowIdx][ne.columnId]=ne.value,J});else if(np(ne)&&ne.type===Hi.Remove)t(X=>X.filter((J,ae)=>ae!==ne.rowIdx));else if(rp(ne))switch(ne.type){case Hi.Remove:t(X=>v0(X,ne.columnIdx)),r(X=>Ur({columnFields:X,columnIdx:ne.columnIdx,type:"remove"}));break;case Hi.Insert:r(X=>Ur({columnFields:X,columnIdx:ne.columnIdx,type:"insert",newColumnName:ne.newName})),t(X=>w0(X,ne.newName));break;case Hi.Rename:{const X=S[ne.columnIdx].title,J=ne.newName;if(!X||!J)return;r(ae=>Ur({columnFields:ae,columnIdx:ne.columnIdx,type:"rename",newColumnName:J})),t(ae=>y0(ae,X,J));break}}const K=[...N.entries()].sort(([ne],[X])=>ne-X).map(([,ne])=>ne);K.length>0&&t(ne=>[...ne,...K]),m()});const S=d.useMemo(()=>{const N=[];for(const[K,ne]of Object.entries(n))N.push({id:K,title:K,width:x[K],icon:tp(ne),kind:ep(ne),dataType:ne,hasMenu:!0});return N},[n,x]),R=d.useCallback(N=>{const[K,ne]=N,X=e[ne][S[K].title],J=S[K].kind;if(J===pe.Boolean){const ae=!!X;return{kind:pe.Boolean,allowOverlay:!1,readonly:!1,data:ae}}return J===pe.Number&&typeof X=="number"?{kind:pe.Number,allowOverlay:!0,readonly:!1,displayData:String(X),data:X}:{kind:pe.Text,allowOverlay:!0,readonly:!1,displayData:String(X),data:String(X)}},[S,e]),H=d.useCallback((N,K)=>{const[ne,X]=N,J=S[ne],ae=J.title;let he=K.data;J.dataType!=="number"&&J.dataType!=="integer"||K.data!==void 0&&K.data!==""||(he=null),t(ze=>{const $e=[...ze];return $e[X][ae]=he,$e}),i([{rowIdx:X,columnId:ae,value:he}])},[S,i,t]),f=d.useCallback((N,K)=>{I(ne=>({...ne,[N.title]:K}))},[]),B=d.useCallback((N,K,ne)=>{const[X,J]=N,ae=S[X].title;switch(n[ae]){case"number":case"integer":if(Number.isNaN(Number(K.data)))return!1;break;case"boolean":if(typeof K.data!="boolean")return!1}return!0},[n,S]),D=d.useCallback(N=>{if(y.current)if(Na.isMetaOrCtrl(N)&&N.key==="c")y.current.emit("copy");else{if(!Na.isMetaOrCtrl(N)||N.key!=="v")return Na.isMetaOrCtrl(N)&&N.key==="f"?(E(K=>!K),N.stopPropagation(),void N.preventDefault()):void(N.key!=="Escape"||E(!1));(function(K){const{selection:ne,data:X,setData:J,onAddEdits:ae,columns:he}=K;if(!ne.current)return;const{range:ze}=ne.current,{x:$e,y:Ze}=ze;navigator.clipboard.readText().then(He=>{if(!He.trim())return;const We=He.split(`
132
132
  `).filter(Me=>Me.trim()),me=[];for(const Me of We){const Se=Me.split(" ");me.push(Se)}if(me.length===0)return;const ye=[];for(const[Me,Se]of me.entries()){if(!Se)continue;const ee=Ze+Me;if(ee>=X.length)break;for(const[Pe,ke]of Se.entries()){if(ke===void 0)continue;const Ge=$e+Pe;if(!he||Ge>=he.length)break;let Re=ke;switch(he[Ge].dataType){case"integer":case"number":{const Ke=Number(ke);if(Number.isNaN(Ke))continue;Re=Ke;break}case"boolean":{const Ke=ke.toLowerCase();Re=Ke==="true"||Ke==="1";break}}const nt=he[Ge].title;ye.push({rowIdx:ee,columnId:nt,value:Re})}}ye.length>0&&(ae(ye),J(Me=>{const Se=[...Me];for(const ee of ye)if(p0(ee)){const Pe=ee.rowIdx,ke=ee.columnId;if(Pe<Se.length){const Ge=Se[Pe];ke in Ge&&(Ge[ke]=ee.value)}}return Se}))}).catch(He=>{La.error("Failed to read clipboard data",He)})})({selection:g,data:e,setData:t,columns:S,onAddEdits:i})}},[S,e,i,g,t]),O=d.useCallback(()=>{const N=Object.fromEntries(S.map(K=>{const ne=K.dataType;switch(ne){case"boolean":return[K.title,!1];case"number":case"integer":return[K.title,null];case"date":case"datetime":case"time":return[K.title,new Date];case"string":case"unknown":return[K.title,""];default:return _0(ne),[K.title,""]}}));l([N]),t(K=>[...K,N])},[S,l,t]),T=Jp((N,K)=>{w({col:N,bounds:K})}),j=async()=>{if(p){const N=S[p.col].title;await rm(N),w(void 0)}};function U(N){om({title:`Column '${N}' already exists`,description:"Please enter a different column name",variant:"danger"})}const te=N=>{if(p){const K=S[p.col].title;if(n[N])return void U(N);const ne=S[p.col].dataType;s(p.col,N),r(X=>Ur({columnFields:X,columnIdx:p.col,type:"rename",dataType:ne,newColumnName:N})),t(X=>y0(X,K,N)),w(void 0)}},Q=()=>{p&&(c(p.col),r(N=>Ur({columnFields:N,columnIdx:p.col,type:"remove"})),t(N=>v0(N,p.col)),w(void 0))},ce=N=>{const{direction:K,columnName:ne,dataType:X}=N;if(p){const J=p.col+(K==="left"?0:1),ae=Math.max(0,Math.min(J,S.length));if(n[ne])return void U(ne);h(ae,ne),r(he=>Ur({columnFields:he,columnIdx:ae,type:"insert",dataType:X,newColumnName:ne})),t(he=>w0(he,ne)),w(void 0)}},se=(p==null?void 0:p.col)===S.length-1,q=p!==void 0,Z="mr-2 h-3.5 w-3.5",fe=e.length>1e5;return et.jsxs("div",{className:"relative",children:[et.jsx(Zp,{children:et.jsx(Zg,{ref:y,getCellContent:R,columns:S,gridSelection:g,onGridSelectionChange:b,rows:e.length,overscrollX:50,smoothScrollX:!fe,smoothScrollY:!fe,validateCell:B,getCellsForSelection:!0,onPaste:!0,showSearch:v,fillHandle:!0,allowedFillDirections:"vertical",onKeyDown:D,height:e.length>10?450:void 0,width:"100%",rowMarkers:{kind:"both"},rowSelectionMode:"multi",onCellEdited:H,onColumnResize:f,onHeaderMenuClick:T,theme:op(C),trailingRowOptions:{hint:"New row",sticky:!0,tint:!0},onRowAppended:O,maxColumnAutoWidth:600,maxColumnWidth:600})}),(()=>{if(!q)return;const N=et.jsxs(et.Fragment,{children:[et.jsx(ip,{currentColumnName:S[p.col].title,onRename:te,onCancel:()=>w(void 0)}),et.jsx(G0,{}),et.jsx(m0,{direction:"left",onAdd:(K,ne)=>ce({direction:"left",columnName:K,dataType:ne}),onCancel:()=>w(void 0)}),et.jsx(m0,{direction:"right",onAdd:(K,ne)=>ce({direction:"right",columnName:K,dataType:ne}),onCancel:()=>w(void 0)}),et.jsx(G0,{}),!se&&et.jsxs(Y0,{onClick:Q,className:"text-destructive focus:text-destructive",children:[et.jsx(am,{className:Z}),"Delete column"]})]});return et.jsx(em,{open:q,onOpenChange:K=>!K&&w(void 0),children:et.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:[et.jsxs(Y0,{onClick:j,children:[et.jsx(nm,{className:Z}),"Copy column name"]}),!fe&&N]})})})(),et.jsx("div",{className:"absolute bottom-1 right-2 w-26",children:et.jsx(ja,{variant:"destructive",size:"sm",disabled:g.rows.length===0,className:"right-2 h-7",onClick:()=>{const N=g.rows.toArray();a(N);let K=0;for(const ne of N){const X=ne-K;t(J=>J.filter((ae,he)=>he!==X)),K++}b({columns:yt.empty(),rows:yt.empty()})},children:g.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};