streamlit 1.49.0__py3-none-any.whl → 1.49.1__py3-none-any.whl

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 (75) hide show
  1. streamlit/elements/lib/layout_utils.py +4 -4
  2. streamlit/static/index.html +1 -1
  3. streamlit/static/manifest.json +218 -218
  4. streamlit/static/static/js/{ErrorOutline.esm.u9XvzxL8.js → ErrorOutline.esm.DcGrhbBP.js} +1 -1
  5. streamlit/static/static/js/{FileDownload.esm.CaRyZ-b2.js → FileDownload.esm.DgBvV6Pq.js} +1 -1
  6. streamlit/static/static/js/{FileHelper.Dk2SwIi3.js → FileHelper.M6AAaeuA.js} +1 -1
  7. streamlit/static/static/js/{FormClearHelper.l_UPPvkg.js → FormClearHelper.DHh1GFzm.js} +1 -1
  8. streamlit/static/static/js/{Hooks.BxrVEftw.js → Hooks.DGu1od_L.js} +1 -1
  9. streamlit/static/static/js/{InputInstructions.C254RU9X.js → InputInstructions.z6sVgyYt.js} +1 -1
  10. streamlit/static/static/js/{Particles.DkY6FDnc.js → Particles.DDVT-6Qc.js} +1 -1
  11. streamlit/static/static/js/{ProgressBar.BPtSM82n.js → ProgressBar.BEY0cXXV.js} +1 -1
  12. streamlit/static/static/js/{Toolbar.BO_3WBaS.js → Toolbar.DSnK1fUh.js} +1 -1
  13. streamlit/static/static/js/{base-input.egUI4LjJ.js → base-input.CK3UVGp1.js} +1 -1
  14. streamlit/static/static/js/{checkbox.ButpszcE.js → checkbox.D8W881TL.js} +1 -1
  15. streamlit/static/static/js/{createSuper.DYJA5xa6.js → createSuper.B6W-Dh9S.js} +1 -1
  16. streamlit/static/static/js/{data-grid-overlay-editor.C9gQLEnU.js → data-grid-overlay-editor.DRTHOydk.js} +1 -1
  17. streamlit/static/static/js/{downloader.B3TjsSPZ.js → downloader.DiKpuU_S.js} +1 -1
  18. streamlit/static/static/js/{es6.BYSNuG4D.js → es6.B8zRNPZ-.js} +2 -2
  19. streamlit/static/static/js/{iframeResizer.contentWindow.CNPHJsF2.js → iframeResizer.contentWindow.DIewJmmh.js} +1 -1
  20. streamlit/static/static/js/{index.CjQnYKID.js → index.452cqrrL.js} +1 -1
  21. streamlit/static/static/js/{index.0tDq1WXk.js → index.4eF4NxG2.js} +1 -1
  22. streamlit/static/static/js/{index.CuEFSQ-o.js → index.B6U8LQo3.js} +1 -1
  23. streamlit/static/static/js/{index.DgpIMUsr.js → index.B9mjBcgE.js} +1 -1
  24. streamlit/static/static/js/{index.Bpe4-O2W.js → index.BXYmrqnf.js} +1 -1
  25. streamlit/static/static/js/index.B_8AnktO.js +1 -0
  26. streamlit/static/static/js/{index.z992t-BQ.js → index.Bl7zGQSh.js} +1 -1
  27. streamlit/static/static/js/{index.DWedOrkQ.js → index.BnEpvLEz.js} +1 -1
  28. streamlit/static/static/js/{index.DStzYLqM.js → index.BnJIOYn9.js} +1 -1
  29. streamlit/static/static/js/{index.DP1rDFP0.js → index.Bte_9Lyq.js} +1 -1
  30. streamlit/static/static/js/{index.Ca3y4ztK.js → index.C1HcTl5K.js} +1 -1
  31. streamlit/static/static/js/{index.DGcW849X.js → index.C7fRKRs4.js} +1 -1
  32. streamlit/static/static/js/{index.C1qCS-sd.js → index.C7lSmSOP.js} +1 -1
  33. streamlit/static/static/js/{index.BBnWuh07.js → index.CD8HuT3N.js} +4 -4
  34. streamlit/static/static/js/{index.D4jR1m1z.js → index.CP5TD2z1.js} +1 -1
  35. streamlit/static/static/js/{index.C3EXAI-u.js → index.C_tmcx4B.js} +1 -1
  36. streamlit/static/static/js/{index.Cl_966eE.js → index.CcJf6BCU.js} +1 -1
  37. streamlit/static/static/js/{index.BH79B25f.js → index.CejBxbg1.js} +1 -1
  38. streamlit/static/static/js/{index.DtwkPJs5.js → index.Ch7MBCx0.js} +1 -1
  39. streamlit/static/static/js/{index.BoJaJReB.js → index.CjXWwH-y.js} +1 -1
  40. streamlit/static/static/js/{index.BrD9sbpx.js → index.CvYYtxD_.js} +1 -1
  41. streamlit/static/static/js/{index.CfiZGqj3.js → index.D2-atlaQ.js} +1 -1
  42. streamlit/static/static/js/{index.BeTC4Yl-.js → index.D3K5nOu9.js} +5 -5
  43. streamlit/static/static/js/{index.uInpwWAP.js → index.D5naqx-J.js} +1 -1
  44. streamlit/static/static/js/{index.CFjU0x00.js → index.Dk4C7X3i.js} +1 -1
  45. streamlit/static/static/js/{index.DKb-BAE2.js → index.DkKT3LUI.js} +1 -1
  46. streamlit/static/static/js/{index.Bp1Of6L8.js → index.DtYN2x4k.js} +1 -1
  47. streamlit/static/static/js/{index.BnOd05Ko.js → index.MTPPBDHk.js} +1 -1
  48. streamlit/static/static/js/{index.CqSRo6zQ.js → index.Ts_0SdB9.js} +1 -1
  49. streamlit/static/static/js/{index.Cb9gN2T2.js → index.cnnXF7xQ.js} +1 -1
  50. streamlit/static/static/js/{index.CeXLlclc.js → index.ho6NIXGl.js} +1 -1
  51. streamlit/static/static/js/{index.C77g9sAQ.js → index.pqW9AMJD.js} +1 -1
  52. streamlit/static/static/js/{index.MQLQLR5Z.js → index.qhs54UAB.js} +1 -1
  53. streamlit/static/static/js/{index.CbwuUwu4.js → index.urHgTgMQ.js} +1 -1
  54. streamlit/static/static/js/{index.BDZorv41.js → index.wzkv_11M.js} +1 -1
  55. streamlit/static/static/js/{index.DVKQKDLu.js → index.yF5AncHY.js} +1 -1
  56. streamlit/static/static/js/{index.CFePF7s4.js → index.zecpGxtj.js} +1 -1
  57. streamlit/static/static/js/{input.CbP5ZuQ7.js → input.nzVJphXi.js} +1 -1
  58. streamlit/static/static/js/{memory.BuacVo2L.js → memory.CjCgTQz3.js} +1 -1
  59. streamlit/static/static/js/{number-overlay-editor.BZb9zRl_.js → number-overlay-editor.DaRFzZEO.js} +1 -1
  60. streamlit/static/static/js/{possibleConstructorReturn.DSM84rOS.js → possibleConstructorReturn.DgiPnZ9N.js} +1 -1
  61. streamlit/static/static/js/{sandbox.C480llMG.js → sandbox.mithfq7Z.js} +1 -1
  62. streamlit/static/static/js/{timepicker.BunxCVp7.js → timepicker.Dbl5KFh6.js} +1 -1
  63. streamlit/static/static/js/{toConsumableArray.B4o8rEx1.js → toConsumableArray.D-Dx88BQ.js} +1 -1
  64. streamlit/static/static/js/{uniqueId.tii0yosY.js → uniqueId.Bh26R_3S.js} +1 -1
  65. streamlit/static/static/js/{useBasicWidgetState.Bnm4FD6K.js → useBasicWidgetState.DeK-QJpD.js} +1 -1
  66. streamlit/static/static/js/{useTextInputAutoExpand.Dgtwc1m0.js → useTextInputAutoExpand.4iAdLWD-.js} +1 -1
  67. streamlit/static/static/js/{useUpdateUiValue.DjXdMFGw.js → useUpdateUiValue.CmT7_nJN.js} +1 -1
  68. streamlit/static/static/js/{withFullScreenWrapper.0cy2pVf5.js → withFullScreenWrapper.DLp1ENGm.js} +1 -1
  69. {streamlit-1.49.0.dist-info → streamlit-1.49.1.dist-info}/METADATA +1 -1
  70. {streamlit-1.49.0.dist-info → streamlit-1.49.1.dist-info}/RECORD +74 -74
  71. streamlit/static/static/js/index.DYbRPmVF.js +0 -1
  72. {streamlit-1.49.0.data → streamlit-1.49.1.data}/scripts/streamlit.cmd +0 -0
  73. {streamlit-1.49.0.dist-info → streamlit-1.49.1.dist-info}/WHEEL +0 -0
  74. {streamlit-1.49.0.dist-info → streamlit-1.49.1.dist-info}/entry_points.txt +0 -0
  75. {streamlit-1.49.0.dist-info → streamlit-1.49.1.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.C9gQLEnU.js","./index.BBnWuh07.js","../css/index.C8X8rNzw.css","./withFullScreenWrapper.0cy2pVf5.js","./Toolbar.BO_3WBaS.js","./FormClearHelper.l_UPPvkg.js","./sprintf.D7DtBTRn.js","./checkbox.ButpszcE.js","./createDownloadLinkElement.ZaXNnPK4.js","./toConsumableArray.B4o8rEx1.js","./possibleConstructorReturn.DSM84rOS.js","./createSuper.DYJA5xa6.js","./FileDownload.esm.CaRyZ-b2.js","./number-overlay-editor.BZb9zRl_.js","./es6.BYSNuG4D.js"])))=>i.map(i=>d[i]);
2
- import{r as f,E as Ws,_ as Ae,c7 as Dh,a5 as vr,bF as Ya,b0 as wo,b1 as Oh,c8 as Ph,c9 as Lh,ca as $c,cb as Nc,am as $t,cc as Fh,cd as Bc,ce as _h,cf as Ah,cg as Hh,ch as zh,ci as Vh,cj as $h,ab as Or,bd as Us,a4 as Nh,ck as Bh,m as ze,b3 as Wc,o as lt,cl as no,bs as Gr,cm as Wh,c4 as ja,j as He,cn as Uh,co as qh,v as nr,aA as rn,aP as Gh,cp as Bl,cq as Xh,cr as Yh,cs as jh,ct as Kh,cu as Uc,cv as Zh,cw as Jh,cx as Es,cy as qc,cz as Gc,cA as Qh,cB as eg,cC as tg,cD as ng,cE as rg,cF as ig,cG as og,cH as ag,cI as sg,cJ as Xc,cK as lg,cL as ug,cM as cg,cN as dg,cO as fg,aN as hg,aO as gg,cP as pg,cQ as mg,aM as vg,cR as bg,cS as wg,cT as yg,aL as Cg,u as Kr,cU as on,x as qs,cV as Sg,bM as ro,cW as ur,cX as Fe,a_ as xg,aa as Yc,cY as jc,a1 as kg,cZ as Mg,t as mi,c_ as Rg,c$ as Ig,aR as Ka,F as Kc,bK as xa,d0 as Zc,h as ka,e as vn,y as Jn,bI as Ma,d1 as Eg,bL as Jc,d2 as Tg,S as Dg,J as Wl,d3 as Og,d4 as Pg,L as Lg,d5 as Fg,d6 as Ul}from"./index.BBnWuh07.js";import{w as _g,E as Ag}from"./withFullScreenWrapper.0cy2pVf5.js";import{T as Hg,a as gi}from"./Toolbar.BO_3WBaS.js";import{u as zg}from"./FormClearHelper.l_UPPvkg.js";import{s as Vg}from"./sprintf.D7DtBTRn.js";import{L as $g,a as Ng,S as Bg}from"./checkbox.ButpszcE.js";import{c as Wg}from"./createDownloadLinkElement.ZaXNnPK4.js";import{_ as gr,a as xi,C as Ug}from"./toConsumableArray.B4o8rEx1.js";import{d as qg,f as Gg,e as Xg}from"./possibleConstructorReturn.DSM84rOS.js";import{_ as Yg}from"./createSuper.DYJA5xa6.js";import{D as jg,F as Kg}from"./FileDownload.esm.CaRyZ-b2.js";var Qc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ws,Ae({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Qc.displayName="Add";var ed=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ws,Ae({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});ed.displayName="Search";var td=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ws,Ae({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M12 6a9.77 9.77 0 018.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0112 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 010 5 2.5 2.5 0 010-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}))});td.displayName="Visibility";var Za,ql;function Zg(){if(ql)return Za;ql=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return Za=n,Za}var Ja,Gl;function Jg(){if(Gl)return Ja;Gl=1;var e=Zg(),t=Dh();function n(r,i){return r!=null&&t(r,i,e)}return Ja=n,Ja}var Qg=Jg();const ep=vr(Qg);function nd(e="This should not happen"){throw new Error(e)}function zn(e,t="Assertion failed"){if(!e)return nd(t)}function co(e,t){return nd(t??"Hell froze over")}function tp(e,t){try{return e()}catch{return t}}const Xl=Object.prototype.hasOwnProperty;function Mi(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--&&Mi(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Xl.call(e,n)&&++r&&!Xl.call(t,n)||!(n in t)||!Mi(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const sa=null,Gs=void 0;var Z;(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"})(Z||(Z={}));var Yl;(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"})(Yl||(Yl={}));var la;(function(e){e.Triangle="triangle",e.Dots="dots"})(la||(la={}));function $o(e){return"width"in e&&typeof e.width=="number"}async function jl(e){return typeof e=="object"?e:await e()}function vi(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function yi(e){return e.kind===Xn.Marker||e.kind===Xn.NewRow}function bi(e){if(!vi(e)||e.kind===Z.Image)return!1;switch(e.kind){case Z.Text:case Z.Number:case Z.Markdown:case Z.Uri:case Z.Custom:case Z.Boolean:return e.readonly!==!0;default:co(e,"A cell was passed with an invalid kind")}}function np(e){return ep(e,"editor")}function Xs(e){return!(e.readonly??!1)}var Xn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Xn||(Xn={}));const ua={shape:"square",size:4,offsetX:-2,offsetY:-2,outline:0};function Qa(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,i){return r[0]-i[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const i=n[n.length-1];i[1]<r[0]?n.push([...r]):i[1]<r[1]&&(i[1]=r[1])}return n}let Kl;class Qe{items;constructor(t){this.items=t}static create=t=>new Qe(Qa(t));static empty=()=>Kl??(Kl=new Qe([]));static fromSingleSelection=t=>Qe.empty().add(t);static fromArray=t=>{if(t.length===0)return Qe.empty();const n=t.map(i=>[i,i+1]),r=Qa(n);return new Qe(r)};offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new Qe(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Qa([...this.items,n]);return new Qe(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],i=typeof t=="number"?t+1:t[1];for(const[o,s]of n.entries()){const[a,l]=s;if(a<=i&&r<=l){const u=[];a<r&&u.push([a,r]),i<l&&u.push([i,l]),n.splice(o,1,...u)}}return new Qe(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,i]=this.items[n];if(t>=r&&t<i)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],i=this.items[n];if(r[0]!==i[0]||r[1]!==i[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let i=n;i<r;i++)t.push(i);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}}var rp=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,l]=a.split("_");n[l]=a}else r.push(a)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},Zl=rp,ip=e=>e.toUpperCase()===e,op=e=>t=>e.indexOf(t)===-1,rd=(e,t)=>{const n={};return Object.keys(e).filter(op(t)).forEach(r=>{n[r]=e[r]}),n};function ap(e,t,n){const r=rd(t,n);if(!e){const i=typeof Ya=="function"?{default:Ya}:Ya;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var sp=(e,t)=>{};function lp(e){let t="";return n=>{const r=(o,s)=>{const{as:a=e,class:l=t}=o,u=n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&!ip(a[0])):n.propsAsIs,c=ap(u,o,["as","class"]);c.ref=s,c.className=n.atomic?Zl(n.class,c.className||l):Zl(c.className||l,n.class);const{vars:d}=n;if(d){const g={};for(const m in d){const y=d[m],b=y[0],v=y[1]||"",C=typeof b=="function"?b(o):b;sp(C,n.name),g[`--${m}`]=`${C}${v}`}const h=c.style||{},p=Object.keys(h);p.length>0&&p.forEach(m=>{g[m]=h[m]}),c.style=g}return e.__wyw_meta&&e!==a?(c.as=a,f.createElement(e,c)):f.createElement(a,c)},i=f.forwardRef?f.forwardRef(r):o=>{const s=rd(o,["innerRef"]);return r(s,o.innerRef)};return i.displayName=n.name,i.__wyw_meta={className:n.class||t,extends:e},i}}var sn=lp;const up=sn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var es={},Ui={},No={},Bo={},Jl;function cp(){return Jl||(Jl=1,function(e){(function(t,n){n(e,wo(),Oh())})(Bo,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=p;var i=s(n),o=s(r);function s(v){return v&&v.__esModule?v:{default:v}}var a=Object.assign||function(v){for(var C=1;C<arguments.length;C++){var E=arguments[C];for(var I in E)Object.prototype.hasOwnProperty.call(E,I)&&(v[I]=E[I])}return v};function l(v,C){var E={};for(var I in v)C.indexOf(I)>=0||Object.prototype.hasOwnProperty.call(v,I)&&(E[I]=v[I]);return E}function u(v,C){if(!(v instanceof C))throw new TypeError("Cannot call a class as a function")}var c=function(){function v(C,E){for(var I=0;I<E.length;I++){var R=E[I];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(C,R.key,R)}}return function(C,E,I){return E&&v(C.prototype,E),I&&v(C,I),C}}();function d(v,C){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:v}function g(v,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);v.prototype=Object.create(C&&C.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(v,C):v.__proto__=C)}var h=!1;function p(v){h=v}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){p(!0)}}))}catch{}function m(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return h?v:v.capture}function y(v){if("touches"in v){var C=v.touches[0],E=C.pageX,I=C.pageY;return{x:E,y:I}}var R=v.screenX,P=v.screenY;return{x:R,y:P}}var b=function(v){g(C,v);function C(){var E;u(this,C);for(var I=arguments.length,R=Array(I),P=0;P<I;P++)R[P]=arguments[P];var x=d(this,(E=C.__proto__||Object.getPrototypeOf(C)).call.apply(E,[this].concat(R)));return x._handleSwipeStart=x._handleSwipeStart.bind(x),x._handleSwipeMove=x._handleSwipeMove.bind(x),x._handleSwipeEnd=x._handleSwipeEnd.bind(x),x._onMouseDown=x._onMouseDown.bind(x),x._onMouseMove=x._onMouseMove.bind(x),x._onMouseUp=x._onMouseUp.bind(x),x._setSwiperRef=x._setSwiperRef.bind(x),x}return c(C,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(I){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(I))}},{key:"_onMouseMove",value:function(I){this.mouseDown&&this._handleSwipeMove(I)}},{key:"_onMouseUp",value:function(I){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(I)}},{key:"_handleSwipeStart",value:function(I){var R=y(I),P=R.x,x=R.y;this.moveStart={x:P,y:x},this.props.onSwipeStart(I)}},{key:"_handleSwipeMove",value:function(I){if(this.moveStart){var R=y(I),P=R.x,x=R.y,S=P-this.moveStart.x,F=x-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x:S,y:F},I);D&&I.cancelable&&I.preventDefault(),this.movePosition={deltaX:S,deltaY:F}}}},{key:"_handleSwipeEnd",value:function(I){this.props.onSwipeEnd(I);var R=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-R?this.props.onSwipeLeft(1,I):this.movePosition.deltaX>R&&this.props.onSwipeRight(1,I),this.movePosition.deltaY<-R?this.props.onSwipeUp(1,I):this.movePosition.deltaY>R&&this.props.onSwipeDown(1,I)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(I){this.swiper=I,this.props.innerRef(I)}},{key:"render",value:function(){var I=this.props;I.tagName;var R=I.className,P=I.style,x=I.children;I.allowMouseEvents,I.onSwipeUp,I.onSwipeDown,I.onSwipeLeft,I.onSwipeRight,I.onSwipeStart,I.onSwipeMove,I.onSwipeEnd,I.innerRef,I.tolerance;var S=l(I,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,a({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:R,style:P},S),x)}}]),C}(n.Component);b.displayName="ReactSwipe",b.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},b.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=b})}(Bo)),Bo}var Ql;function id(){return Ql||(Ql=1,function(e){(function(t,n){n(e,cp())})(No,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=i(n);function i(o){return o&&o.__esModule?o:{default:o}}t.default=r.default})}(No)),No}var qi={},eu;function od(){if(eu)return qi;eu=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.default=void 0;var e=t(Ph());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,s){return o in i?Object.defineProperty(i,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[o]=s,i}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,s){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":s==="horizontal","axis-vertical":s!=="horizontal"})},SLIDER:function(o,s){return(0,e.default)({thumbs:!o,slider:o,animated:!s})},ITEM:function(o,s,a){return(0,e.default)({thumb:!o,slide:o,selected:s,previous:a})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return qi.default=r,qi}var Gi={},Xi={},tu;function dp(){if(tu)return Xi;tu=1,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return Xi.outerWidth=e,Xi}var Yi={},nu;function Ys(){if(nu)return Yi;nu=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,s=i==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",l="("+s.join(",")+")";return a+l};return Yi.default=e,Yi}var ji={},ru;function ad(){if(ru)return ji;ru=1,Object.defineProperty(ji,"__esModule",{value:!0}),ji.default=void 0;var e=function(){return window};return ji.default=e,ji}var iu;function sd(){if(iu)return Gi;iu=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.default=void 0;var e=l(wo()),t=s(od()),n=dp(),r=s(Ys()),i=s(id()),o=s(ad());function s(x){return x&&x.__esModule?x:{default:x}}function a(){if(typeof WeakMap!="function")return null;var x=new WeakMap;return a=function(){return x},x}function l(x){if(x&&x.__esModule)return x;if(x===null||u(x)!=="object"&&typeof x!="function")return{default:x};var S=a();if(S&&S.has(x))return S.get(x);var F={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var M in x)if(Object.prototype.hasOwnProperty.call(x,M)){var T=D?Object.getOwnPropertyDescriptor(x,M):null;T&&(T.get||T.set)?Object.defineProperty(F,M,T):F[M]=x[M]}return F.default=x,S&&S.set(x,F),F}function u(x){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(F){return typeof F}:u=function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},u(x)}function c(){return c=Object.assign||function(x){for(var S=1;S<arguments.length;S++){var F=arguments[S];for(var D in F)Object.prototype.hasOwnProperty.call(F,D)&&(x[D]=F[D])}return x},c.apply(this,arguments)}function d(x,S){if(!(x instanceof S))throw new TypeError("Cannot call a class as a function")}function g(x,S){for(var F=0;F<S.length;F++){var D=S[F];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(x,D.key,D)}}function h(x,S,F){return S&&g(x.prototype,S),x}function p(x,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function");x.prototype=Object.create(S&&S.prototype,{constructor:{value:x,writable:!0,configurable:!0}}),S&&m(x,S)}function m(x,S){return m=Object.setPrototypeOf||function(D,M){return D.__proto__=M,D},m(x,S)}function y(x){var S=C();return function(){var D=E(x),M;if(S){var T=E(this).constructor;M=Reflect.construct(D,arguments,T)}else M=D.apply(this,arguments);return b(this,M)}}function b(x,S){return S&&(u(S)==="object"||typeof S=="function")?S:v(x)}function v(x){if(x===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x}function C(){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}}function E(x){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(F){return F.__proto__||Object.getPrototypeOf(F)},E(x)}function I(x,S,F){return S in x?Object.defineProperty(x,S,{value:F,enumerable:!0,configurable:!0,writable:!0}):x[S]=F,x}var R=function(S){return S.hasOwnProperty("key")},P=function(x){p(F,x);var S=y(F);function F(D){var M;return d(this,F),M=S.call(this,D),I(v(M),"itemsWrapperRef",void 0),I(v(M),"itemsListRef",void 0),I(v(M),"thumbsRef",void 0),I(v(M),"setItemsWrapperRef",function(T){M.itemsWrapperRef=T}),I(v(M),"setItemsListRef",function(T){M.itemsListRef=T}),I(v(M),"setThumbsRef",function(T,O){M.thumbsRef||(M.thumbsRef=[]),M.thumbsRef[O]=T}),I(v(M),"updateSizes",function(){if(!(!M.props.children||!M.itemsWrapperRef||!M.thumbsRef)){var T=e.Children.count(M.props.children),O=M.itemsWrapperRef.clientWidth,k=M.props.thumbWidth?M.props.thumbWidth:(0,n.outerWidth)(M.thumbsRef[0]),$=Math.floor(O/k),G=$<T,j=G?T-$:0;M.setState(function(ue,Q){return{itemSize:k,visibleItems:$,firstItem:G?M.getFirstItem(Q.selectedItem):0,lastPosition:j,showArrows:G}})}}),I(v(M),"handleClickItem",function(T,O,k){if(!R(k)||k.key==="Enter"){var $=M.props.onSelectItem;typeof $=="function"&&$(T,O)}}),I(v(M),"onSwipeStart",function(){M.setState({swiping:!0})}),I(v(M),"onSwipeEnd",function(){M.setState({swiping:!1})}),I(v(M),"onSwipeMove",function(T){var O=T.x;if(!M.state.itemSize||!M.itemsWrapperRef||!M.state.visibleItems)return!1;var k=0,$=e.Children.count(M.props.children),G=-(M.state.firstItem*100)/M.state.visibleItems,j=Math.max($-M.state.visibleItems,0),ue=-j*100/M.state.visibleItems;G===k&&O>0&&(O=0),G===ue&&O<0&&(O=0);var Q=M.itemsWrapperRef.clientWidth,ee=G+100/(Q/O);return M.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(ce){M.itemsListRef.style[ce]=(0,r.default)(ee,"%",M.props.axis)}),!0}),I(v(M),"slideRight",function(T){M.moveTo(M.state.firstItem-(typeof T=="number"?T:1))}),I(v(M),"slideLeft",function(T){M.moveTo(M.state.firstItem+(typeof T=="number"?T:1))}),I(v(M),"moveTo",function(T){T=T<0?0:T,T=T>=M.state.lastPosition?M.state.lastPosition:T,M.setState({firstItem:T})}),M.state={selectedItem:D.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},M}return h(F,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(M){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==M.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(M){var T=M;return M>=this.state.lastPosition&&(T=this.state.lastPosition),M<this.state.firstItem+this.state.visibleItems&&(T=this.state.firstItem),M<this.state.firstItem&&(T=M),T}},{key:"renderItems",value:function(){var M=this;return this.props.children.map(function(T,O){var k=t.default.ITEM(!1,O===M.state.selectedItem),$={key:O,ref:function(j){return M.setThumbsRef(j,O)},className:k,onClick:M.handleClickItem.bind(M,O,M.props.children[O]),onKeyDown:M.handleClickItem.bind(M,O,M.props.children[O]),"aria-label":"".concat(M.props.labels.item," ").concat(O+1),style:{width:M.props.thumbWidth}};return e.default.createElement("li",c({},$,{role:"button",tabIndex:0}),T)})}},{key:"render",value:function(){var M=this;if(!this.props.children)return null;var T=e.Children.count(this.props.children)>1,O=this.state.showArrows&&this.state.firstItem>0,k=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,$={},G=-this.state.firstItem*(this.state.itemSize||0),j=(0,r.default)(G,"px",this.props.axis),ue=this.props.transitionTime+"ms";return $={WebkitTransform:j,MozTransform:j,MsTransform:j,OTransform:j,transform:j,msTransform:j,WebkitTransitionDuration:ue,MozTransitionDuration:ue,MsTransitionDuration:ue,OTransitionDuration:ue,transitionDuration:ue,msTransitionDuration:ue},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(!O),onClick:function(){return M.slideRight()},"aria-label":this.props.labels.leftArrow}),T?e.default.createElement(i.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:$,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(ee){return M.setItemsListRef(ee)},style:$},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!k),onClick:function(){return M.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),F}(e.Component);return Gi.default=P,I(P,"displayName","Thumbs"),I(P,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Gi}var Ki={},ou;function fp(){if(ou)return Ki;ou=1,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.default=void 0;var e=function(){return document};return Ki.default=e,Ki}var Hn={},au;function ld(){if(au)return Hn;au=1,Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.setPosition=Hn.getPosition=Hn.isKeyboardEvent=Hn.defaultStatusFormatter=Hn.noop=void 0;var e=wo(),t=n(Ys());function n(l){return l&&l.__esModule?l:{default:l}}var r=function(){};Hn.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};Hn.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};Hn.isKeyboardEvent=o;var s=function(u,c){if(c.infiniteLoop&&++u,u===0)return 0;var d=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var g=-u*c.centerSlidePercentage,h=d-1;return u&&(u!==h||c.infiniteLoop)?g+=(100-c.centerSlidePercentage)/2:u===h&&(g+=100-c.centerSlidePercentage),g}return-u*100};Hn.getPosition=s;var a=function(u,c){var d={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){d[g]=(0,t.default)(u,"%",c)}),d};return Hn.setPosition=a,Hn}var Zn={},su;function hp(){if(su)return Zn;su=1,Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.fadeAnimationHandler=Zn.slideStopSwipingHandler=Zn.slideSwipeAnimationHandler=Zn.slideAnimationHandler=void 0;var e=wo(),t=r(Ys()),n=ld();function r(d){return d&&d.__esModule?d:{default:d}}function i(d,g){var h=Object.keys(d);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(d);g&&(p=p.filter(function(m){return Object.getOwnPropertyDescriptor(d,m).enumerable})),h.push.apply(h,p)}return h}function o(d){for(var g=1;g<arguments.length;g++){var h=arguments[g]!=null?arguments[g]:{};g%2?i(Object(h),!0).forEach(function(p){s(d,p,h[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(p){Object.defineProperty(d,p,Object.getOwnPropertyDescriptor(h,p))})}return d}function s(d,g,h){return g in d?Object.defineProperty(d,g,{value:h,enumerable:!0,configurable:!0,writable:!0}):d[g]=h,d}var a=function(g,h){var p={},m=h.selectedItem,y=m,b=e.Children.count(g.children)-1,v=g.infiniteLoop&&(m<0||m>b);if(v)return y<0?g.centerMode&&g.centerSlidePercentage&&g.axis==="horizontal"?p.itemListStyle=(0,n.setPosition)(-(b+2)*g.centerSlidePercentage-(100-g.centerSlidePercentage)/2,g.axis):p.itemListStyle=(0,n.setPosition)(-(b+2)*100,g.axis):y>b&&(p.itemListStyle=(0,n.setPosition)(0,g.axis)),p;var C=(0,n.getPosition)(m,g),E=(0,t.default)(C,"%",g.axis),I=g.transitionTime+"ms";return p.itemListStyle={WebkitTransform:E,msTransform:E,OTransform:E,transform:E},h.swiping||(p.itemListStyle=o(o({},p.itemListStyle),{},{WebkitTransitionDuration:I,MozTransitionDuration:I,OTransitionDuration:I,transitionDuration:I,msTransitionDuration:I})),p};Zn.slideAnimationHandler=a;var l=function(g,h,p,m){var y={},b=h.axis==="horizontal",v=e.Children.count(h.children),C=0,E=(0,n.getPosition)(p.selectedItem,h),I=h.infiniteLoop?(0,n.getPosition)(v-1,h)-100:(0,n.getPosition)(v-1,h),R=b?g.x:g.y,P=R;E===C&&R>0&&(P=0),E===I&&R<0&&(P=0);var x=E+100/(p.itemSize/P),S=Math.abs(R)>h.swipeScrollTolerance;return h.infiniteLoop&&S&&(p.selectedItem===0&&x>-100?x-=v*100:p.selectedItem===v-1&&x<-v*100&&(x+=v*100)),(!h.preventMovementUntilSwipeScrollTolerance||S||p.swipeMovementStarted)&&(p.swipeMovementStarted||m({swipeMovementStarted:!0}),y.itemListStyle=(0,n.setPosition)(x,h.axis)),S&&!p.cancelClick&&m({cancelClick:!0}),y};Zn.slideSwipeAnimationHandler=l;var u=function(g,h){var p=(0,n.getPosition)(h.selectedItem,g),m=(0,n.setPosition)(p,g.axis);return{itemListStyle:m}};Zn.slideStopSwipingHandler=u;var c=function(g,h){var p=g.transitionTime+"ms",m="ease-in-out",y={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:m,msTransitionTimingFunction:m,MozTransitionTimingFunction:m,WebkitTransitionTimingFunction:m,OTransitionTimingFunction:m};return h.swiping||(y=o(o({},y),{},{WebkitTransitionDuration:p,MozTransitionDuration:p,OTransitionDuration:p,transitionDuration:p,msTransitionDuration:p})),{slideStyle:y,selectedStyle:o(o({},y),{},{opacity:1,position:"relative"}),prevStyle:o({},y)}};return Zn.fadeAnimationHandler=c,Zn}var lu;function gp(){if(lu)return Ui;lu=1,Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.default=void 0;var e=c(wo()),t=l(id()),n=l(od()),r=l(sd()),i=l(fp()),o=l(ad()),s=ld(),a=hp();function l(D){return D&&D.__esModule?D:{default:D}}function u(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return u=function(){return D},D}function c(D){if(D&&D.__esModule)return D;if(D===null||d(D)!=="object"&&typeof D!="function")return{default:D};var M=u();if(M&&M.has(D))return M.get(D);var T={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var k in D)if(Object.prototype.hasOwnProperty.call(D,k)){var $=O?Object.getOwnPropertyDescriptor(D,k):null;$&&($.get||$.set)?Object.defineProperty(T,k,$):T[k]=D[k]}return T.default=D,M&&M.set(D,T),T}function d(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(T){return typeof T}:d=function(T){return T&&typeof Symbol=="function"&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T},d(D)}function g(){return g=Object.assign||function(D){for(var M=1;M<arguments.length;M++){var T=arguments[M];for(var O in T)Object.prototype.hasOwnProperty.call(T,O)&&(D[O]=T[O])}return D},g.apply(this,arguments)}function h(D,M){var T=Object.keys(D);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(D);M&&(O=O.filter(function(k){return Object.getOwnPropertyDescriptor(D,k).enumerable})),T.push.apply(T,O)}return T}function p(D){for(var M=1;M<arguments.length;M++){var T=arguments[M]!=null?arguments[M]:{};M%2?h(Object(T),!0).forEach(function(O){S(D,O,T[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(T)):h(Object(T)).forEach(function(O){Object.defineProperty(D,O,Object.getOwnPropertyDescriptor(T,O))})}return D}function m(D,M){if(!(D instanceof M))throw new TypeError("Cannot call a class as a function")}function y(D,M){for(var T=0;T<M.length;T++){var O=M[T];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(D,O.key,O)}}function b(D,M,T){return M&&y(D.prototype,M),D}function v(D,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(M&&M.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),M&&C(D,M)}function C(D,M){return C=Object.setPrototypeOf||function(O,k){return O.__proto__=k,O},C(D,M)}function E(D){var M=P();return function(){var O=x(D),k;if(M){var $=x(this).constructor;k=Reflect.construct(O,arguments,$)}else k=O.apply(this,arguments);return I(this,k)}}function I(D,M){return M&&(d(M)==="object"||typeof M=="function")?M:R(D)}function R(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function P(){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}}function x(D){return x=Object.setPrototypeOf?Object.getPrototypeOf:function(T){return T.__proto__||Object.getPrototypeOf(T)},x(D)}function S(D,M,T){return M in D?Object.defineProperty(D,M,{value:T,enumerable:!0,configurable:!0,writable:!0}):D[M]=T,D}var F=function(D){v(T,D);var M=E(T);function T(O){var k;m(this,T),k=M.call(this,O),S(R(k),"thumbsRef",void 0),S(R(k),"carouselWrapperRef",void 0),S(R(k),"listRef",void 0),S(R(k),"itemsRef",void 0),S(R(k),"timer",void 0),S(R(k),"animationHandler",void 0),S(R(k),"setThumbsRef",function(G){k.thumbsRef=G}),S(R(k),"setCarouselWrapperRef",function(G){k.carouselWrapperRef=G}),S(R(k),"setListRef",function(G){k.listRef=G}),S(R(k),"setItemsRef",function(G,j){k.itemsRef||(k.itemsRef=[]),k.itemsRef[j]=G}),S(R(k),"autoPlay",function(){e.Children.count(k.props.children)<=1||(k.clearAutoPlay(),k.props.autoPlay&&(k.timer=setTimeout(function(){k.increment()},k.props.interval)))}),S(R(k),"clearAutoPlay",function(){k.timer&&clearTimeout(k.timer)}),S(R(k),"resetAutoPlay",function(){k.clearAutoPlay(),k.autoPlay()}),S(R(k),"stopOnHover",function(){k.setState({isMouseEntered:!0},k.clearAutoPlay)}),S(R(k),"startOnLeave",function(){k.setState({isMouseEntered:!1},k.autoPlay)}),S(R(k),"isFocusWithinTheCarousel",function(){return k.carouselWrapperRef?!!((0,i.default)().activeElement===k.carouselWrapperRef||k.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),S(R(k),"navigateWithKeyboard",function(G){if(k.isFocusWithinTheCarousel()){var j=k.props.axis,ue=j==="horizontal",Q={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},ee=ue?Q.ArrowRight:Q.ArrowDown,ce=ue?Q.ArrowLeft:Q.ArrowUp;ee===G.keyCode?k.increment():ce===G.keyCode&&k.decrement()}}),S(R(k),"updateSizes",function(){if(!(!k.state.initialized||!k.itemsRef||k.itemsRef.length===0)){var G=k.props.axis==="horizontal",j=k.itemsRef[0];if(j){var ue=G?j.clientWidth:j.clientHeight;k.setState({itemSize:ue}),k.thumbsRef&&k.thumbsRef.updateSizes()}}}),S(R(k),"setMountState",function(){k.setState({hasMount:!0}),k.updateSizes()}),S(R(k),"handleClickItem",function(G,j){if(e.Children.count(k.props.children)!==0){if(k.state.cancelClick){k.setState({cancelClick:!1});return}k.props.onClickItem(G,j),G!==k.state.selectedItem&&k.setState({selectedItem:G})}}),S(R(k),"handleOnChange",function(G,j){e.Children.count(k.props.children)<=1||k.props.onChange(G,j)}),S(R(k),"handleClickThumb",function(G,j){k.props.onClickThumb(G,j),k.moveTo(G)}),S(R(k),"onSwipeStart",function(G){k.setState({swiping:!0}),k.props.onSwipeStart(G)}),S(R(k),"onSwipeEnd",function(G){k.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),k.props.onSwipeEnd(G),k.clearAutoPlay(),k.state.autoPlay&&k.autoPlay()}),S(R(k),"onSwipeMove",function(G,j){k.props.onSwipeMove(j);var ue=k.props.swipeAnimationHandler(G,k.props,k.state,k.setState.bind(R(k)));return k.setState(p({},ue)),!!Object.keys(ue).length}),S(R(k),"decrement",function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem-(typeof G=="number"?G:1))}),S(R(k),"increment",function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem+(typeof G=="number"?G:1))}),S(R(k),"moveTo",function(G){if(typeof G=="number"){var j=e.Children.count(k.props.children)-1;G<0&&(G=k.props.infiniteLoop?j:0),G>j&&(G=k.props.infiniteLoop?0:j),k.selectItem({selectedItem:G}),k.state.autoPlay&&k.state.isMouseEntered===!1&&k.resetAutoPlay()}}),S(R(k),"onClickNext",function(){k.increment(1)}),S(R(k),"onClickPrev",function(){k.decrement(1)}),S(R(k),"onSwipeForward",function(){k.increment(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),S(R(k),"onSwipeBackwards",function(){k.decrement(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),S(R(k),"changeItem",function(G){return function(j){(!(0,s.isKeyboardEvent)(j)||j.key==="Enter")&&k.moveTo(G)}}),S(R(k),"selectItem",function(G){k.setState(p({previousItem:k.state.selectedItem},G),function(){k.setState(k.animationHandler(k.props,k.state))}),k.handleOnChange(G.selectedItem,e.Children.toArray(k.props.children)[G.selectedItem])}),S(R(k),"getInitialImage",function(){var G=k.props.selectedItem,j=k.itemsRef&&k.itemsRef[G],ue=j&&j.getElementsByTagName("img")||[];return ue[0]}),S(R(k),"getVariableItemHeight",function(G){var j=k.itemsRef&&k.itemsRef[G];if(k.state.hasMount&&j&&j.children.length){var ue=j.children[0].getElementsByTagName("img")||[];if(ue.length>0){var Q=ue[0];if(!Q.complete){var ee=function ge(){k.forceUpdate(),Q.removeEventListener("load",ge)};Q.addEventListener("load",ee)}}var ce=ue[0]||j.children[0],ae=ce.clientHeight;return ae>0?ae:null}return null});var $={initialized:!1,previousItem:O.selectedItem,selectedItem:O.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:O.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return k.animationHandler=typeof O.animationHandler=="function"&&O.animationHandler||O.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,k.state=p(p({},$),k.animationHandler(O,$)),k}return b(T,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(k,$){!k.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!k.autoFocus&&this.props.autoFocus&&this.forceFocus(),$.swiping&&!this.state.swiping&&this.setState(p({},this.props.stopSwipingHandler(this.props,this.state))),(k.selectedItem!==this.props.selectedItem||k.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),k.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 k=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 $=k.getInitialImage();$&&!$.complete?$.addEventListener("load",k.setMountState):k.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.addEventListener("mouseenter",this.stopOnHover),k.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.removeEventListener("mouseenter",this.stopOnHover),k.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,i.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var k=this.getInitialImage();k&&k.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var k;(k=this.carouselWrapperRef)===null||k===void 0||k.focus()}},{key:"renderItems",value:function(k){var $=this;return this.props.children?e.Children.map(this.props.children,function(G,j){var ue=j===$.state.selectedItem,Q=j===$.state.previousItem,ee=ue&&$.state.selectedStyle||Q&&$.state.prevStyle||$.state.slideStyle||{};$.props.centerMode&&$.props.axis==="horizontal"&&(ee=p(p({},ee),{},{minWidth:$.props.centerSlidePercentage+"%"})),$.state.swiping&&$.state.swipeMovementStarted&&(ee=p(p({},ee),{},{pointerEvents:"none"}));var ce={ref:function(ge){return $.setItemsRef(ge,j)},key:"itemKey"+j+(k?"clone":""),className:n.default.ITEM(!0,j===$.state.selectedItem,j===$.state.previousItem),onClick:$.handleClickItem.bind($,j,G),style:ee};return e.default.createElement("li",ce,$.props.renderItem(G,{isSelected:j===$.state.selectedItem,isPrevious:j===$.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var k=this,$=this.props,G=$.showIndicators,j=$.labels,ue=$.renderIndicator,Q=$.children;return G?e.default.createElement("ul",{className:"control-dots"},e.Children.map(Q,function(ee,ce){return ue&&ue(k.changeItem(ce),ce===k.state.selectedItem,ce,j.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?null: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))}},{key:"render",value:function(){var k=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var $=this.props.swipeable&&e.Children.count(this.props.children)>1,G=this.props.axis==="horizontal",j=this.props.showArrows&&e.Children.count(this.props.children)>1,ue=j&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,Q=j&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,ee=this.renderItems(!0),ce=ee.shift(),ae=ee.pop(),ge={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},de={};if(G){if(ge.onSwipeLeft=this.onSwipeForward,ge.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var re=this.getVariableItemHeight(this.state.selectedItem);de.height=re||"auto"}}else ge.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,ge.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,ge.style=p(p({},ge.style),{},{height:this.state.itemSize}),de.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,ue,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:de},$?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},ge,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&ae,this.renderItems(),this.props.infiniteLoop&&ce):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(L){return k.setListRef(L)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&ae,this.renderItems(),this.props.infiniteLoop&&ce)),this.props.renderArrowNext(this.onClickNext,Q,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),T}(e.default.Component);return Ui.default=F,S(F,"displayName","Carousel"),S(F,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:s.noop,onClickThumb:s.noop,onChange:s.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(M,T,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_PREV(!T),onClick:M})},renderArrowNext:function(M,T,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_NEXT(!T),onClick:M})},renderIndicator:function(M,T,O,k){return e.default.createElement("li",{className:n.default.DOT(T),onClick:M,onKeyDown:M,value:O,key:O,role:"button",tabIndex:0,"aria-label":"".concat(k," ").concat(O+1)})},renderItem:function(M){return M},renderThumbs:function(M){var T=e.Children.map(M,function(O){var k=O;if(O.type!=="img"&&(k=e.Children.toArray(O.props.children).find(function($){return $.type==="img"})),!!k)return k});return T.filter(function(O){return O}).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"),[]):T},statusFormatter:s.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}),Ui}var uu={},cu;function pp(){return cu||(cu=1),uu}var du;function mp(){return du||(du=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=i(gp()),n=pp(),r=i(sd());function i(o){return o&&o.__esModule?o:{default:o}}}(es)),es}var vp=mp(),ts,fu;function bp(){if(fu)return ts;fu=1;var e=Lh(),t=function(){return e.Date.now()};return ts=t,ts}var ns,hu;function ud(){if(hu)return ns;hu=1;var e=$c(),t=bp(),n=Nc(),r="Expected a function",i=Math.max,o=Math.min;function s(a,l,u){var c,d,g,h,p,m,y=0,b=!1,v=!1,C=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,e(u)&&(b=!!u.leading,v="maxWait"in u,g=v?i(n(u.maxWait)||0,l):g,C="trailing"in u?!!u.trailing:C);function E(T){var O=c,k=d;return c=d=void 0,y=T,h=a.apply(k,O),h}function I(T){return y=T,p=setTimeout(x,l),b?E(T):h}function R(T){var O=T-m,k=T-y,$=l-O;return v?o($,g-k):$}function P(T){var O=T-m,k=T-y;return m===void 0||O>=l||O<0||v&&k>=g}function x(){var T=t();if(P(T))return S(T);p=setTimeout(x,R(T))}function S(T){return p=void 0,C&&c?E(T):(c=d=void 0,h)}function F(){p!==void 0&&clearTimeout(p),y=0,c=m=d=p=void 0}function D(){return p===void 0?h:S(t())}function M(){var T=t(),O=P(T);if(c=arguments,d=this,m=T,O){if(p===void 0)return I(m);if(v)return clearTimeout(p),p=setTimeout(x,l),E(m)}return p===void 0&&(p=setTimeout(x,l)),h}return M.cancel=F,M.flush=D,M}return ns=s,ns}var wp=ud();const cd=vr(wp);function xn(e,t,n,r,i=!1){const o=f.useRef();o.current=t,f.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const s=n,a=l=>{o.current?.call(s,l)};return s.addEventListener(e,a,{passive:r,capture:i}),()=>{s.removeEventListener(e,a,{capture:i})}},[e,n,r,i])}function Er(e,t){return e===void 0?void 0:t}const yp=Math.PI;function gu(e){return e*yp/180}const dd=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),fd=(e,t,n,r,i)=>{switch(e){case"left":return Math.floor(t)+r+i/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-i/2}},hd=(e,t,n)=>Math.min(e,t-n*2),gd=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,js=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.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"}),f.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"}))},Cp=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function Sp(e,t,n){const[r,i]=f.useState(e),o=f.useRef(!0);f.useEffect(()=>()=>{o.current=!1},[]);const s=f.useRef(cd(a=>{o.current&&i(a)},n));return f.useLayoutEffect(()=>{o.current&&s.current(()=>e())},t),r}const xp="֑-߿יִ-﷽ﹰ-ﻼ",kp="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Mp=new RegExp("^[^"+kp+"]*["+xp+"]");function Ks(e){return Mp.test(e)?"rtl":"not-rtl"}let Wo;function Ts(){if(typeof document>"u")return 0;if(Wo!==void 0)return Wo;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(),Wo=n-r,Wo}const Ur=Symbol();function Rp(e){const t=f.useRef([Ur,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=f.useState(e),[,i]=f.useState(),o=f.useCallback(a=>{const l=t.current[0];l!==Ur&&(a=typeof a=="function"?a(l):a,a===l)||(l!==Ur&&i({}),r(u=>typeof a=="function"?a(l===Ur?u:l):a),t.current[0]=Ur)},[]),s=f.useCallback(()=>{t.current[0]=Ur,i({})},[]);return[t.current[0]===Ur?n:t.current[0],o,s]}function pd(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(", ")}function Ip(e){const t=f.useRef(e);return Mi(e,t.current)||(t.current=e),t.current}const Ep=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(a=>a!=="");if(o.length===0)return null;const s=o.length>1;return f.createElement(up,{"data-testid":"GDG-default-image-overlay-editor"},f.createElement(vp.Carousel,{showArrows:s,showThumbs:!1,swipeable:s,emulateTouch:s,infiniteLoop:s},o.map(a=>{const l=i?.(a)??f.createElement("img",{draggable:!1,src:a});return f.createElement("div",{className:"gdg-centering-container",key:a},l)})),n&&r&&f.createElement("button",{className:"gdg-edit-icon",onClick:r},f.createElement(js,null)))};function md(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Zr=md();function Tp(e){Zr=e}const vd=/[&<>"']/,Dp=new RegExp(vd.source,"g"),bd=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Op=new RegExp(bd.source,"g"),Pp={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},pu=e=>Pp[e];function bn(e,t){if(t){if(vd.test(e))return e.replace(Dp,pu)}else if(bd.test(e))return e.replace(Op,pu);return e}const Lp=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function wd(e){return e.replace(Lp,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const Fp=/(^|[^\[])\^/g;function Ht(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(Fp,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const _p=/[^\w:]/g,Ap=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function mu(e,t,n){if(e){let r;try{r=decodeURIComponent(wd(n)).replace(_p,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!Ap.test(n)&&(n=$p(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Uo={},Hp=/^[^:]+:\/*[^/]*$/,zp=/^([^:]+:)[\s\S]*$/,Vp=/^([^:]+:\/*[^/]*)[\s\S]*$/;function $p(e,t){Uo[" "+e]||(Hp.test(e)?Uo[" "+e]=e+"/":Uo[" "+e]=ta(e,"/",!0)),e=Uo[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(zp,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(Vp,"$1")+t:e+t}const ca={exec:function(){}};function vu(e,t){const n=e.replace(/\|/g,(o,s,a)=>{let l=!1,u=s;for(;--u>=0&&a[u]==="\\";)l=!l;return l?"|":" |"}),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function ta(e,t,n){const r=e.length;if(r===0)return"";let i=0;for(;i<r;){const o=e.charAt(r-i-1);if(o===t&&!n)i++;else if(o!==t&&n)i++;else break}return e.slice(0,r-i)}function Np(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let r=0,i=0;for(;i<n;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return-1}function Bp(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function bu(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function wu(e,t,n,r){const i=t.href,o=t.title?bn(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:i,title:o,text:bn(s)}}function Wp(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.DRTHOydk.js","./index.CD8HuT3N.js","../css/index.C8X8rNzw.css","./withFullScreenWrapper.DLp1ENGm.js","./Toolbar.DSnK1fUh.js","./FormClearHelper.DHh1GFzm.js","./sprintf.D7DtBTRn.js","./checkbox.D8W881TL.js","./createDownloadLinkElement.ZaXNnPK4.js","./toConsumableArray.D-Dx88BQ.js","./possibleConstructorReturn.DgiPnZ9N.js","./createSuper.B6W-Dh9S.js","./FileDownload.esm.DgBvV6Pq.js","./number-overlay-editor.DaRFzZEO.js","./es6.B8zRNPZ-.js"])))=>i.map(i=>d[i]);
2
+ import{r as f,E as Ws,_ as Ae,c7 as Dh,a5 as vr,bF as Ya,b0 as wo,b1 as Oh,c8 as Ph,c9 as Lh,ca as $c,cb as Nc,am as $t,cc as Fh,cd as Bc,ce as _h,cf as Ah,cg as Hh,ch as zh,ci as Vh,cj as $h,ab as Or,bd as Us,a4 as Nh,ck as Bh,m as ze,b3 as Wc,o as lt,cl as no,bs as Gr,cm as Wh,c4 as ja,j as He,cn as Uh,co as qh,v as nr,aA as rn,aP as Gh,cp as Bl,cq as Xh,cr as Yh,cs as jh,ct as Kh,cu as Uc,cv as Zh,cw as Jh,cx as Es,cy as qc,cz as Gc,cA as Qh,cB as eg,cC as tg,cD as ng,cE as rg,cF as ig,cG as og,cH as ag,cI as sg,cJ as Xc,cK as lg,cL as ug,cM as cg,cN as dg,cO as fg,aN as hg,aO as gg,cP as pg,cQ as mg,aM as vg,cR as bg,cS as wg,cT as yg,aL as Cg,u as Kr,cU as on,x as qs,cV as Sg,bM as ro,cW as ur,cX as Fe,a_ as xg,aa as Yc,cY as jc,a1 as kg,cZ as Mg,t as mi,c_ as Rg,c$ as Ig,aR as Ka,F as Kc,bK as xa,d0 as Zc,h as ka,e as vn,y as Jn,bI as Ma,d1 as Eg,bL as Jc,d2 as Tg,S as Dg,J as Wl,d3 as Og,d4 as Pg,L as Lg,d5 as Fg,d6 as Ul}from"./index.CD8HuT3N.js";import{w as _g,E as Ag}from"./withFullScreenWrapper.DLp1ENGm.js";import{T as Hg,a as gi}from"./Toolbar.DSnK1fUh.js";import{u as zg}from"./FormClearHelper.DHh1GFzm.js";import{s as Vg}from"./sprintf.D7DtBTRn.js";import{L as $g,a as Ng,S as Bg}from"./checkbox.D8W881TL.js";import{c as Wg}from"./createDownloadLinkElement.ZaXNnPK4.js";import{_ as gr,a as xi,C as Ug}from"./toConsumableArray.D-Dx88BQ.js";import{d as qg,f as Gg,e as Xg}from"./possibleConstructorReturn.DgiPnZ9N.js";import{_ as Yg}from"./createSuper.B6W-Dh9S.js";import{D as jg,F as Kg}from"./FileDownload.esm.DgBvV6Pq.js";var Qc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ws,Ae({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Qc.displayName="Add";var ed=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ws,Ae({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});ed.displayName="Search";var td=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ws,Ae({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M12 6a9.77 9.77 0 018.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0112 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 010 5 2.5 2.5 0 010-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}))});td.displayName="Visibility";var Za,ql;function Zg(){if(ql)return Za;ql=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return Za=n,Za}var Ja,Gl;function Jg(){if(Gl)return Ja;Gl=1;var e=Zg(),t=Dh();function n(r,i){return r!=null&&t(r,i,e)}return Ja=n,Ja}var Qg=Jg();const ep=vr(Qg);function nd(e="This should not happen"){throw new Error(e)}function zn(e,t="Assertion failed"){if(!e)return nd(t)}function co(e,t){return nd(t??"Hell froze over")}function tp(e,t){try{return e()}catch{return t}}const Xl=Object.prototype.hasOwnProperty;function Mi(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--&&Mi(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Xl.call(e,n)&&++r&&!Xl.call(t,n)||!(n in t)||!Mi(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const sa=null,Gs=void 0;var Z;(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"})(Z||(Z={}));var Yl;(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"})(Yl||(Yl={}));var la;(function(e){e.Triangle="triangle",e.Dots="dots"})(la||(la={}));function $o(e){return"width"in e&&typeof e.width=="number"}async function jl(e){return typeof e=="object"?e:await e()}function vi(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function yi(e){return e.kind===Xn.Marker||e.kind===Xn.NewRow}function bi(e){if(!vi(e)||e.kind===Z.Image)return!1;switch(e.kind){case Z.Text:case Z.Number:case Z.Markdown:case Z.Uri:case Z.Custom:case Z.Boolean:return e.readonly!==!0;default:co(e,"A cell was passed with an invalid kind")}}function np(e){return ep(e,"editor")}function Xs(e){return!(e.readonly??!1)}var Xn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Xn||(Xn={}));const ua={shape:"square",size:4,offsetX:-2,offsetY:-2,outline:0};function Qa(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,i){return r[0]-i[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const i=n[n.length-1];i[1]<r[0]?n.push([...r]):i[1]<r[1]&&(i[1]=r[1])}return n}let Kl;class Qe{items;constructor(t){this.items=t}static create=t=>new Qe(Qa(t));static empty=()=>Kl??(Kl=new Qe([]));static fromSingleSelection=t=>Qe.empty().add(t);static fromArray=t=>{if(t.length===0)return Qe.empty();const n=t.map(i=>[i,i+1]),r=Qa(n);return new Qe(r)};offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new Qe(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Qa([...this.items,n]);return new Qe(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],i=typeof t=="number"?t+1:t[1];for(const[o,s]of n.entries()){const[a,l]=s;if(a<=i&&r<=l){const u=[];a<r&&u.push([a,r]),i<l&&u.push([i,l]),n.splice(o,1,...u)}}return new Qe(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,i]=this.items[n];if(t>=r&&t<i)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],i=this.items[n];if(r[0]!==i[0]||r[1]!==i[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let i=n;i<r;i++)t.push(i);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}}var rp=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,l]=a.split("_");n[l]=a}else r.push(a)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},Zl=rp,ip=e=>e.toUpperCase()===e,op=e=>t=>e.indexOf(t)===-1,rd=(e,t)=>{const n={};return Object.keys(e).filter(op(t)).forEach(r=>{n[r]=e[r]}),n};function ap(e,t,n){const r=rd(t,n);if(!e){const i=typeof Ya=="function"?{default:Ya}:Ya;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var sp=(e,t)=>{};function lp(e){let t="";return n=>{const r=(o,s)=>{const{as:a=e,class:l=t}=o,u=n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&!ip(a[0])):n.propsAsIs,c=ap(u,o,["as","class"]);c.ref=s,c.className=n.atomic?Zl(n.class,c.className||l):Zl(c.className||l,n.class);const{vars:d}=n;if(d){const g={};for(const m in d){const y=d[m],b=y[0],v=y[1]||"",C=typeof b=="function"?b(o):b;sp(C,n.name),g[`--${m}`]=`${C}${v}`}const h=c.style||{},p=Object.keys(h);p.length>0&&p.forEach(m=>{g[m]=h[m]}),c.style=g}return e.__wyw_meta&&e!==a?(c.as=a,f.createElement(e,c)):f.createElement(a,c)},i=f.forwardRef?f.forwardRef(r):o=>{const s=rd(o,["innerRef"]);return r(s,o.innerRef)};return i.displayName=n.name,i.__wyw_meta={className:n.class||t,extends:e},i}}var sn=lp;const up=sn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var es={},Ui={},No={},Bo={},Jl;function cp(){return Jl||(Jl=1,function(e){(function(t,n){n(e,wo(),Oh())})(Bo,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=p;var i=s(n),o=s(r);function s(v){return v&&v.__esModule?v:{default:v}}var a=Object.assign||function(v){for(var C=1;C<arguments.length;C++){var E=arguments[C];for(var I in E)Object.prototype.hasOwnProperty.call(E,I)&&(v[I]=E[I])}return v};function l(v,C){var E={};for(var I in v)C.indexOf(I)>=0||Object.prototype.hasOwnProperty.call(v,I)&&(E[I]=v[I]);return E}function u(v,C){if(!(v instanceof C))throw new TypeError("Cannot call a class as a function")}var c=function(){function v(C,E){for(var I=0;I<E.length;I++){var R=E[I];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(C,R.key,R)}}return function(C,E,I){return E&&v(C.prototype,E),I&&v(C,I),C}}();function d(v,C){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:v}function g(v,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);v.prototype=Object.create(C&&C.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(v,C):v.__proto__=C)}var h=!1;function p(v){h=v}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){p(!0)}}))}catch{}function m(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return h?v:v.capture}function y(v){if("touches"in v){var C=v.touches[0],E=C.pageX,I=C.pageY;return{x:E,y:I}}var R=v.screenX,P=v.screenY;return{x:R,y:P}}var b=function(v){g(C,v);function C(){var E;u(this,C);for(var I=arguments.length,R=Array(I),P=0;P<I;P++)R[P]=arguments[P];var x=d(this,(E=C.__proto__||Object.getPrototypeOf(C)).call.apply(E,[this].concat(R)));return x._handleSwipeStart=x._handleSwipeStart.bind(x),x._handleSwipeMove=x._handleSwipeMove.bind(x),x._handleSwipeEnd=x._handleSwipeEnd.bind(x),x._onMouseDown=x._onMouseDown.bind(x),x._onMouseMove=x._onMouseMove.bind(x),x._onMouseUp=x._onMouseUp.bind(x),x._setSwiperRef=x._setSwiperRef.bind(x),x}return c(C,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(I){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(I))}},{key:"_onMouseMove",value:function(I){this.mouseDown&&this._handleSwipeMove(I)}},{key:"_onMouseUp",value:function(I){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(I)}},{key:"_handleSwipeStart",value:function(I){var R=y(I),P=R.x,x=R.y;this.moveStart={x:P,y:x},this.props.onSwipeStart(I)}},{key:"_handleSwipeMove",value:function(I){if(this.moveStart){var R=y(I),P=R.x,x=R.y,S=P-this.moveStart.x,F=x-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x:S,y:F},I);D&&I.cancelable&&I.preventDefault(),this.movePosition={deltaX:S,deltaY:F}}}},{key:"_handleSwipeEnd",value:function(I){this.props.onSwipeEnd(I);var R=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-R?this.props.onSwipeLeft(1,I):this.movePosition.deltaX>R&&this.props.onSwipeRight(1,I),this.movePosition.deltaY<-R?this.props.onSwipeUp(1,I):this.movePosition.deltaY>R&&this.props.onSwipeDown(1,I)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(I){this.swiper=I,this.props.innerRef(I)}},{key:"render",value:function(){var I=this.props;I.tagName;var R=I.className,P=I.style,x=I.children;I.allowMouseEvents,I.onSwipeUp,I.onSwipeDown,I.onSwipeLeft,I.onSwipeRight,I.onSwipeStart,I.onSwipeMove,I.onSwipeEnd,I.innerRef,I.tolerance;var S=l(I,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,a({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:R,style:P},S),x)}}]),C}(n.Component);b.displayName="ReactSwipe",b.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},b.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=b})}(Bo)),Bo}var Ql;function id(){return Ql||(Ql=1,function(e){(function(t,n){n(e,cp())})(No,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=i(n);function i(o){return o&&o.__esModule?o:{default:o}}t.default=r.default})}(No)),No}var qi={},eu;function od(){if(eu)return qi;eu=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.default=void 0;var e=t(Ph());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,s){return o in i?Object.defineProperty(i,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[o]=s,i}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,s){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":s==="horizontal","axis-vertical":s!=="horizontal"})},SLIDER:function(o,s){return(0,e.default)({thumbs:!o,slider:o,animated:!s})},ITEM:function(o,s,a){return(0,e.default)({thumb:!o,slide:o,selected:s,previous:a})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return qi.default=r,qi}var Gi={},Xi={},tu;function dp(){if(tu)return Xi;tu=1,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return Xi.outerWidth=e,Xi}var Yi={},nu;function Ys(){if(nu)return Yi;nu=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,s=i==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",l="("+s.join(",")+")";return a+l};return Yi.default=e,Yi}var ji={},ru;function ad(){if(ru)return ji;ru=1,Object.defineProperty(ji,"__esModule",{value:!0}),ji.default=void 0;var e=function(){return window};return ji.default=e,ji}var iu;function sd(){if(iu)return Gi;iu=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.default=void 0;var e=l(wo()),t=s(od()),n=dp(),r=s(Ys()),i=s(id()),o=s(ad());function s(x){return x&&x.__esModule?x:{default:x}}function a(){if(typeof WeakMap!="function")return null;var x=new WeakMap;return a=function(){return x},x}function l(x){if(x&&x.__esModule)return x;if(x===null||u(x)!=="object"&&typeof x!="function")return{default:x};var S=a();if(S&&S.has(x))return S.get(x);var F={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var M in x)if(Object.prototype.hasOwnProperty.call(x,M)){var T=D?Object.getOwnPropertyDescriptor(x,M):null;T&&(T.get||T.set)?Object.defineProperty(F,M,T):F[M]=x[M]}return F.default=x,S&&S.set(x,F),F}function u(x){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(F){return typeof F}:u=function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},u(x)}function c(){return c=Object.assign||function(x){for(var S=1;S<arguments.length;S++){var F=arguments[S];for(var D in F)Object.prototype.hasOwnProperty.call(F,D)&&(x[D]=F[D])}return x},c.apply(this,arguments)}function d(x,S){if(!(x instanceof S))throw new TypeError("Cannot call a class as a function")}function g(x,S){for(var F=0;F<S.length;F++){var D=S[F];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(x,D.key,D)}}function h(x,S,F){return S&&g(x.prototype,S),x}function p(x,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function");x.prototype=Object.create(S&&S.prototype,{constructor:{value:x,writable:!0,configurable:!0}}),S&&m(x,S)}function m(x,S){return m=Object.setPrototypeOf||function(D,M){return D.__proto__=M,D},m(x,S)}function y(x){var S=C();return function(){var D=E(x),M;if(S){var T=E(this).constructor;M=Reflect.construct(D,arguments,T)}else M=D.apply(this,arguments);return b(this,M)}}function b(x,S){return S&&(u(S)==="object"||typeof S=="function")?S:v(x)}function v(x){if(x===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x}function C(){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}}function E(x){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(F){return F.__proto__||Object.getPrototypeOf(F)},E(x)}function I(x,S,F){return S in x?Object.defineProperty(x,S,{value:F,enumerable:!0,configurable:!0,writable:!0}):x[S]=F,x}var R=function(S){return S.hasOwnProperty("key")},P=function(x){p(F,x);var S=y(F);function F(D){var M;return d(this,F),M=S.call(this,D),I(v(M),"itemsWrapperRef",void 0),I(v(M),"itemsListRef",void 0),I(v(M),"thumbsRef",void 0),I(v(M),"setItemsWrapperRef",function(T){M.itemsWrapperRef=T}),I(v(M),"setItemsListRef",function(T){M.itemsListRef=T}),I(v(M),"setThumbsRef",function(T,O){M.thumbsRef||(M.thumbsRef=[]),M.thumbsRef[O]=T}),I(v(M),"updateSizes",function(){if(!(!M.props.children||!M.itemsWrapperRef||!M.thumbsRef)){var T=e.Children.count(M.props.children),O=M.itemsWrapperRef.clientWidth,k=M.props.thumbWidth?M.props.thumbWidth:(0,n.outerWidth)(M.thumbsRef[0]),$=Math.floor(O/k),G=$<T,j=G?T-$:0;M.setState(function(ue,Q){return{itemSize:k,visibleItems:$,firstItem:G?M.getFirstItem(Q.selectedItem):0,lastPosition:j,showArrows:G}})}}),I(v(M),"handleClickItem",function(T,O,k){if(!R(k)||k.key==="Enter"){var $=M.props.onSelectItem;typeof $=="function"&&$(T,O)}}),I(v(M),"onSwipeStart",function(){M.setState({swiping:!0})}),I(v(M),"onSwipeEnd",function(){M.setState({swiping:!1})}),I(v(M),"onSwipeMove",function(T){var O=T.x;if(!M.state.itemSize||!M.itemsWrapperRef||!M.state.visibleItems)return!1;var k=0,$=e.Children.count(M.props.children),G=-(M.state.firstItem*100)/M.state.visibleItems,j=Math.max($-M.state.visibleItems,0),ue=-j*100/M.state.visibleItems;G===k&&O>0&&(O=0),G===ue&&O<0&&(O=0);var Q=M.itemsWrapperRef.clientWidth,ee=G+100/(Q/O);return M.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(ce){M.itemsListRef.style[ce]=(0,r.default)(ee,"%",M.props.axis)}),!0}),I(v(M),"slideRight",function(T){M.moveTo(M.state.firstItem-(typeof T=="number"?T:1))}),I(v(M),"slideLeft",function(T){M.moveTo(M.state.firstItem+(typeof T=="number"?T:1))}),I(v(M),"moveTo",function(T){T=T<0?0:T,T=T>=M.state.lastPosition?M.state.lastPosition:T,M.setState({firstItem:T})}),M.state={selectedItem:D.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},M}return h(F,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(M){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==M.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(M){var T=M;return M>=this.state.lastPosition&&(T=this.state.lastPosition),M<this.state.firstItem+this.state.visibleItems&&(T=this.state.firstItem),M<this.state.firstItem&&(T=M),T}},{key:"renderItems",value:function(){var M=this;return this.props.children.map(function(T,O){var k=t.default.ITEM(!1,O===M.state.selectedItem),$={key:O,ref:function(j){return M.setThumbsRef(j,O)},className:k,onClick:M.handleClickItem.bind(M,O,M.props.children[O]),onKeyDown:M.handleClickItem.bind(M,O,M.props.children[O]),"aria-label":"".concat(M.props.labels.item," ").concat(O+1),style:{width:M.props.thumbWidth}};return e.default.createElement("li",c({},$,{role:"button",tabIndex:0}),T)})}},{key:"render",value:function(){var M=this;if(!this.props.children)return null;var T=e.Children.count(this.props.children)>1,O=this.state.showArrows&&this.state.firstItem>0,k=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,$={},G=-this.state.firstItem*(this.state.itemSize||0),j=(0,r.default)(G,"px",this.props.axis),ue=this.props.transitionTime+"ms";return $={WebkitTransform:j,MozTransform:j,MsTransform:j,OTransform:j,transform:j,msTransform:j,WebkitTransitionDuration:ue,MozTransitionDuration:ue,MsTransitionDuration:ue,OTransitionDuration:ue,transitionDuration:ue,msTransitionDuration:ue},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(!O),onClick:function(){return M.slideRight()},"aria-label":this.props.labels.leftArrow}),T?e.default.createElement(i.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:$,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(ee){return M.setItemsListRef(ee)},style:$},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!k),onClick:function(){return M.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),F}(e.Component);return Gi.default=P,I(P,"displayName","Thumbs"),I(P,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Gi}var Ki={},ou;function fp(){if(ou)return Ki;ou=1,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.default=void 0;var e=function(){return document};return Ki.default=e,Ki}var Hn={},au;function ld(){if(au)return Hn;au=1,Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.setPosition=Hn.getPosition=Hn.isKeyboardEvent=Hn.defaultStatusFormatter=Hn.noop=void 0;var e=wo(),t=n(Ys());function n(l){return l&&l.__esModule?l:{default:l}}var r=function(){};Hn.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};Hn.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};Hn.isKeyboardEvent=o;var s=function(u,c){if(c.infiniteLoop&&++u,u===0)return 0;var d=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var g=-u*c.centerSlidePercentage,h=d-1;return u&&(u!==h||c.infiniteLoop)?g+=(100-c.centerSlidePercentage)/2:u===h&&(g+=100-c.centerSlidePercentage),g}return-u*100};Hn.getPosition=s;var a=function(u,c){var d={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){d[g]=(0,t.default)(u,"%",c)}),d};return Hn.setPosition=a,Hn}var Zn={},su;function hp(){if(su)return Zn;su=1,Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.fadeAnimationHandler=Zn.slideStopSwipingHandler=Zn.slideSwipeAnimationHandler=Zn.slideAnimationHandler=void 0;var e=wo(),t=r(Ys()),n=ld();function r(d){return d&&d.__esModule?d:{default:d}}function i(d,g){var h=Object.keys(d);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(d);g&&(p=p.filter(function(m){return Object.getOwnPropertyDescriptor(d,m).enumerable})),h.push.apply(h,p)}return h}function o(d){for(var g=1;g<arguments.length;g++){var h=arguments[g]!=null?arguments[g]:{};g%2?i(Object(h),!0).forEach(function(p){s(d,p,h[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(p){Object.defineProperty(d,p,Object.getOwnPropertyDescriptor(h,p))})}return d}function s(d,g,h){return g in d?Object.defineProperty(d,g,{value:h,enumerable:!0,configurable:!0,writable:!0}):d[g]=h,d}var a=function(g,h){var p={},m=h.selectedItem,y=m,b=e.Children.count(g.children)-1,v=g.infiniteLoop&&(m<0||m>b);if(v)return y<0?g.centerMode&&g.centerSlidePercentage&&g.axis==="horizontal"?p.itemListStyle=(0,n.setPosition)(-(b+2)*g.centerSlidePercentage-(100-g.centerSlidePercentage)/2,g.axis):p.itemListStyle=(0,n.setPosition)(-(b+2)*100,g.axis):y>b&&(p.itemListStyle=(0,n.setPosition)(0,g.axis)),p;var C=(0,n.getPosition)(m,g),E=(0,t.default)(C,"%",g.axis),I=g.transitionTime+"ms";return p.itemListStyle={WebkitTransform:E,msTransform:E,OTransform:E,transform:E},h.swiping||(p.itemListStyle=o(o({},p.itemListStyle),{},{WebkitTransitionDuration:I,MozTransitionDuration:I,OTransitionDuration:I,transitionDuration:I,msTransitionDuration:I})),p};Zn.slideAnimationHandler=a;var l=function(g,h,p,m){var y={},b=h.axis==="horizontal",v=e.Children.count(h.children),C=0,E=(0,n.getPosition)(p.selectedItem,h),I=h.infiniteLoop?(0,n.getPosition)(v-1,h)-100:(0,n.getPosition)(v-1,h),R=b?g.x:g.y,P=R;E===C&&R>0&&(P=0),E===I&&R<0&&(P=0);var x=E+100/(p.itemSize/P),S=Math.abs(R)>h.swipeScrollTolerance;return h.infiniteLoop&&S&&(p.selectedItem===0&&x>-100?x-=v*100:p.selectedItem===v-1&&x<-v*100&&(x+=v*100)),(!h.preventMovementUntilSwipeScrollTolerance||S||p.swipeMovementStarted)&&(p.swipeMovementStarted||m({swipeMovementStarted:!0}),y.itemListStyle=(0,n.setPosition)(x,h.axis)),S&&!p.cancelClick&&m({cancelClick:!0}),y};Zn.slideSwipeAnimationHandler=l;var u=function(g,h){var p=(0,n.getPosition)(h.selectedItem,g),m=(0,n.setPosition)(p,g.axis);return{itemListStyle:m}};Zn.slideStopSwipingHandler=u;var c=function(g,h){var p=g.transitionTime+"ms",m="ease-in-out",y={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:m,msTransitionTimingFunction:m,MozTransitionTimingFunction:m,WebkitTransitionTimingFunction:m,OTransitionTimingFunction:m};return h.swiping||(y=o(o({},y),{},{WebkitTransitionDuration:p,MozTransitionDuration:p,OTransitionDuration:p,transitionDuration:p,msTransitionDuration:p})),{slideStyle:y,selectedStyle:o(o({},y),{},{opacity:1,position:"relative"}),prevStyle:o({},y)}};return Zn.fadeAnimationHandler=c,Zn}var lu;function gp(){if(lu)return Ui;lu=1,Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.default=void 0;var e=c(wo()),t=l(id()),n=l(od()),r=l(sd()),i=l(fp()),o=l(ad()),s=ld(),a=hp();function l(D){return D&&D.__esModule?D:{default:D}}function u(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return u=function(){return D},D}function c(D){if(D&&D.__esModule)return D;if(D===null||d(D)!=="object"&&typeof D!="function")return{default:D};var M=u();if(M&&M.has(D))return M.get(D);var T={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var k in D)if(Object.prototype.hasOwnProperty.call(D,k)){var $=O?Object.getOwnPropertyDescriptor(D,k):null;$&&($.get||$.set)?Object.defineProperty(T,k,$):T[k]=D[k]}return T.default=D,M&&M.set(D,T),T}function d(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(T){return typeof T}:d=function(T){return T&&typeof Symbol=="function"&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T},d(D)}function g(){return g=Object.assign||function(D){for(var M=1;M<arguments.length;M++){var T=arguments[M];for(var O in T)Object.prototype.hasOwnProperty.call(T,O)&&(D[O]=T[O])}return D},g.apply(this,arguments)}function h(D,M){var T=Object.keys(D);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(D);M&&(O=O.filter(function(k){return Object.getOwnPropertyDescriptor(D,k).enumerable})),T.push.apply(T,O)}return T}function p(D){for(var M=1;M<arguments.length;M++){var T=arguments[M]!=null?arguments[M]:{};M%2?h(Object(T),!0).forEach(function(O){S(D,O,T[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(T)):h(Object(T)).forEach(function(O){Object.defineProperty(D,O,Object.getOwnPropertyDescriptor(T,O))})}return D}function m(D,M){if(!(D instanceof M))throw new TypeError("Cannot call a class as a function")}function y(D,M){for(var T=0;T<M.length;T++){var O=M[T];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(D,O.key,O)}}function b(D,M,T){return M&&y(D.prototype,M),D}function v(D,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(M&&M.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),M&&C(D,M)}function C(D,M){return C=Object.setPrototypeOf||function(O,k){return O.__proto__=k,O},C(D,M)}function E(D){var M=P();return function(){var O=x(D),k;if(M){var $=x(this).constructor;k=Reflect.construct(O,arguments,$)}else k=O.apply(this,arguments);return I(this,k)}}function I(D,M){return M&&(d(M)==="object"||typeof M=="function")?M:R(D)}function R(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function P(){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}}function x(D){return x=Object.setPrototypeOf?Object.getPrototypeOf:function(T){return T.__proto__||Object.getPrototypeOf(T)},x(D)}function S(D,M,T){return M in D?Object.defineProperty(D,M,{value:T,enumerable:!0,configurable:!0,writable:!0}):D[M]=T,D}var F=function(D){v(T,D);var M=E(T);function T(O){var k;m(this,T),k=M.call(this,O),S(R(k),"thumbsRef",void 0),S(R(k),"carouselWrapperRef",void 0),S(R(k),"listRef",void 0),S(R(k),"itemsRef",void 0),S(R(k),"timer",void 0),S(R(k),"animationHandler",void 0),S(R(k),"setThumbsRef",function(G){k.thumbsRef=G}),S(R(k),"setCarouselWrapperRef",function(G){k.carouselWrapperRef=G}),S(R(k),"setListRef",function(G){k.listRef=G}),S(R(k),"setItemsRef",function(G,j){k.itemsRef||(k.itemsRef=[]),k.itemsRef[j]=G}),S(R(k),"autoPlay",function(){e.Children.count(k.props.children)<=1||(k.clearAutoPlay(),k.props.autoPlay&&(k.timer=setTimeout(function(){k.increment()},k.props.interval)))}),S(R(k),"clearAutoPlay",function(){k.timer&&clearTimeout(k.timer)}),S(R(k),"resetAutoPlay",function(){k.clearAutoPlay(),k.autoPlay()}),S(R(k),"stopOnHover",function(){k.setState({isMouseEntered:!0},k.clearAutoPlay)}),S(R(k),"startOnLeave",function(){k.setState({isMouseEntered:!1},k.autoPlay)}),S(R(k),"isFocusWithinTheCarousel",function(){return k.carouselWrapperRef?!!((0,i.default)().activeElement===k.carouselWrapperRef||k.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),S(R(k),"navigateWithKeyboard",function(G){if(k.isFocusWithinTheCarousel()){var j=k.props.axis,ue=j==="horizontal",Q={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},ee=ue?Q.ArrowRight:Q.ArrowDown,ce=ue?Q.ArrowLeft:Q.ArrowUp;ee===G.keyCode?k.increment():ce===G.keyCode&&k.decrement()}}),S(R(k),"updateSizes",function(){if(!(!k.state.initialized||!k.itemsRef||k.itemsRef.length===0)){var G=k.props.axis==="horizontal",j=k.itemsRef[0];if(j){var ue=G?j.clientWidth:j.clientHeight;k.setState({itemSize:ue}),k.thumbsRef&&k.thumbsRef.updateSizes()}}}),S(R(k),"setMountState",function(){k.setState({hasMount:!0}),k.updateSizes()}),S(R(k),"handleClickItem",function(G,j){if(e.Children.count(k.props.children)!==0){if(k.state.cancelClick){k.setState({cancelClick:!1});return}k.props.onClickItem(G,j),G!==k.state.selectedItem&&k.setState({selectedItem:G})}}),S(R(k),"handleOnChange",function(G,j){e.Children.count(k.props.children)<=1||k.props.onChange(G,j)}),S(R(k),"handleClickThumb",function(G,j){k.props.onClickThumb(G,j),k.moveTo(G)}),S(R(k),"onSwipeStart",function(G){k.setState({swiping:!0}),k.props.onSwipeStart(G)}),S(R(k),"onSwipeEnd",function(G){k.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),k.props.onSwipeEnd(G),k.clearAutoPlay(),k.state.autoPlay&&k.autoPlay()}),S(R(k),"onSwipeMove",function(G,j){k.props.onSwipeMove(j);var ue=k.props.swipeAnimationHandler(G,k.props,k.state,k.setState.bind(R(k)));return k.setState(p({},ue)),!!Object.keys(ue).length}),S(R(k),"decrement",function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem-(typeof G=="number"?G:1))}),S(R(k),"increment",function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem+(typeof G=="number"?G:1))}),S(R(k),"moveTo",function(G){if(typeof G=="number"){var j=e.Children.count(k.props.children)-1;G<0&&(G=k.props.infiniteLoop?j:0),G>j&&(G=k.props.infiniteLoop?0:j),k.selectItem({selectedItem:G}),k.state.autoPlay&&k.state.isMouseEntered===!1&&k.resetAutoPlay()}}),S(R(k),"onClickNext",function(){k.increment(1)}),S(R(k),"onClickPrev",function(){k.decrement(1)}),S(R(k),"onSwipeForward",function(){k.increment(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),S(R(k),"onSwipeBackwards",function(){k.decrement(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),S(R(k),"changeItem",function(G){return function(j){(!(0,s.isKeyboardEvent)(j)||j.key==="Enter")&&k.moveTo(G)}}),S(R(k),"selectItem",function(G){k.setState(p({previousItem:k.state.selectedItem},G),function(){k.setState(k.animationHandler(k.props,k.state))}),k.handleOnChange(G.selectedItem,e.Children.toArray(k.props.children)[G.selectedItem])}),S(R(k),"getInitialImage",function(){var G=k.props.selectedItem,j=k.itemsRef&&k.itemsRef[G],ue=j&&j.getElementsByTagName("img")||[];return ue[0]}),S(R(k),"getVariableItemHeight",function(G){var j=k.itemsRef&&k.itemsRef[G];if(k.state.hasMount&&j&&j.children.length){var ue=j.children[0].getElementsByTagName("img")||[];if(ue.length>0){var Q=ue[0];if(!Q.complete){var ee=function ge(){k.forceUpdate(),Q.removeEventListener("load",ge)};Q.addEventListener("load",ee)}}var ce=ue[0]||j.children[0],ae=ce.clientHeight;return ae>0?ae:null}return null});var $={initialized:!1,previousItem:O.selectedItem,selectedItem:O.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:O.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return k.animationHandler=typeof O.animationHandler=="function"&&O.animationHandler||O.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,k.state=p(p({},$),k.animationHandler(O,$)),k}return b(T,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(k,$){!k.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!k.autoFocus&&this.props.autoFocus&&this.forceFocus(),$.swiping&&!this.state.swiping&&this.setState(p({},this.props.stopSwipingHandler(this.props,this.state))),(k.selectedItem!==this.props.selectedItem||k.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),k.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 k=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 $=k.getInitialImage();$&&!$.complete?$.addEventListener("load",k.setMountState):k.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.addEventListener("mouseenter",this.stopOnHover),k.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.removeEventListener("mouseenter",this.stopOnHover),k.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,i.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var k=this.getInitialImage();k&&k.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var k;(k=this.carouselWrapperRef)===null||k===void 0||k.focus()}},{key:"renderItems",value:function(k){var $=this;return this.props.children?e.Children.map(this.props.children,function(G,j){var ue=j===$.state.selectedItem,Q=j===$.state.previousItem,ee=ue&&$.state.selectedStyle||Q&&$.state.prevStyle||$.state.slideStyle||{};$.props.centerMode&&$.props.axis==="horizontal"&&(ee=p(p({},ee),{},{minWidth:$.props.centerSlidePercentage+"%"})),$.state.swiping&&$.state.swipeMovementStarted&&(ee=p(p({},ee),{},{pointerEvents:"none"}));var ce={ref:function(ge){return $.setItemsRef(ge,j)},key:"itemKey"+j+(k?"clone":""),className:n.default.ITEM(!0,j===$.state.selectedItem,j===$.state.previousItem),onClick:$.handleClickItem.bind($,j,G),style:ee};return e.default.createElement("li",ce,$.props.renderItem(G,{isSelected:j===$.state.selectedItem,isPrevious:j===$.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var k=this,$=this.props,G=$.showIndicators,j=$.labels,ue=$.renderIndicator,Q=$.children;return G?e.default.createElement("ul",{className:"control-dots"},e.Children.map(Q,function(ee,ce){return ue&&ue(k.changeItem(ce),ce===k.state.selectedItem,ce,j.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?null: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))}},{key:"render",value:function(){var k=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var $=this.props.swipeable&&e.Children.count(this.props.children)>1,G=this.props.axis==="horizontal",j=this.props.showArrows&&e.Children.count(this.props.children)>1,ue=j&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,Q=j&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,ee=this.renderItems(!0),ce=ee.shift(),ae=ee.pop(),ge={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},de={};if(G){if(ge.onSwipeLeft=this.onSwipeForward,ge.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var re=this.getVariableItemHeight(this.state.selectedItem);de.height=re||"auto"}}else ge.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,ge.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,ge.style=p(p({},ge.style),{},{height:this.state.itemSize}),de.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,ue,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:de},$?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},ge,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&ae,this.renderItems(),this.props.infiniteLoop&&ce):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(L){return k.setListRef(L)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&ae,this.renderItems(),this.props.infiniteLoop&&ce)),this.props.renderArrowNext(this.onClickNext,Q,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),T}(e.default.Component);return Ui.default=F,S(F,"displayName","Carousel"),S(F,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:s.noop,onClickThumb:s.noop,onChange:s.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(M,T,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_PREV(!T),onClick:M})},renderArrowNext:function(M,T,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_NEXT(!T),onClick:M})},renderIndicator:function(M,T,O,k){return e.default.createElement("li",{className:n.default.DOT(T),onClick:M,onKeyDown:M,value:O,key:O,role:"button",tabIndex:0,"aria-label":"".concat(k," ").concat(O+1)})},renderItem:function(M){return M},renderThumbs:function(M){var T=e.Children.map(M,function(O){var k=O;if(O.type!=="img"&&(k=e.Children.toArray(O.props.children).find(function($){return $.type==="img"})),!!k)return k});return T.filter(function(O){return O}).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"),[]):T},statusFormatter:s.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}),Ui}var uu={},cu;function pp(){return cu||(cu=1),uu}var du;function mp(){return du||(du=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=i(gp()),n=pp(),r=i(sd());function i(o){return o&&o.__esModule?o:{default:o}}}(es)),es}var vp=mp(),ts,fu;function bp(){if(fu)return ts;fu=1;var e=Lh(),t=function(){return e.Date.now()};return ts=t,ts}var ns,hu;function ud(){if(hu)return ns;hu=1;var e=$c(),t=bp(),n=Nc(),r="Expected a function",i=Math.max,o=Math.min;function s(a,l,u){var c,d,g,h,p,m,y=0,b=!1,v=!1,C=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,e(u)&&(b=!!u.leading,v="maxWait"in u,g=v?i(n(u.maxWait)||0,l):g,C="trailing"in u?!!u.trailing:C);function E(T){var O=c,k=d;return c=d=void 0,y=T,h=a.apply(k,O),h}function I(T){return y=T,p=setTimeout(x,l),b?E(T):h}function R(T){var O=T-m,k=T-y,$=l-O;return v?o($,g-k):$}function P(T){var O=T-m,k=T-y;return m===void 0||O>=l||O<0||v&&k>=g}function x(){var T=t();if(P(T))return S(T);p=setTimeout(x,R(T))}function S(T){return p=void 0,C&&c?E(T):(c=d=void 0,h)}function F(){p!==void 0&&clearTimeout(p),y=0,c=m=d=p=void 0}function D(){return p===void 0?h:S(t())}function M(){var T=t(),O=P(T);if(c=arguments,d=this,m=T,O){if(p===void 0)return I(m);if(v)return clearTimeout(p),p=setTimeout(x,l),E(m)}return p===void 0&&(p=setTimeout(x,l)),h}return M.cancel=F,M.flush=D,M}return ns=s,ns}var wp=ud();const cd=vr(wp);function xn(e,t,n,r,i=!1){const o=f.useRef();o.current=t,f.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const s=n,a=l=>{o.current?.call(s,l)};return s.addEventListener(e,a,{passive:r,capture:i}),()=>{s.removeEventListener(e,a,{capture:i})}},[e,n,r,i])}function Er(e,t){return e===void 0?void 0:t}const yp=Math.PI;function gu(e){return e*yp/180}const dd=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),fd=(e,t,n,r,i)=>{switch(e){case"left":return Math.floor(t)+r+i/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-i/2}},hd=(e,t,n)=>Math.min(e,t-n*2),gd=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,js=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.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"}),f.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"}))},Cp=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function Sp(e,t,n){const[r,i]=f.useState(e),o=f.useRef(!0);f.useEffect(()=>()=>{o.current=!1},[]);const s=f.useRef(cd(a=>{o.current&&i(a)},n));return f.useLayoutEffect(()=>{o.current&&s.current(()=>e())},t),r}const xp="֑-߿יִ-﷽ﹰ-ﻼ",kp="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Mp=new RegExp("^[^"+kp+"]*["+xp+"]");function Ks(e){return Mp.test(e)?"rtl":"not-rtl"}let Wo;function Ts(){if(typeof document>"u")return 0;if(Wo!==void 0)return Wo;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(),Wo=n-r,Wo}const Ur=Symbol();function Rp(e){const t=f.useRef([Ur,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=f.useState(e),[,i]=f.useState(),o=f.useCallback(a=>{const l=t.current[0];l!==Ur&&(a=typeof a=="function"?a(l):a,a===l)||(l!==Ur&&i({}),r(u=>typeof a=="function"?a(l===Ur?u:l):a),t.current[0]=Ur)},[]),s=f.useCallback(()=>{t.current[0]=Ur,i({})},[]);return[t.current[0]===Ur?n:t.current[0],o,s]}function pd(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(", ")}function Ip(e){const t=f.useRef(e);return Mi(e,t.current)||(t.current=e),t.current}const Ep=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(a=>a!=="");if(o.length===0)return null;const s=o.length>1;return f.createElement(up,{"data-testid":"GDG-default-image-overlay-editor"},f.createElement(vp.Carousel,{showArrows:s,showThumbs:!1,swipeable:s,emulateTouch:s,infiniteLoop:s},o.map(a=>{const l=i?.(a)??f.createElement("img",{draggable:!1,src:a});return f.createElement("div",{className:"gdg-centering-container",key:a},l)})),n&&r&&f.createElement("button",{className:"gdg-edit-icon",onClick:r},f.createElement(js,null)))};function md(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Zr=md();function Tp(e){Zr=e}const vd=/[&<>"']/,Dp=new RegExp(vd.source,"g"),bd=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Op=new RegExp(bd.source,"g"),Pp={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},pu=e=>Pp[e];function bn(e,t){if(t){if(vd.test(e))return e.replace(Dp,pu)}else if(bd.test(e))return e.replace(Op,pu);return e}const Lp=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function wd(e){return e.replace(Lp,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const Fp=/(^|[^\[])\^/g;function Ht(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(Fp,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const _p=/[^\w:]/g,Ap=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function mu(e,t,n){if(e){let r;try{r=decodeURIComponent(wd(n)).replace(_p,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!Ap.test(n)&&(n=$p(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Uo={},Hp=/^[^:]+:\/*[^/]*$/,zp=/^([^:]+:)[\s\S]*$/,Vp=/^([^:]+:\/*[^/]*)[\s\S]*$/;function $p(e,t){Uo[" "+e]||(Hp.test(e)?Uo[" "+e]=e+"/":Uo[" "+e]=ta(e,"/",!0)),e=Uo[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(zp,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(Vp,"$1")+t:e+t}const ca={exec:function(){}};function vu(e,t){const n=e.replace(/\|/g,(o,s,a)=>{let l=!1,u=s;for(;--u>=0&&a[u]==="\\";)l=!l;return l?"|":" |"}),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function ta(e,t,n){const r=e.length;if(r===0)return"";let i=0;for(;i<r;){const o=e.charAt(r-i-1);if(o===t&&!n)i++;else if(o!==t&&n)i++;else break}return e.slice(0,r-i)}function Np(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let r=0,i=0;for(;i<n;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return-1}function Bp(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function bu(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function wu(e,t,n,r){const i=t.href,o=t.title?bn(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:i,title:o,text:bn(s)}}function Wp(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
3
3
  `).map(i=>{const o=i.match(/^\s+/);if(o===null)return i;const[s]=o;return s.length>=r.length?i.slice(r.length):i}).join(`
4
4
  `)}class Zs{constructor(t){this.options=t||Zr}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:ta(r,`
5
5
  `)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],i=Wp(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:i}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){const i=ta(r,"#");(this.options.pedantic||!i||/ $/.test(i))&&(r=i.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const r=n[0].replace(/^ *>[ \t]?/gm,""),i=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(r);return this.lexer.state.top=i,{type:"blockquote",raw:n[0],tokens:o,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r,i,o,s,a,l,u,c,d,g,h,p,m=n[1].trim();const y=m.length>1,b={type:"list",raw:"",ordered:y,start:y?+m.slice(0,-1):"",loose:!1,items:[]};m=y?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=y?m:"[*+-]");const v=new RegExp(`^( {0,3}${m})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(p=!1,!(!(n=v.exec(t))||this.rules.block.hr.test(t)));){if(r=n[0],t=t.substring(r.length),c=n[2].split(`
@@ -169,10 +169,10 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
169
169
  `?(r.push(e.slice(i,s)),i=s+1,a===`
170
170
  `&&(n.push(r),r=[])):a==='"'&&(o=t.inString);break;case t.inString:a==='"'&&(o=t.inStringPostQuote);break;case t.inStringPostQuote:a==='"'?o=t.inString:((a===" "||a===`
171
171
  `)&&(r.push(Wu(e.slice(i,s))),i=s+1,a===`
172
- `&&(n.push(r),r=[])),o=t.None);break}s++}return i<e.length&&r.push(Wu(e.slice(i,e.length))),n.push(r),n.map(a=>a.map(l=>({rawValue:l,formatted:l,format:"string"})))}function Uu(e,t,n){const r=lv(e,t),i=a=>{window.navigator.clipboard?.writeText(a)},o=(a,l)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([a],{type:"text/plain"}),"text/html":new Blob([l],{type:"text/html"})})]),!0),s=(a,l)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",a),n?.clipboardData?.setData("text/html",l)}catch{o(a,l)||i(a)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?s(r.textPlain,r.textHtml):i(r.textPlain),n?.preventDefault()}function Yd(e){return e!==!0}function qu(e){return typeof e=="string"?e:`${e}px`}const dv=()=>e=>e.innerWidth,fv=()=>e=>e.innerHeight,hv=sn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[dv()],"wmyidgi-1":[fv()]}}),gv=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return f.createElement(hv,{innerHeight:qu(n),innerWidth:qu(t),...i},r)},pv=2,mv=1300;function vv(e,t,n){const r=$t.useRef(0),[i,o]=e??[0,0];$t.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let s=!1,a=0;const l=u=>{if(!s){if(a===0)a=u;else{const c=u-a;r.current=Math.min(1,r.current+c/mv);const d=r.current**1.618*c*pv;t.current?.scrollBy(i*d,o*d),a=u,n?.()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{s=!0}},[t,i,o,n])}function bv({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:s,remSize:a}){const[l,u,c,d,g,h]=$t.useMemo(()=>{if(!s||a===16)return[e,t,n,r,i,o];const p=a/16,m=e,y=Pd();return[typeof m=="number"?m*p:b=>Math.ceil(m(b)*p),Math.ceil(t*p),Math.ceil(n*p),{...r,headerIconSize:(r?.headerIconSize??y.headerIconSize)*p,cellHorizontalPadding:(r?.cellHorizontalPadding??y.cellHorizontalPadding)*p,cellVerticalPadding:(r?.cellVerticalPadding??y.cellVerticalPadding)*p},Math.ceil((i??0)*p),Math.ceil((o??0)*p)]},[n,t,i,o,a,e,s,r]);return{rowHeight:l,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:g,overscrollY:h}}const Ir={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 st(e,t){return e===!0?t:e===!1?"":e}function Gu(e){const t=fa.value;return{activateCell:st(e.activateCell," |Enter|shift+Enter"),clear:st(e.clear,"any+Escape"),closeOverlay:st(e.closeOverlay,"any+Escape"),acceptOverlayDown:st(e.acceptOverlayDown,"Enter"),acceptOverlayUp:st(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:st(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:st(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:st(e.delete,t?"Backspace|Delete":"Delete"),downFill:st(e.downFill,"primary+_68"),scrollToSelectedCell:st(e.scrollToSelectedCell,"primary+Enter"),goDownCell:st(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:st(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:st(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:st(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:st(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:st(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:st(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:st(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:st(e.goToFirstCell,"primary+Home"),goToFirstColumn:st(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:st(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:st(e.goToLastCell,"primary+End"),goToLastColumn:st(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:st(e.goToLastRow,"primary+ArrowDown"),goToNextPage:st(e.goToNextPage,"PageDown"),goToPreviousPage:st(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:st(e.rightFill,"primary+_82"),search:st(e.search,"primary+f"),selectAll:st(e.selectAll,"primary+a"),selectColumn:st(e.selectColumn,"ctrl+ "),selectGrowDown:st(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:st(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:st(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:st(e.selectGrowUp,"shift+ArrowUp"),selectRow:st(e.selectRow,"shift+ "),selectToFirstCell:st(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:st(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:st(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:st(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:st(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:st(e.selectToLastRow,"primary+shift+ArrowDown")}}function wv(e){const t=Ip(e);return $t.useMemo(()=>{if(t===void 0)return Gu(Ir);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??Ir.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??Ir.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??Ir.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??Ir.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??Ir.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??Ir.selectToLastCell};return Gu({...Ir,...n})},[t])}function yv(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const s={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(s.subGroups=r.subGroups.map((a,l)=>t(a,i+1,[...o,l])).sort((a,l)=>a.headerIndex-l.headerIndex)),s}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function al(e,t){const n=[];function r(a,l,u=!1){let c=l!==null?l-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(c=a.subGroups[0].headerIndex-a.headerIndex),c--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:u,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:c}),a.subGroups)for(let d=0;d<a.subGroups.length;d++){const g=d<a.subGroups.length-1?a.subGroups[d+1].headerIndex:l;r(a.subGroups[d],g,u||a.isCollapsed)}}const i=yv(e.groups);for(let a=0;a<i.length;a++){const l=a<i.length-1?i[a+1].headerIndex:null;r(i[a],l)}let o=0,s=0;for(const a of n)a.contentIndex=s,s+=a.rows,a.rowIndex=o,o+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:l,...u}=a;return u})}function Hs(e,t){if(t===void 0||al.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 Cv(e,t,n,r){const i=$t.useMemo(()=>e===void 0?void 0:al(e,t),[e,t]),o=$t.useMemo(()=>i?.reduce((c,d)=>(c[d.rowIndex]=d,c),{}),[i]),s=$t.useMemo(()=>i===void 0?t:i.reduce((c,d)=>c+(d.isCollapsed?1:d.rows+1),0),[i,t]),a=$t.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>o?.[c]?e.height:typeof n=="number"?n:n(c),[o,e,n]),l=$t.useCallback(c=>{if(i===void 0)return c;let d=c;for(const g of i){if(d===0)return;if(d--,!g.isCollapsed){if(d<g.rows)return g.contentIndex+d;d-=g.rows}}return c},[i]),u=Er(r??e?.themeOverride,$t.useCallback(c=>{if(e===void 0)return r?.(c,c,c);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:d,contentIndex:g,groupIndex:h}=Hs(c,i);return d?e.themeOverride:r?.(c,h,g)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:l,getRowThemeOverride:u}:{rowHeight:a,rows:s,rowNumberMapper:l,getRowThemeOverride:u}}function Sv(e,t){const n=$t.useMemo(()=>e===void 0?void 0:al(e,t),[e,t]);return{getRowGroupingForPath:Kd,updateRowGroupingByPath:jd,mapper:$t.useCallback(r=>{if(typeof r=="number")return Hs(r,n);const i=Hs(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function jd(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,s)=>s===r?{...o,...n}:o):e.map((o,s)=>s===r?{...o,subGroups:jd(o.subGroups??[],i,n)}:o)}function Kd(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Kd(e[n].subGroups??[],r)}function xv(e,t){const[n]=f.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}));return n.callback=t,n.facade}function kv(e,t,n,r,i){const[o,s]=f.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),a=f.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:s}),[r,s,o]),[l,u,c]=Rp(a),d=f.useRef(i);d.current=i;const g=xv(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),h=(l.height??1)>1;f.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&h){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&c(),d.current()}},[t,h,c,g]);const p=(l.width??1)>1;return f.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&p){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&c(),d.current()}},[e,p,c,g]),{visibleRegion:l,setVisibleRegion:u,scrollRef:g}}const Mv=f.lazy(async()=>await Us(()=>import("./data-grid-overlay-editor.C9gQLEnU.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url));let Rv=0;function Iv(e){return Tm(Lu(Lu(e).filter(t=>t.span!==void 0).map(t=>Or((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Go(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 Xo={kind:Z.Loading,allowOverlay:!1},Yo={columns:Qe.empty(),rows:Qe.empty(),current:void 0},Ev=(e,t)=>{const[n,r]=f.useState(Yo),[i,o]=f.useState(),s=f.useRef(null),a=f.useRef(null),[l,u]=f.useState(),c=f.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:h,markdownDivCreateNode:p,width:m,height:y,columns:b,rows:v,getCellContent:C,onCellClicked:E,onCellActivated:I,onFillPattern:R,onFinishedEditing:P,coercePasteValue:x,drawHeader:S,drawCell:F,editorBloom:D,onHeaderClicked:M,onColumnProposeMove:T,rangeSelectionColumnSpanning:O=!0,spanRangeBehavior:k="default",onGroupHeaderClicked:$,onCellContextMenu:G,className:j,onHeaderContextMenu:ue,getCellsForSelection:Q,onGroupHeaderContextMenu:ee,onGroupHeaderRenamed:ce,onCellEdited:ae,onCellsEdited:ge,onSearchResultsChanged:de,searchResults:re,onSearchValueChange:H,searchValue:L,onKeyDown:X,onKeyUp:te,keybindings:ie,editOnType:Se=!0,onRowAppended:me,onColumnAppended:nt,onColumnMoved:xe,validateCell:gt,highlightRegions:Mt,rangeSelect:Ue="rect",columnSelect:ne="multi",rowSelect:oe="multi",rangeSelectionBlending:we="exclusive",columnSelectionBlending:fe="exclusive",rowSelectionBlending:ye="exclusive",onDelete:$e,onDragStart:Pe,onMouseMove:it,onPaste:Me,copyHeaders:qe=!1,freezeColumns:Te=0,cellActivationBehavior:Ee="second-click",rowSelectionMode:De="auto",onHeaderMenuClick:ft,onHeaderIndicatorClick:ot,getGroupDetails:Xe,rowGrouping:wt,onSearchClose:yt,onItemHovered:Ft,onSelectionCleared:It,showSearch:dn,onVisibleRegionChanged:Zt,gridSelection:fn,onGridSelectionChange:Ot,minColumnWidth:Ct=50,maxColumnWidth:Tn=500,maxColumnAutoWidth:pt,provideEditor:en,trailingRowOptions:Bt,freezeTrailingRows:Le=0,allowedFillDirections:St="orthogonal",scrollOffsetX:mt,scrollOffsetY:Dn,verticalBorder:Gt,onDragOverCell:hn,onDrop:On,onColumnResize:Xt,onColumnResizeEnd:tn,onColumnResizeStart:Be,customRenderers:Pt,fillHandle:$n,experimental:xt,fixedShadowX:Et,fixedShadowY:kn,headerIcons:cr,imageWindowLoader:Nn,initialSize:N,isDraggable:We,onDragLeave:Ge,onRowMoved:Rt,overscrollX:gn,overscrollY:ln,preventDiagonalScrolling:Mn,rightElement:wn,rightElementProps:Wt,trapFocus:yn=!1,smoothScrollX:Pn,smoothScrollY:Ce,scaleToRem:_t=!1,rowHeight:Jt=34,headerHeight:Ln=36,groupHeaderHeight:un=Ln,theme:Yt,isOutsideClick:jt,renderers:Cn,resizeIndicator:Bn,scrollToActiveCell:Ii=!0,drawFocusRing:Ar=!0,portalElementRef:Il}=e,Ei=Ar==="no-editor"?i===void 0:Ar,Wn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,Rn=Wn?.kind??e.rowMarkers??"none",Ti=Wn?.width??e.rowMarkerWidth,Hr=Wn?.startIndex??e.rowMarkerStartIndex??1,dr=Wn?.theme??e.rowMarkerTheme,ei=Wn?.headerTheme,br=Wn?.headerAlwaysVisible,wr=oe!=="multi"||Wn?.headerDisabled===!0,ti=Wn?.checkboxStyle??"square",fr=Math.max(Ct,20),ni=Math.max(Tn,fr),Ta=Math.max(pt??ni,fr),So=f.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:_e,rowNumberMapper:Di,rowHeight:xo,getRowThemeOverride:yr}=Cv(wt,v,Jt,h),Da=f.useMemo(()=>Number.parseFloat(So.fontSize),[So]),{rowHeight:ir,headerHeight:Oi,groupHeaderHeight:ko,theme:Mo,overscrollX:Pi,overscrollY:Oa}=bv({groupHeaderHeight:un,headerHeight:Ln,overscrollX:gn,overscrollY:ln,remSize:Da,rowHeight:xo,scaleToRem:_t,theme:Yt}),or=wv(ie),Cr=Ti??(v>1e4?48:v>1e3?44:v>100?36:32),Un=Rn!=="none",U=Un?1:0,At=Bt!==void 0,hr=Bt?.sticky===!0,[Li,Ro]=f.useState(!1),ri=dn??Li,Pa=f.useCallback(()=>{yt!==void 0?yt():Ro(!1)},[yt]),K=f.useMemo(()=>fn===void 0?void 0:Go(fn,U),[fn,U])??n,In=f.useRef();In.current===void 0&&(In.current=new AbortController),f.useEffect(()=>()=>In?.current.abort(),[]);const[z,se]=nv(Q,C,U,In.current,_e),ke=f.useCallback((w,A,_)=>{if(gt===void 0)return!0;const W=[w[0]-U,w[1]];return gt?.(W,A,_)},[U,gt]),Re=f.useRef(fn),le=f.useCallback((w,A)=>{A&&(w=uv(w,z,U,k,In.current)),Ot!==void 0?(Re.current=Go(w,-U),Ot(Re.current)):r(w)},[Ot,z,U,k]),ve=Er(Xt,f.useCallback((w,A,_,W)=>{Xt?.(b[_-U],A,_-U,W)},[Xt,U,b])),Ye=Er(tn,f.useCallback((w,A,_,W)=>{tn?.(b[_-U],A,_-U,W)},[tn,U,b])),Ie=Er(Be,f.useCallback((w,A,_,W)=>{Be?.(b[_-U],A,_-U,W)},[Be,U,b])),je=Er(S,f.useCallback((w,A)=>S?.({...w,columnIndex:w.columnIndex-U},A)??!1,[S,U])),ht=Er(F,f.useCallback((w,A)=>F?.({...w,col:w.col-U},A)??!1,[F,U])),Qt=f.useCallback(w=>{if($e!==void 0){const A=$e(Go(w,-U));return typeof A=="boolean"?A:Go(A,U)}return!0},[$e,U]),[ct,Tt,et]=tv(K,le,we,fe,ye,Ue,O),Je=f.useMemo(()=>pr(Pd(),Mo),[Mo]),[zt,Ut]=f.useState([0,0,0]),zr=f.useMemo(()=>{if(Cn===void 0)return{};const w={};for(const A of Cn)w[A.kind]=A;return w},[Cn]),nn=f.useCallback(w=>w.kind!==Z.Custom?zr[w.kind]:Pt?.find(A=>A.isMatch(w)),[Pt,zr]);let{sizedColumns:cn,nonGrowWidth:Sr}=ym(b,_e,se,zt[0]-(U===0?0:Cr)-zt[2],fr,Ta,Je,nn,In.current);Rn!=="none"&&(Sr+=Cr);const Lt=f.useMemo(()=>cn.some(w=>w.group!==void 0),[cn]),En=Lt?Oi+ko:Oi,Fn=K.rows.length,ii=Rn==="none"?void 0:Fn===0?!1:Fn===_e?!0:void 0,rt=f.useMemo(()=>Rn==="none"?cn:[{title:"",width:Cr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:dr,rowMarker:ti,rowMarkerChecked:ii,headerRowMarkerTheme:ei,headerRowMarkerAlwaysVisible:br,headerRowMarkerDisabled:wr},...cn],[Rn,cn,Cr,dr,ti,ii,ei,br,wr]),an=f.useRef({height:1,width:1,x:0,y:0}),Yn=f.useRef(!1),{setVisibleRegion:_i,visibleRegion:_n,scrollRef:Vt}=kv(mt,Dn,ir,an,()=>Yn.current=!0);an.current=_n;const La=_n.x+U,Io=_n.y,pn=f.useRef(null),Sn=f.useCallback(w=>{w===!0?pn.current?.focus():window.requestAnimationFrame(()=>{pn.current?.focus()})},[]),mn=At?_e+1:_e,qn=f.useCallback(w=>{const A=U===0?w:w.map(W=>({...W,location:[W.location[0]-U,W.location[1]]})),_=ge?.(A);if(_!==!0)for(const W of A)ae?.(W.location,W.value);return _},[ae,ge,U]),[Vr,Fa]=f.useState(),Eo=K.current!==void 0&&K.current.range.width*K.current.range.height>1?K.current.range:void 0,El=Ei?K.current?.cell:void 0,To=El?.[0],Do=El?.[1],eh=f.useMemo(()=>{if((Mt===void 0||Mt.length===0)&&(Eo??To??Do??Vr)===void 0)return;const w=[];if(Mt!==void 0)for(const A of Mt){const _=rt.length-A.range.x-U;_>0&&w.push({color:A.color,range:{...A.range,x:A.range.x+U,width:Math.min(_,A.range.width)},style:A.style})}return Vr!==void 0&&w.push({color:jr(Je.accentColor,0),range:Vr,style:"dashed"}),Eo!==void 0&&w.push({color:jr(Je.accentColor,.5),range:Eo,style:"solid-outline"}),To!==void 0&&Do!==void 0&&w.push({color:Je.accentColor,range:{x:To,y:Do,width:1,height:1},style:"solid-outline"}),w.length>0?w:void 0},[Vr,Eo,To,Do,Mt,rt.length,Je.accentColor,U]),Tl=f.useRef(rt);Tl.current=rt;const An=f.useCallback(([w,A],_=!1)=>{const W=At&&A===mn-1;if(w===0&&Un){if(W)return Xo;const Y=Di(A);return Y===void 0?Xo:{kind:Xn.Marker,allowOverlay:!1,checkboxStyle:ti,checked:K?.rows.hasIndex(A)===!0,markerKind:Rn==="clickable-number"?"number":Rn,row:Hr+Y,drawHandle:Rt!==void 0,cursor:Rn==="clickable-number"?"pointer":void 0}}else if(W){const V=w===U?Bt?.hint??"":"",B=Tl.current[w];if(B?.trailingRowOptions?.disabled===!0)return Xo;{const J=B?.trailingRowOptions?.hint??V,he=B?.trailingRowOptions?.addIcon??Bt?.addIcon;return{kind:Xn.NewRow,hint:J,allowOverlay:!1,icon:he}}}else{const Y=w-U;if(_||xt?.strict===!0){const B=an.current,J=B.x>Y||Y>B.x+B.width||B.y>A||A>B.y+B.height||A>=za.current,he=Y===B.extras?.selected?.[0]&&A===B.extras?.selected[1];let pe=!1;if(B.extras?.freezeRegions!==void 0){for(const kt of B.extras.freezeRegions)if(Yr(kt,Y,A)){pe=!0;break}}if(J&&!he&&!pe)return Xo}let V=C([Y,A]);return U!==0&&V.span!==void 0&&(V={...V,span:[V.span[0]+U,V.span[1]+U]}),V}},[At,mn,Un,Di,ti,K?.rows,Rn,Hr,Rt,U,Bt?.hint,Bt?.addIcon,xt?.strict,C]),_a=f.useCallback(w=>{let A=Xe?.(w)??{name:w};return ce!==void 0&&w!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:_=>$a({group:A.name,bounds:_.bounds})}]}),A},[Xe,ce]),Oo=f.useCallback(w=>{const[A,_]=w.cell,W=rt[A],q=W?.group!==void 0?_a(W.group)?.overrideTheme:void 0,Y=W?.themeOverride,V=yr?.(_);o({...w,theme:pr(Je,q,Y,V,w.content.themeOverride)})},[yr,rt,_a,Je]),oi=f.useCallback((w,A,_)=>{if(K.current===void 0)return;const[W,q]=K.current.cell,Y=An([W,q]);if(Y.kind!==Z.Boolean&&Y.allowOverlay){let V=Y;if(_!==void 0)switch(V.kind){case Z.Number:{const B=tp(()=>_==="-"?-0:Number.parseFloat(_),0);V={...V,data:Number.isNaN(B)?0:B};break}case Z.Text:case Z.Markdown:case Z.Uri:V={...V,data:_};break}Oo({target:w,content:V,initialValue:_,cell:[W,q],highlight:_===void 0,forceEditMode:_!==void 0,activation:A})}else Y.kind===Z.Boolean&&A.inputType==="keyboard"&&Y.readonly!==!0&&(qn([{location:K.current.cell,value:{...Y,data:Yd(Y.data)}}]),pn.current?.damage([{cell:K.current.cell}]))},[An,K,qn,Oo]),Dl=f.useCallback((w,A)=>{const _=pn.current?.getBounds(w,A);if(_===void 0||Vt.current===null)return;const W=An([w,A]);W.allowOverlay&&Oo({target:_,content:W,initialValue:void 0,highlight:!0,cell:[w,A],forceEditMode:!0,activation:{inputType:"keyboard",key:"Enter"}})},[An,Vt,Oo]),qt=f.useCallback((w,A,_="both",W=0,q=0,Y=void 0)=>{if(Vt.current!==null){const V=pn.current,B=a.current,J=typeof w!="number"?w.unit==="cell"?w.amount:void 0:w,he=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,pe=typeof w!="number"&&w.unit==="px"?w.amount:void 0,kt=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(V!==null&&B!==null){let tt={x:0,y:0,width:0,height:0},Ke=0,Ze=0;if((J!==void 0||he!==void 0)&&(tt=V.getBounds((J??0)+U,he??0)??tt,tt.width===0||tt.height===0))return;const ut=B.getBoundingClientRect(),vt=ut.width/B.offsetWidth;if(pe!==void 0&&(tt={...tt,x:pe-ut.left-Vt.current.scrollLeft,width:1}),kt!==void 0&&(tt={...tt,y:kt+ut.top-Vt.current.scrollTop,height:1}),tt!==void 0){const bt={x:tt.x-W,y:tt.y-q,width:tt.width+2*W,height:tt.height+2*q};let di=0;for(let Xa=0;Xa<Te;Xa++)di+=cn[Xa].width;let Bi=0;const Wi=Le+(hr?1:0);Wi>0&&(Bi=Qr(mn,Wi,ir));let sr=di*vt+ut.left+U*Cr*vt,fi=ut.right,Wr=ut.top+En*vt,hi=ut.bottom-Bi*vt;const zo=tt.width+W*2;switch(Y?.hAlign){case"start":fi=sr+zo;break;case"end":sr=fi-zo;break;case"center":sr=Math.floor((sr+fi)/2)-zo/2,fi=sr+zo;break}const Vo=tt.height+q*2;switch(Y?.vAlign){case"start":hi=Wr+Vo;break;case"end":Wr=hi-Vo;break;case"center":Wr=Math.floor((Wr+hi)/2)-Vo/2,hi=Wr+Vo;break}sr>bt.x?Ke=bt.x-sr:fi<bt.x+bt.width&&(Ke=bt.x+bt.width-fi),Wr>bt.y?Ze=bt.y-Wr:hi<bt.y+bt.height&&(Ze=bt.y+bt.height-hi),_==="vertical"||typeof w=="number"&&w<Te?Ke=0:(_==="horizontal"||typeof A=="number"&&A>=mn-Wi)&&(Ze=0),(Ke!==0||Ze!==0)&&(vt!==1&&(Ke/=vt,Ze/=vt),Vt.current.scrollTo({left:Ke+Vt.current.scrollLeft,top:Ze+Vt.current.scrollTop,behavior:Y?.behavior??"auto"}))}}}},[U,Le,Cr,Vt,En,Te,cn,mn,hr,ir]),Aa=f.useRef(Dl),Ha=f.useRef(C);Aa.current=Dl,Ha.current=C;const za=f.useRef(_e);za.current=_e;const Ol=f.useRef(rt.length);Ol.current=rt.length;const xr=f.useCallback(async(w,A=!0,_)=>{if(rt[w]?.trailingRowOptions?.disabled===!0)return;const q=me?.();let Y,V=!0;q!==void 0&&(Y=await q,Y==="top"&&(V=!1),typeof Y=="number"&&(V=!1));let B=0;const J=()=>{if(za.current<=_e){B<500&&window.setTimeout(J,B),B=50+B*2;return}const he=typeof Y=="number"?Y:V?_e:0;Ho.current(w-U,he,"both",0,0,_?{behavior:_}:void 0),ct({cell:[w,he],range:{x:w,y:he,width:1,height:1}},!1,!1,"edit");const pe=Ha.current([w-U,he]);pe.allowOverlay&&bi(pe)&&pe.readonly!==!0&&A&&window.setTimeout(()=>{Aa.current(w,he)},0)};J()},[rt,me,U,_e,ct]),Po=f.useCallback(async(w,A=!0)=>{const _=nt?.();let W,q=!0;_!==void 0&&(W=await _,W==="left"&&(q=!1),typeof W=="number"&&(q=!1));let Y=0;const V=()=>{if(Ol.current<=rt.length){Y<500&&window.setTimeout(V,Y),Y=50+Y*2;return}const B=typeof W=="number"?W:q?rt.length:0;qt(B-U,w),ct({cell:[B,w],range:{x:B,y:w,width:1,height:1}},!1,!1,"edit");const J=Ha.current([B-U,w]);J.allowOverlay&&bi(J)&&J.readonly!==!0&&A&&window.setTimeout(()=>{Aa.current(B,w)},0)};V()},[rt,nt,U,qt,ct]),ai=f.useCallback(w=>{const A=cn[w]?.trailingRowOptions?.targetColumn??Bt?.targetColumn;if(typeof A=="number")return A+(Un?1:0);if(typeof A=="object"){const _=b.indexOf(A);if(_>=0)return _+(Un?1:0)}},[cn,b,Un,Bt?.targetColumn]),kr=f.useRef(),si=f.useRef(),Ai=f.useCallback((w,A)=>{const[_,W]=A;return pr(Je,rt[_]?.themeOverride,yr?.(W),w.themeOverride)},[yr,rt,Je]),{mapper:$r}=Sv(wt,v),jn=wt?.navigationBehavior,Hi=f.useCallback(w=>{const A=fa.value?w.metaKey:w.ctrlKey,_=A&&oe==="multi",W=A&&ne==="multi",[q,Y]=w.location,V=K.columns,B=K.rows,[J,he]=K.current?.cell??[];if(w.kind==="cell"){if(si.current=void 0,Nr.current=[q,Y],q===0&&Un){if(At===!0&&Y===_e||Rn==="number"||oe==="none")return;const pe=An(w.location);if(pe.kind!==Xn.Marker)return;if(Rt!==void 0){const Ke=nn(pe);zn(Ke?.kind===Xn.Marker);const Ze=Ke?.onClick?.({...w,cell:pe,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,theme:Ai(pe,w.location),preventDefault:()=>{}});if(Ze===void 0||Ze.checked===pe.checked)return}o(void 0),Sn();const kt=B.hasIndex(Y),tt=kr.current;if(oe==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&tt!==void 0&&B.hasIndex(tt)){const Ke=[Math.min(tt,Y),Math.max(tt,Y)+1];_||De==="multi"?Tt(void 0,Ke,!0):Tt(Qe.fromSingleSelection(Ke),void 0,_)}else oe==="multi"&&(_||w.isTouch||De==="multi")?kt?Tt(B.remove(Y),void 0,!0):(Tt(void 0,Y,!0),kr.current=Y):kt&&B.length===1?Tt(Qe.empty(),void 0,A):(Tt(Qe.fromSingleSelection(Y),void 0,A),kr.current=Y)}else if(q>=U&&At&&Y===_e){const pe=ai(q);xr(pe??q)}else if(J!==q||he!==Y){const pe=An(w.location),kt=nn(pe);if(kt?.onSelect!==void 0){let Ze=!1;if(kt.onSelect({...w,cell:pe,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,preventDefault:()=>Ze=!0,theme:Ai(pe,w.location)}),Ze)return}if(jn==="block"&&$r(Y).isGroupHeader)return;const tt=hr&&Y===_e,Ke=hr&&K!==void 0&&K.current?.cell[1]===_e;if((w.shiftKey||w.isLongTouch===!0)&&J!==void 0&&he!==void 0&&K.current!==void 0&&!Ke){if(tt)return;const Ze=Math.min(q,J),ut=Math.max(q,J),vt=Math.min(Y,he),bt=Math.max(Y,he);ct({...K.current,range:{x:Ze,y:vt,width:ut-Ze+1,height:bt-vt+1}},!0,A,"click"),kr.current=void 0,Sn()}else ct({cell:[q,Y],range:{x:q,y:Y,width:1,height:1}},!0,A,"click"),kr.current=void 0,o(void 0),Sn()}}else if(w.kind==="header")if(Nr.current=[q,Y],o(void 0),Un&&q===0)kr.current=void 0,si.current=void 0,!wr&&oe==="multi"&&(B.length!==_e?Tt(Qe.fromSingleSelection([0,_e]),void 0,A):Tt(Qe.empty(),void 0,A),Sn());else{const pe=si.current;if(ne==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&pe!==void 0&&V.hasIndex(pe)){const kt=[Math.min(pe,q),Math.max(pe,q)+1];W?et(void 0,kt,A):et(Qe.fromSingleSelection(kt),void 0,A)}else W?(V.hasIndex(q)?et(V.remove(q),void 0,A):et(void 0,q,A),si.current=q):ne!=="none"&&(V.hasIndex(q)?et(V.remove(q),void 0,A):et(Qe.fromSingleSelection(q),void 0,A),si.current=q);kr.current=void 0,Sn()}else w.kind===Qn?Nr.current=[q,Y]:w.kind===ha&&!w.isMaybeScrollbar&&(le(Yo,!1),o(void 0),Sn(),It?.(),kr.current=void 0,si.current=void 0)},[oe,ne,K,Un,U,At,_e,Rn,An,Rt,Sn,De,nn,Ai,Tt,ai,xr,jn,$r,hr,ct,wr,et,le,It]),zi=f.useRef(!1),Nr=f.useRef(),Pl=f.useRef(_n),ar=f.useRef(),th=f.useCallback(w=>{if(li.current=!1,Pl.current=an.current,w.button!==0&&w.button!==1){ar.current=void 0;return}const A=performance.now();ar.current={button:w.button,time:A,location:w.location},w?.kind==="header"&&(zi.current=!0);const _=w.kind==="cell"&&w.isFillHandle;!_&&w.kind!=="cell"&&w.isEdge||(u({previousSelection:K,fillHandle:_}),Nr.current=void 0,!w.isTouch&&w.button===0&&!_?Hi(w):!w.isTouch&&w.button===1&&(Nr.current=w.location))},[K,Hi]),[Va,$a]=f.useState(),Ll=f.useCallback(w=>{if(w.kind!==Qn||ne!=="multi")return;const A=fa.value?w.metaKey:w.ctrlKey,[_]=w.location,W=K.columns;if(_<U)return;const q=rt[_];let Y=_,V=_;for(let B=_-1;B>=U&&ho(q.group,rt[B].group);B--)Y--;for(let B=_+1;B<rt.length&&ho(q.group,rt[B].group);B++)V++;if(Sn(),A)if(W.hasAll([Y,V+1])){let B=W;for(let J=Y;J<=V;J++)B=B.remove(J);et(B,void 0,A)}else et(void 0,[Y,V+1],A);else et(Qe.fromSingleSelection([Y,V+1]),void 0,A)},[ne,Sn,K.columns,rt,U,et]),li=f.useRef(!1),Lo=f.useCallback(async w=>{if(z!==void 0&&ve!==void 0){const A=an.current.y,_=an.current.height;let W=z({x:w,y:A,width:1,height:Math.min(_,_e-A)},In.current.signal);typeof W!="object"&&(W=await W());const q=cn[w-U],V=document.createElement("canvas").getContext("2d",{alpha:!1});if(V!==null){V.font=Je.baseFontFull;const B=_d(V,Je,q,0,W,fr,ni,!1,nn);ve?.(q,B.width,w,B.width)}}},[cn,z,ni,Je,fr,ve,U,_e,nn]),[nh,Na]=f.useState(),ui=f.useCallback(async(w,A)=>{const _=w.current?.range;if(_===void 0||z===void 0||A.current===void 0)return;const W=A.current.range;if(R!==void 0){let B=!1;if(R({fillDestination:{...W,x:W.x-U},patternSource:{..._,x:_.x-U},preventDefault:()=>B=!0}),B)return}let q=z(_,In.current.signal);typeof q!="object"&&(q=await q());const Y=q,V=[];for(let B=0;B<W.width;B++)for(let J=0;J<W.height;J++){const he=[W.x+B,W.y+J];if(xd(he,_))continue;const pe=Y[J%_.height][B%_.width];yi(pe)||!bi(pe)||V.push({location:he,value:{...pe}})}qn(V),pn.current?.damage(V.map(B=>({cell:B.location})))},[z,qn,R,U]),Fl=f.useCallback(()=>{if(K.current===void 0||K.current.range.width<=1)return;const w={...K,current:{...K.current,range:{...K.current.range,width:1}}};ui(w,K)},[ui,K]),_l=f.useCallback(()=>{if(K.current===void 0||K.current.range.height<=1)return;const w={...K,current:{...K.current,range:{...K.current.range,height:1}}};ui(w,K)},[ui,K]),rh=f.useCallback((w,A)=>{const _=l;if(u(void 0),Fa(void 0),Na(void 0),zi.current=!1,A)return;if(_?.fillHandle===!0&&K.current!==void 0&&_.previousSelection?.current!==void 0){if(Vr===void 0)return;const pe={...K,current:{...K.current,range:$d(_.previousSelection.current.range,Vr)}};ui(_.previousSelection,pe),le(pe,!0);return}const[W,q]=w.location,[Y,V]=Nr.current??[],B=()=>{li.current=!0},J=pe=>{const kt=pe.isTouch||Y===W&&V===q;if(kt&&E?.([W-U,q],{...pe,preventDefault:B}),pe.button===1)return!li.current;if(!li.current){const tt=An(w.location),Ke=nn(tt);if(Ke!==void 0&&Ke.onClick!==void 0&&kt){const ut=Ke.onClick({...pe,cell:tt,posX:pe.localEventX,posY:pe.localEventY,bounds:pe.bounds,theme:Ai(tt,w.location),preventDefault:B});ut!==void 0&&!yi(ut)&&vi(ut)&&(qn([{location:pe.location,value:ut}]),pn.current?.damage([{cell:pe.location}]))}if(li.current||K.current===void 0)return!1;let Ze=!1;switch(tt.activationBehaviorOverride??Ee){case"double-click":case"second-click":{if(_?.previousSelection?.current?.cell===void 0)break;const[ut,vt]=K.current.cell,[bt,di]=_.previousSelection.current.cell;Ze=W===ut&&W===bt&&q===vt&&q===di&&(pe.isDoubleClick===!0||Ee==="second-click");break}case"single-click":{Ze=!0;break}}if(Ze){const vt={inputType:"pointer",pointerActivation:pe.isDoubleClick===!0?"double-click":tt.activationBehaviorOverride??Ee,pointerType:pe.isTouch?"touch":"mouse"};return I?.([W-U,q],vt),oi(pe.bounds,vt),!0}}return!1},he=w.location[0]-U;if(w.isTouch){const pe=an.current,kt=Pl.current;if(pe.x!==kt.x||pe.y!==kt.y)return;if(w.isLongTouch===!0){if(w.kind==="cell"&&so(K.current?.cell,w.location)){G?.([he,w.location[1]],{...w,preventDefault:B});return}else if(w.kind==="header"&&K.columns.hasIndex(W)){ue?.(he,{...w,preventDefault:B});return}else if(w.kind===Qn){if(he<0)return;ee?.(he,{...w,preventDefault:B});return}}w.kind==="cell"?J(w)||Hi(w):w.kind===Qn?$?.(he,{...w,preventDefault:B}):(w.kind===Tr&&M?.(he,{...w,preventDefault:B}),Hi(w));return}if(w.kind==="header"){if(he<0)return;w.isEdge?w.isDoubleClick===!0&&Lo(W):w.button===0&&W===Y&&q===V&&M?.(he,{...w,preventDefault:B})}if(w.kind===Qn){if(he<0)return;w.button===0&&W===Y&&q===V&&($?.(he,{...w,preventDefault:B}),li.current||Ll(w))}w.kind==="cell"&&(w.button===0||w.button===1)&&J(w),Nr.current=void 0},[l,K,U,Vr,ui,le,E,An,nn,Ee,Ai,qn,I,oi,G,ue,ee,Hi,$,M,Lo,Ll]),ih=f.useCallback(w=>{const A={...w,location:[w.location[0]-U,w.location[1]]};it?.(A),l!==void 0&&w.buttons===0&&(u(void 0),Fa(void 0),Na(void 0),zi.current=!1),Na(_=>zi.current?[w.scrollEdge[0],0]:w.scrollEdge[0]===_?.[0]&&w.scrollEdge[1]===_[1]?_:l===void 0||(ar.current?.location[0]??0)<U?void 0:w.scrollEdge)},[l,it,U]),oh=f.useCallback((w,A)=>{ft?.(w-U,A)},[ft,U]),ah=f.useCallback((w,A)=>{ot?.(w-U,A)},[ot,U]),ci=K?.current?.cell,sh=f.useCallback((w,A,_,W,q,Y)=>{Yn.current=!1;let V=ci;V!==void 0&&(V=[V[0]-U,V[1]]);const B=Te===0?void 0:{x:0,y:w.y,width:Te,height:w.height},J=[];B!==void 0&&J.push(B),Le>0&&(J.push({x:w.x-U,y:_e-Le,width:w.width,height:Le}),Te>0&&J.push({x:0,y:_e-Le,width:Te,height:Le}));const he={x:w.x-U,y:w.y,width:w.width,height:At&&w.y+w.height>=_e?w.height-1:w.height,tx:q,ty:Y,extras:{selected:V,freezeRegion:B,freezeRegions:J}};an.current=he,_i(he),Ut([A,_,W]),Zt?.(he,he.tx,he.ty,he.extras)},[ci,U,At,_e,Te,Le,_i,Zt]),lh=Er(T,f.useCallback((w,A)=>T?.(w-U,A-U)!==!1,[T,U])),uh=Er(xe,f.useCallback((w,A)=>{xe?.(w-U,A-U),ne!=="none"&&et(Qe.fromSingleSelection(A),void 0,!0)},[ne,xe,U,et])),Ba=f.useRef(!1),ch=f.useCallback(w=>{if(w.location[0]===0&&U>0){w.preventDefault();return}Pe?.({...w,location:[w.location[0]-U,w.location[1]]}),w.defaultPrevented()||(Ba.current=!0),u(void 0)},[Pe,U]),dh=f.useCallback(()=>{Ba.current=!1},[]),Al=wt?.selectionBehavior,Fo=f.useCallback(w=>{if(Al!=="block-spanning")return;const{isGroupHeader:A,path:_,groupRows:W}=$r(w);if(A)return[w,w];const q=_[_.length-1],Y=w-q,V=w+W-q-1;return[Y,V]},[$r,Al]),Wa=f.useRef(),Ua=f.useCallback(w=>{if(!Gd(w,Wa.current)&&(Wa.current=w,!(ar?.current?.button!==void 0&&ar.current.button>=1))){if(w.buttons!==0&&l!==void 0&&ar.current?.location[0]===0&&w.location[0]===0&&U===1&&oe==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(ar.current.location[1])&&K.rows.hasIndex(ar.current.location[1])){const A=Math.min(ar.current.location[1],w.location[1]),_=Math.max(ar.current.location[1],w.location[1])+1;Tt(Qe.fromSingleSelection([A,_]),void 0,!1)}if(w.buttons!==0&&l!==void 0&&K.current!==void 0&&!Ba.current&&!zi.current&&(Ue==="rect"||Ue==="multi-rect")){const[A,_]=K.current.cell;let[W,q]=w.location;if(q<0&&(q=an.current.y),l.fillHandle===!0&&l.previousSelection?.current!==void 0){const Y=l.previousSelection.current.range;q=Math.min(q,At?_e-1:_e);const V=l0(Y,W,q,St);Fa(V)}else{if(At&&_===_e)return;if(At&&q===_e)if(w.kind===ha)q--;else return;W=Math.max(W,U);const B=Fo(_);q=B===void 0?q:Gn(q,B[0],B[1]);const J=W-A,he=q-_,pe={x:J>=0?A:W,y:he>=0?_:q,width:Math.abs(J)+1,height:Math.abs(he)+1};ct({...K.current,range:pe},!0,!1,"drag")}}Ft?.({...w,location:[w.location[0]-U,w.location[1]]})}},[l,U,oe,K,Ue,Ft,Tt,At,_e,St,Fo,ct]),fh=f.useCallback(()=>{const w=Wa.current;if(w===void 0)return;const[A,_]=w.scrollEdge;let[W,q]=w.location;const Y=an.current;A===-1?W=Y.extras?.freezeRegion?.x??Y.x:A===1&&(W=Y.x+Y.width),_===-1?q=Math.max(0,Y.y):_===1&&(q=Math.min(_e-1,Y.y+Y.height)),W=Gn(W,0,rt.length-1),q=Gn(q,0,_e-1),Ua({...w,location:[W,q]})},[rt.length,Ua,_e]);vv(nh,Vt,fh);const Kn=f.useCallback(w=>{if(K.current===void 0)return;const[A,_]=w,[W,q]=K.current.cell,Y=K.current.range;let V=Y.x,B=Y.x+Y.width,J=Y.y,he=Y.y+Y.height;const[pe,kt]=Fo(q)??[0,_e-1],tt=kt+1;if(_!==0)switch(_){case 2:{he=tt,J=q,qt(0,he,"vertical");break}case-2:{J=pe,he=q+1,qt(0,J,"vertical");break}case 1:{J<q?(J++,qt(0,J,"vertical")):(he=Math.min(tt,he+1),qt(0,he,"vertical"));break}case-1:{he>q+1?(he--,qt(0,he,"vertical")):(J=Math.max(pe,J-1),qt(0,J,"vertical"));break}default:co()}if(A!==0)if(A===2)B=rt.length,V=W,qt(B-1-U,0,"horizontal");else if(A===-2)V=U,B=W+1,qt(V-U,0,"horizontal");else{let Ke=[];if(z!==void 0){const Ze=z({x:V,y:J,width:B-V-U,height:he-J},In.current.signal);typeof Ze=="object"&&(Ke=Iv(Ze))}if(A===1){let Ze=!1;if(V<W){if(Ke.length>0){const ut=Or(V+1,W+1).find(vt=>!Ke.includes(vt-U));ut!==void 0&&(V=ut,Ze=!0)}else V++,Ze=!0;Ze&&qt(V,0,"horizontal")}Ze||(B=Math.min(rt.length,B+1),qt(B-1-U,0,"horizontal"))}else if(A===-1){let Ze=!1;if(B>W+1){if(Ke.length>0){const ut=Or(B-1,W,-1).find(vt=>!Ke.includes(vt-U));ut!==void 0&&(B=ut,Ze=!0)}else B--,Ze=!0;Ze&&qt(B-U,0,"horizontal")}Ze||(V=Math.max(U,V-1),qt(V-U,0,"horizontal"))}else co()}ct({cell:K.current.cell,range:{x:V,y:J,width:B-V,height:he-J}},!0,!1,"keyboard-select")},[z,Fo,K,rt.length,U,_e,qt,ct]),qa=f.useRef(Ii);qa.current=Ii;const Mr=f.useCallback((w,A,_,W)=>{const q=mn-(_?0:1);w=Gn(w,U,cn.length-1+U),A=Gn(A,0,q);const Y=ci?.[0],V=ci?.[1];if(w===Y&&A===V)return!1;if(W&&K.current!==void 0){const B=[...K.current.rangeStack];(K.current.range.width>1||K.current.range.height>1)&&B.push(K.current.range),le({...K,current:{cell:[w,A],range:{x:w,y:A,width:1,height:1},rangeStack:B}},!0)}else ct({cell:[w,A],range:{x:w,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===w&&c.current[1]===A&&(c.current=void 0),qa.current&&qt(w-U,A),!0},[mn,U,cn.length,ci,K,qt,le,ct]),hh=f.useCallback((w,A)=>{i?.cell!==void 0&&w!==void 0&&vi(w)&&(qn([{location:i.cell,value:w}]),window.requestAnimationFrame(()=>{pn.current?.damage([{cell:i.cell}])})),Sn(!0),o(void 0);const[_,W]=A;if(K.current!==void 0&&(_!==0||W!==0)){const q=K.current.cell[1]===mn-1&&w!==void 0,Y=K.current.cell[0]===rt.length-1&&w!==void 0;let V=!0;if(q&&W===1&&me!==void 0){V=!1;const B=K.current.cell[0]+_,J=ai(B);xr(J??B,!1)}if(Y&&_===1&&nt!==void 0){V=!1;const B=K.current.cell[1]+W;Po(B,!1)}V&&Mr(Gn(K.current.cell[0]+_,0,rt.length-1),Gn(K.current.cell[1]+W,0,mn-1),q,!1)}P?.(w,A)},[i?.cell,Sn,K,P,qn,mn,Mr,rt.length,xr,Po,me,nt,ai]),gh=f.useMemo(()=>`gdg-overlay-${Rv++}`,[]),Br=f.useCallback(w=>{Sn();const A=[];for(let _=w.x;_<w.x+w.width;_++)for(let W=w.y;W<w.y+w.height;W++){const q=C([_-U,W]);if(!q.allowOverlay&&q.kind!==Z.Boolean)continue;let Y;if(q.kind===Z.Custom){const V=nn(q),B=V?.provideEditor?.({...q,location:[_-U,W]});V?.onDelete!==void 0?Y=V.onDelete(q):np(B)&&(Y=B?.deletedValue?.(q))}else(vi(q)&&q.allowOverlay||q.kind===Z.Boolean)&&(Y=nn(q)?.onDelete?.(q));Y!==void 0&&!yi(Y)&&vi(Y)&&A.push({location:[_,W],value:Y})}qn(A),pn.current?.damage(A.map(_=>({cell:_.location})))},[Sn,C,nn,qn,U]),Vi=i!==void 0,Hl=f.useCallback(w=>{const A=()=>{w.stopPropagation(),w.preventDefault()},_={didMatch:!1},{bounds:W}=w,q=K.columns,Y=K.rows,V=or;if(!Vi&&at(V.clear,w,_))le(Yo,!1),It?.();else if(!Vi&&at(V.selectAll,w,_))le({columns:Qe.empty(),rows:Qe.empty(),current:{cell:K.current?.cell??[U,0],range:{x:U,y:0,width:b.length,height:_e},rangeStack:[]}},!1);else if(at(V.search,w,_))s?.current?.focus({preventScroll:!0}),Ro(!0);else if(at(V.delete,w,_)){const ut=Qt?.(K)??!0;if(ut!==!1){const vt=ut===!0?K:ut;if(vt.current!==void 0){Br(vt.current.range);for(const bt of vt.current.rangeStack)Br(bt)}for(const bt of vt.rows)Br({x:U,y:bt,width:b.length,height:1});for(const bt of vt.columns)Br({x:bt,y:0,width:1,height:_e})}}if(_.didMatch)return A(),!0;if(K.current===void 0)return!1;let[B,J]=K.current.cell;const[,he]=K.current.cell;let pe=!1,kt=!1;if(at(V.scrollToSelectedCell,w,_))Ho.current(B-U,J);else if(ne!=="none"&&at(V.selectColumn,w,_))q.hasIndex(B)?et(q.remove(B),void 0,!0):ne==="single"?et(Qe.fromSingleSelection(B),void 0,!0):et(void 0,B,!0);else if(oe!=="none"&&at(V.selectRow,w,_))Y.hasIndex(J)?Tt(Y.remove(J),void 0,!0):oe==="single"?Tt(Qe.fromSingleSelection(J),void 0,!0):Tt(void 0,J,!0);else if(!Vi&&W!==void 0&&at(V.activateCell,w,_))if(J===_e&&At)window.setTimeout(()=>{const ut=ai(B);xr(ut??B)},0);else{const ut={inputType:"keyboard",key:w.key};I?.([B-U,J],ut),oi(W,ut)}else K.current.range.height>1&&at(V.downFill,w,_)?_l():K.current.range.width>1&&at(V.rightFill,w,_)?Fl():at(V.goToNextPage,w,_)?J+=Math.max(1,an.current.height-4):at(V.goToPreviousPage,w,_)?J-=Math.max(1,an.current.height-4):at(V.goToFirstCell,w,_)?(o(void 0),J=0,B=0):at(V.goToLastCell,w,_)?(o(void 0),J=Number.MAX_SAFE_INTEGER,B=Number.MAX_SAFE_INTEGER):at(V.selectToFirstCell,w,_)?(o(void 0),Kn([-2,-2])):at(V.selectToLastCell,w,_)?(o(void 0),Kn([2,2])):Vi?(at(V.closeOverlay,w,_)&&o(void 0),at(V.acceptOverlayDown,w,_)&&(o(void 0),J++),at(V.acceptOverlayUp,w,_)&&(o(void 0),J--),at(V.acceptOverlayLeft,w,_)&&(o(void 0),B--),at(V.acceptOverlayRight,w,_)&&(o(void 0),B++)):(at(V.goDownCell,w,_)?J+=1:at(V.goUpCell,w,_)?J-=1:at(V.goRightCell,w,_)?B+=1:at(V.goLeftCell,w,_)?B-=1:at(V.goDownCellRetainSelection,w,_)?(J+=1,pe=!0):at(V.goUpCellRetainSelection,w,_)?(J-=1,pe=!0):at(V.goRightCellRetainSelection,w,_)?(B+=1,pe=!0):at(V.goLeftCellRetainSelection,w,_)?(B-=1,pe=!0):at(V.goToLastRow,w,_)?J=_e-1:at(V.goToFirstRow,w,_)?J=Number.MIN_SAFE_INTEGER:at(V.goToLastColumn,w,_)?B=Number.MAX_SAFE_INTEGER:at(V.goToFirstColumn,w,_)?B=Number.MIN_SAFE_INTEGER:(Ue==="rect"||Ue==="multi-rect")&&(at(V.selectGrowDown,w,_)?Kn([0,1]):at(V.selectGrowUp,w,_)?Kn([0,-1]):at(V.selectGrowRight,w,_)?Kn([1,0]):at(V.selectGrowLeft,w,_)?Kn([-1,0]):at(V.selectToLastRow,w,_)?Kn([0,2]):at(V.selectToFirstRow,w,_)?Kn([0,-2]):at(V.selectToLastColumn,w,_)?Kn([2,0]):at(V.selectToFirstColumn,w,_)&&Kn([-2,0])),kt=_.didMatch);if(jn!==void 0&&jn!=="normal"&&J!==he){const ut=jn==="skip-up"||jn==="skip"||jn==="block",vt=jn==="skip-down"||jn==="skip"||jn==="block",bt=J<he;if(bt&&ut){for(;J>=0&&$r(J).isGroupHeader;)J--;J<0&&(J=he)}else if(!bt&&vt){for(;J<_e&&$r(J).isGroupHeader;)J++;J>=_e&&(J=he)}}const Ke=Mr(B,J,!1,pe),Ze=_.didMatch;return Ze&&(Ke||!kt||yn)&&A(),Ze},[jn,Vi,K,or,ne,oe,Ue,U,$r,_e,Mr,le,It,b.length,Qt,yn,Br,et,Tt,At,ai,xr,I,oi,_l,Fl,Kn]),$i=f.useCallback(w=>{let A=!1;if(X!==void 0&&X({...w,...w.location&&{location:[w.location[0]-U,w.location[1]]},cancel:()=>{A=!0}}),A||Hl(w)||K.current===void 0)return;const[_,W]=K.current.cell,q=an.current;if(Se&&!w.metaKey&&!w.ctrlKey&&K.current!==void 0&&w.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(w.key)&&w.bounds!==void 0&&bi(C([_-U,Math.max(0,Math.min(W,_e-1))]))){if((!At||W!==_e)&&(q.y>W||W>q.y+q.height||q.x>_||_>q.x+q.width))return;const Y={inputType:"keyboard",key:w.key};I?.([_-U,W],Y),oi(w.bounds,Y,w.key),w.stopPropagation(),w.preventDefault()}},[Se,X,Hl,K,C,U,_e,At,I,oi]),ph=f.useCallback((w,A)=>{const _=w.location[0]-U;if(w.kind==="header"&&ue?.(_,{...w,preventDefault:A}),w.kind===Qn){if(_<0)return;ee?.(_,{...w,preventDefault:A})}if(w.kind==="cell"){const[W,q]=w.location;G?.([_,q],{...w,preventDefault:A}),im(K,w.location)||Mr(W,q,!1,!1)}},[K,G,ee,ue,U,Mr]),Ga=f.useCallback(async w=>{if(!or.paste)return;function A(V,B,J,he){const pe=typeof J=="object"?J?.join(`
172
+ `&&(n.push(r),r=[])),o=t.None);break}s++}return i<e.length&&r.push(Wu(e.slice(i,e.length))),n.push(r),n.map(a=>a.map(l=>({rawValue:l,formatted:l,format:"string"})))}function Uu(e,t,n){const r=lv(e,t),i=a=>{window.navigator.clipboard?.writeText(a)},o=(a,l)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([a],{type:"text/plain"}),"text/html":new Blob([l],{type:"text/html"})})]),!0),s=(a,l)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",a),n?.clipboardData?.setData("text/html",l)}catch{o(a,l)||i(a)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?s(r.textPlain,r.textHtml):i(r.textPlain),n?.preventDefault()}function Yd(e){return e!==!0}function qu(e){return typeof e=="string"?e:`${e}px`}const dv=()=>e=>e.innerWidth,fv=()=>e=>e.innerHeight,hv=sn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[dv()],"wmyidgi-1":[fv()]}}),gv=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return f.createElement(hv,{innerHeight:qu(n),innerWidth:qu(t),...i},r)},pv=2,mv=1300;function vv(e,t,n){const r=$t.useRef(0),[i,o]=e??[0,0];$t.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let s=!1,a=0;const l=u=>{if(!s){if(a===0)a=u;else{const c=u-a;r.current=Math.min(1,r.current+c/mv);const d=r.current**1.618*c*pv;t.current?.scrollBy(i*d,o*d),a=u,n?.()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{s=!0}},[t,i,o,n])}function bv({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:s,remSize:a}){const[l,u,c,d,g,h]=$t.useMemo(()=>{if(!s||a===16)return[e,t,n,r,i,o];const p=a/16,m=e,y=Pd();return[typeof m=="number"?m*p:b=>Math.ceil(m(b)*p),Math.ceil(t*p),Math.ceil(n*p),{...r,headerIconSize:(r?.headerIconSize??y.headerIconSize)*p,cellHorizontalPadding:(r?.cellHorizontalPadding??y.cellHorizontalPadding)*p,cellVerticalPadding:(r?.cellVerticalPadding??y.cellVerticalPadding)*p},Math.ceil((i??0)*p),Math.ceil((o??0)*p)]},[n,t,i,o,a,e,s,r]);return{rowHeight:l,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:g,overscrollY:h}}const Ir={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 st(e,t){return e===!0?t:e===!1?"":e}function Gu(e){const t=fa.value;return{activateCell:st(e.activateCell," |Enter|shift+Enter"),clear:st(e.clear,"any+Escape"),closeOverlay:st(e.closeOverlay,"any+Escape"),acceptOverlayDown:st(e.acceptOverlayDown,"Enter"),acceptOverlayUp:st(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:st(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:st(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:st(e.delete,t?"Backspace|Delete":"Delete"),downFill:st(e.downFill,"primary+_68"),scrollToSelectedCell:st(e.scrollToSelectedCell,"primary+Enter"),goDownCell:st(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:st(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:st(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:st(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:st(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:st(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:st(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:st(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:st(e.goToFirstCell,"primary+Home"),goToFirstColumn:st(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:st(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:st(e.goToLastCell,"primary+End"),goToLastColumn:st(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:st(e.goToLastRow,"primary+ArrowDown"),goToNextPage:st(e.goToNextPage,"PageDown"),goToPreviousPage:st(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:st(e.rightFill,"primary+_82"),search:st(e.search,"primary+f"),selectAll:st(e.selectAll,"primary+a"),selectColumn:st(e.selectColumn,"ctrl+ "),selectGrowDown:st(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:st(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:st(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:st(e.selectGrowUp,"shift+ArrowUp"),selectRow:st(e.selectRow,"shift+ "),selectToFirstCell:st(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:st(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:st(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:st(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:st(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:st(e.selectToLastRow,"primary+shift+ArrowDown")}}function wv(e){const t=Ip(e);return $t.useMemo(()=>{if(t===void 0)return Gu(Ir);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??Ir.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??Ir.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??Ir.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??Ir.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??Ir.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??Ir.selectToLastCell};return Gu({...Ir,...n})},[t])}function yv(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const s={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(s.subGroups=r.subGroups.map((a,l)=>t(a,i+1,[...o,l])).sort((a,l)=>a.headerIndex-l.headerIndex)),s}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function al(e,t){const n=[];function r(a,l,u=!1){let c=l!==null?l-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(c=a.subGroups[0].headerIndex-a.headerIndex),c--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:u,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:c}),a.subGroups)for(let d=0;d<a.subGroups.length;d++){const g=d<a.subGroups.length-1?a.subGroups[d+1].headerIndex:l;r(a.subGroups[d],g,u||a.isCollapsed)}}const i=yv(e.groups);for(let a=0;a<i.length;a++){const l=a<i.length-1?i[a+1].headerIndex:null;r(i[a],l)}let o=0,s=0;for(const a of n)a.contentIndex=s,s+=a.rows,a.rowIndex=o,o+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:l,...u}=a;return u})}function Hs(e,t){if(t===void 0||al.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 Cv(e,t,n,r){const i=$t.useMemo(()=>e===void 0?void 0:al(e,t),[e,t]),o=$t.useMemo(()=>i?.reduce((c,d)=>(c[d.rowIndex]=d,c),{}),[i]),s=$t.useMemo(()=>i===void 0?t:i.reduce((c,d)=>c+(d.isCollapsed?1:d.rows+1),0),[i,t]),a=$t.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>o?.[c]?e.height:typeof n=="number"?n:n(c),[o,e,n]),l=$t.useCallback(c=>{if(i===void 0)return c;let d=c;for(const g of i){if(d===0)return;if(d--,!g.isCollapsed){if(d<g.rows)return g.contentIndex+d;d-=g.rows}}return c},[i]),u=Er(r??e?.themeOverride,$t.useCallback(c=>{if(e===void 0)return r?.(c,c,c);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:d,contentIndex:g,groupIndex:h}=Hs(c,i);return d?e.themeOverride:r?.(c,h,g)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:l,getRowThemeOverride:u}:{rowHeight:a,rows:s,rowNumberMapper:l,getRowThemeOverride:u}}function Sv(e,t){const n=$t.useMemo(()=>e===void 0?void 0:al(e,t),[e,t]);return{getRowGroupingForPath:Kd,updateRowGroupingByPath:jd,mapper:$t.useCallback(r=>{if(typeof r=="number")return Hs(r,n);const i=Hs(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function jd(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,s)=>s===r?{...o,...n}:o):e.map((o,s)=>s===r?{...o,subGroups:jd(o.subGroups??[],i,n)}:o)}function Kd(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Kd(e[n].subGroups??[],r)}function xv(e,t){const[n]=f.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}));return n.callback=t,n.facade}function kv(e,t,n,r,i){const[o,s]=f.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),a=f.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:s}),[r,s,o]),[l,u,c]=Rp(a),d=f.useRef(i);d.current=i;const g=xv(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),h=(l.height??1)>1;f.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&h){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&c(),d.current()}},[t,h,c,g]);const p=(l.width??1)>1;return f.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&p){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&c(),d.current()}},[e,p,c,g]),{visibleRegion:l,setVisibleRegion:u,scrollRef:g}}const Mv=f.lazy(async()=>await Us(()=>import("./data-grid-overlay-editor.DRTHOydk.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url));let Rv=0;function Iv(e){return Tm(Lu(Lu(e).filter(t=>t.span!==void 0).map(t=>Or((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Go(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 Xo={kind:Z.Loading,allowOverlay:!1},Yo={columns:Qe.empty(),rows:Qe.empty(),current:void 0},Ev=(e,t)=>{const[n,r]=f.useState(Yo),[i,o]=f.useState(),s=f.useRef(null),a=f.useRef(null),[l,u]=f.useState(),c=f.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:h,markdownDivCreateNode:p,width:m,height:y,columns:b,rows:v,getCellContent:C,onCellClicked:E,onCellActivated:I,onFillPattern:R,onFinishedEditing:P,coercePasteValue:x,drawHeader:S,drawCell:F,editorBloom:D,onHeaderClicked:M,onColumnProposeMove:T,rangeSelectionColumnSpanning:O=!0,spanRangeBehavior:k="default",onGroupHeaderClicked:$,onCellContextMenu:G,className:j,onHeaderContextMenu:ue,getCellsForSelection:Q,onGroupHeaderContextMenu:ee,onGroupHeaderRenamed:ce,onCellEdited:ae,onCellsEdited:ge,onSearchResultsChanged:de,searchResults:re,onSearchValueChange:H,searchValue:L,onKeyDown:X,onKeyUp:te,keybindings:ie,editOnType:Se=!0,onRowAppended:me,onColumnAppended:nt,onColumnMoved:xe,validateCell:gt,highlightRegions:Mt,rangeSelect:Ue="rect",columnSelect:ne="multi",rowSelect:oe="multi",rangeSelectionBlending:we="exclusive",columnSelectionBlending:fe="exclusive",rowSelectionBlending:ye="exclusive",onDelete:$e,onDragStart:Pe,onMouseMove:it,onPaste:Me,copyHeaders:qe=!1,freezeColumns:Te=0,cellActivationBehavior:Ee="second-click",rowSelectionMode:De="auto",onHeaderMenuClick:ft,onHeaderIndicatorClick:ot,getGroupDetails:Xe,rowGrouping:wt,onSearchClose:yt,onItemHovered:Ft,onSelectionCleared:It,showSearch:dn,onVisibleRegionChanged:Zt,gridSelection:fn,onGridSelectionChange:Ot,minColumnWidth:Ct=50,maxColumnWidth:Tn=500,maxColumnAutoWidth:pt,provideEditor:en,trailingRowOptions:Bt,freezeTrailingRows:Le=0,allowedFillDirections:St="orthogonal",scrollOffsetX:mt,scrollOffsetY:Dn,verticalBorder:Gt,onDragOverCell:hn,onDrop:On,onColumnResize:Xt,onColumnResizeEnd:tn,onColumnResizeStart:Be,customRenderers:Pt,fillHandle:$n,experimental:xt,fixedShadowX:Et,fixedShadowY:kn,headerIcons:cr,imageWindowLoader:Nn,initialSize:N,isDraggable:We,onDragLeave:Ge,onRowMoved:Rt,overscrollX:gn,overscrollY:ln,preventDiagonalScrolling:Mn,rightElement:wn,rightElementProps:Wt,trapFocus:yn=!1,smoothScrollX:Pn,smoothScrollY:Ce,scaleToRem:_t=!1,rowHeight:Jt=34,headerHeight:Ln=36,groupHeaderHeight:un=Ln,theme:Yt,isOutsideClick:jt,renderers:Cn,resizeIndicator:Bn,scrollToActiveCell:Ii=!0,drawFocusRing:Ar=!0,portalElementRef:Il}=e,Ei=Ar==="no-editor"?i===void 0:Ar,Wn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,Rn=Wn?.kind??e.rowMarkers??"none",Ti=Wn?.width??e.rowMarkerWidth,Hr=Wn?.startIndex??e.rowMarkerStartIndex??1,dr=Wn?.theme??e.rowMarkerTheme,ei=Wn?.headerTheme,br=Wn?.headerAlwaysVisible,wr=oe!=="multi"||Wn?.headerDisabled===!0,ti=Wn?.checkboxStyle??"square",fr=Math.max(Ct,20),ni=Math.max(Tn,fr),Ta=Math.max(pt??ni,fr),So=f.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:_e,rowNumberMapper:Di,rowHeight:xo,getRowThemeOverride:yr}=Cv(wt,v,Jt,h),Da=f.useMemo(()=>Number.parseFloat(So.fontSize),[So]),{rowHeight:ir,headerHeight:Oi,groupHeaderHeight:ko,theme:Mo,overscrollX:Pi,overscrollY:Oa}=bv({groupHeaderHeight:un,headerHeight:Ln,overscrollX:gn,overscrollY:ln,remSize:Da,rowHeight:xo,scaleToRem:_t,theme:Yt}),or=wv(ie),Cr=Ti??(v>1e4?48:v>1e3?44:v>100?36:32),Un=Rn!=="none",U=Un?1:0,At=Bt!==void 0,hr=Bt?.sticky===!0,[Li,Ro]=f.useState(!1),ri=dn??Li,Pa=f.useCallback(()=>{yt!==void 0?yt():Ro(!1)},[yt]),K=f.useMemo(()=>fn===void 0?void 0:Go(fn,U),[fn,U])??n,In=f.useRef();In.current===void 0&&(In.current=new AbortController),f.useEffect(()=>()=>In?.current.abort(),[]);const[z,se]=nv(Q,C,U,In.current,_e),ke=f.useCallback((w,A,_)=>{if(gt===void 0)return!0;const W=[w[0]-U,w[1]];return gt?.(W,A,_)},[U,gt]),Re=f.useRef(fn),le=f.useCallback((w,A)=>{A&&(w=uv(w,z,U,k,In.current)),Ot!==void 0?(Re.current=Go(w,-U),Ot(Re.current)):r(w)},[Ot,z,U,k]),ve=Er(Xt,f.useCallback((w,A,_,W)=>{Xt?.(b[_-U],A,_-U,W)},[Xt,U,b])),Ye=Er(tn,f.useCallback((w,A,_,W)=>{tn?.(b[_-U],A,_-U,W)},[tn,U,b])),Ie=Er(Be,f.useCallback((w,A,_,W)=>{Be?.(b[_-U],A,_-U,W)},[Be,U,b])),je=Er(S,f.useCallback((w,A)=>S?.({...w,columnIndex:w.columnIndex-U},A)??!1,[S,U])),ht=Er(F,f.useCallback((w,A)=>F?.({...w,col:w.col-U},A)??!1,[F,U])),Qt=f.useCallback(w=>{if($e!==void 0){const A=$e(Go(w,-U));return typeof A=="boolean"?A:Go(A,U)}return!0},[$e,U]),[ct,Tt,et]=tv(K,le,we,fe,ye,Ue,O),Je=f.useMemo(()=>pr(Pd(),Mo),[Mo]),[zt,Ut]=f.useState([0,0,0]),zr=f.useMemo(()=>{if(Cn===void 0)return{};const w={};for(const A of Cn)w[A.kind]=A;return w},[Cn]),nn=f.useCallback(w=>w.kind!==Z.Custom?zr[w.kind]:Pt?.find(A=>A.isMatch(w)),[Pt,zr]);let{sizedColumns:cn,nonGrowWidth:Sr}=ym(b,_e,se,zt[0]-(U===0?0:Cr)-zt[2],fr,Ta,Je,nn,In.current);Rn!=="none"&&(Sr+=Cr);const Lt=f.useMemo(()=>cn.some(w=>w.group!==void 0),[cn]),En=Lt?Oi+ko:Oi,Fn=K.rows.length,ii=Rn==="none"?void 0:Fn===0?!1:Fn===_e?!0:void 0,rt=f.useMemo(()=>Rn==="none"?cn:[{title:"",width:Cr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:dr,rowMarker:ti,rowMarkerChecked:ii,headerRowMarkerTheme:ei,headerRowMarkerAlwaysVisible:br,headerRowMarkerDisabled:wr},...cn],[Rn,cn,Cr,dr,ti,ii,ei,br,wr]),an=f.useRef({height:1,width:1,x:0,y:0}),Yn=f.useRef(!1),{setVisibleRegion:_i,visibleRegion:_n,scrollRef:Vt}=kv(mt,Dn,ir,an,()=>Yn.current=!0);an.current=_n;const La=_n.x+U,Io=_n.y,pn=f.useRef(null),Sn=f.useCallback(w=>{w===!0?pn.current?.focus():window.requestAnimationFrame(()=>{pn.current?.focus()})},[]),mn=At?_e+1:_e,qn=f.useCallback(w=>{const A=U===0?w:w.map(W=>({...W,location:[W.location[0]-U,W.location[1]]})),_=ge?.(A);if(_!==!0)for(const W of A)ae?.(W.location,W.value);return _},[ae,ge,U]),[Vr,Fa]=f.useState(),Eo=K.current!==void 0&&K.current.range.width*K.current.range.height>1?K.current.range:void 0,El=Ei?K.current?.cell:void 0,To=El?.[0],Do=El?.[1],eh=f.useMemo(()=>{if((Mt===void 0||Mt.length===0)&&(Eo??To??Do??Vr)===void 0)return;const w=[];if(Mt!==void 0)for(const A of Mt){const _=rt.length-A.range.x-U;_>0&&w.push({color:A.color,range:{...A.range,x:A.range.x+U,width:Math.min(_,A.range.width)},style:A.style})}return Vr!==void 0&&w.push({color:jr(Je.accentColor,0),range:Vr,style:"dashed"}),Eo!==void 0&&w.push({color:jr(Je.accentColor,.5),range:Eo,style:"solid-outline"}),To!==void 0&&Do!==void 0&&w.push({color:Je.accentColor,range:{x:To,y:Do,width:1,height:1},style:"solid-outline"}),w.length>0?w:void 0},[Vr,Eo,To,Do,Mt,rt.length,Je.accentColor,U]),Tl=f.useRef(rt);Tl.current=rt;const An=f.useCallback(([w,A],_=!1)=>{const W=At&&A===mn-1;if(w===0&&Un){if(W)return Xo;const Y=Di(A);return Y===void 0?Xo:{kind:Xn.Marker,allowOverlay:!1,checkboxStyle:ti,checked:K?.rows.hasIndex(A)===!0,markerKind:Rn==="clickable-number"?"number":Rn,row:Hr+Y,drawHandle:Rt!==void 0,cursor:Rn==="clickable-number"?"pointer":void 0}}else if(W){const V=w===U?Bt?.hint??"":"",B=Tl.current[w];if(B?.trailingRowOptions?.disabled===!0)return Xo;{const J=B?.trailingRowOptions?.hint??V,he=B?.trailingRowOptions?.addIcon??Bt?.addIcon;return{kind:Xn.NewRow,hint:J,allowOverlay:!1,icon:he}}}else{const Y=w-U;if(_||xt?.strict===!0){const B=an.current,J=B.x>Y||Y>B.x+B.width||B.y>A||A>B.y+B.height||A>=za.current,he=Y===B.extras?.selected?.[0]&&A===B.extras?.selected[1];let pe=!1;if(B.extras?.freezeRegions!==void 0){for(const kt of B.extras.freezeRegions)if(Yr(kt,Y,A)){pe=!0;break}}if(J&&!he&&!pe)return Xo}let V=C([Y,A]);return U!==0&&V.span!==void 0&&(V={...V,span:[V.span[0]+U,V.span[1]+U]}),V}},[At,mn,Un,Di,ti,K?.rows,Rn,Hr,Rt,U,Bt?.hint,Bt?.addIcon,xt?.strict,C]),_a=f.useCallback(w=>{let A=Xe?.(w)??{name:w};return ce!==void 0&&w!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:_=>$a({group:A.name,bounds:_.bounds})}]}),A},[Xe,ce]),Oo=f.useCallback(w=>{const[A,_]=w.cell,W=rt[A],q=W?.group!==void 0?_a(W.group)?.overrideTheme:void 0,Y=W?.themeOverride,V=yr?.(_);o({...w,theme:pr(Je,q,Y,V,w.content.themeOverride)})},[yr,rt,_a,Je]),oi=f.useCallback((w,A,_)=>{if(K.current===void 0)return;const[W,q]=K.current.cell,Y=An([W,q]);if(Y.kind!==Z.Boolean&&Y.allowOverlay){let V=Y;if(_!==void 0)switch(V.kind){case Z.Number:{const B=tp(()=>_==="-"?-0:Number.parseFloat(_),0);V={...V,data:Number.isNaN(B)?0:B};break}case Z.Text:case Z.Markdown:case Z.Uri:V={...V,data:_};break}Oo({target:w,content:V,initialValue:_,cell:[W,q],highlight:_===void 0,forceEditMode:_!==void 0,activation:A})}else Y.kind===Z.Boolean&&A.inputType==="keyboard"&&Y.readonly!==!0&&(qn([{location:K.current.cell,value:{...Y,data:Yd(Y.data)}}]),pn.current?.damage([{cell:K.current.cell}]))},[An,K,qn,Oo]),Dl=f.useCallback((w,A)=>{const _=pn.current?.getBounds(w,A);if(_===void 0||Vt.current===null)return;const W=An([w,A]);W.allowOverlay&&Oo({target:_,content:W,initialValue:void 0,highlight:!0,cell:[w,A],forceEditMode:!0,activation:{inputType:"keyboard",key:"Enter"}})},[An,Vt,Oo]),qt=f.useCallback((w,A,_="both",W=0,q=0,Y=void 0)=>{if(Vt.current!==null){const V=pn.current,B=a.current,J=typeof w!="number"?w.unit==="cell"?w.amount:void 0:w,he=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,pe=typeof w!="number"&&w.unit==="px"?w.amount:void 0,kt=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(V!==null&&B!==null){let tt={x:0,y:0,width:0,height:0},Ke=0,Ze=0;if((J!==void 0||he!==void 0)&&(tt=V.getBounds((J??0)+U,he??0)??tt,tt.width===0||tt.height===0))return;const ut=B.getBoundingClientRect(),vt=ut.width/B.offsetWidth;if(pe!==void 0&&(tt={...tt,x:pe-ut.left-Vt.current.scrollLeft,width:1}),kt!==void 0&&(tt={...tt,y:kt+ut.top-Vt.current.scrollTop,height:1}),tt!==void 0){const bt={x:tt.x-W,y:tt.y-q,width:tt.width+2*W,height:tt.height+2*q};let di=0;for(let Xa=0;Xa<Te;Xa++)di+=cn[Xa].width;let Bi=0;const Wi=Le+(hr?1:0);Wi>0&&(Bi=Qr(mn,Wi,ir));let sr=di*vt+ut.left+U*Cr*vt,fi=ut.right,Wr=ut.top+En*vt,hi=ut.bottom-Bi*vt;const zo=tt.width+W*2;switch(Y?.hAlign){case"start":fi=sr+zo;break;case"end":sr=fi-zo;break;case"center":sr=Math.floor((sr+fi)/2)-zo/2,fi=sr+zo;break}const Vo=tt.height+q*2;switch(Y?.vAlign){case"start":hi=Wr+Vo;break;case"end":Wr=hi-Vo;break;case"center":Wr=Math.floor((Wr+hi)/2)-Vo/2,hi=Wr+Vo;break}sr>bt.x?Ke=bt.x-sr:fi<bt.x+bt.width&&(Ke=bt.x+bt.width-fi),Wr>bt.y?Ze=bt.y-Wr:hi<bt.y+bt.height&&(Ze=bt.y+bt.height-hi),_==="vertical"||typeof w=="number"&&w<Te?Ke=0:(_==="horizontal"||typeof A=="number"&&A>=mn-Wi)&&(Ze=0),(Ke!==0||Ze!==0)&&(vt!==1&&(Ke/=vt,Ze/=vt),Vt.current.scrollTo({left:Ke+Vt.current.scrollLeft,top:Ze+Vt.current.scrollTop,behavior:Y?.behavior??"auto"}))}}}},[U,Le,Cr,Vt,En,Te,cn,mn,hr,ir]),Aa=f.useRef(Dl),Ha=f.useRef(C);Aa.current=Dl,Ha.current=C;const za=f.useRef(_e);za.current=_e;const Ol=f.useRef(rt.length);Ol.current=rt.length;const xr=f.useCallback(async(w,A=!0,_)=>{if(rt[w]?.trailingRowOptions?.disabled===!0)return;const q=me?.();let Y,V=!0;q!==void 0&&(Y=await q,Y==="top"&&(V=!1),typeof Y=="number"&&(V=!1));let B=0;const J=()=>{if(za.current<=_e){B<500&&window.setTimeout(J,B),B=50+B*2;return}const he=typeof Y=="number"?Y:V?_e:0;Ho.current(w-U,he,"both",0,0,_?{behavior:_}:void 0),ct({cell:[w,he],range:{x:w,y:he,width:1,height:1}},!1,!1,"edit");const pe=Ha.current([w-U,he]);pe.allowOverlay&&bi(pe)&&pe.readonly!==!0&&A&&window.setTimeout(()=>{Aa.current(w,he)},0)};J()},[rt,me,U,_e,ct]),Po=f.useCallback(async(w,A=!0)=>{const _=nt?.();let W,q=!0;_!==void 0&&(W=await _,W==="left"&&(q=!1),typeof W=="number"&&(q=!1));let Y=0;const V=()=>{if(Ol.current<=rt.length){Y<500&&window.setTimeout(V,Y),Y=50+Y*2;return}const B=typeof W=="number"?W:q?rt.length:0;qt(B-U,w),ct({cell:[B,w],range:{x:B,y:w,width:1,height:1}},!1,!1,"edit");const J=Ha.current([B-U,w]);J.allowOverlay&&bi(J)&&J.readonly!==!0&&A&&window.setTimeout(()=>{Aa.current(B,w)},0)};V()},[rt,nt,U,qt,ct]),ai=f.useCallback(w=>{const A=cn[w]?.trailingRowOptions?.targetColumn??Bt?.targetColumn;if(typeof A=="number")return A+(Un?1:0);if(typeof A=="object"){const _=b.indexOf(A);if(_>=0)return _+(Un?1:0)}},[cn,b,Un,Bt?.targetColumn]),kr=f.useRef(),si=f.useRef(),Ai=f.useCallback((w,A)=>{const[_,W]=A;return pr(Je,rt[_]?.themeOverride,yr?.(W),w.themeOverride)},[yr,rt,Je]),{mapper:$r}=Sv(wt,v),jn=wt?.navigationBehavior,Hi=f.useCallback(w=>{const A=fa.value?w.metaKey:w.ctrlKey,_=A&&oe==="multi",W=A&&ne==="multi",[q,Y]=w.location,V=K.columns,B=K.rows,[J,he]=K.current?.cell??[];if(w.kind==="cell"){if(si.current=void 0,Nr.current=[q,Y],q===0&&Un){if(At===!0&&Y===_e||Rn==="number"||oe==="none")return;const pe=An(w.location);if(pe.kind!==Xn.Marker)return;if(Rt!==void 0){const Ke=nn(pe);zn(Ke?.kind===Xn.Marker);const Ze=Ke?.onClick?.({...w,cell:pe,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,theme:Ai(pe,w.location),preventDefault:()=>{}});if(Ze===void 0||Ze.checked===pe.checked)return}o(void 0),Sn();const kt=B.hasIndex(Y),tt=kr.current;if(oe==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&tt!==void 0&&B.hasIndex(tt)){const Ke=[Math.min(tt,Y),Math.max(tt,Y)+1];_||De==="multi"?Tt(void 0,Ke,!0):Tt(Qe.fromSingleSelection(Ke),void 0,_)}else oe==="multi"&&(_||w.isTouch||De==="multi")?kt?Tt(B.remove(Y),void 0,!0):(Tt(void 0,Y,!0),kr.current=Y):kt&&B.length===1?Tt(Qe.empty(),void 0,A):(Tt(Qe.fromSingleSelection(Y),void 0,A),kr.current=Y)}else if(q>=U&&At&&Y===_e){const pe=ai(q);xr(pe??q)}else if(J!==q||he!==Y){const pe=An(w.location),kt=nn(pe);if(kt?.onSelect!==void 0){let Ze=!1;if(kt.onSelect({...w,cell:pe,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,preventDefault:()=>Ze=!0,theme:Ai(pe,w.location)}),Ze)return}if(jn==="block"&&$r(Y).isGroupHeader)return;const tt=hr&&Y===_e,Ke=hr&&K!==void 0&&K.current?.cell[1]===_e;if((w.shiftKey||w.isLongTouch===!0)&&J!==void 0&&he!==void 0&&K.current!==void 0&&!Ke){if(tt)return;const Ze=Math.min(q,J),ut=Math.max(q,J),vt=Math.min(Y,he),bt=Math.max(Y,he);ct({...K.current,range:{x:Ze,y:vt,width:ut-Ze+1,height:bt-vt+1}},!0,A,"click"),kr.current=void 0,Sn()}else ct({cell:[q,Y],range:{x:q,y:Y,width:1,height:1}},!0,A,"click"),kr.current=void 0,o(void 0),Sn()}}else if(w.kind==="header")if(Nr.current=[q,Y],o(void 0),Un&&q===0)kr.current=void 0,si.current=void 0,!wr&&oe==="multi"&&(B.length!==_e?Tt(Qe.fromSingleSelection([0,_e]),void 0,A):Tt(Qe.empty(),void 0,A),Sn());else{const pe=si.current;if(ne==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&pe!==void 0&&V.hasIndex(pe)){const kt=[Math.min(pe,q),Math.max(pe,q)+1];W?et(void 0,kt,A):et(Qe.fromSingleSelection(kt),void 0,A)}else W?(V.hasIndex(q)?et(V.remove(q),void 0,A):et(void 0,q,A),si.current=q):ne!=="none"&&(V.hasIndex(q)?et(V.remove(q),void 0,A):et(Qe.fromSingleSelection(q),void 0,A),si.current=q);kr.current=void 0,Sn()}else w.kind===Qn?Nr.current=[q,Y]:w.kind===ha&&!w.isMaybeScrollbar&&(le(Yo,!1),o(void 0),Sn(),It?.(),kr.current=void 0,si.current=void 0)},[oe,ne,K,Un,U,At,_e,Rn,An,Rt,Sn,De,nn,Ai,Tt,ai,xr,jn,$r,hr,ct,wr,et,le,It]),zi=f.useRef(!1),Nr=f.useRef(),Pl=f.useRef(_n),ar=f.useRef(),th=f.useCallback(w=>{if(li.current=!1,Pl.current=an.current,w.button!==0&&w.button!==1){ar.current=void 0;return}const A=performance.now();ar.current={button:w.button,time:A,location:w.location},w?.kind==="header"&&(zi.current=!0);const _=w.kind==="cell"&&w.isFillHandle;!_&&w.kind!=="cell"&&w.isEdge||(u({previousSelection:K,fillHandle:_}),Nr.current=void 0,!w.isTouch&&w.button===0&&!_?Hi(w):!w.isTouch&&w.button===1&&(Nr.current=w.location))},[K,Hi]),[Va,$a]=f.useState(),Ll=f.useCallback(w=>{if(w.kind!==Qn||ne!=="multi")return;const A=fa.value?w.metaKey:w.ctrlKey,[_]=w.location,W=K.columns;if(_<U)return;const q=rt[_];let Y=_,V=_;for(let B=_-1;B>=U&&ho(q.group,rt[B].group);B--)Y--;for(let B=_+1;B<rt.length&&ho(q.group,rt[B].group);B++)V++;if(Sn(),A)if(W.hasAll([Y,V+1])){let B=W;for(let J=Y;J<=V;J++)B=B.remove(J);et(B,void 0,A)}else et(void 0,[Y,V+1],A);else et(Qe.fromSingleSelection([Y,V+1]),void 0,A)},[ne,Sn,K.columns,rt,U,et]),li=f.useRef(!1),Lo=f.useCallback(async w=>{if(z!==void 0&&ve!==void 0){const A=an.current.y,_=an.current.height;let W=z({x:w,y:A,width:1,height:Math.min(_,_e-A)},In.current.signal);typeof W!="object"&&(W=await W());const q=cn[w-U],V=document.createElement("canvas").getContext("2d",{alpha:!1});if(V!==null){V.font=Je.baseFontFull;const B=_d(V,Je,q,0,W,fr,ni,!1,nn);ve?.(q,B.width,w,B.width)}}},[cn,z,ni,Je,fr,ve,U,_e,nn]),[nh,Na]=f.useState(),ui=f.useCallback(async(w,A)=>{const _=w.current?.range;if(_===void 0||z===void 0||A.current===void 0)return;const W=A.current.range;if(R!==void 0){let B=!1;if(R({fillDestination:{...W,x:W.x-U},patternSource:{..._,x:_.x-U},preventDefault:()=>B=!0}),B)return}let q=z(_,In.current.signal);typeof q!="object"&&(q=await q());const Y=q,V=[];for(let B=0;B<W.width;B++)for(let J=0;J<W.height;J++){const he=[W.x+B,W.y+J];if(xd(he,_))continue;const pe=Y[J%_.height][B%_.width];yi(pe)||!bi(pe)||V.push({location:he,value:{...pe}})}qn(V),pn.current?.damage(V.map(B=>({cell:B.location})))},[z,qn,R,U]),Fl=f.useCallback(()=>{if(K.current===void 0||K.current.range.width<=1)return;const w={...K,current:{...K.current,range:{...K.current.range,width:1}}};ui(w,K)},[ui,K]),_l=f.useCallback(()=>{if(K.current===void 0||K.current.range.height<=1)return;const w={...K,current:{...K.current,range:{...K.current.range,height:1}}};ui(w,K)},[ui,K]),rh=f.useCallback((w,A)=>{const _=l;if(u(void 0),Fa(void 0),Na(void 0),zi.current=!1,A)return;if(_?.fillHandle===!0&&K.current!==void 0&&_.previousSelection?.current!==void 0){if(Vr===void 0)return;const pe={...K,current:{...K.current,range:$d(_.previousSelection.current.range,Vr)}};ui(_.previousSelection,pe),le(pe,!0);return}const[W,q]=w.location,[Y,V]=Nr.current??[],B=()=>{li.current=!0},J=pe=>{const kt=pe.isTouch||Y===W&&V===q;if(kt&&E?.([W-U,q],{...pe,preventDefault:B}),pe.button===1)return!li.current;if(!li.current){const tt=An(w.location),Ke=nn(tt);if(Ke!==void 0&&Ke.onClick!==void 0&&kt){const ut=Ke.onClick({...pe,cell:tt,posX:pe.localEventX,posY:pe.localEventY,bounds:pe.bounds,theme:Ai(tt,w.location),preventDefault:B});ut!==void 0&&!yi(ut)&&vi(ut)&&(qn([{location:pe.location,value:ut}]),pn.current?.damage([{cell:pe.location}]))}if(li.current||K.current===void 0)return!1;let Ze=!1;switch(tt.activationBehaviorOverride??Ee){case"double-click":case"second-click":{if(_?.previousSelection?.current?.cell===void 0)break;const[ut,vt]=K.current.cell,[bt,di]=_.previousSelection.current.cell;Ze=W===ut&&W===bt&&q===vt&&q===di&&(pe.isDoubleClick===!0||Ee==="second-click");break}case"single-click":{Ze=!0;break}}if(Ze){const vt={inputType:"pointer",pointerActivation:pe.isDoubleClick===!0?"double-click":tt.activationBehaviorOverride??Ee,pointerType:pe.isTouch?"touch":"mouse"};return I?.([W-U,q],vt),oi(pe.bounds,vt),!0}}return!1},he=w.location[0]-U;if(w.isTouch){const pe=an.current,kt=Pl.current;if(pe.x!==kt.x||pe.y!==kt.y)return;if(w.isLongTouch===!0){if(w.kind==="cell"&&so(K.current?.cell,w.location)){G?.([he,w.location[1]],{...w,preventDefault:B});return}else if(w.kind==="header"&&K.columns.hasIndex(W)){ue?.(he,{...w,preventDefault:B});return}else if(w.kind===Qn){if(he<0)return;ee?.(he,{...w,preventDefault:B});return}}w.kind==="cell"?J(w)||Hi(w):w.kind===Qn?$?.(he,{...w,preventDefault:B}):(w.kind===Tr&&M?.(he,{...w,preventDefault:B}),Hi(w));return}if(w.kind==="header"){if(he<0)return;w.isEdge?w.isDoubleClick===!0&&Lo(W):w.button===0&&W===Y&&q===V&&M?.(he,{...w,preventDefault:B})}if(w.kind===Qn){if(he<0)return;w.button===0&&W===Y&&q===V&&($?.(he,{...w,preventDefault:B}),li.current||Ll(w))}w.kind==="cell"&&(w.button===0||w.button===1)&&J(w),Nr.current=void 0},[l,K,U,Vr,ui,le,E,An,nn,Ee,Ai,qn,I,oi,G,ue,ee,Hi,$,M,Lo,Ll]),ih=f.useCallback(w=>{const A={...w,location:[w.location[0]-U,w.location[1]]};it?.(A),l!==void 0&&w.buttons===0&&(u(void 0),Fa(void 0),Na(void 0),zi.current=!1),Na(_=>zi.current?[w.scrollEdge[0],0]:w.scrollEdge[0]===_?.[0]&&w.scrollEdge[1]===_[1]?_:l===void 0||(ar.current?.location[0]??0)<U?void 0:w.scrollEdge)},[l,it,U]),oh=f.useCallback((w,A)=>{ft?.(w-U,A)},[ft,U]),ah=f.useCallback((w,A)=>{ot?.(w-U,A)},[ot,U]),ci=K?.current?.cell,sh=f.useCallback((w,A,_,W,q,Y)=>{Yn.current=!1;let V=ci;V!==void 0&&(V=[V[0]-U,V[1]]);const B=Te===0?void 0:{x:0,y:w.y,width:Te,height:w.height},J=[];B!==void 0&&J.push(B),Le>0&&(J.push({x:w.x-U,y:_e-Le,width:w.width,height:Le}),Te>0&&J.push({x:0,y:_e-Le,width:Te,height:Le}));const he={x:w.x-U,y:w.y,width:w.width,height:At&&w.y+w.height>=_e?w.height-1:w.height,tx:q,ty:Y,extras:{selected:V,freezeRegion:B,freezeRegions:J}};an.current=he,_i(he),Ut([A,_,W]),Zt?.(he,he.tx,he.ty,he.extras)},[ci,U,At,_e,Te,Le,_i,Zt]),lh=Er(T,f.useCallback((w,A)=>T?.(w-U,A-U)!==!1,[T,U])),uh=Er(xe,f.useCallback((w,A)=>{xe?.(w-U,A-U),ne!=="none"&&et(Qe.fromSingleSelection(A),void 0,!0)},[ne,xe,U,et])),Ba=f.useRef(!1),ch=f.useCallback(w=>{if(w.location[0]===0&&U>0){w.preventDefault();return}Pe?.({...w,location:[w.location[0]-U,w.location[1]]}),w.defaultPrevented()||(Ba.current=!0),u(void 0)},[Pe,U]),dh=f.useCallback(()=>{Ba.current=!1},[]),Al=wt?.selectionBehavior,Fo=f.useCallback(w=>{if(Al!=="block-spanning")return;const{isGroupHeader:A,path:_,groupRows:W}=$r(w);if(A)return[w,w];const q=_[_.length-1],Y=w-q,V=w+W-q-1;return[Y,V]},[$r,Al]),Wa=f.useRef(),Ua=f.useCallback(w=>{if(!Gd(w,Wa.current)&&(Wa.current=w,!(ar?.current?.button!==void 0&&ar.current.button>=1))){if(w.buttons!==0&&l!==void 0&&ar.current?.location[0]===0&&w.location[0]===0&&U===1&&oe==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(ar.current.location[1])&&K.rows.hasIndex(ar.current.location[1])){const A=Math.min(ar.current.location[1],w.location[1]),_=Math.max(ar.current.location[1],w.location[1])+1;Tt(Qe.fromSingleSelection([A,_]),void 0,!1)}if(w.buttons!==0&&l!==void 0&&K.current!==void 0&&!Ba.current&&!zi.current&&(Ue==="rect"||Ue==="multi-rect")){const[A,_]=K.current.cell;let[W,q]=w.location;if(q<0&&(q=an.current.y),l.fillHandle===!0&&l.previousSelection?.current!==void 0){const Y=l.previousSelection.current.range;q=Math.min(q,At?_e-1:_e);const V=l0(Y,W,q,St);Fa(V)}else{if(At&&_===_e)return;if(At&&q===_e)if(w.kind===ha)q--;else return;W=Math.max(W,U);const B=Fo(_);q=B===void 0?q:Gn(q,B[0],B[1]);const J=W-A,he=q-_,pe={x:J>=0?A:W,y:he>=0?_:q,width:Math.abs(J)+1,height:Math.abs(he)+1};ct({...K.current,range:pe},!0,!1,"drag")}}Ft?.({...w,location:[w.location[0]-U,w.location[1]]})}},[l,U,oe,K,Ue,Ft,Tt,At,_e,St,Fo,ct]),fh=f.useCallback(()=>{const w=Wa.current;if(w===void 0)return;const[A,_]=w.scrollEdge;let[W,q]=w.location;const Y=an.current;A===-1?W=Y.extras?.freezeRegion?.x??Y.x:A===1&&(W=Y.x+Y.width),_===-1?q=Math.max(0,Y.y):_===1&&(q=Math.min(_e-1,Y.y+Y.height)),W=Gn(W,0,rt.length-1),q=Gn(q,0,_e-1),Ua({...w,location:[W,q]})},[rt.length,Ua,_e]);vv(nh,Vt,fh);const Kn=f.useCallback(w=>{if(K.current===void 0)return;const[A,_]=w,[W,q]=K.current.cell,Y=K.current.range;let V=Y.x,B=Y.x+Y.width,J=Y.y,he=Y.y+Y.height;const[pe,kt]=Fo(q)??[0,_e-1],tt=kt+1;if(_!==0)switch(_){case 2:{he=tt,J=q,qt(0,he,"vertical");break}case-2:{J=pe,he=q+1,qt(0,J,"vertical");break}case 1:{J<q?(J++,qt(0,J,"vertical")):(he=Math.min(tt,he+1),qt(0,he,"vertical"));break}case-1:{he>q+1?(he--,qt(0,he,"vertical")):(J=Math.max(pe,J-1),qt(0,J,"vertical"));break}default:co()}if(A!==0)if(A===2)B=rt.length,V=W,qt(B-1-U,0,"horizontal");else if(A===-2)V=U,B=W+1,qt(V-U,0,"horizontal");else{let Ke=[];if(z!==void 0){const Ze=z({x:V,y:J,width:B-V-U,height:he-J},In.current.signal);typeof Ze=="object"&&(Ke=Iv(Ze))}if(A===1){let Ze=!1;if(V<W){if(Ke.length>0){const ut=Or(V+1,W+1).find(vt=>!Ke.includes(vt-U));ut!==void 0&&(V=ut,Ze=!0)}else V++,Ze=!0;Ze&&qt(V,0,"horizontal")}Ze||(B=Math.min(rt.length,B+1),qt(B-1-U,0,"horizontal"))}else if(A===-1){let Ze=!1;if(B>W+1){if(Ke.length>0){const ut=Or(B-1,W,-1).find(vt=>!Ke.includes(vt-U));ut!==void 0&&(B=ut,Ze=!0)}else B--,Ze=!0;Ze&&qt(B-U,0,"horizontal")}Ze||(V=Math.max(U,V-1),qt(V-U,0,"horizontal"))}else co()}ct({cell:K.current.cell,range:{x:V,y:J,width:B-V,height:he-J}},!0,!1,"keyboard-select")},[z,Fo,K,rt.length,U,_e,qt,ct]),qa=f.useRef(Ii);qa.current=Ii;const Mr=f.useCallback((w,A,_,W)=>{const q=mn-(_?0:1);w=Gn(w,U,cn.length-1+U),A=Gn(A,0,q);const Y=ci?.[0],V=ci?.[1];if(w===Y&&A===V)return!1;if(W&&K.current!==void 0){const B=[...K.current.rangeStack];(K.current.range.width>1||K.current.range.height>1)&&B.push(K.current.range),le({...K,current:{cell:[w,A],range:{x:w,y:A,width:1,height:1},rangeStack:B}},!0)}else ct({cell:[w,A],range:{x:w,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===w&&c.current[1]===A&&(c.current=void 0),qa.current&&qt(w-U,A),!0},[mn,U,cn.length,ci,K,qt,le,ct]),hh=f.useCallback((w,A)=>{i?.cell!==void 0&&w!==void 0&&vi(w)&&(qn([{location:i.cell,value:w}]),window.requestAnimationFrame(()=>{pn.current?.damage([{cell:i.cell}])})),Sn(!0),o(void 0);const[_,W]=A;if(K.current!==void 0&&(_!==0||W!==0)){const q=K.current.cell[1]===mn-1&&w!==void 0,Y=K.current.cell[0]===rt.length-1&&w!==void 0;let V=!0;if(q&&W===1&&me!==void 0){V=!1;const B=K.current.cell[0]+_,J=ai(B);xr(J??B,!1)}if(Y&&_===1&&nt!==void 0){V=!1;const B=K.current.cell[1]+W;Po(B,!1)}V&&Mr(Gn(K.current.cell[0]+_,0,rt.length-1),Gn(K.current.cell[1]+W,0,mn-1),q,!1)}P?.(w,A)},[i?.cell,Sn,K,P,qn,mn,Mr,rt.length,xr,Po,me,nt,ai]),gh=f.useMemo(()=>`gdg-overlay-${Rv++}`,[]),Br=f.useCallback(w=>{Sn();const A=[];for(let _=w.x;_<w.x+w.width;_++)for(let W=w.y;W<w.y+w.height;W++){const q=C([_-U,W]);if(!q.allowOverlay&&q.kind!==Z.Boolean)continue;let Y;if(q.kind===Z.Custom){const V=nn(q),B=V?.provideEditor?.({...q,location:[_-U,W]});V?.onDelete!==void 0?Y=V.onDelete(q):np(B)&&(Y=B?.deletedValue?.(q))}else(vi(q)&&q.allowOverlay||q.kind===Z.Boolean)&&(Y=nn(q)?.onDelete?.(q));Y!==void 0&&!yi(Y)&&vi(Y)&&A.push({location:[_,W],value:Y})}qn(A),pn.current?.damage(A.map(_=>({cell:_.location})))},[Sn,C,nn,qn,U]),Vi=i!==void 0,Hl=f.useCallback(w=>{const A=()=>{w.stopPropagation(),w.preventDefault()},_={didMatch:!1},{bounds:W}=w,q=K.columns,Y=K.rows,V=or;if(!Vi&&at(V.clear,w,_))le(Yo,!1),It?.();else if(!Vi&&at(V.selectAll,w,_))le({columns:Qe.empty(),rows:Qe.empty(),current:{cell:K.current?.cell??[U,0],range:{x:U,y:0,width:b.length,height:_e},rangeStack:[]}},!1);else if(at(V.search,w,_))s?.current?.focus({preventScroll:!0}),Ro(!0);else if(at(V.delete,w,_)){const ut=Qt?.(K)??!0;if(ut!==!1){const vt=ut===!0?K:ut;if(vt.current!==void 0){Br(vt.current.range);for(const bt of vt.current.rangeStack)Br(bt)}for(const bt of vt.rows)Br({x:U,y:bt,width:b.length,height:1});for(const bt of vt.columns)Br({x:bt,y:0,width:1,height:_e})}}if(_.didMatch)return A(),!0;if(K.current===void 0)return!1;let[B,J]=K.current.cell;const[,he]=K.current.cell;let pe=!1,kt=!1;if(at(V.scrollToSelectedCell,w,_))Ho.current(B-U,J);else if(ne!=="none"&&at(V.selectColumn,w,_))q.hasIndex(B)?et(q.remove(B),void 0,!0):ne==="single"?et(Qe.fromSingleSelection(B),void 0,!0):et(void 0,B,!0);else if(oe!=="none"&&at(V.selectRow,w,_))Y.hasIndex(J)?Tt(Y.remove(J),void 0,!0):oe==="single"?Tt(Qe.fromSingleSelection(J),void 0,!0):Tt(void 0,J,!0);else if(!Vi&&W!==void 0&&at(V.activateCell,w,_))if(J===_e&&At)window.setTimeout(()=>{const ut=ai(B);xr(ut??B)},0);else{const ut={inputType:"keyboard",key:w.key};I?.([B-U,J],ut),oi(W,ut)}else K.current.range.height>1&&at(V.downFill,w,_)?_l():K.current.range.width>1&&at(V.rightFill,w,_)?Fl():at(V.goToNextPage,w,_)?J+=Math.max(1,an.current.height-4):at(V.goToPreviousPage,w,_)?J-=Math.max(1,an.current.height-4):at(V.goToFirstCell,w,_)?(o(void 0),J=0,B=0):at(V.goToLastCell,w,_)?(o(void 0),J=Number.MAX_SAFE_INTEGER,B=Number.MAX_SAFE_INTEGER):at(V.selectToFirstCell,w,_)?(o(void 0),Kn([-2,-2])):at(V.selectToLastCell,w,_)?(o(void 0),Kn([2,2])):Vi?(at(V.closeOverlay,w,_)&&o(void 0),at(V.acceptOverlayDown,w,_)&&(o(void 0),J++),at(V.acceptOverlayUp,w,_)&&(o(void 0),J--),at(V.acceptOverlayLeft,w,_)&&(o(void 0),B--),at(V.acceptOverlayRight,w,_)&&(o(void 0),B++)):(at(V.goDownCell,w,_)?J+=1:at(V.goUpCell,w,_)?J-=1:at(V.goRightCell,w,_)?B+=1:at(V.goLeftCell,w,_)?B-=1:at(V.goDownCellRetainSelection,w,_)?(J+=1,pe=!0):at(V.goUpCellRetainSelection,w,_)?(J-=1,pe=!0):at(V.goRightCellRetainSelection,w,_)?(B+=1,pe=!0):at(V.goLeftCellRetainSelection,w,_)?(B-=1,pe=!0):at(V.goToLastRow,w,_)?J=_e-1:at(V.goToFirstRow,w,_)?J=Number.MIN_SAFE_INTEGER:at(V.goToLastColumn,w,_)?B=Number.MAX_SAFE_INTEGER:at(V.goToFirstColumn,w,_)?B=Number.MIN_SAFE_INTEGER:(Ue==="rect"||Ue==="multi-rect")&&(at(V.selectGrowDown,w,_)?Kn([0,1]):at(V.selectGrowUp,w,_)?Kn([0,-1]):at(V.selectGrowRight,w,_)?Kn([1,0]):at(V.selectGrowLeft,w,_)?Kn([-1,0]):at(V.selectToLastRow,w,_)?Kn([0,2]):at(V.selectToFirstRow,w,_)?Kn([0,-2]):at(V.selectToLastColumn,w,_)?Kn([2,0]):at(V.selectToFirstColumn,w,_)&&Kn([-2,0])),kt=_.didMatch);if(jn!==void 0&&jn!=="normal"&&J!==he){const ut=jn==="skip-up"||jn==="skip"||jn==="block",vt=jn==="skip-down"||jn==="skip"||jn==="block",bt=J<he;if(bt&&ut){for(;J>=0&&$r(J).isGroupHeader;)J--;J<0&&(J=he)}else if(!bt&&vt){for(;J<_e&&$r(J).isGroupHeader;)J++;J>=_e&&(J=he)}}const Ke=Mr(B,J,!1,pe),Ze=_.didMatch;return Ze&&(Ke||!kt||yn)&&A(),Ze},[jn,Vi,K,or,ne,oe,Ue,U,$r,_e,Mr,le,It,b.length,Qt,yn,Br,et,Tt,At,ai,xr,I,oi,_l,Fl,Kn]),$i=f.useCallback(w=>{let A=!1;if(X!==void 0&&X({...w,...w.location&&{location:[w.location[0]-U,w.location[1]]},cancel:()=>{A=!0}}),A||Hl(w)||K.current===void 0)return;const[_,W]=K.current.cell,q=an.current;if(Se&&!w.metaKey&&!w.ctrlKey&&K.current!==void 0&&w.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(w.key)&&w.bounds!==void 0&&bi(C([_-U,Math.max(0,Math.min(W,_e-1))]))){if((!At||W!==_e)&&(q.y>W||W>q.y+q.height||q.x>_||_>q.x+q.width))return;const Y={inputType:"keyboard",key:w.key};I?.([_-U,W],Y),oi(w.bounds,Y,w.key),w.stopPropagation(),w.preventDefault()}},[Se,X,Hl,K,C,U,_e,At,I,oi]),ph=f.useCallback((w,A)=>{const _=w.location[0]-U;if(w.kind==="header"&&ue?.(_,{...w,preventDefault:A}),w.kind===Qn){if(_<0)return;ee?.(_,{...w,preventDefault:A})}if(w.kind==="cell"){const[W,q]=w.location;G?.([_,q],{...w,preventDefault:A}),im(K,w.location)||Mr(W,q,!1,!1)}},[K,G,ee,ue,U,Mr]),Ga=f.useCallback(async w=>{if(!or.paste)return;function A(V,B,J,he){const pe=typeof J=="object"?J?.join(`
173
173
  `)??"":J?.toString()??"";if(!yi(V)&&bi(V)&&V.readonly!==!0){const kt=x?.(pe,V);if(kt!==void 0&&vi(kt))return{location:B,value:kt};const tt=nn(V);if(tt===void 0)return;if(tt.kind===Z.Custom){zn(V.kind===Z.Custom);const Ke=tt.onPaste?.(pe,V.data);return Ke===void 0?void 0:{location:B,value:{...V,data:Ke}}}else{const Ke=tt.onPaste?.(pe,V,{formatted:he,formattedString:typeof he=="string"?he:he?.join(`
174
174
  `),rawValue:J});return Ke===void 0?void 0:(zn(Ke.kind===V.kind),{location:B,value:Ke})}}}const _=K.columns,W=K.rows,q=Vt.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0;let Y;if(K.current!==void 0?Y=[K.current.range.x,K.current.range.y]:_.length===1?Y=[_.first()??0,0]:W.length===1&&(Y=[U,W.first()??0]),q&&Y!==void 0){let V,B;const J="text/plain",he="text/html";if(navigator.clipboard.read!==void 0){const Ke=await navigator.clipboard.read();for(const Ze of Ke){if(Ze.types.includes(he)){const vt=await(await Ze.getType(he)).text(),bt=Bu(vt);if(bt!==void 0){V=bt;break}}Ze.types.includes(J)&&(B=await(await Ze.getType(J)).text())}}else if(navigator.clipboard.readText!==void 0)B=await navigator.clipboard.readText();else if(w!==void 0&&w?.clipboardData!==null){if(w.clipboardData.types.includes(he)){const Ke=w.clipboardData.getData(he);V=Bu(Ke)}V===void 0&&w.clipboardData.types.includes(J)&&(B=w.clipboardData.getData(J))}else return;const[pe,kt]=Y,tt=[];do{if(Me===void 0){const Ke=An(Y),Ze=B??V?.map(vt=>vt.map(bt=>bt.rawValue).join(" ")).join(" ")??"",ut=A(Ke,Y,Ze,void 0);ut!==void 0&&tt.push(ut);break}if(V===void 0){if(B===void 0)return;V=cv(B)}if(Me===!1||typeof Me=="function"&&Me?.([Y[0]-U,Y[1]],V.map(Ke=>Ke.map(Ze=>Ze.rawValue?.toString()??"")))!==!0)return;for(const[Ke,Ze]of V.entries()){if(Ke+kt>=_e)break;for(const[ut,vt]of Ze.entries()){const bt=[ut+pe,Ke+kt],[di,Bi]=bt;if(di>=rt.length||Bi>=mn)continue;const Wi=An(bt),sr=A(Wi,bt,vt.rawValue,vt.formatted);sr!==void 0&&tt.push(sr)}}}while(!1);qn(tt),pn.current?.damage(tt.map(Ke=>({cell:Ke.location})))}},[x,nn,An,K,or.paste,Vt,rt.length,qn,mn,Me,U,_e]);xn("paste",Ga,d,!1,!0);const Ni=f.useCallback(async(w,A)=>{if(!or.copy)return;const _=A===!0||Vt.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0,W=K.columns,q=K.rows,Y=(V,B)=>{if(!qe)Uu(V,B,w);else{const J=B.map(he=>({kind:Z.Text,data:b[he].title,displayData:b[he].title,allowOverlay:!1}));Uu([J,...V],B,w)}};if(_&&z!==void 0){if(K.current!==void 0){let V=z(K.current.range,In.current.signal);typeof V!="object"&&(V=await V()),Y(V,Or(K.current.range.x-U,K.current.range.x+K.current.range.width-U))}else if(q!==void 0&&q.length>0){const B=[...q].map(J=>{const he=z({x:U,y:J,width:b.length,height:1},In.current.signal);return typeof he=="object"?he[0]:he().then(pe=>pe[0])});if(B.some(J=>J instanceof Promise)){const J=await Promise.all(B);Y(J,Or(b.length))}else Y(B,Or(b.length))}else if(W.length>0){const V=[],B=[];for(const J of W){let he=z({x:J,y:0,width:1,height:_e},In.current.signal);typeof he!="object"&&(he=await he()),V.push(he),B.push(J-U)}if(V.length===1)Y(V[0],B);else{const J=V.reduce((he,pe)=>he.map((kt,tt)=>[...kt,...pe[tt]]));Y(J,B)}}}},[b,z,K,or.copy,U,Vt,_e,qe]);xn("copy",Ni,d,!1,!1);const mh=f.useCallback(async w=>{if(!(!or.cut||!(Vt.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0))&&(await Ni(w),K.current!==void 0)){let _={current:{cell:K.current.cell,range:K.current.range,rangeStack:[]},rows:Qe.empty(),columns:Qe.empty()};const W=Qt?.(_);if(W===!1||(_=W===!0?_:W,_.current===void 0))return;Br(_.current.range)}},[Br,K,or.cut,Ni,Vt,Qt]);xn("cut",mh,d,!1,!1);const vh=f.useCallback((w,A)=>{if(de!==void 0){U!==0&&(w=w.map(q=>[q[0]-U,q[1]])),de(w,A);return}if(w.length===0||A===-1)return;const[_,W]=w[A];c.current!==void 0&&c.current[0]===_&&c.current[1]===W||(c.current=[_,W],Mr(_,W,!1,!1))},[de,U,Mr]),[_o,Ao]=fn?.current?.cell??[],Ho=f.useRef(qt);Ho.current=qt,f.useLayoutEffect(()=>{qa.current&&!Yn.current&&_o!==void 0&&Ao!==void 0&&(_o!==Re.current?.current?.cell[0]||Ao!==Re.current?.current?.cell[1])&&Ho.current(_o,Ao),Yn.current=!1},[_o,Ao]);const zl=K.current!==void 0&&(K.current.cell[0]>=rt.length||K.current.cell[1]>=mn);f.useLayoutEffect(()=>{zl&&le(Yo,!1)},[zl,le]);const bh=f.useMemo(()=>At===!0&&Bt?.tint===!0?Qe.fromSingleSelection(mn-1):Qe.empty(),[mn,At,Bt?.tint]),wh=f.useCallback(w=>typeof Gt=="boolean"?Gt:Gt?.(w-U)??!0,[U,Gt]),yh=f.useMemo(()=>{if(Va===void 0||a.current===null)return null;const{bounds:w,group:A}=Va,_=a.current.getBoundingClientRect();return f.createElement(Q0,{bounds:w,group:A,canvasBounds:_,onClose:()=>$a(void 0),onFinish:W=>{$a(void 0),ce?.(A,W)}})},[ce,Va]),Ch=Math.min(rt.length,Te+(Un?1:0));f.useImperativeHandle(t,()=>({appendRow:(w,A)=>xr(w+U,A),appendColumn:(w,A)=>Po(w,A),updateCells:w=>(U!==0&&(w=w.map(A=>({cell:[A.cell[0]+U,A.cell[1]]}))),pn.current?.damage(w)),getBounds:(w,A)=>{if(!(a?.current===null||Vt?.current===null)){if(w===void 0&&A===void 0){const _=a.current.getBoundingClientRect(),W=_.width/Vt.current.clientWidth;return{x:_.x-Vt.current.scrollLeft*W,y:_.y-Vt.current.scrollTop*W,width:Vt.current.scrollWidth*W,height:Vt.current.scrollHeight*W}}return pn.current?.getBounds((w??0)+U,A)}},focus:()=>pn.current?.focus(),emit:async w=>{switch(w){case"delete":$i({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":$i({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":$i({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 Ni(void 0,!0);break;case"paste":await Ga();break}},scrollTo:qt,remeasureColumns:w=>{for(const A of w)Lo(A+U)},getMouseArgsForPosition:(w,A,_)=>{if(pn?.current===null)return;const W=pn.current.getMouseArgsForPosition(w,A,_);if(W!==void 0)return{...W,location:[W.location[0]-U,W.location[1]]}}}),[xr,Po,Lo,Vt,Ni,$i,Ga,U,qt]);const[Vl,$l]=ci??[],Sh=f.useCallback(w=>{const[A,_]=w;if(_===-1){ne!=="none"&&(et(Qe.fromSingleSelection(A),void 0,!1),Sn());return}Vl===A&&$l===_||(ct({cell:w,range:{x:A,y:_,width:1,height:1}},!0,!1,"keyboard-nav"),qt(A,_))},[ne,Sn,qt,Vl,$l,ct,et]),[xh,kh]=f.useState(!1),Nl=f.useRef(cd(w=>{kh(w)},5)),Mh=f.useCallback(()=>{Nl.current(!0),K.current===void 0&&K.columns.length===0&&K.rows.length===0&&l===void 0&&ct({cell:[U,Io],range:{x:U,y:Io,width:1,height:1}},!0,!1,"keyboard-select")},[Io,K,l,U,ct]),Rh=f.useCallback(()=>{Nl.current(!1)},[]),[Ih,Eh]=f.useMemo(()=>{let w;const A=xt?.scrollbarWidthOverride??Ts(),_=_e+(At?1:0);if(typeof ir=="number")w=En+_*ir;else{let q=0;const Y=Math.min(_,10);for(let V=0;V<Y;V++)q+=ir(V);q=Math.floor(q/Y),w=En+_*q}w+=A;const W=rt.reduce((q,Y)=>Y.width+q,0)+A;return[`${Math.min(1e5,W)}px`,`${Math.min(1e5,w)}px`]},[rt,xt?.scrollbarWidthOverride,ir,_e,At,En]),Th=f.useMemo(()=>bm(Je),[Je]);return f.createElement(Ld.Provider,{value:Je},f.createElement(gv,{style:Th,className:j,inWidth:m??Ih,inHeight:y??Eh},f.createElement(j0,{fillHandle:$n,drawFocusRing:Ei,experimental:xt,fixedShadowX:Et,fixedShadowY:kn,getRowThemeOverride:yr,headerIcons:cr,imageWindowLoader:Nn,initialSize:N,isDraggable:We,onDragLeave:Ge,onRowMoved:Rt,overscrollX:Pi,overscrollY:Oa,preventDiagonalScrolling:Mn,rightElement:wn,rightElementProps:Wt,smoothScrollX:Pn,smoothScrollY:Ce,className:j,enableGroups:Lt,onCanvasFocused:Mh,onCanvasBlur:Rh,canvasRef:a,onContextMenu:ph,theme:Je,cellXOffset:La,cellYOffset:Io,accessibilityHeight:_n.height,onDragEnd:dh,columns:rt,nonGrowWidth:Sr,drawHeader:je,onColumnProposeMove:lh,drawCell:ht,disabledRows:bh,freezeColumns:Ch,lockColumns:U,firstColAccessible:U===0,getCellContent:An,minColumnWidth:fr,maxColumnWidth:ni,searchInputRef:s,showSearch:ri,onSearchClose:Pa,highlightRegions:eh,getCellsForSelection:z,getGroupDetails:_a,headerHeight:Oi,isFocused:xh,groupHeaderHeight:Lt?ko:0,freezeTrailingRows:Le+(At&&Bt?.sticky===!0?1:0),hasAppendRow:At,onColumnResize:ve,onColumnResizeEnd:Ye,onColumnResizeStart:Ie,onCellFocused:Sh,onColumnMoved:uh,onDragStart:ch,onHeaderMenuClick:oh,onHeaderIndicatorClick:ah,onItemHovered:Ua,isFilling:l?.fillHandle===!0,onMouseMove:ih,onKeyDown:$i,onKeyUp:te,onMouseDown:th,onMouseUp:rh,onDragOverCell:hn,onDrop:On,onSearchResultsChanged:vh,onVisibleRegionChanged:sh,clientSize:zt,rowHeight:ir,searchResults:re,searchValue:L,onSearchValueChange:H,rows:mn,scrollRef:Vt,selection:K,translateX:_n.tx,translateY:_n.ty,verticalBorder:wh,gridRef:pn,getCellRenderer:nn,resizeIndicator:Bn}),yh,i!==void 0&&f.createElement(f.Suspense,{fallback:null},f.createElement(Mv,{...i,validateCell:ke,bloom:D,id:gh,getCellRenderer:nn,className:xt?.isSubGrid===!0?"click-outside-ignore":void 0,provideEditor:en,imageEditorOverride:g,portalElementRef:Il,onFinishEditing:hh,markdownDivCreateNode:p,isOutsideClick:jt,customEventTarget:xt?.eventTarget}))))},Tv=f.forwardRef(Ev);function Xu(e){const{cell:t,posX:n,posY:r,bounds:i,theme:o}=e,{width:s,height:a,x:l,y:u}=i,c=t.maxSize??o.checkboxMaxSize,d=Math.floor(i.y+a/2),g=hd(c,a,o.cellVerticalPadding),h=fd(t.contentAlign??"center",l,s,o.cellHorizontalPadding,g),p=dd(h,d,g),m=gd(l+n,u+r,p);return Xs(t)&&m}const Dv={getAccessibilityString:e=>e.data?.toString()??"false",kind:Z.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>Ov(e,e.cell.data,Xs(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{Xu(e)&&e.preventDefault()},onClick:e=>{if(Xu(e))return{...e.cell,data:Yd(e.cell.data)}},onPaste:(e,t)=>{let n=sa;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=Gs),n===t.data?void 0:{...t,data:n}}};function Ov(e,t,n,r,i){if(!n&&t===sa)return;const{ctx:o,hoverAmount:s,theme:a,rect:l,highlighted:u,hoverX:c,hoverY:d,cell:{contentAlign:g}}=e,{x:h,y:p,width:m,height:y}=l;let b=!1;if(i>0){let v=n?1-i+i*s:.4;if(t===sa&&(v*=s),v===0)return;v<1&&(b=!0,o.globalAlpha=v)}il(o,a,t,h,p,m,y,u,c,d,r,g),b&&(o.globalAlpha=1)}const Pv=sn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),Lv=e=>{const{bubbles:t}=e;return f.createElement(Pv,null,t.map((n,r)=>f.createElement("div",{key:r,className:"boe-bubble"},n)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},Fv={getAccessibilityString:e=>pd(e.data),kind:Z.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>{const r=t.data.reduce((i,o)=>e.measureText(o).width+i+n.bubblePadding*2+n.bubbleMargin,0);return t.data.length===0?n.cellHorizontalPadding*2:r+2*n.cellHorizontalPadding-n.bubbleMargin},draw:e=>_v(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(Lv,{bubbles:t.data})},onPaste:()=>{}};function _v(e,t){const{rect:n,theme:r,ctx:i,highlighted:o}=e,{x:s,y:a,width:l,height:u}=n;let c=s+r.cellHorizontalPadding;const d=[];for(const g of t){if(c>s+l)break;const h=Fr(g,i,r.baseFontFull).width;d.push({x:c,width:h}),c+=h+r.bubblePadding*2+r.bubbleMargin}i.beginPath();for(const g of d)tr(i,g.x,a+(u-r.bubbleHeight)/2,g.width+r.bubblePadding*2,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2);i.fillStyle=o?r.bgBubbleSelected:r.bgBubble,i.fill();for(const[g,h]of d.entries())i.beginPath(),i.fillStyle=r.textBubble,i.fillText(t[g],h.x+r.bubblePadding,a+u/2+rr(i,r))}const Av=sn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),Hv=e=>{const{drilldowns:t}=e;return f.createElement(Av,null,t.map((n,r)=>f.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&f.createElement("img",{src:n.img}),f.createElement("div",null,n.text))))},zv={getAccessibilityString:e=>pd(e.data.map(t=>t.text)),kind:Z.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,i)=>e.measureText(i.text).width+r+n.bubblePadding*2+n.bubbleMargin+(i.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>$v(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(Hv,{drilldowns:t.data})},onPaste:()=>{}},hs={};function Vv(e,t,n,r){const i=Math.ceil(window.devicePixelRatio),o=5,s=n-o*2,a=4,l=n*i,u=r+o,c=r*3,d=(c+o*2)*i,g=`${e},${t},${i},${n}`;if(hs[g]!==void 0)return{el:hs[g],height:l,width:d,middleWidth:a*i,sideWidth:u*i,padding:o*i,dpr:i};const h=document.createElement("canvas"),p=h.getContext("2d");return p===null?null:(h.width=d,h.height=l,p.scale(i,i),hs[g]=h,p.beginPath(),tr(p,o,o,c,s,r),p.shadowColor="rgba(24, 25, 34, 0.4)",p.shadowBlur=1,p.fillStyle=e,p.fill(),p.shadowColor="rgba(24, 25, 34, 0.3)",p.shadowOffsetY=1,p.shadowBlur=5,p.fillStyle=e,p.fill(),p.shadowOffsetY=0,p.shadowBlur=0,p.shadowBlur=0,p.beginPath(),tr(p,o+.5,o+.5,c,s,r),p.strokeStyle=t,p.lineWidth=1,p.stroke(),{el:h,height:l,width:d,sideWidth:u*i,middleWidth:r*i,padding:o*i,dpr:i})}function $v(e,t){const{rect:n,theme:r,ctx:i,imageLoader:o,col:s,row:a}=e,{x:l,width:u}=n,c=r.baseFontFull,d=el(i,c),g=Math.min(n.height,Math.max(16,Math.ceil(d*r.lineHeight)*2)),h=Math.floor(n.y+(n.height-g)/2),p=g-10,m=r.bubblePadding,y=r.bubbleMargin;let b=l+r.cellHorizontalPadding;const v=r.roundingRadius??6,C=Vv(r.bgCell,r.drilldownBorder,g,v),E=[];for(const I of t){if(b>l+u)break;const P=Fr(I.text,i,c).width;let x=0;I.img!==void 0&&o.loadOrGetImage(I.img,s,a)!==void 0&&(x=p-8+4);const S=P+x+m*2;E.push({x:b,width:S}),b+=S+y}if(C!==null){const{el:I,height:R,middleWidth:P,sideWidth:x,width:S,dpr:F,padding:D}=C,M=x/F,T=D/F;for(const O of E){const k=Math.floor(O.x),$=Math.floor(O.width),G=$-(M-T)*2;i.imageSmoothingEnabled=!1,i.drawImage(I,0,0,x,R,k-T,h,M,g),G>0&&i.drawImage(I,x,0,P,R,k+(M-T),h,G,g),i.drawImage(I,S-x,0,x,R,k+$-(M-T),h,M,g),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[I,R]of E.entries()){const P=t[I];let x=R.x+m;if(P.img!==void 0){const S=o.loadOrGetImage(P.img,s,a);if(S!==void 0){const F=p-8;let D=0,M=0,T=S.width,O=S.height;T>O?(D+=(T-O)/2,T=O):O>T&&(M+=(O-T)/2,O=T),i.beginPath(),tr(i,x,h+g/2-F/2,F,F,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(S,D,M,T,O,x,h+g/2-F/2,F,F),i.restore(),x+=F+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(P.text,x,h+g/2+rr(i,r))}}const Nv={getAccessibilityString:e=>e.data.join(", "),kind:Z.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>Bv(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:r}=e,i=r??Ep;return f.createElement(i,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:o=>{n({...t,data:[o]})}})},onPaste:(e,t)=>{e=e.trim();const r=e.split(",").map(i=>{try{return new URL(i),i}catch{return}}).filter(i=>i!==void 0);if(!(r.length===t.data.length&&r.every((i,o)=>i===t.data[o])))return{...t,data:r}}},gs=4;function Bv(e,t,n,r){const{rect:i,col:o,row:s,theme:a,ctx:l,imageLoader:u}=e,{x:c,y:d,height:g,width:h}=i,p=g-a.cellVerticalPadding*2,m=[];let y=0;for(let v=0;v<t.length;v++){const C=t[v];if(C.length===0)continue;const E=u.loadOrGetImage(C,o,s);if(E!==void 0){m[v]=E;const I=E.width*(p/E.height);y+=I+gs}}if(y===0)return;y-=gs;let b=c+a.cellHorizontalPadding;r==="right"?b=Math.floor(c+h-a.cellHorizontalPadding-y):r==="center"&&(b=Math.floor(c+h/2-y/2));for(const v of m){if(v===void 0)continue;const C=v.width*(p/v.height);n>0&&(l.beginPath(),tr(l,b,d+a.cellVerticalPadding,C,p,n),l.save(),l.clip()),l.drawImage(v,b,d+a.cellVerticalPadding,C,p),n>0&&l.restore(),b+=C+gs}}function Wv(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const Uv={getAccessibilityString:()=>"",kind:Z.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:i,rect:o,theme:s}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let a=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(a+=Math.round(Wv(n,r)*t.skeletonWidthVariability));const l=s.cellHorizontalPadding;a+l*2>=o.width&&(a=o.width-l*2-1);const u=t.skeletonHeight??Math.min(18,o.height-2*s.cellVerticalPadding);tr(i,o.x+l,o.y+(o.height-u)/2,a,u,s.roundingRadius??3),i.fillStyle=jr(s.textDark,.1),i.fill()},onPaste:()=>{}},qv=()=>e=>e.targetWidth,Yu=sn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[qv(),"px"]}}),Gv=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:i,targetRect:o,onFinish:s,validatedSelection:a}=e,l=t.data,u=t.readonly===!0,[c,d]=f.useState(l===""||r),g=f.useCallback(()=>{d(p=>!p)},[]),h=l?"gdg-ml-6":"";return c?f.createElement(Yu,{targetWidth:o.width-20},f.createElement(Jr,{autoFocus:!0,highlight:!1,validatedSelection:a,value:l,onKeyDown:p=>{p.key==="Enter"&&p.stopPropagation()},onChange:n}),f.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${h}`,onClick:()=>s(t)},f.createElement(Cp,null))):f.createElement(Yu,{targetWidth:o.width},f.createElement(Xp,{contents:l,createNode:i}),!u&&f.createElement(f.Fragment,null,f.createElement("div",{className:"spacer"}),f.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${h}`,onClick:g},f.createElement(js,null))),f.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Xv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:yo,measure:(e,t,n)=>{const r=t.data.split(`
175
- `)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>lr(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:i,markdownDivCreateNode:o,forceEditMode:s,validatedSelection:a}=e;return f.createElement(Gv,{onFinish:i,targetRect:r,value:n,validatedSelection:a,onChange:l=>t({...n,data:l.target.value}),forceEditMode:s,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Yv={getAccessibilityString:e=>e.row.toString(),kind:Xn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:jv,measure:()=>44,draw:e=>Zv(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:i}=e,{width:o,height:s}=t,a=n.drawHandle?7+(o-7)/2:o/2,l=s/2;if(Math.abs(r-a)<=10&&Math.abs(i-l)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function jv(e,t){const{ctx:n,theme:r}=e,i=r.markerFontFull,o=t??{};return o?.font!==i&&(n.font=i,o.font=i),o.deprep=Kv,n.textAlign="center",o}function Kv(e){const{ctx:t}=e;t.textAlign="start"}function Zv(e,t,n,r,i,o){const{ctx:s,rect:a,hoverAmount:l,theme:u}=e,{x:c,y:d,width:g,height:h}=a,p=n?1:r==="checkbox-visible"?.6+.4*l:l;if(r!=="number"&&p>0){s.globalAlpha=p;const m=7*(n?l:1);if(il(s,u,n,i?c+m:c,d,i?g-m:g,h,!0,void 0,void 0,u.checkboxMaxSize,"center",o),i){s.globalAlpha=l,s.beginPath();for(const y of[3,6])for(const b of[-5,-1,3])s.rect(c+y,d+h/2+b,2,2);s.fillStyle=u.textLight,s.fill(),s.beginPath()}s.globalAlpha=1}if(r==="number"||r==="both"&&!n){const m=t.toString(),y=u.markerFontFull,b=c+g/2;r==="both"&&l!==0&&(s.globalAlpha=1-l),s.fillStyle=u.textLight,s.font=y,s.fillText(m,b,d+h/2+rr(s,y)),l!==0&&(s.globalAlpha=1)}}const Jv={getAccessibilityString:()=>"",kind:Xn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Qv(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Qv(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:s,spriteManager:a}=e,{x:l,y:u,width:c,height:d}=i;r.beginPath(),r.globalAlpha=o,r.rect(l+1,u+1,c,d-2),r.fillStyle=s.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let h=0;if(n!==void 0){const m=d-8,y=l+8/2,b=u+8/2;a.drawSprite(n,"normal",r,y,b,m,s,g?1:o),h=m}else{h=24;const p=12,m=g?p:o*p,y=g?0:(1-o)*p*.5,b=s.cellHorizontalPadding+4;m>0&&(r.moveTo(l+b+y,u+d/2),r.lineTo(l+b+y+m,u+d/2),r.moveTo(l+b+y+m*.5,u+d/2-m*.5),r.lineTo(l+b+y+m*.5,u+d/2+m*.5),r.lineWidth=2,r.strokeStyle=s.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=s.textMedium,r.fillText(t,h+l+s.cellHorizontalPadding+.5,u+d/2+rr(r,s)),r.beginPath()}function Zd(e,t,n,r,i,o,s){e.textBaseline="alphabetic";const a=eb(e,i,r,t,n?.fullSize??!1);e.beginPath(),tr(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=n?.bgColor??jr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",s?.("text")}function eb(e,t,n,r,i){const o=r.cellHorizontalPadding,s=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+s/2+1,width:t.width-o,height:t.height-s-1};const a=Fr(n,e,r.baseFontFull,"alphabetic"),l=t.height-s,u=Math.min(l,a.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:a.width+o*3,height:u-1}}const tb=f.lazy(async()=>await Us(()=>import("./number-overlay-editor.BZb9zRl_.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url)),nb={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:yo,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:i,rect:o,overrideCursor:s}=e,{hoverEffect:a,displayData:l,hoverEffectTheme:u}=n;a===!0&&t>0&&Zd(r,i,u,l,o,t,s),lr(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return f.createElement(f.Suspense,{fallback:null},f.createElement(tb,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:i,onChange:o=>n({...r,data:Number.isNaN(o.floatValue??0)?0:o.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}}},rb={getAccessibilityString:()=>"",measure:()=>108,kind:Z.Protected,needsHover:!1,needsHoverPosition:!1,draw:ib,onPaste:()=>{}};function ib(e){const{ctx:t,theme:n,rect:r}=e,{x:i,y:o,height:s}=r;t.beginPath();const a=2.5;let l=i+n.cellHorizontalPadding+a;const u=o+s/2,c=Math.cos(gu(30))*a,d=Math.sin(gu(30))*a;for(let g=0;g<12;g++)t.moveTo(l,u-a),t.lineTo(l,u+a),t.moveTo(l+c,u-d),t.lineTo(l-c,u+d),t.moveTo(l-c,u-d),t.lineTo(l+c,u+d),l+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const ob={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>yo(e,t,e.theme.textLight),draw:e=>lr(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return $t.createElement(Jr,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},ab={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:yo,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:o,theme:s,overrideCursor:a}=e,{displayData:l,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:g}=t;c===!0&&n>0&&Zd(i,s,g,l,o,n,a),lr(e,l,u,d,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
175
+ `)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>lr(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:i,markdownDivCreateNode:o,forceEditMode:s,validatedSelection:a}=e;return f.createElement(Gv,{onFinish:i,targetRect:r,value:n,validatedSelection:a,onChange:l=>t({...n,data:l.target.value}),forceEditMode:s,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Yv={getAccessibilityString:e=>e.row.toString(),kind:Xn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:jv,measure:()=>44,draw:e=>Zv(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:i}=e,{width:o,height:s}=t,a=n.drawHandle?7+(o-7)/2:o/2,l=s/2;if(Math.abs(r-a)<=10&&Math.abs(i-l)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function jv(e,t){const{ctx:n,theme:r}=e,i=r.markerFontFull,o=t??{};return o?.font!==i&&(n.font=i,o.font=i),o.deprep=Kv,n.textAlign="center",o}function Kv(e){const{ctx:t}=e;t.textAlign="start"}function Zv(e,t,n,r,i,o){const{ctx:s,rect:a,hoverAmount:l,theme:u}=e,{x:c,y:d,width:g,height:h}=a,p=n?1:r==="checkbox-visible"?.6+.4*l:l;if(r!=="number"&&p>0){s.globalAlpha=p;const m=7*(n?l:1);if(il(s,u,n,i?c+m:c,d,i?g-m:g,h,!0,void 0,void 0,u.checkboxMaxSize,"center",o),i){s.globalAlpha=l,s.beginPath();for(const y of[3,6])for(const b of[-5,-1,3])s.rect(c+y,d+h/2+b,2,2);s.fillStyle=u.textLight,s.fill(),s.beginPath()}s.globalAlpha=1}if(r==="number"||r==="both"&&!n){const m=t.toString(),y=u.markerFontFull,b=c+g/2;r==="both"&&l!==0&&(s.globalAlpha=1-l),s.fillStyle=u.textLight,s.font=y,s.fillText(m,b,d+h/2+rr(s,y)),l!==0&&(s.globalAlpha=1)}}const Jv={getAccessibilityString:()=>"",kind:Xn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Qv(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Qv(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:s,spriteManager:a}=e,{x:l,y:u,width:c,height:d}=i;r.beginPath(),r.globalAlpha=o,r.rect(l+1,u+1,c,d-2),r.fillStyle=s.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let h=0;if(n!==void 0){const m=d-8,y=l+8/2,b=u+8/2;a.drawSprite(n,"normal",r,y,b,m,s,g?1:o),h=m}else{h=24;const p=12,m=g?p:o*p,y=g?0:(1-o)*p*.5,b=s.cellHorizontalPadding+4;m>0&&(r.moveTo(l+b+y,u+d/2),r.lineTo(l+b+y+m,u+d/2),r.moveTo(l+b+y+m*.5,u+d/2-m*.5),r.lineTo(l+b+y+m*.5,u+d/2+m*.5),r.lineWidth=2,r.strokeStyle=s.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=s.textMedium,r.fillText(t,h+l+s.cellHorizontalPadding+.5,u+d/2+rr(r,s)),r.beginPath()}function Zd(e,t,n,r,i,o,s){e.textBaseline="alphabetic";const a=eb(e,i,r,t,n?.fullSize??!1);e.beginPath(),tr(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=n?.bgColor??jr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",s?.("text")}function eb(e,t,n,r,i){const o=r.cellHorizontalPadding,s=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+s/2+1,width:t.width-o,height:t.height-s-1};const a=Fr(n,e,r.baseFontFull,"alphabetic"),l=t.height-s,u=Math.min(l,a.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:a.width+o*3,height:u-1}}const tb=f.lazy(async()=>await Us(()=>import("./number-overlay-editor.DaRFzZEO.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url)),nb={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:yo,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:i,rect:o,overrideCursor:s}=e,{hoverEffect:a,displayData:l,hoverEffectTheme:u}=n;a===!0&&t>0&&Zd(r,i,u,l,o,t,s),lr(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return f.createElement(f.Suspense,{fallback:null},f.createElement(tb,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:i,onChange:o=>n({...r,data:Number.isNaN(o.floatValue??0)?0:o.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}}},rb={getAccessibilityString:()=>"",measure:()=>108,kind:Z.Protected,needsHover:!1,needsHoverPosition:!1,draw:ib,onPaste:()=>{}};function ib(e){const{ctx:t,theme:n,rect:r}=e,{x:i,y:o,height:s}=r;t.beginPath();const a=2.5;let l=i+n.cellHorizontalPadding+a;const u=o+s/2,c=Math.cos(gu(30))*a,d=Math.sin(gu(30))*a;for(let g=0;g<12;g++)t.moveTo(l,u-a),t.lineTo(l,u+a),t.moveTo(l+c,u-d),t.lineTo(l-c,u+d),t.moveTo(l-c,u-d),t.lineTo(l+c,u+d),l+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const ob={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>yo(e,t,e.theme.textLight),draw:e=>lr(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return $t.createElement(Jr,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},ab={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:yo,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:o,theme:s,overrideCursor:a}=e,{displayData:l,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:g}=t;c===!0&&n>0&&Zd(i,s,g,l,o,n,a),lr(e,l,u,d,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
176
176
  `,t.allowWrapping===!0?void 0:1);let i=0;for(const o of r)i=Math.max(i,e.measureText(o).width);return i+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:r,value:i,validatedSelection:o}=t;return f.createElement(Jr,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:i.readonly!==!0,disabled:i.readonly===!0,altNewline:!0,value:i.data,validatedSelection:o,onChange:s=>r({...i,data:s.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},sb=sn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),lb=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:i,validatedSelection:o,preview:s}=e,[a,l]=f.useState(!i&&(t===""||r)),u=f.useCallback(()=>{l(!0)},[]);return a?f.createElement(Jr,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):f.createElement(sb,null,f.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},s),!i&&f.createElement("div",{className:"gdg-edit-icon",onClick:u},f.createElement(js,null)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function Jd(e,t,n,r){let i=n.cellHorizontalPadding;const o=t.height/2-e.actualBoundingBoxAscent/2,s=e.width,a=e.actualBoundingBoxAscent;return r==="right"?i=t.width-s-n.cellHorizontalPadding:r==="center"&&(i=t.width/2-s/2),{x:i,y:o,width:s,height:a}}function ju(e){const{cell:t,bounds:n,posX:r,posY:i,theme:o}=e,s=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const a=Id(s,o.baseFontFull);if(a===void 0)return!1;const l=Jd(a,n,o,t.contentAlign);return Yr({x:l.x-4,y:l.y-4,width:l.width+8,height:l.height+8},r,i)}const ub={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:yo,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:i,hoverY:o,rect:s,ctx:a}=e,l=t.displayData??t.data,u=t.hoverEffect===!0;if(r!==void 0&&u&&i!==void 0&&o!==void 0){const c=Fr(l,a,n.baseFontFull),d=Jd(c,s,n,t.contentAlign),{x:g,y:h,width:p,height:m}=d;if(i>=g-4&&i<=g-4+p+8&&o>=h-4&&o<=h-4+m+8){const y=rr(a,n.baseFontFull);r("pointer");const b=5,v=h-y;a.beginPath(),a.moveTo(s.x+g,Math.floor(s.y+v+m+b)+.5),a.lineTo(s.x+g+p,Math.floor(s.y+v+m+b)+.5),a.strokeStyle=n.linkColor,a.stroke(),a.save(),a.fillStyle=e.cellFillColor,lr({...e,rect:{...s,x:s.x-1}},l,t.contentAlign),lr({...e,rect:{...s,x:s.x-2}},l,t.contentAlign),lr({...e,rect:{...s,x:s.x+1}},l,t.contentAlign),lr({...e,rect:{...s,x:s.x+2}},l,t.contentAlign),a.restore()}}a.fillStyle=u?n.linkColor:n.textDark,lr(e,l,t.contentAlign)},onSelect:e=>{ju(e)&&e.preventDefault()},onClick:e=>{const{cell:t}=e;ju(e)&&t.onClickUri?.(e)},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:r,forceEditMode:i,validatedSelection:o}=t;return f.createElement(lb,{forceEditMode:r.readonly!==!0&&(i||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:o,readonly:r.readonly===!0,onChange:s=>n({...r,data:s.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},cb=[Yv,Jv,Dv,Fv,zv,Nv,Uv,Xv,nb,rb,ob,ab,ub];var ps,Ku;function db(){if(Ku)return ps;Ku=1;var e=ud(),t=$c(),n="Expected a function";function r(i,o,s){var a=!0,l=!0;if(typeof i!="function")throw new TypeError(n);return t(s)&&(a="leading"in s?!!s.leading:a,l="trailing"in s?!!s.trailing:l),e(i,o,{leading:a,maxWait:o,trailing:l})}return ps=r,ps}var fb=db();const hb=vr(fb),ms=[];class gb extends Dd{imageLoaded=()=>{};loadedLocations=[];cache={};setCallback(t){this.imageLoaded=t}sendLoaded=hb(()=>{this.imageLoaded(new uo(this.loadedLocations)),this.loadedLocations=[]},20);clearOutOfWindow=()=>{const t=Object.keys(this.cache);for(const n of t){const r=this.cache[n];let i=!1;for(let o=0;o<r.cells.length;o++){const s=r.cells[o];if(this.isInWindow(s)){i=!0;break}}i?r.cells=r.cells.filter(this.isInWindow):(r.cancel(),delete this.cache[n])}};loadImage(t,n,r,i){let o=!1;const s=ms.pop()??new Image;let a=!1;const l={img:void 0,cells:[er(n,r)],url:t,cancel:()=>{a||(a=!0,ms.length<12?ms.unshift(s):o||(s.src=""))}},u=new Promise(c=>s.addEventListener("load",()=>c(null)));requestAnimationFrame(async()=>{try{s.src=t,await u,await s.decode();const c=this.cache[i];if(c!==void 0&&!a){c.img=s;for(const d of c.cells)this.loadedLocations.push(rl(d));o=!0,this.sendLoaded()}}catch{l.cancel()}}),this.cache[i]=l}loadOrGetImage(t,n,r){const i=t,o=this.cache[i];if(o!==void 0){const s=er(n,r);return o.cells.includes(s)||o.cells.push(s),o.img}else this.loadImage(t,n,r,i)}}const pb=(e,t)=>{const n=f.useMemo(()=>({...o0,...e.headerIcons}),[e.headerIcons]),r=f.useMemo(()=>e.renderers??cb,[e.renderers]),i=f.useMemo(()=>e.imageWindowLoader??new gb,[e.imageWindowLoader]);return f.createElement(Tv,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:i})},mb=f.forwardRef(pb);function Zu(e,t){const n=f.useRef(null),r=f.useRef(),i=f.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return f.useEffect(()=>i,[i]),{debouncedCallback:f.useCallback((...s)=>{r.current=s,i(),n.current=setTimeout(()=>{r.current&&(e(...r.current),r.current=void 0)},t)},[e,t,i]),cancel:i}}var vb=Nh();const bb=vr(vb);var ra={exports:{}};/*! Moment Duration Format v2.2.2
177
177
  * https://github.com/jsmreese/moment-duration-format
178
178
  * Date: 2018-02-16
@@ -193,5 +193,5 @@ Error: ${o}`}const r={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,content
193
193
  40% { opacity: 1; }
194
194
  `]))),yw=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,s=o.colors,a=o.spacing.baseUnit;return Oe({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?s.neutral60:s.neutral20,padding:a*2})},ws=function(t){var n=t.delay,r=t.offset;return Fe("span",{css:jc({animation:"".concat(ww," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Cw=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,s=ur(t,dw);return Fe("div",Ae({},Kt(Oe(Oe({},s),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Fe(ws,{delay:0,offset:r}),Fe(ws,{delay:160,offset:!0}),Fe(ws,{delay:320,offset:!r}))},Sw=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,s=o.colors,a=o.borderRadius,l=o.spacing;return Oe({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?s.neutral5:s.neutral0,borderColor:r?s.neutral10:i?s.primary:s.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(s.primary):void 0,"&:hover":{borderColor:i?s.primary:s.neutral30}})},xw=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,s=t.innerProps,a=t.menuIsOpen;return Fe("div",Ae({ref:o},Kt(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":a}),s,{"aria-disabled":r||void 0}),n)},kw=xw,Mw=["data"],Rw=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},Iw=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,s=t.Heading,a=t.headingProps,l=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return Fe("div",Ae({},Kt(t,"group",{group:!0}),l),Fe(s,Ae({},a,{selectProps:d,theme:c,getStyles:i,getClassNames:o,cx:r}),u),Fe("div",null,n))},Ew=function(t,n){var r=t.theme,i=r.colors,o=r.spacing;return Oe({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},Tw=function(t){var n=kf(t);n.data;var r=ur(n,Mw);return Fe("div",Ae({},Kt(t,"groupHeading",{"group-heading":!0}),r))},Dw=Iw,Ow=["innerRef","isDisabled","isHidden","inputClassName"],Pw=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,s=o.spacing,a=o.colors;return Oe(Oe({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},Lw),n?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:a.neutral80})},Lf={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Lw={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Oe({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Lf)},Fw=function(t){return Oe({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},Lf)},_w=function(t){var n=t.cx,r=t.value,i=kf(t),o=i.innerRef,s=i.isDisabled,a=i.isHidden,l=i.inputClassName,u=ur(i,Ow);return Fe("div",Ae({},Kt(t,"input",{"input-container":!0}),{"data-value":r||""}),Fe("input",Ae({className:n({input:!0},l),ref:o,style:Fw(a),disabled:s},u)))},Aw=_w,Hw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,s=r.colors;return Oe({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:s.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},zw=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,s=t.cropWithEllipsis;return Oe({overflow:"hidden",textOverflow:s||s===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},Vw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,s=r.colors,a=t.isFocused;return Oe({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:a?s.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:s.dangerLight,color:s.danger}})},Ff=function(t){var n=t.children,r=t.innerProps;return Fe("div",r,n)},$w=Ff,Nw=Ff;function Bw(e){var t=e.children,n=e.innerProps;return Fe("div",Ae({role:"button"},n),t||Fe(Sl,{size:14}))}var Ww=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,s=t.isDisabled,a=t.removeProps,l=t.selectProps,u=r.Container,c=r.Label,d=r.Remove;return Fe(u,{data:i,innerProps:Oe(Oe({},Kt(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),o),selectProps:l},Fe(c,{data:i,innerProps:Oe({},Kt(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),Fe(d,{data:i,innerProps:Oe(Oe({},Kt(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:l}))},Uw=Ww,qw=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,s=t.theme,a=s.spacing,l=s.colors;return Oe({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?l.primary:i?l.primary25:"transparent",color:r?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?l.primary:l.primary50}})},Gw=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,s=t.innerRef,a=t.innerProps;return Fe("div",Ae({},Kt(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:s,"aria-disabled":r},a),n)},Xw=Gw,Yw=function(t,n){var r=t.theme,i=r.spacing,o=r.colors;return Oe({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},jw=function(t){var n=t.children,r=t.innerProps;return Fe("div",Ae({},Kt(t,"placeholder",{placeholder:!0}),r),n)},Kw=jw,Zw=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,s=i.colors;return Oe({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?s.neutral40:s.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},Jw=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return Fe("div",Ae({},Kt(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},Qw=Jw,xl={ClearIndicator:mw,Control:kw,DropdownIndicator:gw,DownChevron:Of,CrossIcon:Sl,Group:Dw,GroupHeading:Tw,IndicatorsContainer:uw,IndicatorSeparator:bw,Input:Aw,LoadingIndicator:Cw,Menu:j1,MenuList:Z1,MenuPortal:rw,LoadingMessage:tw,NoOptionsMessage:ew,MultiValue:Uw,MultiValueContainer:$w,MultiValueLabel:Nw,MultiValueRemove:Bw,Option:Xw,Placeholder:Kw,SelectContainer:ow,SingleValue:Qw,ValueContainer:sw},ey=function(t){return Oe(Oe({},xl),t.components)},bc=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function ty(e,t){return!!(e===t||bc(e)&&bc(t))}function ny(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!ty(e[n],t[n]))return!1;return!0}function ry(e,t){t===void 0&&(t=ny);var n=null;function r(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var s=e.apply(this,i);return n={lastResult:s,lastArgs:i,lastThis:this},s}return r.clear=function(){n=null},r}var iy={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},oy=function(t){return Fe("span",Ae({css:iy},t))},wc=oy,ay={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,o=t.context,s=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return s?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,i=r===void 0?"":r,o=t.labels,s=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return s?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,i=t.options,o=t.label,s=o===void 0?"":o,a=t.selectValue,l=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(m,y){return m&&m.length?"".concat(m.indexOf(y)+1," of ").concat(m.length):""};if(n==="value"&&a)return"value ".concat(s," focused, ").concat(d(a,r),".");if(n==="menu"&&c){var g=l?" disabled":"",h="".concat(u?" selected":"").concat(g);return"".concat(s).concat(h,", ").concat(d(i,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},sy=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,s=t.isFocused,a=t.selectValue,l=t.selectProps,u=t.id,c=t.isAppleDevice,d=l.ariaLiveMessages,g=l.getOptionLabel,h=l.inputValue,p=l.isMulti,m=l.isOptionDisabled,y=l.isSearchable,b=l.menuIsOpen,v=l.options,C=l.screenReaderStatus,E=l.tabSelectsValue,I=l.isLoading,R=l["aria-label"],P=l["aria-live"],x=f.useMemo(function(){return Oe(Oe({},ay),d||{})},[d]),S=f.useMemo(function(){var k="";if(n&&x.onChange){var $=n.option,G=n.options,j=n.removedValue,ue=n.removedValues,Q=n.value,ee=function(L){return Array.isArray(L)?null:L},ce=j||$||ee(Q),ae=ce?g(ce):"",ge=G||ue||void 0,de=ge?ge.map(g):[],re=Oe({isDisabled:ce&&m(ce,a),label:ae,labels:de},n);k=x.onChange(re)}return k},[n,x,m,a,g]),F=f.useMemo(function(){var k="",$=r||i,G=!!(r&&a&&a.includes(r));if($&&x.onFocus){var j={focused:$,label:g($),isDisabled:m($,a),isSelected:G,options:o,context:$===r?"menu":"value",selectValue:a,isAppleDevice:c};k=x.onFocus(j)}return k},[r,i,g,m,x,o,a,c]),D=f.useMemo(function(){var k="";if(b&&v.length&&!I&&x.onFilter){var $=C({count:o.length});k=x.onFilter({inputValue:h,resultsMessage:$})}return k},[o,h,b,x,v,C,I]),M=n?.action==="initial-input-focus",T=f.useMemo(function(){var k="";if(x.guidance){var $=i?"value":b?"menu":"input";k=x.guidance({"aria-label":R,context:$,isDisabled:r&&m(r,a),isMulti:p,isSearchable:y,tabSelectsValue:E,isInitialFocus:M})}return k},[R,r,i,p,m,y,b,x,a,E,M]),O=Fe(f.Fragment,null,Fe("span",{id:"aria-selection"},S),Fe("span",{id:"aria-focused"},F),Fe("span",{id:"aria-results"},D),Fe("span",{id:"aria-guidance"},T));return Fe(f.Fragment,null,Fe(wc,{id:u},M&&O),Fe(wc,{"aria-live":P,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},s&&!M&&O))},ly=sy,Bs=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],uy=new RegExp("["+Bs.map(function(e){return e.letters}).join("")+"]","g"),_f={};for(var ys=0;ys<Bs.length;ys++)for(var Cs=Bs[ys],Ss=0;Ss<Cs.letters.length;Ss++)_f[Cs.letters[Ss]]=Cs.base;var Af=function(t){return t.replace(uy,function(n){return _f[n]})},cy=ry(Af),yc=function(t){return t.replace(/^\s+|\s+$/g,"")},dy=function(t){return"".concat(t.label," ").concat(t.value)},fy=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=Oe({ignoreCase:!0,ignoreAccents:!0,stringify:dy,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,s=i.ignoreAccents,a=i.stringify,l=i.trim,u=i.matchFrom,c=l?yc(r):r,d=l?yc(a(n)):a(n);return o&&(c=c.toLowerCase(),d=d.toLowerCase()),s&&(c=cy(c),d=Af(d)),u==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},hy=["innerRef"];function gy(e){var t=e.innerRef,n=ur(e,hy),r=N1(n,"onExited","in","enter","exit","appear");return Fe("input",Ae({ref:t},r,{css:jc({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var py=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function my(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,o=e.onTopLeave,s=f.useRef(!1),a=f.useRef(!1),l=f.useRef(0),u=f.useRef(null),c=f.useCallback(function(y,b){if(u.current!==null){var v=u.current,C=v.scrollTop,E=v.scrollHeight,I=v.clientHeight,R=u.current,P=b>0,x=E-I-C,S=!1;x>b&&s.current&&(r&&r(y),s.current=!1),P&&a.current&&(o&&o(y),a.current=!1),P&&b>x?(n&&!s.current&&n(y),R.scrollTop=E,S=!0,s.current=!0):!P&&-b>C&&(i&&!a.current&&i(y),R.scrollTop=0,S=!0,a.current=!0),S&&py(y)}},[n,r,i,o]),d=f.useCallback(function(y){c(y,y.deltaY)},[c]),g=f.useCallback(function(y){l.current=y.changedTouches[0].clientY},[]),h=f.useCallback(function(y){var b=l.current-y.changedTouches[0].clientY;c(y,b)},[c]),p=f.useCallback(function(y){if(y){var b=z1?{passive:!1}:!1;y.addEventListener("wheel",d,b),y.addEventListener("touchstart",g,b),y.addEventListener("touchmove",h,b)}},[h,g,d]),m=f.useCallback(function(y){y&&(y.removeEventListener("wheel",d,!1),y.removeEventListener("touchstart",g,!1),y.removeEventListener("touchmove",h,!1))},[h,g,d]);return f.useEffect(function(){if(t){var y=u.current;return p(y),function(){m(y)}}},[t,p,m]),function(y){u.current=y}}var Cc=["boxSizing","height","overflow","paddingRight","position"],Sc={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function xc(e){e.cancelable&&e.preventDefault()}function kc(e){e.stopPropagation()}function Mc(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Rc(){return"ontouchstart"in window||navigator.maxTouchPoints}var Ic=!!(typeof window<"u"&&window.document&&window.document.createElement),to=0,pi={capture:!1,passive:!1};function vy(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=f.useRef({}),o=f.useRef(null),s=f.useCallback(function(l){if(Ic){var u=document.body,c=u&&u.style;if(r&&Cc.forEach(function(p){var m=c&&c[p];i.current[p]=m}),r&&to<1){var d=parseInt(i.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,h=window.innerWidth-g+d||0;Object.keys(Sc).forEach(function(p){var m=Sc[p];c&&(c[p]=m)}),c&&(c.paddingRight="".concat(h,"px"))}u&&Rc()&&(u.addEventListener("touchmove",xc,pi),l&&(l.addEventListener("touchstart",Mc,pi),l.addEventListener("touchmove",kc,pi))),to+=1}},[r]),a=f.useCallback(function(l){if(Ic){var u=document.body,c=u&&u.style;to=Math.max(to-1,0),r&&to<1&&Cc.forEach(function(d){var g=i.current[d];c&&(c[d]=g)}),u&&Rc()&&(u.removeEventListener("touchmove",xc,pi),l&&(l.removeEventListener("touchstart",Mc,pi),l.removeEventListener("touchmove",kc,pi)))}},[r]);return f.useEffect(function(){if(t){var l=o.current;return s(l),function(){a(l)}}},[t,s,a]),function(l){o.current=l}}var by=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},wy={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function yy(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,o=e.onBottomArrive,s=e.onBottomLeave,a=e.onTopArrive,l=e.onTopLeave,u=my({isEnabled:i,onBottomArrive:o,onBottomLeave:s,onTopArrive:a,onTopLeave:l}),c=vy({isEnabled:n}),d=function(h){u(h),c(h)};return Fe(f.Fragment,null,n&&Fe("div",{onClick:by,css:wy}),t(d))}var Cy={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Sy=function(t){var n=t.name,r=t.onFocus;return Fe("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:Cy,value:"",onChange:function(){}})},xy=Sy;function kl(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function ky(){return kl(/^iPhone/i)}function Hf(){return kl(/^Mac/i)}function My(){return kl(/^iPad/i)||Hf()&&navigator.maxTouchPoints>1}function Ry(){return ky()||My()}function Iy(){return Hf()||Ry()}var Ey=function(t){return t.label},zf=function(t){return t.label},Vf=function(t){return t.value},Ty=function(t){return!!t.isDisabled},Dy={clearIndicator:pw,container:iw,control:Sw,dropdownIndicator:hw,group:Rw,groupHeading:Ew,indicatorsContainer:lw,indicatorSeparator:vw,input:Pw,loadingIndicator:yw,loadingMessage:Q1,menu:G1,menuList:K1,menuPortal:nw,multiValue:Hw,multiValueLabel:zw,multiValueRemove:Vw,noOptionsMessage:J1,option:qw,placeholder:Yw,singleValue:Zw,valueContainer:aw},Oy={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},Py=4,$f=4,Ly=38,Fy=$f*2,_y={baseUnit:$f,controlHeight:Ly,menuGutter:Fy},xs={borderRadius:Py,colors:Oy,spacing:_y},Ay={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:mc(),captureMenuScroll:!mc(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:fy(),formatGroupLabel:Ey,getOptionLabel:zf,getOptionValue:Vf,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Ty,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!A1(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Ec(e,t,n,r){var i=Wf(e,t,n),o=Uf(e,t,n),s=Bf(e,t),a=Sa(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:s,value:a,index:r}}function oa(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(s,a){return Ec(e,s,t,a)}).filter(function(s){return Dc(e,s)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=Ec(e,n,t,r);return Dc(e,o)?o:void 0}).filter(V1)}function Nf(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,xi(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function Tc(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,xi(r.options.map(function(i){return{data:i.data,id:"".concat(t,"-").concat(r.index,"-").concat(i.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function Hy(e,t){return Nf(oa(e,t))}function Dc(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,s=t.label,a=t.value;return(!Gf(e)||!o)&&qf(e,{label:s,value:a,data:i},r)}function zy(e,t){var n=e.focusedValue,r=e.selectValue,i=r.indexOf(n);if(i>-1){var o=t.indexOf(n);if(o>-1)return n;if(i<t.length)return t[i]}return null}function Vy(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var ks=function(t,n){var r,i=(r=t.find(function(o){return o.data===n}))===null||r===void 0?void 0:r.id;return i||null},Bf=function(t,n){return t.getOptionLabel(n)},Sa=function(t,n){return t.getOptionValue(n)};function Wf(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function Uf(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=Sa(e,t);return n.some(function(i){return Sa(e,i)===r})}function qf(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var Gf=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},$y=1,Ml=function(e){qg(n,e);var t=Yg(n);function n(r){var i;if(Xg(this,n),i=t.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.isAppleDevice=Iy(),i.controlRef=null,i.getControlRef=function(l){i.controlRef=l},i.focusedOptionRef=null,i.getFocusedOptionRef=function(l){i.focusedOptionRef=l},i.menuListRef=null,i.getMenuListRef=function(l){i.menuListRef=l},i.inputRef=null,i.getInputRef=function(l){i.inputRef=l},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(l,u){var c=i.props,d=c.onChange,g=c.name;u.name=g,i.ariaOnChange(l,u),d(l,u)},i.setValue=function(l,u,c){var d=i.props,g=d.closeMenuOnSelect,h=d.isMulti,p=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:p}),g&&(i.setState({inputIsHiddenAfterUpdate:!h}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(l,{action:u,option:c})},i.selectOption=function(l){var u=i.props,c=u.blurInputOnSelect,d=u.isMulti,g=u.name,h=i.state.selectValue,p=d&&i.isOptionSelected(l,h),m=i.isOptionDisabled(l,h);if(p){var y=i.getOptionValue(l);i.setValue(h.filter(function(b){return i.getOptionValue(b)!==y}),"deselect-option",l)}else if(!m)d?i.setValue([].concat(xi(h),[l]),"select-option",l):i.setValue(l,"select-option");else{i.ariaOnChange(l,{action:"select-option",option:l,name:g});return}c&&i.blurInput()},i.removeValue=function(l){var u=i.props.isMulti,c=i.state.selectValue,d=i.getOptionValue(l),g=c.filter(function(p){return i.getOptionValue(p)!==d}),h=io(u,g,g[0]||null);i.onChange(h,{action:"remove-value",removedValue:l}),i.focusInput()},i.clearValue=function(){var l=i.state.selectValue;i.onChange(io(i.props.isMulti,[],null),{action:"clear",removedValues:l})},i.popValue=function(){var l=i.props.isMulti,u=i.state.selectValue,c=u[u.length-1],d=u.slice(0,u.length-1),g=io(l,d,d[0]||null);c&&i.onChange(g,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(l){return ks(i.state.focusableOptionsWithIds,l)},i.getFocusableOptionsWithIds=function(){return Tc(oa(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var l=arguments.length,u=new Array(l),c=0;c<l;c++)u[c]=arguments[c];return O1.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(l){return Bf(i.props,l)},i.getOptionValue=function(l){return Sa(i.props,l)},i.getStyles=function(l,u){var c=i.props.unstyled,d=Dy[l](u,c);d.boxSizing="border-box";var g=i.props.styles[l];return g?g(d,u):d},i.getClassNames=function(l,u){var c,d;return(c=(d=i.props.classNames)[l])===null||c===void 0?void 0:c.call(d,u)},i.getElementId=function(l){return"".concat(i.state.instancePrefix,"-").concat(l)},i.getComponents=function(){return ey(i.props)},i.buildCategorizedOptions=function(){return oa(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return Nf(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(l,u){i.setState({ariaSelection:Oe({value:l},u)})},i.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(l){i.blockOptionHover=!1},i.onControlMouseDown=function(l){if(!l.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},i.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!i.props.isDisabled){var u=i.props,c=u.isMulti,d=u.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!c}),i.onMenuClose()):i.openMenu("first"),l.preventDefault()}},i.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(i.clearValue(),l.preventDefault(),i.openAfterFocus=!1,l.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(l){typeof i.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&Ea(l.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(l)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(l){var u=l.touches,c=u&&u.item(0);c&&(i.initialTouchX=c.clientX,i.initialTouchY=c.clientY,i.userIsDragging=!1)},i.onTouchMove=function(l){var u=l.touches,c=u&&u.item(0);if(c){var d=Math.abs(c.clientX-i.initialTouchX),g=Math.abs(c.clientY-i.initialTouchY),h=5;i.userIsDragging=d>h||g>h}},i.onTouchEnd=function(l){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(l.target)&&i.menuListRef&&!i.menuListRef.contains(l.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(l){i.userIsDragging||i.onControlMouseDown(l)},i.onClearIndicatorTouchEnd=function(l){i.userIsDragging||i.onClearIndicatorMouseDown(l)},i.onDropdownIndicatorTouchEnd=function(l){i.userIsDragging||i.onDropdownIndicatorMouseDown(l)},i.handleInputChange=function(l){var u=i.props.inputValue,c=l.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(c,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(l){i.props.onFocus&&i.props.onFocus(l),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(l){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(l),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(l){if(!(i.blockOptionHover||i.state.focusedOption===l)){var u=i.getFocusableOptions(),c=u.indexOf(l);i.setState({focusedOption:l,focusedOptionId:c>-1?i.getFocusedOptionId(l):null})}},i.shouldHideSelectedOptions=function(){return Gf(i.props)},i.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),i.focus()},i.onKeyDown=function(l){var u=i.props,c=u.isMulti,d=u.backspaceRemovesValue,g=u.escapeClearsValue,h=u.inputValue,p=u.isClearable,m=u.isDisabled,y=u.menuIsOpen,b=u.onKeyDown,v=u.tabSelectsValue,C=u.openMenuOnFocus,E=i.state,I=E.focusedOption,R=E.focusedValue,P=E.selectValue;if(!m&&!(typeof b=="function"&&(b(l),l.defaultPrevented))){switch(i.blockOptionHover=!0,l.key){case"ArrowLeft":if(!c||h)return;i.focusValue("previous");break;case"ArrowRight":if(!c||h)return;i.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(R)i.removeValue(R);else{if(!d)return;c?i.popValue():p&&i.clearValue()}break;case"Tab":if(i.isComposing||l.shiftKey||!y||!v||!I||C&&i.isOptionSelected(I,P))return;i.selectOption(I);break;case"Enter":if(l.keyCode===229)break;if(y){if(!I||i.isComposing)return;i.selectOption(I);break}return;case"Escape":y?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:h}),i.onMenuClose()):p&&g&&i.clearValue();break;case" ":if(h)return;if(!y){i.openMenu("first");break}if(!I)return;i.selectOption(I);break;case"ArrowUp":y?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":y?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!y)return;i.focusOption("pageup");break;case"PageDown":if(!y)return;i.focusOption("pagedown");break;case"Home":if(!y)return;i.focusOption("first");break;case"End":if(!y)return;i.focusOption("last");break;default:return}l.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++$y),i.state.selectValue=ya(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),s=i.buildFocusableOptions(),a=s.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=s[a],i.state.focusedOptionId=ks(o,s[a])}return i}return Gg(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&pc(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var o=this.props,s=o.isDisabled,a=o.menuIsOpen,l=this.state.isFocused;(l&&!s&&i.isDisabled||l&&a&&!i.menuIsOpen)&&this.focusInput(),l&&s&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!s&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(pc(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,o){this.props.onInputChange(i,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var o=this,s=this.state,a=s.selectValue,l=s.isFocused,u=this.buildFocusableOptions(),c=i==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(a[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(i){var o=this.state,s=o.selectValue,a=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=s.indexOf(a);a||(l=-1);var u=s.length-1,c=-1;if(s.length){switch(i){case"previous":l===0?c=0:l===-1?c=u:c=l-1;break;case"next":l>-1&&l<u&&(c=l+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:s[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,s=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,u=a.indexOf(s);s||(u=-1),i==="up"?l=u>0?u-1:a.length-1:i==="down"?l=(u+1)%a.length:i==="pageup"?(l=u-o,l<0&&(l=0)):i==="pagedown"?(l=u+o,l>a.length-1&&(l=a.length-1)):i==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(xs):Oe(Oe({},xs),this.props.theme):xs}},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,s=this.getStyles,a=this.getClassNames,l=this.getValue,u=this.selectOption,c=this.setValue,d=this.props,g=d.isMulti,h=d.isRtl,p=d.options,m=this.hasValue();return{clearValue:i,cx:o,getStyles:s,getClassNames:a,getValue:l,hasValue:m,isMulti:g,isRtl:h,options:p,selectOption:u,selectProps:d,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,o=i.isClearable,s=i.isMulti;return o===void 0?s:o}},{key:"isOptionDisabled",value:function(i,o){return Wf(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return Uf(this.props,i,o)}},{key:"filterOption",value:function(i,o){return qf(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var s=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:s,selectValue:a})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,o=i.isDisabled,s=i.isSearchable,a=i.inputId,l=i.inputValue,u=i.tabIndex,c=i.form,d=i.menuIsOpen,g=i.required,h=this.getComponents(),p=h.Input,m=this.state,y=m.inputIsHidden,b=m.ariaSelection,v=this.commonProps,C=a||this.getElementId("input"),E=Oe(Oe(Oe({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":g,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!s&&{"aria-readonly":!0}),this.hasValue()?b?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return s?f.createElement(p,Ae({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:C,innerRef:this.getInputRef,isDisabled:o,isHidden:y,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:l},E)):f.createElement(gy,Ae({id:C,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:wa,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},E))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),s=o.MultiValue,a=o.MultiValueContainer,l=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,d=o.Placeholder,g=this.commonProps,h=this.props,p=h.controlShouldRenderValue,m=h.isDisabled,y=h.isMulti,b=h.inputValue,v=h.placeholder,C=this.state,E=C.selectValue,I=C.focusedValue,R=C.isFocused;if(!this.hasValue()||!p)return b?null:f.createElement(d,Ae({},g,{key:"placeholder",isDisabled:m,isFocused:R,innerProps:{id:this.getElementId("placeholder")}}),v);if(y)return E.map(function(x,S){var F=x===I,D="".concat(i.getOptionLabel(x),"-").concat(i.getOptionValue(x));return f.createElement(s,Ae({},g,{components:{Container:a,Label:l,Remove:u},isFocused:F,isDisabled:m,key:D,index:S,removeProps:{onClick:function(){return i.removeValue(x)},onTouchEnd:function(){return i.removeValue(x)},onMouseDown:function(T){T.preventDefault()}},data:x}),i.formatOptionLabel(x,"value"))});if(b)return null;var P=E[0];return f.createElement(c,Ae({},g,{data:P,isDisabled:m}),this.formatOptionLabel(P,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,Ae({},s,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return f.createElement(o,Ae({},s,{innerProps:d,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,s=i.IndicatorSeparator;if(!o||!s)return null;var a=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return f.createElement(s,Ae({},a,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var s=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,Ae({},s,{innerProps:u,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),s=o.Group,a=o.GroupHeading,l=o.Menu,u=o.MenuList,c=o.MenuPortal,d=o.LoadingMessage,g=o.NoOptionsMessage,h=o.Option,p=this.commonProps,m=this.state.focusedOption,y=this.props,b=y.captureMenuScroll,v=y.inputValue,C=y.isLoading,E=y.loadingMessage,I=y.minMenuHeight,R=y.maxMenuHeight,P=y.menuIsOpen,x=y.menuPlacement,S=y.menuPosition,F=y.menuPortalTarget,D=y.menuShouldBlockScroll,M=y.menuShouldScrollIntoView,T=y.noOptionsMessage,O=y.onMenuScrollToTop,k=y.onMenuScrollToBottom;if(!P)return null;var $=function(ae,ge){var de=ae.type,re=ae.data,H=ae.isDisabled,L=ae.isSelected,X=ae.label,te=ae.value,ie=m===re,Se=H?void 0:function(){return i.onOptionHover(re)},me=H?void 0:function(){return i.selectOption(re)},nt="".concat(i.getElementId("option"),"-").concat(ge),xe={id:nt,onClick:me,onMouseMove:Se,onMouseOver:Se,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:L};return f.createElement(h,Ae({},p,{innerProps:xe,data:re,isDisabled:H,isSelected:L,key:nt,label:X,type:de,value:te,isFocused:ie,innerRef:ie?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(ae.data,"menu"))},G;if(this.hasOptions())G=this.getCategorizedOptions().map(function(ce){if(ce.type==="group"){var ae=ce.data,ge=ce.options,de=ce.index,re="".concat(i.getElementId("group"),"-").concat(de),H="".concat(re,"-heading");return f.createElement(s,Ae({},p,{key:re,data:ae,options:ge,Heading:a,headingProps:{id:H,data:ce.data},label:i.formatGroupLabel(ce.data)}),ce.options.map(function(L){return $(L,"".concat(de,"-").concat(L.index))}))}else if(ce.type==="option")return $(ce,"".concat(ce.index))});else if(C){var j=E({inputValue:v});if(j===null)return null;G=f.createElement(d,p,j)}else{var ue=T({inputValue:v});if(ue===null)return null;G=f.createElement(g,p,ue)}var Q={minMenuHeight:I,maxMenuHeight:R,menuPlacement:x,menuPosition:S,menuShouldScrollIntoView:M},ee=f.createElement(X1,Ae({},p,Q),function(ce){var ae=ce.ref,ge=ce.placerProps,de=ge.placement,re=ge.maxHeight;return f.createElement(l,Ae({},p,Q,{innerRef:ae,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:C,placement:de}),f.createElement(yy,{captureEnabled:b,onTopArrive:O,onBottomArrive:k,lockEnabled:D},function(H){return f.createElement(u,Ae({},p,{innerRef:function(X){i.getMenuListRef(X),H(X)},innerProps:{role:"listbox","aria-multiselectable":p.isMulti,id:i.getElementId("listbox")},isLoading:C,maxHeight:re,focusedOption:m}),G)}))});return F||S==="fixed"?f.createElement(c,Ae({},p,{appendTo:F,controlElement:this.controlRef,menuPlacement:x,menuPosition:S}),ee):ee}},{key:"renderFormField",value:function(){var i=this,o=this.props,s=o.delimiter,a=o.isDisabled,l=o.isMulti,u=o.name,c=o.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!a)return f.createElement(xy,{name:u,onFocus:this.onValueInputFocus});if(!(!u||a))if(l)if(s){var g=d.map(function(m){return i.getOptionValue(m)}).join(s);return f.createElement("input",{name:u,type:"hidden",value:g})}else{var h=d.length>0?d.map(function(m,y){return f.createElement("input",{key:"i-".concat(y),name:u,type:"hidden",value:i.getOptionValue(m)})}):f.createElement("input",{name:u,type:"hidden",value:""});return f.createElement("div",null,h)}else{var p=d[0]?this.getOptionValue(d[0]):"";return f.createElement("input",{name:u,type:"hidden",value:p})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,s=o.ariaSelection,a=o.focusedOption,l=o.focusedValue,u=o.isFocused,c=o.selectValue,d=this.getFocusableOptions();return f.createElement(ly,Ae({},i,{id:this.getElementId("live-region"),ariaSelection:s,focusedOption:a,focusedValue:l,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,s=i.IndicatorsContainer,a=i.SelectContainer,l=i.ValueContainer,u=this.props,c=u.className,d=u.id,g=u.isDisabled,h=u.menuIsOpen,p=this.state.isFocused,m=this.commonProps=this.getCommonProps();return f.createElement(a,Ae({},m,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:g,isFocused:p}),this.renderLiveRegion(),f.createElement(o,Ae({},m,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:g,isFocused:p,menuIsOpen:h}),f.createElement(l,Ae({},m,{isDisabled:g}),this.renderPlaceholderOrValue(),this.renderInput()),f.createElement(s,Ae({},m,{isDisabled:g}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var s=o.prevProps,a=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,d=o.prevWasFocused,g=o.instancePrefix,h=i.options,p=i.value,m=i.menuIsOpen,y=i.inputValue,b=i.isMulti,v=ya(p),C={};if(s&&(p!==s.value||h!==s.options||m!==s.menuIsOpen||y!==s.inputValue)){var E=m?Hy(i,v):[],I=m?Tc(oa(i,v),"".concat(g,"-option")):[],R=a?zy(o,v):null,P=Vy(o,E),x=ks(I,P);C={selectValue:v,focusedOption:P,focusedOptionId:x,focusableOptionsWithIds:I,focusedValue:R,clearFocusValueOnUpdate:!1}}var S=l!=null&&i!==s?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},F=u,D=c&&d;return c&&!D&&(F={value:io(b,v,v[0]||null),options:v,action:"initial-input-focus"},D=!d),u?.action==="initial-input-focus"&&(F=null),Oe(Oe(Oe({},C),S),{},{prevProps:i,ariaSelection:F,prevWasFocused:D})}}]),n}(f.Component);Ml.defaultProps=Ay;var Ny=f.forwardRef(function(e,t){var n=bf(e);return f.createElement(Ml,Ae({ref:t},n))}),Xf=Ny;const By=e=>{const{Menu:t}=xl,{children:n,...r}=e;return f.createElement(t,{...r},n)},Wy=sn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),Uy=sn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),qy=sn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),Gy=e=>{const{value:t,onFinishedEditing:n,initialValue:r,portalElementRef:i}=e,{allowedValues:o,value:s}=t.data,[a,l]=f.useState(s),[u,c]=f.useState(r??""),d=Fd(),g=f.useMemo(()=>o.map(h=>typeof h=="string"||h===null||h===void 0?{value:h,label:h?.toString()??""}:h),[o]);return t.readonly?f.createElement(qy,null,f.createElement(Jr,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):f.createElement(Wy,null,f.createElement(Xf,{className:"glide-select",inputValue:u,onInputChange:c,menuPlacement:"auto",value:g.find(h=>h.value===a),styles:{control:h=>({...h,border:0,boxShadow:"none"}),option:(h,{isFocused:p})=>({...h,fontSize:d.editorFontSize,fontFamily:d.fontFamily,cursor:p?"pointer":void 0,paddingLeft:d.cellHorizontalPadding,paddingRight:d.cellHorizontalPadding,":active":{...h[":active"],color:d.accentFg},":empty::after":{content:'"&nbsp;"',visibility:"hidden"}})},theme:h=>({...h,colors:{...h.colors,neutral0:d.bgCell,neutral5:d.bgCell,neutral10:d.bgCell,neutral20:d.bgCellMedium,neutral30:d.bgCellMedium,neutral40:d.bgCellMedium,neutral50:d.textLight,neutral60:d.textMedium,neutral70:d.textMedium,neutral80:d.textDark,neutral90:d.textDark,neutral100:d.textDark,primary:d.accentColor,primary75:d.accentColor,primary50:d.accentColor,primary25:d.accentLight}}),menuPortalTarget:i?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:h=>f.createElement(Uy,null,f.createElement(By,{className:"click-outside-ignore",...h}))},options:g,onChange:async h=>{h!==null&&(l(h.value),await new Promise(p=>window.requestAnimationFrame(p)),n({...t,data:{...t.data,value:h.value}}))}}))},Xy={kind:Z.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{value:o}=t.data,s=t.data.allowedValues.find(l=>typeof l=="string"||l===null||l===void 0?l===o:l.value===o),a=typeof s=="string"?s:s?.label??"";return a&&(n.fillStyle=r.textDark,n.fillText(a,i.x+r.cellHorizontalPadding,i.y+i.height/2+rr(n,r))),!0},measure:(e,t,n)=>{const{value:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Gy,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,value:""}})}),onPaste:(e,t)=>({...t,value:t.allowedValues.some(n=>n==null?!1:typeof n=="string"?n===e:n.value===e)?e:t.value})};function Yy(e,t){const n=/(\d+\.?\d*)\s*(px|rem|em|%|pt)/,r=e.match(n);if(r){const i=parseFloat(r[1]),o=r[2],s=i*t;return e.replace(n,`${Number(s.toPrecision(3))}${o}`)}return e}const jy={marginRight:8},Ky={display:"flex",alignItems:"center",flexGrow:1},Zy={kind:Z.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{min:o,max:s,value:a,label:l,measureLabel:u}=t.data,c=i.x+r.cellHorizontalPadding,d=i.y+i.height/2,g=s-o,h=(a-o)/g,p=`${Yy(r.baseFontStyle,.9)} ${r.fontFamily}`,y=el(n,p)/2;n.save();let b=0;l!==void 0&&(n.font=p,b=Fr(u??l,n,p).width+r.cellHorizontalPadding);const v=i.width-r.cellHorizontalPadding*2-b;if(v>=y){const C=n.createLinearGradient(c,d,c+v,d);C.addColorStop(0,r.accentColor),C.addColorStop(h,r.accentColor),C.addColorStop(h,r.bgBubble),C.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=C,cc(n,c,d-y/2,v,y,y/2),n.fill(),n.beginPath(),cc(n,c+.5,d-y/2+.5,v-1,y-1,(y-1)/2),n.strokeStyle=r.accentLight,n.lineWidth=1,n.stroke()}return l!==void 0&&(n.textAlign="right",n.fillStyle=r.textDark,n.fillText(l,i.x+i.width-r.cellHorizontalPadding,d+rr(n,p))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,r=t.value.toString(),i=t.min.toString(),o=t.max.toString(),s=t.step.toString(),a=l=>{e.onChange({...e.value,data:{...t,value:Number(l.target.value)}})};return f.createElement("label",{style:Ky},f.createElement("input",{style:jy,type:"range",value:r,min:i,max:o,step:s,onChange:a,disabled:n}),r)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},Jy=sn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),Ms=(e,t,n)=>{if(t==null)return"";n&&(t=new Date(t.getTime()+n));const r=t.toISOString();switch(e){case"date":return r.split("T")[0];case"datetime-local":return r.replace("Z","");case"time":return r.split("T")[1].replace("Z","");default:throw new Error(`Unknown date kind ${e}`)}},Qy=e=>{const t=e.value.data,{format:n,displayDate:r}=t,i=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,o=t.timezoneOffset?t.timezoneOffset*60*1e3:0,s=t.min instanceof Date?Ms(n,t.min,o):t.min,a=t.max instanceof Date?Ms(n,t.max,o):t.max,l=Ms(n,t.date,o);return e.value.readonly?$t.createElement(Jr,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):$t.createElement(Jy,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:l,min:s,max:a,step:i,autoFocus:!0,onChange:u=>{isNaN(u.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(u.target.valueAsNumber-o)}})}})},eC={kind:Z.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return Qs(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Qy}),onPaste:(e,t)=>{let n=NaN;return e&&(n=Number(e).valueOf(),Number.isNaN(n)&&(n=Date.parse(e),t.format==="time"&&Number.isNaN(n)&&(n=Date.parse(`1970-01-01T${e}Z`)))),{...t,date:Number.isNaN(n)?void 0:new Date(n)}}};var tC=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],Oc=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=String(t).toLowerCase(),o=String(r.getOptionValue(n)).toLowerCase(),s=String(r.getOptionLabel(n)).toLowerCase();return o===i||s===i},Rs={formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,n,r,i){return!(!t||n.some(function(o){return Oc(t,o,i)})||r.some(function(o){return Oc(t,o,i)}))},getNewOptionData:function(t,n){return{label:n,value:t,__isNew__:!0}}};function nC(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,i=r===void 0?"last":r,o=e.formatCreateLabel,s=o===void 0?Rs.formatCreateLabel:o,a=e.isValidNewOption,l=a===void 0?Rs.isValidNewOption:a,u=e.getNewOptionData,c=u===void 0?Rs.getNewOptionData:u,d=e.onCreateOption,g=e.options,h=g===void 0?[]:g,p=e.onChange,m=ur(e,tC),y=m.getOptionValue,b=y===void 0?Vf:y,v=m.getOptionLabel,C=v===void 0?zf:v,E=m.inputValue,I=m.isLoading,R=m.isMulti,P=m.value,x=m.name,S=f.useMemo(function(){return l(E,ya(P),h,{getOptionValue:b,getOptionLabel:C})?c(E,s(E)):void 0},[s,c,C,b,E,l,h,P]),F=f.useMemo(function(){return(n||!I)&&S?i==="first"?[S].concat(xi(h)):[].concat(xi(h),[S]):h},[n,i,I,S,h]),D=f.useCallback(function(M,T){if(T.action!=="select-option")return p(M,T);var O=Array.isArray(M)?M:[M];if(O[O.length-1]===S){if(d)d(E);else{var k=c(E,E),$={action:"create-option",name:x,option:k};p(io(R,[].concat(xi(ya(P)),[k]),k),$)}return}p(M,T)},[c,E,R,x,S,d,p,P]);return Oe(Oe({},m),{},{options:F,onChange:D})}var rC=f.forwardRef(function(e,t){var n=bf(e),r=nC(n);return f.createElement(Ml,Ae({ref:t},r))}),iC=rC;const Rl="__value",oC=new RegExp(`^${Rl}\\d+__`),aC=sn("div")({name:"Wrap",class:"gdg-w1i61rz",propsAsIs:!1}),sC=sn("div")({name:"PortalWrap",class:"gdg-phbadu4",propsAsIs:!1}),aa=e=>e.map(t=>typeof t=="string"||t===null||t===void 0?{value:t,label:t??"",color:void 0}:{value:t.value,label:t.label??t.value??"",color:t.color??void 0}),Yf=(e,t,n)=>e==null?[]:e.map((r,i)=>{const o=n?`${Rl}${i}__`:"",s=t.find(a=>a.value===r);return s?{...s,value:`${o}${s.value}`}:{value:`${o}${r}`,label:r}}),lC=e=>{const{Menu:t}=xl,{children:n,...r}=e;return f.createElement(t,{...r},n)},uC=e=>{const{value:t,initialValue:n,onChange:r,onFinishedEditing:i,portalElementRef:o}=e,{options:s,values:a,allowCreation:l,allowDuplicates:u}=t.data,c=Fd(),[d,g]=f.useState(a),[h,p]=f.useState(!0),[m,y]=f.useState(n??""),b=f.useMemo(()=>aa(s??[]),[s]),v=l&&u&&b.length===0,C=f.useCallback(x=>{h&&x.stopPropagation()},[h]),E={control:(x,S)=>({...x,border:0,boxShadow:"none",backgroundColor:c.bgCell,pointerEvents:S.isDisabled?"auto":x.pointerEvents,cursor:S.isDisabled?"default":x.cursor}),valueContainer:x=>({...x,flexWrap:x.flexWrap??"wrap",overflowX:"auto",overflowY:"hidden"}),menu:x=>({...x,backgroundColor:c.bgCell}),option:(x,S)=>({...x,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textDark,...S.isFocused?{backgroundColor:c.accentLight,cursor:"pointer"}:{},":active":{...x[":active"],color:c.accentFg,backgroundColor:c.accentColor}}),input:(x,{isDisabled:S})=>S?{display:"none"}:{...x,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textDark},placeholder:x=>({...x,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textLight}),noOptionsMessage:x=>({...x,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textLight}),clearIndicator:x=>({...x,color:c.textLight,":hover":{color:c.textDark,cursor:"pointer"}}),multiValue:(x,{data:S})=>({...x,backgroundColor:S.color??c.bgBubble,borderRadius:`${c.roundingRadius??c.bubbleHeight/2}px`,flexShrink:0,whiteSpace:"nowrap"}),multiValueLabel:(x,{data:S,isDisabled:F})=>({...x,paddingRight:F?c.bubblePadding:0,paddingLeft:c.bubblePadding,paddingTop:0,paddingBottom:0,color:S.color?Os(S.color)>.5?"black":"white":c.textBubble,fontSize:c.editorFontSize,fontFamily:c.fontFamily,justifyContent:"center",alignItems:"center",display:"flex",height:c.bubbleHeight,whiteSpace:"nowrap"}),multiValueRemove:(x,{data:S,isDisabled:F,isFocused:D})=>F?{display:"none"}:{...x,color:S.color?Os(S.color)>.5?"black":"white":c.textBubble,backgroundColor:void 0,borderRadius:D?`${c.roundingRadius??c.bubbleHeight/2}px`:void 0,":hover":{cursor:"pointer"}}},I=f.useCallback(x=>{const S=x.map(F=>u&&F.startsWith(Rl)?F.replace(new RegExp(oC),""):F);g(S),r({...t,data:{...t.data,values:S}})},[t,r,u]),R=x=>{switch(x.key){case"Enter":case"Tab":if(!m){i(t,[0,1]);return}u&&l&&(y(""),I([...d??[],m]),p(!1),x.preventDefault())}},P=l?iC:Xf;return f.createElement(aC,{onKeyDown:C,"data-testid":"multi-select-cell"},f.createElement(P,{className:"gdg-multi-select",isMulti:!0,isDisabled:t.readonly,isClearable:!0,isSearchable:!0,inputValue:m,onInputChange:y,options:b,placeholder:t.readonly?"":l?"Add...":void 0,noOptionsMessage:x=>l&&u&&x.inputValue?`Create "${x.inputValue}"`:void 0,menuIsOpen:t.readonly?!1:h,onMenuOpen:()=>p(!0),onMenuClose:()=>p(!1),value:Yf(d,b,u),onKeyDown:t.readonly?void 0:R,menuPlacement:"auto",menuPortalTarget:o?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,openMenuOnClick:!0,closeMenuOnSelect:!0,backspaceRemovesValue:!0,escapeClearsValue:!1,styles:E,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:x=>v?null:f.createElement(sC,null,f.createElement(lC,{className:"click-outside-ignore",...x}))},onChange:async x=>{x!==null&&I(x.map(S=>S.value))}}))},cC={kind:Z.Custom,isMatch:e=>e.data.kind==="multi-select-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i,highlighted:o}=e,{values:s,options:a}=t.data;if(s==null)return!0;const l=aa(a??[]),u={x:i.x+r.cellHorizontalPadding,y:i.y+r.cellVerticalPadding,width:i.width-2*r.cellHorizontalPadding,height:i.height-2*r.cellVerticalPadding},c=Math.max(1,Math.floor(u.height/(r.bubbleHeight+r.bubblePadding)));let{x:d}=u,g=1,h=c===1?u.y+(u.height-r.bubbleHeight)/2:u.y+(u.height-c*r.bubbleHeight-(c-1)*r.bubblePadding)/2;for(const p of s){const m=l.find(I=>I.value===p),y=m?.color??(o?r.bgBubbleSelected:r.bgBubble),b=m?.label??p,C=Fr(b,n).width+r.bubblePadding*2,E=r.bubbleHeight/2;if(d!==u.x&&d+C>u.x+u.width&&g<c&&(g++,h+=r.bubbleHeight+r.bubblePadding,d=u.x),n.fillStyle=y,n.beginPath(),tr(n,d,h,C,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2),n.fill(),n.fillStyle=m?.color?Os(y)>.5?"#000000":"#ffffff":r.textBubble,n.fillText(b,d+r.bubblePadding,h+E+rr(n,r)),d+=C+r.bubbleMargin,d>u.x+u.width+r.cellHorizontalPadding&&g>=c)break}return!0},measure:(e,t,n)=>{const{values:r,options:i}=t.data;if(!r)return n.cellHorizontalPadding*2;const o=Yf(r,aa(i??[]),t.data.allowDuplicates).map(a=>a.label??a.value),s=o.reduce((a,l)=>e.measureText(l).width+a+n.bubblePadding*2+n.bubbleMargin,0);return o.length===0?n.cellHorizontalPadding*2:s+2*n.cellHorizontalPadding-n.bubbleMargin},provideEditor:()=>({editor:uC,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,values:[]}})}),onPaste:(e,t)=>{if(!e||!e.trim())return{...t,values:[]};let n=e.split(",").map(r=>r.trim());if(t.allowDuplicates||(n=n.filter((r,i)=>n.indexOf(r)===i)),!t.allowCreation){const r=aa(t.options??[]);n=n.filter(i=>r.find(o=>o.value===i))}if(n.length!==0)return{...t,values:n}}},dC="None";function Pc(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-n.cellHorizontalPadding,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+n.cellHorizontalPadding),e.fillStyle=n.accentColor,e.fill(),e.restore()}const fC=e=>{const{cell:t,theme:n,ctx:r}=e;Qs({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`}},dC,t.contentAlign),r.fillStyle=n.textDark};function hC(e){const t=f.useCallback((r,i)=>{const{cell:o,theme:s,ctx:a,rect:l}=r,u=r.col;if(ki(o))Pc(a,l,s);else if(sl(o)&&u<e.length){const c=e[u];["checkbox","line_chart","bar_chart","progress"].includes(c.kind)?i():fC(r),c.isRequired&&c.isEditable&&Pc(a,l,s);return}i()},[e]),n=f.useMemo(()=>[h1,Xy,Zy,eC,cC,...Vb],[]);return{drawCell:t,customRenderers:n}}function gC(){const e=Kr();return f.useMemo(()=>{const n={editable:i=>`<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="${i.bgColor}"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>`};return{glideTheme:{accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:mi(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:mi(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroundColor,bgHeaderHasFocus:mi(e.colors.darkenedBgMix100,.9),bgHeaderHovered:mi(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(rn("1.125rem")),headerFontStyle:`${e.fontWeights.normal} ${rn(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${rn(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:mi(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(rn(e.spacing.sm)),cellVerticalPadding:Math.round(rn("0.1875rem")),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:Mg(e.colors.secondaryBg,.1),bubbleHeight:Math.round(rn("1.25rem")),bubblePadding:Math.round(rn(e.spacing.sm)),bubbleMargin:Math.round(rn(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(rn(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(rn("25rem")),minColumnWidth:Math.round(rn("3.125rem")),maxColumnWidth:Math.round(rn("62.5rem")),maxColumnAutoWidth:Math.round(rn("31.25rem")),defaultRowHeight:Math.round(rn("2.1875rem")),defaultHeaderHeight:Math.round(rn("2.1875rem")),bgRowHovered:Rg(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:n}},[e])}const pC=qs.getLogger("useDataEditor");function mC(e,t,n,r,i,o,s,a,l){const u=f.useCallback(([m,y],b)=>{const v=e[m];if(!v.isEditable)return;const C=v.indexNumber,E=n.current.getOriginalRowIndex(i(y)),I=r([m,y]),R=v.getCellValue(I),P=v.getCellValue(b);if(!ki(I)&&P===R)return;const x=v.getCell(P,!0);ki(x)?pC.warn(`Not applying the cell edit since it causes this error:
195
195
  ${x.data}`):(n.current.setCell(C,E,{...x,lastUpdated:performance.now()}),a())},[e,n,i,r,a]),c=f.useCallback(()=>{if(t)return;const m=new Map;e.forEach(y=>{m.set(y.indexNumber,y.getCell(y.defaultValue))}),n.current.addRow(m),s()},[e,n,t,s]),d=f.useCallback(()=>{t||(c(),a())},[c,a,t]),g=f.useCallback(m=>{if(m.rows.length>0){if(t)return!0;const y=m.rows.toArray().map(b=>n.current.getOriginalRowIndex(i(b)));return n.current.deleteRows(y),s(),l(),a(),!1}if(m.current?.range){const y=[],b=m.current.range;for(let v=b.y;v<b.y+b.height;v++)for(let C=b.x;C<b.x+b.width;C++){const E=e[C];E.isEditable&&!E.isRequired&&(y.push({cell:[C,v]}),u([C,v],E.getCell(null)))}return y.length>0&&(a(),o(y)),!1}return!0},[e,n,t,o,i,a,u,l,s]),h=f.useCallback((m,y)=>{const[b,v]=m,C=[];for(let E=0;E<y.length;E++){const I=y[E];if(E+v>=n.current.getNumRows()){if(t)break;c()}for(let R=0;R<I.length;R++){const P=I[R],x=E+v,S=R+b;if(S>=e.length)break;const F=e[S];if(F.isEditable){const D=F.getCell(P,!0);if(lt(D)&&!ki(D)){const M=F.indexNumber,T=n.current.getOriginalRowIndex(i(x)),O=F.getCellValue(r([S,x]));F.getCellValue(D)!==O&&(n.current.setCell(M,T,{...D,lastUpdated:performance.now()}),C.push({cell:[S,x]}))}}}C.length>0&&(a(),o(C))}return!1},[e,n,t,i,r,c,a,o]),p=f.useCallback((m,y)=>{const b=m[0];if(b>=e.length)return!0;const v=e[b];if(v.validateInput){const C=v.validateInput(v.getCellValue(y));return C===!0||C===!1?C:v.getCell(C)}return!0},[e]);return{onCellEdited:u,onPaste:h,onRowAppended:d,onDelete:g,validateCell:p}}const jf=",",oo='"',vC='"',Kf=`
196
- `,bC="\uFEFF",wC=new RegExp(`[${[jf,oo,Kf].join("")}]`),Lc=qs.getLogger("useDataExporter");function Fc(e){return e.map(t=>yC(t)).join(jf)+Kf}function yC(e){if(ze(e))return"";const t=dt(e);return wC.test(t)?`${oo}${t.replace(new RegExp(oo,"g"),vC+oo)}${oo}`:t}async function _c(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(bC));const o=n.map(s=>s.name);await e.write(i.encode(Fc(o)));for(let s=0;s<r;s++){const a=[];n.forEach((l,u,c)=>{a.push(l.getCellValue(t([u,s])))}),await e.write(i.encode(Fc(a)))}await e.close()}function CC(e,t,n,r){return{exportToCsv:f.useCallback(async()=>{const s=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Us(()=>import("./es6.BYSNuG4D.js").then(c=>c.a),__vite__mapDeps([14,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:s,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await _c(u,e,t,n)}catch(a){if(a instanceof Error&&a.name==="AbortError")return;try{Lc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",a);let l="";const u=new WritableStream({write:h=>{l+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await _c(u.getWriter(),e,t,n);const c=new Blob([l],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),g=Wg({enforceDownloadInNewTab:r,url:d,filename:s});g.style.display="none",document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(d)}catch(l){Lc.error("Failed to export data as CSV",l)}}},[t,n,e,r])}}function SC(e,t,n,r){return{getCellContent:f.useCallback(([o,s])=>{if(o>t.length-1)return Dt("Column index out of bounds","This error should never happen. Please report this bug.");if(s>n-1)return Dt("Row index out of bounds","This error should never happen. Please report this bug.");try{const a=t[o],l=a.indexNumber,u=r.current.getOriginalRowIndex(s),c=r.current.isAddedRow(u);if(a.isEditable||c){const h=r.current.getCell(l,u);if(lt(h))return{...a.getCell(a.getCellValue(h),!1),lastUpdated:h.lastUpdated};if(c)return Dt("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${l}; row=${u}`)}const d=e.getCell(u,l),g=Ig(e,u,l);return jb(a,d,g,e.styler?.cssStyles)}catch(a){return Dt("Error during cell creation",`This error should never happen. Please report this bug.
196
+ `,bC="\uFEFF",wC=new RegExp(`[${[jf,oo,Kf].join("")}]`),Lc=qs.getLogger("useDataExporter");function Fc(e){return e.map(t=>yC(t)).join(jf)+Kf}function yC(e){if(ze(e))return"";const t=dt(e);return wC.test(t)?`${oo}${t.replace(new RegExp(oo,"g"),vC+oo)}${oo}`:t}async function _c(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(bC));const o=n.map(s=>s.name);await e.write(i.encode(Fc(o)));for(let s=0;s<r;s++){const a=[];n.forEach((l,u,c)=>{a.push(l.getCellValue(t([u,s])))}),await e.write(i.encode(Fc(a)))}await e.close()}function CC(e,t,n,r){return{exportToCsv:f.useCallback(async()=>{const s=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Us(()=>import("./es6.B8zRNPZ-.js").then(c=>c.a),__vite__mapDeps([14,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:s,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await _c(u,e,t,n)}catch(a){if(a instanceof Error&&a.name==="AbortError")return;try{Lc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",a);let l="";const u=new WritableStream({write:h=>{l+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await _c(u.getWriter(),e,t,n);const c=new Blob([l],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),g=Wg({enforceDownloadInNewTab:r,url:d,filename:s});g.style.display="none",document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(d)}catch(l){Lc.error("Failed to export data as CSV",l)}}},[t,n,e,r])}}function SC(e,t,n,r){return{getCellContent:f.useCallback(([o,s])=>{if(o>t.length-1)return Dt("Column index out of bounds","This error should never happen. Please report this bug.");if(s>n-1)return Dt("Row index out of bounds","This error should never happen. Please report this bug.");try{const a=t[o],l=a.indexNumber,u=r.current.getOriginalRowIndex(s),c=r.current.isAddedRow(u);if(a.isEditable||c){const h=r.current.getCell(l,u);if(lt(h))return{...a.getCell(a.getCellValue(h),!1),lastUpdated:h.lastUpdated};if(c)return Dt("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${l}; row=${u}`)}const d=e.getCell(u,l),g=Ig(e,u,l);return jb(a,d,g,e.styler?.cssStyles)}catch(a){return Dt("Error during cell creation",`This error should never happen. Please report this bug.
197
197
  Error: ${a}`)}},[t,n,e,r])}}function xC(e){const[t,n]=f.useState(void 0),r=f.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,s]=o.location;n(s)}},[n]);return{getRowThemeOverride:f.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function kC(e,t,n,r,i){const[o,s]=f.useState({columns:Qe.empty(),rows:Qe.empty(),current:void 0}),a=!t&&!n&&(e.selectionMode.includes(on.SelectionMode.MULTI_ROW)||e.selectionMode.includes(on.SelectionMode.SINGLE_ROW)),l=a&&e.selectionMode.includes(on.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(on.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(on.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(on.SelectionMode.MULTI_COLUMN),d=!t&&!n&&(e.selectionMode.includes(on.SelectionMode.SINGLE_CELL)||e.selectionMode.includes(on.SelectionMode.MULTI_CELL)),g=d&&e.selectionMode.includes(on.SelectionMode.MULTI_CELL),h=o.rows.length>0,p=o.columns.length>0,m=o.current!==void 0,y=f.useCallback(v=>{const C=!Ka(v.rows.toArray(),o.rows.toArray()),E=!Ka(v.columns.toArray(),o.columns.toArray()),I=!Ka(v.current,o.current);let R=a&&C||u&&E||d&&I,P=v;if((a||u)&&v.current!==void 0&&I&&(P={...v,rows:v.rows.length===0?o.rows:v.rows,columns:v.columns.length===0?o.columns:v.columns},R=d),C&&v.rows.length>0&&E&&v.columns.length===0&&(P={...P,rows:v.rows,columns:o.columns},R=!0),E&&v.columns.length>0&&C&&v.rows.length===0&&(P={...P,columns:v.columns,rows:o.rows,current:o.current},R=!0),E&&P.columns.length>=0){let x=P.columns;r.forEach((S,F)=>{S.isIndex&&(x=x.remove(F))}),x.length<P.columns.length&&(P={...P,columns:x})}s(P),R&&i(P,d)},[o,a,u,d,i,r]),b=f.useCallback((v=!1,C=!1)=>{const E={columns:C?o.columns:Qe.empty(),rows:v?o.rows:Qe.empty(),current:void 0};s(E),(!v&&a||!C&&u||d)&&i(E,d)},[o,a,u,d,i]);return{gridSelection:o,isRowSelectionActivated:a,isMultiRowSelectionActivated:l,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isCellSelectionActivated:d,isMultiCellSelectionActivated:g,isRowSelected:h,isColumnSelected:p,isCellSelected:m,clearSelection:b,processSelectionChange:y}}function MC(e,t,n,r,i,o,s,a,l){const u=e.rowHeight??t.defaultRowHeight,c=t.defaultHeaderHeight+u+2*t.tableBorderWidth,d=r?2:1,g=e.editingMode===on.EditingMode.DYNAMIC?1:0,h=n+g;let p=Math.max(h*u+d*t.defaultHeaderHeight+2*t.tableBorderWidth,c),m=Math.min(p,t.defaultTableHeight);const y=Zb(e,l);y&&(m=Math.max(y,c),p=Math.max(y,p)),o&&(m=Math.min(m,o),p=Math.min(p,o),y||(m=p));const b=t.minColumnWidth+2*t.tableBorderWidth,v=Math.max(i,b);let C,E=v;const I=pf(e,a),R=mf(e,a),P=Kb(a);I?C=v:R?(C=Math.min(Math.max(R,b),v),E=Math.min(Math.max(R,E),v)):P&&(C=void 0);const[x,S]=f.useState({width:C||"100%",height:m});return f.useLayoutEffect(()=>{I&&x.width==="100%"&&S(F=>({...F,width:v}))},[v]),f.useLayoutEffect(()=>{S(F=>({...F,width:C||"100%"}))},[C]),f.useLayoutEffect(()=>{S(F=>({...F,height:m}))},[m,n]),f.useLayoutEffect(()=>{if(s){const F=I||lt(R)&&R>0;S({width:F?E:"100%",height:p})}else S({width:C||"100%",height:m})},[s]),{minHeight:c,maxHeight:p,minWidth:b,maxWidth:E,rowHeight:u,resizableSize:x,setResizableSize:S}}const RC=600,IC="⚠️ Please fill out this cell.";function EC(e,t,n=[]){const[r,i]=f.useState(),o=f.useRef(null),s=f.useCallback(l=>{if(clearTimeout(o.current),o.current=0,i(void 0),(l.kind==="header"||l.kind==="cell")&&l.location){const u=l.location[0],c=l.location[1];let d;if(u<0||u>=e.length||n.includes(c))return;const g=e[u];if(l.kind==="header"&&lt(g))d=g.help;else if(l.kind==="cell"){const h=t([u,c]);ki(h)?d=h.errorDetails:g.isRequired&&g.isEditable&&sl(h)?d=IC:xb(h)&&(d=h.tooltip)}d&&(o.current=setTimeout(()=>{d&&i({content:d,left:l.bounds.x+l.bounds.width/2,top:l.bounds.y})},RC))}},[e,t,i,o,n]),a=f.useCallback(()=>{i(void 0)},[i]);return{tooltip:r,clearTooltip:a,onItemHovered:s}}const Zf=nr("div",{target:"e32gfpu0"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs})),Dr=nr("div",{target:"e32gfpu1"})(({theme:e,isActive:t,hasSubmenu:n})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,paddingTop:e.spacing.twoXS,paddingBottom:e.spacing.twoXS,cursor:"pointer",backgroundColor:t?e.colors.darkenedBgMix15:void 0,"&:hover":{backgroundColor:e.colors.darkenedBgMix15},minWidth:e.sizes.minMenuWidth,...n&&{justifyContent:"space-between","& > :first-of-type":{display:"flex",alignItems:"center",gap:e.spacing.sm}}})),Jf=nr("div",{target:"e32gfpu2"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs})),TC=nr("div",{target:"e32gfpu3"})(({theme:e})=>({display:"flex",alignItems:"center",padding:`${e.spacing.sm} ${e.spacing.sm}`,cursor:"default",gap:e.spacing.twoXS})),DC=nr("div",{target:"e32gfpu4"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",padding:e.spacing.twoXS,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.md,backgroundColor:"transparent",color:e.colors.bodyText,height:"fit-content"})),OC=nr("div",{target:"e32gfpu5"})(({theme:e})=>({display:"flex",alignItems:"center",flexGrow:1,padding:`${e.spacing.threeXS} ${e.spacing.threeXS}`,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.md,backgroundColor:e.colors.secondaryBg,minWidth:0,overflow:"hidden"})),PC=nr("span",{target:"e32gfpu6"})(({theme:e})=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1,margin:`0 ${e.spacing.xs}`,fontSize:e.fontSizes.twoSm,maxWidth:"4rem"})),LC=nr("button",{target:"e32gfpu7"})(({theme:e})=>({background:"none",border:"none",padding:e.spacing.twoXS,cursor:"pointer",color:e.colors.bodyText,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:e.radii.md,transition:"background-color 0.2s ease","&:hover":{backgroundColor:e.colors.fadedText05},"&:active":{backgroundColor:e.colors.fadedText10}})),Ac=[{format:"",label:"Automatic",icon:":material/123:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"plain",label:"Plain",icon:":material/speed_1_75:"},{format:"compact",label:"Compact",icon:":material/1k:"},{format:"dollar",label:"Dollar",icon:":material/attach_money:"},{format:"euro",label:"Euro",icon:":material/euro:"},{format:"yen",label:"Yen",icon:":material/currency_yen:"},{format:"percent",label:"Percent",icon:":material/percent:"},{format:"scientific",label:"Scientific",icon:":material/experiment:"},{format:"accounting",label:"Accounting",icon:":material/finance_chip:"}],FC={number:Ac,progress:Ac,datetime:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"distance",label:"Distance",icon:":material/search_activity:"},{format:"calendar",label:"Calendar",icon:":material/today:"}],date:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"distance",label:"Distance",icon:":material/search_activity:"}],time:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"}]};function _C({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:i,onCloseMenu:o,children:s}){const a=Kr(),{colors:l,fontSizes:u,radii:c,fontWeights:d}=a,g=FC[e]||[];return g.length===0?He(Kc,{}):He(Ma,{triggerType:Zc.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:He(Zf,{role:"menu",children:g.map(h=>vn(Dr,{onClick:()=>{i(h.format),o()},role:"menuitem",children:[He(Jn,{size:"base",margin:"0",color:"inherit",iconValue:h.icon}),h.label]},h.format))}),placement:xa.right,showArrow:!1,popoverMargin:2,overrides:{Body:{props:{"data-testid":"stDataFrameColumnFormattingMenu"},style:{borderTopLeftRadius:c.default,borderTopRightRadius:c.default,borderBottomLeftRadius:c.default,borderBottomRightRadius:c.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${a.sizes.borderWidth} solid ${a.colors.borderColor}`}},Inner:{style:{backgroundColor:ka(a)?l.bgColor:l.secondaryBg,color:l.bodyText,fontSize:u.sm,fontWeight:d.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:s})}const AC=f.memo(_C);function HC({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:i,onCloseMenu:o,onSortColumn:s,onHideColumn:a,column:l,onChangeFormat:u,onAutosize:c}){const d=Kr(),[g,h]=f.useState(!1),{colors:p,fontSizes:m,radii:y,fontWeights:b}=d,{isCopied:v,copyToClipboard:C}=Eg();f.useEffect(()=>{function R(P){P.preventDefault()}return document.addEventListener("wheel",R,{passive:!1}),document.addEventListener("touchmove",R,{passive:!1}),()=>{document.removeEventListener("wheel",R),document.removeEventListener("touchmove",R)}},[]);const E=f.useCallback(()=>{o()},[o]),I=f.useCallback(()=>{C(l.title)},[l.title,C]);return He(Ma,{autoFocus:!0,"aria-label":"Dataframe column menu",content:vn(Zf,{children:[vn(TC,{children:[He(DC,{title:l.kind,children:He(Jn,{iconValue:l.typeIcon||":material/notes:",size:"base",color:"inherit"})}),vn(OC,{title:l.title,children:[He(PC,{children:l.title}),He(LC,{onClick:I,title:"Copy column name","aria-label":"Copy column name",children:He(Jn,{iconValue:v?":material/check:":":material/content_copy:",size:"sm",margin:"0",color:"inherit"})})]})]}),s&&vn(Kc,{children:[vn(Dr,{onClick:()=>{s("asc"),E()},role:"menuitem",children:[He(Jn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),vn(Dr,{onClick:()=>{s("desc"),E()},role:"menuitem",children:[He(Jn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_downward:"}),"Sort descending"]}),He(Jf,{})]}),u&&He(AC,{columnKind:l.kind,isOpen:g,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onChangeFormat:u,onCloseMenu:E,children:vn(Dr,{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),isActive:g,hasSubmenu:!0,children:[vn("div",{children:[He(Jn,{size:"base",margin:"0",color:"inherit",iconValue:":material/format_list_numbered:"}),"Format"]}),He(Jn,{size:"base",margin:"0",color:"inherit",iconValue:":material/chevron_right:"})]})}),c&&vn(Dr,{onClick:()=>{c(),E()},children:[He(Jn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&vn(Dr,{onClick:()=>{i(),E()},children:[He(Jn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&vn(Dr,{onClick:()=>{r(),E()},children:[He(Jn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep:"}),"Pin column"]}),a&&vn(Dr,{onClick:()=>{a(),E()},children:[He(Jn,{size:"base",margin:"0",color:"inherit",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:xa.bottomRight,accessibilityType:Jc.menu,showArrow:!1,popoverMargin:rn("0.375rem"),onClickOutside:g?void 0:E,onEsc:E,overrides:{Body:{props:{"data-testid":"stDataFrameColumnMenu"},style:{paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{border:`${d.sizes.borderWidth} solid ${d.colors.borderColor}`,backgroundColor:ka(d)?p.bgColor:p.secondaryBg,color:p.bodyText,fontSize:m.sm,fontWeight:b.normal,borderTopLeftRadius:y.default,borderTopRightRadius:y.default,borderBottomLeftRadius:y.default,borderBottomRightRadius:y.default,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:!0,children:He("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const zC=f.memo(HC),VC="(index)";function Is(e,t){return!t.length||e.isIndex?!1:!t.includes(e.id)&&!t.includes(e.name)}const Hc=({label:e,initialValue:t,isIndeterminate:n,onChange:r})=>{const i=Kr();return He(Bg,{isIndeterminate:n,checked:t,onChange:o=>{r(o.target.checked)},"aria-label":e,checkmarkType:Ng.default,labelPlacement:$g.right,overrides:{Root:{style:({$isFocusVisible:o})=>({marginBottom:i.spacing.none,marginTop:i.spacing.none,paddingLeft:i.spacing.md,paddingRight:i.spacing.md,paddingTop:i.spacing.twoXS,paddingBottom:i.spacing.twoXS,backgroundColor:o?i.colors.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Checkmark:{style:({$isFocusVisible:o,$checked:s,$isIndeterminate:a})=>{const l=s||a?i.colors.primary:i.colors.fadedText40;return{outline:0,width:i.sizes.checkbox,height:i.sizes.checkbox,marginTop:i.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:o&&(s||a)?`0 0 0 0.2rem ${mi(i.colors.primary,.5)}`:"",borderLeftWidth:i.sizes.borderWidth,borderRightWidth:i.sizes.borderWidth,borderTopWidth:i.sizes.borderWidth,borderBottomWidth:i.sizes.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:i.lineHeights.small,paddingLeft:i.spacing.sm,position:"relative",color:i.colors.bodyText,fontSize:i.fontSizes.sm,fontWeight:i.fontWeights.normal}}},children:e})},$C=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:i,children:o,isOpen:s,onClose:a})=>{const l=Kr(),u=h=>!(h.isHidden===!0||Is(h,t)),c=e.every(u),d=e.some(u)&&!c,g=h=>{e.forEach(p=>{const m=Is(p,t);h?(i(p.id),m&&n(y=>[...y,p.id])):r(p.id)})};return He(Ma,{triggerType:Zc.click,placement:xa.bottomRight,autoFocus:!0,focusLock:!0,content:()=>vn("div",{style:{paddingTop:l.spacing.sm,paddingBottom:l.spacing.sm,maxHeight:l.sizes.maxDropdownHeight,overflow:"auto"},children:[He(Hc,{label:"Select all",isIndeterminate:d,initialValue:c,onChange:h=>{g(h)}}),He(Jf,{}),He("div",{children:e.map(h=>{const p=Is(h,t);return He(Hc,{label:!h.title&&h.isIndex?VC:h.title,initialValue:!(h.isHidden===!0||p),onChange:m=>{m?(i(h.id),p&&n(y=>[...y,h.id])):r(h.id)}},h.id)})})]}),isOpen:s,onClickOutside:a,onClick:()=>s?a():void 0,onEsc:a,ignoreBoundary:!1,overrides:{Body:{props:{"data-testid":"stDataFrameColumnVisibilityMenu"},style:{borderTopLeftRadius:l.radii.default,borderTopRightRadius:l.radii.default,borderBottomLeftRadius:l.radii.default,borderBottomRightRadius:l.radii.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${l.sizes.borderWidth} solid ${l.colors.borderColor}`}},Inner:{style:{backgroundColor:ka(l)?l.colors.bgColor:l.colors.secondaryBg,color:l.colors.bodyText,fontSize:l.fontSizes.sm,fontWeight:l.fontWeights.normal,minWidth:l.sizes.minMenuWidth,maxWidth:`calc(${l.sizes.minMenuWidth} * 2)`,maxHeight:l.sizes.maxDropdownHeight,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:He("div",{children:o})})},NC=f.memo($C),zc=nr("div",{target:"e8es05k0"})(({theme:e,isInHorizontalLayout:t})=>({position:"relative",display:t?"flex":"inline-block","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",borderRadius:e.radii.default},"& .dvn-scroller":{overflowX:"auto !important",overflowY:"auto !important"},"& .gdg-search-bar":{maxWidth:"19rem",width:"80%",minWidth:"6rem",top:e.spacing.sm,right:e.spacing.sm,padding:e.spacing.sm,borderRadius:e.radii.default,"& .gdg-search-status":{paddingTop:e.spacing.twoXS,fontSize:e.fontSizes.twoSm},"& .gdg-search-progress":{display:"none"},"& input":{width:"100%"},"& button":{width:e.iconSizes.xl,height:e.iconSizes.xl,"& .button-icon":{width:e.iconSizes.base,height:e.iconSizes.base}}}}));function BC({top:e,left:t,content:n,clearTooltip:r}){const[i,o]=f.useState(!0),s=Kr(),{colors:a,fontSizes:l,radii:u,fontWeights:c}=s,d=f.useCallback(()=>{o(!1),r()},[r,o]);return He(Ma,{content:He(Tg,{"data-testid":"stDataFrameTooltipContent",children:He(Dg,{style:{fontSize:l.sm},source:n,allowHTML:!1})}),placement:xa.top,accessibilityType:Jc.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:d,onEsc:d,overrides:{Body:{style:{borderTopLeftRadius:u.default,borderTopRightRadius:u.default,borderBottomLeftRadius:u.default,borderBottomRightRadius:u.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:ka(s)?a.bgColor:a.secondaryBg,color:a.bodyText,fontSize:l.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:i,children:He("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const WC=f.memo(BC),Vc=150,UC=15e4,qC="0.5rem";function GC({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:i,fragmentId:o,customToolbarActions:s,widthConfig:a,heightConfig:l}){const{expanded:u,expand:c,collapse:d,width:g,height:h}=Wl(Ag),{isInHorizontalLayout:p}=Wl(Og),m=f.useRef(null),y=f.useRef(null),b=f.useRef(null),v=Pg(),C=gC(),{getRowThemeOverride:E,onItemHovered:I}=xC(C),{libConfig:{enforceDownloadInNewTab:R=!1}}=f.useContext(Lg),[P,x]=f.useState(!0),[S,F]=f.useState(!1),[D,M]=f.useState(!1),[T,O]=f.useState(!1),[k,$]=f.useState(),[G,j]=f.useState(!1),ue=f.useCallback(()=>j(Ce=>!Ce),[]),Q=f.useCallback(()=>j(!1),[]),ee=f.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]);ze(e.editingMode)&&(e.editingMode=on.EditingMode.READ_ONLY);const{READ_ONLY:ce,DYNAMIC:ae}=on.EditingMode,ge=t.dimensions,de=Math.max(0,ge.numDataRows),re=de===0&&!(e.editingMode===ae&&ge.numDataColumns>0),H=de>UC,L=!H&&!re&&e.editingMode!==ae,X=!re&&e.editingMode===ae&&!n,te=f.useRef(new Zo(de)),[ie,Se]=f.useState(te.current.getNumRows());f.useEffect(()=>{te.current=new Zo(de),Se(te.current.getNumRows())},[de]);const me=f.useCallback(()=>{te.current=new Zo(de),Se(te.current.getNumRows())},[de]),[nt,xe]=f.useState(e.columnOrder);f.useEffect(()=>{xe(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:gt,allColumns:Mt,setColumnConfigMapping:Ue}=e1(e,t,n,nt,a);f.useEffect(()=>{if(e.editingMode===ce||!r)return;const Ce=r.getStringValue({id:e.id,formId:e.formId});Ce&&(te.current.fromJson(Ce,gt),Se(te.current.getNumRows()))},[]);const{getCellContent:ne}=SC(t,gt,ie,te),{columns:oe,sortColumn:we,getOriginalIndex:fe,getCellContent:ye}=c1(de,gt,ne),$e=f.useCallback((Ce,_t)=>{if(!r)return;const Jt={selection:{rows:[],columns:[],cells:[]}};if(Jt.selection.rows=Ce.rows.toArray().map(Yt=>fe(Yt)),Jt.selection.columns=Ce.columns.toArray().map(Yt=>Xr(oe[Yt])),_t&&Ce.current){const{cell:Yt,range:jt}=Ce.current;if(jt)for(let Cn=jt.y;Cn<jt.y+jt.height;Cn++)for(let Bn=jt.x;Bn<jt.x+jt.width;Bn++)oe[Bn].isIndex||Jt.selection.cells.push([fe(Cn),Xr(oe[Bn])]);else if(Yt){const[Cn,Bn]=Yt;oe[Cn].isIndex||Jt.selection.cells.push([fe(Bn),Xr(oe[Cn])])}}const Ln=JSON.stringify(Jt),un=r.getStringValue({id:e.id,formId:e.formId});(un===void 0||un!==Ln)&&r.setStringValue({id:e.id,formId:e.formId},Ln,{fromUi:!0},o)},[oe,e.id,e.formId,r,o,fe]),{debouncedCallback:Pe}=Zu($e,Vc),{gridSelection:it,isRowSelectionActivated:Me,isMultiRowSelectionActivated:qe,isColumnSelectionActivated:Te,isMultiColumnSelectionActivated:Ee,isCellSelectionActivated:De,isMultiCellSelectionActivated:ft,isRowSelected:ot,isColumnSelected:Xe,isCellSelected:wt,clearSelection:yt,processSelectionChange:Ft}=kC(e,re,n,oe,Pe);f.useEffect(()=>{De||yt(!0,!0)},[u]);const It=f.useCallback(Ce=>{y.current?.updateCells(Ce)},[]);f.useEffect(()=>{if(!Me&&!Te&&!De||!r)return;const Ce=r.getStringValue({id:e.id,formId:e.formId});if(Ce){const _t=oe.map(jt=>Xr(jt)),Jt=JSON.parse(Ce);let Ln=Qe.empty(),un=Qe.empty(),Yt;if(Jt.selection?.rows?.forEach(jt=>{Ln=Ln.add(jt)}),Jt.selection?.columns?.forEach(jt=>{un=un.add(_t.indexOf(jt))}),De&&!ft){const[jt,Cn]=Jt.selection?.cells?.[0]??[];jt!==void 0&&Cn!==void 0&&(Yt=[_t.indexOf(Cn),jt])}if(Ln.length>0||un.length>0||Yt!==void 0){const jt={rows:Ln,columns:un,current:Yt?{cell:Yt,range:{x:Yt[0],y:Yt[1],width:1,height:1},rangeStack:[]}:void 0};Ft(jt)}}},[]);const dn=f.useCallback(()=>{ie!==te.current.getNumRows()&&Se(te.current.getNumRows())},[ie]),Zt=f.useCallback(()=>{if(!r)return;const Ce=te.current.toJson(oe);let _t=r.getStringValue({id:e.id,formId:e.formId});_t===void 0&&(_t=new Zo(0).toJson([])),Ce!==_t&&r.setStringValue({id:e.id,formId:e.formId},Ce,{fromUi:!0},o)},[oe,e.id,e.formId,r,o]),{debouncedCallback:fn}=Zu(Zt,Vc),{exportToCsv:Ot}=CC(ye,oe,ie,R),{onCellEdited:Ct,onPaste:Tn,onRowAppended:pt,onDelete:en,validateCell:Bt}=mC(oe,e.editingMode!==ae,te,ye,fe,It,dn,fn,yt),Le=f.useMemo(()=>re?[0]:X?[ie]:[],[re,X,ie]),{tooltip:St,clearTooltip:mt,onItemHovered:Dn}=EC(oe,ye,Le),{drawCell:Gt,customRenderers:hn}=hC(oe),{provideEditor:On}=f1(),Xt=f.useCallback(Ce=>({...Ce,hasMenu:!re}),[re]),tn=f.useMemo(()=>oe.map(Ce=>Xt(Vs(Ce))),[oe,Xt]),{columns:Be,onColumnResize:Pt}=i1(tn),$n=t.dimensions.numHeaderRows>1,{minHeight:xt,maxHeight:Et,minWidth:kn,maxWidth:cr,rowHeight:Nn,resizableSize:N,setResizableSize:We}=MC(e,C,ie,$n,g||0,h,u,a,l),Ge=f.useCallback(([Ce,_t])=>({...kb(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:C.glideTheme.textLight},span:[0,Math.max(oe.length-1,0)]}),[oe,C.glideTheme.textLight]),Rt=f.useCallback(()=>{me(),yt()},[me,yt]);zg({element:e,widgetMgr:r,onFormCleared:Rt});const{pinColumn:gn,unpinColumn:ln,freezeColumns:Mn}=n1(oe,re,g||0,C.minColumnWidth,yt,Ue),{changeColumnFormat:wn}=t1(Ue),{hideColumn:Wt,showColumn:yn}=d1(yt,Ue),{onColumnMoved:Pn}=r1(oe,Mn,gn,ln,xe);return f.useEffect(()=>{let Ce;const _t=requestAnimationFrame(()=>{Ce=setTimeout(()=>{if(b.current&&y.current){const Jt=b.current?.querySelector(".dvn-stack")?.getBoundingClientRect();Jt&&(M(Jt.height>b.current.clientHeight),O(Jt.width>b.current.clientWidth))}},0)});return()=>{cancelAnimationFrame(_t),Ce&&clearTimeout(Ce)}},[N,ie,Be]),f.useEffect(()=>{Mt.length==oe.length&&j(!1)},[Mt.length,oe.length]),vn(zc,{className:"stDataFrame","data-testid":"stDataFrame",ref:b,isInHorizontalLayout:p,onPointerDown:Ce=>{if(b.current){const _t=b.current.getBoundingClientRect(),Jt=(v||Math.round(rn(qC)))+1;T&&_t.height-Jt<Ce.clientY-_t.top&&Ce.stopPropagation(),D&&_t.width-Jt<Ce.clientX-_t.left&&Ce.stopPropagation()}},onBlur:Ce=>{!P&&!ee&&!Ce.currentTarget.contains(Ce.relatedTarget)&&!De&&yt(!0,!0)},children:[vn(Hg,{isFullScreen:u,disableFullscreenMode:i,locked:ot&&!Me||wt||ee&&P||G,onExpand:c,onCollapse:d,target:zc,children:[s?.map(Ce=>Ce),(Me&&ot||Te&&Xe||De&&wt)&&He(gi,{label:"Clear selection",icon:Ug,onClick:()=>{yt(),mt()}}),X&&ot&&He(gi,{label:"Delete row(s)",icon:jg,onClick:()=>{en&&(en(it),mt())}}),X&&!ot&&He(gi,{label:"Add row",icon:Qc,onClick:()=>{pt&&(x(!0),pt(),mt(),y.current?.scrollTo(0,ie,"vertical"))}}),!re&&Mt.length>oe.length&&He(NC,{columns:Mt,columnOrder:nt,setColumnOrder:xe,hideColumn:Wt,showColumn:yn,isOpen:G,onClose:Q,children:He(gi,{label:"Show/hide columns",icon:td,onClick:ue})}),!H&&!re&&He(gi,{label:"Download as CSV",icon:Kg,onClick:Ot}),!re&&He(gi,{label:"Search",icon:ed,onClick:()=>{S?F(!1):(x(!0),F(!0)),mt()}})]}),He(Fg,{"data-testid":"stDataFrameResizable",ref:m,defaultSize:N,style:{border:`${C.tableBorderWidth}px solid ${C.glideTheme.borderColor}`,borderRadius:`${C.tableBorderRadius}`},minHeight:xt,maxHeight:Et,minWidth:kn,maxWidth:p?void 0:cr,size:N,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!p,bottomLeft:!1,topLeft:!1},grid:[1,Nn],snapGap:Nn/3,onResizeStop:(Ce,_t,Jt,Ln)=>{if(m.current){const un=2*C.tableBorderWidth;We({width:m.current.size.width,height:Et-m.current.size.height===un?m.current.size.height+un:m.current.size.height})}},children:He(mb,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:y,columns:Be,rows:re?1:ie,minColumnWidth:C.minColumnWidth,maxColumnWidth:C.maxColumnWidth,maxColumnAutoWidth:C.maxColumnAutoWidth,rowHeight:Nn,headerHeight:C.defaultHeaderHeight,getCellContent:re?Ge:ye,onColumnResize:ee?void 0:Pt,resizeIndicator:"header",freezeColumns:Mn,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:ee?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:Te?void 0:Pn,onItemHovered:Ce=>{I?.(Ce),Dn?.(Ce)},keybindings:{downFill:!0,...De||H?{selectAll:!1}:{}},onKeyDown:Ce=>{(Ce.ctrlKey||Ce.metaKey)&&Ce.key==="f"&&(F(_t=>!_t),Ce.stopPropagation(),Ce.preventDefault())},showSearch:S,searchResults:S?void 0:[],onSearchClose:()=>{F(!1),mt()},onHeaderClicked:(Ce,_t)=>{!L||Te||(S&&F(!1),Me&&ot?yt():yt(!0,!0),we(Ce,"auto"))},gridSelection:it,onGridSelectionChange:Ce=>{(P||ee)&&(Ft(Ce),St!==void 0&&mt(),$(void 0),j(!1))},theme:C.glideTheme,getRowThemeOverride:E,onMouseMove:Ce=>{Ce.kind==="out-of-bounds"&&P?x(!1):Ce.kind!=="out-of-bounds"&&!P&&x(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,paddingBottom:T?-v:void 0,paddingRight:D?-v:void 0},provideEditor:On,drawCell:Gt,customRenderers:hn,imageEditorOverride:zb,headerIcons:C.headerIcons,validateCell:Bt,onHeaderMenuClick:(Ce,_t)=>{G||$({columnIdx:Ce,headerBounds:_t})},onPaste:!1,...Me&&{rowMarkers:{kind:"checkbox-visible",checkboxStyle:"square",theme:{bgCell:C.glideTheme.bgHeader,bgCellMedium:C.glideTheme.bgHeader,textMedium:C.glideTheme.textLight}},rowSelectionMode:qe?"multi":"auto",rowSelect:n?"none":qe?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...Te&&{columnSelect:n?"none":Ee?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...De&&{rangeSelect:ft?"rect":"cell",rangeSelectionBlending:"mixed"},...!re&&e.editingMode!==ce&&!n&&{fillHandle:!ee,onCellEdited:Ct,onPaste:Tn,onDelete:en},...!re&&e.editingMode===ae&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:C.glideTheme.bgHeader,bgCellMedium:C.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:pt,onHeaderClicked:void 0}})}),St&&St.content&&He(WC,{top:St.top,left:St.left,content:St.content,clearTooltip:mt}),k&&Yc.createPortal(He(zC,{top:k.headerBounds.y+k.headerBounds.height,left:k.headerBounds.x+k.headerBounds.width,column:gt[k.columnIdx],onCloseMenu:()=>$(void 0),onSortColumn:L?Ce=>{S&&F(!1),yt(!(Me&&ot),!0),we(k.columnIdx,Ce,!0)}:void 0,isColumnPinned:gt[k.columnIdx].isPinned,onUnpinColumn:()=>{ln(gt[k.columnIdx].id)},onPinColumn:()=>{gn(gt[k.columnIdx].id)},onHideColumn:()=>{Wt(gt[k.columnIdx].id)},onChangeFormat:Ce=>{wn(gt[k.columnIdx].id,Ce),setTimeout(()=>{y.current?.remeasureColumns(Qe.fromSingleSelection(k.columnIdx))},100)},onAutosize:()=>{y.current?.remeasureColumns(Qe.fromSingleSelection(k.columnIdx))}}),document.querySelector("#portal"))]})}const XC=_g(GC),Qf=f.memo(XC),YC=({data:e,height:t,customToolbarActions:n})=>He(Qf,{element:new on({useContainerWidth:!0,editingMode:on.EditingMode.READ_ONLY,disabled:!0,data:void 0,styler:null,width:void 0,height:t??null,id:"",columns:"",formId:"",columnOrder:[],selectionMode:[]}),data:e,widgetMgr:void 0,disabled:!0,fragmentId:void 0,disableFullscreenMode:!0,customToolbarActions:n,widthConfig:new Ul.WidthConfig({useStretch:!0}),heightConfig:t?new Ul.HeightConfig({pixelHeight:t}):void 0}),aS=Object.freeze(Object.defineProperty({__proto__:null,ReadOnlyGrid:YC,default:Qf},Symbol.toStringTag,{value:"Module"}));export{K0 as C,YC as R,Ld as T,yi as a,np as b,aS as c,vi as i,bm as m,sn as s};