streamlit-nightly 1.46.2.dev20250715__py3-none-any.whl → 1.47.1.dev20250716__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 (82) hide show
  1. streamlit/connections/snowflake_connection.py +2 -2
  2. streamlit/elements/graphviz_chart.py +7 -0
  3. streamlit/elements/lib/file_uploader_utils.py +21 -2
  4. streamlit/elements/plotly_chart.py +6 -2
  5. streamlit/elements/pyplot.py +5 -1
  6. streamlit/elements/widgets/chat.py +6 -0
  7. streamlit/elements/widgets/file_uploader.py +6 -0
  8. streamlit/static/index.html +1 -1
  9. streamlit/static/manifest.json +218 -218
  10. streamlit/static/static/js/{ErrorOutline.esm.CaUhmcG6.js → ErrorOutline.esm.DNK5J9Fz.js} +1 -1
  11. streamlit/static/static/js/{FileDownload.esm.ZEl-HfEg.js → FileDownload.esm.Cb2Z--zt.js} +1 -1
  12. streamlit/static/static/js/{FileHelper.BKIVKQnB.js → FileHelper.QQBwcr1S.js} +1 -1
  13. streamlit/static/static/js/{FormClearHelper.C4W8xjEX.js → FormClearHelper.Fo17GZrr.js} +1 -1
  14. streamlit/static/static/js/{Hooks.Bcs7Dqad.js → Hooks.Blc9M7kn.js} +1 -1
  15. streamlit/static/static/js/{InputInstructions.CAp9mFM6.js → InputInstructions.DQ5Ej_7M.js} +1 -1
  16. streamlit/static/static/js/{ProgressBar.DBmbQ5U6.js → ProgressBar.DbvwXQwC.js} +1 -1
  17. streamlit/static/static/js/{RenderInPortalIfExists.BGENGpwt.js → RenderInPortalIfExists.DUUcjeaK.js} +1 -1
  18. streamlit/static/static/js/{Toolbar.CA92Moni.js → Toolbar.oggLWFZy.js} +1 -1
  19. streamlit/static/static/js/{base-input.C-H36mFE.js → base-input.DiS6HF4j.js} +1 -1
  20. streamlit/static/static/js/{checkbox.B6I7DbdE.js → checkbox.D60kv6TD.js} +1 -1
  21. streamlit/static/static/js/{createSuper.DEaMobJa.js → createSuper.C67qUZn1.js} +1 -1
  22. streamlit/static/static/js/{data-grid-overlay-editor.CxvB719M.js → data-grid-overlay-editor.Cov081px.js} +1 -1
  23. streamlit/static/static/js/{downloader.CDDSxxak.js → downloader.C82YfVzs.js} +1 -1
  24. streamlit/static/static/js/{es6.BMYexa9t.js → es6.BhqRltzl.js} +2 -2
  25. streamlit/static/static/js/{iframeResizer.contentWindow.D-l9cCws.js → iframeResizer.contentWindow.BZvCz8C4.js} +1 -1
  26. streamlit/static/static/js/{index.BjJqANY4.js → index.6RK7jQPW.js} +1 -1
  27. streamlit/static/static/js/{index.DygxY7Lg.js → index.B3AxymZr.js} +2 -2
  28. streamlit/static/static/js/{index.CEUhSvrW.js → index.B4lVqTBW.js} +1 -1
  29. streamlit/static/static/js/{index.Ch30W6NP.js → index.B5O7nWCz.js} +1 -1
  30. streamlit/static/static/js/{index.DJ6SMXzt.js → index.B5wDHoKR.js} +1 -1
  31. streamlit/static/static/js/{index.DBVPN8iJ.js → index.B6y7HgHo.js} +1 -1
  32. streamlit/static/static/js/{index.DFjvmFUl.js → index.BHolK_CI.js} +1 -1
  33. streamlit/static/static/js/{index.DMzpbFDn.js → index.BM85-T91.js} +1 -1
  34. streamlit/static/static/js/{index.Bb5Sxtkx.js → index.BNqR53-k.js} +1 -1
  35. streamlit/static/static/js/{index.DHv7KxuP.js → index.BOKlrlFj.js} +1 -1
  36. streamlit/static/static/js/{index.CZbA_QY0.js → index.BSlzPv51.js} +1 -1
  37. streamlit/static/static/js/{index.BdazK8za.js → index.BZF4FCAE.js} +1 -1
  38. streamlit/static/static/js/{index.1ZtAvXND.js → index.B_k2kuGW.js} +1 -1
  39. streamlit/static/static/js/{index.DNoDZbuV.js → index.By0Eif-W.js} +1 -1
  40. streamlit/static/static/js/{index.aLRZj3JI.js → index.C70-m6Fw.js} +1 -1
  41. streamlit/static/static/js/{index.Buz-cCdK.js → index.CA0u5BJL.js} +1 -1
  42. streamlit/static/static/js/{index.Br2RYgMU.js → index.C_X5F5TG.js} +1 -1
  43. streamlit/static/static/js/{index.Ce906Q5W.js → index.CaTOVCTS.js} +1 -1
  44. streamlit/static/static/js/{index.D9XZpDDt.js → index.Cb-_n28x.js} +1 -1
  45. streamlit/static/static/js/{index.Ou3kxN43.js → index.Cn9KSkdV.js} +1 -1
  46. streamlit/static/static/js/{index.B-g_Erog.js → index.CtapdFs_.js} +5 -5
  47. streamlit/static/static/js/{index.vRRu8CJW.js → index.CvFk5Vuj.js} +1 -1
  48. streamlit/static/static/js/{index.EAQB8Tuq.js → index.D1AeFlAQ.js} +3 -3
  49. streamlit/static/static/js/{index.CS9yBABI.js → index.D6Zkg3M-.js} +1 -1
  50. streamlit/static/static/js/{index.BoTBd6Jn.js → index.DFLdlD8F.js} +1 -1
  51. streamlit/static/static/js/{index.DYvo87DK.js → index.DGw6KzzW.js} +1 -1
  52. streamlit/static/static/js/{index.CphcnmQO.js → index.DJhDzJzB.js} +1 -1
  53. streamlit/static/static/js/{index.Dm8vdcs9.js → index.DbQYY96m.js} +1 -1
  54. streamlit/static/static/js/{index.phUFaJLn.js → index.KCUN3mSA.js} +1 -1
  55. streamlit/static/static/js/{index.DzH3Qe6P.js → index.KU83amIK.js} +1 -1
  56. streamlit/static/static/js/{index.Ct2v9YN2.js → index.LqU8bU6z.js} +1 -1
  57. streamlit/static/static/js/{index.BQQ5JTaz.js → index.RvGvTgvL.js} +1 -1
  58. streamlit/static/static/js/{index.kIS8fJE1.js → index.X5bDcXsg.js} +1 -1
  59. streamlit/static/static/js/{index.CqALE_Sz.js → index.dfF-LVn5.js} +1 -1
  60. streamlit/static/static/js/{index.C_f3O5DO.js → index.kt6H3rVc.js} +1 -1
  61. streamlit/static/static/js/{index.CfoE7jon.js → index.rrZNiSCJ.js} +1 -1
  62. streamlit/static/static/js/{index.C9PLrvrw.js → index.uTlWTJyJ.js} +1 -1
  63. streamlit/static/static/js/{input.DjnwsrgF.js → input.C5ChshDH.js} +1 -1
  64. streamlit/static/static/js/{memory.C-fF2BpE.js → memory.YFW_wmkS.js} +1 -1
  65. streamlit/static/static/js/{mergeWith.Cjweouij.js → mergeWith.CRLNQNLL.js} +1 -1
  66. streamlit/static/static/js/{number-overlay-editor.BFTlQD7x.js → number-overlay-editor.Coke5m2c.js} +1 -1
  67. streamlit/static/static/js/{possibleConstructorReturn.Cy1PJuxU.js → possibleConstructorReturn.DG2YBhZN.js} +1 -1
  68. streamlit/static/static/js/{sandbox.DvSXZ4R-.js → sandbox.Bk17Upg8.js} +1 -1
  69. streamlit/static/static/js/{timepicker.bPCY7gSF.js → timepicker.DGOKu1Dm.js} +1 -1
  70. streamlit/static/static/js/{toConsumableArray.DaNXH4b3.js → toConsumableArray.FS1y1Ph9.js} +1 -1
  71. streamlit/static/static/js/{uniqueId.CDZNs_pn.js → uniqueId.xlR2febd.js} +1 -1
  72. streamlit/static/static/js/{useBasicWidgetState.YAhDGDM8.js → useBasicWidgetState.WEzLnfWp.js} +1 -1
  73. streamlit/static/static/js/{useOnInputChange.HiDk3WIa.js → useOnInputChange.xCSX6R9u.js} +1 -1
  74. streamlit/static/static/js/{useTextInputAutoExpand.CwuIWHHK.js → useTextInputAutoExpand.Qpzi9U5B.js} +1 -1
  75. streamlit/static/static/js/{withFullScreenWrapper.C4lh8vGd.js → withFullScreenWrapper.BPdpC8z2.js} +1 -1
  76. streamlit/user_info.py +5 -1
  77. {streamlit_nightly-1.46.2.dev20250715.dist-info → streamlit_nightly-1.47.1.dev20250716.dist-info}/METADATA +13 -1
  78. {streamlit_nightly-1.46.2.dev20250715.dist-info → streamlit_nightly-1.47.1.dev20250716.dist-info}/RECORD +82 -82
  79. {streamlit_nightly-1.46.2.dev20250715.data → streamlit_nightly-1.47.1.dev20250716.data}/scripts/streamlit.cmd +0 -0
  80. {streamlit_nightly-1.46.2.dev20250715.dist-info → streamlit_nightly-1.47.1.dev20250716.dist-info}/WHEEL +0 -0
  81. {streamlit_nightly-1.46.2.dev20250715.dist-info → streamlit_nightly-1.47.1.dev20250716.dist-info}/entry_points.txt +0 -0
  82. {streamlit_nightly-1.46.2.dev20250715.dist-info → streamlit_nightly-1.47.1.dev20250716.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.CxvB719M.js","./index.EAQB8Tuq.js","../css/index.CJVRHjQZ.css","./FormClearHelper.C4W8xjEX.js","./withFullScreenWrapper.C4lh8vGd.js","./Toolbar.CA92Moni.js","./checkbox.B6I7DbdE.js","./mergeWith.Cjweouij.js","./sprintf.D7DtBTRn.js","./createDownloadLinkElement.DZMwyjvU.js","./toConsumableArray.DaNXH4b3.js","./possibleConstructorReturn.Cy1PJuxU.js","./createSuper.DEaMobJa.js","./FileDownload.esm.ZEl-HfEg.js","./number-overlay-editor.BFTlQD7x.js","./es6.BMYexa9t.js"])))=>i.map(i=>d[i]);
2
- import{r as f,E as Ls,_ as ze,c as uh,g as ar,i as Ua,d as lo,e as ch,f as dh,h as fh,m as Ic,n as Tc,R as Vt,o as hh,p as Dc,q as gh,t as mh,u as ph,v as vh,w as bh,x as wh,a as Sr,y as As,s as vi,z as $r,j as nt,F as Oc,A as pa,T as Pc,B as va,C as Tn,D as nr,G as ba,H as ln,I as _c,J as si,K as yh,L as Ch,M as Le,N as Fc,O as lt,Q as Yi,S as zr,U as qa,V as Sh,W as xh,X as kh,Y as Pl,Z as Mh,$ as Rh,a0 as Eh,a1 as Ih,a2 as Lc,a3 as Th,a4 as Dh,a5 as Cs,a6 as Ac,a7 as Hc,a8 as Oh,a9 as Ph,aa as _h,ab as Fh,ac as Lh,ad as Ah,ae as Hh,af as zh,ag as Vh,ah as zc,ai as Nh,aj as $h,ak as Bh,al as Wh,am as Uh,an as qh,ao as Gh,ap as Yh,aq as jh,ar as Xh,as as Kh,at as Zh,au as Jh,av as Qh,aw as bn,l as Hs,ax as ji,ay as sr,az as Oe,aA as eg,b as Vc,aB as Nc,k as tg,aC as ng,aD as rg,aE as Ga,aF as ig,aG as og,aH as ag,aI as sg,aJ as lg}from"./index.EAQB8Tuq.js";import{u as ug}from"./FormClearHelper.C4W8xjEX.js";import{w as cg,E as dg}from"./withFullScreenWrapper.C4lh8vGd.js";import{T as fg,a as oi}from"./Toolbar.CA92Moni.js";import{L as hg,S as gg,a as mg}from"./checkbox.B6I7DbdE.js";import{m as pg}from"./mergeWith.Cjweouij.js";import{s as vg}from"./sprintf.D7DtBTRn.js";import{c as bg}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as rr,a as zs,C as wg}from"./toConsumableArray.DaNXH4b3.js";import{_ as yg,a as Cg,b as Sg}from"./possibleConstructorReturn.Cy1PJuxU.js";import{_ as xg}from"./createSuper.DEaMobJa.js";import{D as kg,F as Mg}from"./FileDownload.esm.ZEl-HfEg.js";var $c=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ls,ze({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"}))});$c.displayName="Add";var Bc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ls,ze({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"}))});Bc.displayName="Search";var Wc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ls,ze({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"}))});Wc.displayName="Visibility";var Ya,_l;function Rg(){if(_l)return Ya;_l=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return Ya=n,Ya}var ja,Fl;function Eg(){if(Fl)return ja;Fl=1;var e=Rg(),t=uh();function n(r,i){return r!=null&&t(r,i,e)}return ja=n,ja}var Ig=Eg();const Tg=ar(Ig);function Uc(e="This should not happen"){throw new Error(e)}function Dn(e,t="Assertion failed"){if(!e)return Uc(t)}function to(e,t){return Uc(t??"Hell froze over")}function Dg(e,t){try{return e()}catch{return t}}const Ll=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(Ll.call(e,n)&&++r&&!Ll.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 ta=null,Vs=void 0;var J;(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"})(J||(J={}));var Al;(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"})(Al||(Al={}));var na;(function(e){e.Triangle="triangle",e.Dots="dots"})(na||(na={}));function _o(e){return"width"in e&&typeof e.width=="number"}async function Hl(e){return typeof e=="object"?e:await e()}function li(e){return!(e.kind===J.Loading||e.kind===J.Bubble||e.kind===J.RowID||e.kind===J.Protected||e.kind===J.Drilldown)}function di(e){return e.kind===Hn.Marker||e.kind===Hn.NewRow}function ui(e){if(!li(e)||e.kind===J.Image)return!1;switch(e.kind){case J.Text:case J.Number:case J.Markdown:case J.Uri:case J.Custom:case J.Boolean:return e.readonly!==!0;default:to(e,"A cell was passed with an invalid kind")}}function Og(e){return Tg(e,"editor")}function Ns(e){return!(e.readonly??!1)}var Hn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Hn||(Hn={}));function Pg(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 zl;class it{items;constructor(t){this.items=t}static empty=()=>zl??(zl=new it([]));static fromSingleSelection=t=>it.empty().add(t);offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new it(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Pg([...this.items,n]);return new it(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 it(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 _g=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(" ")},Vl=_g,Fg=e=>e.toUpperCase()===e,Lg=e=>t=>e.indexOf(t)===-1,qc=(e,t)=>{const n={};return Object.keys(e).filter(Lg(t)).forEach(r=>{n[r]=e[r]}),n};function Ag(e,t,n){const r=qc(t,n);if(!e){const i=typeof Ua=="function"?{default:Ua}:Ua;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var Hg=(e,t)=>{};function zg(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&&!Fg(a[0])):n.propsAsIs,c=Ag(u,o,["as","class"]);c.ref=s,c.className=n.atomic?Vl(n.class,c.className||l):Vl(c.className||l,n.class);const{vars:d}=n;if(d){const g={};for(const p in d){const y=d[p],b=y[0],v=y[1]||"",S=typeof b=="function"?b(o):b;Hg(S,n.name),g[`--${p}`]=`${S}${v}`}const h=c.style||{},m=Object.keys(h);m.length>0&&m.forEach(p=>{g[p]=h[p]}),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=qc(o,["innerRef"]);return r(s,o.innerRef)};return i.displayName=n.name,i.__wyw_meta={className:n.class||t,extends:e},i}}var un=zg;const Vg=un("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Xa={},Li={},Fo={},Lo={},Nl;function Ng(){return Nl||(Nl=1,function(e){(function(t,n){n(e,lo(),ch())})(Lo,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;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 S=1;S<arguments.length;S++){var O=arguments[S];for(var R in O)Object.prototype.hasOwnProperty.call(O,R)&&(v[R]=O[R])}return v};function l(v,S){var O={};for(var R in v)S.indexOf(R)>=0||Object.prototype.hasOwnProperty.call(v,R)&&(O[R]=v[R]);return O}function u(v,S){if(!(v instanceof S))throw new TypeError("Cannot call a class as a function")}var c=function(){function v(S,O){for(var R=0;R<O.length;R++){var M=O[R];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(S,M.key,M)}}return function(S,O,R){return O&&v(S.prototype,O),R&&v(S,R),S}}();function d(v,S){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:v}function g(v,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);v.prototype=Object.create(S&&S.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(v,S):v.__proto__=S)}var h=!1;function m(v){h=v}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){m(!0)}}))}catch{}function p(){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 S=v.touches[0],O=S.pageX,R=S.pageY;return{x:O,y:R}}var M=v.screenX,_=v.screenY;return{x:M,y:_}}var b=function(v){g(S,v);function S(){var O;u(this,S);for(var R=arguments.length,M=Array(R),_=0;_<R;_++)M[_]=arguments[_];var E=d(this,(O=S.__proto__||Object.getPrototypeOf(S)).call.apply(O,[this].concat(M)));return E._handleSwipeStart=E._handleSwipeStart.bind(E),E._handleSwipeMove=E._handleSwipeMove.bind(E),E._handleSwipeEnd=E._handleSwipeEnd.bind(E),E._onMouseDown=E._onMouseDown.bind(E),E._onMouseMove=E._onMouseMove.bind(E),E._onMouseUp=E._onMouseUp.bind(E),E._setSwiperRef=E._setSwiperRef.bind(E),E}return c(S,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(R){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(R))}},{key:"_onMouseMove",value:function(R){this.mouseDown&&this._handleSwipeMove(R)}},{key:"_onMouseUp",value:function(R){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(R)}},{key:"_handleSwipeStart",value:function(R){var M=y(R),_=M.x,E=M.y;this.moveStart={x:_,y:E},this.props.onSwipeStart(R)}},{key:"_handleSwipeMove",value:function(R){if(this.moveStart){var M=y(R),_=M.x,E=M.y,k=_-this.moveStart.x,F=E-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x:k,y:F},R);D&&R.cancelable&&R.preventDefault(),this.movePosition={deltaX:k,deltaY:F}}}},{key:"_handleSwipeEnd",value:function(R){this.props.onSwipeEnd(R);var M=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-M?this.props.onSwipeLeft(1,R):this.movePosition.deltaX>M&&this.props.onSwipeRight(1,R),this.movePosition.deltaY<-M?this.props.onSwipeUp(1,R):this.movePosition.deltaY>M&&this.props.onSwipeDown(1,R)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(R){this.swiper=R,this.props.innerRef(R)}},{key:"render",value:function(){var R=this.props;R.tagName;var M=R.className,_=R.style,E=R.children;R.allowMouseEvents,R.onSwipeUp,R.onSwipeDown,R.onSwipeLeft,R.onSwipeRight,R.onSwipeStart,R.onSwipeMove,R.onSwipeEnd,R.innerRef,R.tolerance;var k=l(R,["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:M,style:_},k),E)}}]),S}(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})}(Lo)),Lo}var $l;function Gc(){return $l||($l=1,function(e){(function(t,n){n(e,Ng())})(Fo,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})}(Fo)),Fo}var Ai={},Bl;function Yc(){if(Bl)return Ai;Bl=1,Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=void 0;var e=t(dh());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 Ai.default=r,Ai}var Hi={},zi={},Wl;function $g(){if(Wl)return zi;Wl=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return zi.outerWidth=e,zi}var Vi={},Ul;function $s(){if(Ul)return Vi;Ul=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.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 Vi.default=e,Vi}var Ni={},ql;function jc(){if(ql)return Ni;ql=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.default=void 0;var e=function(){return window};return Ni.default=e,Ni}var Gl;function Xc(){if(Gl)return Hi;Gl=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.default=void 0;var e=l(lo()),t=s(Yc()),n=$g(),r=s($s()),i=s(Gc()),o=s(jc());function s(E){return E&&E.__esModule?E:{default:E}}function a(){if(typeof WeakMap!="function")return null;var E=new WeakMap;return a=function(){return E},E}function l(E){if(E&&E.__esModule)return E;if(E===null||u(E)!=="object"&&typeof E!="function")return{default:E};var k=a();if(k&&k.has(E))return k.get(E);var F={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in E)if(Object.prototype.hasOwnProperty.call(E,C)){var I=D?Object.getOwnPropertyDescriptor(E,C):null;I&&(I.get||I.set)?Object.defineProperty(F,C,I):F[C]=E[C]}return F.default=E,k&&k.set(E,F),F}function u(E){"@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(E)}function c(){return c=Object.assign||function(E){for(var k=1;k<arguments.length;k++){var F=arguments[k];for(var D in F)Object.prototype.hasOwnProperty.call(F,D)&&(E[D]=F[D])}return E},c.apply(this,arguments)}function d(E,k){if(!(E instanceof k))throw new TypeError("Cannot call a class as a function")}function g(E,k){for(var F=0;F<k.length;F++){var D=k[F];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(E,D.key,D)}}function h(E,k,F){return k&&g(E.prototype,k),E}function m(E,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(k&&k.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),k&&p(E,k)}function p(E,k){return p=Object.setPrototypeOf||function(D,C){return D.__proto__=C,D},p(E,k)}function y(E){var k=S();return function(){var D=O(E),C;if(k){var I=O(this).constructor;C=Reflect.construct(D,arguments,I)}else C=D.apply(this,arguments);return b(this,C)}}function b(E,k){return k&&(u(k)==="object"||typeof k=="function")?k:v(E)}function v(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function S(){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 O(E){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(F){return F.__proto__||Object.getPrototypeOf(F)},O(E)}function R(E,k,F){return k in E?Object.defineProperty(E,k,{value:F,enumerable:!0,configurable:!0,writable:!0}):E[k]=F,E}var M=function(k){return k.hasOwnProperty("key")},_=function(E){m(F,E);var k=y(F);function F(D){var C;return d(this,F),C=k.call(this,D),R(v(C),"itemsWrapperRef",void 0),R(v(C),"itemsListRef",void 0),R(v(C),"thumbsRef",void 0),R(v(C),"setItemsWrapperRef",function(I){C.itemsWrapperRef=I}),R(v(C),"setItemsListRef",function(I){C.itemsListRef=I}),R(v(C),"setThumbsRef",function(I,T){C.thumbsRef||(C.thumbsRef=[]),C.thumbsRef[T]=I}),R(v(C),"updateSizes",function(){if(!(!C.props.children||!C.itemsWrapperRef||!C.thumbsRef)){var I=e.Children.count(C.props.children),T=C.itemsWrapperRef.clientWidth,x=C.props.thumbWidth?C.props.thumbWidth:(0,n.outerWidth)(C.thumbsRef[0]),$=Math.floor(T/x),G=$<I,X=G?I-$:0;C.setState(function(ie,ee){return{itemSize:x,visibleItems:$,firstItem:G?C.getFirstItem(ee.selectedItem):0,lastPosition:X,showArrows:G}})}}),R(v(C),"handleClickItem",function(I,T,x){if(!M(x)||x.key==="Enter"){var $=C.props.onSelectItem;typeof $=="function"&&$(I,T)}}),R(v(C),"onSwipeStart",function(){C.setState({swiping:!0})}),R(v(C),"onSwipeEnd",function(){C.setState({swiping:!1})}),R(v(C),"onSwipeMove",function(I){var T=I.x;if(!C.state.itemSize||!C.itemsWrapperRef||!C.state.visibleItems)return!1;var x=0,$=e.Children.count(C.props.children),G=-(C.state.firstItem*100)/C.state.visibleItems,X=Math.max($-C.state.visibleItems,0),ie=-X*100/C.state.visibleItems;G===x&&T>0&&(T=0),G===ie&&T<0&&(T=0);var ee=C.itemsWrapperRef.clientWidth,Q=G+100/(ee/T);return C.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(te){C.itemsListRef.style[te]=(0,r.default)(Q,"%",C.props.axis)}),!0}),R(v(C),"slideRight",function(I){C.moveTo(C.state.firstItem-(typeof I=="number"?I:1))}),R(v(C),"slideLeft",function(I){C.moveTo(C.state.firstItem+(typeof I=="number"?I:1))}),R(v(C),"moveTo",function(I){I=I<0?0:I,I=I>=C.state.lastPosition?C.state.lastPosition:I,C.setState({firstItem:I})}),C.state={selectedItem:D.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},C}return h(F,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(C){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==C.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(C){var I=C;return C>=this.state.lastPosition&&(I=this.state.lastPosition),C<this.state.firstItem+this.state.visibleItems&&(I=this.state.firstItem),C<this.state.firstItem&&(I=C),I}},{key:"renderItems",value:function(){var C=this;return this.props.children.map(function(I,T){var x=t.default.ITEM(!1,T===C.state.selectedItem),$={key:T,ref:function(X){return C.setThumbsRef(X,T)},className:x,onClick:C.handleClickItem.bind(C,T,C.props.children[T]),onKeyDown:C.handleClickItem.bind(C,T,C.props.children[T]),"aria-label":"".concat(C.props.labels.item," ").concat(T+1),style:{width:C.props.thumbWidth}};return e.default.createElement("li",c({},$,{role:"button",tabIndex:0}),I)})}},{key:"render",value:function(){var C=this;if(!this.props.children)return null;var I=e.Children.count(this.props.children)>1,T=this.state.showArrows&&this.state.firstItem>0,x=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,$={},G=-this.state.firstItem*(this.state.itemSize||0),X=(0,r.default)(G,"px",this.props.axis),ie=this.props.transitionTime+"ms";return $={WebkitTransform:X,MozTransform:X,MsTransform:X,OTransform:X,transform:X,msTransform:X,WebkitTransitionDuration:ie,MozTransitionDuration:ie,MsTransitionDuration:ie,OTransitionDuration:ie,transitionDuration:ie,msTransitionDuration:ie},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(!T),onClick:function(){return C.slideRight()},"aria-label":this.props.labels.leftArrow}),I?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(Q){return C.setItemsListRef(Q)},style:$},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!x),onClick:function(){return C.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),F}(e.Component);return Hi.default=_,R(_,"displayName","Thumbs"),R(_,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Hi}var $i={},Yl;function Bg(){if(Yl)return $i;Yl=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.default=void 0;var e=function(){return document};return $i.default=e,$i}var In={},jl;function Kc(){if(jl)return In;jl=1,Object.defineProperty(In,"__esModule",{value:!0}),In.setPosition=In.getPosition=In.isKeyboardEvent=In.defaultStatusFormatter=In.noop=void 0;var e=lo(),t=n($s());function n(l){return l&&l.__esModule?l:{default:l}}var r=function(){};In.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};In.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};In.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};In.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 In.setPosition=a,In}var $n={},Xl;function Wg(){if(Xl)return $n;Xl=1,Object.defineProperty($n,"__esModule",{value:!0}),$n.fadeAnimationHandler=$n.slideStopSwipingHandler=$n.slideSwipeAnimationHandler=$n.slideAnimationHandler=void 0;var e=lo(),t=r($s()),n=Kc();function r(d){return d&&d.__esModule?d:{default:d}}function i(d,g){var h=Object.keys(d);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(d);g&&(m=m.filter(function(p){return Object.getOwnPropertyDescriptor(d,p).enumerable})),h.push.apply(h,m)}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(m){s(d,m,h[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(m){Object.defineProperty(d,m,Object.getOwnPropertyDescriptor(h,m))})}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 m={},p=h.selectedItem,y=p,b=e.Children.count(g.children)-1,v=g.infiniteLoop&&(p<0||p>b);if(v)return y<0?g.centerMode&&g.centerSlidePercentage&&g.axis==="horizontal"?m.itemListStyle=(0,n.setPosition)(-(b+2)*g.centerSlidePercentage-(100-g.centerSlidePercentage)/2,g.axis):m.itemListStyle=(0,n.setPosition)(-(b+2)*100,g.axis):y>b&&(m.itemListStyle=(0,n.setPosition)(0,g.axis)),m;var S=(0,n.getPosition)(p,g),O=(0,t.default)(S,"%",g.axis),R=g.transitionTime+"ms";return m.itemListStyle={WebkitTransform:O,msTransform:O,OTransform:O,transform:O},h.swiping||(m.itemListStyle=o(o({},m.itemListStyle),{},{WebkitTransitionDuration:R,MozTransitionDuration:R,OTransitionDuration:R,transitionDuration:R,msTransitionDuration:R})),m};$n.slideAnimationHandler=a;var l=function(g,h,m,p){var y={},b=h.axis==="horizontal",v=e.Children.count(h.children),S=0,O=(0,n.getPosition)(m.selectedItem,h),R=h.infiniteLoop?(0,n.getPosition)(v-1,h)-100:(0,n.getPosition)(v-1,h),M=b?g.x:g.y,_=M;O===S&&M>0&&(_=0),O===R&&M<0&&(_=0);var E=O+100/(m.itemSize/_),k=Math.abs(M)>h.swipeScrollTolerance;return h.infiniteLoop&&k&&(m.selectedItem===0&&E>-100?E-=v*100:m.selectedItem===v-1&&E<-v*100&&(E+=v*100)),(!h.preventMovementUntilSwipeScrollTolerance||k||m.swipeMovementStarted)&&(m.swipeMovementStarted||p({swipeMovementStarted:!0}),y.itemListStyle=(0,n.setPosition)(E,h.axis)),k&&!m.cancelClick&&p({cancelClick:!0}),y};$n.slideSwipeAnimationHandler=l;var u=function(g,h){var m=(0,n.getPosition)(h.selectedItem,g),p=(0,n.setPosition)(m,g.axis);return{itemListStyle:p}};$n.slideStopSwipingHandler=u;var c=function(g,h){var m=g.transitionTime+"ms",p="ease-in-out",y={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:p,msTransitionTimingFunction:p,MozTransitionTimingFunction:p,WebkitTransitionTimingFunction:p,OTransitionTimingFunction:p};return h.swiping||(y=o(o({},y),{},{WebkitTransitionDuration:m,MozTransitionDuration:m,OTransitionDuration:m,transitionDuration:m,msTransitionDuration:m})),{slideStyle:y,selectedStyle:o(o({},y),{},{opacity:1,position:"relative"}),prevStyle:o({},y)}};return $n.fadeAnimationHandler=c,$n}var Kl;function Ug(){if(Kl)return Li;Kl=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.default=void 0;var e=c(lo()),t=l(Gc()),n=l(Yc()),r=l(Xc()),i=l(Bg()),o=l(jc()),s=Kc(),a=Wg();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 C=u();if(C&&C.has(D))return C.get(D);var I={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in D)if(Object.prototype.hasOwnProperty.call(D,x)){var $=T?Object.getOwnPropertyDescriptor(D,x):null;$&&($.get||$.set)?Object.defineProperty(I,x,$):I[x]=D[x]}return I.default=D,C&&C.set(D,I),I}function d(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(I){return typeof I}:d=function(I){return I&&typeof Symbol=="function"&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},d(D)}function g(){return g=Object.assign||function(D){for(var C=1;C<arguments.length;C++){var I=arguments[C];for(var T in I)Object.prototype.hasOwnProperty.call(I,T)&&(D[T]=I[T])}return D},g.apply(this,arguments)}function h(D,C){var I=Object.keys(D);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(D);C&&(T=T.filter(function(x){return Object.getOwnPropertyDescriptor(D,x).enumerable})),I.push.apply(I,T)}return I}function m(D){for(var C=1;C<arguments.length;C++){var I=arguments[C]!=null?arguments[C]:{};C%2?h(Object(I),!0).forEach(function(T){k(D,T,I[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(I)):h(Object(I)).forEach(function(T){Object.defineProperty(D,T,Object.getOwnPropertyDescriptor(I,T))})}return D}function p(D,C){if(!(D instanceof C))throw new TypeError("Cannot call a class as a function")}function y(D,C){for(var I=0;I<C.length;I++){var T=C[I];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(D,T.key,T)}}function b(D,C,I){return C&&y(D.prototype,C),D}function v(D,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(C&&C.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),C&&S(D,C)}function S(D,C){return S=Object.setPrototypeOf||function(T,x){return T.__proto__=x,T},S(D,C)}function O(D){var C=_();return function(){var T=E(D),x;if(C){var $=E(this).constructor;x=Reflect.construct(T,arguments,$)}else x=T.apply(this,arguments);return R(this,x)}}function R(D,C){return C&&(d(C)==="object"||typeof C=="function")?C:M(D)}function M(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function _(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function E(D){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(I){return I.__proto__||Object.getPrototypeOf(I)},E(D)}function k(D,C,I){return C in D?Object.defineProperty(D,C,{value:I,enumerable:!0,configurable:!0,writable:!0}):D[C]=I,D}var F=function(D){v(I,D);var C=O(I);function I(T){var x;p(this,I),x=C.call(this,T),k(M(x),"thumbsRef",void 0),k(M(x),"carouselWrapperRef",void 0),k(M(x),"listRef",void 0),k(M(x),"itemsRef",void 0),k(M(x),"timer",void 0),k(M(x),"animationHandler",void 0),k(M(x),"setThumbsRef",function(G){x.thumbsRef=G}),k(M(x),"setCarouselWrapperRef",function(G){x.carouselWrapperRef=G}),k(M(x),"setListRef",function(G){x.listRef=G}),k(M(x),"setItemsRef",function(G,X){x.itemsRef||(x.itemsRef=[]),x.itemsRef[X]=G}),k(M(x),"autoPlay",function(){e.Children.count(x.props.children)<=1||(x.clearAutoPlay(),x.props.autoPlay&&(x.timer=setTimeout(function(){x.increment()},x.props.interval)))}),k(M(x),"clearAutoPlay",function(){x.timer&&clearTimeout(x.timer)}),k(M(x),"resetAutoPlay",function(){x.clearAutoPlay(),x.autoPlay()}),k(M(x),"stopOnHover",function(){x.setState({isMouseEntered:!0},x.clearAutoPlay)}),k(M(x),"startOnLeave",function(){x.setState({isMouseEntered:!1},x.autoPlay)}),k(M(x),"isFocusWithinTheCarousel",function(){return x.carouselWrapperRef?!!((0,i.default)().activeElement===x.carouselWrapperRef||x.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),k(M(x),"navigateWithKeyboard",function(G){if(x.isFocusWithinTheCarousel()){var X=x.props.axis,ie=X==="horizontal",ee={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},Q=ie?ee.ArrowRight:ee.ArrowDown,te=ie?ee.ArrowLeft:ee.ArrowUp;Q===G.keyCode?x.increment():te===G.keyCode&&x.decrement()}}),k(M(x),"updateSizes",function(){if(!(!x.state.initialized||!x.itemsRef||x.itemsRef.length===0)){var G=x.props.axis==="horizontal",X=x.itemsRef[0];if(X){var ie=G?X.clientWidth:X.clientHeight;x.setState({itemSize:ie}),x.thumbsRef&&x.thumbsRef.updateSizes()}}}),k(M(x),"setMountState",function(){x.setState({hasMount:!0}),x.updateSizes()}),k(M(x),"handleClickItem",function(G,X){if(e.Children.count(x.props.children)!==0){if(x.state.cancelClick){x.setState({cancelClick:!1});return}x.props.onClickItem(G,X),G!==x.state.selectedItem&&x.setState({selectedItem:G})}}),k(M(x),"handleOnChange",function(G,X){e.Children.count(x.props.children)<=1||x.props.onChange(G,X)}),k(M(x),"handleClickThumb",function(G,X){x.props.onClickThumb(G,X),x.moveTo(G)}),k(M(x),"onSwipeStart",function(G){x.setState({swiping:!0}),x.props.onSwipeStart(G)}),k(M(x),"onSwipeEnd",function(G){x.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),x.props.onSwipeEnd(G),x.clearAutoPlay(),x.state.autoPlay&&x.autoPlay()}),k(M(x),"onSwipeMove",function(G,X){x.props.onSwipeMove(X);var ie=x.props.swipeAnimationHandler(G,x.props,x.state,x.setState.bind(M(x)));return x.setState(m({},ie)),!!Object.keys(ie).length}),k(M(x),"decrement",function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;x.moveTo(x.state.selectedItem-(typeof G=="number"?G:1))}),k(M(x),"increment",function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;x.moveTo(x.state.selectedItem+(typeof G=="number"?G:1))}),k(M(x),"moveTo",function(G){if(typeof G=="number"){var X=e.Children.count(x.props.children)-1;G<0&&(G=x.props.infiniteLoop?X:0),G>X&&(G=x.props.infiniteLoop?0:X),x.selectItem({selectedItem:G}),x.state.autoPlay&&x.state.isMouseEntered===!1&&x.resetAutoPlay()}}),k(M(x),"onClickNext",function(){x.increment(1)}),k(M(x),"onClickPrev",function(){x.decrement(1)}),k(M(x),"onSwipeForward",function(){x.increment(1),x.props.emulateTouch&&x.setState({cancelClick:!0})}),k(M(x),"onSwipeBackwards",function(){x.decrement(1),x.props.emulateTouch&&x.setState({cancelClick:!0})}),k(M(x),"changeItem",function(G){return function(X){(!(0,s.isKeyboardEvent)(X)||X.key==="Enter")&&x.moveTo(G)}}),k(M(x),"selectItem",function(G){x.setState(m({previousItem:x.state.selectedItem},G),function(){x.setState(x.animationHandler(x.props,x.state))}),x.handleOnChange(G.selectedItem,e.Children.toArray(x.props.children)[G.selectedItem])}),k(M(x),"getInitialImage",function(){var G=x.props.selectedItem,X=x.itemsRef&&x.itemsRef[G],ie=X&&X.getElementsByTagName("img")||[];return ie[0]}),k(M(x),"getVariableItemHeight",function(G){var X=x.itemsRef&&x.itemsRef[G];if(x.state.hasMount&&X&&X.children.length){var ie=X.children[0].getElementsByTagName("img")||[];if(ie.length>0){var ee=ie[0];if(!ee.complete){var Q=function ue(){x.forceUpdate(),ee.removeEventListener("load",ue)};ee.addEventListener("load",Q)}}var te=ie[0]||X.children[0],se=te.clientHeight;return se>0?se:null}return null});var $={initialized:!1,previousItem:T.selectedItem,selectedItem:T.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:T.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return x.animationHandler=typeof T.animationHandler=="function"&&T.animationHandler||T.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,x.state=m(m({},$),x.animationHandler(T,$)),x}return b(I,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(x,$){!x.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!x.autoFocus&&this.props.autoFocus&&this.forceFocus(),$.swiping&&!this.state.swiping&&this.setState(m({},this.props.stopSwipingHandler(this.props,this.state))),(x.selectedItem!==this.props.selectedItem||x.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),x.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 x=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 $=x.getInitialImage();$&&!$.complete?$.addEventListener("load",x.setMountState):x.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var x=this.carouselWrapperRef;this.props.stopOnHover&&x&&(x.addEventListener("mouseenter",this.stopOnHover),x.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var x=this.carouselWrapperRef;this.props.stopOnHover&&x&&(x.removeEventListener("mouseenter",this.stopOnHover),x.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 x=this.getInitialImage();x&&x.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var x;(x=this.carouselWrapperRef)===null||x===void 0||x.focus()}},{key:"renderItems",value:function(x){var $=this;return this.props.children?e.Children.map(this.props.children,function(G,X){var ie=X===$.state.selectedItem,ee=X===$.state.previousItem,Q=ie&&$.state.selectedStyle||ee&&$.state.prevStyle||$.state.slideStyle||{};$.props.centerMode&&$.props.axis==="horizontal"&&(Q=m(m({},Q),{},{minWidth:$.props.centerSlidePercentage+"%"})),$.state.swiping&&$.state.swipeMovementStarted&&(Q=m(m({},Q),{},{pointerEvents:"none"}));var te={ref:function(ue){return $.setItemsRef(ue,X)},key:"itemKey"+X+(x?"clone":""),className:n.default.ITEM(!0,X===$.state.selectedItem,X===$.state.previousItem),onClick:$.handleClickItem.bind($,X,G),style:Q};return e.default.createElement("li",te,$.props.renderItem(G,{isSelected:X===$.state.selectedItem,isPrevious:X===$.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var x=this,$=this.props,G=$.showIndicators,X=$.labels,ie=$.renderIndicator,ee=$.children;return G?e.default.createElement("ul",{className:"control-dots"},e.Children.map(ee,function(Q,te){return ie&&ie(x.changeItem(te),te===x.state.selectedItem,te,X.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 x=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",X=this.props.showArrows&&e.Children.count(this.props.children)>1,ie=X&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ee=X&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,Q=this.renderItems(!0),te=Q.shift(),se=Q.pop(),ue={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},fe={};if(G){if(ue.onSwipeLeft=this.onSwipeForward,ue.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var re=this.getVariableItemHeight(this.state.selectedItem);fe.height=re||"auto"}}else ue.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,ue.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,ue.style=m(m({},ue.style),{},{height:this.state.itemSize}),fe.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,ie,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:fe},$?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},ue,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&se,this.renderItems(),this.props.infiniteLoop&&te):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(P){return x.setListRef(P)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&se,this.renderItems(),this.props.infiniteLoop&&te)),this.props.renderArrowNext(this.onClickNext,ee,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),I}(e.default.Component);return Li.default=F,k(F,"displayName","Carousel"),k(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(C,I,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_PREV(!I),onClick:C})},renderArrowNext:function(C,I,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_NEXT(!I),onClick:C})},renderIndicator:function(C,I,T,x){return e.default.createElement("li",{className:n.default.DOT(I),onClick:C,onKeyDown:C,value:T,key:T,role:"button",tabIndex:0,"aria-label":"".concat(x," ").concat(T+1)})},renderItem:function(C){return C},renderThumbs:function(C){var I=e.Children.map(C,function(T){var x=T;if(T.type!=="img"&&(x=e.Children.toArray(T.props.children).find(function($){return $.type==="img"})),!!x)return x});return I.filter(function(T){return T}).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"),[]):I},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}),Li}var Zl={},Jl;function qg(){return Jl||(Jl=1),Zl}var Ql;function Gg(){return Ql||(Ql=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(Ug()),n=qg(),r=i(Xc());function i(o){return o&&o.__esModule?o:{default:o}}}(Xa)),Xa}var Yg=Gg(),Ka,eu;function jg(){if(eu)return Ka;eu=1;var e=fh(),t=function(){return e.Date.now()};return Ka=t,Ka}var Za,tu;function Zc(){if(tu)return Za;tu=1;var e=Ic(),t=jg(),n=Tc(),r="Expected a function",i=Math.max,o=Math.min;function s(a,l,u){var c,d,g,h,m,p,y=0,b=!1,v=!1,S=!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,S="trailing"in u?!!u.trailing:S);function O(I){var T=c,x=d;return c=d=void 0,y=I,h=a.apply(x,T),h}function R(I){return y=I,m=setTimeout(E,l),b?O(I):h}function M(I){var T=I-p,x=I-y,$=l-T;return v?o($,g-x):$}function _(I){var T=I-p,x=I-y;return p===void 0||T>=l||T<0||v&&x>=g}function E(){var I=t();if(_(I))return k(I);m=setTimeout(E,M(I))}function k(I){return m=void 0,S&&c?O(I):(c=d=void 0,h)}function F(){m!==void 0&&clearTimeout(m),y=0,c=p=d=m=void 0}function D(){return m===void 0?h:k(t())}function C(){var I=t(),T=_(I);if(c=arguments,d=this,p=I,T){if(m===void 0)return R(p);if(v)return clearTimeout(m),m=setTimeout(E,l),O(p)}return m===void 0&&(m=setTimeout(E,l)),h}return C.cancel=F,C.flush=D,C}return Za=s,Za}var Xg=Zc();const Jc=ar(Xg);function vn(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 wr(e,t){return e===void 0?void 0:t}const Kg=Math.PI;function nu(e){return e*Kg/180}const Qc=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),ed=(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}},td=(e,t,n)=>Math.min(e,t-n*2),nd=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Bs=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"}))},Zg=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 Jg(e,t,n){const[r,i]=f.useState(e),o=f.useRef(!0);f.useEffect(()=>()=>{o.current=!1},[]);const s=f.useRef(Jc(a=>{o.current&&i(a)},n));return f.useLayoutEffect(()=>{o.current&&s.current(()=>e())},t),r}const Qg="֑-߿יִ-﷽ﹰ-ﻼ",em="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",tm=new RegExp("^[^"+em+"]*["+Qg+"]");function Ws(e){return tm.test(e)?"rtl":"not-rtl"}let Ao;function Ss(){if(typeof document>"u")return 0;if(Ao!==void 0)return Ao;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(),Ao=n-r,Ao}const Ar=Symbol();function nm(e){const t=f.useRef([Ar,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!==Ar&&(a=typeof a=="function"?a(l):a,a===l)||(l!==Ar&&i({}),r(u=>typeof a=="function"?a(l===Ar?u:l):a),t.current[0]=Ar)},[]),s=f.useCallback(()=>{t.current[0]=Ar,i({})},[]);return[t.current[0]===Ar?n:t.current[0],o,s]}function rd(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 rm(e){const t=f.useRef(e);return mi(e,t.current)||(t.current=e),t.current}const im=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(Vg,{"data-testid":"GDG-default-image-overlay-editor"},f.createElement(Yg.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(Bs,null)))};function id(){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 Br=id();function om(e){Br=e}const od=/[&<>"']/,am=new RegExp(od.source,"g"),ad=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,sm=new RegExp(ad.source,"g"),lm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ru=e=>lm[e];function gn(e,t){if(t){if(od.test(e))return e.replace(am,ru)}else if(ad.test(e))return e.replace(sm,ru);return e}const um=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function sd(e){return e.replace(um,(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 cm=/(^|[^\[])\^/g;function At(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(cm,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const dm=/[^\w:]/g,fm=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function iu(e,t,n){if(e){let r;try{r=decodeURIComponent(sd(n)).replace(dm,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!fm.test(n)&&(n=pm(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Ho={},hm=/^[^:]+:\/*[^/]*$/,gm=/^([^:]+:)[\s\S]*$/,mm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function pm(e,t){Ho[" "+e]||(hm.test(e)?Ho[" "+e]=e+"/":Ho[" "+e]=Ko(e,"/",!0)),e=Ho[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(gm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(mm,"$1")+t:e+t}const ra={exec:function(){}};function ou(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 Ko(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 vm(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 bm(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 au(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function su(e,t,n,r){const i=t.href,o=t.title?gn(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:gn(s)}}function wm(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.Cov081px.js","./index.D1AeFlAQ.js","../css/index.CJVRHjQZ.css","./FormClearHelper.Fo17GZrr.js","./withFullScreenWrapper.BPdpC8z2.js","./Toolbar.oggLWFZy.js","./checkbox.D60kv6TD.js","./mergeWith.CRLNQNLL.js","./sprintf.D7DtBTRn.js","./createDownloadLinkElement.DZMwyjvU.js","./toConsumableArray.FS1y1Ph9.js","./possibleConstructorReturn.DG2YBhZN.js","./createSuper.C67qUZn1.js","./FileDownload.esm.Cb2Z--zt.js","./number-overlay-editor.Coke5m2c.js","./es6.BhqRltzl.js"])))=>i.map(i=>d[i]);
2
+ import{r as f,E as Ls,_ as ze,c as uh,g as ar,i as Ua,d as lo,e as ch,f as dh,h as fh,m as Ic,n as Tc,R as Vt,o as hh,p as Dc,q as gh,t as mh,u as ph,v as vh,w as bh,x as wh,a as Sr,y as As,s as vi,z as $r,j as nt,F as Oc,A as pa,T as Pc,B as va,C as Tn,D as nr,G as ba,H as ln,I as _c,J as si,K as yh,L as Ch,M as Le,N as Fc,O as lt,Q as Yi,S as zr,U as qa,V as Sh,W as xh,X as kh,Y as Pl,Z as Mh,$ as Rh,a0 as Eh,a1 as Ih,a2 as Lc,a3 as Th,a4 as Dh,a5 as Cs,a6 as Ac,a7 as Hc,a8 as Oh,a9 as Ph,aa as _h,ab as Fh,ac as Lh,ad as Ah,ae as Hh,af as zh,ag as Vh,ah as zc,ai as Nh,aj as $h,ak as Bh,al as Wh,am as Uh,an as qh,ao as Gh,ap as Yh,aq as jh,ar as Xh,as as Kh,at as Zh,au as Jh,av as Qh,aw as bn,l as Hs,ax as ji,ay as sr,az as Oe,aA as eg,b as Vc,aB as Nc,k as tg,aC as ng,aD as rg,aE as Ga,aF as ig,aG as og,aH as ag,aI as sg,aJ as lg}from"./index.D1AeFlAQ.js";import{u as ug}from"./FormClearHelper.Fo17GZrr.js";import{w as cg,E as dg}from"./withFullScreenWrapper.BPdpC8z2.js";import{T as fg,a as oi}from"./Toolbar.oggLWFZy.js";import{L as hg,S as gg,a as mg}from"./checkbox.D60kv6TD.js";import{m as pg}from"./mergeWith.CRLNQNLL.js";import{s as vg}from"./sprintf.D7DtBTRn.js";import{c as bg}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as rr,a as zs,C as wg}from"./toConsumableArray.FS1y1Ph9.js";import{_ as yg,a as Cg,b as Sg}from"./possibleConstructorReturn.DG2YBhZN.js";import{_ as xg}from"./createSuper.C67qUZn1.js";import{D as kg,F as Mg}from"./FileDownload.esm.Cb2Z--zt.js";var $c=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ls,ze({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"}))});$c.displayName="Add";var Bc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ls,ze({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"}))});Bc.displayName="Search";var Wc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ls,ze({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"}))});Wc.displayName="Visibility";var Ya,_l;function Rg(){if(_l)return Ya;_l=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return Ya=n,Ya}var ja,Fl;function Eg(){if(Fl)return ja;Fl=1;var e=Rg(),t=uh();function n(r,i){return r!=null&&t(r,i,e)}return ja=n,ja}var Ig=Eg();const Tg=ar(Ig);function Uc(e="This should not happen"){throw new Error(e)}function Dn(e,t="Assertion failed"){if(!e)return Uc(t)}function to(e,t){return Uc(t??"Hell froze over")}function Dg(e,t){try{return e()}catch{return t}}const Ll=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(Ll.call(e,n)&&++r&&!Ll.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 ta=null,Vs=void 0;var J;(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"})(J||(J={}));var Al;(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"})(Al||(Al={}));var na;(function(e){e.Triangle="triangle",e.Dots="dots"})(na||(na={}));function _o(e){return"width"in e&&typeof e.width=="number"}async function Hl(e){return typeof e=="object"?e:await e()}function li(e){return!(e.kind===J.Loading||e.kind===J.Bubble||e.kind===J.RowID||e.kind===J.Protected||e.kind===J.Drilldown)}function di(e){return e.kind===Hn.Marker||e.kind===Hn.NewRow}function ui(e){if(!li(e)||e.kind===J.Image)return!1;switch(e.kind){case J.Text:case J.Number:case J.Markdown:case J.Uri:case J.Custom:case J.Boolean:return e.readonly!==!0;default:to(e,"A cell was passed with an invalid kind")}}function Og(e){return Tg(e,"editor")}function Ns(e){return!(e.readonly??!1)}var Hn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Hn||(Hn={}));function Pg(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 zl;class it{items;constructor(t){this.items=t}static empty=()=>zl??(zl=new it([]));static fromSingleSelection=t=>it.empty().add(t);offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new it(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Pg([...this.items,n]);return new it(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 it(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 _g=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(" ")},Vl=_g,Fg=e=>e.toUpperCase()===e,Lg=e=>t=>e.indexOf(t)===-1,qc=(e,t)=>{const n={};return Object.keys(e).filter(Lg(t)).forEach(r=>{n[r]=e[r]}),n};function Ag(e,t,n){const r=qc(t,n);if(!e){const i=typeof Ua=="function"?{default:Ua}:Ua;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var Hg=(e,t)=>{};function zg(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&&!Fg(a[0])):n.propsAsIs,c=Ag(u,o,["as","class"]);c.ref=s,c.className=n.atomic?Vl(n.class,c.className||l):Vl(c.className||l,n.class);const{vars:d}=n;if(d){const g={};for(const p in d){const y=d[p],b=y[0],v=y[1]||"",S=typeof b=="function"?b(o):b;Hg(S,n.name),g[`--${p}`]=`${S}${v}`}const h=c.style||{},m=Object.keys(h);m.length>0&&m.forEach(p=>{g[p]=h[p]}),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=qc(o,["innerRef"]);return r(s,o.innerRef)};return i.displayName=n.name,i.__wyw_meta={className:n.class||t,extends:e},i}}var un=zg;const Vg=un("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Xa={},Li={},Fo={},Lo={},Nl;function Ng(){return Nl||(Nl=1,function(e){(function(t,n){n(e,lo(),ch())})(Lo,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;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 S=1;S<arguments.length;S++){var O=arguments[S];for(var R in O)Object.prototype.hasOwnProperty.call(O,R)&&(v[R]=O[R])}return v};function l(v,S){var O={};for(var R in v)S.indexOf(R)>=0||Object.prototype.hasOwnProperty.call(v,R)&&(O[R]=v[R]);return O}function u(v,S){if(!(v instanceof S))throw new TypeError("Cannot call a class as a function")}var c=function(){function v(S,O){for(var R=0;R<O.length;R++){var M=O[R];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(S,M.key,M)}}return function(S,O,R){return O&&v(S.prototype,O),R&&v(S,R),S}}();function d(v,S){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:v}function g(v,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);v.prototype=Object.create(S&&S.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(v,S):v.__proto__=S)}var h=!1;function m(v){h=v}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){m(!0)}}))}catch{}function p(){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 S=v.touches[0],O=S.pageX,R=S.pageY;return{x:O,y:R}}var M=v.screenX,_=v.screenY;return{x:M,y:_}}var b=function(v){g(S,v);function S(){var O;u(this,S);for(var R=arguments.length,M=Array(R),_=0;_<R;_++)M[_]=arguments[_];var E=d(this,(O=S.__proto__||Object.getPrototypeOf(S)).call.apply(O,[this].concat(M)));return E._handleSwipeStart=E._handleSwipeStart.bind(E),E._handleSwipeMove=E._handleSwipeMove.bind(E),E._handleSwipeEnd=E._handleSwipeEnd.bind(E),E._onMouseDown=E._onMouseDown.bind(E),E._onMouseMove=E._onMouseMove.bind(E),E._onMouseUp=E._onMouseUp.bind(E),E._setSwiperRef=E._setSwiperRef.bind(E),E}return c(S,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(R){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(R))}},{key:"_onMouseMove",value:function(R){this.mouseDown&&this._handleSwipeMove(R)}},{key:"_onMouseUp",value:function(R){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(R)}},{key:"_handleSwipeStart",value:function(R){var M=y(R),_=M.x,E=M.y;this.moveStart={x:_,y:E},this.props.onSwipeStart(R)}},{key:"_handleSwipeMove",value:function(R){if(this.moveStart){var M=y(R),_=M.x,E=M.y,k=_-this.moveStart.x,F=E-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x:k,y:F},R);D&&R.cancelable&&R.preventDefault(),this.movePosition={deltaX:k,deltaY:F}}}},{key:"_handleSwipeEnd",value:function(R){this.props.onSwipeEnd(R);var M=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-M?this.props.onSwipeLeft(1,R):this.movePosition.deltaX>M&&this.props.onSwipeRight(1,R),this.movePosition.deltaY<-M?this.props.onSwipeUp(1,R):this.movePosition.deltaY>M&&this.props.onSwipeDown(1,R)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(R){this.swiper=R,this.props.innerRef(R)}},{key:"render",value:function(){var R=this.props;R.tagName;var M=R.className,_=R.style,E=R.children;R.allowMouseEvents,R.onSwipeUp,R.onSwipeDown,R.onSwipeLeft,R.onSwipeRight,R.onSwipeStart,R.onSwipeMove,R.onSwipeEnd,R.innerRef,R.tolerance;var k=l(R,["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:M,style:_},k),E)}}]),S}(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})}(Lo)),Lo}var $l;function Gc(){return $l||($l=1,function(e){(function(t,n){n(e,Ng())})(Fo,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})}(Fo)),Fo}var Ai={},Bl;function Yc(){if(Bl)return Ai;Bl=1,Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=void 0;var e=t(dh());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 Ai.default=r,Ai}var Hi={},zi={},Wl;function $g(){if(Wl)return zi;Wl=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return zi.outerWidth=e,zi}var Vi={},Ul;function $s(){if(Ul)return Vi;Ul=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.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 Vi.default=e,Vi}var Ni={},ql;function jc(){if(ql)return Ni;ql=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.default=void 0;var e=function(){return window};return Ni.default=e,Ni}var Gl;function Xc(){if(Gl)return Hi;Gl=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.default=void 0;var e=l(lo()),t=s(Yc()),n=$g(),r=s($s()),i=s(Gc()),o=s(jc());function s(E){return E&&E.__esModule?E:{default:E}}function a(){if(typeof WeakMap!="function")return null;var E=new WeakMap;return a=function(){return E},E}function l(E){if(E&&E.__esModule)return E;if(E===null||u(E)!=="object"&&typeof E!="function")return{default:E};var k=a();if(k&&k.has(E))return k.get(E);var F={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in E)if(Object.prototype.hasOwnProperty.call(E,C)){var I=D?Object.getOwnPropertyDescriptor(E,C):null;I&&(I.get||I.set)?Object.defineProperty(F,C,I):F[C]=E[C]}return F.default=E,k&&k.set(E,F),F}function u(E){"@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(E)}function c(){return c=Object.assign||function(E){for(var k=1;k<arguments.length;k++){var F=arguments[k];for(var D in F)Object.prototype.hasOwnProperty.call(F,D)&&(E[D]=F[D])}return E},c.apply(this,arguments)}function d(E,k){if(!(E instanceof k))throw new TypeError("Cannot call a class as a function")}function g(E,k){for(var F=0;F<k.length;F++){var D=k[F];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(E,D.key,D)}}function h(E,k,F){return k&&g(E.prototype,k),E}function m(E,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(k&&k.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),k&&p(E,k)}function p(E,k){return p=Object.setPrototypeOf||function(D,C){return D.__proto__=C,D},p(E,k)}function y(E){var k=S();return function(){var D=O(E),C;if(k){var I=O(this).constructor;C=Reflect.construct(D,arguments,I)}else C=D.apply(this,arguments);return b(this,C)}}function b(E,k){return k&&(u(k)==="object"||typeof k=="function")?k:v(E)}function v(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function S(){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 O(E){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(F){return F.__proto__||Object.getPrototypeOf(F)},O(E)}function R(E,k,F){return k in E?Object.defineProperty(E,k,{value:F,enumerable:!0,configurable:!0,writable:!0}):E[k]=F,E}var M=function(k){return k.hasOwnProperty("key")},_=function(E){m(F,E);var k=y(F);function F(D){var C;return d(this,F),C=k.call(this,D),R(v(C),"itemsWrapperRef",void 0),R(v(C),"itemsListRef",void 0),R(v(C),"thumbsRef",void 0),R(v(C),"setItemsWrapperRef",function(I){C.itemsWrapperRef=I}),R(v(C),"setItemsListRef",function(I){C.itemsListRef=I}),R(v(C),"setThumbsRef",function(I,T){C.thumbsRef||(C.thumbsRef=[]),C.thumbsRef[T]=I}),R(v(C),"updateSizes",function(){if(!(!C.props.children||!C.itemsWrapperRef||!C.thumbsRef)){var I=e.Children.count(C.props.children),T=C.itemsWrapperRef.clientWidth,x=C.props.thumbWidth?C.props.thumbWidth:(0,n.outerWidth)(C.thumbsRef[0]),$=Math.floor(T/x),G=$<I,X=G?I-$:0;C.setState(function(ie,ee){return{itemSize:x,visibleItems:$,firstItem:G?C.getFirstItem(ee.selectedItem):0,lastPosition:X,showArrows:G}})}}),R(v(C),"handleClickItem",function(I,T,x){if(!M(x)||x.key==="Enter"){var $=C.props.onSelectItem;typeof $=="function"&&$(I,T)}}),R(v(C),"onSwipeStart",function(){C.setState({swiping:!0})}),R(v(C),"onSwipeEnd",function(){C.setState({swiping:!1})}),R(v(C),"onSwipeMove",function(I){var T=I.x;if(!C.state.itemSize||!C.itemsWrapperRef||!C.state.visibleItems)return!1;var x=0,$=e.Children.count(C.props.children),G=-(C.state.firstItem*100)/C.state.visibleItems,X=Math.max($-C.state.visibleItems,0),ie=-X*100/C.state.visibleItems;G===x&&T>0&&(T=0),G===ie&&T<0&&(T=0);var ee=C.itemsWrapperRef.clientWidth,Q=G+100/(ee/T);return C.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(te){C.itemsListRef.style[te]=(0,r.default)(Q,"%",C.props.axis)}),!0}),R(v(C),"slideRight",function(I){C.moveTo(C.state.firstItem-(typeof I=="number"?I:1))}),R(v(C),"slideLeft",function(I){C.moveTo(C.state.firstItem+(typeof I=="number"?I:1))}),R(v(C),"moveTo",function(I){I=I<0?0:I,I=I>=C.state.lastPosition?C.state.lastPosition:I,C.setState({firstItem:I})}),C.state={selectedItem:D.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},C}return h(F,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(C){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==C.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(C){var I=C;return C>=this.state.lastPosition&&(I=this.state.lastPosition),C<this.state.firstItem+this.state.visibleItems&&(I=this.state.firstItem),C<this.state.firstItem&&(I=C),I}},{key:"renderItems",value:function(){var C=this;return this.props.children.map(function(I,T){var x=t.default.ITEM(!1,T===C.state.selectedItem),$={key:T,ref:function(X){return C.setThumbsRef(X,T)},className:x,onClick:C.handleClickItem.bind(C,T,C.props.children[T]),onKeyDown:C.handleClickItem.bind(C,T,C.props.children[T]),"aria-label":"".concat(C.props.labels.item," ").concat(T+1),style:{width:C.props.thumbWidth}};return e.default.createElement("li",c({},$,{role:"button",tabIndex:0}),I)})}},{key:"render",value:function(){var C=this;if(!this.props.children)return null;var I=e.Children.count(this.props.children)>1,T=this.state.showArrows&&this.state.firstItem>0,x=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,$={},G=-this.state.firstItem*(this.state.itemSize||0),X=(0,r.default)(G,"px",this.props.axis),ie=this.props.transitionTime+"ms";return $={WebkitTransform:X,MozTransform:X,MsTransform:X,OTransform:X,transform:X,msTransform:X,WebkitTransitionDuration:ie,MozTransitionDuration:ie,MsTransitionDuration:ie,OTransitionDuration:ie,transitionDuration:ie,msTransitionDuration:ie},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(!T),onClick:function(){return C.slideRight()},"aria-label":this.props.labels.leftArrow}),I?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(Q){return C.setItemsListRef(Q)},style:$},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!x),onClick:function(){return C.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),F}(e.Component);return Hi.default=_,R(_,"displayName","Thumbs"),R(_,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Hi}var $i={},Yl;function Bg(){if(Yl)return $i;Yl=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.default=void 0;var e=function(){return document};return $i.default=e,$i}var In={},jl;function Kc(){if(jl)return In;jl=1,Object.defineProperty(In,"__esModule",{value:!0}),In.setPosition=In.getPosition=In.isKeyboardEvent=In.defaultStatusFormatter=In.noop=void 0;var e=lo(),t=n($s());function n(l){return l&&l.__esModule?l:{default:l}}var r=function(){};In.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};In.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};In.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};In.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 In.setPosition=a,In}var $n={},Xl;function Wg(){if(Xl)return $n;Xl=1,Object.defineProperty($n,"__esModule",{value:!0}),$n.fadeAnimationHandler=$n.slideStopSwipingHandler=$n.slideSwipeAnimationHandler=$n.slideAnimationHandler=void 0;var e=lo(),t=r($s()),n=Kc();function r(d){return d&&d.__esModule?d:{default:d}}function i(d,g){var h=Object.keys(d);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(d);g&&(m=m.filter(function(p){return Object.getOwnPropertyDescriptor(d,p).enumerable})),h.push.apply(h,m)}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(m){s(d,m,h[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(m){Object.defineProperty(d,m,Object.getOwnPropertyDescriptor(h,m))})}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 m={},p=h.selectedItem,y=p,b=e.Children.count(g.children)-1,v=g.infiniteLoop&&(p<0||p>b);if(v)return y<0?g.centerMode&&g.centerSlidePercentage&&g.axis==="horizontal"?m.itemListStyle=(0,n.setPosition)(-(b+2)*g.centerSlidePercentage-(100-g.centerSlidePercentage)/2,g.axis):m.itemListStyle=(0,n.setPosition)(-(b+2)*100,g.axis):y>b&&(m.itemListStyle=(0,n.setPosition)(0,g.axis)),m;var S=(0,n.getPosition)(p,g),O=(0,t.default)(S,"%",g.axis),R=g.transitionTime+"ms";return m.itemListStyle={WebkitTransform:O,msTransform:O,OTransform:O,transform:O},h.swiping||(m.itemListStyle=o(o({},m.itemListStyle),{},{WebkitTransitionDuration:R,MozTransitionDuration:R,OTransitionDuration:R,transitionDuration:R,msTransitionDuration:R})),m};$n.slideAnimationHandler=a;var l=function(g,h,m,p){var y={},b=h.axis==="horizontal",v=e.Children.count(h.children),S=0,O=(0,n.getPosition)(m.selectedItem,h),R=h.infiniteLoop?(0,n.getPosition)(v-1,h)-100:(0,n.getPosition)(v-1,h),M=b?g.x:g.y,_=M;O===S&&M>0&&(_=0),O===R&&M<0&&(_=0);var E=O+100/(m.itemSize/_),k=Math.abs(M)>h.swipeScrollTolerance;return h.infiniteLoop&&k&&(m.selectedItem===0&&E>-100?E-=v*100:m.selectedItem===v-1&&E<-v*100&&(E+=v*100)),(!h.preventMovementUntilSwipeScrollTolerance||k||m.swipeMovementStarted)&&(m.swipeMovementStarted||p({swipeMovementStarted:!0}),y.itemListStyle=(0,n.setPosition)(E,h.axis)),k&&!m.cancelClick&&p({cancelClick:!0}),y};$n.slideSwipeAnimationHandler=l;var u=function(g,h){var m=(0,n.getPosition)(h.selectedItem,g),p=(0,n.setPosition)(m,g.axis);return{itemListStyle:p}};$n.slideStopSwipingHandler=u;var c=function(g,h){var m=g.transitionTime+"ms",p="ease-in-out",y={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:p,msTransitionTimingFunction:p,MozTransitionTimingFunction:p,WebkitTransitionTimingFunction:p,OTransitionTimingFunction:p};return h.swiping||(y=o(o({},y),{},{WebkitTransitionDuration:m,MozTransitionDuration:m,OTransitionDuration:m,transitionDuration:m,msTransitionDuration:m})),{slideStyle:y,selectedStyle:o(o({},y),{},{opacity:1,position:"relative"}),prevStyle:o({},y)}};return $n.fadeAnimationHandler=c,$n}var Kl;function Ug(){if(Kl)return Li;Kl=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.default=void 0;var e=c(lo()),t=l(Gc()),n=l(Yc()),r=l(Xc()),i=l(Bg()),o=l(jc()),s=Kc(),a=Wg();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 C=u();if(C&&C.has(D))return C.get(D);var I={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in D)if(Object.prototype.hasOwnProperty.call(D,x)){var $=T?Object.getOwnPropertyDescriptor(D,x):null;$&&($.get||$.set)?Object.defineProperty(I,x,$):I[x]=D[x]}return I.default=D,C&&C.set(D,I),I}function d(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(I){return typeof I}:d=function(I){return I&&typeof Symbol=="function"&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},d(D)}function g(){return g=Object.assign||function(D){for(var C=1;C<arguments.length;C++){var I=arguments[C];for(var T in I)Object.prototype.hasOwnProperty.call(I,T)&&(D[T]=I[T])}return D},g.apply(this,arguments)}function h(D,C){var I=Object.keys(D);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(D);C&&(T=T.filter(function(x){return Object.getOwnPropertyDescriptor(D,x).enumerable})),I.push.apply(I,T)}return I}function m(D){for(var C=1;C<arguments.length;C++){var I=arguments[C]!=null?arguments[C]:{};C%2?h(Object(I),!0).forEach(function(T){k(D,T,I[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(I)):h(Object(I)).forEach(function(T){Object.defineProperty(D,T,Object.getOwnPropertyDescriptor(I,T))})}return D}function p(D,C){if(!(D instanceof C))throw new TypeError("Cannot call a class as a function")}function y(D,C){for(var I=0;I<C.length;I++){var T=C[I];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(D,T.key,T)}}function b(D,C,I){return C&&y(D.prototype,C),D}function v(D,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(C&&C.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),C&&S(D,C)}function S(D,C){return S=Object.setPrototypeOf||function(T,x){return T.__proto__=x,T},S(D,C)}function O(D){var C=_();return function(){var T=E(D),x;if(C){var $=E(this).constructor;x=Reflect.construct(T,arguments,$)}else x=T.apply(this,arguments);return R(this,x)}}function R(D,C){return C&&(d(C)==="object"||typeof C=="function")?C:M(D)}function M(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function _(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function E(D){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(I){return I.__proto__||Object.getPrototypeOf(I)},E(D)}function k(D,C,I){return C in D?Object.defineProperty(D,C,{value:I,enumerable:!0,configurable:!0,writable:!0}):D[C]=I,D}var F=function(D){v(I,D);var C=O(I);function I(T){var x;p(this,I),x=C.call(this,T),k(M(x),"thumbsRef",void 0),k(M(x),"carouselWrapperRef",void 0),k(M(x),"listRef",void 0),k(M(x),"itemsRef",void 0),k(M(x),"timer",void 0),k(M(x),"animationHandler",void 0),k(M(x),"setThumbsRef",function(G){x.thumbsRef=G}),k(M(x),"setCarouselWrapperRef",function(G){x.carouselWrapperRef=G}),k(M(x),"setListRef",function(G){x.listRef=G}),k(M(x),"setItemsRef",function(G,X){x.itemsRef||(x.itemsRef=[]),x.itemsRef[X]=G}),k(M(x),"autoPlay",function(){e.Children.count(x.props.children)<=1||(x.clearAutoPlay(),x.props.autoPlay&&(x.timer=setTimeout(function(){x.increment()},x.props.interval)))}),k(M(x),"clearAutoPlay",function(){x.timer&&clearTimeout(x.timer)}),k(M(x),"resetAutoPlay",function(){x.clearAutoPlay(),x.autoPlay()}),k(M(x),"stopOnHover",function(){x.setState({isMouseEntered:!0},x.clearAutoPlay)}),k(M(x),"startOnLeave",function(){x.setState({isMouseEntered:!1},x.autoPlay)}),k(M(x),"isFocusWithinTheCarousel",function(){return x.carouselWrapperRef?!!((0,i.default)().activeElement===x.carouselWrapperRef||x.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),k(M(x),"navigateWithKeyboard",function(G){if(x.isFocusWithinTheCarousel()){var X=x.props.axis,ie=X==="horizontal",ee={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},Q=ie?ee.ArrowRight:ee.ArrowDown,te=ie?ee.ArrowLeft:ee.ArrowUp;Q===G.keyCode?x.increment():te===G.keyCode&&x.decrement()}}),k(M(x),"updateSizes",function(){if(!(!x.state.initialized||!x.itemsRef||x.itemsRef.length===0)){var G=x.props.axis==="horizontal",X=x.itemsRef[0];if(X){var ie=G?X.clientWidth:X.clientHeight;x.setState({itemSize:ie}),x.thumbsRef&&x.thumbsRef.updateSizes()}}}),k(M(x),"setMountState",function(){x.setState({hasMount:!0}),x.updateSizes()}),k(M(x),"handleClickItem",function(G,X){if(e.Children.count(x.props.children)!==0){if(x.state.cancelClick){x.setState({cancelClick:!1});return}x.props.onClickItem(G,X),G!==x.state.selectedItem&&x.setState({selectedItem:G})}}),k(M(x),"handleOnChange",function(G,X){e.Children.count(x.props.children)<=1||x.props.onChange(G,X)}),k(M(x),"handleClickThumb",function(G,X){x.props.onClickThumb(G,X),x.moveTo(G)}),k(M(x),"onSwipeStart",function(G){x.setState({swiping:!0}),x.props.onSwipeStart(G)}),k(M(x),"onSwipeEnd",function(G){x.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),x.props.onSwipeEnd(G),x.clearAutoPlay(),x.state.autoPlay&&x.autoPlay()}),k(M(x),"onSwipeMove",function(G,X){x.props.onSwipeMove(X);var ie=x.props.swipeAnimationHandler(G,x.props,x.state,x.setState.bind(M(x)));return x.setState(m({},ie)),!!Object.keys(ie).length}),k(M(x),"decrement",function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;x.moveTo(x.state.selectedItem-(typeof G=="number"?G:1))}),k(M(x),"increment",function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;x.moveTo(x.state.selectedItem+(typeof G=="number"?G:1))}),k(M(x),"moveTo",function(G){if(typeof G=="number"){var X=e.Children.count(x.props.children)-1;G<0&&(G=x.props.infiniteLoop?X:0),G>X&&(G=x.props.infiniteLoop?0:X),x.selectItem({selectedItem:G}),x.state.autoPlay&&x.state.isMouseEntered===!1&&x.resetAutoPlay()}}),k(M(x),"onClickNext",function(){x.increment(1)}),k(M(x),"onClickPrev",function(){x.decrement(1)}),k(M(x),"onSwipeForward",function(){x.increment(1),x.props.emulateTouch&&x.setState({cancelClick:!0})}),k(M(x),"onSwipeBackwards",function(){x.decrement(1),x.props.emulateTouch&&x.setState({cancelClick:!0})}),k(M(x),"changeItem",function(G){return function(X){(!(0,s.isKeyboardEvent)(X)||X.key==="Enter")&&x.moveTo(G)}}),k(M(x),"selectItem",function(G){x.setState(m({previousItem:x.state.selectedItem},G),function(){x.setState(x.animationHandler(x.props,x.state))}),x.handleOnChange(G.selectedItem,e.Children.toArray(x.props.children)[G.selectedItem])}),k(M(x),"getInitialImage",function(){var G=x.props.selectedItem,X=x.itemsRef&&x.itemsRef[G],ie=X&&X.getElementsByTagName("img")||[];return ie[0]}),k(M(x),"getVariableItemHeight",function(G){var X=x.itemsRef&&x.itemsRef[G];if(x.state.hasMount&&X&&X.children.length){var ie=X.children[0].getElementsByTagName("img")||[];if(ie.length>0){var ee=ie[0];if(!ee.complete){var Q=function ue(){x.forceUpdate(),ee.removeEventListener("load",ue)};ee.addEventListener("load",Q)}}var te=ie[0]||X.children[0],se=te.clientHeight;return se>0?se:null}return null});var $={initialized:!1,previousItem:T.selectedItem,selectedItem:T.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:T.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return x.animationHandler=typeof T.animationHandler=="function"&&T.animationHandler||T.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,x.state=m(m({},$),x.animationHandler(T,$)),x}return b(I,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(x,$){!x.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!x.autoFocus&&this.props.autoFocus&&this.forceFocus(),$.swiping&&!this.state.swiping&&this.setState(m({},this.props.stopSwipingHandler(this.props,this.state))),(x.selectedItem!==this.props.selectedItem||x.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),x.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 x=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 $=x.getInitialImage();$&&!$.complete?$.addEventListener("load",x.setMountState):x.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var x=this.carouselWrapperRef;this.props.stopOnHover&&x&&(x.addEventListener("mouseenter",this.stopOnHover),x.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var x=this.carouselWrapperRef;this.props.stopOnHover&&x&&(x.removeEventListener("mouseenter",this.stopOnHover),x.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 x=this.getInitialImage();x&&x.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var x;(x=this.carouselWrapperRef)===null||x===void 0||x.focus()}},{key:"renderItems",value:function(x){var $=this;return this.props.children?e.Children.map(this.props.children,function(G,X){var ie=X===$.state.selectedItem,ee=X===$.state.previousItem,Q=ie&&$.state.selectedStyle||ee&&$.state.prevStyle||$.state.slideStyle||{};$.props.centerMode&&$.props.axis==="horizontal"&&(Q=m(m({},Q),{},{minWidth:$.props.centerSlidePercentage+"%"})),$.state.swiping&&$.state.swipeMovementStarted&&(Q=m(m({},Q),{},{pointerEvents:"none"}));var te={ref:function(ue){return $.setItemsRef(ue,X)},key:"itemKey"+X+(x?"clone":""),className:n.default.ITEM(!0,X===$.state.selectedItem,X===$.state.previousItem),onClick:$.handleClickItem.bind($,X,G),style:Q};return e.default.createElement("li",te,$.props.renderItem(G,{isSelected:X===$.state.selectedItem,isPrevious:X===$.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var x=this,$=this.props,G=$.showIndicators,X=$.labels,ie=$.renderIndicator,ee=$.children;return G?e.default.createElement("ul",{className:"control-dots"},e.Children.map(ee,function(Q,te){return ie&&ie(x.changeItem(te),te===x.state.selectedItem,te,X.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 x=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",X=this.props.showArrows&&e.Children.count(this.props.children)>1,ie=X&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ee=X&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,Q=this.renderItems(!0),te=Q.shift(),se=Q.pop(),ue={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},fe={};if(G){if(ue.onSwipeLeft=this.onSwipeForward,ue.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var re=this.getVariableItemHeight(this.state.selectedItem);fe.height=re||"auto"}}else ue.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,ue.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,ue.style=m(m({},ue.style),{},{height:this.state.itemSize}),fe.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,ie,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:fe},$?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},ue,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&se,this.renderItems(),this.props.infiniteLoop&&te):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(P){return x.setListRef(P)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&se,this.renderItems(),this.props.infiniteLoop&&te)),this.props.renderArrowNext(this.onClickNext,ee,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),I}(e.default.Component);return Li.default=F,k(F,"displayName","Carousel"),k(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(C,I,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_PREV(!I),onClick:C})},renderArrowNext:function(C,I,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_NEXT(!I),onClick:C})},renderIndicator:function(C,I,T,x){return e.default.createElement("li",{className:n.default.DOT(I),onClick:C,onKeyDown:C,value:T,key:T,role:"button",tabIndex:0,"aria-label":"".concat(x," ").concat(T+1)})},renderItem:function(C){return C},renderThumbs:function(C){var I=e.Children.map(C,function(T){var x=T;if(T.type!=="img"&&(x=e.Children.toArray(T.props.children).find(function($){return $.type==="img"})),!!x)return x});return I.filter(function(T){return T}).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"),[]):I},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}),Li}var Zl={},Jl;function qg(){return Jl||(Jl=1),Zl}var Ql;function Gg(){return Ql||(Ql=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(Ug()),n=qg(),r=i(Xc());function i(o){return o&&o.__esModule?o:{default:o}}}(Xa)),Xa}var Yg=Gg(),Ka,eu;function jg(){if(eu)return Ka;eu=1;var e=fh(),t=function(){return e.Date.now()};return Ka=t,Ka}var Za,tu;function Zc(){if(tu)return Za;tu=1;var e=Ic(),t=jg(),n=Tc(),r="Expected a function",i=Math.max,o=Math.min;function s(a,l,u){var c,d,g,h,m,p,y=0,b=!1,v=!1,S=!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,S="trailing"in u?!!u.trailing:S);function O(I){var T=c,x=d;return c=d=void 0,y=I,h=a.apply(x,T),h}function R(I){return y=I,m=setTimeout(E,l),b?O(I):h}function M(I){var T=I-p,x=I-y,$=l-T;return v?o($,g-x):$}function _(I){var T=I-p,x=I-y;return p===void 0||T>=l||T<0||v&&x>=g}function E(){var I=t();if(_(I))return k(I);m=setTimeout(E,M(I))}function k(I){return m=void 0,S&&c?O(I):(c=d=void 0,h)}function F(){m!==void 0&&clearTimeout(m),y=0,c=p=d=m=void 0}function D(){return m===void 0?h:k(t())}function C(){var I=t(),T=_(I);if(c=arguments,d=this,p=I,T){if(m===void 0)return R(p);if(v)return clearTimeout(m),m=setTimeout(E,l),O(p)}return m===void 0&&(m=setTimeout(E,l)),h}return C.cancel=F,C.flush=D,C}return Za=s,Za}var Xg=Zc();const Jc=ar(Xg);function vn(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 wr(e,t){return e===void 0?void 0:t}const Kg=Math.PI;function nu(e){return e*Kg/180}const Qc=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),ed=(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}},td=(e,t,n)=>Math.min(e,t-n*2),nd=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Bs=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"}))},Zg=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 Jg(e,t,n){const[r,i]=f.useState(e),o=f.useRef(!0);f.useEffect(()=>()=>{o.current=!1},[]);const s=f.useRef(Jc(a=>{o.current&&i(a)},n));return f.useLayoutEffect(()=>{o.current&&s.current(()=>e())},t),r}const Qg="֑-߿יִ-﷽ﹰ-ﻼ",em="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",tm=new RegExp("^[^"+em+"]*["+Qg+"]");function Ws(e){return tm.test(e)?"rtl":"not-rtl"}let Ao;function Ss(){if(typeof document>"u")return 0;if(Ao!==void 0)return Ao;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(),Ao=n-r,Ao}const Ar=Symbol();function nm(e){const t=f.useRef([Ar,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!==Ar&&(a=typeof a=="function"?a(l):a,a===l)||(l!==Ar&&i({}),r(u=>typeof a=="function"?a(l===Ar?u:l):a),t.current[0]=Ar)},[]),s=f.useCallback(()=>{t.current[0]=Ar,i({})},[]);return[t.current[0]===Ar?n:t.current[0],o,s]}function rd(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 rm(e){const t=f.useRef(e);return mi(e,t.current)||(t.current=e),t.current}const im=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(Vg,{"data-testid":"GDG-default-image-overlay-editor"},f.createElement(Yg.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(Bs,null)))};function id(){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 Br=id();function om(e){Br=e}const od=/[&<>"']/,am=new RegExp(od.source,"g"),ad=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,sm=new RegExp(ad.source,"g"),lm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ru=e=>lm[e];function gn(e,t){if(t){if(od.test(e))return e.replace(am,ru)}else if(ad.test(e))return e.replace(sm,ru);return e}const um=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function sd(e){return e.replace(um,(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 cm=/(^|[^\[])\^/g;function At(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(cm,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const dm=/[^\w:]/g,fm=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function iu(e,t,n){if(e){let r;try{r=decodeURIComponent(sd(n)).replace(dm,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!fm.test(n)&&(n=pm(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Ho={},hm=/^[^:]+:\/*[^/]*$/,gm=/^([^:]+:)[\s\S]*$/,mm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function pm(e,t){Ho[" "+e]||(hm.test(e)?Ho[" "+e]=e+"/":Ho[" "+e]=Ko(e,"/",!0)),e=Ho[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(gm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(mm,"$1")+t:e+t}const ra={exec:function(){}};function ou(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 Ko(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 vm(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 bm(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 au(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function su(e,t,n,r){const i=t.href,o=t.title?gn(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:gn(s)}}function wm(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 Us{constructor(t){this.options=t||Br}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:Ko(r,`
5
5
  `)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],i=wm(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=Ko(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,m,p=n[1].trim();const y=p.length>1,b={type:"list",raw:"",ordered:y,start:y?+p.slice(0,-1):"",loose:!1,items:[]};p=y?`\\d{1,9}\\${p.slice(-1)}`:`\\${p}`,this.options.pedantic&&(p=y?p:"[*+-]");const v=new RegExp(`^( {0,3}${p})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(m=!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(Pu(e.slice(i,s))),i=s+1,a===`
172
- `&&(n.push(r),r=[])),o=t.None);break}s++}return i<e.length&&r.push(Pu(e.slice(i,e.length))),n.push(r),n.map(a=>a.map(l=>({rawValue:l,formatted:l,format:"string"})))}function _u(e,t,n){const r=V0(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 Ld(e){return e!==!0}function Fu(e){return typeof e=="string"?e:`${e}px`}const B0=()=>e=>e.innerWidth,W0=()=>e=>e.innerHeight,U0=un("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[B0()],"wmyidgi-1":[W0()]}}),q0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return f.createElement(U0,{innerHeight:Fu(n),innerWidth:Fu(t),...i},r)},G0=2,Y0=1300;function j0(e,t,n){const r=Vt.useRef(0),[i,o]=e??[0,0];Vt.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/Y0);const d=r.current**1.618*c*G0;t.current?.scrollBy(i*d,o*d),a=u,n?.()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{s=!0}},[t,i,o,n])}function X0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:s,remSize:a}){const[l,u,c,d,g,h]=Vt.useMemo(()=>{if(!s||a===16)return[e,t,n,r,i,o];const m=a/16,p=e,y=yd();return[typeof p=="number"?p*m:b=>Math.ceil(p(b)*m),Math.ceil(t*m),Math.ceil(n*m),{...r,headerIconSize:(r?.headerIconSize??y.headerIconSize)*m,cellHorizontalPadding:(r?.cellHorizontalPadding??y.cellHorizontalPadding)*m,cellVerticalPadding:(r?.cellVerticalPadding??y.cellVerticalPadding)*m},Math.ceil((i??0)*m),Math.ceil((o??0)*m)]},[n,t,i,o,a,e,s,r]);return{rowHeight:l,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:g,overscrollY:h}}const br={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 at(e,t){return e===!0?t:e===!1?"":e}function Lu(e){const t=aa.value;return{activateCell:at(e.activateCell," |Enter|shift+Enter"),clear:at(e.clear,"any+Escape"),closeOverlay:at(e.closeOverlay,"any+Escape"),acceptOverlayDown:at(e.acceptOverlayDown,"Enter"),acceptOverlayUp:at(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:at(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:at(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:at(e.delete,t?"Backspace|Delete":"Delete"),downFill:at(e.downFill,"primary+_68"),scrollToSelectedCell:at(e.scrollToSelectedCell,"primary+Enter"),goDownCell:at(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:at(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:at(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:at(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:at(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:at(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:at(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:at(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:at(e.goToFirstCell,"primary+Home"),goToFirstColumn:at(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:at(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:at(e.goToLastCell,"primary+End"),goToLastColumn:at(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:at(e.goToLastRow,"primary+ArrowDown"),goToNextPage:at(e.goToNextPage,"PageDown"),goToPreviousPage:at(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:at(e.rightFill,"primary+_82"),search:at(e.search,"primary+f"),selectAll:at(e.selectAll,"primary+a"),selectColumn:at(e.selectColumn,"ctrl+ "),selectGrowDown:at(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:at(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:at(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:at(e.selectGrowUp,"shift+ArrowUp"),selectRow:at(e.selectRow,"shift+ "),selectToFirstCell:at(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:at(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:at(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:at(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:at(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:at(e.selectToLastRow,"primary+shift+ArrowDown")}}function K0(e){const t=rm(e);return Vt.useMemo(()=>{if(t===void 0)return Lu(br);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??br.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??br.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??br.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??br.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??br.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??br.selectToLastCell};return Lu({...br,...n})},[t])}function Z0(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 Qs(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=Z0(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 Ts(e,t){if(t===void 0||Qs.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 J0(e,t,n,r){const i=Vt.useMemo(()=>e===void 0?void 0:Qs(e,t),[e,t]),o=Vt.useMemo(()=>i?.reduce((c,d)=>(c[d.rowIndex]=d,c),{}),[i]),s=Vt.useMemo(()=>i===void 0?t:i.reduce((c,d)=>c+(d.isCollapsed?1:d.rows+1),0),[i,t]),a=Vt.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=Vt.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=wr(r??e?.themeOverride,Vt.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}=Ts(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 Q0(e,t){const n=Vt.useMemo(()=>e===void 0?void 0:Qs(e,t),[e,t]);return{getRowGroupingForPath:Hd,updateRowGroupingByPath:Ad,mapper:Vt.useCallback(r=>{if(typeof r=="number")return Ts(r,n);const i=Ts(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function Ad(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:Ad(o.subGroups??[],i,n)}:o)}function Hd(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Hd(e[n].subGroups??[],r)}function ev(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 tv(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]=nm(a),d=f.useRef(i);d.current=i;const g=ev(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.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 m=(l.width??1)>1;return f.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&m){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&c(),d.current()}},[e,m,c,g]),{visibleRegion:l,setVisibleRegion:u,scrollRef:g}}const nv=f.lazy(async()=>await As(()=>import("./data-grid-overlay-editor.CxvB719M.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url));let rv=0;function iv(e){return ap(Cu(Cu(e).filter(t=>t.span!==void 0).map(t=>Sr((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Vo(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 No={kind:J.Loading,allowOverlay:!1},$o={columns:it.empty(),rows:it.empty(),current:void 0},ov=(e,t)=>{const[n,r]=f.useState($o),[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:m,width:p,height:y,columns:b,rows:v,getCellContent:S,onCellClicked:O,onCellActivated:R,onFillPattern:M,onFinishedEditing:_,coercePasteValue:E,drawHeader:k,drawCell:F,editorBloom:D,onHeaderClicked:C,onColumnProposeMove:I,rangeSelectionColumnSpanning:T=!0,spanRangeBehavior:x="default",onGroupHeaderClicked:$,onCellContextMenu:G,className:X,onHeaderContextMenu:ie,getCellsForSelection:ee,onGroupHeaderContextMenu:Q,onGroupHeaderRenamed:te,onCellEdited:se,onCellsEdited:ue,onSearchResultsChanged:fe,searchResults:re,onSearchValueChange:H,searchValue:P,onKeyDown:Y,onKeyUp:ce,keybindings:he,editOnType:ke=!0,onRowAppended:Se,onColumnAppended:Je,onColumnMoved:Ie,validateCell:Qe,highlightRegions:kt,rangeSelect:$e="rect",columnSelect:ne="multi",rowSelect:me="multi",rangeSelectionBlending:xe="exclusive",columnSelectionBlending:de="exclusive",rowSelectionBlending:be="exclusive",onDelete:Pe,onDragStart:Te,onMouseMove:st,onPaste:Re,copyHeaders:qe=!1,freezeColumns:He=0,cellActivationBehavior:we="second-click",rowSelectionMode:Be="auto",onHeaderMenuClick:mt,onHeaderIndicatorClick:ft,getGroupDetails:Ge,rowGrouping:yt,onSearchClose:Yt,onItemHovered:Ht,onSelectionCleared:Mt,showSearch:nn,onVisibleRegionChanged:qt,gridSelection:cn,onGridSelectionChange:Ot,minColumnWidth:ut=50,maxColumnWidth:tn=500,maxColumnAutoWidth:Ct,provideEditor:rn,trailingRowOptions:Bt,freezeTrailingRows:De=0,allowedFillDirections:It="orthogonal",scrollOffsetX:Pt,scrollOffsetY:wn,verticalBorder:jt,onDragOverCell:dn,onDrop:Mn,onColumnResize:Xt,onColumnResizeEnd:Jt,onColumnResizeStart:We,customRenderers:Rt,fillHandle:yn,experimental:vt,fixedShadowX:Ft,fixedShadowY:Cn,headerIcons:Wn,imageWindowLoader:zn,initialSize:N,isDraggable:Ne,onDragLeave:Ue,onRowMoved:St,overscrollX:mn,overscrollY:ge,preventDiagonalScrolling:bt,rightElement:Qt,rightElementProps:Et,trapFocus:$t=!1,smoothScrollX:on,smoothScrollY:xa,scaleToRem:fo=!1,rowHeight:ka=34,headerHeight:ho=36,groupHeaderHeight:Rr=ho,theme:lr,isOutsideClick:Ma,renderers:bi,resizeIndicator:go,scrollToActiveCell:wi=!0,drawFocusRing:Er=!0,portalElementRef:pl}=e,yi=Er==="no-editor"?i===void 0:Er,Pn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,Sn=Pn?.kind??e.rowMarkers??"none",Ci=Pn?.width??e.rowMarkerWidth,Jn=Pn?.startIndex??e.rowMarkerStartIndex??1,Qn=Pn?.theme??e.rowMarkerTheme,Gr=Pn?.headerTheme,ur=Pn?.headerAlwaysVisible,Ir=me!=="multi"||Pn?.headerDisabled===!0,Yr=Pn?.checkboxStyle??"square",er=Math.max(ut,20),jr=Math.max(tn,er),Ra=Math.max(Ct??jr,er),mo=f.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:_e,rowNumberMapper:Si,rowHeight:po,getRowThemeOverride:cr}=J0(yt,v,ka,h),Ea=f.useMemo(()=>Number.parseFloat(mo.fontSize),[mo]),{rowHeight:Un,headerHeight:xi,groupHeaderHeight:vo,theme:bo,overscrollX:ki,overscrollY:Ia}=X0({groupHeaderHeight:Rr,headerHeight:ho,overscrollX:mn,overscrollY:ge,remSize:Ea,rowHeight:po,scaleToRem:fo,theme:lr}),qn=K0(he),dr=Ci??(v>1e4?48:v>1e3?44:v>100?36:32),_n=Sn!=="none",U=_n?1:0,Lt=Bt!==void 0,tr=Bt?.sticky===!0,[Mi,wo]=f.useState(!1),Xr=nn??Mi,Ta=f.useCallback(()=>{Yt!==void 0?Yt():wo(!1)},[Yt]),K=f.useMemo(()=>cn===void 0?void 0:Vo(cn,U),[cn,U])??n,xn=f.useRef();xn.current===void 0&&(xn.current=new AbortController),f.useEffect(()=>()=>xn?.current.abort(),[]);const[z,oe]=_0(ee,S,U,xn.current,_e),Me=f.useCallback((w,A,L)=>{if(Qe===void 0)return!0;const W=[w[0]-U,w[1]];return Qe?.(W,A,L)},[U,Qe]),Ee=f.useRef(cn),ae=f.useCallback((w,A)=>{A&&(w=N0(w,z,U,x,xn.current)),Ot!==void 0?(Ee.current=Vo(w,-U),Ot(Ee.current)):r(w)},[Ot,z,U,x]),ve=wr(Xt,f.useCallback((w,A,L,W)=>{Xt?.(b[L-U],A,L-U,W)},[Xt,U,b])),Ye=wr(Jt,f.useCallback((w,A,L,W)=>{Jt?.(b[L-U],A,L-U,W)},[Jt,U,b])),ye=wr(We,f.useCallback((w,A,L,W)=>{We?.(b[L-U],A,L-U,W)},[We,U,b])),je=wr(k,f.useCallback((w,A)=>k?.({...w,columnIndex:w.columnIndex-U},A)??!1,[k,U])),ct=wr(F,f.useCallback((w,A)=>F?.({...w,col:w.col-U},A)??!1,[F,U])),Zt=f.useCallback(w=>{if(Pe!==void 0){const A=Pe(Vo(w,-U));return typeof A=="boolean"?A:Vo(A,U)}return!0},[Pe,U]),[dt,Tt,et]=P0(K,ae,xe,de,be,$e,T),Ze=f.useMemo(()=>ir(yd(),bo),[bo]),[zt,Wt]=f.useState([0,0,0]),Tr=f.useMemo(()=>{if(bi===void 0)return{};const w={};for(const A of bi)w[A.kind]=A;return w},[bi]),en=f.useCallback(w=>w.kind!==J.Custom?Tr[w.kind]:Rt?.find(A=>A.isMatch(w)),[Rt,Tr]);let{sizedColumns:an,nonGrowWidth:fr}=Zm(b,_e,oe,zt[0]-(U===0?0:dr)-zt[2],er,Ra,Ze,en,xn.current);Sn!=="none"&&(fr+=dr);const _t=f.useMemo(()=>an.some(w=>w.group!==void 0),[an]),kn=_t?xi+vo:xi,Rn=K.rows.length,hr=Sn==="none"?void 0:Rn===0?!1:Rn===_e?!0:void 0,tt=f.useMemo(()=>Sn==="none"?an:[{title:"",width:dr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:Qn,rowMarker:Yr,rowMarkerChecked:hr,headerRowMarkerTheme:Gr,headerRowMarkerAlwaysVisible:ur,headerRowMarkerDisabled:Ir},...an],[Sn,an,dr,Qn,Yr,hr,Gr,ur,Ir]),sn=f.useRef({height:1,width:1,x:0,y:0}),Gn=f.useRef(!1),{setVisibleRegion:vl,visibleRegion:Dr,scrollRef:Ut}=tv(Pt,wn,Un,sn,()=>Gn.current=!0);sn.current=Dr;const Pf=Dr.x+U,yo=Dr.y,fn=f.useRef(null),pn=f.useCallback(w=>{w===!0?fn.current?.focus():window.requestAnimationFrame(()=>{fn.current?.focus()})},[]),hn=Lt?_e+1:_e,Fn=f.useCallback(w=>{const A=U===0?w:w.map(W=>({...W,location:[W.location[0]-U,W.location[1]]})),L=ue?.(A);if(L!==!0)for(const W of A)se?.(W.location,W.value);return L},[se,ue,U]),[Or,Da]=f.useState(),Co=K.current!==void 0&&K.current.range.width*K.current.range.height>1?K.current.range:void 0,bl=yi?K.current?.cell:void 0,So=bl?.[0],xo=bl?.[1],_f=f.useMemo(()=>{if((kt===void 0||kt.length===0)&&(Co??So??xo??Or)===void 0)return;const w=[];if(kt!==void 0)for(const A of kt){const L=tt.length-A.range.x-U;L>0&&w.push({color:A.color,range:{...A.range,x:A.range.x+U,width:Math.min(L,A.range.width)},style:A.style})}return Or!==void 0&&w.push({color:Nr(Ze.accentColor,0),range:Or,style:"dashed"}),Co!==void 0&&w.push({color:Nr(Ze.accentColor,.5),range:Co,style:"solid-outline"}),So!==void 0&&xo!==void 0&&w.push({color:Ze.accentColor,range:{x:So,y:xo,width:1,height:1},style:"solid-outline"}),w.length>0?w:void 0},[Or,Co,So,xo,kt,tt.length,Ze.accentColor,U]),wl=f.useRef(tt);wl.current=tt;const En=f.useCallback(([w,A],L=!1)=>{const W=Lt&&A===hn-1;if(w===0&&_n){if(W)return No;const j=Si(A);return j===void 0?No:{kind:Hn.Marker,allowOverlay:!1,checkboxStyle:Yr,checked:K?.rows.hasIndex(A)===!0,markerKind:Sn==="clickable-number"?"number":Sn,row:Jn+j,drawHandle:St!==void 0,cursor:Sn==="clickable-number"?"pointer":void 0}}else if(W){const V=w===U?Bt?.hint??"":"",B=wl.current[w];if(B?.trailingRowOptions?.disabled===!0)return No;{const Z=B?.trailingRowOptions?.hint??V,le=B?.trailingRowOptions?.addIcon??Bt?.addIcon;return{kind:Hn.NewRow,hint:Z,allowOverlay:!1,icon:le}}}else{const j=w-U;if(L||vt?.strict===!0){const B=sn.current,Z=B.x>j||j>B.x+B.width||B.y>A||A>B.y+B.height||A>=Fa.current,le=j===B.extras?.selected?.[0]&&A===B.extras?.selected[1];let pe=!1;if(B.extras?.freezeRegions!==void 0){for(const wt of B.extras.freezeRegions)if(Vr(wt,j,A)){pe=!0;break}}if(Z&&!le&&!pe)return No}let V=S([j,A]);return U!==0&&V.span!==void 0&&(V={...V,span:[V.span[0]+U,V.span[1]+U]}),V}},[Lt,hn,_n,Si,Yr,K?.rows,Sn,Jn,St,U,Bt?.hint,Bt?.addIcon,vt?.strict,S]),Oa=f.useCallback(w=>{let A=Ge?.(w)??{name:w};return te!==void 0&&w!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:L=>Aa({group:A.name,bounds:L.bounds})}]}),A},[Ge,te]),ko=f.useCallback(w=>{const[A,L]=w.cell,W=tt[A],q=W?.group!==void 0?Oa(W.group)?.overrideTheme:void 0,j=W?.themeOverride,V=cr?.(L);o({...w,theme:ir(Ze,q,j,V,w.content.themeOverride)})},[cr,tt,Oa,Ze]),Kr=f.useCallback((w,A,L)=>{if(K.current===void 0)return;const[W,q]=K.current.cell,j=En([W,q]);if(j.kind!==J.Boolean&&j.allowOverlay){let V=j;if(L!==void 0)switch(V.kind){case J.Number:{const B=Dg(()=>L==="-"?-0:Number.parseFloat(L),0);V={...V,data:Number.isNaN(B)?0:B};break}case J.Text:case J.Markdown:case J.Uri:V={...V,data:L};break}ko({target:w,content:V,initialValue:L,cell:[W,q],highlight:L===void 0,forceEditMode:L!==void 0})}else j.kind===J.Boolean&&A&&j.readonly!==!0&&(Fn([{location:K.current.cell,value:{...j,data:Ld(j.data)}}]),fn.current?.damage([{cell:K.current.cell}]))},[En,K,Fn,ko]),yl=f.useCallback((w,A)=>{const L=fn.current?.getBounds(w,A);if(L===void 0||Ut.current===null)return;const W=En([w,A]);W.allowOverlay&&ko({target:L,content:W,initialValue:void 0,highlight:!0,cell:[w,A],forceEditMode:!0})},[En,Ut,ko]),Gt=f.useCallback((w,A,L="both",W=0,q=0,j=void 0)=>{if(Ut.current!==null){const V=fn.current,B=a.current,Z=typeof w!="number"?w.unit==="cell"?w.amount:void 0:w,le=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,pe=typeof w!="number"&&w.unit==="px"?w.amount:void 0,wt=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(V!==null&&B!==null){let rt={x:0,y:0,width:0,height:0},Xe=0,Ke=0;if((Z!==void 0||le!==void 0)&&(rt=V.getBounds((Z??0)+U,le??0)??rt,rt.width===0||rt.height===0))return;const ht=B.getBoundingClientRect(),xt=ht.width/B.offsetWidth;if(pe!==void 0&&(rt={...rt,x:pe-ht.left-Ut.current.scrollLeft,width:1}),wt!==void 0&&(rt={...rt,y:wt+ht.top-Ut.current.scrollTop,height:1}),rt!==void 0){const pt={x:rt.x-W,y:rt.y-q,width:rt.width+2*W,height:rt.height+2*q};let ni=0;for(let Wa=0;Wa<He;Wa++)ni+=an[Wa].width;let _i=0;const Fi=De+(tr?1:0);Fi>0&&(_i=Ur(hn,Fi,Un));let jn=ni*xt+ht.left+U*dr*xt,ri=ht.right,Lr=ht.top+kn*xt,ii=ht.bottom-_i*xt;const Oo=rt.width+W*2;switch(j?.hAlign){case"start":ri=jn+Oo;break;case"end":jn=ri-Oo;break;case"center":jn=Math.floor((jn+ri)/2)-Oo/2,ri=jn+Oo;break}const Po=rt.height+q*2;switch(j?.vAlign){case"start":ii=Lr+Po;break;case"end":Lr=ii-Po;break;case"center":Lr=Math.floor((Lr+ii)/2)-Po/2,ii=Lr+Po;break}jn>pt.x?Xe=pt.x-jn:ri<pt.x+pt.width&&(Xe=pt.x+pt.width-ri),Lr>pt.y?Ke=pt.y-Lr:ii<pt.y+pt.height&&(Ke=pt.y+pt.height-ii),L==="vertical"||typeof w=="number"&&w<He?Xe=0:(L==="horizontal"||typeof A=="number"&&A>=hn-Fi)&&(Ke=0),(Xe!==0||Ke!==0)&&(xt!==1&&(Xe/=xt,Ke/=xt),Ut.current.scrollTo({left:Xe+Ut.current.scrollLeft,top:Ke+Ut.current.scrollTop,behavior:j?.behavior??"auto"}))}}}},[U,De,dr,Ut,kn,He,an,hn,tr,Un]),Pa=f.useRef(yl),_a=f.useRef(S);Pa.current=yl,_a.current=S;const Fa=f.useRef(_e);Fa.current=_e;const Cl=f.useRef(tt.length);Cl.current=tt.length;const gr=f.useCallback(async(w,A=!0,L)=>{if(tt[w]?.trailingRowOptions?.disabled===!0)return;const q=Se?.();let j,V=!0;q!==void 0&&(j=await q,j==="top"&&(V=!1),typeof j=="number"&&(V=!1));let B=0;const Z=()=>{if(Fa.current<=_e){B<500&&window.setTimeout(Z,B),B=50+B*2;return}const le=typeof j=="number"?j:V?_e:0;Do.current(w-U,le,"both",0,0,L?{behavior:L}:void 0),dt({cell:[w,le],range:{x:w,y:le,width:1,height:1}},!1,!1,"edit");const pe=_a.current([w-U,le]);pe.allowOverlay&&ui(pe)&&pe.readonly!==!0&&A&&window.setTimeout(()=>{Pa.current(w,le)},0)};Z()},[tt,Se,U,_e,dt]),Mo=f.useCallback(async(w,A=!0)=>{const L=Je?.();let W,q=!0;L!==void 0&&(W=await L,W==="left"&&(q=!1),typeof W=="number"&&(q=!1));let j=0;const V=()=>{if(Cl.current<=tt.length){j<500&&window.setTimeout(V,j),j=50+j*2;return}const B=typeof W=="number"?W:q?tt.length:0;Gt(B-U,w),dt({cell:[B,w],range:{x:B,y:w,width:1,height:1}},!1,!1,"edit");const Z=_a.current([B-U,w]);Z.allowOverlay&&ui(Z)&&Z.readonly!==!0&&A&&window.setTimeout(()=>{Pa.current(B,w)},0)};V()},[tt,Je,U,Gt,dt]),Zr=f.useCallback(w=>{const A=an[w]?.trailingRowOptions?.targetColumn??Bt?.targetColumn;if(typeof A=="number")return A+(_n?1:0);if(typeof A=="object"){const L=b.indexOf(A);if(L>=0)return L+(_n?1:0)}},[an,b,_n,Bt?.targetColumn]),mr=f.useRef(),Jr=f.useRef(),Ei=f.useCallback((w,A)=>{const[L,W]=A;return ir(Ze,tt[L]?.themeOverride,cr?.(W),w.themeOverride)},[cr,tt,Ze]),{mapper:Pr}=Q0(yt,v),Vn=yt?.navigationBehavior,Ii=f.useCallback(w=>{const A=aa.value?w.metaKey:w.ctrlKey,L=A&&me==="multi",W=A&&ne==="multi",[q,j]=w.location,V=K.columns,B=K.rows,[Z,le]=K.current?.cell??[];if(w.kind==="cell"){if(Jr.current=void 0,_r.current=[q,j],q===0&&_n){if(Lt===!0&&j===_e||Sn==="number"||me==="none")return;const pe=En(w.location);if(pe.kind!==Hn.Marker)return;if(St!==void 0){const Xe=en(pe);Dn(Xe?.kind===Hn.Marker);const Ke=Xe?.onClick?.({...w,cell:pe,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,theme:Ei(pe,w.location),preventDefault:()=>{}});if(Ke===void 0||Ke.checked===pe.checked)return}o(void 0),pn();const wt=B.hasIndex(j),rt=mr.current;if(me==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&rt!==void 0&&B.hasIndex(rt)){const Xe=[Math.min(rt,j),Math.max(rt,j)+1];L||Be==="multi"?Tt(void 0,Xe,!0):Tt(it.fromSingleSelection(Xe),void 0,L)}else me==="multi"&&(L||w.isTouch||Be==="multi")?wt?Tt(B.remove(j),void 0,!0):(Tt(void 0,j,!0),mr.current=j):wt&&B.length===1?Tt(it.empty(),void 0,A):(Tt(it.fromSingleSelection(j),void 0,A),mr.current=j)}else if(q>=U&&Lt&&j===_e){const pe=Zr(q);gr(pe??q)}else if(Z!==q||le!==j){const pe=En(w.location),wt=en(pe);if(wt?.onSelect!==void 0){let Ke=!1;if(wt.onSelect({...w,cell:pe,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,preventDefault:()=>Ke=!0,theme:Ei(pe,w.location)}),Ke)return}if(Vn==="block"&&Pr(j).isGroupHeader)return;const rt=tr&&j===_e,Xe=tr&&K!==void 0&&K.current?.cell[1]===_e;if((w.shiftKey||w.isLongTouch===!0)&&Z!==void 0&&le!==void 0&&K.current!==void 0&&!Xe){if(rt)return;const Ke=Math.min(q,Z),ht=Math.max(q,Z),xt=Math.min(j,le),pt=Math.max(j,le);dt({...K.current,range:{x:Ke,y:xt,width:ht-Ke+1,height:pt-xt+1}},!0,A,"click"),mr.current=void 0,pn()}else dt({cell:[q,j],range:{x:q,y:j,width:1,height:1}},!0,A,"click"),mr.current=void 0,o(void 0),pn()}}else if(w.kind==="header")if(_r.current=[q,j],o(void 0),_n&&q===0)mr.current=void 0,Jr.current=void 0,!Ir&&me==="multi"&&(B.length!==_e?Tt(it.fromSingleSelection([0,_e]),void 0,A):Tt(it.empty(),void 0,A),pn());else{const pe=Jr.current;if(ne==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&pe!==void 0&&V.hasIndex(pe)){const wt=[Math.min(pe,q),Math.max(pe,q)+1];W?et(void 0,wt,A):et(it.fromSingleSelection(wt),void 0,A)}else W?(V.hasIndex(q)?et(V.remove(q),void 0,A):et(void 0,q,A),Jr.current=q):ne!=="none"&&(V.hasIndex(q)?et(V.remove(q),void 0,A):et(it.fromSingleSelection(q),void 0,A),Jr.current=q);mr.current=void 0,pn()}else w.kind===An?_r.current=[q,j]:w.kind===sa&&!w.isMaybeScrollbar&&(ae($o,!1),o(void 0),pn(),Mt?.(),mr.current=void 0,Jr.current=void 0)},[me,ne,K,_n,U,Lt,_e,Sn,En,St,pn,Be,en,Ei,Tt,Zr,gr,Vn,Pr,tr,dt,et,ae,Mt]),Ti=f.useRef(!1),_r=f.useRef(),Sl=f.useRef(Dr),Yn=f.useRef(),Ff=f.useCallback(w=>{if(Qr.current=!1,Sl.current=sn.current,w.button!==0&&w.button!==1){Yn.current=void 0;return}const A=performance.now();Yn.current={button:w.button,time:A,location:w.location},w?.kind==="header"&&(Ti.current=!0);const L=w.kind==="cell"&&w.isFillHandle;!L&&w.kind!=="cell"&&w.isEdge||(u({previousSelection:K,fillHandle:L}),_r.current=void 0,!w.isTouch&&w.button===0&&!L?Ii(w):!w.isTouch&&w.button===1&&(_r.current=w.location))},[K,Ii]),[La,Aa]=f.useState(),xl=f.useCallback(w=>{if(w.kind!==An||ne!=="multi")return;const A=aa.value?w.metaKey:w.ctrlKey,[L]=w.location,W=K.columns;if(L<U)return;const q=tt[L];let j=L,V=L;for(let B=L-1;B>=U&&no(q.group,tt[B].group);B--)j--;for(let B=L+1;B<tt.length&&no(q.group,tt[B].group);B++)V++;if(pn(),A)if(W.hasAll([j,V+1])){let B=W;for(let Z=j;Z<=V;Z++)B=B.remove(Z);et(B,void 0,A)}else et(void 0,[j,V+1],A);else et(it.fromSingleSelection([j,V+1]),void 0,A)},[ne,pn,K.columns,tt,U,et]),Qr=f.useRef(!1),Ro=f.useCallback(async w=>{if(z!==void 0&&ve!==void 0){const A=sn.current.y,L=sn.current.height;let W=z({x:w,y:A,width:1,height:Math.min(L,_e-A)},xn.current.signal);typeof W!="object"&&(W=await W());const q=an[w-U],V=document.createElement("canvas").getContext("2d",{alpha:!1});if(V!==null){V.font=Ze.baseFontFull;const B=Sd(V,Ze,q,0,W,er,jr,!1,en);ve?.(q,B.width,w,B.width)}}},[an,z,jr,Ze,er,ve,U,_e,en]),[Lf,Ha]=f.useState(),ei=f.useCallback(async(w,A)=>{const L=w.current?.range;if(L===void 0||z===void 0||A.current===void 0)return;const W=A.current.range;if(M!==void 0){let B=!1;if(M({fillDestination:{...W,x:W.x-U},patternSource:{...L,x:L.x-U},preventDefault:()=>B=!0}),B)return}let q=z(L,xn.current.signal);typeof q!="object"&&(q=await q());const j=q,V=[];for(let B=0;B<W.width;B++)for(let Z=0;Z<W.height;Z++){const le=[W.x+B,W.y+Z];if(dd(le,L))continue;const pe=j[Z%L.height][B%L.width];di(pe)||!ui(pe)||V.push({location:le,value:{...pe}})}Fn(V),fn.current?.damage(V.map(B=>({cell:B.location})))},[z,Fn,M,U]),kl=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}}};ei(w,K)},[ei,K]),Ml=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}}};ei(w,K)},[ei,K]),Af=f.useCallback((w,A)=>{const L=l;if(u(void 0),Da(void 0),Ha(void 0),Ti.current=!1,A)return;if(L?.fillHandle===!0&&K.current!==void 0&&L.previousSelection?.current!==void 0){if(Or===void 0)return;const pe={...K,current:{...K.current,range:Ed(L.previousSelection.current.range,Or)}};ei(L.previousSelection,pe),ae(pe,!0);return}const[W,q]=w.location,[j,V]=_r.current??[],B=()=>{Qr.current=!0},Z=pe=>{const wt=pe.isTouch||j===W&&V===q;if(wt&&O?.([W-U,q],{...pe,preventDefault:B}),pe.button===1)return!Qr.current;if(!Qr.current){const rt=En(w.location),Xe=en(rt);if(Xe!==void 0&&Xe.onClick!==void 0&&wt){const ht=Xe.onClick({...pe,cell:rt,posX:pe.localEventX,posY:pe.localEventY,bounds:pe.bounds,theme:Ei(rt,w.location),preventDefault:B});ht!==void 0&&!di(ht)&&li(ht)&&(Fn([{location:pe.location,value:ht}]),fn.current?.damage([{cell:pe.location}]))}if(Qr.current||K.current===void 0)return!1;let Ke=!1;switch(rt.activationBehaviorOverride??we){case"double-click":case"second-click":{if(L?.previousSelection?.current?.cell===void 0)break;const[ht,xt]=K.current.cell,[pt,ni]=L.previousSelection.current.cell;Ke=W===ht&&W===pt&&q===xt&&q===ni&&(pe.isDoubleClick===!0||we==="second-click");break}case"single-click":{Ke=!0;break}}if(Ke)return R?.([W-U,q]),Kr(pe.bounds,!1),!0}return!1},le=w.location[0]-U;if(w.isTouch){const pe=sn.current,wt=Sl.current;if(pe.x!==wt.x||pe.y!==wt.y)return;if(w.isLongTouch===!0){if(w.kind==="cell"&&Zi(K.current?.cell,w.location)){G?.([le,w.location[1]],{...w,preventDefault:B});return}else if(w.kind==="header"&&K.columns.hasIndex(W)){ie?.(le,{...w,preventDefault:B});return}else if(w.kind===An){if(le<0)return;Q?.(le,{...w,preventDefault:B});return}}w.kind==="cell"?Z(w)||Ii(w):w.kind===An?$?.(le,{...w,preventDefault:B}):(w.kind===yr&&C?.(le,{...w,preventDefault:B}),Ii(w));return}if(w.kind==="header"){if(le<0)return;w.isEdge?w.isDoubleClick===!0&&Ro(W):w.button===0&&W===j&&q===V&&C?.(le,{...w,preventDefault:B})}if(w.kind===An){if(le<0)return;w.button===0&&W===j&&q===V&&($?.(le,{...w,preventDefault:B}),Qr.current||xl(w))}w.kind==="cell"&&(w.button===0||w.button===1)&&Z(w),_r.current=void 0},[l,K,U,Or,ei,ae,O,En,en,we,Ei,Fn,R,Kr,G,ie,Q,Ii,$,C,Ro,xl]),Hf=f.useCallback(w=>{const A={...w,location:[w.location[0]-U,w.location[1]]};st?.(A),l!==void 0&&w.buttons===0&&(u(void 0),Da(void 0),Ha(void 0),Ti.current=!1),Ha(L=>Ti.current?[w.scrollEdge[0],0]:w.scrollEdge[0]===L?.[0]&&w.scrollEdge[1]===L[1]?L:l===void 0||(Yn.current?.location[0]??0)<U?void 0:w.scrollEdge)},[l,st,U]),zf=f.useCallback((w,A)=>{mt?.(w-U,A)},[mt,U]),Vf=f.useCallback((w,A)=>{ft?.(w-U,A)},[ft,U]),ti=K?.current?.cell,Nf=f.useCallback((w,A,L,W,q,j)=>{Gn.current=!1;let V=ti;V!==void 0&&(V=[V[0]-U,V[1]]);const B=He===0?void 0:{x:0,y:w.y,width:He,height:w.height},Z=[];B!==void 0&&Z.push(B),De>0&&(Z.push({x:w.x-U,y:_e-De,width:w.width,height:De}),He>0&&Z.push({x:0,y:_e-De,width:He,height:De}));const le={x:w.x-U,y:w.y,width:w.width,height:Lt&&w.y+w.height>=_e?w.height-1:w.height,tx:q,ty:j,extras:{selected:V,freezeRegion:B,freezeRegions:Z}};sn.current=le,vl(le),Wt([A,L,W]),qt?.(le,le.tx,le.ty,le.extras)},[ti,U,Lt,_e,He,De,vl,qt]),$f=wr(I,f.useCallback((w,A)=>I?.(w-U,A-U)!==!1,[I,U])),Bf=wr(Ie,f.useCallback((w,A)=>{Ie?.(w-U,A-U),ne!=="none"&&et(it.fromSingleSelection(A),void 0,!0)},[ne,Ie,U,et])),za=f.useRef(!1),Wf=f.useCallback(w=>{if(w.location[0]===0&&U>0){w.preventDefault();return}Te?.({...w,location:[w.location[0]-U,w.location[1]]}),w.defaultPrevented()||(za.current=!0),u(void 0)},[Te,U]),Uf=f.useCallback(()=>{za.current=!1},[]),Rl=yt?.selectionBehavior,Eo=f.useCallback(w=>{if(Rl!=="block-spanning")return;const{isGroupHeader:A,path:L,groupRows:W}=Pr(w);if(A)return[w,w];const q=L[L.length-1],j=w-q,V=w+W-q-1;return[j,V]},[Pr,Rl]),Va=f.useRef(),Na=f.useCallback(w=>{if(!_d(w,Va.current)&&(Va.current=w,!(Yn?.current?.button!==void 0&&Yn.current.button>=1))){if(w.buttons!==0&&l!==void 0&&Yn.current?.location[0]===0&&w.location[0]===0&&U===1&&me==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(Yn.current.location[1])&&K.rows.hasIndex(Yn.current.location[1])){const A=Math.min(Yn.current.location[1],w.location[1]),L=Math.max(Yn.current.location[1],w.location[1])+1;Tt(it.fromSingleSelection([A,L]),void 0,!1)}if(w.buttons!==0&&l!==void 0&&K.current!==void 0&&!za.current&&!Ti.current&&($e==="rect"||$e==="multi-rect")){const[A,L]=K.current.cell;let[W,q]=w.location;if(q<0&&(q=sn.current.y),l.fillHandle===!0&&l.previousSelection?.current!==void 0){const j=l.previousSelection.current.range;q=Math.min(q,Lt?_e-1:_e);const V=Vp(j,W,q,It);Da(V)}else{if(Lt&&L===_e)return;if(Lt&&q===_e)if(w.kind===sa)q--;else return;W=Math.max(W,U);const B=Eo(L);q=B===void 0?q:Ln(q,B[0],B[1]);const Z=W-A,le=q-L,pe={x:Z>=0?A:W,y:le>=0?L:q,width:Math.abs(Z)+1,height:Math.abs(le)+1};dt({...K.current,range:pe},!0,!1,"drag")}}Ht?.({...w,location:[w.location[0]-U,w.location[1]]})}},[l,U,me,K,$e,Ht,Tt,Lt,_e,It,Eo,dt]),qf=f.useCallback(()=>{const w=Va.current;if(w===void 0)return;const[A,L]=w.scrollEdge;let[W,q]=w.location;const j=sn.current;A===-1?W=j.extras?.freezeRegion?.x??j.x:A===1&&(W=j.x+j.width),L===-1?q=Math.max(0,j.y):L===1&&(q=Math.min(_e-1,j.y+j.height)),W=Ln(W,0,tt.length-1),q=Ln(q,0,_e-1),Na({...w,location:[W,q]})},[tt.length,Na,_e]);j0(Lf,Ut,qf);const Nn=f.useCallback(w=>{if(K.current===void 0)return;const[A,L]=w,[W,q]=K.current.cell,j=K.current.range;let V=j.x,B=j.x+j.width,Z=j.y,le=j.y+j.height;const[pe,wt]=Eo(q)??[0,_e-1],rt=wt+1;if(L!==0)switch(L){case 2:{le=rt,Z=q,Gt(0,le,"vertical");break}case-2:{Z=pe,le=q+1,Gt(0,Z,"vertical");break}case 1:{Z<q?(Z++,Gt(0,Z,"vertical")):(le=Math.min(rt,le+1),Gt(0,le,"vertical"));break}case-1:{le>q+1?(le--,Gt(0,le,"vertical")):(Z=Math.max(pe,Z-1),Gt(0,Z,"vertical"));break}default:to()}if(A!==0)if(A===2)B=tt.length,V=W,Gt(B-1-U,0,"horizontal");else if(A===-2)V=U,B=W+1,Gt(V-U,0,"horizontal");else{let Xe=[];if(z!==void 0){const Ke=z({x:V,y:Z,width:B-V-U,height:le-Z},xn.current.signal);typeof Ke=="object"&&(Xe=iv(Ke))}if(A===1){let Ke=!1;if(V<W){if(Xe.length>0){const ht=Sr(V+1,W+1).find(xt=>!Xe.includes(xt-U));ht!==void 0&&(V=ht,Ke=!0)}else V++,Ke=!0;Ke&&Gt(V,0,"horizontal")}Ke||(B=Math.min(tt.length,B+1),Gt(B-1-U,0,"horizontal"))}else if(A===-1){let Ke=!1;if(B>W+1){if(Xe.length>0){const ht=Sr(B-1,W,-1).find(xt=>!Xe.includes(xt-U));ht!==void 0&&(B=ht,Ke=!0)}else B--,Ke=!0;Ke&&Gt(B-U,0,"horizontal")}Ke||(V=Math.max(U,V-1),Gt(V-U,0,"horizontal"))}else to()}dt({cell:K.current.cell,range:{x:V,y:Z,width:B-V,height:le-Z}},!0,!1,"keyboard-select")},[z,Eo,K,tt.length,U,_e,Gt,dt]),$a=f.useRef(wi);$a.current=wi;const pr=f.useCallback((w,A,L,W)=>{const q=hn-(L?0:1);w=Ln(w,U,an.length-1+U),A=Ln(A,0,q);const j=ti?.[0],V=ti?.[1];if(w===j&&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),ae({...K,current:{cell:[w,A],range:{x:w,y:A,width:1,height:1},rangeStack:B}},!0)}else dt({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),$a.current&&Gt(w-U,A),!0},[hn,U,an.length,ti,K,Gt,ae,dt]),Gf=f.useCallback((w,A)=>{i?.cell!==void 0&&w!==void 0&&li(w)&&(Fn([{location:i.cell,value:w}]),window.requestAnimationFrame(()=>{fn.current?.damage([{cell:i.cell}])})),pn(!0),o(void 0);const[L,W]=A;if(K.current!==void 0&&(L!==0||W!==0)){const q=K.current.cell[1]===hn-1&&w!==void 0,j=K.current.cell[0]===tt.length-1&&w!==void 0;let V=!0;if(q&&W===1&&Se!==void 0){V=!1;const B=K.current.cell[0]+L,Z=Zr(B);gr(Z??B,!1)}if(j&&L===1&&Je!==void 0){V=!1;const B=K.current.cell[1]+W;Mo(B,!1)}V&&pr(Ln(K.current.cell[0]+L,0,tt.length-1),Ln(K.current.cell[1]+W,0,hn-1),q,!1)}_?.(w,A)},[i?.cell,pn,K,_,Fn,hn,pr,tt.length,gr,Mo,Se,Je,Zr]),Yf=f.useMemo(()=>`gdg-overlay-${rv++}`,[]),Fr=f.useCallback(w=>{pn();const A=[];for(let L=w.x;L<w.x+w.width;L++)for(let W=w.y;W<w.y+w.height;W++){const q=S([L-U,W]);if(!q.allowOverlay&&q.kind!==J.Boolean)continue;let j;if(q.kind===J.Custom){const V=en(q),B=V?.provideEditor?.({...q,location:[L-U,W]});V?.onDelete!==void 0?j=V.onDelete(q):Og(B)&&(j=B?.deletedValue?.(q))}else(li(q)&&q.allowOverlay||q.kind===J.Boolean)&&(j=en(q)?.onDelete?.(q));j!==void 0&&!di(j)&&li(j)&&A.push({location:[L,W],value:j})}Fn(A),fn.current?.damage(A.map(L=>({cell:L.location})))},[pn,S,en,Fn,U]),Di=i!==void 0,El=f.useCallback(w=>{const A=()=>{w.stopPropagation(),w.preventDefault()},L={didMatch:!1},{bounds:W}=w,q=K.columns,j=K.rows,V=qn;if(!Di&&ot(V.clear,w,L))ae($o,!1),Mt?.();else if(!Di&&ot(V.selectAll,w,L))ae({columns:it.empty(),rows:it.empty(),current:{cell:K.current?.cell??[U,0],range:{x:U,y:0,width:b.length,height:_e},rangeStack:[]}},!1);else if(ot(V.search,w,L))s?.current?.focus({preventScroll:!0}),wo(!0);else if(ot(V.delete,w,L)){const ht=Zt?.(K)??!0;if(ht!==!1){const xt=ht===!0?K:ht;if(xt.current!==void 0){Fr(xt.current.range);for(const pt of xt.current.rangeStack)Fr(pt)}for(const pt of xt.rows)Fr({x:U,y:pt,width:b.length,height:1});for(const pt of xt.columns)Fr({x:pt,y:0,width:1,height:_e})}}if(L.didMatch)return A(),!0;if(K.current===void 0)return!1;let[B,Z]=K.current.cell;const[,le]=K.current.cell;let pe=!1,wt=!1;if(ot(V.scrollToSelectedCell,w,L)?Do.current(B-U,Z):ne!=="none"&&ot(V.selectColumn,w,L)?q.hasIndex(B)?et(q.remove(B),void 0,!0):ne==="single"?et(it.fromSingleSelection(B),void 0,!0):et(void 0,B,!0):me!=="none"&&ot(V.selectRow,w,L)?j.hasIndex(Z)?Tt(j.remove(Z),void 0,!0):me==="single"?Tt(it.fromSingleSelection(Z),void 0,!0):Tt(void 0,Z,!0):!Di&&W!==void 0&&ot(V.activateCell,w,L)?Z===_e&&Lt?window.setTimeout(()=>{const ht=Zr(B);gr(ht??B)},0):(R?.([B-U,Z]),Kr(W,!0)):K.current.range.height>1&&ot(V.downFill,w,L)?Ml():K.current.range.width>1&&ot(V.rightFill,w,L)?kl():ot(V.goToNextPage,w,L)?Z+=Math.max(1,sn.current.height-4):ot(V.goToPreviousPage,w,L)?Z-=Math.max(1,sn.current.height-4):ot(V.goToFirstCell,w,L)?(o(void 0),Z=0,B=0):ot(V.goToLastCell,w,L)?(o(void 0),Z=Number.MAX_SAFE_INTEGER,B=Number.MAX_SAFE_INTEGER):ot(V.selectToFirstCell,w,L)?(o(void 0),Nn([-2,-2])):ot(V.selectToLastCell,w,L)?(o(void 0),Nn([2,2])):Di?(ot(V.closeOverlay,w,L)&&o(void 0),ot(V.acceptOverlayDown,w,L)&&(o(void 0),Z++),ot(V.acceptOverlayUp,w,L)&&(o(void 0),Z--),ot(V.acceptOverlayLeft,w,L)&&(o(void 0),B--),ot(V.acceptOverlayRight,w,L)&&(o(void 0),B++)):(ot(V.goDownCell,w,L)?Z+=1:ot(V.goUpCell,w,L)?Z-=1:ot(V.goRightCell,w,L)?B+=1:ot(V.goLeftCell,w,L)?B-=1:ot(V.goDownCellRetainSelection,w,L)?(Z+=1,pe=!0):ot(V.goUpCellRetainSelection,w,L)?(Z-=1,pe=!0):ot(V.goRightCellRetainSelection,w,L)?(B+=1,pe=!0):ot(V.goLeftCellRetainSelection,w,L)?(B-=1,pe=!0):ot(V.goToLastRow,w,L)?Z=_e-1:ot(V.goToFirstRow,w,L)?Z=Number.MIN_SAFE_INTEGER:ot(V.goToLastColumn,w,L)?B=Number.MAX_SAFE_INTEGER:ot(V.goToFirstColumn,w,L)?B=Number.MIN_SAFE_INTEGER:($e==="rect"||$e==="multi-rect")&&(ot(V.selectGrowDown,w,L)?Nn([0,1]):ot(V.selectGrowUp,w,L)?Nn([0,-1]):ot(V.selectGrowRight,w,L)?Nn([1,0]):ot(V.selectGrowLeft,w,L)?Nn([-1,0]):ot(V.selectToLastRow,w,L)?Nn([0,2]):ot(V.selectToFirstRow,w,L)?Nn([0,-2]):ot(V.selectToLastColumn,w,L)?Nn([2,0]):ot(V.selectToFirstColumn,w,L)&&Nn([-2,0])),wt=L.didMatch),Vn!==void 0&&Vn!=="normal"&&Z!==le){const ht=Vn==="skip-up"||Vn==="skip"||Vn==="block",xt=Vn==="skip-down"||Vn==="skip"||Vn==="block",pt=Z<le;if(pt&&ht){for(;Z>=0&&Pr(Z).isGroupHeader;)Z--;Z<0&&(Z=le)}else if(!pt&&xt){for(;Z<_e&&Pr(Z).isGroupHeader;)Z++;Z>=_e&&(Z=le)}}const Xe=pr(B,Z,!1,pe),Ke=L.didMatch;return Ke&&(Xe||!wt||$t)&&A(),Ke},[Vn,Di,K,qn,ne,me,$e,U,Pr,_e,pr,ae,Mt,b.length,Zt,$t,Fr,et,Tt,Lt,Zr,gr,R,Kr,Ml,kl,Nn]),Oi=f.useCallback(w=>{let A=!1;if(Y!==void 0&&Y({...w,...w.location&&{location:[w.location[0]-U,w.location[1]]},cancel:()=>{A=!0}}),A||El(w)||K.current===void 0)return;const[L,W]=K.current.cell,q=sn.current;if(ke&&!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&&ui(S([L-U,Math.max(0,Math.min(W,_e-1))]))){if((!Lt||W!==_e)&&(q.y>W||W>q.y+q.height||q.x>L||L>q.x+q.width))return;R?.([L-U,W]),Kr(w.bounds,!0,w.key),w.stopPropagation(),w.preventDefault()}},[ke,Y,El,K,S,U,_e,Lt,R,Kr]),jf=f.useCallback((w,A)=>{const L=w.location[0]-U;if(w.kind==="header"&&ie?.(L,{...w,preventDefault:A}),w.kind===An){if(L<0)return;Q?.(L,{...w,preventDefault:A})}if(w.kind==="cell"){const[W,q]=w.location;G?.([L,q],{...w,preventDefault:A}),Fm(K,w.location)||pr(W,q,!1,!1)}},[K,G,Q,ie,U,pr]),Ba=f.useCallback(async w=>{if(!qn.paste)return;function A(V,B,Z,le){const pe=typeof Z=="object"?Z?.join(`
172
+ `&&(n.push(r),r=[])),o=t.None);break}s++}return i<e.length&&r.push(Pu(e.slice(i,e.length))),n.push(r),n.map(a=>a.map(l=>({rawValue:l,formatted:l,format:"string"})))}function _u(e,t,n){const r=V0(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 Ld(e){return e!==!0}function Fu(e){return typeof e=="string"?e:`${e}px`}const B0=()=>e=>e.innerWidth,W0=()=>e=>e.innerHeight,U0=un("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[B0()],"wmyidgi-1":[W0()]}}),q0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return f.createElement(U0,{innerHeight:Fu(n),innerWidth:Fu(t),...i},r)},G0=2,Y0=1300;function j0(e,t,n){const r=Vt.useRef(0),[i,o]=e??[0,0];Vt.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/Y0);const d=r.current**1.618*c*G0;t.current?.scrollBy(i*d,o*d),a=u,n?.()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{s=!0}},[t,i,o,n])}function X0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:s,remSize:a}){const[l,u,c,d,g,h]=Vt.useMemo(()=>{if(!s||a===16)return[e,t,n,r,i,o];const m=a/16,p=e,y=yd();return[typeof p=="number"?p*m:b=>Math.ceil(p(b)*m),Math.ceil(t*m),Math.ceil(n*m),{...r,headerIconSize:(r?.headerIconSize??y.headerIconSize)*m,cellHorizontalPadding:(r?.cellHorizontalPadding??y.cellHorizontalPadding)*m,cellVerticalPadding:(r?.cellVerticalPadding??y.cellVerticalPadding)*m},Math.ceil((i??0)*m),Math.ceil((o??0)*m)]},[n,t,i,o,a,e,s,r]);return{rowHeight:l,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:g,overscrollY:h}}const br={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 at(e,t){return e===!0?t:e===!1?"":e}function Lu(e){const t=aa.value;return{activateCell:at(e.activateCell," |Enter|shift+Enter"),clear:at(e.clear,"any+Escape"),closeOverlay:at(e.closeOverlay,"any+Escape"),acceptOverlayDown:at(e.acceptOverlayDown,"Enter"),acceptOverlayUp:at(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:at(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:at(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:at(e.delete,t?"Backspace|Delete":"Delete"),downFill:at(e.downFill,"primary+_68"),scrollToSelectedCell:at(e.scrollToSelectedCell,"primary+Enter"),goDownCell:at(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:at(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:at(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:at(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:at(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:at(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:at(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:at(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:at(e.goToFirstCell,"primary+Home"),goToFirstColumn:at(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:at(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:at(e.goToLastCell,"primary+End"),goToLastColumn:at(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:at(e.goToLastRow,"primary+ArrowDown"),goToNextPage:at(e.goToNextPage,"PageDown"),goToPreviousPage:at(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:at(e.rightFill,"primary+_82"),search:at(e.search,"primary+f"),selectAll:at(e.selectAll,"primary+a"),selectColumn:at(e.selectColumn,"ctrl+ "),selectGrowDown:at(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:at(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:at(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:at(e.selectGrowUp,"shift+ArrowUp"),selectRow:at(e.selectRow,"shift+ "),selectToFirstCell:at(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:at(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:at(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:at(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:at(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:at(e.selectToLastRow,"primary+shift+ArrowDown")}}function K0(e){const t=rm(e);return Vt.useMemo(()=>{if(t===void 0)return Lu(br);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??br.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??br.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??br.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??br.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??br.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??br.selectToLastCell};return Lu({...br,...n})},[t])}function Z0(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 Qs(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=Z0(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 Ts(e,t){if(t===void 0||Qs.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 J0(e,t,n,r){const i=Vt.useMemo(()=>e===void 0?void 0:Qs(e,t),[e,t]),o=Vt.useMemo(()=>i?.reduce((c,d)=>(c[d.rowIndex]=d,c),{}),[i]),s=Vt.useMemo(()=>i===void 0?t:i.reduce((c,d)=>c+(d.isCollapsed?1:d.rows+1),0),[i,t]),a=Vt.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=Vt.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=wr(r??e?.themeOverride,Vt.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}=Ts(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 Q0(e,t){const n=Vt.useMemo(()=>e===void 0?void 0:Qs(e,t),[e,t]);return{getRowGroupingForPath:Hd,updateRowGroupingByPath:Ad,mapper:Vt.useCallback(r=>{if(typeof r=="number")return Ts(r,n);const i=Ts(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function Ad(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:Ad(o.subGroups??[],i,n)}:o)}function Hd(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Hd(e[n].subGroups??[],r)}function ev(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 tv(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]=nm(a),d=f.useRef(i);d.current=i;const g=ev(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.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 m=(l.width??1)>1;return f.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&m){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&c(),d.current()}},[e,m,c,g]),{visibleRegion:l,setVisibleRegion:u,scrollRef:g}}const nv=f.lazy(async()=>await As(()=>import("./data-grid-overlay-editor.Cov081px.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url));let rv=0;function iv(e){return ap(Cu(Cu(e).filter(t=>t.span!==void 0).map(t=>Sr((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Vo(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 No={kind:J.Loading,allowOverlay:!1},$o={columns:it.empty(),rows:it.empty(),current:void 0},ov=(e,t)=>{const[n,r]=f.useState($o),[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:m,width:p,height:y,columns:b,rows:v,getCellContent:S,onCellClicked:O,onCellActivated:R,onFillPattern:M,onFinishedEditing:_,coercePasteValue:E,drawHeader:k,drawCell:F,editorBloom:D,onHeaderClicked:C,onColumnProposeMove:I,rangeSelectionColumnSpanning:T=!0,spanRangeBehavior:x="default",onGroupHeaderClicked:$,onCellContextMenu:G,className:X,onHeaderContextMenu:ie,getCellsForSelection:ee,onGroupHeaderContextMenu:Q,onGroupHeaderRenamed:te,onCellEdited:se,onCellsEdited:ue,onSearchResultsChanged:fe,searchResults:re,onSearchValueChange:H,searchValue:P,onKeyDown:Y,onKeyUp:ce,keybindings:he,editOnType:ke=!0,onRowAppended:Se,onColumnAppended:Je,onColumnMoved:Ie,validateCell:Qe,highlightRegions:kt,rangeSelect:$e="rect",columnSelect:ne="multi",rowSelect:me="multi",rangeSelectionBlending:xe="exclusive",columnSelectionBlending:de="exclusive",rowSelectionBlending:be="exclusive",onDelete:Pe,onDragStart:Te,onMouseMove:st,onPaste:Re,copyHeaders:qe=!1,freezeColumns:He=0,cellActivationBehavior:we="second-click",rowSelectionMode:Be="auto",onHeaderMenuClick:mt,onHeaderIndicatorClick:ft,getGroupDetails:Ge,rowGrouping:yt,onSearchClose:Yt,onItemHovered:Ht,onSelectionCleared:Mt,showSearch:nn,onVisibleRegionChanged:qt,gridSelection:cn,onGridSelectionChange:Ot,minColumnWidth:ut=50,maxColumnWidth:tn=500,maxColumnAutoWidth:Ct,provideEditor:rn,trailingRowOptions:Bt,freezeTrailingRows:De=0,allowedFillDirections:It="orthogonal",scrollOffsetX:Pt,scrollOffsetY:wn,verticalBorder:jt,onDragOverCell:dn,onDrop:Mn,onColumnResize:Xt,onColumnResizeEnd:Jt,onColumnResizeStart:We,customRenderers:Rt,fillHandle:yn,experimental:vt,fixedShadowX:Ft,fixedShadowY:Cn,headerIcons:Wn,imageWindowLoader:zn,initialSize:N,isDraggable:Ne,onDragLeave:Ue,onRowMoved:St,overscrollX:mn,overscrollY:ge,preventDiagonalScrolling:bt,rightElement:Qt,rightElementProps:Et,trapFocus:$t=!1,smoothScrollX:on,smoothScrollY:xa,scaleToRem:fo=!1,rowHeight:ka=34,headerHeight:ho=36,groupHeaderHeight:Rr=ho,theme:lr,isOutsideClick:Ma,renderers:bi,resizeIndicator:go,scrollToActiveCell:wi=!0,drawFocusRing:Er=!0,portalElementRef:pl}=e,yi=Er==="no-editor"?i===void 0:Er,Pn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,Sn=Pn?.kind??e.rowMarkers??"none",Ci=Pn?.width??e.rowMarkerWidth,Jn=Pn?.startIndex??e.rowMarkerStartIndex??1,Qn=Pn?.theme??e.rowMarkerTheme,Gr=Pn?.headerTheme,ur=Pn?.headerAlwaysVisible,Ir=me!=="multi"||Pn?.headerDisabled===!0,Yr=Pn?.checkboxStyle??"square",er=Math.max(ut,20),jr=Math.max(tn,er),Ra=Math.max(Ct??jr,er),mo=f.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:_e,rowNumberMapper:Si,rowHeight:po,getRowThemeOverride:cr}=J0(yt,v,ka,h),Ea=f.useMemo(()=>Number.parseFloat(mo.fontSize),[mo]),{rowHeight:Un,headerHeight:xi,groupHeaderHeight:vo,theme:bo,overscrollX:ki,overscrollY:Ia}=X0({groupHeaderHeight:Rr,headerHeight:ho,overscrollX:mn,overscrollY:ge,remSize:Ea,rowHeight:po,scaleToRem:fo,theme:lr}),qn=K0(he),dr=Ci??(v>1e4?48:v>1e3?44:v>100?36:32),_n=Sn!=="none",U=_n?1:0,Lt=Bt!==void 0,tr=Bt?.sticky===!0,[Mi,wo]=f.useState(!1),Xr=nn??Mi,Ta=f.useCallback(()=>{Yt!==void 0?Yt():wo(!1)},[Yt]),K=f.useMemo(()=>cn===void 0?void 0:Vo(cn,U),[cn,U])??n,xn=f.useRef();xn.current===void 0&&(xn.current=new AbortController),f.useEffect(()=>()=>xn?.current.abort(),[]);const[z,oe]=_0(ee,S,U,xn.current,_e),Me=f.useCallback((w,A,L)=>{if(Qe===void 0)return!0;const W=[w[0]-U,w[1]];return Qe?.(W,A,L)},[U,Qe]),Ee=f.useRef(cn),ae=f.useCallback((w,A)=>{A&&(w=N0(w,z,U,x,xn.current)),Ot!==void 0?(Ee.current=Vo(w,-U),Ot(Ee.current)):r(w)},[Ot,z,U,x]),ve=wr(Xt,f.useCallback((w,A,L,W)=>{Xt?.(b[L-U],A,L-U,W)},[Xt,U,b])),Ye=wr(Jt,f.useCallback((w,A,L,W)=>{Jt?.(b[L-U],A,L-U,W)},[Jt,U,b])),ye=wr(We,f.useCallback((w,A,L,W)=>{We?.(b[L-U],A,L-U,W)},[We,U,b])),je=wr(k,f.useCallback((w,A)=>k?.({...w,columnIndex:w.columnIndex-U},A)??!1,[k,U])),ct=wr(F,f.useCallback((w,A)=>F?.({...w,col:w.col-U},A)??!1,[F,U])),Zt=f.useCallback(w=>{if(Pe!==void 0){const A=Pe(Vo(w,-U));return typeof A=="boolean"?A:Vo(A,U)}return!0},[Pe,U]),[dt,Tt,et]=P0(K,ae,xe,de,be,$e,T),Ze=f.useMemo(()=>ir(yd(),bo),[bo]),[zt,Wt]=f.useState([0,0,0]),Tr=f.useMemo(()=>{if(bi===void 0)return{};const w={};for(const A of bi)w[A.kind]=A;return w},[bi]),en=f.useCallback(w=>w.kind!==J.Custom?Tr[w.kind]:Rt?.find(A=>A.isMatch(w)),[Rt,Tr]);let{sizedColumns:an,nonGrowWidth:fr}=Zm(b,_e,oe,zt[0]-(U===0?0:dr)-zt[2],er,Ra,Ze,en,xn.current);Sn!=="none"&&(fr+=dr);const _t=f.useMemo(()=>an.some(w=>w.group!==void 0),[an]),kn=_t?xi+vo:xi,Rn=K.rows.length,hr=Sn==="none"?void 0:Rn===0?!1:Rn===_e?!0:void 0,tt=f.useMemo(()=>Sn==="none"?an:[{title:"",width:dr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:Qn,rowMarker:Yr,rowMarkerChecked:hr,headerRowMarkerTheme:Gr,headerRowMarkerAlwaysVisible:ur,headerRowMarkerDisabled:Ir},...an],[Sn,an,dr,Qn,Yr,hr,Gr,ur,Ir]),sn=f.useRef({height:1,width:1,x:0,y:0}),Gn=f.useRef(!1),{setVisibleRegion:vl,visibleRegion:Dr,scrollRef:Ut}=tv(Pt,wn,Un,sn,()=>Gn.current=!0);sn.current=Dr;const Pf=Dr.x+U,yo=Dr.y,fn=f.useRef(null),pn=f.useCallback(w=>{w===!0?fn.current?.focus():window.requestAnimationFrame(()=>{fn.current?.focus()})},[]),hn=Lt?_e+1:_e,Fn=f.useCallback(w=>{const A=U===0?w:w.map(W=>({...W,location:[W.location[0]-U,W.location[1]]})),L=ue?.(A);if(L!==!0)for(const W of A)se?.(W.location,W.value);return L},[se,ue,U]),[Or,Da]=f.useState(),Co=K.current!==void 0&&K.current.range.width*K.current.range.height>1?K.current.range:void 0,bl=yi?K.current?.cell:void 0,So=bl?.[0],xo=bl?.[1],_f=f.useMemo(()=>{if((kt===void 0||kt.length===0)&&(Co??So??xo??Or)===void 0)return;const w=[];if(kt!==void 0)for(const A of kt){const L=tt.length-A.range.x-U;L>0&&w.push({color:A.color,range:{...A.range,x:A.range.x+U,width:Math.min(L,A.range.width)},style:A.style})}return Or!==void 0&&w.push({color:Nr(Ze.accentColor,0),range:Or,style:"dashed"}),Co!==void 0&&w.push({color:Nr(Ze.accentColor,.5),range:Co,style:"solid-outline"}),So!==void 0&&xo!==void 0&&w.push({color:Ze.accentColor,range:{x:So,y:xo,width:1,height:1},style:"solid-outline"}),w.length>0?w:void 0},[Or,Co,So,xo,kt,tt.length,Ze.accentColor,U]),wl=f.useRef(tt);wl.current=tt;const En=f.useCallback(([w,A],L=!1)=>{const W=Lt&&A===hn-1;if(w===0&&_n){if(W)return No;const j=Si(A);return j===void 0?No:{kind:Hn.Marker,allowOverlay:!1,checkboxStyle:Yr,checked:K?.rows.hasIndex(A)===!0,markerKind:Sn==="clickable-number"?"number":Sn,row:Jn+j,drawHandle:St!==void 0,cursor:Sn==="clickable-number"?"pointer":void 0}}else if(W){const V=w===U?Bt?.hint??"":"",B=wl.current[w];if(B?.trailingRowOptions?.disabled===!0)return No;{const Z=B?.trailingRowOptions?.hint??V,le=B?.trailingRowOptions?.addIcon??Bt?.addIcon;return{kind:Hn.NewRow,hint:Z,allowOverlay:!1,icon:le}}}else{const j=w-U;if(L||vt?.strict===!0){const B=sn.current,Z=B.x>j||j>B.x+B.width||B.y>A||A>B.y+B.height||A>=Fa.current,le=j===B.extras?.selected?.[0]&&A===B.extras?.selected[1];let pe=!1;if(B.extras?.freezeRegions!==void 0){for(const wt of B.extras.freezeRegions)if(Vr(wt,j,A)){pe=!0;break}}if(Z&&!le&&!pe)return No}let V=S([j,A]);return U!==0&&V.span!==void 0&&(V={...V,span:[V.span[0]+U,V.span[1]+U]}),V}},[Lt,hn,_n,Si,Yr,K?.rows,Sn,Jn,St,U,Bt?.hint,Bt?.addIcon,vt?.strict,S]),Oa=f.useCallback(w=>{let A=Ge?.(w)??{name:w};return te!==void 0&&w!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:L=>Aa({group:A.name,bounds:L.bounds})}]}),A},[Ge,te]),ko=f.useCallback(w=>{const[A,L]=w.cell,W=tt[A],q=W?.group!==void 0?Oa(W.group)?.overrideTheme:void 0,j=W?.themeOverride,V=cr?.(L);o({...w,theme:ir(Ze,q,j,V,w.content.themeOverride)})},[cr,tt,Oa,Ze]),Kr=f.useCallback((w,A,L)=>{if(K.current===void 0)return;const[W,q]=K.current.cell,j=En([W,q]);if(j.kind!==J.Boolean&&j.allowOverlay){let V=j;if(L!==void 0)switch(V.kind){case J.Number:{const B=Dg(()=>L==="-"?-0:Number.parseFloat(L),0);V={...V,data:Number.isNaN(B)?0:B};break}case J.Text:case J.Markdown:case J.Uri:V={...V,data:L};break}ko({target:w,content:V,initialValue:L,cell:[W,q],highlight:L===void 0,forceEditMode:L!==void 0})}else j.kind===J.Boolean&&A&&j.readonly!==!0&&(Fn([{location:K.current.cell,value:{...j,data:Ld(j.data)}}]),fn.current?.damage([{cell:K.current.cell}]))},[En,K,Fn,ko]),yl=f.useCallback((w,A)=>{const L=fn.current?.getBounds(w,A);if(L===void 0||Ut.current===null)return;const W=En([w,A]);W.allowOverlay&&ko({target:L,content:W,initialValue:void 0,highlight:!0,cell:[w,A],forceEditMode:!0})},[En,Ut,ko]),Gt=f.useCallback((w,A,L="both",W=0,q=0,j=void 0)=>{if(Ut.current!==null){const V=fn.current,B=a.current,Z=typeof w!="number"?w.unit==="cell"?w.amount:void 0:w,le=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,pe=typeof w!="number"&&w.unit==="px"?w.amount:void 0,wt=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(V!==null&&B!==null){let rt={x:0,y:0,width:0,height:0},Xe=0,Ke=0;if((Z!==void 0||le!==void 0)&&(rt=V.getBounds((Z??0)+U,le??0)??rt,rt.width===0||rt.height===0))return;const ht=B.getBoundingClientRect(),xt=ht.width/B.offsetWidth;if(pe!==void 0&&(rt={...rt,x:pe-ht.left-Ut.current.scrollLeft,width:1}),wt!==void 0&&(rt={...rt,y:wt+ht.top-Ut.current.scrollTop,height:1}),rt!==void 0){const pt={x:rt.x-W,y:rt.y-q,width:rt.width+2*W,height:rt.height+2*q};let ni=0;for(let Wa=0;Wa<He;Wa++)ni+=an[Wa].width;let _i=0;const Fi=De+(tr?1:0);Fi>0&&(_i=Ur(hn,Fi,Un));let jn=ni*xt+ht.left+U*dr*xt,ri=ht.right,Lr=ht.top+kn*xt,ii=ht.bottom-_i*xt;const Oo=rt.width+W*2;switch(j?.hAlign){case"start":ri=jn+Oo;break;case"end":jn=ri-Oo;break;case"center":jn=Math.floor((jn+ri)/2)-Oo/2,ri=jn+Oo;break}const Po=rt.height+q*2;switch(j?.vAlign){case"start":ii=Lr+Po;break;case"end":Lr=ii-Po;break;case"center":Lr=Math.floor((Lr+ii)/2)-Po/2,ii=Lr+Po;break}jn>pt.x?Xe=pt.x-jn:ri<pt.x+pt.width&&(Xe=pt.x+pt.width-ri),Lr>pt.y?Ke=pt.y-Lr:ii<pt.y+pt.height&&(Ke=pt.y+pt.height-ii),L==="vertical"||typeof w=="number"&&w<He?Xe=0:(L==="horizontal"||typeof A=="number"&&A>=hn-Fi)&&(Ke=0),(Xe!==0||Ke!==0)&&(xt!==1&&(Xe/=xt,Ke/=xt),Ut.current.scrollTo({left:Xe+Ut.current.scrollLeft,top:Ke+Ut.current.scrollTop,behavior:j?.behavior??"auto"}))}}}},[U,De,dr,Ut,kn,He,an,hn,tr,Un]),Pa=f.useRef(yl),_a=f.useRef(S);Pa.current=yl,_a.current=S;const Fa=f.useRef(_e);Fa.current=_e;const Cl=f.useRef(tt.length);Cl.current=tt.length;const gr=f.useCallback(async(w,A=!0,L)=>{if(tt[w]?.trailingRowOptions?.disabled===!0)return;const q=Se?.();let j,V=!0;q!==void 0&&(j=await q,j==="top"&&(V=!1),typeof j=="number"&&(V=!1));let B=0;const Z=()=>{if(Fa.current<=_e){B<500&&window.setTimeout(Z,B),B=50+B*2;return}const le=typeof j=="number"?j:V?_e:0;Do.current(w-U,le,"both",0,0,L?{behavior:L}:void 0),dt({cell:[w,le],range:{x:w,y:le,width:1,height:1}},!1,!1,"edit");const pe=_a.current([w-U,le]);pe.allowOverlay&&ui(pe)&&pe.readonly!==!0&&A&&window.setTimeout(()=>{Pa.current(w,le)},0)};Z()},[tt,Se,U,_e,dt]),Mo=f.useCallback(async(w,A=!0)=>{const L=Je?.();let W,q=!0;L!==void 0&&(W=await L,W==="left"&&(q=!1),typeof W=="number"&&(q=!1));let j=0;const V=()=>{if(Cl.current<=tt.length){j<500&&window.setTimeout(V,j),j=50+j*2;return}const B=typeof W=="number"?W:q?tt.length:0;Gt(B-U,w),dt({cell:[B,w],range:{x:B,y:w,width:1,height:1}},!1,!1,"edit");const Z=_a.current([B-U,w]);Z.allowOverlay&&ui(Z)&&Z.readonly!==!0&&A&&window.setTimeout(()=>{Pa.current(B,w)},0)};V()},[tt,Je,U,Gt,dt]),Zr=f.useCallback(w=>{const A=an[w]?.trailingRowOptions?.targetColumn??Bt?.targetColumn;if(typeof A=="number")return A+(_n?1:0);if(typeof A=="object"){const L=b.indexOf(A);if(L>=0)return L+(_n?1:0)}},[an,b,_n,Bt?.targetColumn]),mr=f.useRef(),Jr=f.useRef(),Ei=f.useCallback((w,A)=>{const[L,W]=A;return ir(Ze,tt[L]?.themeOverride,cr?.(W),w.themeOverride)},[cr,tt,Ze]),{mapper:Pr}=Q0(yt,v),Vn=yt?.navigationBehavior,Ii=f.useCallback(w=>{const A=aa.value?w.metaKey:w.ctrlKey,L=A&&me==="multi",W=A&&ne==="multi",[q,j]=w.location,V=K.columns,B=K.rows,[Z,le]=K.current?.cell??[];if(w.kind==="cell"){if(Jr.current=void 0,_r.current=[q,j],q===0&&_n){if(Lt===!0&&j===_e||Sn==="number"||me==="none")return;const pe=En(w.location);if(pe.kind!==Hn.Marker)return;if(St!==void 0){const Xe=en(pe);Dn(Xe?.kind===Hn.Marker);const Ke=Xe?.onClick?.({...w,cell:pe,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,theme:Ei(pe,w.location),preventDefault:()=>{}});if(Ke===void 0||Ke.checked===pe.checked)return}o(void 0),pn();const wt=B.hasIndex(j),rt=mr.current;if(me==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&rt!==void 0&&B.hasIndex(rt)){const Xe=[Math.min(rt,j),Math.max(rt,j)+1];L||Be==="multi"?Tt(void 0,Xe,!0):Tt(it.fromSingleSelection(Xe),void 0,L)}else me==="multi"&&(L||w.isTouch||Be==="multi")?wt?Tt(B.remove(j),void 0,!0):(Tt(void 0,j,!0),mr.current=j):wt&&B.length===1?Tt(it.empty(),void 0,A):(Tt(it.fromSingleSelection(j),void 0,A),mr.current=j)}else if(q>=U&&Lt&&j===_e){const pe=Zr(q);gr(pe??q)}else if(Z!==q||le!==j){const pe=En(w.location),wt=en(pe);if(wt?.onSelect!==void 0){let Ke=!1;if(wt.onSelect({...w,cell:pe,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,preventDefault:()=>Ke=!0,theme:Ei(pe,w.location)}),Ke)return}if(Vn==="block"&&Pr(j).isGroupHeader)return;const rt=tr&&j===_e,Xe=tr&&K!==void 0&&K.current?.cell[1]===_e;if((w.shiftKey||w.isLongTouch===!0)&&Z!==void 0&&le!==void 0&&K.current!==void 0&&!Xe){if(rt)return;const Ke=Math.min(q,Z),ht=Math.max(q,Z),xt=Math.min(j,le),pt=Math.max(j,le);dt({...K.current,range:{x:Ke,y:xt,width:ht-Ke+1,height:pt-xt+1}},!0,A,"click"),mr.current=void 0,pn()}else dt({cell:[q,j],range:{x:q,y:j,width:1,height:1}},!0,A,"click"),mr.current=void 0,o(void 0),pn()}}else if(w.kind==="header")if(_r.current=[q,j],o(void 0),_n&&q===0)mr.current=void 0,Jr.current=void 0,!Ir&&me==="multi"&&(B.length!==_e?Tt(it.fromSingleSelection([0,_e]),void 0,A):Tt(it.empty(),void 0,A),pn());else{const pe=Jr.current;if(ne==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&pe!==void 0&&V.hasIndex(pe)){const wt=[Math.min(pe,q),Math.max(pe,q)+1];W?et(void 0,wt,A):et(it.fromSingleSelection(wt),void 0,A)}else W?(V.hasIndex(q)?et(V.remove(q),void 0,A):et(void 0,q,A),Jr.current=q):ne!=="none"&&(V.hasIndex(q)?et(V.remove(q),void 0,A):et(it.fromSingleSelection(q),void 0,A),Jr.current=q);mr.current=void 0,pn()}else w.kind===An?_r.current=[q,j]:w.kind===sa&&!w.isMaybeScrollbar&&(ae($o,!1),o(void 0),pn(),Mt?.(),mr.current=void 0,Jr.current=void 0)},[me,ne,K,_n,U,Lt,_e,Sn,En,St,pn,Be,en,Ei,Tt,Zr,gr,Vn,Pr,tr,dt,et,ae,Mt]),Ti=f.useRef(!1),_r=f.useRef(),Sl=f.useRef(Dr),Yn=f.useRef(),Ff=f.useCallback(w=>{if(Qr.current=!1,Sl.current=sn.current,w.button!==0&&w.button!==1){Yn.current=void 0;return}const A=performance.now();Yn.current={button:w.button,time:A,location:w.location},w?.kind==="header"&&(Ti.current=!0);const L=w.kind==="cell"&&w.isFillHandle;!L&&w.kind!=="cell"&&w.isEdge||(u({previousSelection:K,fillHandle:L}),_r.current=void 0,!w.isTouch&&w.button===0&&!L?Ii(w):!w.isTouch&&w.button===1&&(_r.current=w.location))},[K,Ii]),[La,Aa]=f.useState(),xl=f.useCallback(w=>{if(w.kind!==An||ne!=="multi")return;const A=aa.value?w.metaKey:w.ctrlKey,[L]=w.location,W=K.columns;if(L<U)return;const q=tt[L];let j=L,V=L;for(let B=L-1;B>=U&&no(q.group,tt[B].group);B--)j--;for(let B=L+1;B<tt.length&&no(q.group,tt[B].group);B++)V++;if(pn(),A)if(W.hasAll([j,V+1])){let B=W;for(let Z=j;Z<=V;Z++)B=B.remove(Z);et(B,void 0,A)}else et(void 0,[j,V+1],A);else et(it.fromSingleSelection([j,V+1]),void 0,A)},[ne,pn,K.columns,tt,U,et]),Qr=f.useRef(!1),Ro=f.useCallback(async w=>{if(z!==void 0&&ve!==void 0){const A=sn.current.y,L=sn.current.height;let W=z({x:w,y:A,width:1,height:Math.min(L,_e-A)},xn.current.signal);typeof W!="object"&&(W=await W());const q=an[w-U],V=document.createElement("canvas").getContext("2d",{alpha:!1});if(V!==null){V.font=Ze.baseFontFull;const B=Sd(V,Ze,q,0,W,er,jr,!1,en);ve?.(q,B.width,w,B.width)}}},[an,z,jr,Ze,er,ve,U,_e,en]),[Lf,Ha]=f.useState(),ei=f.useCallback(async(w,A)=>{const L=w.current?.range;if(L===void 0||z===void 0||A.current===void 0)return;const W=A.current.range;if(M!==void 0){let B=!1;if(M({fillDestination:{...W,x:W.x-U},patternSource:{...L,x:L.x-U},preventDefault:()=>B=!0}),B)return}let q=z(L,xn.current.signal);typeof q!="object"&&(q=await q());const j=q,V=[];for(let B=0;B<W.width;B++)for(let Z=0;Z<W.height;Z++){const le=[W.x+B,W.y+Z];if(dd(le,L))continue;const pe=j[Z%L.height][B%L.width];di(pe)||!ui(pe)||V.push({location:le,value:{...pe}})}Fn(V),fn.current?.damage(V.map(B=>({cell:B.location})))},[z,Fn,M,U]),kl=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}}};ei(w,K)},[ei,K]),Ml=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}}};ei(w,K)},[ei,K]),Af=f.useCallback((w,A)=>{const L=l;if(u(void 0),Da(void 0),Ha(void 0),Ti.current=!1,A)return;if(L?.fillHandle===!0&&K.current!==void 0&&L.previousSelection?.current!==void 0){if(Or===void 0)return;const pe={...K,current:{...K.current,range:Ed(L.previousSelection.current.range,Or)}};ei(L.previousSelection,pe),ae(pe,!0);return}const[W,q]=w.location,[j,V]=_r.current??[],B=()=>{Qr.current=!0},Z=pe=>{const wt=pe.isTouch||j===W&&V===q;if(wt&&O?.([W-U,q],{...pe,preventDefault:B}),pe.button===1)return!Qr.current;if(!Qr.current){const rt=En(w.location),Xe=en(rt);if(Xe!==void 0&&Xe.onClick!==void 0&&wt){const ht=Xe.onClick({...pe,cell:rt,posX:pe.localEventX,posY:pe.localEventY,bounds:pe.bounds,theme:Ei(rt,w.location),preventDefault:B});ht!==void 0&&!di(ht)&&li(ht)&&(Fn([{location:pe.location,value:ht}]),fn.current?.damage([{cell:pe.location}]))}if(Qr.current||K.current===void 0)return!1;let Ke=!1;switch(rt.activationBehaviorOverride??we){case"double-click":case"second-click":{if(L?.previousSelection?.current?.cell===void 0)break;const[ht,xt]=K.current.cell,[pt,ni]=L.previousSelection.current.cell;Ke=W===ht&&W===pt&&q===xt&&q===ni&&(pe.isDoubleClick===!0||we==="second-click");break}case"single-click":{Ke=!0;break}}if(Ke)return R?.([W-U,q]),Kr(pe.bounds,!1),!0}return!1},le=w.location[0]-U;if(w.isTouch){const pe=sn.current,wt=Sl.current;if(pe.x!==wt.x||pe.y!==wt.y)return;if(w.isLongTouch===!0){if(w.kind==="cell"&&Zi(K.current?.cell,w.location)){G?.([le,w.location[1]],{...w,preventDefault:B});return}else if(w.kind==="header"&&K.columns.hasIndex(W)){ie?.(le,{...w,preventDefault:B});return}else if(w.kind===An){if(le<0)return;Q?.(le,{...w,preventDefault:B});return}}w.kind==="cell"?Z(w)||Ii(w):w.kind===An?$?.(le,{...w,preventDefault:B}):(w.kind===yr&&C?.(le,{...w,preventDefault:B}),Ii(w));return}if(w.kind==="header"){if(le<0)return;w.isEdge?w.isDoubleClick===!0&&Ro(W):w.button===0&&W===j&&q===V&&C?.(le,{...w,preventDefault:B})}if(w.kind===An){if(le<0)return;w.button===0&&W===j&&q===V&&($?.(le,{...w,preventDefault:B}),Qr.current||xl(w))}w.kind==="cell"&&(w.button===0||w.button===1)&&Z(w),_r.current=void 0},[l,K,U,Or,ei,ae,O,En,en,we,Ei,Fn,R,Kr,G,ie,Q,Ii,$,C,Ro,xl]),Hf=f.useCallback(w=>{const A={...w,location:[w.location[0]-U,w.location[1]]};st?.(A),l!==void 0&&w.buttons===0&&(u(void 0),Da(void 0),Ha(void 0),Ti.current=!1),Ha(L=>Ti.current?[w.scrollEdge[0],0]:w.scrollEdge[0]===L?.[0]&&w.scrollEdge[1]===L[1]?L:l===void 0||(Yn.current?.location[0]??0)<U?void 0:w.scrollEdge)},[l,st,U]),zf=f.useCallback((w,A)=>{mt?.(w-U,A)},[mt,U]),Vf=f.useCallback((w,A)=>{ft?.(w-U,A)},[ft,U]),ti=K?.current?.cell,Nf=f.useCallback((w,A,L,W,q,j)=>{Gn.current=!1;let V=ti;V!==void 0&&(V=[V[0]-U,V[1]]);const B=He===0?void 0:{x:0,y:w.y,width:He,height:w.height},Z=[];B!==void 0&&Z.push(B),De>0&&(Z.push({x:w.x-U,y:_e-De,width:w.width,height:De}),He>0&&Z.push({x:0,y:_e-De,width:He,height:De}));const le={x:w.x-U,y:w.y,width:w.width,height:Lt&&w.y+w.height>=_e?w.height-1:w.height,tx:q,ty:j,extras:{selected:V,freezeRegion:B,freezeRegions:Z}};sn.current=le,vl(le),Wt([A,L,W]),qt?.(le,le.tx,le.ty,le.extras)},[ti,U,Lt,_e,He,De,vl,qt]),$f=wr(I,f.useCallback((w,A)=>I?.(w-U,A-U)!==!1,[I,U])),Bf=wr(Ie,f.useCallback((w,A)=>{Ie?.(w-U,A-U),ne!=="none"&&et(it.fromSingleSelection(A),void 0,!0)},[ne,Ie,U,et])),za=f.useRef(!1),Wf=f.useCallback(w=>{if(w.location[0]===0&&U>0){w.preventDefault();return}Te?.({...w,location:[w.location[0]-U,w.location[1]]}),w.defaultPrevented()||(za.current=!0),u(void 0)},[Te,U]),Uf=f.useCallback(()=>{za.current=!1},[]),Rl=yt?.selectionBehavior,Eo=f.useCallback(w=>{if(Rl!=="block-spanning")return;const{isGroupHeader:A,path:L,groupRows:W}=Pr(w);if(A)return[w,w];const q=L[L.length-1],j=w-q,V=w+W-q-1;return[j,V]},[Pr,Rl]),Va=f.useRef(),Na=f.useCallback(w=>{if(!_d(w,Va.current)&&(Va.current=w,!(Yn?.current?.button!==void 0&&Yn.current.button>=1))){if(w.buttons!==0&&l!==void 0&&Yn.current?.location[0]===0&&w.location[0]===0&&U===1&&me==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(Yn.current.location[1])&&K.rows.hasIndex(Yn.current.location[1])){const A=Math.min(Yn.current.location[1],w.location[1]),L=Math.max(Yn.current.location[1],w.location[1])+1;Tt(it.fromSingleSelection([A,L]),void 0,!1)}if(w.buttons!==0&&l!==void 0&&K.current!==void 0&&!za.current&&!Ti.current&&($e==="rect"||$e==="multi-rect")){const[A,L]=K.current.cell;let[W,q]=w.location;if(q<0&&(q=sn.current.y),l.fillHandle===!0&&l.previousSelection?.current!==void 0){const j=l.previousSelection.current.range;q=Math.min(q,Lt?_e-1:_e);const V=Vp(j,W,q,It);Da(V)}else{if(Lt&&L===_e)return;if(Lt&&q===_e)if(w.kind===sa)q--;else return;W=Math.max(W,U);const B=Eo(L);q=B===void 0?q:Ln(q,B[0],B[1]);const Z=W-A,le=q-L,pe={x:Z>=0?A:W,y:le>=0?L:q,width:Math.abs(Z)+1,height:Math.abs(le)+1};dt({...K.current,range:pe},!0,!1,"drag")}}Ht?.({...w,location:[w.location[0]-U,w.location[1]]})}},[l,U,me,K,$e,Ht,Tt,Lt,_e,It,Eo,dt]),qf=f.useCallback(()=>{const w=Va.current;if(w===void 0)return;const[A,L]=w.scrollEdge;let[W,q]=w.location;const j=sn.current;A===-1?W=j.extras?.freezeRegion?.x??j.x:A===1&&(W=j.x+j.width),L===-1?q=Math.max(0,j.y):L===1&&(q=Math.min(_e-1,j.y+j.height)),W=Ln(W,0,tt.length-1),q=Ln(q,0,_e-1),Na({...w,location:[W,q]})},[tt.length,Na,_e]);j0(Lf,Ut,qf);const Nn=f.useCallback(w=>{if(K.current===void 0)return;const[A,L]=w,[W,q]=K.current.cell,j=K.current.range;let V=j.x,B=j.x+j.width,Z=j.y,le=j.y+j.height;const[pe,wt]=Eo(q)??[0,_e-1],rt=wt+1;if(L!==0)switch(L){case 2:{le=rt,Z=q,Gt(0,le,"vertical");break}case-2:{Z=pe,le=q+1,Gt(0,Z,"vertical");break}case 1:{Z<q?(Z++,Gt(0,Z,"vertical")):(le=Math.min(rt,le+1),Gt(0,le,"vertical"));break}case-1:{le>q+1?(le--,Gt(0,le,"vertical")):(Z=Math.max(pe,Z-1),Gt(0,Z,"vertical"));break}default:to()}if(A!==0)if(A===2)B=tt.length,V=W,Gt(B-1-U,0,"horizontal");else if(A===-2)V=U,B=W+1,Gt(V-U,0,"horizontal");else{let Xe=[];if(z!==void 0){const Ke=z({x:V,y:Z,width:B-V-U,height:le-Z},xn.current.signal);typeof Ke=="object"&&(Xe=iv(Ke))}if(A===1){let Ke=!1;if(V<W){if(Xe.length>0){const ht=Sr(V+1,W+1).find(xt=>!Xe.includes(xt-U));ht!==void 0&&(V=ht,Ke=!0)}else V++,Ke=!0;Ke&&Gt(V,0,"horizontal")}Ke||(B=Math.min(tt.length,B+1),Gt(B-1-U,0,"horizontal"))}else if(A===-1){let Ke=!1;if(B>W+1){if(Xe.length>0){const ht=Sr(B-1,W,-1).find(xt=>!Xe.includes(xt-U));ht!==void 0&&(B=ht,Ke=!0)}else B--,Ke=!0;Ke&&Gt(B-U,0,"horizontal")}Ke||(V=Math.max(U,V-1),Gt(V-U,0,"horizontal"))}else to()}dt({cell:K.current.cell,range:{x:V,y:Z,width:B-V,height:le-Z}},!0,!1,"keyboard-select")},[z,Eo,K,tt.length,U,_e,Gt,dt]),$a=f.useRef(wi);$a.current=wi;const pr=f.useCallback((w,A,L,W)=>{const q=hn-(L?0:1);w=Ln(w,U,an.length-1+U),A=Ln(A,0,q);const j=ti?.[0],V=ti?.[1];if(w===j&&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),ae({...K,current:{cell:[w,A],range:{x:w,y:A,width:1,height:1},rangeStack:B}},!0)}else dt({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),$a.current&&Gt(w-U,A),!0},[hn,U,an.length,ti,K,Gt,ae,dt]),Gf=f.useCallback((w,A)=>{i?.cell!==void 0&&w!==void 0&&li(w)&&(Fn([{location:i.cell,value:w}]),window.requestAnimationFrame(()=>{fn.current?.damage([{cell:i.cell}])})),pn(!0),o(void 0);const[L,W]=A;if(K.current!==void 0&&(L!==0||W!==0)){const q=K.current.cell[1]===hn-1&&w!==void 0,j=K.current.cell[0]===tt.length-1&&w!==void 0;let V=!0;if(q&&W===1&&Se!==void 0){V=!1;const B=K.current.cell[0]+L,Z=Zr(B);gr(Z??B,!1)}if(j&&L===1&&Je!==void 0){V=!1;const B=K.current.cell[1]+W;Mo(B,!1)}V&&pr(Ln(K.current.cell[0]+L,0,tt.length-1),Ln(K.current.cell[1]+W,0,hn-1),q,!1)}_?.(w,A)},[i?.cell,pn,K,_,Fn,hn,pr,tt.length,gr,Mo,Se,Je,Zr]),Yf=f.useMemo(()=>`gdg-overlay-${rv++}`,[]),Fr=f.useCallback(w=>{pn();const A=[];for(let L=w.x;L<w.x+w.width;L++)for(let W=w.y;W<w.y+w.height;W++){const q=S([L-U,W]);if(!q.allowOverlay&&q.kind!==J.Boolean)continue;let j;if(q.kind===J.Custom){const V=en(q),B=V?.provideEditor?.({...q,location:[L-U,W]});V?.onDelete!==void 0?j=V.onDelete(q):Og(B)&&(j=B?.deletedValue?.(q))}else(li(q)&&q.allowOverlay||q.kind===J.Boolean)&&(j=en(q)?.onDelete?.(q));j!==void 0&&!di(j)&&li(j)&&A.push({location:[L,W],value:j})}Fn(A),fn.current?.damage(A.map(L=>({cell:L.location})))},[pn,S,en,Fn,U]),Di=i!==void 0,El=f.useCallback(w=>{const A=()=>{w.stopPropagation(),w.preventDefault()},L={didMatch:!1},{bounds:W}=w,q=K.columns,j=K.rows,V=qn;if(!Di&&ot(V.clear,w,L))ae($o,!1),Mt?.();else if(!Di&&ot(V.selectAll,w,L))ae({columns:it.empty(),rows:it.empty(),current:{cell:K.current?.cell??[U,0],range:{x:U,y:0,width:b.length,height:_e},rangeStack:[]}},!1);else if(ot(V.search,w,L))s?.current?.focus({preventScroll:!0}),wo(!0);else if(ot(V.delete,w,L)){const ht=Zt?.(K)??!0;if(ht!==!1){const xt=ht===!0?K:ht;if(xt.current!==void 0){Fr(xt.current.range);for(const pt of xt.current.rangeStack)Fr(pt)}for(const pt of xt.rows)Fr({x:U,y:pt,width:b.length,height:1});for(const pt of xt.columns)Fr({x:pt,y:0,width:1,height:_e})}}if(L.didMatch)return A(),!0;if(K.current===void 0)return!1;let[B,Z]=K.current.cell;const[,le]=K.current.cell;let pe=!1,wt=!1;if(ot(V.scrollToSelectedCell,w,L)?Do.current(B-U,Z):ne!=="none"&&ot(V.selectColumn,w,L)?q.hasIndex(B)?et(q.remove(B),void 0,!0):ne==="single"?et(it.fromSingleSelection(B),void 0,!0):et(void 0,B,!0):me!=="none"&&ot(V.selectRow,w,L)?j.hasIndex(Z)?Tt(j.remove(Z),void 0,!0):me==="single"?Tt(it.fromSingleSelection(Z),void 0,!0):Tt(void 0,Z,!0):!Di&&W!==void 0&&ot(V.activateCell,w,L)?Z===_e&&Lt?window.setTimeout(()=>{const ht=Zr(B);gr(ht??B)},0):(R?.([B-U,Z]),Kr(W,!0)):K.current.range.height>1&&ot(V.downFill,w,L)?Ml():K.current.range.width>1&&ot(V.rightFill,w,L)?kl():ot(V.goToNextPage,w,L)?Z+=Math.max(1,sn.current.height-4):ot(V.goToPreviousPage,w,L)?Z-=Math.max(1,sn.current.height-4):ot(V.goToFirstCell,w,L)?(o(void 0),Z=0,B=0):ot(V.goToLastCell,w,L)?(o(void 0),Z=Number.MAX_SAFE_INTEGER,B=Number.MAX_SAFE_INTEGER):ot(V.selectToFirstCell,w,L)?(o(void 0),Nn([-2,-2])):ot(V.selectToLastCell,w,L)?(o(void 0),Nn([2,2])):Di?(ot(V.closeOverlay,w,L)&&o(void 0),ot(V.acceptOverlayDown,w,L)&&(o(void 0),Z++),ot(V.acceptOverlayUp,w,L)&&(o(void 0),Z--),ot(V.acceptOverlayLeft,w,L)&&(o(void 0),B--),ot(V.acceptOverlayRight,w,L)&&(o(void 0),B++)):(ot(V.goDownCell,w,L)?Z+=1:ot(V.goUpCell,w,L)?Z-=1:ot(V.goRightCell,w,L)?B+=1:ot(V.goLeftCell,w,L)?B-=1:ot(V.goDownCellRetainSelection,w,L)?(Z+=1,pe=!0):ot(V.goUpCellRetainSelection,w,L)?(Z-=1,pe=!0):ot(V.goRightCellRetainSelection,w,L)?(B+=1,pe=!0):ot(V.goLeftCellRetainSelection,w,L)?(B-=1,pe=!0):ot(V.goToLastRow,w,L)?Z=_e-1:ot(V.goToFirstRow,w,L)?Z=Number.MIN_SAFE_INTEGER:ot(V.goToLastColumn,w,L)?B=Number.MAX_SAFE_INTEGER:ot(V.goToFirstColumn,w,L)?B=Number.MIN_SAFE_INTEGER:($e==="rect"||$e==="multi-rect")&&(ot(V.selectGrowDown,w,L)?Nn([0,1]):ot(V.selectGrowUp,w,L)?Nn([0,-1]):ot(V.selectGrowRight,w,L)?Nn([1,0]):ot(V.selectGrowLeft,w,L)?Nn([-1,0]):ot(V.selectToLastRow,w,L)?Nn([0,2]):ot(V.selectToFirstRow,w,L)?Nn([0,-2]):ot(V.selectToLastColumn,w,L)?Nn([2,0]):ot(V.selectToFirstColumn,w,L)&&Nn([-2,0])),wt=L.didMatch),Vn!==void 0&&Vn!=="normal"&&Z!==le){const ht=Vn==="skip-up"||Vn==="skip"||Vn==="block",xt=Vn==="skip-down"||Vn==="skip"||Vn==="block",pt=Z<le;if(pt&&ht){for(;Z>=0&&Pr(Z).isGroupHeader;)Z--;Z<0&&(Z=le)}else if(!pt&&xt){for(;Z<_e&&Pr(Z).isGroupHeader;)Z++;Z>=_e&&(Z=le)}}const Xe=pr(B,Z,!1,pe),Ke=L.didMatch;return Ke&&(Xe||!wt||$t)&&A(),Ke},[Vn,Di,K,qn,ne,me,$e,U,Pr,_e,pr,ae,Mt,b.length,Zt,$t,Fr,et,Tt,Lt,Zr,gr,R,Kr,Ml,kl,Nn]),Oi=f.useCallback(w=>{let A=!1;if(Y!==void 0&&Y({...w,...w.location&&{location:[w.location[0]-U,w.location[1]]},cancel:()=>{A=!0}}),A||El(w)||K.current===void 0)return;const[L,W]=K.current.cell,q=sn.current;if(ke&&!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&&ui(S([L-U,Math.max(0,Math.min(W,_e-1))]))){if((!Lt||W!==_e)&&(q.y>W||W>q.y+q.height||q.x>L||L>q.x+q.width))return;R?.([L-U,W]),Kr(w.bounds,!0,w.key),w.stopPropagation(),w.preventDefault()}},[ke,Y,El,K,S,U,_e,Lt,R,Kr]),jf=f.useCallback((w,A)=>{const L=w.location[0]-U;if(w.kind==="header"&&ie?.(L,{...w,preventDefault:A}),w.kind===An){if(L<0)return;Q?.(L,{...w,preventDefault:A})}if(w.kind==="cell"){const[W,q]=w.location;G?.([L,q],{...w,preventDefault:A}),Fm(K,w.location)||pr(W,q,!1,!1)}},[K,G,Q,ie,U,pr]),Ba=f.useCallback(async w=>{if(!qn.paste)return;function A(V,B,Z,le){const pe=typeof Z=="object"?Z?.join(`
173
173
  `)??"":Z?.toString()??"";if(!di(V)&&ui(V)&&V.readonly!==!0){const wt=E?.(pe,V);if(wt!==void 0&&li(wt))return{location:B,value:wt};const rt=en(V);if(rt===void 0)return;if(rt.kind===J.Custom){Dn(V.kind===J.Custom);const Xe=rt.onPaste?.(pe,V.data);return Xe===void 0?void 0:{location:B,value:{...V,data:Xe}}}else{const Xe=rt.onPaste?.(pe,V,{formatted:le,formattedString:typeof le=="string"?le:le?.join(`
174
174
  `),rawValue:Z});return Xe===void 0?void 0:(Dn(Xe.kind===V.kind),{location:B,value:Xe})}}}const L=K.columns,W=K.rows,q=Ut.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0;let j;if(K.current!==void 0?j=[K.current.range.x,K.current.range.y]:L.length===1?j=[L.first()??0,0]:W.length===1&&(j=[U,W.first()??0]),q&&j!==void 0){let V,B;const Z="text/plain",le="text/html";if(navigator.clipboard.read!==void 0){const Xe=await navigator.clipboard.read();for(const Ke of Xe){if(Ke.types.includes(le)){const xt=await(await Ke.getType(le)).text(),pt=Ou(xt);if(pt!==void 0){V=pt;break}}Ke.types.includes(Z)&&(B=await(await Ke.getType(Z)).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(le)){const Xe=w.clipboardData.getData(le);V=Ou(Xe)}V===void 0&&w.clipboardData.types.includes(Z)&&(B=w.clipboardData.getData(Z))}else return;const[pe,wt]=j,rt=[];do{if(Re===void 0){const Xe=En(j),Ke=B??V?.map(xt=>xt.map(pt=>pt.rawValue).join(" ")).join(" ")??"",ht=A(Xe,j,Ke,void 0);ht!==void 0&&rt.push(ht);break}if(V===void 0){if(B===void 0)return;V=$0(B)}if(Re===!1||typeof Re=="function"&&Re?.([j[0]-U,j[1]],V.map(Xe=>Xe.map(Ke=>Ke.rawValue?.toString()??"")))!==!0)return;for(const[Xe,Ke]of V.entries()){if(Xe+wt>=_e)break;for(const[ht,xt]of Ke.entries()){const pt=[ht+pe,Xe+wt],[ni,_i]=pt;if(ni>=tt.length||_i>=hn)continue;const Fi=En(pt),jn=A(Fi,pt,xt.rawValue,xt.formatted);jn!==void 0&&rt.push(jn)}}}while(!1);Fn(rt),fn.current?.damage(rt.map(Xe=>({cell:Xe.location})))}},[E,en,En,K,qn.paste,Ut,tt.length,Fn,hn,Re,U,_e]);vn("paste",Ba,d,!1,!0);const Pi=f.useCallback(async(w,A)=>{if(!qn.copy)return;const L=A===!0||Ut.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0,W=K.columns,q=K.rows,j=(V,B)=>{if(!qe)_u(V,B,w);else{const Z=B.map(le=>({kind:J.Text,data:b[le].title,displayData:b[le].title,allowOverlay:!1}));_u([Z,...V],B,w)}};if(L&&z!==void 0){if(K.current!==void 0){let V=z(K.current.range,xn.current.signal);typeof V!="object"&&(V=await V()),j(V,Sr(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(Z=>{const le=z({x:U,y:Z,width:b.length,height:1},xn.current.signal);return typeof le=="object"?le[0]:le().then(pe=>pe[0])});if(B.some(Z=>Z instanceof Promise)){const Z=await Promise.all(B);j(Z,Sr(b.length))}else j(B,Sr(b.length))}else if(W.length>0){const V=[],B=[];for(const Z of W){let le=z({x:Z,y:0,width:1,height:_e},xn.current.signal);typeof le!="object"&&(le=await le()),V.push(le),B.push(Z-U)}if(V.length===1)j(V[0],B);else{const Z=V.reduce((le,pe)=>le.map((wt,rt)=>[...wt,...pe[rt]]));j(Z,B)}}}},[b,z,K,qn.copy,U,Ut,_e,qe]);vn("copy",Pi,d,!1,!1);const Xf=f.useCallback(async w=>{if(!(!qn.cut||!(Ut.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0))&&(await Pi(w),K.current!==void 0)){let L={current:{cell:K.current.cell,range:K.current.range,rangeStack:[]},rows:it.empty(),columns:it.empty()};const W=Zt?.(L);if(W===!1||(L=W===!0?L:W,L.current===void 0))return;Fr(L.current.range)}},[Fr,K,qn.cut,Pi,Ut,Zt]);vn("cut",Xf,d,!1,!1);const Kf=f.useCallback((w,A)=>{if(fe!==void 0){U!==0&&(w=w.map(q=>[q[0]-U,q[1]])),fe(w,A);return}if(w.length===0||A===-1)return;const[L,W]=w[A];c.current!==void 0&&c.current[0]===L&&c.current[1]===W||(c.current=[L,W],pr(L,W,!1,!1))},[fe,U,pr]),[Io,To]=cn?.current?.cell??[],Do=f.useRef(Gt);Do.current=Gt,f.useLayoutEffect(()=>{$a.current&&!Gn.current&&Io!==void 0&&To!==void 0&&(Io!==Ee.current?.current?.cell[0]||To!==Ee.current?.current?.cell[1])&&Do.current(Io,To),Gn.current=!1},[Io,To]);const Il=K.current!==void 0&&(K.current.cell[0]>=tt.length||K.current.cell[1]>=hn);f.useLayoutEffect(()=>{Il&&ae($o,!1)},[Il,ae]);const Zf=f.useMemo(()=>Lt===!0&&Bt?.tint===!0?it.fromSingleSelection(hn-1):it.empty(),[hn,Lt,Bt?.tint]),Jf=f.useCallback(w=>typeof jt=="boolean"?jt:jt?.(w-U)??!0,[U,jt]),Qf=f.useMemo(()=>{if(La===void 0||a.current===null)return null;const{bounds:w,group:A}=La,L=a.current.getBoundingClientRect();return f.createElement(D0,{bounds:w,group:A,canvasBounds:L,onClose:()=>Aa(void 0),onFinish:W=>{Aa(void 0),te?.(A,W)}})},[te,La]),eh=Math.min(tt.length,He+(_n?1:0));f.useImperativeHandle(t,()=>({appendRow:(w,A)=>gr(w+U,A),appendColumn:(w,A)=>Mo(w,A),updateCells:w=>(U!==0&&(w=w.map(A=>({cell:[A.cell[0]+U,A.cell[1]]}))),fn.current?.damage(w)),getBounds:(w,A)=>{if(!(a?.current===null||Ut?.current===null)){if(w===void 0&&A===void 0){const L=a.current.getBoundingClientRect(),W=L.width/Ut.current.clientWidth;return{x:L.x-Ut.current.scrollLeft*W,y:L.y-Ut.current.scrollTop*W,width:Ut.current.scrollWidth*W,height:Ut.current.scrollHeight*W}}return fn.current?.getBounds((w??0)+U,A)}},focus:()=>fn.current?.focus(),emit:async w=>{switch(w){case"delete":Oi({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":Oi({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":Oi({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 Pi(void 0,!0);break;case"paste":await Ba();break}},scrollTo:Gt,remeasureColumns:w=>{for(const A of w)Ro(A+U)},getMouseArgsForPosition:(w,A,L)=>{if(fn?.current===null)return;const W=fn.current.getMouseArgsForPosition(w,A,L);if(W!==void 0)return{...W,location:[W.location[0]-U,W.location[1]]}}}),[gr,Mo,Ro,Ut,Pi,Oi,Ba,U,Gt]);const[Tl,Dl]=ti??[],th=f.useCallback(w=>{const[A,L]=w;if(L===-1){ne!=="none"&&(et(it.fromSingleSelection(A),void 0,!1),pn());return}Tl===A&&Dl===L||(dt({cell:w,range:{x:A,y:L,width:1,height:1}},!0,!1,"keyboard-nav"),Gt(A,L))},[ne,pn,Gt,Tl,Dl,dt,et]),[nh,rh]=f.useState(!1),Ol=f.useRef(Jc(w=>{rh(w)},5)),ih=f.useCallback(()=>{Ol.current(!0),K.current===void 0&&K.columns.length===0&&K.rows.length===0&&l===void 0&&dt({cell:[U,yo],range:{x:U,y:yo,width:1,height:1}},!0,!1,"keyboard-select")},[yo,K,l,U,dt]),oh=f.useCallback(()=>{Ol.current(!1)},[]),[ah,sh]=f.useMemo(()=>{let w;const A=vt?.scrollbarWidthOverride??Ss(),L=_e+(Lt?1:0);if(typeof Un=="number")w=kn+L*Un;else{let q=0;const j=Math.min(L,10);for(let V=0;V<j;V++)q+=Un(V);q=Math.floor(q/j),w=kn+L*q}w+=A;const W=tt.reduce((q,j)=>j.width+q,0)+A;return[`${Math.min(1e5,W)}px`,`${Math.min(1e5,w)}px`]},[tt,vt?.scrollbarWidthOverride,Un,_e,Lt,kn]),lh=f.useMemo(()=>jm(Ze),[Ze]);return f.createElement(Cd.Provider,{value:Ze},f.createElement(q0,{style:lh,className:X,inWidth:p??ah,inHeight:y??sh},f.createElement(R0,{fillHandle:yn,drawFocusRing:yi,experimental:vt,fixedShadowX:Ft,fixedShadowY:Cn,getRowThemeOverride:cr,headerIcons:Wn,imageWindowLoader:zn,initialSize:N,isDraggable:Ne,onDragLeave:Ue,onRowMoved:St,overscrollX:ki,overscrollY:Ia,preventDiagonalScrolling:bt,rightElement:Qt,rightElementProps:Et,smoothScrollX:on,smoothScrollY:xa,className:X,enableGroups:_t,onCanvasFocused:ih,onCanvasBlur:oh,canvasRef:a,onContextMenu:jf,theme:Ze,cellXOffset:Pf,cellYOffset:yo,accessibilityHeight:Dr.height,onDragEnd:Uf,columns:tt,nonGrowWidth:fr,drawHeader:je,onColumnProposeMove:$f,drawCell:ct,disabledRows:Zf,freezeColumns:eh,lockColumns:U,firstColAccessible:U===0,getCellContent:En,minColumnWidth:er,maxColumnWidth:jr,searchInputRef:s,showSearch:Xr,onSearchClose:Ta,highlightRegions:_f,getCellsForSelection:z,getGroupDetails:Oa,headerHeight:xi,isFocused:nh,groupHeaderHeight:_t?vo:0,freezeTrailingRows:De+(Lt&&Bt?.sticky===!0?1:0),hasAppendRow:Lt,onColumnResize:ve,onColumnResizeEnd:Ye,onColumnResizeStart:ye,onCellFocused:th,onColumnMoved:Bf,onDragStart:Wf,onHeaderMenuClick:zf,onHeaderIndicatorClick:Vf,onItemHovered:Na,isFilling:l?.fillHandle===!0,onMouseMove:Hf,onKeyDown:Oi,onKeyUp:ce,onMouseDown:Ff,onMouseUp:Af,onDragOverCell:dn,onDrop:Mn,onSearchResultsChanged:Kf,onVisibleRegionChanged:Nf,clientSize:zt,rowHeight:Un,searchResults:re,searchValue:P,onSearchValueChange:H,rows:hn,scrollRef:Ut,selection:K,translateX:Dr.tx,translateY:Dr.ty,verticalBorder:Jf,gridRef:fn,getCellRenderer:en,resizeIndicator:go}),Qf,i!==void 0&&f.createElement(f.Suspense,{fallback:null},f.createElement(nv,{...i,validateCell:Me,bloom:D,id:Yf,getCellRenderer:en,className:vt?.isSubGrid===!0?"click-outside-ignore":void 0,provideEditor:rn,imageEditorOverride:g,portalElementRef:pl,onFinishEditing:Gf,markdownDivCreateNode:m,isOutsideClick:Ma,customEventTarget:vt?.eventTarget}))))},av=f.forwardRef(ov);function Au(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=td(c,a,o.cellVerticalPadding),h=ed(t.contentAlign??"center",l,s,o.cellHorizontalPadding,g),m=Qc(h,d,g),p=nd(l+n,u+r,m);return Ns(t)&&p}const sv={getAccessibilityString:e=>e.data?.toString()??"false",kind:J.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>lv(e,e.cell.data,Ns(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{Au(e)&&e.preventDefault()},onClick:e=>{if(Au(e))return{...e.cell,data:Ld(e.cell.data)}},onPaste:(e,t)=>{let n=ta;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=Vs),n===t.data?void 0:{...t,data:n}}};function lv(e,t,n,r,i){if(!n&&t===ta)return;const{ctx:o,hoverAmount:s,theme:a,rect:l,highlighted:u,hoverX:c,hoverY:d,cell:{contentAlign:g}}=e,{x:h,y:m,width:p,height:y}=l;let b=!1;if(i>0){let v=n?1-i+i*s:.4;if(t===ta&&(v*=s),v===0)return;v<1&&(b=!0,o.globalAlpha=v)}Zs(o,a,t,h,m,p,y,u,c,d,r,g),b&&(o.globalAlpha=1)}const uv=un("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),cv=e=>{const{bubbles:t}=e;return f.createElement(uv,null,t.map((n,r)=>f.createElement("div",{key:r,className:"boe-bubble"},n)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},dv={getAccessibilityString:e=>rd(e.data),kind:J.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=>fv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(cv,{bubbles:t.data})},onPaste:()=>{}};function fv(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=qr(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)Kn(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+Zn(i,r))}const hv=un("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),gv=e=>{const{drilldowns:t}=e;return f.createElement(hv,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))))},mv={getAccessibilityString:e=>rd(e.data.map(t=>t.text)),kind:J.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=>vv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(gv,{drilldowns:t.data})},onPaste:()=>{}},ls={};function pv(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(ls[g]!==void 0)return{el:ls[g],height:l,width:d,middleWidth:a*i,sideWidth:u*i,padding:o*i,dpr:i};const h=document.createElement("canvas"),m=h.getContext("2d");return m===null?null:(h.width=d,h.height=l,m.scale(i,i),ls[g]=h,m.beginPath(),Kn(m,o,o,c,s,r),m.shadowColor="rgba(24, 25, 34, 0.4)",m.shadowBlur=1,m.fillStyle=e,m.fill(),m.shadowColor="rgba(24, 25, 34, 0.3)",m.shadowOffsetY=1,m.shadowBlur=5,m.fillStyle=e,m.fill(),m.shadowOffsetY=0,m.shadowBlur=0,m.shadowBlur=0,m.beginPath(),Kn(m,o+.5,o+.5,c,s,r),m.strokeStyle=t,m.lineWidth=1,m.stroke(),{el:h,height:l,width:d,sideWidth:u*i,middleWidth:r*i,padding:o*i,dpr:i})}function vv(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=Ys(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),m=g-10,p=r.bubblePadding,y=r.bubbleMargin;let b=l+r.cellHorizontalPadding;const v=r.roundingRadius??6,S=pv(r.bgCell,r.drilldownBorder,g,v),O=[];for(const R of t){if(b>l+u)break;const _=qr(R.text,i,c).width;let E=0;R.img!==void 0&&o.loadOrGetImage(R.img,s,a)!==void 0&&(E=m-8+4);const k=_+E+p*2;O.push({x:b,width:k}),b+=k+y}if(S!==null){const{el:R,height:M,middleWidth:_,sideWidth:E,width:k,dpr:F,padding:D}=S,C=E/F,I=D/F;for(const T of O){const x=Math.floor(T.x),$=Math.floor(T.width),G=$-(C-I)*2;i.imageSmoothingEnabled=!1,i.drawImage(R,0,0,E,M,x-I,h,C,g),G>0&&i.drawImage(R,E,0,_,M,x+(C-I),h,G,g),i.drawImage(R,k-E,0,E,M,x+$-(C-I),h,C,g),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[R,M]of O.entries()){const _=t[R];let E=M.x+p;if(_.img!==void 0){const k=o.loadOrGetImage(_.img,s,a);if(k!==void 0){const F=m-8;let D=0,C=0,I=k.width,T=k.height;I>T?(D+=(I-T)/2,I=T):T>I&&(C+=(T-I)/2,T=I),i.beginPath(),Kn(i,E,h+g/2-F/2,F,F,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(k,D,C,I,T,E,h+g/2-F/2,F,F),i.restore(),E+=F+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(_.text,E,h+g/2+Zn(i,r))}}const bv={getAccessibilityString:e=>e.data.join(", "),kind:J.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>wv(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??im;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}}},us=4;function wv(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,m=g-a.cellVerticalPadding*2,p=[];let y=0;for(let v=0;v<t.length;v++){const S=t[v];if(S.length===0)continue;const O=u.loadOrGetImage(S,o,s);if(O!==void 0){p[v]=O;const R=O.width*(m/O.height);y+=R+us}}if(y===0)return;y-=us;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 p){if(v===void 0)continue;const S=v.width*(m/v.height);n>0&&(l.beginPath(),Kn(l,b,d+a.cellVerticalPadding,S,m,n),l.save(),l.clip()),l.drawImage(v,b,d+a.cellVerticalPadding,S,m),n>0&&l.restore(),b+=S+us}}function yv(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const Cv={getAccessibilityString:()=>"",kind:J.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(yv(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);Kn(i,o.x+l,o.y+(o.height-u)/2,a,u,s.roundingRadius??3),i.fillStyle=Nr(s.textDark,.1),i.fill()},onPaste:()=>{}},Sv=()=>e=>e.targetWidth,Hu=un("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[Sv(),"px"]}}),xv=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(m=>!m)},[]),h=l?"gdg-ml-6":"";return c?f.createElement(Hu,{targetWidth:o.width-20},f.createElement(Wr,{autoFocus:!0,highlight:!1,validatedSelection:a,value:l,onKeyDown:m=>{m.key==="Enter"&&m.stopPropagation()},onChange:n}),f.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${h}`,onClick:()=>s(t)},f.createElement(Zg,null))):f.createElement(Hu,{targetWidth:o.width},f.createElement(xm,{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(Bs,null))),f.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},kv={getAccessibilityString:e=>e.data?.toString()??"",kind:J.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:uo,measure:(e,t,n)=>{const r=t.data.split(`
175
- `)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>Xn(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(xv,{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}},Mv={getAccessibilityString:e=>e.row.toString(),kind:Hn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Rv,measure:()=>44,draw:e=>Iv(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 Rv(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=Ev,n.textAlign="center",o}function Ev(e){const{ctx:t}=e;t.textAlign="start"}function Iv(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,m=n?1:r==="checkbox-visible"?.6+.4*l:l;if(r!=="number"&&m>0){s.globalAlpha=m;const p=7*(n?l:1);if(Zs(s,u,n,i?c+p:c,d,i?g-p: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 p=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(p,b,d+h/2+Zn(s,y)),l!==0&&(s.globalAlpha=1)}}const Tv={getAccessibilityString:()=>"",kind:Hn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Dv(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Dv(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 p=d-8,y=l+8/2,b=u+8/2;a.drawSprite(n,"normal",r,y,b,p,s,g?1:o),h=p}else{h=24;const m=12,p=g?m:o*m,y=g?0:(1-o)*m*.5,b=s.cellHorizontalPadding+4;p>0&&(r.moveTo(l+b+y,u+d/2),r.lineTo(l+b+y+p,u+d/2),r.moveTo(l+b+y+p*.5,u+d/2-p*.5),r.lineTo(l+b+y+p*.5,u+d/2+p*.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+Zn(r,s)),r.beginPath()}function zd(e,t,n,r,i,o,s){e.textBaseline="alphabetic";const a=Ov(e,i,r,t,n?.fullSize??!1);e.beginPath(),Kn(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=n?.bgColor??Nr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",s?.("text")}function Ov(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=qr(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 Pv=f.lazy(async()=>await As(()=>import("./number-overlay-editor.BFTlQD7x.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)),_v={getAccessibilityString:e=>e.data?.toString()??"",kind:J.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:uo,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),Xn(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(Pv,{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}}},Fv={getAccessibilityString:()=>"",measure:()=>108,kind:J.Protected,needsHover:!1,needsHoverPosition:!1,draw:Lv,onPaste:()=>{}};function Lv(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(nu(30))*a,d=Math.sin(nu(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 Av={getAccessibilityString:e=>e.data?.toString()??"",kind:J.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>uo(e,t,e.theme.textLight),draw:e=>Xn(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 Vt.createElement(Wr,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},Hv={getAccessibilityString:e=>e.data?.toString()??"",kind:J.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:uo,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),Xn(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=>Xn(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(xv,{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}},Mv={getAccessibilityString:e=>e.row.toString(),kind:Hn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Rv,measure:()=>44,draw:e=>Iv(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 Rv(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=Ev,n.textAlign="center",o}function Ev(e){const{ctx:t}=e;t.textAlign="start"}function Iv(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,m=n?1:r==="checkbox-visible"?.6+.4*l:l;if(r!=="number"&&m>0){s.globalAlpha=m;const p=7*(n?l:1);if(Zs(s,u,n,i?c+p:c,d,i?g-p: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 p=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(p,b,d+h/2+Zn(s,y)),l!==0&&(s.globalAlpha=1)}}const Tv={getAccessibilityString:()=>"",kind:Hn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Dv(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Dv(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 p=d-8,y=l+8/2,b=u+8/2;a.drawSprite(n,"normal",r,y,b,p,s,g?1:o),h=p}else{h=24;const m=12,p=g?m:o*m,y=g?0:(1-o)*m*.5,b=s.cellHorizontalPadding+4;p>0&&(r.moveTo(l+b+y,u+d/2),r.lineTo(l+b+y+p,u+d/2),r.moveTo(l+b+y+p*.5,u+d/2-p*.5),r.lineTo(l+b+y+p*.5,u+d/2+p*.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+Zn(r,s)),r.beginPath()}function zd(e,t,n,r,i,o,s){e.textBaseline="alphabetic";const a=Ov(e,i,r,t,n?.fullSize??!1);e.beginPath(),Kn(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=n?.bgColor??Nr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",s?.("text")}function Ov(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=qr(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 Pv=f.lazy(async()=>await As(()=>import("./number-overlay-editor.Coke5m2c.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)),_v={getAccessibilityString:e=>e.data?.toString()??"",kind:J.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:uo,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),Xn(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(Pv,{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}}},Fv={getAccessibilityString:()=>"",measure:()=>108,kind:J.Protected,needsHover:!1,needsHoverPosition:!1,draw:Lv,onPaste:()=>{}};function Lv(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(nu(30))*a,d=Math.sin(nu(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 Av={getAccessibilityString:e=>e.data?.toString()??"",kind:J.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>uo(e,t,e.theme.textLight),draw:e=>Xn(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 Vt.createElement(Wr,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},Hv={getAccessibilityString:e=>e.data?.toString()??"",kind:J.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:uo,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),Xn(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(Wr,{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}},zv=un("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Vv=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(Wr,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):f.createElement(zv,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(Bs,null)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function Vd(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 zu(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=md(s,o.baseFontFull);if(a===void 0)return!1;const l=Vd(a,n,o,t.contentAlign);return Vr({x:l.x-4,y:l.y-4,width:l.width+8,height:l.height+8},r,i)}const Nv={getAccessibilityString:e=>e.data?.toString()??"",kind:J.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:uo,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=qr(l,a,n.baseFontFull),d=Vd(c,s,n,t.contentAlign),{x:g,y:h,width:m,height:p}=d;if(i>=g-4&&i<=g-4+m+8&&o>=h-4&&o<=h-4+p+8){const y=Zn(a,n.baseFontFull);r("pointer");const b=5,v=h-y;a.beginPath(),a.moveTo(s.x+g,Math.floor(s.y+v+p+b)+.5),a.lineTo(s.x+g+m,Math.floor(s.y+v+p+b)+.5),a.strokeStyle=n.linkColor,a.stroke(),a.save(),a.fillStyle=e.cellFillColor,Xn({...e,rect:{...s,x:s.x-1}},l,t.contentAlign),Xn({...e,rect:{...s,x:s.x-2}},l,t.contentAlign),Xn({...e,rect:{...s,x:s.x+1}},l,t.contentAlign),Xn({...e,rect:{...s,x:s.x+2}},l,t.contentAlign),a.restore()}}a.fillStyle=u?n.linkColor:n.textDark,Xn(e,l,t.contentAlign)},onSelect:e=>{zu(e)&&e.preventDefault()},onClick:e=>{const{cell:t}=e;zu(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(Vv,{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}},$v=[Mv,Tv,sv,dv,mv,bv,Cv,kv,_v,Fv,Av,Hv,Nv];var cs,Vu;function Bv(){if(Vu)return cs;Vu=1;var e=Zc(),t=Ic(),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 cs=r,cs}var Wv=Bv();const Uv=ar(Wv),ds=[];class qv extends bd{imageLoaded=()=>{};loadedLocations=[];cache={};setCallback(t){this.imageLoaded=t}sendLoaded=Uv(()=>{this.imageLoaded(new Qi(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=ds.pop()??new Image;let a=!1;const l={img:void 0,cells:[Bn(n,r)],url:t,cancel:()=>{a||(a=!0,ds.length<12?ds.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(Ks(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=Bn(n,r);return o.cells.includes(s)||o.cells.push(s),o.img}else this.loadImage(t,n,r,i)}}const Gv=(e,t)=>{const n=f.useMemo(()=>({...Ap,...e.headerIcons}),[e.headerIcons]),r=f.useMemo(()=>e.renderers??$v,[e.renderers]),i=f.useMemo(()=>e.imageWindowLoader??new qv,[e.imageWindowLoader]);return f.createElement(av,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:i})},Yv=f.forwardRef(Gv);function Nu(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}}const Nd=vi("div",{target:"ee4nolw0"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs})),Cr=vi("div",{target:"ee4nolw1"})(({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}}})),jv=vi("div",{target:"ee4nolw2"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs})),$u=[{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:"}],Xv={number:$u,progress:$u,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 Kv({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:i,onCloseMenu:o,children:s}){const a=$r(),{colors:l,fontSizes:u,radii:c,fontWeights:d}=a,g=Xv[e]||[];return g.length===0?nt(Oc,{}):nt(ba,{triggerType:Pc.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:nt(Nd,{role:"menu",children:g.map(h=>Tn(Cr,{onClick:()=>{i(h.format),o()},role:"menuitem",children:[nt(nr,{size:"base",margin:"0",color:"inherit",iconValue:h.icon}),h.label]},h.format))}),placement:pa.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:va(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 Zv=f.memo(Kv);function Jv({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:i,onCloseMenu:o,onSortColumn:s,onHideColumn:a,columnKind:l,onChangeFormat:u,onAutosize:c}){const d=$r(),[g,h]=f.useState(!1),{colors:m,fontSizes:p,radii:y,fontWeights:b}=d;f.useEffect(()=>{function S(O){O.preventDefault()}return document.addEventListener("wheel",S,{passive:!1}),document.addEventListener("touchmove",S,{passive:!1}),()=>{document.removeEventListener("wheel",S),document.removeEventListener("touchmove",S)}},[]);const v=f.useCallback(()=>{o()},[o]);return nt(ba,{autoFocus:!0,"aria-label":"Dataframe column menu",content:Tn(Nd,{children:[s&&Tn(Oc,{children:[Tn(Cr,{onClick:()=>{s("asc"),v()},role:"menuitem",children:[nt(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),Tn(Cr,{onClick:()=>{s("desc"),v()},role:"menuitem",children:[nt(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_downward:"}),"Sort descending"]}),nt(jv,{})]}),u&&nt(Zv,{columnKind:l,isOpen:g,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onChangeFormat:u,onCloseMenu:v,children:Tn(Cr,{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),isActive:g,hasSubmenu:!0,children:[Tn("div",{children:[nt(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/format_list_numbered:"}),"Format"]}),nt(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/chevron_right:"})]})}),c&&Tn(Cr,{onClick:()=>{c(),v()},children:[nt(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&Tn(Cr,{onClick:()=>{i(),v()},children:[nt(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&Tn(Cr,{onClick:()=>{r(),v()},children:[nt(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep:"}),"Pin column"]}),a&&Tn(Cr,{onClick:()=>{a(),v()},children:[nt(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:pa.bottomRight,accessibilityType:_c.menu,showArrow:!1,popoverMargin:ln("0.375rem"),onClickOutside:g?void 0:v,onEsc:v,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:va(d)?m.bgColor:m.secondaryBg,color:m.bodyText,fontSize:p.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:nt("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const Qv=f.memo(Jv),e1="(index)",t1=({label:e,initialValue:t,onChange:n})=>{const r=$r();return nt(mg,{checked:t,onChange:i=>{n(i.target.checked)},"aria-label":e,checkmarkType:gg.default,labelPlacement:hg.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:r.spacing.none,marginTop:r.spacing.none,paddingLeft:r.spacing.md,paddingRight:r.spacing.md,paddingTop:r.spacing.twoXS,paddingBottom:r.spacing.twoXS,backgroundColor:i?r.colors.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Checkmark:{style:({$isFocusVisible:i,$checked:o})=>{const s=o?r.colors.primary:r.colors.fadedText40;return{outline:0,width:r.sizes.checkbox,height:r.sizes.checkbox,marginTop:r.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&o?`0 0 0 0.2rem ${si(r.colors.primary,.5)}`:"",borderLeftWidth:r.sizes.borderWidth,borderRightWidth:r.sizes.borderWidth,borderTopWidth:r.sizes.borderWidth,borderBottomWidth:r.sizes.borderWidth,borderLeftColor:s,borderRightColor:s,borderTopColor:s,borderBottomColor:s}}},Label:{style:{lineHeight:r.lineHeights.small,paddingLeft:r.spacing.sm,position:"relative",color:r.colors.bodyText,fontSize:r.fontSizes.sm,fontWeight:r.fontWeights.normal}}},children:e})},n1=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:i,children:o,isOpen:s,onClose:a})=>{const l=$r();return nt(ba,{triggerType:Pc.click,placement:pa.bottomRight,autoFocus:!0,focusLock:!0,content:()=>nt("div",{style:{paddingTop:l.spacing.sm,paddingBottom:l.spacing.sm},children:e.map(u=>{const c=t.length&&!u.isIndex?!t.includes(u.id)&&!t.includes(u.name):!1;return nt(t1,{label:!u.title&&u.isIndex?e1:u.title,initialValue:!(u.isHidden===!0||c),onChange:d=>{d?(i(u.id),c&&n(g=>[...g,u.id])):r(u.id)}},u.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:va(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:nt("div",{children:o})})},r1=f.memo(n1);var i1=yh();const o1=ar(i1);var Jo={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:J.Text,data:"",displayData:"",allowOverlay:!0,content
193
193
  40% { opacity: 1; }
194
194
  `]))),ow=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,s=o.colors,a=o.spacing.baseUnit;return Fe({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})},gs=function(t){var n=t.delay,r=t.offset;return Oe("span",{css:Nc({animation:"".concat(iw," 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"},"","")})},aw=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,s=sr(t,Kb);return Oe("div",ze({},Kt(Fe(Fe({},s),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Oe(gs,{delay:0,offset:r}),Oe(gs,{delay:160,offset:!0}),Oe(gs,{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 Fe({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}})},lw=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,s=t.innerProps,a=t.menuIsOpen;return Oe("div",ze({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)},uw=lw,cw=["data"],dw=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},fw=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 Oe("div",ze({},Kt(t,"group",{group:!0}),l),Oe(s,ze({},a,{selectProps:d,theme:c,getStyles:i,getClassNames:o,cx:r}),u),Oe("div",null,n))},hw=function(t,n){var r=t.theme,i=r.colors,o=r.spacing;return Fe({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"})},gw=function(t){var n=sf(t);n.data;var r=sr(n,cw);return Oe("div",ze({},Kt(t,"groupHeading",{"group-heading":!0}),r))},mw=fw,pw=["innerRef","isDisabled","isHidden","inputClassName"],vw=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,s=o.spacing,a=o.colors;return Fe(Fe({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},bw),n?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:a.neutral80})},pf={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},bw={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Fe({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},pf)},ww=function(t){return Fe({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},pf)},yw=function(t){var n=t.cx,r=t.value,i=sf(t),o=i.innerRef,s=i.isDisabled,a=i.isHidden,l=i.inputClassName,u=sr(i,pw);return Oe("div",ze({},Kt(t,"input",{"input-container":!0}),{"data-value":r||""}),Oe("input",ze({className:n({input:!0},l),ref:o,style:ww(a),disabled:s},u)))},Cw=yw,Sw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,s=r.colors;return Fe({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:s.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},xw=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,s=t.cropWithEllipsis;return Fe({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})},kw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,s=r.colors,a=t.isFocused;return Fe({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}})},vf=function(t){var n=t.children,r=t.innerProps;return Oe("div",r,n)},Mw=vf,Rw=vf;function Ew(e){var t=e.children,n=e.innerProps;return Oe("div",ze({role:"button"},n),t||Oe(gl,{size:14}))}var Iw=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 Oe(u,{data:i,innerProps:Fe(Fe({},Kt(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),o),selectProps:l},Oe(c,{data:i,innerProps:Fe({},Kt(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),Oe(d,{data:i,innerProps:Fe(Fe({},Kt(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:l}))},Tw=Iw,Dw=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,s=t.theme,a=s.spacing,l=s.colors;return Fe({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}})},Ow=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,s=t.innerRef,a=t.innerProps;return Oe("div",ze({},Kt(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:s,"aria-disabled":r},a),n)},Pw=Ow,_w=function(t,n){var r=t.theme,i=r.spacing,o=r.colors;return Fe({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},Fw=function(t){var n=t.children,r=t.innerProps;return Oe("div",ze({},Kt(t,"placeholder",{placeholder:!0}),r),n)},Lw=Fw,Aw=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,s=i.colors;return Fe({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})},Hw=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return Oe("div",ze({},Kt(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},zw=Hw,bf={ClearIndicator:tw,Control:uw,DropdownIndicator:Qb,DownChevron:gf,CrossIcon:gl,Group:mw,GroupHeading:gw,IndicatorsContainer:jb,IndicatorSeparator:rw,Input:Cw,LoadingIndicator:aw,Menu:Fb,MenuList:Ab,MenuPortal:Bb,LoadingMessage:Nb,NoOptionsMessage:Vb,MultiValue:Tw,MultiValueContainer:Mw,MultiValueLabel:Rw,MultiValueRemove:Ew,Option:Pw,Placeholder:Lw,SelectContainer:Ub,SingleValue:zw,ValueContainer:Gb},Vw=function(t){return Fe(Fe({},bf),t.components)},uc=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Nw(e,t){return!!(e===t||uc(e)&&uc(t))}function $w(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Nw(e[n],t[n]))return!1;return!0}function Bw(e,t){t===void 0&&(t=$w);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 Ww={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"},Uw=function(t){return Oe("span",ze({css:Ww},t))},cc=Uw,qw={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(p,y){return p&&p.length?"".concat(p.indexOf(y)+1," of ").concat(p.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:"",".")}},Gw=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,m=l.isMulti,p=l.isOptionDisabled,y=l.isSearchable,b=l.menuIsOpen,v=l.options,S=l.screenReaderStatus,O=l.tabSelectsValue,R=l.isLoading,M=l["aria-label"],_=l["aria-live"],E=f.useMemo(function(){return Fe(Fe({},qw),d||{})},[d]),k=f.useMemo(function(){var x="";if(n&&E.onChange){var $=n.option,G=n.options,X=n.removedValue,ie=n.removedValues,ee=n.value,Q=function(P){return Array.isArray(P)?null:P},te=X||$||Q(ee),se=te?g(te):"",ue=G||ie||void 0,fe=ue?ue.map(g):[],re=Fe({isDisabled:te&&p(te,a),label:se,labels:fe},n);x=E.onChange(re)}return x},[n,E,p,a,g]),F=f.useMemo(function(){var x="",$=r||i,G=!!(r&&a&&a.includes(r));if($&&E.onFocus){var X={focused:$,label:g($),isDisabled:p($,a),isSelected:G,options:o,context:$===r?"menu":"value",selectValue:a,isAppleDevice:c};x=E.onFocus(X)}return x},[r,i,g,p,E,o,a,c]),D=f.useMemo(function(){var x="";if(b&&v.length&&!R&&E.onFilter){var $=S({count:o.length});x=E.onFilter({inputValue:h,resultsMessage:$})}return x},[o,h,b,E,v,S,R]),C=n?.action==="initial-input-focus",I=f.useMemo(function(){var x="";if(E.guidance){var $=i?"value":b?"menu":"input";x=E.guidance({"aria-label":M,context:$,isDisabled:r&&p(r,a),isMulti:m,isSearchable:y,tabSelectsValue:O,isInitialFocus:C})}return x},[M,r,i,m,p,y,b,E,a,O,C]),T=Oe(f.Fragment,null,Oe("span",{id:"aria-selection"},k),Oe("span",{id:"aria-focused"},F),Oe("span",{id:"aria-results"},D),Oe("span",{id:"aria-guidance"},I));return Oe(f.Fragment,null,Oe(cc,{id:u},C&&T),Oe(cc,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},s&&!C&&T))},Yw=Gw,Fs=[{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źẑżžẓẕƶȥɀⱬꝣ"}],jw=new RegExp("["+Fs.map(function(e){return e.letters}).join("")+"]","g"),wf={};for(var ms=0;ms<Fs.length;ms++)for(var ps=Fs[ms],vs=0;vs<ps.letters.length;vs++)wf[ps.letters[vs]]=ps.base;var yf=function(t){return t.replace(jw,function(n){return wf[n]})},Xw=Bw(yf),dc=function(t){return t.replace(/^\s+|\s+$/g,"")},Kw=function(t){return"".concat(t.label," ").concat(t.value)},Zw=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=Fe({ignoreCase:!0,ignoreAccents:!0,stringify:Kw,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,s=i.ignoreAccents,a=i.stringify,l=i.trim,u=i.matchFrom,c=l?dc(r):r,d=l?dc(a(n)):a(n);return o&&(c=c.toLowerCase(),d=d.toLowerCase()),s&&(c=Xw(c),d=yf(d)),u==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},Jw=["innerRef"];function Qw(e){var t=e.innerRef,n=sr(e,Jw),r=Rb(n,"onExited","in","enter","exit","appear");return Oe("input",ze({ref:t},r,{css:Nc({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 ey=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function ty(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,S=v.scrollTop,O=v.scrollHeight,R=v.clientHeight,M=u.current,_=b>0,E=O-R-S,k=!1;E>b&&s.current&&(r&&r(y),s.current=!1),_&&a.current&&(o&&o(y),a.current=!1),_&&b>E?(n&&!s.current&&n(y),M.scrollTop=O,k=!0,s.current=!0):!_&&-b>S&&(i&&!a.current&&i(y),M.scrollTop=0,k=!0,a.current=!0),k&&ey(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]),m=f.useCallback(function(y){if(y){var b=xb?{passive:!1}:!1;y.addEventListener("wheel",d,b),y.addEventListener("touchstart",g,b),y.addEventListener("touchmove",h,b)}},[h,g,d]),p=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 m(y),function(){p(y)}}},[t,m,p]),function(y){u.current=y}}var fc=["boxSizing","height","overflow","paddingRight","position"],hc={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function gc(e){e.cancelable&&e.preventDefault()}function mc(e){e.stopPropagation()}function pc(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function vc(){return"ontouchstart"in window||navigator.maxTouchPoints}var bc=!!(typeof window<"u"&&window.document&&window.document.createElement),Gi=0,ai={capture:!1,passive:!1};function ny(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(bc){var u=document.body,c=u&&u.style;if(r&&fc.forEach(function(m){var p=c&&c[m];i.current[m]=p}),r&&Gi<1){var d=parseInt(i.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,h=window.innerWidth-g+d||0;Object.keys(hc).forEach(function(m){var p=hc[m];c&&(c[m]=p)}),c&&(c.paddingRight="".concat(h,"px"))}u&&vc()&&(u.addEventListener("touchmove",gc,ai),l&&(l.addEventListener("touchstart",pc,ai),l.addEventListener("touchmove",mc,ai))),Gi+=1}},[r]),a=f.useCallback(function(l){if(bc){var u=document.body,c=u&&u.style;Gi=Math.max(Gi-1,0),r&&Gi<1&&fc.forEach(function(d){var g=i.current[d];c&&(c[d]=g)}),u&&vc()&&(u.removeEventListener("touchmove",gc,ai),l&&(l.removeEventListener("touchstart",pc,ai),l.removeEventListener("touchmove",mc,ai)))}},[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 ry=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},iy={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function oy(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=ty({isEnabled:i,onBottomArrive:o,onBottomLeave:s,onTopArrive:a,onTopLeave:l}),c=ny({isEnabled:n}),d=function(h){u(h),c(h)};return Oe(f.Fragment,null,n&&Oe("div",{onClick:ry,css:iy}),t(d))}var ay={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 Oe("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:ay,value:"",onChange:function(){}})},ly=sy;function ml(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 uy(){return ml(/^iPhone/i)}function Cf(){return ml(/^Mac/i)}function cy(){return ml(/^iPad/i)||Cf()&&navigator.maxTouchPoints>1}function dy(){return uy()||cy()}function fy(){return Cf()||dy()}var hy=function(t){return t.label},gy=function(t){return t.label},my=function(t){return t.value},py=function(t){return!!t.isDisabled},vy={clearIndicator:ew,container:Wb,control:sw,dropdownIndicator:Jb,group:dw,groupHeading:hw,indicatorsContainer:Yb,indicatorSeparator:nw,input:vw,loadingIndicator:ow,loadingMessage:zb,menu:Ob,menuList:Lb,menuPortal:$b,multiValue:Sw,multiValueLabel:xw,multiValueRemove:kw,noOptionsMessage:Hb,option:Dw,placeholder:_w,singleValue:Aw,valueContainer:qb},by={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%)"},wy=4,Sf=4,yy=38,Cy=Sf*2,Sy={baseUnit:Sf,controlHeight:yy,menuGutter:Cy},bs={borderRadius:wy,colors:by,spacing:Sy},xy={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:sc(),captureMenuScroll:!sc(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Zw(),formatGroupLabel:hy,getOptionLabel:gy,getOptionValue:my,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:py,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Cb(),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 wc(e,t,n,r){var i=Mf(e,t,n),o=Rf(e,t,n),s=kf(e,t),a=ma(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:s,value:a,index:r}}function ea(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(s,a){return wc(e,s,t,a)}).filter(function(s){return Cc(e,s)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=wc(e,n,t,r);return Cc(e,o)?o:void 0}).filter(kb)}function xf(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,zs(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function yc(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,zs(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 ky(e,t){return xf(ea(e,t))}function Cc(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,s=t.label,a=t.value;return(!If(e)||!o)&&Ef(e,{label:s,value:a,data:i},r)}function My(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 Ry(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var ws=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},kf=function(t,n){return t.getOptionLabel(n)},ma=function(t,n){return t.getOptionValue(n)};function Mf(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function Rf(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=ma(e,t);return n.some(function(i){return ma(e,i)===r})}function Ef(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var If=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},Ey=1,Tf=function(e){yg(n,e);var t=xg(n);function n(r){var i;if(Sg(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=fy(),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,m=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:m}),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,m=d&&i.isOptionSelected(l,h),p=i.isOptionDisabled(l,h);if(m){var y=i.getOptionValue(l);i.setValue(h.filter(function(b){return i.getOptionValue(b)!==y}),"deselect-option",l)}else if(!p)d?i.setValue([].concat(zs(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(m){return i.getOptionValue(m)!==d}),h=jo(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(jo(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=jo(l,d,d[0]||null);c&&i.onChange(g,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(l){return ws(i.state.focusableOptionsWithIds,l)},i.getFocusableOptionsWithIds=function(){return yc(ea(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 pb.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(l){return kf(i.props,l)},i.getOptionValue=function(l){return ma(i.props,l)},i.getStyles=function(l,u){var c=i.props.unstyled,d=vy[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 Vw(i.props)},i.buildCategorizedOptions=function(){return ea(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return xf(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(l,u){i.setState({ariaSelection:Fe({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&&Sa(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 If(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,m=u.isClearable,p=u.isDisabled,y=u.menuIsOpen,b=u.onKeyDown,v=u.tabSelectsValue,S=u.openMenuOnFocus,O=i.state,R=O.focusedOption,M=O.focusedValue,_=O.selectValue;if(!p&&!(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(M)i.removeValue(M);else{if(!d)return;c?i.popValue():m&&i.clearValue()}break;case"Tab":if(i.isComposing||l.shiftKey||!y||!v||!R||S&&i.isOptionSelected(R,_))return;i.selectOption(R);break;case"Enter":if(l.keyCode===229)break;if(y){if(!R||i.isComposing)return;i.selectOption(R);break}return;case"Escape":y?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:h}),i.onMenuClose()):m&&g&&i.clearValue();break;case" ":if(h)return;if(!y){i.openMenu("first");break}if(!R)return;i.selectOption(R);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||++Ey),i.state.selectValue=oc(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=ws(o,s[a])}return i}return Cg(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&&ac(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&&(ac(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(bs):Fe(Fe({},bs),this.props.theme):bs}},{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,m=d.options,p=this.hasValue();return{clearValue:i,cx:o,getStyles:s,getClassNames:a,getValue:l,hasValue:p,isMulti:g,isRtl:h,options:m,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 Mf(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return Rf(this.props,i,o)}},{key:"filterOption",value:function(i,o){return Ef(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(),m=h.Input,p=this.state,y=p.inputIsHidden,b=p.ariaSelection,v=this.commonProps,S=a||this.getElementId("input"),O=Fe(Fe(Fe({"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(m,ze({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:S,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},O)):f.createElement(Qw,ze({id:S,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:ha,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},O))}},{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,m=h.controlShouldRenderValue,p=h.isDisabled,y=h.isMulti,b=h.inputValue,v=h.placeholder,S=this.state,O=S.selectValue,R=S.focusedValue,M=S.isFocused;if(!this.hasValue()||!m)return b?null:f.createElement(d,ze({},g,{key:"placeholder",isDisabled:p,isFocused:M,innerProps:{id:this.getElementId("placeholder")}}),v);if(y)return O.map(function(E,k){var F=E===R,D="".concat(i.getOptionLabel(E),"-").concat(i.getOptionValue(E));return f.createElement(s,ze({},g,{components:{Container:a,Label:l,Remove:u},isFocused:F,isDisabled:p,key:D,index:k,removeProps:{onClick:function(){return i.removeValue(E)},onTouchEnd:function(){return i.removeValue(E)},onMouseDown:function(I){I.preventDefault()}},data:E}),i.formatOptionLabel(E,"value"))});if(b)return null;var _=O[0];return f.createElement(c,ze({},g,{data:_,isDisabled:p}),this.formatOptionLabel(_,"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,ze({},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,ze({},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,ze({},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,ze({},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,m=this.commonProps,p=this.state.focusedOption,y=this.props,b=y.captureMenuScroll,v=y.inputValue,S=y.isLoading,O=y.loadingMessage,R=y.minMenuHeight,M=y.maxMenuHeight,_=y.menuIsOpen,E=y.menuPlacement,k=y.menuPosition,F=y.menuPortalTarget,D=y.menuShouldBlockScroll,C=y.menuShouldScrollIntoView,I=y.noOptionsMessage,T=y.onMenuScrollToTop,x=y.onMenuScrollToBottom;if(!_)return null;var $=function(se,ue){var fe=se.type,re=se.data,H=se.isDisabled,P=se.isSelected,Y=se.label,ce=se.value,he=p===re,ke=H?void 0:function(){return i.onOptionHover(re)},Se=H?void 0:function(){return i.selectOption(re)},Je="".concat(i.getElementId("option"),"-").concat(ue),Ie={id:Je,onClick:Se,onMouseMove:ke,onMouseOver:ke,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:P};return f.createElement(h,ze({},m,{innerProps:Ie,data:re,isDisabled:H,isSelected:P,key:Je,label:Y,type:fe,value:ce,isFocused:he,innerRef:he?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(se.data,"menu"))},G;if(this.hasOptions())G=this.getCategorizedOptions().map(function(te){if(te.type==="group"){var se=te.data,ue=te.options,fe=te.index,re="".concat(i.getElementId("group"),"-").concat(fe),H="".concat(re,"-heading");return f.createElement(s,ze({},m,{key:re,data:se,options:ue,Heading:a,headingProps:{id:H,data:te.data},label:i.formatGroupLabel(te.data)}),te.options.map(function(P){return $(P,"".concat(fe,"-").concat(P.index))}))}else if(te.type==="option")return $(te,"".concat(te.index))});else if(S){var X=O({inputValue:v});if(X===null)return null;G=f.createElement(d,m,X)}else{var ie=I({inputValue:v});if(ie===null)return null;G=f.createElement(g,m,ie)}var ee={minMenuHeight:R,maxMenuHeight:M,menuPlacement:E,menuPosition:k,menuShouldScrollIntoView:C},Q=f.createElement(Pb,ze({},m,ee),function(te){var se=te.ref,ue=te.placerProps,fe=ue.placement,re=ue.maxHeight;return f.createElement(l,ze({},m,ee,{innerRef:se,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:S,placement:fe}),f.createElement(oy,{captureEnabled:b,onTopArrive:T,onBottomArrive:x,lockEnabled:D},function(H){return f.createElement(u,ze({},m,{innerRef:function(Y){i.getMenuListRef(Y),H(Y)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:i.getElementId("listbox")},isLoading:S,maxHeight:re,focusedOption:p}),G)}))});return F||k==="fixed"?f.createElement(c,ze({},m,{appendTo:F,controlElement:this.controlRef,menuPlacement:E,menuPosition:k}),Q):Q}},{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(ly,{name:u,onFocus:this.onValueInputFocus});if(!(!u||a))if(l)if(s){var g=d.map(function(p){return i.getOptionValue(p)}).join(s);return f.createElement("input",{name:u,type:"hidden",value:g})}else{var h=d.length>0?d.map(function(p,y){return f.createElement("input",{key:"i-".concat(y),name:u,type:"hidden",value:i.getOptionValue(p)})}):f.createElement("input",{name:u,type:"hidden",value:""});return f.createElement("div",null,h)}else{var m=d[0]?this.getOptionValue(d[0]):"";return f.createElement("input",{name:u,type:"hidden",value:m})}}},{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(Yw,ze({},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,m=this.state.isFocused,p=this.commonProps=this.getCommonProps();return f.createElement(a,ze({},p,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:g,isFocused:m}),this.renderLiveRegion(),f.createElement(o,ze({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:g,isFocused:m,menuIsOpen:h}),f.createElement(l,ze({},p,{isDisabled:g}),this.renderPlaceholderOrValue(),this.renderInput()),f.createElement(s,ze({},p,{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,m=i.value,p=i.menuIsOpen,y=i.inputValue,b=i.isMulti,v=oc(m),S={};if(s&&(m!==s.value||h!==s.options||p!==s.menuIsOpen||y!==s.inputValue)){var O=p?ky(i,v):[],R=p?yc(ea(i,v),"".concat(g,"-option")):[],M=a?My(o,v):null,_=Ry(o,O),E=ws(R,_);S={selectValue:v,focusedOption:_,focusedOptionId:E,focusableOptionsWithIds:R,focusedValue:M,clearFocusValueOnUpdate:!1}}var k=l!=null&&i!==s?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},F=u,D=c&&d;return c&&!D&&(F={value:jo(b,v,v[0]||null),options:v,action:"initial-input-focus"},D=!d),u?.action==="initial-input-focus"&&(F=null),Fe(Fe(Fe({},S),k),{},{prevProps:i,ariaSelection:F,prevWasFocused:D})}}]),n}(f.Component);Tf.defaultProps=xy;var Iy=f.forwardRef(function(e,t){var n=Q1(e);return f.createElement(Tf,ze({ref:t},n))}),Ty=Iy;const Dy=e=>{const{Menu:t}=bf,{children:n,...r}=e;return f.createElement(t,{...r},n)},Oy=un("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),Py=un("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),_y=un("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),Fy=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=Xm(),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(_y,null,f.createElement(Wr,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):f.createElement(Oy,null,f.createElement(Ty,{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:m})=>({...h,fontSize:d.editorFontSize,fontFamily:d.fontFamily,cursor:m?"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(Py,null,f.createElement(Dy,{className:"click-outside-ignore",...h}))},options:g,onChange:async h=>{h!==null&&(l(h.value),await new Promise(m=>window.requestAnimationFrame(m)),n({...t,data:{...t.data,value:h.value}}))}}))},Ly={kind:J.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+Zn(n,r))),!0},measure:(e,t,n)=>{const{value:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Fy,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 Ay(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 Hy={marginRight:8},zy={display:"flex",alignItems:"center",flexGrow:1},Vy={kind:J.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,m=`${Ay(r.baseFontStyle,.9)} ${r.fontFamily}`,y=Ys(n,m)/2;n.save();let b=0;l!==void 0&&(n.font=m,b=qr(u??l,n,m).width+r.cellHorizontalPadding);const v=i.width-r.cellHorizontalPadding*2-b;if(v>=y){const S=n.createLinearGradient(c,d,c+v,d);S.addColorStop(0,r.accentColor),S.addColorStop(h,r.accentColor),S.addColorStop(h,r.bgBubble),S.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=S,ec(n,c,d-y/2,v,y,y/2),n.fill(),n.beginPath(),ec(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+Zn(n,m))),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:zy},f.createElement("input",{style:Hy,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}}},Ny=un("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),ys=(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}`)}},$y=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?ys(n,t.min,o):t.min,a=t.max instanceof Date?ys(n,t.max,o):t.max,l=ys(n,t.date,o);return e.value.readonly?Vt.createElement(Wr,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):Vt.createElement(Ny,{"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)}})}})},By={kind:J.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return Gs(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:$y}),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)}}},Wy="None";function Sc(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 Uy=e=>{const{cell:t,theme:n,ctx:r}=e;Gs({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`}},Wy,t.contentAlign),r.fillStyle=n.textDark};function qy(e){const t=f.useCallback((r,i)=>{const{cell:o,theme:s,ctx:a,rect:l}=r,u=r.col;if(gi(o))Sc(a,l,s);else if(ya(o)&&u<e.length){const c=e[u];["checkbox","line_chart","bar_chart","progress"].includes(c.kind)?i():Uy(r),c.isRequired&&c.isEditable&&Sc(a,l,s);return}i()},[e]),n=f.useMemo(()=>[Z1,Ly,Vy,By,...M1],[]);return{drawCell:t,customRenderers:n}}function Gy(){const e=$r();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:si(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:si(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroundColor,bgHeaderHasFocus:si(e.colors.darkenedBgMix100,.9),bgHeaderHovered:si(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(ln("1.125rem")),headerFontStyle:`${e.fontWeights.normal} ${ln(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${ln(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:si(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(ln(e.spacing.sm)),cellVerticalPadding:Math.round(ln("0.1875rem")),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,bubbleHeight:Math.round(ln("1.25rem")),bubblePadding:Math.round(ln(e.spacing.sm)),bubbleMargin:Math.round(ln(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(ln(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(ln("25rem")),minColumnWidth:Math.round(ln("3.125rem")),maxColumnWidth:Math.round(ln("62.5rem")),maxColumnAutoWidth:Math.round(ln("31.25rem")),defaultRowHeight:Math.round(ln("2.1875rem")),defaultHeaderHeight:Math.round(ln("2.1875rem")),bgRowHovered:ng(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:n}},[e])}const Yy=Hs.getLogger("useDataEditor");function jy(e,t,n,r,i,o,s,a,l){const u=f.useCallback(([p,y],b)=>{const v=e[p];if(!v.isEditable)return;const S=v.indexNumber,O=n.current.getOriginalRowIndex(i(y)),R=r([p,y]),M=v.getCellValue(R),_=v.getCellValue(b);if(!gi(R)&&_===M)return;const E=v.getCell(_,!0);gi(E)?Yy.warn(`Not applying the cell edit since it causes this error:
195
195
  ${E.data}`):(n.current.setCell(S,O,{...E,lastUpdated:performance.now()}),a())},[e,n,i,r,a]),c=f.useCallback(()=>{if(t)return;const p=new Map;e.forEach(y=>{p.set(y.indexNumber,y.getCell(y.defaultValue))}),n.current.addRow(p),s()},[e,n,t,s]),d=f.useCallback(()=>{t||(c(),a())},[c,a,t]),g=f.useCallback(p=>{if(p.rows.length>0){if(t)return!0;const y=p.rows.toArray().map(b=>n.current.getOriginalRowIndex(i(b)));return n.current.deleteRows(y),s(),l(),a(),!1}if(p.current?.range){const y=[],b=p.current.range;for(let v=b.y;v<b.y+b.height;v++)for(let S=b.x;S<b.x+b.width;S++){const O=e[S];O.isEditable&&!O.isRequired&&(y.push({cell:[S,v]}),u([S,v],O.getCell(null)))}return y.length>0&&(a(),o(y)),!1}return!0},[e,n,t,o,i,a,u,l,s]),h=f.useCallback((p,y)=>{const[b,v]=p,S=[];for(let O=0;O<y.length;O++){const R=y[O];if(O+v>=n.current.getNumRows()){if(t)break;c()}for(let M=0;M<R.length;M++){const _=R[M],E=O+v,k=M+b;if(k>=e.length)break;const F=e[k];if(F.isEditable){const D=F.getCell(_,!0);if(lt(D)&&!gi(D)){const C=F.indexNumber,I=n.current.getOriginalRowIndex(i(E)),T=F.getCellValue(r([k,E]));F.getCellValue(D)!==T&&(n.current.setCell(C,I,{...D,lastUpdated:performance.now()}),S.push({cell:[k,E]}))}}}S.length>0&&(a(),o(S))}return!1},[e,n,t,i,r,c,a,o]),m=f.useCallback((p,y)=>{const b=p[0];if(b>=e.length)return!0;const v=e[b];if(v.validateInput){const S=v.validateInput(v.getCellValue(y));return S===!0||S===!1?S:v.getCell(S)}return!0},[e]);return{onCellEdited:u,onPaste:h,onRowAppended:d,onDelete:g,validateCell:m}}const Df=",",Xi='"',Xy='"',Of=`
196
- `,Ky="\uFEFF",Zy=new RegExp(`[${[Df,Xi,Of].join("")}]`),xc=Hs.getLogger("useDataExporter");function kc(e){return e.map(t=>Jy(t)).join(Df)+Of}function Jy(e){if(Le(e))return"";const t=gt(e);return Zy.test(t)?`${Xi}${t.replace(new RegExp(Xi,"g"),Xy+Xi)}${Xi}`:t}async function Mc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(Ky));const o=n.map(s=>s.name);await e.write(i.encode(kc(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(kc(a)))}await e.close()}function Qy(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 As(()=>import("./es6.BMYexa9t.js").then(c=>c.a),__vite__mapDeps([15,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:s,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await Mc(u,e,t,n)}catch(a){if(a instanceof Error&&a.name==="AbortError")return;try{xc.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 Mc(u.getWriter(),e,t,n);const c=new Blob([l],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),g=bg({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){xc.error("Failed to export data as CSV",l)}}},[t,n,e,r])}}function eC(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=rg(e,u,l);return L1(a,d,g,e.styler?.cssStyles)}catch(a){return Dt("Error during cell creation",`This error should never happen. Please report this bug.
196
+ `,Ky="\uFEFF",Zy=new RegExp(`[${[Df,Xi,Of].join("")}]`),xc=Hs.getLogger("useDataExporter");function kc(e){return e.map(t=>Jy(t)).join(Df)+Of}function Jy(e){if(Le(e))return"";const t=gt(e);return Zy.test(t)?`${Xi}${t.replace(new RegExp(Xi,"g"),Xy+Xi)}${Xi}`:t}async function Mc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(Ky));const o=n.map(s=>s.name);await e.write(i.encode(kc(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(kc(a)))}await e.close()}function Qy(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 As(()=>import("./es6.BhqRltzl.js").then(c=>c.a),__vite__mapDeps([15,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:s,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await Mc(u,e,t,n)}catch(a){if(a instanceof Error&&a.name==="AbortError")return;try{xc.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 Mc(u.getWriter(),e,t,n);const c=new Blob([l],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),g=bg({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){xc.error("Failed to export data as CSV",l)}}},[t,n,e,r])}}function eC(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=rg(e,u,l);return L1(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 tC(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 nC(e,t,n,r,i){const[o,s]=f.useState({columns:it.empty(),rows:it.empty(),current:void 0}),a=!t&&!n&&(e.selectionMode.includes(bn.SelectionMode.MULTI_ROW)||e.selectionMode.includes(bn.SelectionMode.SINGLE_ROW)),l=a&&e.selectionMode.includes(bn.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(bn.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(bn.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(bn.SelectionMode.MULTI_COLUMN),d=o.rows.length>0,g=o.columns.length>0,h=o.current!==void 0,m=f.useCallback(y=>{const b=!Ga(y.rows.toArray(),o.rows.toArray()),v=!Ga(y.columns.toArray(),o.columns.toArray()),S=!Ga(y.current,o.current);let O=a&&b||u&&v,R=y;if((a||u)&&y.current!==void 0&&S&&(R={...y,rows:o.rows,columns:o.columns},O=!1),b&&y.rows.length>0&&v&&y.columns.length===0&&(R={...R,columns:o.columns},O=!0),v&&y.columns.length>0&&b&&y.rows.length===0&&(R={...R,rows:o.rows},O=!0),v&&R.columns.length>=0){let M=R.columns;r.forEach((_,E)=>{_.isIndex&&(M=M.remove(E))}),M.length<R.columns.length&&(R={...R,columns:M})}s(R),O&&i(R)},[o,a,u,i,r]),p=f.useCallback((y=!1,b=!1)=>{const v={columns:b?o.columns:it.empty(),rows:y?o.rows:it.empty(),current:void 0};s(v),(!y&&a||!b&&u)&&i(v)},[o,a,u,i]);return{gridSelection:o,isRowSelectionActivated:a,isMultiRowSelectionActivated:l,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isRowSelected:d,isColumnSelected:g,isCellSelected:h,clearSelection:p,processSelectionChange:m}}function rC(e,t,n,r,i,o,s){const a=e.rowHeight??t.defaultRowHeight,l=t.defaultHeaderHeight+a+2*t.tableBorderWidth,u=r?2:1,c=e.editingMode===bn.EditingMode.DYNAMIC?1:0,d=n+c;let g=Math.max(d*a+u*t.defaultHeaderHeight+2*t.tableBorderWidth,l),h=Math.min(g,t.defaultTableHeight);e.height&&(h=Math.max(e.height,l),g=Math.max(e.height,g)),o&&(h=Math.min(h,o),g=Math.min(g,o),e.height||(h=g));const m=t.minColumnWidth+2*t.tableBorderWidth,p=Math.max(i,m);let y,b=p;e.useContainerWidth?y=p:e.width&&(y=Math.min(Math.max(e.width,m),p),b=Math.min(Math.max(e.width,b),p));const[v,S]=f.useState({width:y||"100%",height:h});return f.useLayoutEffect(()=>{e.useContainerWidth&&v.width==="100%"&&S(O=>({...O,width:p}))},[p]),f.useLayoutEffect(()=>{S(O=>({...O,width:y||"100%"}))},[y]),f.useLayoutEffect(()=>{S(O=>({...O,height:h}))},[h,n]),f.useLayoutEffect(()=>{if(s){const O=e.useContainerWidth||lt(e.width)&&e.width>0;S({width:O?b:"100%",height:g})}else S({width:y||"100%",height:h})},[s]),{minHeight:l,maxHeight:g,minWidth:m,maxWidth:b,rowHeight:a,resizableSize:v,setResizableSize:S}}const iC=600,oC="⚠️ Please fill out this cell.";function aC(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]);gi(h)?d=h.errorDetails:g.isRequired&&g.isEditable&&ya(h)?d=oC:c1(h)&&(d=h.tooltip)}d&&(o.current=setTimeout(()=>{d&&i({content:d,left:l.bounds.x+l.bounds.width/2,top:l.bounds.y})},iC))}},[e,t,i,o,n]),a=f.useCallback(()=>{i(void 0)},[i]);return{tooltip:r,clearTooltip:a,onItemHovered:s}}function sC({top:e,left:t,content:n,clearTooltip:r}){const[i,o]=f.useState(!0),s=$r(),{colors:a,fontSizes:l,radii:u,fontWeights:c}=s,d=f.useCallback(()=>{o(!1),r()},[r,o]);return nt(ba,{content:nt(ig,{"data-testid":"stDataFrameTooltipContent",children:nt(og,{style:{fontSize:l.sm},source:n,allowHTML:!1})}),placement:pa.top,accessibilityType:_c.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:va(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:nt("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const lC=f.memo(sC),Rc=vi("div",{target:"e1u61huh0"})(({hasCustomizedScrollbars:e,theme:t})=>({position:"relative",display:"inline-block","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",borderRadius:t.radii.default},"& .dvn-scroller":{...!e&&{scrollbarWidth:"thin"},overflowX:"auto !important",overflowY:"auto !important"},"& .gdg-search-bar":{maxWidth:"19rem",width:"80%",minWidth:"6rem",top:t.spacing.sm,right:t.spacing.sm,padding:t.spacing.sm,borderRadius:t.radii.default,"& .gdg-search-status":{paddingTop:t.spacing.twoXS,fontSize:t.fontSizes.twoSm},"& .gdg-search-progress":{display:"none"},"& input":{width:"100%"},"& button":{width:t.iconSizes.xl,height:t.iconSizes.xl,"& .button-icon":{width:t.iconSizes.base,height:t.iconSizes.base}}}})),Ec=150,uC=15e4,Xo=6;function cC({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:i,fragmentId:o}){const{expanded:s,expand:a,collapse:l,width:u,height:c}=ag(dg),d=f.useRef(null),g=f.useRef(null),h=f.useRef(null),m=Gy(),{getRowThemeOverride:p,onItemHovered:y}=tC(m),{libConfig:{enforceDownloadInNewTab:b=!1}}=f.useContext(sg),[v,S]=f.useState(!0),[O,R]=f.useState(!1),[M,_]=f.useState(!1),[E,k]=f.useState(!1),[F,D]=f.useState(),[C,I]=f.useState(!1),T=f.useCallback(()=>I(ge=>!ge),[]),x=f.useCallback(()=>I(!1),[]),$=f.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]),G=f.useMemo(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome"),[]);Le(e.editingMode)&&(e.editingMode=bn.EditingMode.READ_ONLY);const{READ_ONLY:X,DYNAMIC:ie}=bn.EditingMode,ee=t.dimensions,Q=Math.max(0,ee.numDataRows),te=Q===0&&!(e.editingMode===ie&&ee.numDataColumns>0),se=Q>uC,ue=!se&&!te&&e.editingMode!==ie,fe=!te&&e.editingMode===ie&&!n,re=f.useRef(new Uo(Q)),[H,P]=f.useState(re.current.getNumRows());f.useEffect(()=>{re.current=new Uo(Q),P(re.current.getNumRows())},[Q]);const Y=f.useCallback(()=>{re.current=new Uo(Q),P(re.current.getNumRows())},[Q]),[ce,he]=f.useState(e.columnOrder);f.useEffect(()=>{he(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:ke,allColumns:Se,setColumnConfigMapping:Je}=z1(e,t,n,ce);f.useEffect(()=>{if(e.editingMode===X)return;const ge=r.getStringValue({id:e.id,formId:e.formId});ge&&(re.current.fromJson(ge,ke),P(re.current.getNumRows()))},[]);const{getCellContent:Ie}=eC(t,ke,H,re),{columns:Qe,sortColumn:kt,getOriginalIndex:$e,getCellContent:ne}=j1(Q,ke,Ie),me=f.useCallback(ge=>{const bt={selection:{rows:[],columns:[]}};bt.selection.rows=ge.rows.toArray().map($t=>$e($t)),bt.selection.columns=ge.columns.toArray().map($t=>eo(Qe[$t]));const Qt=JSON.stringify(bt),Et=r.getStringValue({id:e.id,formId:e.formId});(Et===void 0||Et!==Qt)&&r.setStringValue({id:e.id,formId:e.formId},Qt,{fromUi:!0},o)},[Qe,e.id,e.formId,r,o,$e]),{debouncedCallback:xe}=Nu(me,Ec),{gridSelection:de,isRowSelectionActivated:be,isMultiRowSelectionActivated:Pe,isColumnSelectionActivated:Te,isMultiColumnSelectionActivated:st,isRowSelected:Re,isColumnSelected:qe,isCellSelected:He,clearSelection:we,processSelectionChange:Be}=nC(e,te,n,Qe,xe);f.useEffect(()=>{we(!0,!0)},[s]);const mt=f.useCallback(ge=>{g.current?.updateCells(ge)},[]);f.useEffect(()=>{if(!be&&!Te)return;const ge=r.getStringValue({id:e.id,formId:e.formId});if(ge){const bt=Qe.map(on=>eo(on)),Qt=JSON.parse(ge);let Et=it.empty(),$t=it.empty();Qt.selection?.rows?.forEach(on=>{Et=Et.add(on)}),Qt.selection?.columns?.forEach(on=>{$t=$t.add(bt.indexOf(on))}),(Et.length>0||$t.length>0)&&Be({rows:Et,columns:$t,current:void 0})}},[]);const ft=f.useCallback(()=>{H!==re.current.getNumRows()&&P(re.current.getNumRows())},[H]),Ge=f.useCallback(()=>{const ge=re.current.toJson(Qe);let bt=r.getStringValue({id:e.id,formId:e.formId});bt===void 0&&(bt=new Uo(0).toJson([])),ge!==bt&&r.setStringValue({id:e.id,formId:e.formId},ge,{fromUi:!0},o)},[Qe,e.id,e.formId,r,o]),{debouncedCallback:yt}=Nu(Ge,Ec),{exportToCsv:Yt}=Qy(ne,Qe,H,b),{onCellEdited:Ht,onPaste:Mt,onRowAppended:nn,onDelete:qt,validateCell:cn}=jy(Qe,e.editingMode!==ie,re,ne,$e,mt,ft,yt,we),Ot=f.useMemo(()=>te?[0]:fe?[H]:[],[te,fe,H]),{tooltip:ut,clearTooltip:tn,onItemHovered:Ct}=aC(Qe,ne,Ot),{drawCell:rn,customRenderers:Bt}=qy(Qe),{provideEditor:De}=K1(),It=f.useCallback(ge=>({...ge,hasMenu:!te}),[te]),Pt=f.useMemo(()=>Qe.map(ge=>It(Os(ge))),[Qe,It]),{columns:wn,onColumnResize:jt}=B1(Pt),dn=t.dimensions.numHeaderRows>1,{minHeight:Mn,maxHeight:Xt,minWidth:Jt,maxWidth:We,rowHeight:Rt,resizableSize:yn,setResizableSize:vt}=rC(e,m,H,dn,u||0,c,s),Ft=f.useCallback(([ge,bt])=>({...d1(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:m.glideTheme.textLight},span:[0,Math.max(Qe.length-1,0)]}),[Qe,m.glideTheme.textLight]),Cn=f.useCallback(()=>{Y(),we()},[Y,we]);ug({element:e,widgetMgr:r,onFormCleared:Cn});const{pinColumn:Wn,unpinColumn:zn,freezeColumns:N}=N1(Qe,te,u||0,m.minColumnWidth,we,Je),{changeColumnFormat:Ne}=V1(Je),{hideColumn:Ue,showColumn:St}=X1(we,Je),{onColumnMoved:mn}=$1(Qe,N,Wn,zn,he);return f.useEffect(()=>{setTimeout(()=>{if(h.current&&g.current){const ge=h.current?.querySelector(".dvn-stack")?.getBoundingClientRect();ge&&(_(ge.height>h.current.clientHeight),k(ge.width>h.current.clientWidth))}},1)},[yn,H,wn]),f.useEffect(()=>{Se.length==Qe.length&&I(!1)},[Se.length,Qe.length]),Tn(Rc,{className:"stDataFrame","data-testid":"stDataFrame",hasCustomizedScrollbars:G,ref:h,onMouseDown:ge=>{if(h.current&&G){const bt=h.current.getBoundingClientRect();E&&bt.height-(Xo+1)<ge.clientY-bt.top&&ge.stopPropagation(),M&&bt.width-(Xo+1)<ge.clientX-bt.left&&ge.stopPropagation()}},onBlur:ge=>{!v&&!$&&!ge.currentTarget.contains(ge.relatedTarget)&&we(!0,!0)},children:[Tn(fg,{isFullScreen:s,disableFullscreenMode:i,locked:Re&&!be||He||$&&v||C,onExpand:a,onCollapse:l,target:Rc,children:[(be&&Re||Te&&qe)&&nt(oi,{label:"Clear selection",icon:wg,onClick:()=>{we(),tn()}}),fe&&Re&&nt(oi,{label:"Delete row(s)",icon:kg,onClick:()=>{qt&&(qt(de),tn())}}),fe&&!Re&&nt(oi,{label:"Add row",icon:$c,onClick:()=>{nn&&(S(!0),nn(),tn(),g.current?.scrollTo(0,H,"vertical"))}}),!te&&Se.length>Qe.length&&nt(r1,{columns:Se,columnOrder:ce,setColumnOrder:he,hideColumn:Ue,showColumn:St,isOpen:C,onClose:x,children:nt(oi,{label:"Show/hide columns",icon:Wc,onClick:T})}),!se&&!te&&nt(oi,{label:"Download as CSV",icon:Mg,onClick:Yt}),!te&&nt(oi,{label:"Search",icon:Bc,onClick:()=>{O?R(!1):(S(!0),R(!0)),tn()}})]}),nt(lg,{"data-testid":"stDataFrameResizable",ref:d,defaultSize:yn,style:{border:`${m.tableBorderWidth}px solid ${m.glideTheme.borderColor}`,borderRadius:`${m.tableBorderRadius}`},minHeight:Mn,maxHeight:Xt,minWidth:Jt,maxWidth:We,size:yn,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,Rt],snapGap:Rt/3,onResizeStop:(ge,bt,Qt,Et)=>{if(d.current){const $t=2*m.tableBorderWidth;vt({width:d.current.size.width,height:Xt-d.current.size.height===$t?d.current.size.height+$t:d.current.size.height})}},children:nt(Yv,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:g,columns:wn,rows:te?1:H,minColumnWidth:m.minColumnWidth,maxColumnWidth:m.maxColumnWidth,maxColumnAutoWidth:m.maxColumnAutoWidth,rowHeight:Rt,headerHeight:m.defaultHeaderHeight,getCellContent:te?Ft:ne,onColumnResize:$?void 0:jt,resizeIndicator:"header",freezeColumns:N,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:$?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:Te?void 0:mn,onItemHovered:ge=>{y?.(ge),Ct?.(ge)},keybindings:{downFill:!0},onKeyDown:ge=>{(ge.ctrlKey||ge.metaKey)&&ge.key==="f"&&(R(bt=>!bt),ge.stopPropagation(),ge.preventDefault())},showSearch:O,searchResults:O?void 0:[],onSearchClose:()=>{R(!1),tn()},onHeaderClicked:(ge,bt)=>{!ue||Te||(O&&R(!1),be&&Re?we():we(!0,!0),kt(ge,"auto"))},gridSelection:de,onGridSelectionChange:ge=>{(v||$)&&(Be(ge),ut!==void 0&&tn())},theme:m.glideTheme,getRowThemeOverride:p,onMouseMove:ge=>{ge.kind==="out-of-bounds"&&v?S(!1):ge.kind!=="out-of-bounds"&&!v&&S(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...G&&{paddingBottom:E?-Xo:void 0,paddingRight:M?-Xo:void 0}},provideEditor:De,drawCell:rn,customRenderers:Bt,imageEditorOverride:k1,headerIcons:m.headerIcons,validateCell:cn,onHeaderMenuClick:(ge,bt)=>{D({columnIdx:ge,headerBounds:bt})},onPaste:!1,...be&&{rowMarkers:{kind:"checkbox-visible",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader,textMedium:m.glideTheme.textLight}},rowSelectionMode:Pe?"multi":"auto",rowSelect:n?"none":Pe?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...Te&&{columnSelect:n?"none":st?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!te&&e.editingMode!==X&&!n&&{fillHandle:!$,onCellEdited:Ht,onPaste:Mt,onDelete:qt},...!te&&e.editingMode===ie&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:nn,onHeaderClicked:void 0}})}),ut&&ut.content&&nt(lC,{top:ut.top,left:ut.left,content:ut.content,clearTooltip:tn}),F&&Vc.createPortal(nt(Qv,{top:F.headerBounds.y+F.headerBounds.height,left:F.headerBounds.x+F.headerBounds.width,columnKind:ke[F.columnIdx].kind,onCloseMenu:()=>D(void 0),onSortColumn:ue?ge=>{O&&R(!1),we(!(be&&Re),!0),kt(F.columnIdx,ge,!0)}:void 0,isColumnPinned:ke[F.columnIdx].isPinned,onUnpinColumn:()=>{zn(ke[F.columnIdx].id)},onPinColumn:()=>{Wn(ke[F.columnIdx].id)},onHideColumn:()=>{Ue(ke[F.columnIdx].id)},onChangeFormat:ge=>{Ne(ke[F.columnIdx].id,ge),setTimeout(()=>{g.current?.remeasureColumns(it.fromSingleSelection(F.columnIdx))},100)},onAutosize:()=>{g.current?.remeasureColumns(it.fromSingleSelection(F.columnIdx))}}),document.querySelector("#portal"))]})}const dC=cg(cC),fC=f.memo(dC),MC=Object.freeze(Object.defineProperty({__proto__:null,default:fC},Symbol.toStringTag,{value:"Module"}));export{E0 as C,Cd as T,di as a,Og as b,MC as c,li as i,jm as m,un as s};