streamlit-nightly 1.42.2.dev20250218__py2.py3-none-any.whl → 1.42.2.dev20250219__py2.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 (72) hide show
  1. streamlit/static/index.html +1 -1
  2. streamlit/static/static/js/{FileDownload.esm.DU-1rCSB.js → FileDownload.esm.gA2YL2Ws.js} +1 -1
  3. streamlit/static/static/js/{FileDropzone.BI3MGDdT.js → FileDropzone.CFdsfZRc.js} +1 -1
  4. streamlit/static/static/js/{FormClearHelper.DzU-mNjk.js → FormClearHelper.CUy5uXTm.js} +1 -1
  5. streamlit/static/static/js/{Hooks.qUbVZL-A.js → Hooks.DK2XYjwG.js} +1 -1
  6. streamlit/static/static/js/{InputInstructions.CpNPMMpX.js → InputInstructions.BliBOyQ3.js} +1 -1
  7. streamlit/static/static/js/{ProgressBar.4yIafGOA.js → ProgressBar.x1Isa69D.js} +1 -1
  8. streamlit/static/static/js/{RenderInPortalIfExists.31NYBozH.js → RenderInPortalIfExists.BAeceYUy.js} +1 -1
  9. streamlit/static/static/js/{Toolbar.lnT7wtEH.js → Toolbar.CT8DybSu.js} +1 -1
  10. streamlit/static/static/js/{base-input.DYDwDBVN.js → base-input.DCz9tkLd.js} +1 -1
  11. streamlit/static/static/js/{createSuper.CP_bqXkl.js → createSuper.C7LhI0EH.js} +1 -1
  12. streamlit/static/static/js/{data-grid-overlay-editor.Bw6S-08j.js → data-grid-overlay-editor.BCdg4YOG.js} +1 -1
  13. streamlit/static/static/js/{downloader.DZpOwdni.js → downloader.vdos0sUi.js} +1 -1
  14. streamlit/static/static/js/{es6.D670kkuw.js → es6.DwFVXqV3.js} +2 -2
  15. streamlit/static/static/js/{iframeResizer.contentWindow.CBWvp4oS.js → iframeResizer.contentWindow.RYpo13Tx.js} +1 -1
  16. streamlit/static/static/js/{index.0jzSLI-x.js → index.B6ax18R8.js} +1 -1
  17. streamlit/static/static/js/{index.Bif_gpeX.js → index.B7_aOrfa.js} +1 -1
  18. streamlit/static/static/js/{index.CrYKK91g.js → index.BGAu9NKr.js} +1 -1
  19. streamlit/static/static/js/{index.CD53GuKN.js → index.BZeSmopR.js} +1 -1
  20. streamlit/static/static/js/{index.8M0nMTyK.js → index.BdXu9OaH.js} +1 -1
  21. streamlit/static/static/js/{index.D3VdaBwP.js → index.BkCG7aTj.js} +1 -1
  22. streamlit/static/static/js/{index.DHBu5iL6.js → index.BpjiEyUX.js} +1 -1
  23. streamlit/static/static/js/{index.C5VAa8DZ.js → index.C-qg2uWr.js} +1 -1
  24. streamlit/static/static/js/{index.DJF89pFO.js → index.C1c-PWwv.js} +1 -1
  25. streamlit/static/static/js/{index.D6UL3iMZ.js → index.C53pKB0j.js} +1 -1
  26. streamlit/static/static/js/{index.BkURA4Nq.js → index.C5SUBN7c.js} +1 -1
  27. streamlit/static/static/js/{index.B6KnC7nW.js → index.C5Vmgs5Q.js} +1 -1
  28. streamlit/static/static/js/{index.DdeHhk74.js → index.CO-uFT7b.js} +1 -1
  29. streamlit/static/static/js/{index.BMlBBPxY.js → index.CP5mPDkY.js} +1 -1
  30. streamlit/static/static/js/{index.CLsHMaqe.js → index.CTtluRFB.js} +5 -5
  31. streamlit/static/static/js/{index.CA6bEd5D.js → index.CYAXfbfU.js} +1 -1
  32. streamlit/static/static/js/{index.DRJutLeV.js → index.CYBSRaVx.js} +1 -1
  33. streamlit/static/static/js/{index.DNEGP5ih.js → index.CaA1VIZR.js} +1 -1
  34. streamlit/static/static/js/{index.De5HitMn.js → index.CbM0IQPr.js} +1 -1
  35. streamlit/static/static/js/{index.B-Bz2NGO.js → index.CpJnG_8d.js} +1 -1
  36. streamlit/static/static/js/{index.DsvnAu-2.js → index.D0h2TgPB.js} +1 -1
  37. streamlit/static/static/js/{index.Du4f6P1i.js → index.D8iwKK7d.js} +1 -1
  38. streamlit/static/static/js/{index.-wGNsvT9.js → index.DA71zvn-.js} +1 -1
  39. streamlit/static/static/js/{index.D8aCPmhr.js → index.DCnVdrNR.js} +1 -1
  40. streamlit/static/static/js/{index.Ch1c3KR1.js → index.DFovZsvy.js} +1 -1
  41. streamlit/static/static/js/{index.ChIZFRw0.js → index.DGog6RGy.js} +1 -1
  42. streamlit/static/static/js/{index.B9mk7o4G.js → index.DSORXUAZ.js} +1 -1
  43. streamlit/static/static/js/{index.DS38XxzV.js → index.DTMcwebh.js} +1 -1
  44. streamlit/static/static/js/{index.Byj6qntv.js → index.DTik05yh.js} +1 -1
  45. streamlit/static/static/js/{index.edlGQJ3v.js → index.Dc1YdleN.js} +5 -5
  46. streamlit/static/static/js/{index.C0O8ISw8.js → index.DgLxA-9p.js} +1 -1
  47. streamlit/static/static/js/index.Dh8M84uS.js +1 -0
  48. streamlit/static/static/js/{index.XAUdgEdp.js → index.DuxM9Tnh.js} +1 -1
  49. streamlit/static/static/js/{index.HCbHLWBq.js → index.XBfbnu7R.js} +1 -1
  50. streamlit/static/static/js/{index.CKT6gwZG.js → index.Ya6ZDkVG.js} +1 -1
  51. streamlit/static/static/js/{index.BhTUDBBK.js → index.rOQjzSJF.js} +1 -1
  52. streamlit/static/static/js/{index.BCorV1AX.js → index.zBfRJuNm.js} +1 -1
  53. streamlit/static/static/js/{input.e-37_Dj1.js → input.DI1DKx6K.js} +1 -1
  54. streamlit/static/static/js/{memory.B5p-2jga.js → memory.Bys8G1q2.js} +1 -1
  55. streamlit/static/static/js/{mergeWith.D8nk5iJa.js → mergeWith.CQCg1Krv.js} +1 -1
  56. streamlit/static/static/js/{number-overlay-editor.DLD5-9zx.js → number-overlay-editor.C7xqWB6m.js} +1 -1
  57. streamlit/static/static/js/{possibleConstructorReturn.eeV6HB6T.js → possibleConstructorReturn.CoBITkSn.js} +1 -1
  58. streamlit/static/static/js/{sandbox.ChKquq8J.js → sandbox.DhWaUNlZ.js} +1 -1
  59. streamlit/static/static/js/{textarea.ZI_0MUsX.js → textarea.BBYT1EyU.js} +1 -1
  60. streamlit/static/static/js/{timepicker.C8N66VUc.js → timepicker.BNm3w13Y.js} +1 -1
  61. streamlit/static/static/js/{toConsumableArray.DKg00cRh.js → toConsumableArray.CdvkF-LC.js} +1 -1
  62. streamlit/static/static/js/{uniqueId.fc9w8X88.js → uniqueId.C4bthDRw.js} +1 -1
  63. streamlit/static/static/js/{useBasicWidgetState.CySX_BlM.js → useBasicWidgetState.B8drr2-Z.js} +1 -1
  64. streamlit/static/static/js/{useOnInputChange.BF6Trlh5.js → useOnInputChange.DxZMmV5y.js} +1 -1
  65. streamlit/static/static/js/{withFullScreenWrapper.x2WsM7iA.js → withFullScreenWrapper.KpXeL4S_.js} +1 -1
  66. {streamlit_nightly-1.42.2.dev20250218.dist-info → streamlit_nightly-1.42.2.dev20250219.dist-info}/METADATA +1 -1
  67. {streamlit_nightly-1.42.2.dev20250218.dist-info → streamlit_nightly-1.42.2.dev20250219.dist-info}/RECORD +71 -71
  68. streamlit/static/static/js/index.Cvgj5_qB.js +0 -1
  69. {streamlit_nightly-1.42.2.dev20250218.data → streamlit_nightly-1.42.2.dev20250219.data}/scripts/streamlit.cmd +0 -0
  70. {streamlit_nightly-1.42.2.dev20250218.dist-info → streamlit_nightly-1.42.2.dev20250219.dist-info}/WHEEL +0 -0
  71. {streamlit_nightly-1.42.2.dev20250218.dist-info → streamlit_nightly-1.42.2.dev20250219.dist-info}/entry_points.txt +0 -0
  72. {streamlit_nightly-1.42.2.dev20250218.dist-info → streamlit_nightly-1.42.2.dev20250219.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.Bw6S-08j.js","./index.CLsHMaqe.js","../css/index.DpJG_94W.css","./FormClearHelper.DzU-mNjk.js","./withFullScreenWrapper.x2WsM7iA.js","./Toolbar.lnT7wtEH.js","./mergeWith.D8nk5iJa.js","./sprintf.D7DtBTRn.js","./createDownloadLinkElement.DZMwyjvU.js","./toConsumableArray.DKg00cRh.js","./possibleConstructorReturn.eeV6HB6T.js","./createSuper.CP_bqXkl.js","./FileDownload.esm.DU-1rCSB.js","./number-overlay-editor.DLD5-9zx.js","./es6.D670kkuw.js"])))=>i.map(i=>d[i]);
2
- var Zf=Object.defineProperty;var Jf=(e,t,n)=>t in e?Zf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var dt=(e,t,n)=>Jf(e,typeof t!="symbol"?t+"":t,n);import{r as g,E as pc,_ as tt,c as Qf,g as pr,R as se,i as Va,d as ro,e as eh,f as th,h as nh,l as vc,m as bc,o as rh,p as wc,q as ih,s as oh,t as ah,u as sh,v as lh,w as uh,a as ar,x as Es,n as io,y as ma,j as Kt,z as $n,A as yc,B as Cc,C as Ir,D as Sc,F as ch,G as To,H as xc,I as dh,J as fh,K as nt,L as kc,M as bt,N as Wi,O as Nr,Q as hh,S as Sl,T as gh,U as Mc,V as mh,W as ph,X as ms,Y as Rc,Z as Ec,$ as vh,a0 as bh,a1 as wh,a2 as yh,a3 as Ch,a4 as Sh,a5 as xh,a6 as kh,a7 as Mh,a8 as Rh,a9 as Ic,aa as Eh,ab as Ih,ac as Th,ad as Dh,ae as Oh,af as Ph,ag as _h,ah as Lh,ai as Fh,aj as Ah,ak as Hh,al as zh,am as Bn,an as Is,ao as Ui,ap as vr,aq as Be,ar as Vh,b as Tc,as as Dc,k as $h,at as $a,au as Nh,av as Bh,aw as Na,ax as Wh,ay as Uh,az as qh,aA as Yh}from"./index.CLsHMaqe.js";import{u as Xh}from"./FormClearHelper.DzU-mNjk.js";import{w as Gh,u as jh,E as Kh}from"./withFullScreenWrapper.x2WsM7iA.js";import{T as Zh,a as Di}from"./Toolbar.lnT7wtEH.js";import{m as Jh}from"./mergeWith.D8nk5iJa.js";import{s as Qh}from"./sprintf.D7DtBTRn.js";import{c as eg}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as hr,a as Ts,C as tg}from"./toConsumableArray.DKg00cRh.js";import{_ as ng,a as rg,b as ig}from"./possibleConstructorReturn.eeV6HB6T.js";import{_ as og}from"./createSuper.CP_bqXkl.js";import{D as ag,F as sg}from"./FileDownload.esm.DU-1rCSB.js";var Oc=g.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return g.createElement(pc,tt({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),g.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),g.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Oc.displayName="Add";var Pc=g.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return g.createElement(pc,tt({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),g.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),g.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"}))});Pc.displayName="Search";function _c(e="This should not happen"){throw new Error(e)}function Pn(e,t="Assertion failed"){if(!e)return _c(t)}function Ji(e,t){return _c(t??"Hell froze over")}function lg(e,t){try{return e()}catch{return t}}const xl=Object.prototype.hasOwnProperty;function fi(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--&&fi(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(xl.call(e,n)&&++r&&!xl.call(t,n)||!(n in t)||!fi(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}var Ba,kl;function ug(){if(kl)return Ba;kl=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return Ba=n,Ba}var Wa,Ml;function cg(){if(Ml)return Wa;Ml=1;var e=ug(),t=Qf();function n(r,i){return r!=null&&t(r,i,e)}return Wa=n,Wa}var dg=cg();const fg=pr(dg),Jo=null,Ds=void 0;var re;(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"})(re||(re={}));var Rl;(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"})(Rl||(Rl={}));var Qo;(function(e){e.Triangle="triangle",e.Dots="dots"})(Qo||(Qo={}));function Do(e){return"width"in e&&typeof e.width=="number"}async function El(e){return typeof e=="object"?e:await e()}function ai(e){return!(e.kind===re.Loading||e.kind===re.Bubble||e.kind===re.RowID||e.kind===re.Protected||e.kind===re.Drilldown)}function li(e){return e.kind===Un.Marker||e.kind===Un.NewRow}function qi(e){if(!ai(e)||e.kind===re.Image)return!1;if(e.kind===re.Text||e.kind===re.Number||e.kind===re.Markdown||e.kind===re.Uri||e.kind===re.Custom||e.kind===re.Boolean)return e.readonly!==!0;Ji(e,"A cell was passed with an invalid kind")}function hg(e){return fg(e,"editor")}function Os(e){return!(e.readonly??!1)}var Un;(function(e){e.NewRow="new-row",e.Marker="marker"})(Un||(Un={}));function gg(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 Il;const fr=class fr{constructor(t){dt(this,"items");this.items=t}offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new fr(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=gg([...this.items,n]);return new fr(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,a]of n.entries()){const[l,s]=a;if(l<=i&&r<=s){const u=[];l<r&&u.push([l,r]),i<s&&u.push([i,s]),n.splice(o,1,...u)}}return new fr(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}};dt(fr,"empty",()=>Il??(Il=new fr([]))),dt(fr,"fromSingleSelection",t=>fr.empty().add(t));let vt=fr;var mg=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(l=>{if(l.startsWith("atm_")){const[,s]=l.split("_");n[s]=l}else r.push(l)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},Tl=mg,pg=e=>e.toUpperCase()===e,vg=e=>t=>e.indexOf(t)===-1,Lc=(e,t)=>{const n={};return Object.keys(e).filter(vg(t)).forEach(r=>{n[r]=e[r]}),n};function bg(e,t,n){const r=Lc(t,n);if(!e){const i=typeof Va=="function"?{default:Va}:Va;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var wg=(e,t)=>{};function yg(e){let t="";return n=>{const r=(o,a)=>{const{as:l=e,class:s=t}=o,u=n.propsAsIs===void 0?!(typeof l=="string"&&l.indexOf("-")===-1&&!pg(l[0])):n.propsAsIs,c=bg(u,o,["as","class"]);c.ref=a,c.className=n.atomic?Tl(n.class,c.className||s):Tl(c.className||s,n.class);const{vars:d}=n;if(d){const f={};for(const p in d){const v=d[p],y=v[0],b=v[1]||"",R=typeof y=="function"?y(o):y;wg(R,n.name),f[`--${p}`]=`${R}${b}`}const h=c.style||{},m=Object.keys(h);m.length>0&&m.forEach(p=>{f[p]=h[p]}),c.style=f}return e.__linaria&&e!==l?(c.as=l,se.createElement(e,c)):se.createElement(l,c)},i=se.forwardRef?se.forwardRef(r):o=>{const a=Lc(o,["innerRef"]);return r(a,o.innerRef)};return i.displayName=n.name,i.__linaria={className:n.class||t,extends:e},i}}var fn=yg;const Cg=fn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Ua={},Oi={},Oo={},Po={},Dl;function Sg(){return Dl||(Dl=1,function(e){(function(t,n){n(e,ro(),eh())})(Po,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var i=a(n),o=a(r);function a(b){return b&&b.__esModule?b:{default:b}}var l=Object.assign||function(b){for(var R=1;R<arguments.length;R++){var O=arguments[R];for(var S in O)Object.prototype.hasOwnProperty.call(O,S)&&(b[S]=O[S])}return b};function s(b,R){var O={};for(var S in b)R.indexOf(S)>=0||Object.prototype.hasOwnProperty.call(b,S)&&(O[S]=b[S]);return O}function u(b,R){if(!(b instanceof R))throw new TypeError("Cannot call a class as a function")}var c=function(){function b(R,O){for(var S=0;S<O.length;S++){var M=O[S];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(R,M.key,M)}}return function(R,O,S){return O&&b(R.prototype,O),S&&b(R,S),R}}();function d(b,R){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:b}function f(b,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);b.prototype=Object.create(R&&R.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(b,R):b.__proto__=R)}var h=!1;function m(b){h=b}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){m(!0)}}))}catch{}function p(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return h?b:b.capture}function v(b){if("touches"in b){var R=b.touches[0],O=R.pageX,S=R.pageY;return{x:O,y:S}}var M=b.screenX,_=b.screenY;return{x:M,y:_}}var y=function(b){f(R,b);function R(){var O;u(this,R);for(var S=arguments.length,M=Array(S),_=0;_<S;_++)M[_]=arguments[_];var E=d(this,(O=R.__proto__||Object.getPrototypeOf(R)).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(R,[{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(S){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(S))}},{key:"_onMouseMove",value:function(S){this.mouseDown&&this._handleSwipeMove(S)}},{key:"_onMouseUp",value:function(S){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(S)}},{key:"_handleSwipeStart",value:function(S){var M=v(S),_=M.x,E=M.y;this.moveStart={x:_,y:E},this.props.onSwipeStart(S)}},{key:"_handleSwipeMove",value:function(S){if(this.moveStart){var M=v(S),_=M.x,E=M.y,x=_-this.moveStart.x,L=E-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x,y:L},S);D&&S.cancelable&&S.preventDefault(),this.movePosition={deltaX:x,deltaY:L}}}},{key:"_handleSwipeEnd",value:function(S){this.props.onSwipeEnd(S);var M=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-M?this.props.onSwipeLeft(1,S):this.movePosition.deltaX>M&&this.props.onSwipeRight(1,S),this.movePosition.deltaY<-M?this.props.onSwipeUp(1,S):this.movePosition.deltaY>M&&this.props.onSwipeDown(1,S)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(S){this.swiper=S,this.props.innerRef(S)}},{key:"render",value:function(){var S=this.props;S.tagName;var M=S.className,_=S.style,E=S.children;S.allowMouseEvents,S.onSwipeUp,S.onSwipeDown,S.onSwipeLeft,S.onSwipeRight,S.onSwipeStart,S.onSwipeMove,S.onSwipeEnd,S.innerRef,S.tolerance;var x=s(S,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,l({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:M,style:_},x),E)}}]),R}(n.Component);y.displayName="ReactSwipe",y.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},y.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=y})}(Po)),Po}var Ol;function Fc(){return Ol||(Ol=1,function(e){(function(t,n){n(e,Sg())})(Oo,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})}(Oo)),Oo}var Pi={},Pl;function Ac(){if(Pl)return Pi;Pl=1,Object.defineProperty(Pi,"__esModule",{value:!0}),Pi.default=void 0;var e=t(th());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,a){return o in i?Object.defineProperty(i,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[o]=a,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,a){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":a==="horizontal","axis-vertical":a!=="horizontal"})},SLIDER:function(o,a){return(0,e.default)({thumbs:!o,slider:o,animated:!a})},ITEM:function(o,a,l){return(0,e.default)({thumb:!o,slide:o,selected:a,previous:l})},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 Pi.default=r,Pi}var _i={},Li={},_l;function xg(){if(_l)return Li;_l=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return Li.outerWidth=e,Li}var Fi={},Ll;function Ps(){if(Ll)return Fi;Ll=1,Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,a=i==="horizontal"?[o,0,0]:[0,o,0],l="translate3d",s="("+a.join(",")+")";return l+s};return Fi.default=e,Fi}var Ai={},Fl;function Hc(){if(Fl)return Ai;Fl=1,Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=void 0;var e=function(){return window};return Ai.default=e,Ai}var Al;function zc(){if(Al)return _i;Al=1,Object.defineProperty(_i,"__esModule",{value:!0}),_i.default=void 0;var e=s(ro()),t=a(Ac()),n=xg(),r=a(Ps()),i=a(Fc()),o=a(Hc());function a(E){return E&&E.__esModule?E:{default:E}}function l(){if(typeof WeakMap!="function")return null;var E=new WeakMap;return l=function(){return E},E}function s(E){if(E&&E.__esModule)return E;if(E===null||u(E)!=="object"&&typeof E!="function")return{default:E};var x=l();if(x&&x.has(E))return x.get(E);var L={},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(L,C,I):L[C]=E[C]}return L.default=E,x&&x.set(E,L),L}function u(E){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(L){return typeof L}:u=function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},u(E)}function c(){return c=Object.assign||function(E){for(var x=1;x<arguments.length;x++){var L=arguments[x];for(var D in L)Object.prototype.hasOwnProperty.call(L,D)&&(E[D]=L[D])}return E},c.apply(this,arguments)}function d(E,x){if(!(E instanceof x))throw new TypeError("Cannot call a class as a function")}function f(E,x){for(var L=0;L<x.length;L++){var D=x[L];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(E,D.key,D)}}function h(E,x,L){return x&&f(E.prototype,x),E}function m(E,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(x&&x.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),x&&p(E,x)}function p(E,x){return p=Object.setPrototypeOf||function(D,C){return D.__proto__=C,D},p(E,x)}function v(E){var x=R();return function(){var D=O(E),C;if(x){var I=O(this).constructor;C=Reflect.construct(D,arguments,I)}else C=D.apply(this,arguments);return y(this,C)}}function y(E,x){return x&&(u(x)==="object"||typeof x=="function")?x:b(E)}function b(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function R(){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(L){return L.__proto__||Object.getPrototypeOf(L)},O(E)}function S(E,x,L){return x in E?Object.defineProperty(E,x,{value:L,enumerable:!0,configurable:!0,writable:!0}):E[x]=L,E}var M=function(x){return x.hasOwnProperty("key")},_=function(E){m(L,E);var x=v(L);function L(D){var C;return d(this,L),C=x.call(this,D),S(b(C),"itemsWrapperRef",void 0),S(b(C),"itemsListRef",void 0),S(b(C),"thumbsRef",void 0),S(b(C),"setItemsWrapperRef",function(I){C.itemsWrapperRef=I}),S(b(C),"setItemsListRef",function(I){C.itemsListRef=I}),S(b(C),"setThumbsRef",function(I,T){C.thumbsRef||(C.thumbsRef=[]),C.thumbsRef[T]=I}),S(b(C),"updateSizes",function(){if(!(!C.props.children||!C.itemsWrapperRef||!C.thumbsRef)){var I=e.Children.count(C.props.children),T=C.itemsWrapperRef.clientWidth,k=C.props.thumbWidth?C.props.thumbWidth:(0,n.outerWidth)(C.thumbsRef[0]),z=Math.floor(T/k),N=z<I,U=N?I-z:0;C.setState(function(oe,ee){return{itemSize:k,visibleItems:z,firstItem:N?C.getFirstItem(ee.selectedItem):0,lastPosition:U,showArrows:N}})}}),S(b(C),"handleClickItem",function(I,T,k){if(!M(k)||k.key==="Enter"){var z=C.props.onSelectItem;typeof z=="function"&&z(I,T)}}),S(b(C),"onSwipeStart",function(){C.setState({swiping:!0})}),S(b(C),"onSwipeEnd",function(){C.setState({swiping:!1})}),S(b(C),"onSwipeMove",function(I){var T=I.x;if(!C.state.itemSize||!C.itemsWrapperRef||!C.state.visibleItems)return!1;var k=0,z=e.Children.count(C.props.children),N=-(C.state.firstItem*100)/C.state.visibleItems,U=Math.max(z-C.state.visibleItems,0),oe=-U*100/C.state.visibleItems;N===k&&T>0&&(T=0),N===oe&&T<0&&(T=0);var ee=C.itemsWrapperRef.clientWidth,G=N+100/(ee/T);return C.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(te){C.itemsListRef.style[te]=(0,r.default)(G,"%",C.props.axis)}),!0}),S(b(C),"slideRight",function(I){C.moveTo(C.state.firstItem-(typeof I=="number"?I:1))}),S(b(C),"slideLeft",function(I){C.moveTo(C.state.firstItem+(typeof I=="number"?I:1))}),S(b(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(L,[{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 k=t.default.ITEM(!1,T===C.state.selectedItem),z={key:T,ref:function(U){return C.setThumbsRef(U,T)},className:k,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({},z,{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,k=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,z={},N=-this.state.firstItem*(this.state.itemSize||0),U=(0,r.default)(N,"px",this.props.axis),oe=this.props.transitionTime+"ms";return z={WebkitTransform:U,MozTransform:U,MsTransform:U,OTransform:U,transform:U,msTransform:U,WebkitTransitionDuration:oe,MozTransitionDuration:oe,MsTransitionDuration:oe,OTransitionDuration:oe,transitionDuration:oe,msTransitionDuration:oe},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:z,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(G){return C.setItemsListRef(G)},style:z},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!k),onClick:function(){return C.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),L}(e.Component);return _i.default=_,S(_,"displayName","Thumbs"),S(_,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),_i}var Hi={},Hl;function kg(){if(Hl)return Hi;Hl=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.default=void 0;var e=function(){return document};return Hi.default=e,Hi}var On={},zl;function Vc(){if(zl)return On;zl=1,Object.defineProperty(On,"__esModule",{value:!0}),On.setPosition=On.getPosition=On.isKeyboardEvent=On.defaultStatusFormatter=On.noop=void 0;var e=ro(),t=n(Ps());function n(s){return s&&s.__esModule?s:{default:s}}var r=function(){};On.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};On.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};On.isKeyboardEvent=o;var a=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 f=-u*c.centerSlidePercentage,h=d-1;return u&&(u!==h||c.infiniteLoop)?f+=(100-c.centerSlidePercentage)/2:u===h&&(f+=100-c.centerSlidePercentage),f}return-u*100};On.getPosition=a;var l=function(u,c){var d={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(f){d[f]=(0,t.default)(u,"%",c)}),d};return On.setPosition=l,On}var Qn={},Vl;function Mg(){if(Vl)return Qn;Vl=1,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.fadeAnimationHandler=Qn.slideStopSwipingHandler=Qn.slideSwipeAnimationHandler=Qn.slideAnimationHandler=void 0;var e=ro(),t=r(Ps()),n=Vc();function r(d){return d&&d.__esModule?d:{default:d}}function i(d,f){var h=Object.keys(d);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(d);f&&(m=m.filter(function(p){return Object.getOwnPropertyDescriptor(d,p).enumerable})),h.push.apply(h,m)}return h}function o(d){for(var f=1;f<arguments.length;f++){var h=arguments[f]!=null?arguments[f]:{};f%2?i(Object(h),!0).forEach(function(m){a(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 a(d,f,h){return f in d?Object.defineProperty(d,f,{value:h,enumerable:!0,configurable:!0,writable:!0}):d[f]=h,d}var l=function(f,h){var m={},p=h.selectedItem,v=p,y=e.Children.count(f.children)-1,b=f.infiniteLoop&&(p<0||p>y);if(b)return v<0?f.centerMode&&f.centerSlidePercentage&&f.axis==="horizontal"?m.itemListStyle=(0,n.setPosition)(-(y+2)*f.centerSlidePercentage-(100-f.centerSlidePercentage)/2,f.axis):m.itemListStyle=(0,n.setPosition)(-(y+2)*100,f.axis):v>y&&(m.itemListStyle=(0,n.setPosition)(0,f.axis)),m;var R=(0,n.getPosition)(p,f),O=(0,t.default)(R,"%",f.axis),S=f.transitionTime+"ms";return m.itemListStyle={WebkitTransform:O,msTransform:O,OTransform:O,transform:O},h.swiping||(m.itemListStyle=o(o({},m.itemListStyle),{},{WebkitTransitionDuration:S,MozTransitionDuration:S,OTransitionDuration:S,transitionDuration:S,msTransitionDuration:S})),m};Qn.slideAnimationHandler=l;var s=function(f,h,m,p){var v={},y=h.axis==="horizontal",b=e.Children.count(h.children),R=0,O=(0,n.getPosition)(m.selectedItem,h),S=h.infiniteLoop?(0,n.getPosition)(b-1,h)-100:(0,n.getPosition)(b-1,h),M=y?f.x:f.y,_=M;O===R&&M>0&&(_=0),O===S&&M<0&&(_=0);var E=O+100/(m.itemSize/_),x=Math.abs(M)>h.swipeScrollTolerance;return h.infiniteLoop&&x&&(m.selectedItem===0&&E>-100?E-=b*100:m.selectedItem===b-1&&E<-b*100&&(E+=b*100)),(!h.preventMovementUntilSwipeScrollTolerance||x||m.swipeMovementStarted)&&(m.swipeMovementStarted||p({swipeMovementStarted:!0}),v.itemListStyle=(0,n.setPosition)(E,h.axis)),x&&!m.cancelClick&&p({cancelClick:!0}),v};Qn.slideSwipeAnimationHandler=s;var u=function(f,h){var m=(0,n.getPosition)(h.selectedItem,f),p=(0,n.setPosition)(m,f.axis);return{itemListStyle:p}};Qn.slideStopSwipingHandler=u;var c=function(f,h){var m=f.transitionTime+"ms",p="ease-in-out",v={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||(v=o(o({},v),{},{WebkitTransitionDuration:m,MozTransitionDuration:m,OTransitionDuration:m,transitionDuration:m,msTransitionDuration:m})),{slideStyle:v,selectedStyle:o(o({},v),{},{opacity:1,position:"relative"}),prevStyle:o({},v)}};return Qn.fadeAnimationHandler=c,Qn}var $l;function Rg(){if($l)return Oi;$l=1,Object.defineProperty(Oi,"__esModule",{value:!0}),Oi.default=void 0;var e=c(ro()),t=s(Fc()),n=s(Ac()),r=s(zc()),i=s(kg()),o=s(Hc()),a=Vc(),l=Mg();function s(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 k in D)if(Object.prototype.hasOwnProperty.call(D,k)){var z=T?Object.getOwnPropertyDescriptor(D,k):null;z&&(z.get||z.set)?Object.defineProperty(I,k,z):I[k]=D[k]}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 f(){return f=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},f.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(k){return Object.getOwnPropertyDescriptor(D,k).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){x(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 v(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 y(D,C,I){return C&&v(D.prototype,C),D}function b(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&&R(D,C)}function R(D,C){return R=Object.setPrototypeOf||function(T,k){return T.__proto__=k,T},R(D,C)}function O(D){var C=_();return function(){var T=E(D),k;if(C){var z=E(this).constructor;k=Reflect.construct(T,arguments,z)}else k=T.apply(this,arguments);return S(this,k)}}function S(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 x(D,C,I){return C in D?Object.defineProperty(D,C,{value:I,enumerable:!0,configurable:!0,writable:!0}):D[C]=I,D}var L=function(D){b(I,D);var C=O(I);function I(T){var k;p(this,I),k=C.call(this,T),x(M(k),"thumbsRef",void 0),x(M(k),"carouselWrapperRef",void 0),x(M(k),"listRef",void 0),x(M(k),"itemsRef",void 0),x(M(k),"timer",void 0),x(M(k),"animationHandler",void 0),x(M(k),"setThumbsRef",function(N){k.thumbsRef=N}),x(M(k),"setCarouselWrapperRef",function(N){k.carouselWrapperRef=N}),x(M(k),"setListRef",function(N){k.listRef=N}),x(M(k),"setItemsRef",function(N,U){k.itemsRef||(k.itemsRef=[]),k.itemsRef[U]=N}),x(M(k),"autoPlay",function(){e.Children.count(k.props.children)<=1||(k.clearAutoPlay(),k.props.autoPlay&&(k.timer=setTimeout(function(){k.increment()},k.props.interval)))}),x(M(k),"clearAutoPlay",function(){k.timer&&clearTimeout(k.timer)}),x(M(k),"resetAutoPlay",function(){k.clearAutoPlay(),k.autoPlay()}),x(M(k),"stopOnHover",function(){k.setState({isMouseEntered:!0},k.clearAutoPlay)}),x(M(k),"startOnLeave",function(){k.setState({isMouseEntered:!1},k.autoPlay)}),x(M(k),"isFocusWithinTheCarousel",function(){return k.carouselWrapperRef?!!((0,i.default)().activeElement===k.carouselWrapperRef||k.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),x(M(k),"navigateWithKeyboard",function(N){if(k.isFocusWithinTheCarousel()){var U=k.props.axis,oe=U==="horizontal",ee={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},G=oe?ee.ArrowRight:ee.ArrowDown,te=oe?ee.ArrowLeft:ee.ArrowUp;G===N.keyCode?k.increment():te===N.keyCode&&k.decrement()}}),x(M(k),"updateSizes",function(){if(!(!k.state.initialized||!k.itemsRef||k.itemsRef.length===0)){var N=k.props.axis==="horizontal",U=k.itemsRef[0];if(U){var oe=N?U.clientWidth:U.clientHeight;k.setState({itemSize:oe}),k.thumbsRef&&k.thumbsRef.updateSizes()}}}),x(M(k),"setMountState",function(){k.setState({hasMount:!0}),k.updateSizes()}),x(M(k),"handleClickItem",function(N,U){if(e.Children.count(k.props.children)!==0){if(k.state.cancelClick){k.setState({cancelClick:!1});return}k.props.onClickItem(N,U),N!==k.state.selectedItem&&k.setState({selectedItem:N})}}),x(M(k),"handleOnChange",function(N,U){e.Children.count(k.props.children)<=1||k.props.onChange(N,U)}),x(M(k),"handleClickThumb",function(N,U){k.props.onClickThumb(N,U),k.moveTo(N)}),x(M(k),"onSwipeStart",function(N){k.setState({swiping:!0}),k.props.onSwipeStart(N)}),x(M(k),"onSwipeEnd",function(N){k.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),k.props.onSwipeEnd(N),k.clearAutoPlay(),k.state.autoPlay&&k.autoPlay()}),x(M(k),"onSwipeMove",function(N,U){k.props.onSwipeMove(U);var oe=k.props.swipeAnimationHandler(N,k.props,k.state,k.setState.bind(M(k)));return k.setState(m({},oe)),!!Object.keys(oe).length}),x(M(k),"decrement",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem-(typeof N=="number"?N:1))}),x(M(k),"increment",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem+(typeof N=="number"?N:1))}),x(M(k),"moveTo",function(N){if(typeof N=="number"){var U=e.Children.count(k.props.children)-1;N<0&&(N=k.props.infiniteLoop?U:0),N>U&&(N=k.props.infiniteLoop?0:U),k.selectItem({selectedItem:N}),k.state.autoPlay&&k.state.isMouseEntered===!1&&k.resetAutoPlay()}}),x(M(k),"onClickNext",function(){k.increment(1)}),x(M(k),"onClickPrev",function(){k.decrement(1)}),x(M(k),"onSwipeForward",function(){k.increment(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),x(M(k),"onSwipeBackwards",function(){k.decrement(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),x(M(k),"changeItem",function(N){return function(U){(!(0,a.isKeyboardEvent)(U)||U.key==="Enter")&&k.moveTo(N)}}),x(M(k),"selectItem",function(N){k.setState(m({previousItem:k.state.selectedItem},N),function(){k.setState(k.animationHandler(k.props,k.state))}),k.handleOnChange(N.selectedItem,e.Children.toArray(k.props.children)[N.selectedItem])}),x(M(k),"getInitialImage",function(){var N=k.props.selectedItem,U=k.itemsRef&&k.itemsRef[N],oe=U&&U.getElementsByTagName("img")||[];return oe[0]}),x(M(k),"getVariableItemHeight",function(N){var U=k.itemsRef&&k.itemsRef[N];if(k.state.hasMount&&U&&U.children.length){var oe=U.children[0].getElementsByTagName("img")||[];if(oe.length>0){var ee=oe[0];if(!ee.complete){var G=function ue(){k.forceUpdate(),ee.removeEventListener("load",ue)};ee.addEventListener("load",G)}}var te=oe[0]||U.children[0],ie=te.clientHeight;return ie>0?ie:null}return null});var z={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 k.animationHandler=typeof T.animationHandler=="function"&&T.animationHandler||T.animationHandler==="fade"&&l.fadeAnimationHandler||l.slideAnimationHandler,k.state=m(m({},z),k.animationHandler(T,z)),k}return y(I,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(k,z){!k.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!k.autoFocus&&this.props.autoFocus&&this.forceFocus(),z.swiping&&!this.state.swiping&&this.setState(m({},this.props.stopSwipingHandler(this.props,this.state))),(k.selectedItem!==this.props.selectedItem||k.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),k.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var k=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var z=k.getInitialImage();z&&!z.complete?z.addEventListener("load",k.setMountState):k.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.addEventListener("mouseenter",this.stopOnHover),k.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.removeEventListener("mouseenter",this.stopOnHover),k.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,i.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var k=this.getInitialImage();k&&k.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var k;(k=this.carouselWrapperRef)===null||k===void 0||k.focus()}},{key:"renderItems",value:function(k){var z=this;return this.props.children?e.Children.map(this.props.children,function(N,U){var oe=U===z.state.selectedItem,ee=U===z.state.previousItem,G=oe&&z.state.selectedStyle||ee&&z.state.prevStyle||z.state.slideStyle||{};z.props.centerMode&&z.props.axis==="horizontal"&&(G=m(m({},G),{},{minWidth:z.props.centerSlidePercentage+"%"})),z.state.swiping&&z.state.swipeMovementStarted&&(G=m(m({},G),{},{pointerEvents:"none"}));var te={ref:function(ue){return z.setItemsRef(ue,U)},key:"itemKey"+U+(k?"clone":""),className:n.default.ITEM(!0,U===z.state.selectedItem,U===z.state.previousItem),onClick:z.handleClickItem.bind(z,U,N),style:G};return e.default.createElement("li",te,z.props.renderItem(N,{isSelected:U===z.state.selectedItem,isPrevious:U===z.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var k=this,z=this.props,N=z.showIndicators,U=z.labels,oe=z.renderIndicator,ee=z.children;return N?e.default.createElement("ul",{className:"control-dots"},e.Children.map(ee,function(G,te){return oe&&oe(k.changeItem(te),te===k.state.selectedItem,te,U.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||e.Children.count(this.props.children)===0?null:e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var k=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var z=this.props.swipeable&&e.Children.count(this.props.children)>1,N=this.props.axis==="horizontal",U=this.props.showArrows&&e.Children.count(this.props.children)>1,oe=U&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ee=U&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,G=this.renderItems(!0),te=G.shift(),ie=G.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},ge={};if(N){if(ue.onSwipeLeft=this.onSwipeForward,ue.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var J=this.getVariableItemHeight(this.state.selectedItem);ge.height=J||"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}),ge.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,oe,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:ge},z?e.default.createElement(t.default,f({tagName:"ul",innerRef:this.setListRef},ue,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&ie,this.renderItems(),this.props.infiniteLoop&&te):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(P){return k.setListRef(P)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&ie,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 Oi.default=L,x(L,"displayName","Carousel"),x(L,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:a.noop,onClickThumb:a.noop,onChange:a.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,k){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(k," ").concat(T+1)})},renderItem:function(C){return C},renderThumbs:function(C){var I=e.Children.map(C,function(T){var k=T;if(T.type!=="img"&&(k=e.Children.toArray(T.props.children).find(function(z){return z.type==="img"})),!!k)return k});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:a.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:l.slideSwipeAnimationHandler,stopSwipingHandler:l.slideStopSwipingHandler}),Oi}var Nl={},Bl;function Eg(){return Bl||(Bl=1),Nl}var Wl;function Ig(){return Wl||(Wl=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(Rg()),n=Eg(),r=i(zc());function i(o){return o&&o.__esModule?o:{default:o}}}(Ua)),Ua}var Tg=Ig(),qa,Ul;function Dg(){if(Ul)return qa;Ul=1;var e=nh(),t=function(){return e.Date.now()};return qa=t,qa}var Ya,ql;function $c(){if(ql)return Ya;ql=1;var e=vc(),t=Dg(),n=bc(),r="Expected a function",i=Math.max,o=Math.min;function a(l,s,u){var c,d,f,h,m,p,v=0,y=!1,b=!1,R=!0;if(typeof l!="function")throw new TypeError(r);s=n(s)||0,e(u)&&(y=!!u.leading,b="maxWait"in u,f=b?i(n(u.maxWait)||0,s):f,R="trailing"in u?!!u.trailing:R);function O(I){var T=c,k=d;return c=d=void 0,v=I,h=l.apply(k,T),h}function S(I){return v=I,m=setTimeout(E,s),y?O(I):h}function M(I){var T=I-p,k=I-v,z=s-T;return b?o(z,f-k):z}function _(I){var T=I-p,k=I-v;return p===void 0||T>=s||T<0||b&&k>=f}function E(){var I=t();if(_(I))return x(I);m=setTimeout(E,M(I))}function x(I){return m=void 0,R&&c?O(I):(c=d=void 0,h)}function L(){m!==void 0&&clearTimeout(m),v=0,c=p=d=m=void 0}function D(){return m===void 0?h:x(t())}function C(){var I=t(),T=_(I);if(c=arguments,d=this,p=I,T){if(m===void 0)return S(p);if(b)return clearTimeout(m),m=setTimeout(E,s),O(p)}return m===void 0&&(m=setTimeout(E,s)),h}return C.cancel=L,C.flush=D,C}return Ya=a,Ya}var Og=$c();const Nc=pr(Og);function dn(e,t,n,r,i=!1){const o=g.useRef();o.current=t,g.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,l=s=>{var u;(u=o.current)==null||u.call(a,s)};return a.addEventListener(e,l,{passive:r,capture:i}),()=>{a.removeEventListener(e,l,{capture:i})}},[e,n,r,i])}function Br(e,t){return e===void 0?void 0:t}const Pg=Math.PI;function Yl(e){return e*Pg/180}const Bc=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Wc=(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}},Uc=(e,t,n)=>Math.min(e,t-n*2),qc=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,_s=e=>{const t=e.fgColor??"currentColor";return g.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g.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"}),g.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"}))},_g=e=>{const t=e.fgColor??"currentColor";return g.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function Lg(e,t,n){const[r,i]=g.useState(e),o=g.useRef(!0);g.useEffect(()=>()=>{o.current=!1},[]);const a=g.useRef(Nc(l=>{o.current&&i(l)},n));return g.useLayoutEffect(()=>{o.current&&a.current(()=>e())},t),r}const Fg="֑-߿יִ-﷽ﹰ-ﻼ",Ag="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Hg=new RegExp("^[^"+Ag+"]*["+Fg+"]");function Ls(e){return Hg.test(e)?"rtl":"not-rtl"}let _o;function ps(){if(typeof document>"u")return 0;if(_o!==void 0)return _o;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(),_o=n-r,_o}const Vr=Symbol();function zg(e){const t=g.useRef([Vr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=g.useState(e),[,i]=g.useState(),o=g.useCallback(l=>{const s=t.current[0];s!==Vr&&(l=typeof l=="function"?l(s):l,l===s)||(s!==Vr&&i({}),r(u=>typeof l=="function"?l(s===Vr?u:s):l),t.current[0]=Vr)},[]),a=g.useCallback(()=>{t.current[0]=Vr,i({})},[]);return[t.current[0]===Vr?n:t.current[0],o,a]}function Yc(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 Vg(e){const t=g.useRef(e);return fi(e,t.current)||(t.current=e),t.current}const $g=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(l=>l!=="");if(o.length===0)return null;const a=o.length>1;return g.createElement(Cg,{"data-testid":"GDG-default-image-overlay-editor"},g.createElement(Tg.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},o.map(l=>{const s=(i==null?void 0:i(l))??g.createElement("img",{draggable:!1,src:l});return g.createElement("div",{className:"gdg-centering-container",key:l},s)})),n&&r&&g.createElement("button",{className:"gdg-edit-icon",onClick:r},g.createElement(_s,null)))};function Xc(){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 qr=Xc();function Ng(e){qr=e}const Gc=/[&<>"']/,Bg=new RegExp(Gc.source,"g"),jc=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Wg=new RegExp(jc.source,"g"),Ug={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Xl=e=>Ug[e];function pn(e,t){if(t){if(Gc.test(e))return e.replace(Bg,Xl)}else if(jc.test(e))return e.replace(Wg,Xl);return e}const qg=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Kc(e){return e.replace(qg,(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 Yg=/(^|[^\[])\^/g;function Nt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(Yg,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const Xg=/[^\w:]/g,Gg=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Gl(e,t,n){if(e){let r;try{r=decodeURIComponent(Kc(n)).replace(Xg,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!Gg.test(n)&&(n=Jg(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Lo={},jg=/^[^:]+:\/*[^/]*$/,Kg=/^([^:]+:)[\s\S]*$/,Zg=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Jg(e,t){Lo[" "+e]||(jg.test(e)?Lo[" "+e]=e+"/":Lo[" "+e]=Xo(e,"/",!0)),e=Lo[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(Kg,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(Zg,"$1")+t:e+t}const ea={exec:function(){}};function jl(e,t){const n=e.replace(/\|/g,(o,a,l)=>{let s=!1,u=a;for(;--u>=0&&l[u]==="\\";)s=!s;return s?"|":" |"}),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 Xo(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 Qg(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 em(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 Kl(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function Zl(e,t,n,r){const i=t.href,o=t.title?pn(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const l={type:"link",raw:n,href:i,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}return{type:"image",raw:n,href:i,title:o,text:pn(a)}}function tm(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.BCdg4YOG.js","./index.CTtluRFB.js","../css/index.DpJG_94W.css","./FormClearHelper.CUy5uXTm.js","./withFullScreenWrapper.KpXeL4S_.js","./Toolbar.CT8DybSu.js","./mergeWith.CQCg1Krv.js","./sprintf.D7DtBTRn.js","./createDownloadLinkElement.DZMwyjvU.js","./toConsumableArray.CdvkF-LC.js","./possibleConstructorReturn.CoBITkSn.js","./createSuper.C7LhI0EH.js","./FileDownload.esm.gA2YL2Ws.js","./number-overlay-editor.C7xqWB6m.js","./es6.DwFVXqV3.js"])))=>i.map(i=>d[i]);
2
+ var Zf=Object.defineProperty;var Jf=(e,t,n)=>t in e?Zf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var dt=(e,t,n)=>Jf(e,typeof t!="symbol"?t+"":t,n);import{r as g,E as pc,_ as tt,c as Qf,g as pr,R as se,i as Va,d as ro,e as eh,f as th,h as nh,l as vc,m as bc,o as rh,p as wc,q as ih,s as oh,t as ah,u as sh,v as lh,w as uh,a as ar,x as Es,n as io,y as ma,j as Kt,z as $n,A as yc,B as Cc,C as Ir,D as Sc,F as ch,G as To,H as xc,I as dh,J as fh,K as nt,L as kc,M as bt,N as Wi,O as Nr,Q as hh,S as Sl,T as gh,U as Mc,V as mh,W as ph,X as ms,Y as Rc,Z as Ec,$ as vh,a0 as bh,a1 as wh,a2 as yh,a3 as Ch,a4 as Sh,a5 as xh,a6 as kh,a7 as Mh,a8 as Rh,a9 as Ic,aa as Eh,ab as Ih,ac as Th,ad as Dh,ae as Oh,af as Ph,ag as _h,ah as Lh,ai as Fh,aj as Ah,ak as Hh,al as zh,am as Bn,an as Is,ao as Ui,ap as vr,aq as Be,ar as Vh,b as Tc,as as Dc,k as $h,at as $a,au as Nh,av as Bh,aw as Na,ax as Wh,ay as Uh,az as qh,aA as Yh}from"./index.CTtluRFB.js";import{u as Xh}from"./FormClearHelper.CUy5uXTm.js";import{w as Gh,u as jh,E as Kh}from"./withFullScreenWrapper.KpXeL4S_.js";import{T as Zh,a as Di}from"./Toolbar.CT8DybSu.js";import{m as Jh}from"./mergeWith.CQCg1Krv.js";import{s as Qh}from"./sprintf.D7DtBTRn.js";import{c as eg}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as hr,a as Ts,C as tg}from"./toConsumableArray.CdvkF-LC.js";import{_ as ng,a as rg,b as ig}from"./possibleConstructorReturn.CoBITkSn.js";import{_ as og}from"./createSuper.C7LhI0EH.js";import{D as ag,F as sg}from"./FileDownload.esm.gA2YL2Ws.js";var Oc=g.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return g.createElement(pc,tt({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),g.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),g.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Oc.displayName="Add";var Pc=g.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return g.createElement(pc,tt({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),g.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),g.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"}))});Pc.displayName="Search";function _c(e="This should not happen"){throw new Error(e)}function Pn(e,t="Assertion failed"){if(!e)return _c(t)}function Ji(e,t){return _c(t??"Hell froze over")}function lg(e,t){try{return e()}catch{return t}}const xl=Object.prototype.hasOwnProperty;function fi(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--&&fi(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(xl.call(e,n)&&++r&&!xl.call(t,n)||!(n in t)||!fi(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}var Ba,kl;function ug(){if(kl)return Ba;kl=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return Ba=n,Ba}var Wa,Ml;function cg(){if(Ml)return Wa;Ml=1;var e=ug(),t=Qf();function n(r,i){return r!=null&&t(r,i,e)}return Wa=n,Wa}var dg=cg();const fg=pr(dg),Jo=null,Ds=void 0;var re;(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"})(re||(re={}));var Rl;(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"})(Rl||(Rl={}));var Qo;(function(e){e.Triangle="triangle",e.Dots="dots"})(Qo||(Qo={}));function Do(e){return"width"in e&&typeof e.width=="number"}async function El(e){return typeof e=="object"?e:await e()}function ai(e){return!(e.kind===re.Loading||e.kind===re.Bubble||e.kind===re.RowID||e.kind===re.Protected||e.kind===re.Drilldown)}function li(e){return e.kind===Un.Marker||e.kind===Un.NewRow}function qi(e){if(!ai(e)||e.kind===re.Image)return!1;if(e.kind===re.Text||e.kind===re.Number||e.kind===re.Markdown||e.kind===re.Uri||e.kind===re.Custom||e.kind===re.Boolean)return e.readonly!==!0;Ji(e,"A cell was passed with an invalid kind")}function hg(e){return fg(e,"editor")}function Os(e){return!(e.readonly??!1)}var Un;(function(e){e.NewRow="new-row",e.Marker="marker"})(Un||(Un={}));function gg(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 Il;const fr=class fr{constructor(t){dt(this,"items");this.items=t}offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new fr(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=gg([...this.items,n]);return new fr(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,a]of n.entries()){const[l,s]=a;if(l<=i&&r<=s){const u=[];l<r&&u.push([l,r]),i<s&&u.push([i,s]),n.splice(o,1,...u)}}return new fr(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}};dt(fr,"empty",()=>Il??(Il=new fr([]))),dt(fr,"fromSingleSelection",t=>fr.empty().add(t));let vt=fr;var mg=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(l=>{if(l.startsWith("atm_")){const[,s]=l.split("_");n[s]=l}else r.push(l)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},Tl=mg,pg=e=>e.toUpperCase()===e,vg=e=>t=>e.indexOf(t)===-1,Lc=(e,t)=>{const n={};return Object.keys(e).filter(vg(t)).forEach(r=>{n[r]=e[r]}),n};function bg(e,t,n){const r=Lc(t,n);if(!e){const i=typeof Va=="function"?{default:Va}:Va;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var wg=(e,t)=>{};function yg(e){let t="";return n=>{const r=(o,a)=>{const{as:l=e,class:s=t}=o,u=n.propsAsIs===void 0?!(typeof l=="string"&&l.indexOf("-")===-1&&!pg(l[0])):n.propsAsIs,c=bg(u,o,["as","class"]);c.ref=a,c.className=n.atomic?Tl(n.class,c.className||s):Tl(c.className||s,n.class);const{vars:d}=n;if(d){const f={};for(const p in d){const v=d[p],y=v[0],b=v[1]||"",R=typeof y=="function"?y(o):y;wg(R,n.name),f[`--${p}`]=`${R}${b}`}const h=c.style||{},m=Object.keys(h);m.length>0&&m.forEach(p=>{f[p]=h[p]}),c.style=f}return e.__linaria&&e!==l?(c.as=l,se.createElement(e,c)):se.createElement(l,c)},i=se.forwardRef?se.forwardRef(r):o=>{const a=Lc(o,["innerRef"]);return r(a,o.innerRef)};return i.displayName=n.name,i.__linaria={className:n.class||t,extends:e},i}}var fn=yg;const Cg=fn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Ua={},Oi={},Oo={},Po={},Dl;function Sg(){return Dl||(Dl=1,function(e){(function(t,n){n(e,ro(),eh())})(Po,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var i=a(n),o=a(r);function a(b){return b&&b.__esModule?b:{default:b}}var l=Object.assign||function(b){for(var R=1;R<arguments.length;R++){var O=arguments[R];for(var S in O)Object.prototype.hasOwnProperty.call(O,S)&&(b[S]=O[S])}return b};function s(b,R){var O={};for(var S in b)R.indexOf(S)>=0||Object.prototype.hasOwnProperty.call(b,S)&&(O[S]=b[S]);return O}function u(b,R){if(!(b instanceof R))throw new TypeError("Cannot call a class as a function")}var c=function(){function b(R,O){for(var S=0;S<O.length;S++){var M=O[S];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(R,M.key,M)}}return function(R,O,S){return O&&b(R.prototype,O),S&&b(R,S),R}}();function d(b,R){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:b}function f(b,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);b.prototype=Object.create(R&&R.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(b,R):b.__proto__=R)}var h=!1;function m(b){h=b}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){m(!0)}}))}catch{}function p(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return h?b:b.capture}function v(b){if("touches"in b){var R=b.touches[0],O=R.pageX,S=R.pageY;return{x:O,y:S}}var M=b.screenX,_=b.screenY;return{x:M,y:_}}var y=function(b){f(R,b);function R(){var O;u(this,R);for(var S=arguments.length,M=Array(S),_=0;_<S;_++)M[_]=arguments[_];var E=d(this,(O=R.__proto__||Object.getPrototypeOf(R)).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(R,[{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(S){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(S))}},{key:"_onMouseMove",value:function(S){this.mouseDown&&this._handleSwipeMove(S)}},{key:"_onMouseUp",value:function(S){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(S)}},{key:"_handleSwipeStart",value:function(S){var M=v(S),_=M.x,E=M.y;this.moveStart={x:_,y:E},this.props.onSwipeStart(S)}},{key:"_handleSwipeMove",value:function(S){if(this.moveStart){var M=v(S),_=M.x,E=M.y,x=_-this.moveStart.x,L=E-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x,y:L},S);D&&S.cancelable&&S.preventDefault(),this.movePosition={deltaX:x,deltaY:L}}}},{key:"_handleSwipeEnd",value:function(S){this.props.onSwipeEnd(S);var M=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-M?this.props.onSwipeLeft(1,S):this.movePosition.deltaX>M&&this.props.onSwipeRight(1,S),this.movePosition.deltaY<-M?this.props.onSwipeUp(1,S):this.movePosition.deltaY>M&&this.props.onSwipeDown(1,S)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(S){this.swiper=S,this.props.innerRef(S)}},{key:"render",value:function(){var S=this.props;S.tagName;var M=S.className,_=S.style,E=S.children;S.allowMouseEvents,S.onSwipeUp,S.onSwipeDown,S.onSwipeLeft,S.onSwipeRight,S.onSwipeStart,S.onSwipeMove,S.onSwipeEnd,S.innerRef,S.tolerance;var x=s(S,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,l({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:M,style:_},x),E)}}]),R}(n.Component);y.displayName="ReactSwipe",y.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},y.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=y})}(Po)),Po}var Ol;function Fc(){return Ol||(Ol=1,function(e){(function(t,n){n(e,Sg())})(Oo,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})}(Oo)),Oo}var Pi={},Pl;function Ac(){if(Pl)return Pi;Pl=1,Object.defineProperty(Pi,"__esModule",{value:!0}),Pi.default=void 0;var e=t(th());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,a){return o in i?Object.defineProperty(i,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[o]=a,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,a){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":a==="horizontal","axis-vertical":a!=="horizontal"})},SLIDER:function(o,a){return(0,e.default)({thumbs:!o,slider:o,animated:!a})},ITEM:function(o,a,l){return(0,e.default)({thumb:!o,slide:o,selected:a,previous:l})},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 Pi.default=r,Pi}var _i={},Li={},_l;function xg(){if(_l)return Li;_l=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return Li.outerWidth=e,Li}var Fi={},Ll;function Ps(){if(Ll)return Fi;Ll=1,Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,a=i==="horizontal"?[o,0,0]:[0,o,0],l="translate3d",s="("+a.join(",")+")";return l+s};return Fi.default=e,Fi}var Ai={},Fl;function Hc(){if(Fl)return Ai;Fl=1,Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=void 0;var e=function(){return window};return Ai.default=e,Ai}var Al;function zc(){if(Al)return _i;Al=1,Object.defineProperty(_i,"__esModule",{value:!0}),_i.default=void 0;var e=s(ro()),t=a(Ac()),n=xg(),r=a(Ps()),i=a(Fc()),o=a(Hc());function a(E){return E&&E.__esModule?E:{default:E}}function l(){if(typeof WeakMap!="function")return null;var E=new WeakMap;return l=function(){return E},E}function s(E){if(E&&E.__esModule)return E;if(E===null||u(E)!=="object"&&typeof E!="function")return{default:E};var x=l();if(x&&x.has(E))return x.get(E);var L={},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(L,C,I):L[C]=E[C]}return L.default=E,x&&x.set(E,L),L}function u(E){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(L){return typeof L}:u=function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},u(E)}function c(){return c=Object.assign||function(E){for(var x=1;x<arguments.length;x++){var L=arguments[x];for(var D in L)Object.prototype.hasOwnProperty.call(L,D)&&(E[D]=L[D])}return E},c.apply(this,arguments)}function d(E,x){if(!(E instanceof x))throw new TypeError("Cannot call a class as a function")}function f(E,x){for(var L=0;L<x.length;L++){var D=x[L];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(E,D.key,D)}}function h(E,x,L){return x&&f(E.prototype,x),E}function m(E,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(x&&x.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),x&&p(E,x)}function p(E,x){return p=Object.setPrototypeOf||function(D,C){return D.__proto__=C,D},p(E,x)}function v(E){var x=R();return function(){var D=O(E),C;if(x){var I=O(this).constructor;C=Reflect.construct(D,arguments,I)}else C=D.apply(this,arguments);return y(this,C)}}function y(E,x){return x&&(u(x)==="object"||typeof x=="function")?x:b(E)}function b(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function R(){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(L){return L.__proto__||Object.getPrototypeOf(L)},O(E)}function S(E,x,L){return x in E?Object.defineProperty(E,x,{value:L,enumerable:!0,configurable:!0,writable:!0}):E[x]=L,E}var M=function(x){return x.hasOwnProperty("key")},_=function(E){m(L,E);var x=v(L);function L(D){var C;return d(this,L),C=x.call(this,D),S(b(C),"itemsWrapperRef",void 0),S(b(C),"itemsListRef",void 0),S(b(C),"thumbsRef",void 0),S(b(C),"setItemsWrapperRef",function(I){C.itemsWrapperRef=I}),S(b(C),"setItemsListRef",function(I){C.itemsListRef=I}),S(b(C),"setThumbsRef",function(I,T){C.thumbsRef||(C.thumbsRef=[]),C.thumbsRef[T]=I}),S(b(C),"updateSizes",function(){if(!(!C.props.children||!C.itemsWrapperRef||!C.thumbsRef)){var I=e.Children.count(C.props.children),T=C.itemsWrapperRef.clientWidth,k=C.props.thumbWidth?C.props.thumbWidth:(0,n.outerWidth)(C.thumbsRef[0]),z=Math.floor(T/k),N=z<I,U=N?I-z:0;C.setState(function(oe,ee){return{itemSize:k,visibleItems:z,firstItem:N?C.getFirstItem(ee.selectedItem):0,lastPosition:U,showArrows:N}})}}),S(b(C),"handleClickItem",function(I,T,k){if(!M(k)||k.key==="Enter"){var z=C.props.onSelectItem;typeof z=="function"&&z(I,T)}}),S(b(C),"onSwipeStart",function(){C.setState({swiping:!0})}),S(b(C),"onSwipeEnd",function(){C.setState({swiping:!1})}),S(b(C),"onSwipeMove",function(I){var T=I.x;if(!C.state.itemSize||!C.itemsWrapperRef||!C.state.visibleItems)return!1;var k=0,z=e.Children.count(C.props.children),N=-(C.state.firstItem*100)/C.state.visibleItems,U=Math.max(z-C.state.visibleItems,0),oe=-U*100/C.state.visibleItems;N===k&&T>0&&(T=0),N===oe&&T<0&&(T=0);var ee=C.itemsWrapperRef.clientWidth,G=N+100/(ee/T);return C.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(te){C.itemsListRef.style[te]=(0,r.default)(G,"%",C.props.axis)}),!0}),S(b(C),"slideRight",function(I){C.moveTo(C.state.firstItem-(typeof I=="number"?I:1))}),S(b(C),"slideLeft",function(I){C.moveTo(C.state.firstItem+(typeof I=="number"?I:1))}),S(b(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(L,[{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 k=t.default.ITEM(!1,T===C.state.selectedItem),z={key:T,ref:function(U){return C.setThumbsRef(U,T)},className:k,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({},z,{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,k=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,z={},N=-this.state.firstItem*(this.state.itemSize||0),U=(0,r.default)(N,"px",this.props.axis),oe=this.props.transitionTime+"ms";return z={WebkitTransform:U,MozTransform:U,MsTransform:U,OTransform:U,transform:U,msTransform:U,WebkitTransitionDuration:oe,MozTransitionDuration:oe,MsTransitionDuration:oe,OTransitionDuration:oe,transitionDuration:oe,msTransitionDuration:oe},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:z,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(G){return C.setItemsListRef(G)},style:z},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!k),onClick:function(){return C.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),L}(e.Component);return _i.default=_,S(_,"displayName","Thumbs"),S(_,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),_i}var Hi={},Hl;function kg(){if(Hl)return Hi;Hl=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.default=void 0;var e=function(){return document};return Hi.default=e,Hi}var On={},zl;function Vc(){if(zl)return On;zl=1,Object.defineProperty(On,"__esModule",{value:!0}),On.setPosition=On.getPosition=On.isKeyboardEvent=On.defaultStatusFormatter=On.noop=void 0;var e=ro(),t=n(Ps());function n(s){return s&&s.__esModule?s:{default:s}}var r=function(){};On.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};On.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};On.isKeyboardEvent=o;var a=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 f=-u*c.centerSlidePercentage,h=d-1;return u&&(u!==h||c.infiniteLoop)?f+=(100-c.centerSlidePercentage)/2:u===h&&(f+=100-c.centerSlidePercentage),f}return-u*100};On.getPosition=a;var l=function(u,c){var d={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(f){d[f]=(0,t.default)(u,"%",c)}),d};return On.setPosition=l,On}var Qn={},Vl;function Mg(){if(Vl)return Qn;Vl=1,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.fadeAnimationHandler=Qn.slideStopSwipingHandler=Qn.slideSwipeAnimationHandler=Qn.slideAnimationHandler=void 0;var e=ro(),t=r(Ps()),n=Vc();function r(d){return d&&d.__esModule?d:{default:d}}function i(d,f){var h=Object.keys(d);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(d);f&&(m=m.filter(function(p){return Object.getOwnPropertyDescriptor(d,p).enumerable})),h.push.apply(h,m)}return h}function o(d){for(var f=1;f<arguments.length;f++){var h=arguments[f]!=null?arguments[f]:{};f%2?i(Object(h),!0).forEach(function(m){a(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 a(d,f,h){return f in d?Object.defineProperty(d,f,{value:h,enumerable:!0,configurable:!0,writable:!0}):d[f]=h,d}var l=function(f,h){var m={},p=h.selectedItem,v=p,y=e.Children.count(f.children)-1,b=f.infiniteLoop&&(p<0||p>y);if(b)return v<0?f.centerMode&&f.centerSlidePercentage&&f.axis==="horizontal"?m.itemListStyle=(0,n.setPosition)(-(y+2)*f.centerSlidePercentage-(100-f.centerSlidePercentage)/2,f.axis):m.itemListStyle=(0,n.setPosition)(-(y+2)*100,f.axis):v>y&&(m.itemListStyle=(0,n.setPosition)(0,f.axis)),m;var R=(0,n.getPosition)(p,f),O=(0,t.default)(R,"%",f.axis),S=f.transitionTime+"ms";return m.itemListStyle={WebkitTransform:O,msTransform:O,OTransform:O,transform:O},h.swiping||(m.itemListStyle=o(o({},m.itemListStyle),{},{WebkitTransitionDuration:S,MozTransitionDuration:S,OTransitionDuration:S,transitionDuration:S,msTransitionDuration:S})),m};Qn.slideAnimationHandler=l;var s=function(f,h,m,p){var v={},y=h.axis==="horizontal",b=e.Children.count(h.children),R=0,O=(0,n.getPosition)(m.selectedItem,h),S=h.infiniteLoop?(0,n.getPosition)(b-1,h)-100:(0,n.getPosition)(b-1,h),M=y?f.x:f.y,_=M;O===R&&M>0&&(_=0),O===S&&M<0&&(_=0);var E=O+100/(m.itemSize/_),x=Math.abs(M)>h.swipeScrollTolerance;return h.infiniteLoop&&x&&(m.selectedItem===0&&E>-100?E-=b*100:m.selectedItem===b-1&&E<-b*100&&(E+=b*100)),(!h.preventMovementUntilSwipeScrollTolerance||x||m.swipeMovementStarted)&&(m.swipeMovementStarted||p({swipeMovementStarted:!0}),v.itemListStyle=(0,n.setPosition)(E,h.axis)),x&&!m.cancelClick&&p({cancelClick:!0}),v};Qn.slideSwipeAnimationHandler=s;var u=function(f,h){var m=(0,n.getPosition)(h.selectedItem,f),p=(0,n.setPosition)(m,f.axis);return{itemListStyle:p}};Qn.slideStopSwipingHandler=u;var c=function(f,h){var m=f.transitionTime+"ms",p="ease-in-out",v={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||(v=o(o({},v),{},{WebkitTransitionDuration:m,MozTransitionDuration:m,OTransitionDuration:m,transitionDuration:m,msTransitionDuration:m})),{slideStyle:v,selectedStyle:o(o({},v),{},{opacity:1,position:"relative"}),prevStyle:o({},v)}};return Qn.fadeAnimationHandler=c,Qn}var $l;function Rg(){if($l)return Oi;$l=1,Object.defineProperty(Oi,"__esModule",{value:!0}),Oi.default=void 0;var e=c(ro()),t=s(Fc()),n=s(Ac()),r=s(zc()),i=s(kg()),o=s(Hc()),a=Vc(),l=Mg();function s(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 k in D)if(Object.prototype.hasOwnProperty.call(D,k)){var z=T?Object.getOwnPropertyDescriptor(D,k):null;z&&(z.get||z.set)?Object.defineProperty(I,k,z):I[k]=D[k]}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 f(){return f=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},f.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(k){return Object.getOwnPropertyDescriptor(D,k).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){x(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 v(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 y(D,C,I){return C&&v(D.prototype,C),D}function b(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&&R(D,C)}function R(D,C){return R=Object.setPrototypeOf||function(T,k){return T.__proto__=k,T},R(D,C)}function O(D){var C=_();return function(){var T=E(D),k;if(C){var z=E(this).constructor;k=Reflect.construct(T,arguments,z)}else k=T.apply(this,arguments);return S(this,k)}}function S(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 x(D,C,I){return C in D?Object.defineProperty(D,C,{value:I,enumerable:!0,configurable:!0,writable:!0}):D[C]=I,D}var L=function(D){b(I,D);var C=O(I);function I(T){var k;p(this,I),k=C.call(this,T),x(M(k),"thumbsRef",void 0),x(M(k),"carouselWrapperRef",void 0),x(M(k),"listRef",void 0),x(M(k),"itemsRef",void 0),x(M(k),"timer",void 0),x(M(k),"animationHandler",void 0),x(M(k),"setThumbsRef",function(N){k.thumbsRef=N}),x(M(k),"setCarouselWrapperRef",function(N){k.carouselWrapperRef=N}),x(M(k),"setListRef",function(N){k.listRef=N}),x(M(k),"setItemsRef",function(N,U){k.itemsRef||(k.itemsRef=[]),k.itemsRef[U]=N}),x(M(k),"autoPlay",function(){e.Children.count(k.props.children)<=1||(k.clearAutoPlay(),k.props.autoPlay&&(k.timer=setTimeout(function(){k.increment()},k.props.interval)))}),x(M(k),"clearAutoPlay",function(){k.timer&&clearTimeout(k.timer)}),x(M(k),"resetAutoPlay",function(){k.clearAutoPlay(),k.autoPlay()}),x(M(k),"stopOnHover",function(){k.setState({isMouseEntered:!0},k.clearAutoPlay)}),x(M(k),"startOnLeave",function(){k.setState({isMouseEntered:!1},k.autoPlay)}),x(M(k),"isFocusWithinTheCarousel",function(){return k.carouselWrapperRef?!!((0,i.default)().activeElement===k.carouselWrapperRef||k.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),x(M(k),"navigateWithKeyboard",function(N){if(k.isFocusWithinTheCarousel()){var U=k.props.axis,oe=U==="horizontal",ee={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},G=oe?ee.ArrowRight:ee.ArrowDown,te=oe?ee.ArrowLeft:ee.ArrowUp;G===N.keyCode?k.increment():te===N.keyCode&&k.decrement()}}),x(M(k),"updateSizes",function(){if(!(!k.state.initialized||!k.itemsRef||k.itemsRef.length===0)){var N=k.props.axis==="horizontal",U=k.itemsRef[0];if(U){var oe=N?U.clientWidth:U.clientHeight;k.setState({itemSize:oe}),k.thumbsRef&&k.thumbsRef.updateSizes()}}}),x(M(k),"setMountState",function(){k.setState({hasMount:!0}),k.updateSizes()}),x(M(k),"handleClickItem",function(N,U){if(e.Children.count(k.props.children)!==0){if(k.state.cancelClick){k.setState({cancelClick:!1});return}k.props.onClickItem(N,U),N!==k.state.selectedItem&&k.setState({selectedItem:N})}}),x(M(k),"handleOnChange",function(N,U){e.Children.count(k.props.children)<=1||k.props.onChange(N,U)}),x(M(k),"handleClickThumb",function(N,U){k.props.onClickThumb(N,U),k.moveTo(N)}),x(M(k),"onSwipeStart",function(N){k.setState({swiping:!0}),k.props.onSwipeStart(N)}),x(M(k),"onSwipeEnd",function(N){k.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),k.props.onSwipeEnd(N),k.clearAutoPlay(),k.state.autoPlay&&k.autoPlay()}),x(M(k),"onSwipeMove",function(N,U){k.props.onSwipeMove(U);var oe=k.props.swipeAnimationHandler(N,k.props,k.state,k.setState.bind(M(k)));return k.setState(m({},oe)),!!Object.keys(oe).length}),x(M(k),"decrement",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem-(typeof N=="number"?N:1))}),x(M(k),"increment",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem+(typeof N=="number"?N:1))}),x(M(k),"moveTo",function(N){if(typeof N=="number"){var U=e.Children.count(k.props.children)-1;N<0&&(N=k.props.infiniteLoop?U:0),N>U&&(N=k.props.infiniteLoop?0:U),k.selectItem({selectedItem:N}),k.state.autoPlay&&k.state.isMouseEntered===!1&&k.resetAutoPlay()}}),x(M(k),"onClickNext",function(){k.increment(1)}),x(M(k),"onClickPrev",function(){k.decrement(1)}),x(M(k),"onSwipeForward",function(){k.increment(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),x(M(k),"onSwipeBackwards",function(){k.decrement(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),x(M(k),"changeItem",function(N){return function(U){(!(0,a.isKeyboardEvent)(U)||U.key==="Enter")&&k.moveTo(N)}}),x(M(k),"selectItem",function(N){k.setState(m({previousItem:k.state.selectedItem},N),function(){k.setState(k.animationHandler(k.props,k.state))}),k.handleOnChange(N.selectedItem,e.Children.toArray(k.props.children)[N.selectedItem])}),x(M(k),"getInitialImage",function(){var N=k.props.selectedItem,U=k.itemsRef&&k.itemsRef[N],oe=U&&U.getElementsByTagName("img")||[];return oe[0]}),x(M(k),"getVariableItemHeight",function(N){var U=k.itemsRef&&k.itemsRef[N];if(k.state.hasMount&&U&&U.children.length){var oe=U.children[0].getElementsByTagName("img")||[];if(oe.length>0){var ee=oe[0];if(!ee.complete){var G=function ue(){k.forceUpdate(),ee.removeEventListener("load",ue)};ee.addEventListener("load",G)}}var te=oe[0]||U.children[0],ie=te.clientHeight;return ie>0?ie:null}return null});var z={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 k.animationHandler=typeof T.animationHandler=="function"&&T.animationHandler||T.animationHandler==="fade"&&l.fadeAnimationHandler||l.slideAnimationHandler,k.state=m(m({},z),k.animationHandler(T,z)),k}return y(I,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(k,z){!k.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!k.autoFocus&&this.props.autoFocus&&this.forceFocus(),z.swiping&&!this.state.swiping&&this.setState(m({},this.props.stopSwipingHandler(this.props,this.state))),(k.selectedItem!==this.props.selectedItem||k.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),k.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var k=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var z=k.getInitialImage();z&&!z.complete?z.addEventListener("load",k.setMountState):k.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.addEventListener("mouseenter",this.stopOnHover),k.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.removeEventListener("mouseenter",this.stopOnHover),k.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,i.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var k=this.getInitialImage();k&&k.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var k;(k=this.carouselWrapperRef)===null||k===void 0||k.focus()}},{key:"renderItems",value:function(k){var z=this;return this.props.children?e.Children.map(this.props.children,function(N,U){var oe=U===z.state.selectedItem,ee=U===z.state.previousItem,G=oe&&z.state.selectedStyle||ee&&z.state.prevStyle||z.state.slideStyle||{};z.props.centerMode&&z.props.axis==="horizontal"&&(G=m(m({},G),{},{minWidth:z.props.centerSlidePercentage+"%"})),z.state.swiping&&z.state.swipeMovementStarted&&(G=m(m({},G),{},{pointerEvents:"none"}));var te={ref:function(ue){return z.setItemsRef(ue,U)},key:"itemKey"+U+(k?"clone":""),className:n.default.ITEM(!0,U===z.state.selectedItem,U===z.state.previousItem),onClick:z.handleClickItem.bind(z,U,N),style:G};return e.default.createElement("li",te,z.props.renderItem(N,{isSelected:U===z.state.selectedItem,isPrevious:U===z.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var k=this,z=this.props,N=z.showIndicators,U=z.labels,oe=z.renderIndicator,ee=z.children;return N?e.default.createElement("ul",{className:"control-dots"},e.Children.map(ee,function(G,te){return oe&&oe(k.changeItem(te),te===k.state.selectedItem,te,U.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||e.Children.count(this.props.children)===0?null:e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var k=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var z=this.props.swipeable&&e.Children.count(this.props.children)>1,N=this.props.axis==="horizontal",U=this.props.showArrows&&e.Children.count(this.props.children)>1,oe=U&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ee=U&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,G=this.renderItems(!0),te=G.shift(),ie=G.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},ge={};if(N){if(ue.onSwipeLeft=this.onSwipeForward,ue.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var J=this.getVariableItemHeight(this.state.selectedItem);ge.height=J||"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}),ge.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,oe,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:ge},z?e.default.createElement(t.default,f({tagName:"ul",innerRef:this.setListRef},ue,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&ie,this.renderItems(),this.props.infiniteLoop&&te):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(P){return k.setListRef(P)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&ie,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 Oi.default=L,x(L,"displayName","Carousel"),x(L,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:a.noop,onClickThumb:a.noop,onChange:a.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,k){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(k," ").concat(T+1)})},renderItem:function(C){return C},renderThumbs:function(C){var I=e.Children.map(C,function(T){var k=T;if(T.type!=="img"&&(k=e.Children.toArray(T.props.children).find(function(z){return z.type==="img"})),!!k)return k});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:a.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:l.slideSwipeAnimationHandler,stopSwipingHandler:l.slideStopSwipingHandler}),Oi}var Nl={},Bl;function Eg(){return Bl||(Bl=1),Nl}var Wl;function Ig(){return Wl||(Wl=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(Rg()),n=Eg(),r=i(zc());function i(o){return o&&o.__esModule?o:{default:o}}}(Ua)),Ua}var Tg=Ig(),qa,Ul;function Dg(){if(Ul)return qa;Ul=1;var e=nh(),t=function(){return e.Date.now()};return qa=t,qa}var Ya,ql;function $c(){if(ql)return Ya;ql=1;var e=vc(),t=Dg(),n=bc(),r="Expected a function",i=Math.max,o=Math.min;function a(l,s,u){var c,d,f,h,m,p,v=0,y=!1,b=!1,R=!0;if(typeof l!="function")throw new TypeError(r);s=n(s)||0,e(u)&&(y=!!u.leading,b="maxWait"in u,f=b?i(n(u.maxWait)||0,s):f,R="trailing"in u?!!u.trailing:R);function O(I){var T=c,k=d;return c=d=void 0,v=I,h=l.apply(k,T),h}function S(I){return v=I,m=setTimeout(E,s),y?O(I):h}function M(I){var T=I-p,k=I-v,z=s-T;return b?o(z,f-k):z}function _(I){var T=I-p,k=I-v;return p===void 0||T>=s||T<0||b&&k>=f}function E(){var I=t();if(_(I))return x(I);m=setTimeout(E,M(I))}function x(I){return m=void 0,R&&c?O(I):(c=d=void 0,h)}function L(){m!==void 0&&clearTimeout(m),v=0,c=p=d=m=void 0}function D(){return m===void 0?h:x(t())}function C(){var I=t(),T=_(I);if(c=arguments,d=this,p=I,T){if(m===void 0)return S(p);if(b)return clearTimeout(m),m=setTimeout(E,s),O(p)}return m===void 0&&(m=setTimeout(E,s)),h}return C.cancel=L,C.flush=D,C}return Ya=a,Ya}var Og=$c();const Nc=pr(Og);function dn(e,t,n,r,i=!1){const o=g.useRef();o.current=t,g.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,l=s=>{var u;(u=o.current)==null||u.call(a,s)};return a.addEventListener(e,l,{passive:r,capture:i}),()=>{a.removeEventListener(e,l,{capture:i})}},[e,n,r,i])}function Br(e,t){return e===void 0?void 0:t}const Pg=Math.PI;function Yl(e){return e*Pg/180}const Bc=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Wc=(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}},Uc=(e,t,n)=>Math.min(e,t-n*2),qc=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,_s=e=>{const t=e.fgColor??"currentColor";return g.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g.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"}),g.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"}))},_g=e=>{const t=e.fgColor??"currentColor";return g.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function Lg(e,t,n){const[r,i]=g.useState(e),o=g.useRef(!0);g.useEffect(()=>()=>{o.current=!1},[]);const a=g.useRef(Nc(l=>{o.current&&i(l)},n));return g.useLayoutEffect(()=>{o.current&&a.current(()=>e())},t),r}const Fg="֑-߿יִ-﷽ﹰ-ﻼ",Ag="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Hg=new RegExp("^[^"+Ag+"]*["+Fg+"]");function Ls(e){return Hg.test(e)?"rtl":"not-rtl"}let _o;function ps(){if(typeof document>"u")return 0;if(_o!==void 0)return _o;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(),_o=n-r,_o}const Vr=Symbol();function zg(e){const t=g.useRef([Vr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=g.useState(e),[,i]=g.useState(),o=g.useCallback(l=>{const s=t.current[0];s!==Vr&&(l=typeof l=="function"?l(s):l,l===s)||(s!==Vr&&i({}),r(u=>typeof l=="function"?l(s===Vr?u:s):l),t.current[0]=Vr)},[]),a=g.useCallback(()=>{t.current[0]=Vr,i({})},[]);return[t.current[0]===Vr?n:t.current[0],o,a]}function Yc(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 Vg(e){const t=g.useRef(e);return fi(e,t.current)||(t.current=e),t.current}const $g=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(l=>l!=="");if(o.length===0)return null;const a=o.length>1;return g.createElement(Cg,{"data-testid":"GDG-default-image-overlay-editor"},g.createElement(Tg.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},o.map(l=>{const s=(i==null?void 0:i(l))??g.createElement("img",{draggable:!1,src:l});return g.createElement("div",{className:"gdg-centering-container",key:l},s)})),n&&r&&g.createElement("button",{className:"gdg-edit-icon",onClick:r},g.createElement(_s,null)))};function Xc(){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 qr=Xc();function Ng(e){qr=e}const Gc=/[&<>"']/,Bg=new RegExp(Gc.source,"g"),jc=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Wg=new RegExp(jc.source,"g"),Ug={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Xl=e=>Ug[e];function pn(e,t){if(t){if(Gc.test(e))return e.replace(Bg,Xl)}else if(jc.test(e))return e.replace(Wg,Xl);return e}const qg=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Kc(e){return e.replace(qg,(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 Yg=/(^|[^\[])\^/g;function Nt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(Yg,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const Xg=/[^\w:]/g,Gg=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Gl(e,t,n){if(e){let r;try{r=decodeURIComponent(Kc(n)).replace(Xg,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!Gg.test(n)&&(n=Jg(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Lo={},jg=/^[^:]+:\/*[^/]*$/,Kg=/^([^:]+:)[\s\S]*$/,Zg=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Jg(e,t){Lo[" "+e]||(jg.test(e)?Lo[" "+e]=e+"/":Lo[" "+e]=Xo(e,"/",!0)),e=Lo[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(Kg,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(Zg,"$1")+t:e+t}const ea={exec:function(){}};function jl(e,t){const n=e.replace(/\|/g,(o,a,l)=>{let s=!1,u=a;for(;--u>=0&&l[u]==="\\";)s=!s;return s?"|":" |"}),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 Xo(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 Qg(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 em(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 Kl(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function Zl(e,t,n,r){const i=t.href,o=t.title?pn(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const l={type:"link",raw:n,href:i,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}return{type:"image",raw:n,href:i,title:o,text:pn(a)}}function tm(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[a]=o;return a.length>=r.length?i.slice(r.length):i}).join(`
4
4
  `)}class Fs{constructor(t){this.options=t||qr}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:Xo(r,`
5
5
  `)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],i=tm(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=Xo(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,a,l,s,u,c,d,f,h,m,p=n[1].trim();const v=p.length>1,y={type:"list",raw:"",ordered:v,start:v?+p.slice(0,-1):"",loose:!1,items:[]};p=v?`\\d{1,9}\\${p.slice(-1)}`:`\\${p}`,this.options.pedantic&&(p=v?p:"[*+-]");const b=new RegExp(`^( {0,3}${p})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(m=!1,!(!(n=b.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,a)),i=a+1,l===`
170
170
  `&&(n.push(r),r=[])):l==='"'&&(o=t.inString);break;case t.inString:l==='"'&&(o=t.inStringPostQuote);break;case t.inStringPostQuote:l==='"'?o=t.inString:((l===" "||l===`
171
171
  `)&&(r.push(Su(e.slice(i,a))),i=a+1,l===`
172
- `&&(n.push(r),r=[])),o=t.None);break}a++}return i<e.length&&r.push(Su(e.slice(i,e.length))),n.push(r),n.map(l=>l.map(s=>({rawValue:s,formatted:s,format:"string"})))}function xu(e,t,n){var l;const r=w0(e,t),i=s=>{var u;(u=window.navigator.clipboard)==null||u.writeText(s)},o=(s,u)=>{var c;return((c=window.navigator.clipboard)==null?void 0:c.write)===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([s],{type:"text/plain"}),"text/html":new Blob([u],{type:"text/html"})})]),!0)},a=(s,u)=>{var c,d;try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");(c=n==null?void 0:n.clipboardData)==null||c.setData("text/plain",s),(d=n==null?void 0:n.clipboardData)==null||d.setData("text/html",u)}catch{o(s,u)||i(s)}};((l=window.navigator.clipboard)==null?void 0:l.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?a(r.textPlain,r.textHtml):i(r.textPlain),n==null||n.preventDefault()}function Rd(e){return e!==!0}function ku(e){return typeof e=="string"?e:`${e}px`}const S0=()=>e=>e.innerWidth,x0=()=>e=>e.innerHeight,k0=fn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[S0()],"wmyidgi-1":[x0()]}}),M0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return g.createElement(k0,{innerHeight:ku(n),innerWidth:ku(t),...i},r)},R0=2,E0=1300;function I0(e,t,n){const r=se.useRef(0),[i,o]=e??[0,0];se.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let a=!1,l=0;const s=u=>{var c;if(!a){if(l===0)l=u;else{const d=u-l;r.current=Math.min(1,r.current+d/E0);const f=r.current**1.618*d*R0;(c=t.current)==null||c.scrollBy(i*f,o*f),l=u,n==null||n()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{a=!0}},[t,i,o,n])}function T0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:a,remSize:l}){const[s,u,c,d,f,h]=se.useMemo(()=>{if(!a||l===16)return[e,t,n,r,i,o];const m=l/16,p=e,v=dd();return[typeof p=="number"?p*m:y=>Math.ceil(p(y)*m),Math.ceil(t*m),Math.ceil(n*m),{...r,headerIconSize:((r==null?void 0:r.headerIconSize)??v.headerIconSize)*m,cellHorizontalPadding:((r==null?void 0:r.cellHorizontalPadding)??v.cellHorizontalPadding)*m,cellVerticalPadding:((r==null?void 0:r.cellVerticalPadding)??v.cellVerticalPadding)*m},Math.ceil((i??0)*m),Math.ceil((o??0)*m)]},[n,t,i,o,l,e,a,r]);return{rowHeight:s,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:f,overscrollY:h}}const Rr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function ct(e,t){return e===!0?t:e===!1?"":e}function Mu(e){const t=ia.value;return{activateCell:ct(e.activateCell," |Enter|shift+Enter"),clear:ct(e.clear,"any+Escape"),closeOverlay:ct(e.closeOverlay,"any+Escape"),acceptOverlayDown:ct(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ct(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ct(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ct(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ct(e.delete,t?"Backspace|Delete":"Delete"),downFill:ct(e.downFill,"primary+_68"),scrollToSelectedCell:ct(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ct(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ct(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ct(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ct(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ct(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ct(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ct(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ct(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ct(e.goToFirstCell,"primary+Home"),goToFirstColumn:ct(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ct(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ct(e.goToLastCell,"primary+End"),goToLastColumn:ct(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ct(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ct(e.goToNextPage,"PageDown"),goToPreviousPage:ct(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ct(e.rightFill,"primary+_82"),search:ct(e.search,"primary+f"),selectAll:ct(e.selectAll,"primary+a"),selectColumn:ct(e.selectColumn,"ctrl+ "),selectGrowDown:ct(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ct(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ct(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ct(e.selectGrowUp,"shift+ArrowUp"),selectRow:ct(e.selectRow,"shift+ "),selectToFirstCell:ct(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ct(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ct(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ct(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ct(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ct(e.selectToLastRow,"primary+shift+ArrowDown")}}function D0(e){const t=Vg(e);return se.useMemo(()=>{if(t===void 0)return Mu(Rr);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??Rr.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??Rr.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??Rr.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??Rr.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??Rr.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??Rr.selectToLastCell};return Mu({...Rr,...n})},[t])}function O0(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const a={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(a.subGroups=r.subGroups.map((l,s)=>t(l,i+1,[...o,s])).sort((l,s)=>l.headerIndex-s.headerIndex)),a}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function Bs(e,t){const n=[];function r(a,l,s=!1){let u=l!==null?l-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(u=a.subGroups[0].headerIndex-a.headerIndex),u--,n.push({headerIndex:a.headerIndex,contentIndex:-1,skip:s,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:u}),a.subGroups)for(let c=0;c<a.subGroups.length;c++){const d=c<a.subGroups.length-1?a.subGroups[c+1].headerIndex:l;r(a.subGroups[c],d,s||a.isCollapsed)}}const i=O0(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;for(const a of n)a.contentIndex=o,o+=a.rows;return n.filter(a=>a.skip===!1).map(a=>{const{skip:l,...s}=a;return s})}function aa(e,t){if(t===void 0||Bs.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(n--,!r.isCollapsed){if(n<r.rows)return{path:[...r.path,n],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n,contentIndex:r.contentIndex+n,groupRows:r.rows};n-=r.rows}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function P0(e,t,n,r){const i=se.useMemo(()=>e===void 0?void 0:Bs(e,t),[e,t]),o=se.useMemo(()=>i===void 0?t:i.reduce((u,c)=>u+(c.isCollapsed?1:c.rows+1),0),[i,t]),a=se.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:u=>{const{isGroupHeader:c}=aa(u,i);return c?e.height:typeof n=="number"?n:n(u)},[i,e,n]),l=se.useCallback(u=>{if(i===void 0)return u;let c=u;for(const d of i){if(c===0)return;if(c--,!d.isCollapsed){if(c<d.rows)return d.contentIndex+c;c-=d.rows}}return u},[i]),s=Br(r??(e==null?void 0:e.themeOverride),se.useCallback(u=>{if(e===void 0)return r==null?void 0:r(u,u,u);if(r===void 0&&(e==null?void 0:e.themeOverride)===void 0)return;const{isGroupHeader:c,contentIndex:d,groupIndex:f}=aa(u,i);return c?e.themeOverride:r==null?void 0:r(u,f,d)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:l,getRowThemeOverride:s}:{rowHeight:a,rows:o,rowNumberMapper:l,getRowThemeOverride:s}}function _0(e,t){const n=se.useMemo(()=>e===void 0?void 0:Bs(e,t),[e,t]);return{getRowGroupingForPath:Id,updateRowGroupingByPath:Ed,mapper:se.useCallback(r=>{if(typeof r=="number")return aa(r,n);const i=aa(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function Ed(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,a)=>a===r?{...o,...n}:o):e.map((o,a)=>a===r?{...o,subGroups:Ed(o.subGroups??[],i,n)}:o)}function Id(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Id(e[n].subGroups??[],r)}function L0(e,t){const[n]=g.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 F0(e,t,n,r,i){const[o,a]=g.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),l=g.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:a}),[r,a,o]),[s,u,c]=zg(l),d=g.useRef(i);d.current=i;const f=L0(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.scrollLeft=e)}),h=(s.height??1)>1;g.useLayoutEffect(()=>{if(t!==void 0&&f.current!==null&&h){if(f.current.scrollTop===t)return;f.current.scrollTop=t,f.current.scrollTop!==t&&c(),d.current()}},[t,h,c,f]);const m=(s.width??1)>1;return g.useLayoutEffect(()=>{if(e!==void 0&&f.current!==null&&m){if(f.current.scrollLeft===e)return;f.current.scrollLeft=e,f.current.scrollLeft!==e&&c(),d.current()}},[e,m,c,f]),{visibleRegion:s,setVisibleRegion:u,scrollRef:f}}const A0=g.lazy(async()=>await Es(()=>import("./data-grid-overlay-editor.Bw6S-08j.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url));let H0=0;function z0(e){return Bm(du(du(e).filter(t=>t.span!==void 0).map(t=>{var n,r;return ar((((n=t.span)==null?void 0:n[0])??0)+1,(((r=t.span)==null?void 0:r[1])??0)+1)})))}function Ao(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 Ho={kind:re.Loading,allowOverlay:!1},zo={columns:vt.empty(),rows:vt.empty(),current:void 0},V0=(e,t)=>{var wl,yl,Cl;const[n,r]=g.useState(zo),[i,o]=g.useState(),a=g.useRef(null),l=g.useRef(null),[s,u]=g.useState(),c=g.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:f,getRowThemeOverride:h,markdownDivCreateNode:m,width:p,height:v,columns:y,rows:b,getCellContent:R,onCellClicked:O,onCellActivated:S,onFillPattern:M,onFinishedEditing:_,coercePasteValue:E,drawHeader:x,drawCell:L,editorBloom:D,onHeaderClicked:C,onColumnProposeMove:I,rangeSelectionColumnSpanning:T=!0,spanRangeBehavior:k="default",onGroupHeaderClicked:z,onCellContextMenu:N,className:U,onHeaderContextMenu:oe,getCellsForSelection:ee,onGroupHeaderContextMenu:G,onGroupHeaderRenamed:te,onCellEdited:ie,onCellsEdited:ue,onSearchResultsChanged:ge,searchResults:J,onSearchValueChange:H,searchValue:P,onKeyDown:q,onKeyUp:he,keybindings:me,editOnType:Ve=!0,onRowAppended:ve,onColumnMoved:Xe,validateCell:Me,highlightRegions:Ot,rangeSelect:kt="rect",columnSelect:et="multi",rowSelect:le="multi",rangeSelectionBlending:Ge="exclusive",columnSelectionBlending:we="exclusive",rowSelectionBlending:ce="exclusive",onDelete:be,onDragStart:$e,onMouseMove:Oe,onPaste:rt,copyHeaders:pe=!1,freezeColumns:Ee=0,cellActivationBehavior:lt="second-click",rowSelectionMode:Ae="auto",onHeaderMenuClick:it,onHeaderIndicatorClick:pt,getGroupDetails:ht,rowGrouping:He,onSearchClose:It,onItemHovered:Ut,onSelectionCleared:mt,showSearch:Mt,onVisibleRegionChanged:Xt,gridSelection:_t,onGridSelectionChange:Cn,minColumnWidth:Ht=50,maxColumnWidth:Rt=500,maxColumnAutoWidth:Sn,provideEditor:vn,trailingRowOptions:Pe,freezeTrailingRows:Lt=0,allowedFillDirections:cn="orthogonal",scrollOffsetX:hn,scrollOffsetY:gn,verticalBorder:ot,onDragOverCell:zt,onDrop:Pt,onColumnResize:tn,onColumnResizeEnd:Tt,onColumnResizeStart:Ft,customRenderers:je,fillHandle:Vt,experimental:$t,fixedShadowX:de,fixedShadowY:Ne,headerIcons:Gt,imageWindowLoader:xn,initialSize:on,isDraggable:V,onDragLeave:Ke,onRowMoved:ze,overscrollX:Dt,overscrollY:an,preventDiagonalScrolling:bn,rightElement:qn,rightElementProps:In,trapFocus:Zt=!1,smoothScrollX:Ln,smoothScrollY:Yn,scaleToRem:ya=!1,rowHeight:so=34,headerHeight:lo=36,groupHeaderHeight:Ca=lo,theme:Gr,isOutsideClick:br,renderers:mi,resizeIndicator:Sa,scrollToActiveCell:pi=!0,drawFocusRing:vi=!0}=e,Pr=vi==="no-editor"?i===void 0:vi,Jt=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,kn=(Jt==null?void 0:Jt.kind)??e.rowMarkers??"none",bi=(Jt==null?void 0:Jt.width)??e.rowMarkerWidth,wi=(Jt==null?void 0:Jt.startIndex)??e.rowMarkerStartIndex??1,jr=(Jt==null?void 0:Jt.theme)??e.rowMarkerTheme,cr=Jt==null?void 0:Jt.headerTheme,dr=Jt==null?void 0:Jt.headerAlwaysVisible,Kr=le!=="multi",tr=(Jt==null?void 0:Jt.checkboxStyle)??"square",nr=Math.max(Ht,20),_r=Math.max(Rt,nr),uo=Math.max(Sn??_r,nr),yi=g.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Ze,rowNumberMapper:co,rowHeight:fo,getRowThemeOverride:Fn}=P0(He,b,so,h),ho=g.useMemo(()=>Number.parseFloat(yi.fontSize),[yi]),{rowHeight:Xn,headerHeight:Ci,groupHeaderHeight:go,theme:mo,overscrollX:xa,overscrollY:ka}=T0({groupHeaderHeight:Ca,headerHeight:lo,overscrollX:Dt,overscrollY:an,remSize:ho,rowHeight:fo,scaleToRem:ya,theme:Gr}),An=D0(me),wr=bi??(b>1e4?48:b>1e3?44:b>100?36:32),Hn=kn!=="none",Y=Hn?1:0,Yt=ve!==void 0,yr=(Pe==null?void 0:Pe.sticky)===!0,[Zr,Jr]=g.useState(!1),Si=Mt??Zr,Ma=g.useCallback(()=>{It!==void 0?It():Jr(!1)},[It]),j=g.useMemo(()=>_t===void 0?void 0:Ao(_t,Y),[_t,Y])??n,ln=g.useRef();ln.current===void 0&&(ln.current=new AbortController),g.useEffect(()=>()=>ln==null?void 0:ln.current.abort(),[]);const[un,Ra]=h0(ee,R,Y,ln.current,Ze),$=g.useCallback((w,A,F)=>{if(Me===void 0)return!0;const W=[w[0]-Y,w[1]];return Me==null?void 0:Me(W,A,F)},[Y,Me]),ae=g.useRef(_t),Se=g.useCallback((w,A)=>{A&&(w=y0(w,un,Y,k,ln.current)),Cn!==void 0?(ae.current=Ao(w,-Y),Cn(ae.current)):r(w)},[Cn,un,Y,k]),xe=Br(tn,g.useCallback((w,A,F,W)=>{tn==null||tn(y[F-Y],A,F-Y,W)},[tn,Y,y])),fe=Br(Tt,g.useCallback((w,A,F,W)=>{Tt==null||Tt(y[F-Y],A,F-Y,W)},[Tt,Y,y])),Re=Br(Ft,g.useCallback((w,A,F,W)=>{Ft==null||Ft(y[F-Y],A,F-Y,W)},[Ft,Y,y])),at=Br(x,g.useCallback((w,A)=>(x==null?void 0:x({...w,columnIndex:w.columnIndex-Y},A))??!1,[x,Y])),st=Br(L,g.useCallback((w,A)=>(L==null?void 0:L({...w,col:w.col-Y},A))??!1,[L,Y])),Te=g.useCallback(w=>{if(be!==void 0){const A=be(Ao(w,-Y));return typeof A=="boolean"?A:Ao(A,Y)}return!0},[be,Y]),[Ct,ke,Je]=f0(j,Se,Ge,we,ce,kt,T),We=g.useMemo(()=>gr(dd(),mo),[mo]),[ft,sn]=g.useState([0,0,0]),Mn=g.useMemo(()=>{if(mi===void 0)return{};const w={};for(const A of mi)w[A.kind]=A;return w},[mi]),wt=g.useCallback(w=>w.kind!==re.Custom?Mn[w.kind]:je==null?void 0:je.find(A=>A.isMatch(w)),[je,Mn]);let{sizedColumns:jt,nonGrowWidth:Gn}=_m(y,Ze,Ra,ft[0]-(Y===0?0:wr)-ft[2],nr,uo,We,wt,ln.current);kn!=="none"&&(Gn+=wr);const wn=g.useMemo(()=>jt.some(w=>w.group!==void 0),[jt]),Et=wn?Ci+go:Ci,Rn=j.rows.length,Tn=kn==="none"?void 0:Rn===0?!1:Rn===Ze?!0:void 0,yt=g.useMemo(()=>kn==="none"?jt:[{title:"",width:wr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:jr,rowMarker:tr,rowMarkerChecked:Tn,headerRowMarkerTheme:cr,headerRowMarkerAlwaysVisible:dr,headerRowMarkerDisabled:Kr},...jt],[kn,jt,wr,jr,tr,Tn,cr,dr,Kr]),Qt=g.useRef({height:1,width:1,x:0,y:0}),Cr=g.useRef(!1),{setVisibleRegion:Sr,visibleRegion:Lr,scrollRef:Bt}=F0(hn,gn,Xn,Qt,()=>Cr.current=!0);Qt.current=Lr;const Cf=Lr.x+Y,po=Lr.y,En=g.useRef(null),yn=g.useCallback(w=>{var A;w===!0?(A=En.current)==null||A.focus():window.requestAnimationFrame(()=>{var F;(F=En.current)==null||F.focus()})},[]),mn=Yt?Ze+1:Ze,zn=g.useCallback(w=>{const A=Y===0?w:w.map(W=>({...W,location:[W.location[0]-Y,W.location[1]]})),F=ue==null?void 0:ue(A);if(F!==!0)for(const W of A)ie==null||ie(W.location,W.value);return F},[ie,ue,Y]),[Fr,Ea]=g.useState(),vo=j.current!==void 0&&j.current.range.width*j.current.range.height>1?j.current.range:void 0,Qr=Pr?(wl=j.current)==null?void 0:wl.cell:void 0,bo=Qr==null?void 0:Qr[0],wo=Qr==null?void 0:Qr[1],Sf=g.useMemo(()=>{if((Ot===void 0||Ot.length===0)&&(vo??bo??wo??Fr)===void 0)return;const w=[];if(Ot!==void 0)for(const A of Ot){const F=yt.length-A.range.x-Y;F>0&&w.push({color:A.color,range:{...A.range,x:A.range.x+Y,width:Math.min(F,A.range.width)},style:A.style})}return Fr!==void 0&&w.push({color:Ur(We.accentColor,0),range:Fr,style:"dashed"}),vo!==void 0&&w.push({color:Ur(We.accentColor,.5),range:vo,style:"solid-outline"}),bo!==void 0&&wo!==void 0&&w.push({color:We.accentColor,range:{x:bo,y:wo,width:1,height:1},style:"solid-outline"}),w.length>0?w:void 0},[Fr,vo,bo,wo,Ot,yt.length,We.accentColor,Y]),ol=g.useRef(yt);ol.current=yt;const Dn=g.useCallback(([w,A],F=!1)=>{var Z,X,K,Q,ne,ye,_e;const W=Yt&&A===mn-1;if(w===0&&Hn){if(W)return Ho;const Ce=co(A);return Ce===void 0?Ho:{kind:Un.Marker,allowOverlay:!1,checkboxStyle:tr,checked:(j==null?void 0:j.rows.hasIndex(A))===!0,markerKind:kn==="clickable-number"?"number":kn,row:wi+Ce,drawHandle:ze!==void 0,cursor:kn==="clickable-number"?"pointer":void 0}}else if(W){const Fe=w===Y?(Pe==null?void 0:Pe.hint)??"":"",De=ol.current[w];if(((Z=De==null?void 0:De.trailingRowOptions)==null?void 0:Z.disabled)===!0)return Ho;{const gt=((X=De==null?void 0:De.trailingRowOptions)==null?void 0:X.hint)??Fe,Ue=((K=De==null?void 0:De.trailingRowOptions)==null?void 0:K.addIcon)??(Pe==null?void 0:Pe.addIcon);return{kind:Un.NewRow,hint:gt,allowOverlay:!1,icon:Ue}}}else{const Ce=w-Y;if(F||($t==null?void 0:$t.strict)===!0){const De=Qt.current,gt=De.x>Ce||Ce>De.x+De.width||De.y>A||A>De.y+De.height||A>=Ta.current,Ue=Ce===((ne=(Q=De.extras)==null?void 0:Q.selected)==null?void 0:ne[0])&&A===((ye=De.extras)==null?void 0:ye.selected[1]);let Le=!1;if(((_e=De.extras)==null?void 0:_e.freezeRegions)!==void 0){for(const St of De.extras.freezeRegions)if(Wr(St,Ce,A)){Le=!0;break}}if(gt&&!Ue&&!Le)return Ho}let Fe=R([Ce,A]);return Y!==0&&Fe.span!==void 0&&(Fe={...Fe,span:[Fe.span[0]+Y,Fe.span[1]+Y]}),Fe}},[Yt,mn,Hn,co,tr,j==null?void 0:j.rows,kn,wi,ze,Y,Pe==null?void 0:Pe.hint,Pe==null?void 0:Pe.addIcon,$t==null?void 0:$t.strict,R]),Ia=g.useCallback(w=>{let A=(ht==null?void 0:ht(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:F=>Oa({group:A.name,bounds:F.bounds})}]}),A},[ht,te]),yo=g.useCallback(w=>{var K;const[A,F]=w.cell,W=yt[A],B=(W==null?void 0:W.group)!==void 0?(K=Ia(W.group))==null?void 0:K.overrideTheme:void 0,Z=W==null?void 0:W.themeOverride,X=Fn==null?void 0:Fn(F);o({...w,theme:gr(We,B,Z,X,w.content.themeOverride)})},[Fn,yt,Ia,We]),ei=g.useCallback((w,A,F)=>{var X;if(j.current===void 0)return;const[W,B]=j.current.cell,Z=Dn([W,B]);if(Z.kind!==re.Boolean&&Z.allowOverlay){let K=Z;if(F!==void 0)switch(K.kind){case re.Number:{const Q=lg(()=>F==="-"?-0:Number.parseFloat(F),0);K={...K,data:Number.isNaN(Q)?0:Q};break}case re.Text:case re.Markdown:case re.Uri:K={...K,data:F};break}yo({target:w,content:K,initialValue:F,cell:[W,B],highlight:F===void 0,forceEditMode:F!==void 0})}else Z.kind===re.Boolean&&A&&Z.readonly!==!0&&(zn([{location:j.current.cell,value:{...Z,data:Rd(Z.data)}}]),(X=En.current)==null||X.damage([{cell:j.current.cell}]))},[Dn,j,zn,yo]),al=g.useCallback((w,A)=>{var B;const F=(B=En.current)==null?void 0:B.getBounds(w,A);if(F===void 0||Bt.current===null)return;const W=Dn([w,A]);W.allowOverlay&&yo({target:F,content:W,initialValue:void 0,highlight:!0,cell:[w,A],forceEditMode:!0})},[Dn,Bt,yo]),nn=g.useCallback((w,A,F="both",W=0,B=0,Z=void 0)=>{if(Bt.current!==null){const X=En.current,K=l.current,Q=typeof w!="number"?w.unit==="cell"?w.amount:void 0:w,ne=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,ye=typeof w!="number"&&w.unit==="px"?w.amount:void 0,_e=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(X!==null&&K!==null){let Ce={x:0,y:0,width:0,height:0},Fe=0,De=0;if((Q!==void 0||ne!==void 0)&&(Ce=X.getBounds((Q??0)+Y,ne??0)??Ce,Ce.width===0||Ce.height===0))return;const gt=K.getBoundingClientRect(),Ue=gt.width/K.offsetWidth;if(ye!==void 0&&(Ce={...Ce,x:ye-gt.left-Bt.current.scrollLeft,width:1}),_e!==void 0&&(Ce={...Ce,y:_e+gt.top-Bt.current.scrollTop,height:1}),Ce!==void 0){const Le={x:Ce.x-W,y:Ce.y-B,width:Ce.width+2*W,height:Ce.height+2*B};let St=0;for(let za=0;za<Ee;za++)St+=jt[za].width;let qt=0;const rn=Lt+(yr?1:0);rn>0&&(qt=Yr(mn,rn,Xn));let Zn=St*Ue+gt.left+Y*wr*Ue,ir=gt.right,Jn=gt.top+Et*Ue,or=gt.bottom-qt*Ue;const Eo=Ce.width+W*2;switch(Z==null?void 0:Z.hAlign){case"start":ir=Zn+Eo;break;case"end":Zn=ir-Eo;break;case"center":Zn=Math.floor((Zn+ir)/2)-Eo/2,ir=Zn+Eo;break}const Io=Ce.height+B*2;switch(Z==null?void 0:Z.vAlign){case"start":or=Jn+Io;break;case"end":Jn=or-Io;break;case"center":Jn=Math.floor((Jn+or)/2)-Io/2,or=Jn+Io;break}Zn>Le.x?Fe=Le.x-Zn:ir<Le.x+Le.width&&(Fe=Le.x+Le.width-ir),Jn>Le.y?De=Le.y-Jn:or<Le.y+Le.height&&(De=Le.y+Le.height-or),F==="vertical"||typeof w=="number"&&w<Ee?Fe=0:(F==="horizontal"||typeof A=="number"&&A>=mn-rn)&&(De=0),(Fe!==0||De!==0)&&(Ue!==1&&(Fe/=Ue,De/=Ue),Bt.current.scrollTo(Fe+Bt.current.scrollLeft,De+Bt.current.scrollTop))}}}},[Y,Lt,wr,Bt,Et,Ee,jt,mn,yr,Xn]),sl=g.useRef(al),ll=g.useRef(R),Ta=g.useRef(Ze);sl.current=al,ll.current=R,Ta.current=Ze;const ti=g.useCallback(async(w,A=!0)=>{var Q;const F=yt[w];if(((Q=F==null?void 0:F.trailingRowOptions)==null?void 0:Q.disabled)===!0)return;const W=ve==null?void 0:ve();let B,Z=!0;W!==void 0&&(B=await W,B==="top"&&(Z=!1),typeof B=="number"&&(Z=!1));let X=0;const K=()=>{if(Ta.current<=Ze){X<500&&window.setTimeout(K,X),X=50+X*2;return}const ne=typeof B=="number"?B:Z?Ze:0;Ro.current(w-Y,ne),Ct({cell:[w,ne],range:{x:w,y:ne,width:1,height:1}},!1,!1,"edit");const ye=ll.current([w-Y,ne]);ye.allowOverlay&&qi(ye)&&ye.readonly!==!0&&A&&window.setTimeout(()=>{sl.current(w,ne)},0)};K()},[yt,ve,Y,Ze,Ct]),Co=g.useCallback(w=>{var F,W;const A=((W=(F=jt[w])==null?void 0:F.trailingRowOptions)==null?void 0:W.targetColumn)??(Pe==null?void 0:Pe.targetColumn);if(typeof A=="number")return A+(Hn?1:0);if(typeof A=="object"){const B=y.indexOf(A);if(B>=0)return B+(Hn?1:0)}},[jt,y,Hn,Pe==null?void 0:Pe.targetColumn]),xr=g.useRef(),ni=g.useRef(),ki=g.useCallback((w,A)=>{var B;const[F,W]=A;return gr(We,(B=yt[F])==null?void 0:B.themeOverride,Fn==null?void 0:Fn(W),w.themeOverride)},[Fn,yt,We]),{mapper:Ar}=_0(He,b),jn=He==null?void 0:He.navigationBehavior,Mi=g.useCallback(w=>{var ye,_e,Ce;const A=ia.value?w.metaKey:w.ctrlKey,F=A&&le==="multi",W=A&&et==="multi",[B,Z]=w.location,X=j.columns,K=j.rows,[Q,ne]=((ye=j.current)==null?void 0:ye.cell)??[];if(w.kind==="cell"){if(ni.current=void 0,Hr.current=[B,Z],B===0&&Hn){if(Yt===!0&&Z===Ze||kn==="number"||le==="none")return;const Fe=Dn(w.location);if(Fe.kind!==Un.Marker)return;if(ze!==void 0){const Ue=wt(Fe);Pn((Ue==null?void 0:Ue.kind)===Un.Marker);const Le=(_e=Ue==null?void 0:Ue.onClick)==null?void 0:_e.call(Ue,{...w,cell:Fe,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,theme:ki(Fe,w.location),preventDefault:()=>{}});if(Le===void 0||Le.checked===Fe.checked)return}o(void 0),yn();const De=K.hasIndex(Z),gt=xr.current;if(le==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&gt!==void 0&&K.hasIndex(gt)){const Ue=[Math.min(gt,Z),Math.max(gt,Z)+1];F||Ae==="multi"?ke(void 0,Ue,!0):ke(vt.fromSingleSelection(Ue),void 0,F)}else le==="multi"&&(F||w.isTouch||Ae==="multi")?De?ke(K.remove(Z),void 0,!0):(ke(void 0,Z,!0),xr.current=Z):De&&K.length===1?ke(vt.empty(),void 0,A):(ke(vt.fromSingleSelection(Z),void 0,A),xr.current=Z)}else if(B>=Y&&Yt&&Z===Ze){const Fe=Co(B);ti(Fe??B)}else if(Q!==B||ne!==Z){const Fe=Dn(w.location),De=wt(Fe);if((De==null?void 0:De.onSelect)!==void 0){let Le=!1;if(De.onSelect({...w,cell:Fe,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,preventDefault:()=>Le=!0,theme:ki(Fe,w.location)}),Le)return}if(jn==="block"&&Ar(Z).isGroupHeader)return;const gt=yr&&Z===Ze,Ue=yr&&j!==void 0&&((Ce=j.current)==null?void 0:Ce.cell[1])===Ze;if((w.shiftKey||w.isLongTouch===!0)&&Q!==void 0&&ne!==void 0&&j.current!==void 0&&!Ue){if(gt)return;const Le=Math.min(B,Q),St=Math.max(B,Q),qt=Math.min(Z,ne),rn=Math.max(Z,ne);Ct({...j.current,range:{x:Le,y:qt,width:St-Le+1,height:rn-qt+1}},!0,A,"click"),xr.current=void 0,yn()}else Ct({cell:[B,Z],range:{x:B,y:Z,width:1,height:1}},!0,A,"click"),xr.current=void 0,o(void 0),yn()}}else if(w.kind==="header")if(Hr.current=[B,Z],o(void 0),Hn&&B===0)xr.current=void 0,ni.current=void 0,le==="multi"&&(K.length!==Ze?ke(vt.fromSingleSelection([0,Ze]),void 0,A):ke(vt.empty(),void 0,A),yn());else{const Fe=ni.current;if(et==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&Fe!==void 0&&X.hasIndex(Fe)){const De=[Math.min(Fe,B),Math.max(Fe,B)+1];W?Je(void 0,De,A):Je(vt.fromSingleSelection(De),void 0,A)}else W?(X.hasIndex(B)?Je(X.remove(B),void 0,A):Je(void 0,B,A),ni.current=B):et!=="none"&&(Je(vt.fromSingleSelection(B),void 0,A),ni.current=B);xr.current=void 0,yn()}else w.kind===Wn?Hr.current=[B,Z]:w.kind===oa&&!w.isMaybeScrollbar&&(Se(zo,!1),o(void 0),yn(),mt==null||mt(),xr.current=void 0,ni.current=void 0)},[le,et,j,Hn,Y,Yt,Ze,kn,Dn,ze,yn,Ae,wt,ki,ke,Co,ti,jn,Ar,yr,Ct,Je,Se,mt]),Ri=g.useRef(!1),Hr=g.useRef(),ul=g.useRef(Lr),Vn=g.useRef(),xf=g.useCallback(w=>{if(ri.current=!1,ul.current=Qt.current,w.button!==0&&w.button!==1){Vn.current=void 0;return}const A=performance.now();Vn.current={button:w.button,time:A,location:w.location},(w==null?void 0:w.kind)==="header"&&(Ri.current=!0);const F=w.kind==="cell"&&w.isFillHandle;!F&&w.kind!=="cell"&&w.isEdge||(u({previousSelection:j,fillHandle:F}),Hr.current=void 0,!w.isTouch&&w.button===0&&!F?Mi(w):!w.isTouch&&w.button===1&&(Hr.current=w.location))},[j,Mi]),[Da,Oa]=g.useState(),cl=g.useCallback(w=>{if(w.kind!==Wn||et!=="multi")return;const A=ia.value?w.metaKey:w.ctrlKey,[F]=w.location,W=j.columns;if(F<Y)return;const B=yt[F];let Z=F,X=F;for(let K=F-1;K>=Y&&Qi(B.group,yt[K].group);K--)Z--;for(let K=F+1;K<yt.length&&Qi(B.group,yt[K].group);K++)X++;if(yn(),A)if(W.hasAll([Z,X+1])){let K=W;for(let Q=Z;Q<=X;Q++)K=K.remove(Q);Je(K,void 0,A)}else Je(void 0,[Z,X+1],A);else Je(vt.fromSingleSelection([Z,X+1]),void 0,A)},[et,yn,j.columns,yt,Y,Je]),ri=g.useRef(!1),So=g.useCallback(async w=>{if(un!==void 0&&xe!==void 0){const A=Qt.current.y,F=Qt.current.height;let W=un({x:w,y:A,width:1,height:Math.min(F,Ze-A)},ln.current.signal);typeof W!="object"&&(W=await W());const B=jt[w-Y],X=document.createElement("canvas").getContext("2d",{alpha:!1});if(X!==null){X.font=We.baseFontFull;const K=hd(X,We,B,0,W,nr,_r,!1,wt);xe==null||xe(B,K.width,w,K.width)}}},[jt,un,_r,We,nr,xe,Y,Ze,wt]),[kf,Pa]=g.useState(),ii=g.useCallback(async(w,A)=>{var K,Q;const F=(K=w.current)==null?void 0:K.range;if(F===void 0||un===void 0||A.current===void 0)return;const W=A.current.range;if(M!==void 0){let ne=!1;if(M({fillDestination:{...W,x:W.x-Y},patternSource:{...F,x:F.x-Y},preventDefault:()=>ne=!0}),ne)return}let B=un(F,ln.current.signal);typeof B!="object"&&(B=await B());const Z=B,X=[];for(let ne=0;ne<W.width;ne++)for(let ye=0;ye<W.height;ye++){const _e=[W.x+ne,W.y+ye];if(ed(_e,F))continue;const Ce=Z[ye%F.height][ne%F.width];li(Ce)||!qi(Ce)||X.push({location:_e,value:{...Ce}})}zn(X),(Q=En.current)==null||Q.damage(X.map(ne=>({cell:ne.location})))},[un,zn,M,Y]),dl=g.useCallback(()=>{if(j.current===void 0||j.current.range.width<=1)return;const w={...j,current:{...j.current,range:{...j.current.range,width:1}}};ii(w,j)},[ii,j]),fl=g.useCallback(()=>{if(j.current===void 0||j.current.range.height<=1)return;const w={...j,current:{...j.current,range:{...j.current.range,height:1}}};ii(w,j)},[ii,j]),Mf=g.useCallback((w,A)=>{var ye,_e;const F=s;if(u(void 0),Ea(void 0),Pa(void 0),Ri.current=!1,A)return;if((F==null?void 0:F.fillHandle)===!0&&j.current!==void 0&&((ye=F.previousSelection)==null?void 0:ye.current)!==void 0){if(Fr===void 0)return;const Ce={...j,current:{...j.current,range:bd(F.previousSelection.current.range,Fr)}};ii(F.previousSelection,Ce),Se(Ce,!0);return}const[W,B]=w.location,[Z,X]=Hr.current??[],K=()=>{ri.current=!0},Q=Ce=>{var De,gt,Ue;const Fe=Ce.isTouch||Z===W&&X===B;if(Fe&&(O==null||O([W-Y,B],{...Ce,preventDefault:K})),Ce.button===1)return!ri.current;if(!ri.current){const Le=Dn(w.location),St=wt(Le);if(St!==void 0&&St.onClick!==void 0&&Fe){const rn=St.onClick({...Ce,cell:Le,posX:Ce.localEventX,posY:Ce.localEventY,bounds:Ce.bounds,theme:ki(Le,w.location),preventDefault:K});rn!==void 0&&!li(rn)&&ai(rn)&&(zn([{location:Ce.location,value:rn}]),(De=En.current)==null||De.damage([{cell:Ce.location}]))}if(ri.current||j.current===void 0)return!1;let qt=!1;switch(Le.activationBehaviorOverride??lt){case"double-click":case"second-click":{if(((Ue=(gt=F==null?void 0:F.previousSelection)==null?void 0:gt.current)==null?void 0:Ue.cell)===void 0)break;const[rn,Zn]=j.current.cell,[ir,Jn]=F.previousSelection.current.cell;qt=W===rn&&W===ir&&B===Zn&&B===Jn&&(Ce.isDoubleClick===!0||lt==="second-click");break}case"single-click":{qt=!0;break}}if(qt)return S==null||S([W-Y,B]),ei(Ce.bounds,!1),!0}return!1},ne=w.location[0]-Y;if(w.isTouch){const Ce=Qt.current,Fe=ul.current;if(Ce.x!==Fe.x||Ce.y!==Fe.y)return;if(w.isLongTouch===!0){if(w.kind==="cell"&&Gi((_e=j.current)==null?void 0:_e.cell,w.location)){N==null||N([ne,w.location[1]],{...w,preventDefault:K});return}else if(w.kind==="header"&&j.columns.hasIndex(W)){oe==null||oe(ne,{...w,preventDefault:K});return}else if(w.kind===Wn){if(ne<0)return;G==null||G(ne,{...w,preventDefault:K});return}}w.kind==="cell"?Q(w)||Mi(w):w.kind===Wn?z==null||z(ne,{...w,preventDefault:K}):(w.kind===Er&&(C==null||C(ne,{...w,preventDefault:K})),Mi(w));return}if(w.kind==="header"){if(ne<0)return;w.isEdge?w.isDoubleClick===!0&&So(W):w.button===0&&W===Z&&B===X&&(C==null||C(ne,{...w,preventDefault:K}))}if(w.kind===Wn){if(ne<0)return;w.button===0&&W===Z&&B===X&&(z==null||z(ne,{...w,preventDefault:K}),ri.current||cl(w))}w.kind==="cell"&&(w.button===0||w.button===1)&&Q(w),Hr.current=void 0},[s,j,Y,Fr,ii,Se,O,Dn,wt,lt,ki,zn,S,ei,N,oe,G,Mi,z,C,So,cl]),Rf=g.useCallback(w=>{const A={...w,location:[w.location[0]-Y,w.location[1]]};Oe==null||Oe(A),s!==void 0&&w.buttons===0&&(u(void 0),Ea(void 0),Pa(void 0),Ri.current=!1),Pa(F=>{var W;return Ri.current?[w.scrollEdge[0],0]:w.scrollEdge[0]===(F==null?void 0:F[0])&&w.scrollEdge[1]===F[1]?F:s===void 0||(((W=Vn.current)==null?void 0:W.location[0])??0)<Y?void 0:w.scrollEdge})},[s,Oe,Y]),Ef=g.useCallback((w,A)=>{it==null||it(w-Y,A)},[it,Y]),If=g.useCallback((w,A)=>{pt==null||pt(w-Y,A)},[pt,Y]),rr=(yl=j==null?void 0:j.current)==null?void 0:yl.cell,Tf=g.useCallback((w,A,F,W,B,Z)=>{Cr.current=!1;let X=rr;X!==void 0&&(X=[X[0]-Y,X[1]]);const K=Ee===0?void 0:{x:0,y:w.y,width:Ee,height:w.height},Q=[];K!==void 0&&Q.push(K),Lt>0&&(Q.push({x:w.x-Y,y:Ze-Lt,width:w.width,height:Lt}),Ee>0&&Q.push({x:0,y:Ze-Lt,width:Ee,height:Lt}));const ne={x:w.x-Y,y:w.y,width:w.width,height:Yt&&w.y+w.height>=Ze?w.height-1:w.height,tx:B,ty:Z,extras:{selected:X,freezeRegion:K,freezeRegions:Q}};Qt.current=ne,Sr(ne),sn([A,F,W]),Xt==null||Xt(ne,ne.tx,ne.ty,ne.extras)},[rr,Y,Yt,Ze,Ee,Lt,Sr,Xt]),Df=Br(Xe,g.useCallback((w,A)=>{Xe==null||Xe(w-Y,A-Y),et!=="none"&&Je(vt.fromSingleSelection(A),void 0,!0)},[et,Xe,Y,Je])),_a=g.useRef(!1),Of=g.useCallback(w=>{if(w.location[0]===0&&Y>0){w.preventDefault();return}$e==null||$e({...w,location:[w.location[0]-Y,w.location[1]]}),w.defaultPrevented()||(_a.current=!0),u(void 0)},[$e,Y]),Pf=g.useCallback(()=>{_a.current=!1},[]),hl=He==null?void 0:He.selectionBehavior,xo=g.useCallback(w=>{if(hl!=="block-spanning")return;const{isGroupHeader:A,path:F,groupRows:W}=Ar(w);if(A)return[w,w];const B=F[F.length-1],Z=w-B,X=w+W-B-1;return[Z,X]},[Ar,hl]),La=g.useRef(),Fa=g.useCallback(w=>{var A,F,W;if(!kd(w,La.current)&&(La.current=w,!(((A=Vn==null?void 0:Vn.current)==null?void 0:A.button)!==void 0&&Vn.current.button>=1))){if(w.buttons!==0&&s!==void 0&&((F=Vn.current)==null?void 0:F.location[0])===0&&w.location[0]===0&&Y===1&&le==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(Vn.current.location[1])&&j.rows.hasIndex(Vn.current.location[1])){const B=Math.min(Vn.current.location[1],w.location[1]),Z=Math.max(Vn.current.location[1],w.location[1])+1;ke(vt.fromSingleSelection([B,Z]),void 0,!1)}if(w.buttons!==0&&s!==void 0&&j.current!==void 0&&!_a.current&&!Ri.current&&(kt==="rect"||kt==="multi-rect")){const[B,Z]=j.current.cell;let[X,K]=w.location;if(K<0&&(K=Qt.current.y),s.fillHandle===!0&&((W=s.previousSelection)==null?void 0:W.current)!==void 0){const Q=s.previousSelection.current.range;K=Math.min(K,Yt?Ze-1:Ze);const ne=Cp(Q,X,K,cn);Ea(ne)}else{if(Yt&&Z===Ze)return;if(Yt&&K===Ze)if(w.kind===oa)K--;else return;X=Math.max(X,Y);const ye=xo(Z);K=ye===void 0?K:Nn(K,ye[0],ye[1]);const _e=X-B,Ce=K-Z,Fe={x:_e>=0?B:X,y:Ce>=0?Z:K,width:Math.abs(_e)+1,height:Math.abs(Ce)+1};Ct({...j.current,range:Fe},!0,!1,"drag")}}Ut==null||Ut({...w,location:[w.location[0]-Y,w.location[1]]})}},[s,Y,le,j,kt,Ut,ke,Yt,Ze,cn,xo,Ct]),_f=g.useCallback(()=>{var X,K;const w=La.current;if(w===void 0)return;const[A,F]=w.scrollEdge;let[W,B]=w.location;const Z=Qt.current;A===-1?W=((K=(X=Z.extras)==null?void 0:X.freezeRegion)==null?void 0:K.x)??Z.x:A===1&&(W=Z.x+Z.width),F===-1?B=Math.max(0,Z.y):F===1&&(B=Math.min(Ze-1,Z.y+Z.height)),W=Nn(W,0,yt.length-1),B=Nn(B,0,Ze-1),Fa({...w,location:[W,B]})},[yt.length,Fa,Ze]);I0(kf,Bt,_f);const Kn=g.useCallback(w=>{if(j.current===void 0)return;const[A,F]=w,[W,B]=j.current.cell,Z=j.current.range;let X=Z.x,K=Z.x+Z.width,Q=Z.y,ne=Z.y+Z.height;const[ye,_e]=xo(B)??[0,Ze-1],Ce=_e+1;if(F!==0)switch(F){case 2:{ne=Ce,Q=B,nn(0,ne,"vertical");break}case-2:{Q=ye,ne=B+1,nn(0,Q,"vertical");break}case 1:{Q<B?(Q++,nn(0,Q,"vertical")):(ne=Math.min(Ce,ne+1),nn(0,ne,"vertical"));break}case-1:{ne>B+1?(ne--,nn(0,ne,"vertical")):(Q=Math.max(ye,Q-1),nn(0,Q,"vertical"));break}default:Ji()}if(A!==0)if(A===2)K=yt.length,X=W,nn(K-1-Y,0,"horizontal");else if(A===-2)X=Y,K=W+1,nn(X-Y,0,"horizontal");else{let Fe=[];if(un!==void 0){const De=un({x:X,y:Q,width:K-X-Y,height:ne-Q},ln.current.signal);typeof De=="object"&&(Fe=z0(De))}if(A===1){let De=!1;if(X<W){if(Fe.length>0){const gt=ar(X+1,W+1).find(Ue=>!Fe.includes(Ue-Y));gt!==void 0&&(X=gt,De=!0)}else X++,De=!0;De&&nn(X,0,"horizontal")}De||(K=Math.min(yt.length,K+1),nn(K-1-Y,0,"horizontal"))}else if(A===-1){let De=!1;if(K>W+1){if(Fe.length>0){const gt=ar(K-1,W,-1).find(Ue=>!Fe.includes(Ue-Y));gt!==void 0&&(K=gt,De=!0)}else K--,De=!0;De&&nn(K-Y,0,"horizontal")}De||(X=Math.max(Y,X-1),nn(X-Y,0,"horizontal"))}else Ji()}Ct({cell:j.current.cell,range:{x:X,y:Q,width:K-X,height:ne-Q}},!0,!1,"keyboard-select")},[un,xo,j,yt.length,Y,Ze,nn,Ct]),Aa=g.useRef(pi);Aa.current=pi;const kr=g.useCallback((w,A,F,W)=>{const B=mn-(F?0:1);w=Nn(w,Y,jt.length-1+Y),A=Nn(A,0,B);const Z=rr==null?void 0:rr[0],X=rr==null?void 0:rr[1];if(w===Z&&A===X)return!1;if(W&&j.current!==void 0){const K=[...j.current.rangeStack];(j.current.range.width>1||j.current.range.height>1)&&K.push(j.current.range),Se({...j,current:{cell:[w,A],range:{x:w,y:A,width:1,height:1},rangeStack:K}},!0)}else Ct({cell:[w,A],range:{x:w,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===w&&c.current[1]===A&&(c.current=void 0),Aa.current&&nn(w-Y,A),!0},[mn,Y,jt.length,rr,j,nn,Se,Ct]),Lf=g.useCallback((w,A)=>{(i==null?void 0:i.cell)!==void 0&&w!==void 0&&ai(w)&&(zn([{location:i.cell,value:w}]),window.requestAnimationFrame(()=>{var B;(B=En.current)==null||B.damage([{cell:i.cell}])})),yn(!0),o(void 0);const[F,W]=A;if(j.current!==void 0&&(F!==0||W!==0)){const B=j.current.cell[1]===mn-1&&w!==void 0;kr(Nn(j.current.cell[0]+F,0,yt.length-1),Nn(j.current.cell[1]+W,0,mn-1),B,!1)}_==null||_(w,A)},[i==null?void 0:i.cell,yn,j,_,zn,mn,kr,yt.length]),Ff=g.useMemo(()=>`gdg-overlay-${H0++}`,[]),zr=g.useCallback(w=>{var F,W,B,Z;yn();const A=[];for(let X=w.x;X<w.x+w.width;X++)for(let K=w.y;K<w.y+w.height;K++){const Q=R([X-Y,K]);if(!Q.allowOverlay&&Q.kind!==re.Boolean)continue;let ne;if(Q.kind===re.Custom){const ye=wt(Q),_e=(F=ye==null?void 0:ye.provideEditor)==null?void 0:F.call(ye,Q);(ye==null?void 0:ye.onDelete)!==void 0?ne=ye.onDelete(Q):hg(_e)&&(ne=(W=_e==null?void 0:_e.deletedValue)==null?void 0:W.call(_e,Q))}else if(ai(Q)&&Q.allowOverlay||Q.kind===re.Boolean){const ye=wt(Q);ne=(B=ye==null?void 0:ye.onDelete)==null?void 0:B.call(ye,Q)}ne!==void 0&&!li(ne)&&ai(ne)&&A.push({location:[X,K],value:ne})}zn(A),(Z=En.current)==null||Z.damage(A.map(X=>({cell:X.location})))},[yn,R,wt,zn,Y]),Ei=i!==void 0,gl=g.useCallback(w=>{var gt,Ue;const A=()=>{w.stopPropagation(),w.preventDefault()},F={didMatch:!1},{bounds:W}=w,B=j.columns,Z=j.rows,X=An;if(!Ei&&ut(X.clear,w,F))Se(zo,!1),mt==null||mt();else if(!Ei&&ut(X.selectAll,w,F))Se({columns:vt.empty(),rows:vt.empty(),current:{cell:((gt=j.current)==null?void 0:gt.cell)??[Y,0],range:{x:Y,y:0,width:y.length,height:Ze},rangeStack:[]}},!1);else if(ut(X.search,w,F))(Ue=a==null?void 0:a.current)==null||Ue.focus({preventScroll:!0}),Jr(!0);else if(ut(X.delete,w,F)){const Le=(Te==null?void 0:Te(j))??!0;if(Le!==!1){const St=Le===!0?j:Le;if(St.current!==void 0){zr(St.current.range);for(const qt of St.current.rangeStack)zr(qt)}for(const qt of St.rows)zr({x:Y,y:qt,width:y.length,height:1});for(const qt of St.columns)zr({x:qt,y:0,width:1,height:Ze})}}if(F.didMatch)return A(),!0;if(j.current===void 0)return!1;let[K,Q]=j.current.cell;const[,ne]=j.current.cell;let ye=!1,_e=!1;if(ut(X.scrollToSelectedCell,w,F)?Ro.current(K-Y,Q):et!=="none"&&ut(X.selectColumn,w,F)?B.hasIndex(K)?Je(B.remove(K),void 0,!0):et==="single"?Je(vt.fromSingleSelection(K),void 0,!0):Je(void 0,K,!0):le!=="none"&&ut(X.selectRow,w,F)?Z.hasIndex(Q)?ke(Z.remove(Q),void 0,!0):le==="single"?ke(vt.fromSingleSelection(Q),void 0,!0):ke(void 0,Q,!0):!Ei&&W!==void 0&&ut(X.activateCell,w,F)?Q===Ze&&Yt?window.setTimeout(()=>{const Le=Co(K);ti(Le??K)},0):(S==null||S([K-Y,Q]),ei(W,!0)):j.current.range.height>1&&ut(X.downFill,w,F)?fl():j.current.range.width>1&&ut(X.rightFill,w,F)?dl():ut(X.goToNextPage,w,F)?Q+=Math.max(1,Qt.current.height-4):ut(X.goToPreviousPage,w,F)?Q-=Math.max(1,Qt.current.height-4):ut(X.goToFirstCell,w,F)?(o(void 0),Q=0,K=0):ut(X.goToLastCell,w,F)?(o(void 0),Q=Number.MAX_SAFE_INTEGER,K=Number.MAX_SAFE_INTEGER):ut(X.selectToFirstCell,w,F)?(o(void 0),Kn([-2,-2])):ut(X.selectToLastCell,w,F)?(o(void 0),Kn([2,2])):Ei?(ut(X.closeOverlay,w,F)&&o(void 0),ut(X.acceptOverlayDown,w,F)&&(o(void 0),Q++),ut(X.acceptOverlayUp,w,F)&&(o(void 0),Q--),ut(X.acceptOverlayLeft,w,F)&&(o(void 0),K--),ut(X.acceptOverlayRight,w,F)&&(o(void 0),K++)):(ut(X.goDownCell,w,F)?Q+=1:ut(X.goUpCell,w,F)?Q-=1:ut(X.goRightCell,w,F)?K+=1:ut(X.goLeftCell,w,F)?K-=1:ut(X.goDownCellRetainSelection,w,F)?(Q+=1,ye=!0):ut(X.goUpCellRetainSelection,w,F)?(Q-=1,ye=!0):ut(X.goRightCellRetainSelection,w,F)?(K+=1,ye=!0):ut(X.goLeftCellRetainSelection,w,F)?(K-=1,ye=!0):ut(X.goToLastRow,w,F)?Q=Ze-1:ut(X.goToFirstRow,w,F)?Q=Number.MIN_SAFE_INTEGER:ut(X.goToLastColumn,w,F)?K=Number.MAX_SAFE_INTEGER:ut(X.goToFirstColumn,w,F)?K=Number.MIN_SAFE_INTEGER:(kt==="rect"||kt==="multi-rect")&&(ut(X.selectGrowDown,w,F)?Kn([0,1]):ut(X.selectGrowUp,w,F)?Kn([0,-1]):ut(X.selectGrowRight,w,F)?Kn([1,0]):ut(X.selectGrowLeft,w,F)?Kn([-1,0]):ut(X.selectToLastRow,w,F)?Kn([0,2]):ut(X.selectToFirstRow,w,F)?Kn([0,-2]):ut(X.selectToLastColumn,w,F)?Kn([2,0]):ut(X.selectToFirstColumn,w,F)&&Kn([-2,0])),_e=F.didMatch),jn!==void 0&&jn!=="normal"&&Q!==ne){const Le=jn==="skip-up"||jn==="skip"||jn==="block",St=jn==="skip-down"||jn==="skip"||jn==="block",qt=Q<ne;if(qt&&Le){for(;Q>=0&&Ar(Q).isGroupHeader;)Q--;Q<0&&(Q=ne)}else if(!qt&&St){for(;Q<Ze&&Ar(Q).isGroupHeader;)Q++;Q>=Ze&&(Q=ne)}}const Fe=kr(K,Q,!1,ye),De=F.didMatch;return De&&(Fe||!_e||Zt)&&A(),De},[jn,Ei,j,An,et,le,kt,Y,Ar,Ze,kr,Se,mt,y.length,Te,Zt,zr,Je,ke,Yt,Co,ti,S,ei,fl,dl,Kn]),Ii=g.useCallback(w=>{let A=!1;if(q!==void 0&&q({...w,cancel:()=>{A=!0}}),A||gl(w)||j.current===void 0)return;const[F,W]=j.current.cell,B=Qt.current;if(Ve&&!w.metaKey&&!w.ctrlKey&&j.current!==void 0&&w.key.length===1&&/[ -~]/g.test(w.key)&&w.bounds!==void 0&&qi(R([F-Y,Math.max(0,Math.min(W,Ze-1))]))){if((!Yt||W!==Ze)&&(B.y>W||W>B.y+B.height||B.x>F||F>B.x+B.width))return;ei(w.bounds,!0,w.key),w.stopPropagation(),w.preventDefault()}},[Ve,q,gl,j,R,Y,Ze,Yt,ei]),Af=g.useCallback((w,A)=>{const F=w.location[0]-Y;if(w.kind==="header"&&(oe==null||oe(F,{...w,preventDefault:A})),w.kind===Wn){if(F<0)return;G==null||G(F,{...w,preventDefault:A})}if(w.kind==="cell"){const[W,B]=w.location;N==null||N([F,B],{...w,preventDefault:A}),pm(j,w.location)||kr(W,B,!1,!1)}},[j,N,G,oe,Y,kr]),Ha=g.useCallback(async w=>{var X,K,Q;if(!An.paste)return;function A(ne,ye,_e,Ce){var De,gt;const Fe=typeof _e=="object"?(_e==null?void 0:_e.join(`
172
+ `&&(n.push(r),r=[])),o=t.None);break}a++}return i<e.length&&r.push(Su(e.slice(i,e.length))),n.push(r),n.map(l=>l.map(s=>({rawValue:s,formatted:s,format:"string"})))}function xu(e,t,n){var l;const r=w0(e,t),i=s=>{var u;(u=window.navigator.clipboard)==null||u.writeText(s)},o=(s,u)=>{var c;return((c=window.navigator.clipboard)==null?void 0:c.write)===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([s],{type:"text/plain"}),"text/html":new Blob([u],{type:"text/html"})})]),!0)},a=(s,u)=>{var c,d;try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");(c=n==null?void 0:n.clipboardData)==null||c.setData("text/plain",s),(d=n==null?void 0:n.clipboardData)==null||d.setData("text/html",u)}catch{o(s,u)||i(s)}};((l=window.navigator.clipboard)==null?void 0:l.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?a(r.textPlain,r.textHtml):i(r.textPlain),n==null||n.preventDefault()}function Rd(e){return e!==!0}function ku(e){return typeof e=="string"?e:`${e}px`}const S0=()=>e=>e.innerWidth,x0=()=>e=>e.innerHeight,k0=fn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[S0()],"wmyidgi-1":[x0()]}}),M0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return g.createElement(k0,{innerHeight:ku(n),innerWidth:ku(t),...i},r)},R0=2,E0=1300;function I0(e,t,n){const r=se.useRef(0),[i,o]=e??[0,0];se.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let a=!1,l=0;const s=u=>{var c;if(!a){if(l===0)l=u;else{const d=u-l;r.current=Math.min(1,r.current+d/E0);const f=r.current**1.618*d*R0;(c=t.current)==null||c.scrollBy(i*f,o*f),l=u,n==null||n()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{a=!0}},[t,i,o,n])}function T0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:a,remSize:l}){const[s,u,c,d,f,h]=se.useMemo(()=>{if(!a||l===16)return[e,t,n,r,i,o];const m=l/16,p=e,v=dd();return[typeof p=="number"?p*m:y=>Math.ceil(p(y)*m),Math.ceil(t*m),Math.ceil(n*m),{...r,headerIconSize:((r==null?void 0:r.headerIconSize)??v.headerIconSize)*m,cellHorizontalPadding:((r==null?void 0:r.cellHorizontalPadding)??v.cellHorizontalPadding)*m,cellVerticalPadding:((r==null?void 0:r.cellVerticalPadding)??v.cellVerticalPadding)*m},Math.ceil((i??0)*m),Math.ceil((o??0)*m)]},[n,t,i,o,l,e,a,r]);return{rowHeight:s,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:f,overscrollY:h}}const Rr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function ct(e,t){return e===!0?t:e===!1?"":e}function Mu(e){const t=ia.value;return{activateCell:ct(e.activateCell," |Enter|shift+Enter"),clear:ct(e.clear,"any+Escape"),closeOverlay:ct(e.closeOverlay,"any+Escape"),acceptOverlayDown:ct(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ct(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ct(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ct(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ct(e.delete,t?"Backspace|Delete":"Delete"),downFill:ct(e.downFill,"primary+_68"),scrollToSelectedCell:ct(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ct(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ct(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ct(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ct(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ct(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ct(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ct(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ct(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ct(e.goToFirstCell,"primary+Home"),goToFirstColumn:ct(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ct(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ct(e.goToLastCell,"primary+End"),goToLastColumn:ct(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ct(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ct(e.goToNextPage,"PageDown"),goToPreviousPage:ct(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ct(e.rightFill,"primary+_82"),search:ct(e.search,"primary+f"),selectAll:ct(e.selectAll,"primary+a"),selectColumn:ct(e.selectColumn,"ctrl+ "),selectGrowDown:ct(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ct(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ct(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ct(e.selectGrowUp,"shift+ArrowUp"),selectRow:ct(e.selectRow,"shift+ "),selectToFirstCell:ct(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ct(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ct(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ct(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ct(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ct(e.selectToLastRow,"primary+shift+ArrowDown")}}function D0(e){const t=Vg(e);return se.useMemo(()=>{if(t===void 0)return Mu(Rr);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??Rr.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??Rr.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??Rr.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??Rr.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??Rr.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??Rr.selectToLastCell};return Mu({...Rr,...n})},[t])}function O0(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const a={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(a.subGroups=r.subGroups.map((l,s)=>t(l,i+1,[...o,s])).sort((l,s)=>l.headerIndex-s.headerIndex)),a}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function Bs(e,t){const n=[];function r(a,l,s=!1){let u=l!==null?l-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(u=a.subGroups[0].headerIndex-a.headerIndex),u--,n.push({headerIndex:a.headerIndex,contentIndex:-1,skip:s,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:u}),a.subGroups)for(let c=0;c<a.subGroups.length;c++){const d=c<a.subGroups.length-1?a.subGroups[c+1].headerIndex:l;r(a.subGroups[c],d,s||a.isCollapsed)}}const i=O0(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;for(const a of n)a.contentIndex=o,o+=a.rows;return n.filter(a=>a.skip===!1).map(a=>{const{skip:l,...s}=a;return s})}function aa(e,t){if(t===void 0||Bs.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(n--,!r.isCollapsed){if(n<r.rows)return{path:[...r.path,n],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n,contentIndex:r.contentIndex+n,groupRows:r.rows};n-=r.rows}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function P0(e,t,n,r){const i=se.useMemo(()=>e===void 0?void 0:Bs(e,t),[e,t]),o=se.useMemo(()=>i===void 0?t:i.reduce((u,c)=>u+(c.isCollapsed?1:c.rows+1),0),[i,t]),a=se.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:u=>{const{isGroupHeader:c}=aa(u,i);return c?e.height:typeof n=="number"?n:n(u)},[i,e,n]),l=se.useCallback(u=>{if(i===void 0)return u;let c=u;for(const d of i){if(c===0)return;if(c--,!d.isCollapsed){if(c<d.rows)return d.contentIndex+c;c-=d.rows}}return u},[i]),s=Br(r??(e==null?void 0:e.themeOverride),se.useCallback(u=>{if(e===void 0)return r==null?void 0:r(u,u,u);if(r===void 0&&(e==null?void 0:e.themeOverride)===void 0)return;const{isGroupHeader:c,contentIndex:d,groupIndex:f}=aa(u,i);return c?e.themeOverride:r==null?void 0:r(u,f,d)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:l,getRowThemeOverride:s}:{rowHeight:a,rows:o,rowNumberMapper:l,getRowThemeOverride:s}}function _0(e,t){const n=se.useMemo(()=>e===void 0?void 0:Bs(e,t),[e,t]);return{getRowGroupingForPath:Id,updateRowGroupingByPath:Ed,mapper:se.useCallback(r=>{if(typeof r=="number")return aa(r,n);const i=aa(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function Ed(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,a)=>a===r?{...o,...n}:o):e.map((o,a)=>a===r?{...o,subGroups:Ed(o.subGroups??[],i,n)}:o)}function Id(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Id(e[n].subGroups??[],r)}function L0(e,t){const[n]=g.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 F0(e,t,n,r,i){const[o,a]=g.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),l=g.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:a}),[r,a,o]),[s,u,c]=zg(l),d=g.useRef(i);d.current=i;const f=L0(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.scrollLeft=e)}),h=(s.height??1)>1;g.useLayoutEffect(()=>{if(t!==void 0&&f.current!==null&&h){if(f.current.scrollTop===t)return;f.current.scrollTop=t,f.current.scrollTop!==t&&c(),d.current()}},[t,h,c,f]);const m=(s.width??1)>1;return g.useLayoutEffect(()=>{if(e!==void 0&&f.current!==null&&m){if(f.current.scrollLeft===e)return;f.current.scrollLeft=e,f.current.scrollLeft!==e&&c(),d.current()}},[e,m,c,f]),{visibleRegion:s,setVisibleRegion:u,scrollRef:f}}const A0=g.lazy(async()=>await Es(()=>import("./data-grid-overlay-editor.BCdg4YOG.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url));let H0=0;function z0(e){return Bm(du(du(e).filter(t=>t.span!==void 0).map(t=>{var n,r;return ar((((n=t.span)==null?void 0:n[0])??0)+1,(((r=t.span)==null?void 0:r[1])??0)+1)})))}function Ao(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 Ho={kind:re.Loading,allowOverlay:!1},zo={columns:vt.empty(),rows:vt.empty(),current:void 0},V0=(e,t)=>{var wl,yl,Cl;const[n,r]=g.useState(zo),[i,o]=g.useState(),a=g.useRef(null),l=g.useRef(null),[s,u]=g.useState(),c=g.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:f,getRowThemeOverride:h,markdownDivCreateNode:m,width:p,height:v,columns:y,rows:b,getCellContent:R,onCellClicked:O,onCellActivated:S,onFillPattern:M,onFinishedEditing:_,coercePasteValue:E,drawHeader:x,drawCell:L,editorBloom:D,onHeaderClicked:C,onColumnProposeMove:I,rangeSelectionColumnSpanning:T=!0,spanRangeBehavior:k="default",onGroupHeaderClicked:z,onCellContextMenu:N,className:U,onHeaderContextMenu:oe,getCellsForSelection:ee,onGroupHeaderContextMenu:G,onGroupHeaderRenamed:te,onCellEdited:ie,onCellsEdited:ue,onSearchResultsChanged:ge,searchResults:J,onSearchValueChange:H,searchValue:P,onKeyDown:q,onKeyUp:he,keybindings:me,editOnType:Ve=!0,onRowAppended:ve,onColumnMoved:Xe,validateCell:Me,highlightRegions:Ot,rangeSelect:kt="rect",columnSelect:et="multi",rowSelect:le="multi",rangeSelectionBlending:Ge="exclusive",columnSelectionBlending:we="exclusive",rowSelectionBlending:ce="exclusive",onDelete:be,onDragStart:$e,onMouseMove:Oe,onPaste:rt,copyHeaders:pe=!1,freezeColumns:Ee=0,cellActivationBehavior:lt="second-click",rowSelectionMode:Ae="auto",onHeaderMenuClick:it,onHeaderIndicatorClick:pt,getGroupDetails:ht,rowGrouping:He,onSearchClose:It,onItemHovered:Ut,onSelectionCleared:mt,showSearch:Mt,onVisibleRegionChanged:Xt,gridSelection:_t,onGridSelectionChange:Cn,minColumnWidth:Ht=50,maxColumnWidth:Rt=500,maxColumnAutoWidth:Sn,provideEditor:vn,trailingRowOptions:Pe,freezeTrailingRows:Lt=0,allowedFillDirections:cn="orthogonal",scrollOffsetX:hn,scrollOffsetY:gn,verticalBorder:ot,onDragOverCell:zt,onDrop:Pt,onColumnResize:tn,onColumnResizeEnd:Tt,onColumnResizeStart:Ft,customRenderers:je,fillHandle:Vt,experimental:$t,fixedShadowX:de,fixedShadowY:Ne,headerIcons:Gt,imageWindowLoader:xn,initialSize:on,isDraggable:V,onDragLeave:Ke,onRowMoved:ze,overscrollX:Dt,overscrollY:an,preventDiagonalScrolling:bn,rightElement:qn,rightElementProps:In,trapFocus:Zt=!1,smoothScrollX:Ln,smoothScrollY:Yn,scaleToRem:ya=!1,rowHeight:so=34,headerHeight:lo=36,groupHeaderHeight:Ca=lo,theme:Gr,isOutsideClick:br,renderers:mi,resizeIndicator:Sa,scrollToActiveCell:pi=!0,drawFocusRing:vi=!0}=e,Pr=vi==="no-editor"?i===void 0:vi,Jt=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,kn=(Jt==null?void 0:Jt.kind)??e.rowMarkers??"none",bi=(Jt==null?void 0:Jt.width)??e.rowMarkerWidth,wi=(Jt==null?void 0:Jt.startIndex)??e.rowMarkerStartIndex??1,jr=(Jt==null?void 0:Jt.theme)??e.rowMarkerTheme,cr=Jt==null?void 0:Jt.headerTheme,dr=Jt==null?void 0:Jt.headerAlwaysVisible,Kr=le!=="multi",tr=(Jt==null?void 0:Jt.checkboxStyle)??"square",nr=Math.max(Ht,20),_r=Math.max(Rt,nr),uo=Math.max(Sn??_r,nr),yi=g.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Ze,rowNumberMapper:co,rowHeight:fo,getRowThemeOverride:Fn}=P0(He,b,so,h),ho=g.useMemo(()=>Number.parseFloat(yi.fontSize),[yi]),{rowHeight:Xn,headerHeight:Ci,groupHeaderHeight:go,theme:mo,overscrollX:xa,overscrollY:ka}=T0({groupHeaderHeight:Ca,headerHeight:lo,overscrollX:Dt,overscrollY:an,remSize:ho,rowHeight:fo,scaleToRem:ya,theme:Gr}),An=D0(me),wr=bi??(b>1e4?48:b>1e3?44:b>100?36:32),Hn=kn!=="none",Y=Hn?1:0,Yt=ve!==void 0,yr=(Pe==null?void 0:Pe.sticky)===!0,[Zr,Jr]=g.useState(!1),Si=Mt??Zr,Ma=g.useCallback(()=>{It!==void 0?It():Jr(!1)},[It]),j=g.useMemo(()=>_t===void 0?void 0:Ao(_t,Y),[_t,Y])??n,ln=g.useRef();ln.current===void 0&&(ln.current=new AbortController),g.useEffect(()=>()=>ln==null?void 0:ln.current.abort(),[]);const[un,Ra]=h0(ee,R,Y,ln.current,Ze),$=g.useCallback((w,A,F)=>{if(Me===void 0)return!0;const W=[w[0]-Y,w[1]];return Me==null?void 0:Me(W,A,F)},[Y,Me]),ae=g.useRef(_t),Se=g.useCallback((w,A)=>{A&&(w=y0(w,un,Y,k,ln.current)),Cn!==void 0?(ae.current=Ao(w,-Y),Cn(ae.current)):r(w)},[Cn,un,Y,k]),xe=Br(tn,g.useCallback((w,A,F,W)=>{tn==null||tn(y[F-Y],A,F-Y,W)},[tn,Y,y])),fe=Br(Tt,g.useCallback((w,A,F,W)=>{Tt==null||Tt(y[F-Y],A,F-Y,W)},[Tt,Y,y])),Re=Br(Ft,g.useCallback((w,A,F,W)=>{Ft==null||Ft(y[F-Y],A,F-Y,W)},[Ft,Y,y])),at=Br(x,g.useCallback((w,A)=>(x==null?void 0:x({...w,columnIndex:w.columnIndex-Y},A))??!1,[x,Y])),st=Br(L,g.useCallback((w,A)=>(L==null?void 0:L({...w,col:w.col-Y},A))??!1,[L,Y])),Te=g.useCallback(w=>{if(be!==void 0){const A=be(Ao(w,-Y));return typeof A=="boolean"?A:Ao(A,Y)}return!0},[be,Y]),[Ct,ke,Je]=f0(j,Se,Ge,we,ce,kt,T),We=g.useMemo(()=>gr(dd(),mo),[mo]),[ft,sn]=g.useState([0,0,0]),Mn=g.useMemo(()=>{if(mi===void 0)return{};const w={};for(const A of mi)w[A.kind]=A;return w},[mi]),wt=g.useCallback(w=>w.kind!==re.Custom?Mn[w.kind]:je==null?void 0:je.find(A=>A.isMatch(w)),[je,Mn]);let{sizedColumns:jt,nonGrowWidth:Gn}=_m(y,Ze,Ra,ft[0]-(Y===0?0:wr)-ft[2],nr,uo,We,wt,ln.current);kn!=="none"&&(Gn+=wr);const wn=g.useMemo(()=>jt.some(w=>w.group!==void 0),[jt]),Et=wn?Ci+go:Ci,Rn=j.rows.length,Tn=kn==="none"?void 0:Rn===0?!1:Rn===Ze?!0:void 0,yt=g.useMemo(()=>kn==="none"?jt:[{title:"",width:wr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:jr,rowMarker:tr,rowMarkerChecked:Tn,headerRowMarkerTheme:cr,headerRowMarkerAlwaysVisible:dr,headerRowMarkerDisabled:Kr},...jt],[kn,jt,wr,jr,tr,Tn,cr,dr,Kr]),Qt=g.useRef({height:1,width:1,x:0,y:0}),Cr=g.useRef(!1),{setVisibleRegion:Sr,visibleRegion:Lr,scrollRef:Bt}=F0(hn,gn,Xn,Qt,()=>Cr.current=!0);Qt.current=Lr;const Cf=Lr.x+Y,po=Lr.y,En=g.useRef(null),yn=g.useCallback(w=>{var A;w===!0?(A=En.current)==null||A.focus():window.requestAnimationFrame(()=>{var F;(F=En.current)==null||F.focus()})},[]),mn=Yt?Ze+1:Ze,zn=g.useCallback(w=>{const A=Y===0?w:w.map(W=>({...W,location:[W.location[0]-Y,W.location[1]]})),F=ue==null?void 0:ue(A);if(F!==!0)for(const W of A)ie==null||ie(W.location,W.value);return F},[ie,ue,Y]),[Fr,Ea]=g.useState(),vo=j.current!==void 0&&j.current.range.width*j.current.range.height>1?j.current.range:void 0,Qr=Pr?(wl=j.current)==null?void 0:wl.cell:void 0,bo=Qr==null?void 0:Qr[0],wo=Qr==null?void 0:Qr[1],Sf=g.useMemo(()=>{if((Ot===void 0||Ot.length===0)&&(vo??bo??wo??Fr)===void 0)return;const w=[];if(Ot!==void 0)for(const A of Ot){const F=yt.length-A.range.x-Y;F>0&&w.push({color:A.color,range:{...A.range,x:A.range.x+Y,width:Math.min(F,A.range.width)},style:A.style})}return Fr!==void 0&&w.push({color:Ur(We.accentColor,0),range:Fr,style:"dashed"}),vo!==void 0&&w.push({color:Ur(We.accentColor,.5),range:vo,style:"solid-outline"}),bo!==void 0&&wo!==void 0&&w.push({color:We.accentColor,range:{x:bo,y:wo,width:1,height:1},style:"solid-outline"}),w.length>0?w:void 0},[Fr,vo,bo,wo,Ot,yt.length,We.accentColor,Y]),ol=g.useRef(yt);ol.current=yt;const Dn=g.useCallback(([w,A],F=!1)=>{var Z,X,K,Q,ne,ye,_e;const W=Yt&&A===mn-1;if(w===0&&Hn){if(W)return Ho;const Ce=co(A);return Ce===void 0?Ho:{kind:Un.Marker,allowOverlay:!1,checkboxStyle:tr,checked:(j==null?void 0:j.rows.hasIndex(A))===!0,markerKind:kn==="clickable-number"?"number":kn,row:wi+Ce,drawHandle:ze!==void 0,cursor:kn==="clickable-number"?"pointer":void 0}}else if(W){const Fe=w===Y?(Pe==null?void 0:Pe.hint)??"":"",De=ol.current[w];if(((Z=De==null?void 0:De.trailingRowOptions)==null?void 0:Z.disabled)===!0)return Ho;{const gt=((X=De==null?void 0:De.trailingRowOptions)==null?void 0:X.hint)??Fe,Ue=((K=De==null?void 0:De.trailingRowOptions)==null?void 0:K.addIcon)??(Pe==null?void 0:Pe.addIcon);return{kind:Un.NewRow,hint:gt,allowOverlay:!1,icon:Ue}}}else{const Ce=w-Y;if(F||($t==null?void 0:$t.strict)===!0){const De=Qt.current,gt=De.x>Ce||Ce>De.x+De.width||De.y>A||A>De.y+De.height||A>=Ta.current,Ue=Ce===((ne=(Q=De.extras)==null?void 0:Q.selected)==null?void 0:ne[0])&&A===((ye=De.extras)==null?void 0:ye.selected[1]);let Le=!1;if(((_e=De.extras)==null?void 0:_e.freezeRegions)!==void 0){for(const St of De.extras.freezeRegions)if(Wr(St,Ce,A)){Le=!0;break}}if(gt&&!Ue&&!Le)return Ho}let Fe=R([Ce,A]);return Y!==0&&Fe.span!==void 0&&(Fe={...Fe,span:[Fe.span[0]+Y,Fe.span[1]+Y]}),Fe}},[Yt,mn,Hn,co,tr,j==null?void 0:j.rows,kn,wi,ze,Y,Pe==null?void 0:Pe.hint,Pe==null?void 0:Pe.addIcon,$t==null?void 0:$t.strict,R]),Ia=g.useCallback(w=>{let A=(ht==null?void 0:ht(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:F=>Oa({group:A.name,bounds:F.bounds})}]}),A},[ht,te]),yo=g.useCallback(w=>{var K;const[A,F]=w.cell,W=yt[A],B=(W==null?void 0:W.group)!==void 0?(K=Ia(W.group))==null?void 0:K.overrideTheme:void 0,Z=W==null?void 0:W.themeOverride,X=Fn==null?void 0:Fn(F);o({...w,theme:gr(We,B,Z,X,w.content.themeOverride)})},[Fn,yt,Ia,We]),ei=g.useCallback((w,A,F)=>{var X;if(j.current===void 0)return;const[W,B]=j.current.cell,Z=Dn([W,B]);if(Z.kind!==re.Boolean&&Z.allowOverlay){let K=Z;if(F!==void 0)switch(K.kind){case re.Number:{const Q=lg(()=>F==="-"?-0:Number.parseFloat(F),0);K={...K,data:Number.isNaN(Q)?0:Q};break}case re.Text:case re.Markdown:case re.Uri:K={...K,data:F};break}yo({target:w,content:K,initialValue:F,cell:[W,B],highlight:F===void 0,forceEditMode:F!==void 0})}else Z.kind===re.Boolean&&A&&Z.readonly!==!0&&(zn([{location:j.current.cell,value:{...Z,data:Rd(Z.data)}}]),(X=En.current)==null||X.damage([{cell:j.current.cell}]))},[Dn,j,zn,yo]),al=g.useCallback((w,A)=>{var B;const F=(B=En.current)==null?void 0:B.getBounds(w,A);if(F===void 0||Bt.current===null)return;const W=Dn([w,A]);W.allowOverlay&&yo({target:F,content:W,initialValue:void 0,highlight:!0,cell:[w,A],forceEditMode:!0})},[Dn,Bt,yo]),nn=g.useCallback((w,A,F="both",W=0,B=0,Z=void 0)=>{if(Bt.current!==null){const X=En.current,K=l.current,Q=typeof w!="number"?w.unit==="cell"?w.amount:void 0:w,ne=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,ye=typeof w!="number"&&w.unit==="px"?w.amount:void 0,_e=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(X!==null&&K!==null){let Ce={x:0,y:0,width:0,height:0},Fe=0,De=0;if((Q!==void 0||ne!==void 0)&&(Ce=X.getBounds((Q??0)+Y,ne??0)??Ce,Ce.width===0||Ce.height===0))return;const gt=K.getBoundingClientRect(),Ue=gt.width/K.offsetWidth;if(ye!==void 0&&(Ce={...Ce,x:ye-gt.left-Bt.current.scrollLeft,width:1}),_e!==void 0&&(Ce={...Ce,y:_e+gt.top-Bt.current.scrollTop,height:1}),Ce!==void 0){const Le={x:Ce.x-W,y:Ce.y-B,width:Ce.width+2*W,height:Ce.height+2*B};let St=0;for(let za=0;za<Ee;za++)St+=jt[za].width;let qt=0;const rn=Lt+(yr?1:0);rn>0&&(qt=Yr(mn,rn,Xn));let Zn=St*Ue+gt.left+Y*wr*Ue,ir=gt.right,Jn=gt.top+Et*Ue,or=gt.bottom-qt*Ue;const Eo=Ce.width+W*2;switch(Z==null?void 0:Z.hAlign){case"start":ir=Zn+Eo;break;case"end":Zn=ir-Eo;break;case"center":Zn=Math.floor((Zn+ir)/2)-Eo/2,ir=Zn+Eo;break}const Io=Ce.height+B*2;switch(Z==null?void 0:Z.vAlign){case"start":or=Jn+Io;break;case"end":Jn=or-Io;break;case"center":Jn=Math.floor((Jn+or)/2)-Io/2,or=Jn+Io;break}Zn>Le.x?Fe=Le.x-Zn:ir<Le.x+Le.width&&(Fe=Le.x+Le.width-ir),Jn>Le.y?De=Le.y-Jn:or<Le.y+Le.height&&(De=Le.y+Le.height-or),F==="vertical"||typeof w=="number"&&w<Ee?Fe=0:(F==="horizontal"||typeof A=="number"&&A>=mn-rn)&&(De=0),(Fe!==0||De!==0)&&(Ue!==1&&(Fe/=Ue,De/=Ue),Bt.current.scrollTo(Fe+Bt.current.scrollLeft,De+Bt.current.scrollTop))}}}},[Y,Lt,wr,Bt,Et,Ee,jt,mn,yr,Xn]),sl=g.useRef(al),ll=g.useRef(R),Ta=g.useRef(Ze);sl.current=al,ll.current=R,Ta.current=Ze;const ti=g.useCallback(async(w,A=!0)=>{var Q;const F=yt[w];if(((Q=F==null?void 0:F.trailingRowOptions)==null?void 0:Q.disabled)===!0)return;const W=ve==null?void 0:ve();let B,Z=!0;W!==void 0&&(B=await W,B==="top"&&(Z=!1),typeof B=="number"&&(Z=!1));let X=0;const K=()=>{if(Ta.current<=Ze){X<500&&window.setTimeout(K,X),X=50+X*2;return}const ne=typeof B=="number"?B:Z?Ze:0;Ro.current(w-Y,ne),Ct({cell:[w,ne],range:{x:w,y:ne,width:1,height:1}},!1,!1,"edit");const ye=ll.current([w-Y,ne]);ye.allowOverlay&&qi(ye)&&ye.readonly!==!0&&A&&window.setTimeout(()=>{sl.current(w,ne)},0)};K()},[yt,ve,Y,Ze,Ct]),Co=g.useCallback(w=>{var F,W;const A=((W=(F=jt[w])==null?void 0:F.trailingRowOptions)==null?void 0:W.targetColumn)??(Pe==null?void 0:Pe.targetColumn);if(typeof A=="number")return A+(Hn?1:0);if(typeof A=="object"){const B=y.indexOf(A);if(B>=0)return B+(Hn?1:0)}},[jt,y,Hn,Pe==null?void 0:Pe.targetColumn]),xr=g.useRef(),ni=g.useRef(),ki=g.useCallback((w,A)=>{var B;const[F,W]=A;return gr(We,(B=yt[F])==null?void 0:B.themeOverride,Fn==null?void 0:Fn(W),w.themeOverride)},[Fn,yt,We]),{mapper:Ar}=_0(He,b),jn=He==null?void 0:He.navigationBehavior,Mi=g.useCallback(w=>{var ye,_e,Ce;const A=ia.value?w.metaKey:w.ctrlKey,F=A&&le==="multi",W=A&&et==="multi",[B,Z]=w.location,X=j.columns,K=j.rows,[Q,ne]=((ye=j.current)==null?void 0:ye.cell)??[];if(w.kind==="cell"){if(ni.current=void 0,Hr.current=[B,Z],B===0&&Hn){if(Yt===!0&&Z===Ze||kn==="number"||le==="none")return;const Fe=Dn(w.location);if(Fe.kind!==Un.Marker)return;if(ze!==void 0){const Ue=wt(Fe);Pn((Ue==null?void 0:Ue.kind)===Un.Marker);const Le=(_e=Ue==null?void 0:Ue.onClick)==null?void 0:_e.call(Ue,{...w,cell:Fe,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,theme:ki(Fe,w.location),preventDefault:()=>{}});if(Le===void 0||Le.checked===Fe.checked)return}o(void 0),yn();const De=K.hasIndex(Z),gt=xr.current;if(le==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&gt!==void 0&&K.hasIndex(gt)){const Ue=[Math.min(gt,Z),Math.max(gt,Z)+1];F||Ae==="multi"?ke(void 0,Ue,!0):ke(vt.fromSingleSelection(Ue),void 0,F)}else le==="multi"&&(F||w.isTouch||Ae==="multi")?De?ke(K.remove(Z),void 0,!0):(ke(void 0,Z,!0),xr.current=Z):De&&K.length===1?ke(vt.empty(),void 0,A):(ke(vt.fromSingleSelection(Z),void 0,A),xr.current=Z)}else if(B>=Y&&Yt&&Z===Ze){const Fe=Co(B);ti(Fe??B)}else if(Q!==B||ne!==Z){const Fe=Dn(w.location),De=wt(Fe);if((De==null?void 0:De.onSelect)!==void 0){let Le=!1;if(De.onSelect({...w,cell:Fe,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,preventDefault:()=>Le=!0,theme:ki(Fe,w.location)}),Le)return}if(jn==="block"&&Ar(Z).isGroupHeader)return;const gt=yr&&Z===Ze,Ue=yr&&j!==void 0&&((Ce=j.current)==null?void 0:Ce.cell[1])===Ze;if((w.shiftKey||w.isLongTouch===!0)&&Q!==void 0&&ne!==void 0&&j.current!==void 0&&!Ue){if(gt)return;const Le=Math.min(B,Q),St=Math.max(B,Q),qt=Math.min(Z,ne),rn=Math.max(Z,ne);Ct({...j.current,range:{x:Le,y:qt,width:St-Le+1,height:rn-qt+1}},!0,A,"click"),xr.current=void 0,yn()}else Ct({cell:[B,Z],range:{x:B,y:Z,width:1,height:1}},!0,A,"click"),xr.current=void 0,o(void 0),yn()}}else if(w.kind==="header")if(Hr.current=[B,Z],o(void 0),Hn&&B===0)xr.current=void 0,ni.current=void 0,le==="multi"&&(K.length!==Ze?ke(vt.fromSingleSelection([0,Ze]),void 0,A):ke(vt.empty(),void 0,A),yn());else{const Fe=ni.current;if(et==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&Fe!==void 0&&X.hasIndex(Fe)){const De=[Math.min(Fe,B),Math.max(Fe,B)+1];W?Je(void 0,De,A):Je(vt.fromSingleSelection(De),void 0,A)}else W?(X.hasIndex(B)?Je(X.remove(B),void 0,A):Je(void 0,B,A),ni.current=B):et!=="none"&&(Je(vt.fromSingleSelection(B),void 0,A),ni.current=B);xr.current=void 0,yn()}else w.kind===Wn?Hr.current=[B,Z]:w.kind===oa&&!w.isMaybeScrollbar&&(Se(zo,!1),o(void 0),yn(),mt==null||mt(),xr.current=void 0,ni.current=void 0)},[le,et,j,Hn,Y,Yt,Ze,kn,Dn,ze,yn,Ae,wt,ki,ke,Co,ti,jn,Ar,yr,Ct,Je,Se,mt]),Ri=g.useRef(!1),Hr=g.useRef(),ul=g.useRef(Lr),Vn=g.useRef(),xf=g.useCallback(w=>{if(ri.current=!1,ul.current=Qt.current,w.button!==0&&w.button!==1){Vn.current=void 0;return}const A=performance.now();Vn.current={button:w.button,time:A,location:w.location},(w==null?void 0:w.kind)==="header"&&(Ri.current=!0);const F=w.kind==="cell"&&w.isFillHandle;!F&&w.kind!=="cell"&&w.isEdge||(u({previousSelection:j,fillHandle:F}),Hr.current=void 0,!w.isTouch&&w.button===0&&!F?Mi(w):!w.isTouch&&w.button===1&&(Hr.current=w.location))},[j,Mi]),[Da,Oa]=g.useState(),cl=g.useCallback(w=>{if(w.kind!==Wn||et!=="multi")return;const A=ia.value?w.metaKey:w.ctrlKey,[F]=w.location,W=j.columns;if(F<Y)return;const B=yt[F];let Z=F,X=F;for(let K=F-1;K>=Y&&Qi(B.group,yt[K].group);K--)Z--;for(let K=F+1;K<yt.length&&Qi(B.group,yt[K].group);K++)X++;if(yn(),A)if(W.hasAll([Z,X+1])){let K=W;for(let Q=Z;Q<=X;Q++)K=K.remove(Q);Je(K,void 0,A)}else Je(void 0,[Z,X+1],A);else Je(vt.fromSingleSelection([Z,X+1]),void 0,A)},[et,yn,j.columns,yt,Y,Je]),ri=g.useRef(!1),So=g.useCallback(async w=>{if(un!==void 0&&xe!==void 0){const A=Qt.current.y,F=Qt.current.height;let W=un({x:w,y:A,width:1,height:Math.min(F,Ze-A)},ln.current.signal);typeof W!="object"&&(W=await W());const B=jt[w-Y],X=document.createElement("canvas").getContext("2d",{alpha:!1});if(X!==null){X.font=We.baseFontFull;const K=hd(X,We,B,0,W,nr,_r,!1,wt);xe==null||xe(B,K.width,w,K.width)}}},[jt,un,_r,We,nr,xe,Y,Ze,wt]),[kf,Pa]=g.useState(),ii=g.useCallback(async(w,A)=>{var K,Q;const F=(K=w.current)==null?void 0:K.range;if(F===void 0||un===void 0||A.current===void 0)return;const W=A.current.range;if(M!==void 0){let ne=!1;if(M({fillDestination:{...W,x:W.x-Y},patternSource:{...F,x:F.x-Y},preventDefault:()=>ne=!0}),ne)return}let B=un(F,ln.current.signal);typeof B!="object"&&(B=await B());const Z=B,X=[];for(let ne=0;ne<W.width;ne++)for(let ye=0;ye<W.height;ye++){const _e=[W.x+ne,W.y+ye];if(ed(_e,F))continue;const Ce=Z[ye%F.height][ne%F.width];li(Ce)||!qi(Ce)||X.push({location:_e,value:{...Ce}})}zn(X),(Q=En.current)==null||Q.damage(X.map(ne=>({cell:ne.location})))},[un,zn,M,Y]),dl=g.useCallback(()=>{if(j.current===void 0||j.current.range.width<=1)return;const w={...j,current:{...j.current,range:{...j.current.range,width:1}}};ii(w,j)},[ii,j]),fl=g.useCallback(()=>{if(j.current===void 0||j.current.range.height<=1)return;const w={...j,current:{...j.current,range:{...j.current.range,height:1}}};ii(w,j)},[ii,j]),Mf=g.useCallback((w,A)=>{var ye,_e;const F=s;if(u(void 0),Ea(void 0),Pa(void 0),Ri.current=!1,A)return;if((F==null?void 0:F.fillHandle)===!0&&j.current!==void 0&&((ye=F.previousSelection)==null?void 0:ye.current)!==void 0){if(Fr===void 0)return;const Ce={...j,current:{...j.current,range:bd(F.previousSelection.current.range,Fr)}};ii(F.previousSelection,Ce),Se(Ce,!0);return}const[W,B]=w.location,[Z,X]=Hr.current??[],K=()=>{ri.current=!0},Q=Ce=>{var De,gt,Ue;const Fe=Ce.isTouch||Z===W&&X===B;if(Fe&&(O==null||O([W-Y,B],{...Ce,preventDefault:K})),Ce.button===1)return!ri.current;if(!ri.current){const Le=Dn(w.location),St=wt(Le);if(St!==void 0&&St.onClick!==void 0&&Fe){const rn=St.onClick({...Ce,cell:Le,posX:Ce.localEventX,posY:Ce.localEventY,bounds:Ce.bounds,theme:ki(Le,w.location),preventDefault:K});rn!==void 0&&!li(rn)&&ai(rn)&&(zn([{location:Ce.location,value:rn}]),(De=En.current)==null||De.damage([{cell:Ce.location}]))}if(ri.current||j.current===void 0)return!1;let qt=!1;switch(Le.activationBehaviorOverride??lt){case"double-click":case"second-click":{if(((Ue=(gt=F==null?void 0:F.previousSelection)==null?void 0:gt.current)==null?void 0:Ue.cell)===void 0)break;const[rn,Zn]=j.current.cell,[ir,Jn]=F.previousSelection.current.cell;qt=W===rn&&W===ir&&B===Zn&&B===Jn&&(Ce.isDoubleClick===!0||lt==="second-click");break}case"single-click":{qt=!0;break}}if(qt)return S==null||S([W-Y,B]),ei(Ce.bounds,!1),!0}return!1},ne=w.location[0]-Y;if(w.isTouch){const Ce=Qt.current,Fe=ul.current;if(Ce.x!==Fe.x||Ce.y!==Fe.y)return;if(w.isLongTouch===!0){if(w.kind==="cell"&&Gi((_e=j.current)==null?void 0:_e.cell,w.location)){N==null||N([ne,w.location[1]],{...w,preventDefault:K});return}else if(w.kind==="header"&&j.columns.hasIndex(W)){oe==null||oe(ne,{...w,preventDefault:K});return}else if(w.kind===Wn){if(ne<0)return;G==null||G(ne,{...w,preventDefault:K});return}}w.kind==="cell"?Q(w)||Mi(w):w.kind===Wn?z==null||z(ne,{...w,preventDefault:K}):(w.kind===Er&&(C==null||C(ne,{...w,preventDefault:K})),Mi(w));return}if(w.kind==="header"){if(ne<0)return;w.isEdge?w.isDoubleClick===!0&&So(W):w.button===0&&W===Z&&B===X&&(C==null||C(ne,{...w,preventDefault:K}))}if(w.kind===Wn){if(ne<0)return;w.button===0&&W===Z&&B===X&&(z==null||z(ne,{...w,preventDefault:K}),ri.current||cl(w))}w.kind==="cell"&&(w.button===0||w.button===1)&&Q(w),Hr.current=void 0},[s,j,Y,Fr,ii,Se,O,Dn,wt,lt,ki,zn,S,ei,N,oe,G,Mi,z,C,So,cl]),Rf=g.useCallback(w=>{const A={...w,location:[w.location[0]-Y,w.location[1]]};Oe==null||Oe(A),s!==void 0&&w.buttons===0&&(u(void 0),Ea(void 0),Pa(void 0),Ri.current=!1),Pa(F=>{var W;return Ri.current?[w.scrollEdge[0],0]:w.scrollEdge[0]===(F==null?void 0:F[0])&&w.scrollEdge[1]===F[1]?F:s===void 0||(((W=Vn.current)==null?void 0:W.location[0])??0)<Y?void 0:w.scrollEdge})},[s,Oe,Y]),Ef=g.useCallback((w,A)=>{it==null||it(w-Y,A)},[it,Y]),If=g.useCallback((w,A)=>{pt==null||pt(w-Y,A)},[pt,Y]),rr=(yl=j==null?void 0:j.current)==null?void 0:yl.cell,Tf=g.useCallback((w,A,F,W,B,Z)=>{Cr.current=!1;let X=rr;X!==void 0&&(X=[X[0]-Y,X[1]]);const K=Ee===0?void 0:{x:0,y:w.y,width:Ee,height:w.height},Q=[];K!==void 0&&Q.push(K),Lt>0&&(Q.push({x:w.x-Y,y:Ze-Lt,width:w.width,height:Lt}),Ee>0&&Q.push({x:0,y:Ze-Lt,width:Ee,height:Lt}));const ne={x:w.x-Y,y:w.y,width:w.width,height:Yt&&w.y+w.height>=Ze?w.height-1:w.height,tx:B,ty:Z,extras:{selected:X,freezeRegion:K,freezeRegions:Q}};Qt.current=ne,Sr(ne),sn([A,F,W]),Xt==null||Xt(ne,ne.tx,ne.ty,ne.extras)},[rr,Y,Yt,Ze,Ee,Lt,Sr,Xt]),Df=Br(Xe,g.useCallback((w,A)=>{Xe==null||Xe(w-Y,A-Y),et!=="none"&&Je(vt.fromSingleSelection(A),void 0,!0)},[et,Xe,Y,Je])),_a=g.useRef(!1),Of=g.useCallback(w=>{if(w.location[0]===0&&Y>0){w.preventDefault();return}$e==null||$e({...w,location:[w.location[0]-Y,w.location[1]]}),w.defaultPrevented()||(_a.current=!0),u(void 0)},[$e,Y]),Pf=g.useCallback(()=>{_a.current=!1},[]),hl=He==null?void 0:He.selectionBehavior,xo=g.useCallback(w=>{if(hl!=="block-spanning")return;const{isGroupHeader:A,path:F,groupRows:W}=Ar(w);if(A)return[w,w];const B=F[F.length-1],Z=w-B,X=w+W-B-1;return[Z,X]},[Ar,hl]),La=g.useRef(),Fa=g.useCallback(w=>{var A,F,W;if(!kd(w,La.current)&&(La.current=w,!(((A=Vn==null?void 0:Vn.current)==null?void 0:A.button)!==void 0&&Vn.current.button>=1))){if(w.buttons!==0&&s!==void 0&&((F=Vn.current)==null?void 0:F.location[0])===0&&w.location[0]===0&&Y===1&&le==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(Vn.current.location[1])&&j.rows.hasIndex(Vn.current.location[1])){const B=Math.min(Vn.current.location[1],w.location[1]),Z=Math.max(Vn.current.location[1],w.location[1])+1;ke(vt.fromSingleSelection([B,Z]),void 0,!1)}if(w.buttons!==0&&s!==void 0&&j.current!==void 0&&!_a.current&&!Ri.current&&(kt==="rect"||kt==="multi-rect")){const[B,Z]=j.current.cell;let[X,K]=w.location;if(K<0&&(K=Qt.current.y),s.fillHandle===!0&&((W=s.previousSelection)==null?void 0:W.current)!==void 0){const Q=s.previousSelection.current.range;K=Math.min(K,Yt?Ze-1:Ze);const ne=Cp(Q,X,K,cn);Ea(ne)}else{if(Yt&&Z===Ze)return;if(Yt&&K===Ze)if(w.kind===oa)K--;else return;X=Math.max(X,Y);const ye=xo(Z);K=ye===void 0?K:Nn(K,ye[0],ye[1]);const _e=X-B,Ce=K-Z,Fe={x:_e>=0?B:X,y:Ce>=0?Z:K,width:Math.abs(_e)+1,height:Math.abs(Ce)+1};Ct({...j.current,range:Fe},!0,!1,"drag")}}Ut==null||Ut({...w,location:[w.location[0]-Y,w.location[1]]})}},[s,Y,le,j,kt,Ut,ke,Yt,Ze,cn,xo,Ct]),_f=g.useCallback(()=>{var X,K;const w=La.current;if(w===void 0)return;const[A,F]=w.scrollEdge;let[W,B]=w.location;const Z=Qt.current;A===-1?W=((K=(X=Z.extras)==null?void 0:X.freezeRegion)==null?void 0:K.x)??Z.x:A===1&&(W=Z.x+Z.width),F===-1?B=Math.max(0,Z.y):F===1&&(B=Math.min(Ze-1,Z.y+Z.height)),W=Nn(W,0,yt.length-1),B=Nn(B,0,Ze-1),Fa({...w,location:[W,B]})},[yt.length,Fa,Ze]);I0(kf,Bt,_f);const Kn=g.useCallback(w=>{if(j.current===void 0)return;const[A,F]=w,[W,B]=j.current.cell,Z=j.current.range;let X=Z.x,K=Z.x+Z.width,Q=Z.y,ne=Z.y+Z.height;const[ye,_e]=xo(B)??[0,Ze-1],Ce=_e+1;if(F!==0)switch(F){case 2:{ne=Ce,Q=B,nn(0,ne,"vertical");break}case-2:{Q=ye,ne=B+1,nn(0,Q,"vertical");break}case 1:{Q<B?(Q++,nn(0,Q,"vertical")):(ne=Math.min(Ce,ne+1),nn(0,ne,"vertical"));break}case-1:{ne>B+1?(ne--,nn(0,ne,"vertical")):(Q=Math.max(ye,Q-1),nn(0,Q,"vertical"));break}default:Ji()}if(A!==0)if(A===2)K=yt.length,X=W,nn(K-1-Y,0,"horizontal");else if(A===-2)X=Y,K=W+1,nn(X-Y,0,"horizontal");else{let Fe=[];if(un!==void 0){const De=un({x:X,y:Q,width:K-X-Y,height:ne-Q},ln.current.signal);typeof De=="object"&&(Fe=z0(De))}if(A===1){let De=!1;if(X<W){if(Fe.length>0){const gt=ar(X+1,W+1).find(Ue=>!Fe.includes(Ue-Y));gt!==void 0&&(X=gt,De=!0)}else X++,De=!0;De&&nn(X,0,"horizontal")}De||(K=Math.min(yt.length,K+1),nn(K-1-Y,0,"horizontal"))}else if(A===-1){let De=!1;if(K>W+1){if(Fe.length>0){const gt=ar(K-1,W,-1).find(Ue=>!Fe.includes(Ue-Y));gt!==void 0&&(K=gt,De=!0)}else K--,De=!0;De&&nn(K-Y,0,"horizontal")}De||(X=Math.max(Y,X-1),nn(X-Y,0,"horizontal"))}else Ji()}Ct({cell:j.current.cell,range:{x:X,y:Q,width:K-X,height:ne-Q}},!0,!1,"keyboard-select")},[un,xo,j,yt.length,Y,Ze,nn,Ct]),Aa=g.useRef(pi);Aa.current=pi;const kr=g.useCallback((w,A,F,W)=>{const B=mn-(F?0:1);w=Nn(w,Y,jt.length-1+Y),A=Nn(A,0,B);const Z=rr==null?void 0:rr[0],X=rr==null?void 0:rr[1];if(w===Z&&A===X)return!1;if(W&&j.current!==void 0){const K=[...j.current.rangeStack];(j.current.range.width>1||j.current.range.height>1)&&K.push(j.current.range),Se({...j,current:{cell:[w,A],range:{x:w,y:A,width:1,height:1},rangeStack:K}},!0)}else Ct({cell:[w,A],range:{x:w,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===w&&c.current[1]===A&&(c.current=void 0),Aa.current&&nn(w-Y,A),!0},[mn,Y,jt.length,rr,j,nn,Se,Ct]),Lf=g.useCallback((w,A)=>{(i==null?void 0:i.cell)!==void 0&&w!==void 0&&ai(w)&&(zn([{location:i.cell,value:w}]),window.requestAnimationFrame(()=>{var B;(B=En.current)==null||B.damage([{cell:i.cell}])})),yn(!0),o(void 0);const[F,W]=A;if(j.current!==void 0&&(F!==0||W!==0)){const B=j.current.cell[1]===mn-1&&w!==void 0;kr(Nn(j.current.cell[0]+F,0,yt.length-1),Nn(j.current.cell[1]+W,0,mn-1),B,!1)}_==null||_(w,A)},[i==null?void 0:i.cell,yn,j,_,zn,mn,kr,yt.length]),Ff=g.useMemo(()=>`gdg-overlay-${H0++}`,[]),zr=g.useCallback(w=>{var F,W,B,Z;yn();const A=[];for(let X=w.x;X<w.x+w.width;X++)for(let K=w.y;K<w.y+w.height;K++){const Q=R([X-Y,K]);if(!Q.allowOverlay&&Q.kind!==re.Boolean)continue;let ne;if(Q.kind===re.Custom){const ye=wt(Q),_e=(F=ye==null?void 0:ye.provideEditor)==null?void 0:F.call(ye,Q);(ye==null?void 0:ye.onDelete)!==void 0?ne=ye.onDelete(Q):hg(_e)&&(ne=(W=_e==null?void 0:_e.deletedValue)==null?void 0:W.call(_e,Q))}else if(ai(Q)&&Q.allowOverlay||Q.kind===re.Boolean){const ye=wt(Q);ne=(B=ye==null?void 0:ye.onDelete)==null?void 0:B.call(ye,Q)}ne!==void 0&&!li(ne)&&ai(ne)&&A.push({location:[X,K],value:ne})}zn(A),(Z=En.current)==null||Z.damage(A.map(X=>({cell:X.location})))},[yn,R,wt,zn,Y]),Ei=i!==void 0,gl=g.useCallback(w=>{var gt,Ue;const A=()=>{w.stopPropagation(),w.preventDefault()},F={didMatch:!1},{bounds:W}=w,B=j.columns,Z=j.rows,X=An;if(!Ei&&ut(X.clear,w,F))Se(zo,!1),mt==null||mt();else if(!Ei&&ut(X.selectAll,w,F))Se({columns:vt.empty(),rows:vt.empty(),current:{cell:((gt=j.current)==null?void 0:gt.cell)??[Y,0],range:{x:Y,y:0,width:y.length,height:Ze},rangeStack:[]}},!1);else if(ut(X.search,w,F))(Ue=a==null?void 0:a.current)==null||Ue.focus({preventScroll:!0}),Jr(!0);else if(ut(X.delete,w,F)){const Le=(Te==null?void 0:Te(j))??!0;if(Le!==!1){const St=Le===!0?j:Le;if(St.current!==void 0){zr(St.current.range);for(const qt of St.current.rangeStack)zr(qt)}for(const qt of St.rows)zr({x:Y,y:qt,width:y.length,height:1});for(const qt of St.columns)zr({x:qt,y:0,width:1,height:Ze})}}if(F.didMatch)return A(),!0;if(j.current===void 0)return!1;let[K,Q]=j.current.cell;const[,ne]=j.current.cell;let ye=!1,_e=!1;if(ut(X.scrollToSelectedCell,w,F)?Ro.current(K-Y,Q):et!=="none"&&ut(X.selectColumn,w,F)?B.hasIndex(K)?Je(B.remove(K),void 0,!0):et==="single"?Je(vt.fromSingleSelection(K),void 0,!0):Je(void 0,K,!0):le!=="none"&&ut(X.selectRow,w,F)?Z.hasIndex(Q)?ke(Z.remove(Q),void 0,!0):le==="single"?ke(vt.fromSingleSelection(Q),void 0,!0):ke(void 0,Q,!0):!Ei&&W!==void 0&&ut(X.activateCell,w,F)?Q===Ze&&Yt?window.setTimeout(()=>{const Le=Co(K);ti(Le??K)},0):(S==null||S([K-Y,Q]),ei(W,!0)):j.current.range.height>1&&ut(X.downFill,w,F)?fl():j.current.range.width>1&&ut(X.rightFill,w,F)?dl():ut(X.goToNextPage,w,F)?Q+=Math.max(1,Qt.current.height-4):ut(X.goToPreviousPage,w,F)?Q-=Math.max(1,Qt.current.height-4):ut(X.goToFirstCell,w,F)?(o(void 0),Q=0,K=0):ut(X.goToLastCell,w,F)?(o(void 0),Q=Number.MAX_SAFE_INTEGER,K=Number.MAX_SAFE_INTEGER):ut(X.selectToFirstCell,w,F)?(o(void 0),Kn([-2,-2])):ut(X.selectToLastCell,w,F)?(o(void 0),Kn([2,2])):Ei?(ut(X.closeOverlay,w,F)&&o(void 0),ut(X.acceptOverlayDown,w,F)&&(o(void 0),Q++),ut(X.acceptOverlayUp,w,F)&&(o(void 0),Q--),ut(X.acceptOverlayLeft,w,F)&&(o(void 0),K--),ut(X.acceptOverlayRight,w,F)&&(o(void 0),K++)):(ut(X.goDownCell,w,F)?Q+=1:ut(X.goUpCell,w,F)?Q-=1:ut(X.goRightCell,w,F)?K+=1:ut(X.goLeftCell,w,F)?K-=1:ut(X.goDownCellRetainSelection,w,F)?(Q+=1,ye=!0):ut(X.goUpCellRetainSelection,w,F)?(Q-=1,ye=!0):ut(X.goRightCellRetainSelection,w,F)?(K+=1,ye=!0):ut(X.goLeftCellRetainSelection,w,F)?(K-=1,ye=!0):ut(X.goToLastRow,w,F)?Q=Ze-1:ut(X.goToFirstRow,w,F)?Q=Number.MIN_SAFE_INTEGER:ut(X.goToLastColumn,w,F)?K=Number.MAX_SAFE_INTEGER:ut(X.goToFirstColumn,w,F)?K=Number.MIN_SAFE_INTEGER:(kt==="rect"||kt==="multi-rect")&&(ut(X.selectGrowDown,w,F)?Kn([0,1]):ut(X.selectGrowUp,w,F)?Kn([0,-1]):ut(X.selectGrowRight,w,F)?Kn([1,0]):ut(X.selectGrowLeft,w,F)?Kn([-1,0]):ut(X.selectToLastRow,w,F)?Kn([0,2]):ut(X.selectToFirstRow,w,F)?Kn([0,-2]):ut(X.selectToLastColumn,w,F)?Kn([2,0]):ut(X.selectToFirstColumn,w,F)&&Kn([-2,0])),_e=F.didMatch),jn!==void 0&&jn!=="normal"&&Q!==ne){const Le=jn==="skip-up"||jn==="skip"||jn==="block",St=jn==="skip-down"||jn==="skip"||jn==="block",qt=Q<ne;if(qt&&Le){for(;Q>=0&&Ar(Q).isGroupHeader;)Q--;Q<0&&(Q=ne)}else if(!qt&&St){for(;Q<Ze&&Ar(Q).isGroupHeader;)Q++;Q>=Ze&&(Q=ne)}}const Fe=kr(K,Q,!1,ye),De=F.didMatch;return De&&(Fe||!_e||Zt)&&A(),De},[jn,Ei,j,An,et,le,kt,Y,Ar,Ze,kr,Se,mt,y.length,Te,Zt,zr,Je,ke,Yt,Co,ti,S,ei,fl,dl,Kn]),Ii=g.useCallback(w=>{let A=!1;if(q!==void 0&&q({...w,cancel:()=>{A=!0}}),A||gl(w)||j.current===void 0)return;const[F,W]=j.current.cell,B=Qt.current;if(Ve&&!w.metaKey&&!w.ctrlKey&&j.current!==void 0&&w.key.length===1&&/[ -~]/g.test(w.key)&&w.bounds!==void 0&&qi(R([F-Y,Math.max(0,Math.min(W,Ze-1))]))){if((!Yt||W!==Ze)&&(B.y>W||W>B.y+B.height||B.x>F||F>B.x+B.width))return;ei(w.bounds,!0,w.key),w.stopPropagation(),w.preventDefault()}},[Ve,q,gl,j,R,Y,Ze,Yt,ei]),Af=g.useCallback((w,A)=>{const F=w.location[0]-Y;if(w.kind==="header"&&(oe==null||oe(F,{...w,preventDefault:A})),w.kind===Wn){if(F<0)return;G==null||G(F,{...w,preventDefault:A})}if(w.kind==="cell"){const[W,B]=w.location;N==null||N([F,B],{...w,preventDefault:A}),pm(j,w.location)||kr(W,B,!1,!1)}},[j,N,G,oe,Y,kr]),Ha=g.useCallback(async w=>{var X,K,Q;if(!An.paste)return;function A(ne,ye,_e,Ce){var De,gt;const Fe=typeof _e=="object"?(_e==null?void 0:_e.join(`
173
173
  `))??"":(_e==null?void 0:_e.toString())??"";if(!li(ne)&&qi(ne)&&ne.readonly!==!0){const Ue=E==null?void 0:E(Fe,ne);if(Ue!==void 0&&ai(Ue))return{location:ye,value:Ue};const Le=wt(ne);if(Le===void 0)return;if(Le.kind===re.Custom){Pn(ne.kind===re.Custom);const St=(De=Le.onPaste)==null?void 0:De.call(Le,Fe,ne.data);return St===void 0?void 0:{location:ye,value:{...ne,data:St}}}else{const St=(gt=Le.onPaste)==null?void 0:gt.call(Le,Fe,ne,{formatted:Ce,formattedString:typeof Ce=="string"?Ce:Ce==null?void 0:Ce.join(`
174
174
  `),rawValue:_e});return St===void 0?void 0:(Pn(St.kind===ne.kind),{location:ye,value:St})}}}const F=j.columns,W=j.rows,B=((X=Bt.current)==null?void 0:X.contains(document.activeElement))===!0||((K=l.current)==null?void 0:K.contains(document.activeElement))===!0;let Z;if(j.current!==void 0?Z=[j.current.range.x,j.current.range.y]:F.length===1?Z=[F.first()??0,0]:W.length===1&&(Z=[Y,W.first()??0]),B&&Z!==void 0){let ne,ye;const _e="text/plain",Ce="text/html";if(navigator.clipboard.read!==void 0){const Ue=await navigator.clipboard.read();for(const Le of Ue){if(Le.types.includes(Ce)){const qt=await(await Le.getType(Ce)).text(),rn=Cu(qt);if(rn!==void 0){ne=rn;break}}Le.types.includes(_e)&&(ye=await(await Le.getType(_e)).text())}}else if(navigator.clipboard.readText!==void 0)ye=await navigator.clipboard.readText();else if(w!==void 0&&(w==null?void 0:w.clipboardData)!==null){if(w.clipboardData.types.includes(Ce)){const Ue=w.clipboardData.getData(Ce);ne=Cu(Ue)}ne===void 0&&w.clipboardData.types.includes(_e)&&(ye=w.clipboardData.getData(_e))}else return;const[Fe,De]=Z,gt=[];do{if(rt===void 0){const Ue=Dn(Z),Le=ye??(ne==null?void 0:ne.map(qt=>qt.map(rn=>rn.rawValue).join(" ")).join(" "))??"",St=A(Ue,Z,Le,void 0);St!==void 0&&gt.push(St);break}if(ne===void 0){if(ye===void 0)return;ne=C0(ye)}if(rt===!1||typeof rt=="function"&&(rt==null?void 0:rt([Z[0]-Y,Z[1]],ne.map(Ue=>Ue.map(Le=>{var St;return((St=Le.rawValue)==null?void 0:St.toString())??""}))))!==!0)return;for(const[Ue,Le]of ne.entries()){if(Ue+De>=Ze)break;for(const[St,qt]of Le.entries()){const rn=[St+Fe,Ue+De],[Zn,ir]=rn;if(Zn>=yt.length||ir>=mn)continue;const Jn=Dn(rn),or=A(Jn,rn,qt.rawValue,qt.formatted);or!==void 0&&gt.push(or)}}}while(!1);zn(gt),(Q=En.current)==null||Q.damage(gt.map(Ue=>({cell:Ue.location})))}},[E,wt,Dn,j,An.paste,Bt,yt.length,zn,mn,rt,Y,Ze]);dn("paste",Ha,d,!1,!0);const Ti=g.useCallback(async(w,A)=>{var X,K;if(!An.copy)return;const F=A===!0||((X=Bt.current)==null?void 0:X.contains(document.activeElement))===!0||((K=l.current)==null?void 0:K.contains(document.activeElement))===!0,W=j.columns,B=j.rows,Z=(Q,ne)=>{if(!pe)xu(Q,ne,w);else{const ye=ne.map(_e=>({kind:re.Text,data:y[_e].title,displayData:y[_e].title,allowOverlay:!1}));xu([ye,...Q],ne,w)}};if(F&&un!==void 0){if(j.current!==void 0){let Q=un(j.current.range,ln.current.signal);typeof Q!="object"&&(Q=await Q()),Z(Q,ar(j.current.range.x-Y,j.current.range.x+j.current.range.width-Y))}else if(B!==void 0&&B.length>0){const ne=[...B].map(ye=>{const _e=un({x:Y,y:ye,width:y.length,height:1},ln.current.signal);return typeof _e=="object"?_e[0]:_e().then(Ce=>Ce[0])});if(ne.some(ye=>ye instanceof Promise)){const ye=await Promise.all(ne);Z(ye,ar(y.length))}else Z(ne,ar(y.length))}else if(W.length>0){const Q=[],ne=[];for(const ye of W){let _e=un({x:ye,y:0,width:1,height:Ze},ln.current.signal);typeof _e!="object"&&(_e=await _e()),Q.push(_e),ne.push(ye-Y)}if(Q.length===1)Z(Q[0],ne);else{const ye=Q.reduce((_e,Ce)=>_e.map((Fe,De)=>[...Fe,...Ce[De]]));Z(ye,ne)}}}},[y,un,j,An.copy,Y,Bt,Ze,pe]);dn("copy",Ti,d,!1,!1);const Hf=g.useCallback(async w=>{var F,W;if(!(!An.cut||!(((F=Bt.current)==null?void 0:F.contains(document.activeElement))===!0||((W=l.current)==null?void 0:W.contains(document.activeElement))===!0))&&(await Ti(w),j.current!==void 0)){let B={current:{cell:j.current.cell,range:j.current.range,rangeStack:[]},rows:vt.empty(),columns:vt.empty()};const Z=Te==null?void 0:Te(B);if(Z===!1||(B=Z===!0?B:Z,B.current===void 0))return;zr(B.current.range)}},[zr,j,An.cut,Ti,Bt,Te]);dn("cut",Hf,d,!1,!1);const zf=g.useCallback((w,A)=>{if(ge!==void 0){Y!==0&&(w=w.map(B=>[B[0]-Y,B[1]])),ge(w,A);return}if(w.length===0||A===-1)return;const[F,W]=w[A];c.current!==void 0&&c.current[0]===F&&c.current[1]===W||(c.current=[F,W],kr(F,W,!1,!1))},[ge,Y,kr]),[ko,Mo]=((Cl=_t==null?void 0:_t.current)==null?void 0:Cl.cell)??[],Ro=g.useRef(nn);Ro.current=nn,g.useLayoutEffect(()=>{var w,A,F,W;Aa.current&&!Cr.current&&ko!==void 0&&Mo!==void 0&&(ko!==((A=(w=ae.current)==null?void 0:w.current)==null?void 0:A.cell[0])||Mo!==((W=(F=ae.current)==null?void 0:F.current)==null?void 0:W.cell[1]))&&Ro.current(ko,Mo),Cr.current=!1},[ko,Mo]);const ml=j.current!==void 0&&(j.current.cell[0]>=yt.length||j.current.cell[1]>=mn);g.useLayoutEffect(()=>{ml&&Se(zo,!1)},[ml,Se]);const Vf=g.useMemo(()=>Yt===!0&&(Pe==null?void 0:Pe.tint)===!0?vt.fromSingleSelection(mn-1):vt.empty(),[mn,Yt,Pe==null?void 0:Pe.tint]),$f=g.useCallback(w=>typeof ot=="boolean"?ot:(ot==null?void 0:ot(w-Y))??!0,[Y,ot]),Nf=g.useMemo(()=>{if(Da===void 0||l.current===null)return null;const{bounds:w,group:A}=Da,F=l.current.getBoundingClientRect();return g.createElement(c0,{bounds:w,group:A,canvasBounds:F,onClose:()=>Oa(void 0),onFinish:W=>{Oa(void 0),te==null||te(A,W)}})},[te,Da]),Bf=Math.min(yt.length,Ee+(Hn?1:0));g.useImperativeHandle(t,()=>({appendRow:(w,A)=>ti(w+Y,A),updateCells:w=>{var A;return Y!==0&&(w=w.map(F=>({cell:[F.cell[0]+Y,F.cell[1]]}))),(A=En.current)==null?void 0:A.damage(w)},getBounds:(w,A)=>{var F;if(!((l==null?void 0:l.current)===null||(Bt==null?void 0:Bt.current)===null)){if(w===void 0&&A===void 0){const W=l.current.getBoundingClientRect(),B=W.width/Bt.current.clientWidth;return{x:W.x-Bt.current.scrollLeft*B,y:W.y-Bt.current.scrollTop*B,width:Bt.current.scrollWidth*B,height:Bt.current.scrollHeight*B}}return(F=En.current)==null?void 0:F.getBounds((w??0)+Y,A)}},focus:()=>{var w;return(w=En.current)==null?void 0:w.focus()},emit:async w=>{switch(w){case"delete":Ii({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":Ii({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":Ii({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 Ti(void 0,!0);break;case"paste":await Ha();break}},scrollTo:nn,remeasureColumns:w=>{for(const A of w)So(A+Y)}}),[ti,So,Bt,Ti,Ii,Ha,Y,nn]);const[pl,vl]=rr??[],Wf=g.useCallback(w=>{const[A,F]=w;if(F===-1){et!=="none"&&(Je(vt.fromSingleSelection(A),void 0,!1),yn());return}pl===A&&vl===F||(Ct({cell:w,range:{x:A,y:F,width:1,height:1}},!0,!1,"keyboard-nav"),nn(A,F))},[et,yn,nn,pl,vl,Ct,Je]),[Uf,qf]=g.useState(!1),bl=g.useRef(Nc(w=>{qf(w)},5)),Yf=g.useCallback(()=>{bl.current(!0),j.current===void 0&&j.columns.length===0&&j.rows.length===0&&s===void 0&&Ct({cell:[Y,po],range:{x:Y,y:po,width:1,height:1}},!0,!1,"keyboard-select")},[po,j,s,Y,Ct]),Xf=g.useCallback(()=>{bl.current(!1)},[]),[Gf,jf]=g.useMemo(()=>{let w;const A=($t==null?void 0:$t.scrollbarWidthOverride)??ps(),F=Ze+(Yt?1:0);if(typeof Xn=="number")w=Et+F*Xn;else{let B=0;const Z=Math.min(F,10);for(let X=0;X<Z;X++)B+=Xn(X);B=Math.floor(B/Z),w=Et+F*B}w+=A;const W=yt.reduce((B,Z)=>Z.width+B,0)+A;return[`${Math.min(1e5,W)}px`,`${Math.min(1e5,w)}px`]},[yt,$t==null?void 0:$t.scrollbarWidthOverride,Xn,Ze,Yt,Et]),Kf=g.useMemo(()=>Dm(We),[We]);return g.createElement(fd.Provider,{value:We},g.createElement(M0,{style:Kf,className:U,inWidth:p??Gf,inHeight:v??jf},g.createElement(a0,{fillHandle:Vt,drawFocusRing:Pr,experimental:$t,fixedShadowX:de,fixedShadowY:Ne,getRowThemeOverride:Fn,headerIcons:Gt,imageWindowLoader:xn,initialSize:on,isDraggable:V,onDragLeave:Ke,onRowMoved:ze,overscrollX:xa,overscrollY:ka,preventDiagonalScrolling:bn,rightElement:qn,rightElementProps:In,smoothScrollX:Ln,smoothScrollY:Yn,className:U,enableGroups:wn,onCanvasFocused:Yf,onCanvasBlur:Xf,canvasRef:l,onContextMenu:Af,theme:We,cellXOffset:Cf,cellYOffset:po,accessibilityHeight:Lr.height,onDragEnd:Pf,columns:yt,nonGrowWidth:Gn,drawHeader:at,onColumnProposeMove:I,drawCell:st,disabledRows:Vf,freezeColumns:Bf,lockColumns:Y,firstColAccessible:Y===0,getCellContent:Dn,minColumnWidth:nr,maxColumnWidth:_r,searchInputRef:a,showSearch:Si,onSearchClose:Ma,highlightRegions:Sf,getCellsForSelection:un,getGroupDetails:Ia,headerHeight:Ci,isFocused:Uf,groupHeaderHeight:wn?go:0,freezeTrailingRows:Lt+(Yt&&(Pe==null?void 0:Pe.sticky)===!0?1:0),hasAppendRow:Yt,onColumnResize:xe,onColumnResizeEnd:fe,onColumnResizeStart:Re,onCellFocused:Wf,onColumnMoved:Df,onDragStart:Of,onHeaderMenuClick:Ef,onHeaderIndicatorClick:If,onItemHovered:Fa,isFilling:(s==null?void 0:s.fillHandle)===!0,onMouseMove:Rf,onKeyDown:Ii,onKeyUp:he,onMouseDown:xf,onMouseUp:Mf,onDragOverCell:zt,onDrop:Pt,onSearchResultsChanged:zf,onVisibleRegionChanged:Tf,clientSize:ft,rowHeight:Xn,searchResults:J,searchValue:P,onSearchValueChange:H,rows:mn,scrollRef:Bt,selection:j,translateX:Lr.tx,translateY:Lr.ty,verticalBorder:$f,gridRef:En,getCellRenderer:wt,resizeIndicator:Sa}),Nf,i!==void 0&&g.createElement(g.Suspense,{fallback:null},g.createElement(A0,{...i,validateCell:$,bloom:D,id:Ff,getCellRenderer:wt,className:($t==null?void 0:$t.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:vn,imageEditorOverride:f,onFinishEditing:Lf,markdownDivCreateNode:m,isOutsideClick:br}))))},$0=g.forwardRef(V0),Td=20;function Ru(e){const{cell:t,posX:n,posY:r,bounds:i,theme:o}=e,{width:a,height:l,x:s,y:u}=i,c=t.maxSize??Td,d=Math.floor(i.y+l/2),f=Uc(c,l,o.cellVerticalPadding),h=Wc(t.contentAlign??"center",s,a,o.cellHorizontalPadding,f),m=Bc(h,d,f),p=qc(s+n,u+r,m);return Os(t)&&p}const N0={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??"false"},kind:re.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>B0(e,e.cell.data,Os(e.cell),e.cell.maxSize??Td,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{Ru(e)&&e.preventDefault()},onClick:e=>{if(Ru(e))return{...e.cell,data:Rd(e.cell.data)}},onPaste:(e,t)=>{let n=Jo;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=Ds),n===t.data?void 0:{...t,data:n}}};function B0(e,t,n,r,i){if(!n&&t===Jo)return;const{ctx:o,hoverAmount:a,theme:l,rect:s,highlighted:u,hoverX:c,hoverY:d,cell:{contentAlign:f}}=e,{x:h,y:m,width:p,height:v}=s;let y=!1;if(i>0){let b=n?1-i+i*a:.4;if(t===Jo&&(b*=a),b===0)return;b<1&&(y=!0,o.globalAlpha=b)}$s(o,l,t,h,m,p,v,u,c,d,r,f),y&&(o.globalAlpha=1)}const W0=fn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),U0=e=>{const{bubbles:t}=e;return g.createElement(W0,null,t.map((n,r)=>g.createElement("div",{key:r,className:"boe-bubble"},n)),g.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},q0={getAccessibilityString:e=>Yc(e.data),kind:re.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,i)=>e.measureText(i).width+r+20,0)+2*n.cellHorizontalPadding-4,draw:e=>X0(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return g.createElement(U0,{bubbles:t.data})},onPaste:()=>{}},Y0=4;function X0(e,t){const{rect:n,theme:r,ctx:i,highlighted:o}=e,{x:a,y:l,width:s,height:u}=n,c=20,d=8,f=Y0;let h=a+r.cellHorizontalPadding;const m=[];for(const p of t){if(h>a+s)break;const v=Xr(p,i,r.baseFontFull).width;m.push({x:h,width:v}),h+=v+d*2+f}i.beginPath();for(const p of m)lr(i,p.x,l+(u-c)/2,p.width+d*2,c,r.roundingRadius??c/2);i.fillStyle=o?r.bgBubbleSelected:r.bgBubble,i.fill();for(const[p,v]of m.entries())i.beginPath(),i.fillStyle=r.textBubble,i.fillText(t[p],v.x+d,l+u/2+ur(i,r))}const G0=fn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),j0=e=>{const{drilldowns:t}=e;return g.createElement(G0,null,t.map((n,r)=>g.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&g.createElement("img",{src:n.img}),g.createElement("div",null,n.text))))},K0={getAccessibilityString:e=>Yc(e.data.map(t=>t.text)),kind:re.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,i)=>e.measureText(i.text).width+r+20+(i.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>Q0(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return g.createElement(j0,{drilldowns:t.data})},onPaste:()=>{}},Z0=4,rs={};function J0(e,t,n,r){const i=Math.ceil(window.devicePixelRatio),o=5,a=n-o*2,l=4,s=n*i,u=r+o,c=r*3,d=(c+o*2)*i,f=`${e},${t},${i},${n}`;if(rs[f]!==void 0)return{el:rs[f],height:s,width:d,middleWidth:l*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=s,m.scale(i,i),rs[f]=h,m.beginPath(),lr(m,o,o,c,a,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(),lr(m,o+.5,o+.5,c,a,r),m.strokeStyle=t,m.lineWidth=1,m.stroke(),{el:h,height:s,width:d,sideWidth:u*i,middleWidth:r*i,padding:o*i,dpr:i})}function Q0(e,t){const{rect:n,theme:r,ctx:i,imageLoader:o,col:a,row:l}=e,{x:s,width:u}=n,c=r.baseFontFull,d=sd(i,c),f=Math.min(n.height,Math.max(16,Math.ceil(d*r.lineHeight)*2)),h=Math.floor(n.y+(n.height-f)/2),m=f-10,p=8,v=Z0;let y=s+r.cellHorizontalPadding;const b=r.roundingRadius??6,R=J0(r.bgCell,r.drilldownBorder,f,b),O=[];for(const S of t){if(y>s+u)break;const _=Xr(S.text,i,c).width;let E=0;S.img!==void 0&&o.loadOrGetImage(S.img,a,l)!==void 0&&(E=m-8+4);const x=_+E+p*2;O.push({x:y,width:x}),y+=x+v}if(R!==null){const{el:S,height:M,middleWidth:_,sideWidth:E,width:x,dpr:L,padding:D}=R,C=E/L,I=D/L;for(const T of O){const k=Math.floor(T.x),z=Math.floor(T.width),N=z-(C-I)*2;i.imageSmoothingEnabled=!1,i.drawImage(S,0,0,E,M,k-I,h,C,f),N>0&&i.drawImage(S,E,0,_,M,k+(C-I),h,N,f),i.drawImage(S,x-E,0,E,M,k+z-(C-I),h,C,f),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[S,M]of O.entries()){const _=t[S];let E=M.x+p;if(_.img!==void 0){const x=o.loadOrGetImage(_.img,a,l);if(x!==void 0){const L=m-8;let D=0,C=0,I=x.width,T=x.height;I>T?(D+=(I-T)/2,I=T):T>I&&(C+=(T-I)/2,T=I),i.beginPath(),lr(i,E,h+f/2-L/2,L,L,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(x,D,C,I,T,E,h+f/2-L/2,L,L),i.restore(),E+=L+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(_.text,E,h+f/2+ur(i,r))}}const ev={getAccessibilityString:e=>e.data.join(", "),kind:re.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>tv(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??$g;return g.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}}},is=4;function tv(e,t,n,r){const{rect:i,col:o,row:a,theme:l,ctx:s,imageLoader:u}=e,{x:c,y:d,height:f,width:h}=i,m=f-l.cellVerticalPadding*2,p=[];let v=0;for(let b=0;b<t.length;b++){const R=t[b];if(R.length===0)continue;const O=u.loadOrGetImage(R,o,a);if(O!==void 0){p[b]=O;const S=O.width*(m/O.height);v+=S+is}}if(v===0)return;v-=is;let y=c+l.cellHorizontalPadding;r==="right"?y=Math.floor(c+h-l.cellHorizontalPadding-v):r==="center"&&(y=Math.floor(c+h/2-v/2));for(const b of p){if(b===void 0)continue;const R=b.width*(m/b.height);n>0&&(s.beginPath(),lr(s,y,d+l.cellVerticalPadding,R,m,n),s.save(),s.clip()),s.drawImage(b,y,d+l.cellVerticalPadding,R,m),n>0&&s.restore(),y+=R+is}}function nv(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const rv={getAccessibilityString:()=>"",kind:re.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:i,rect:o,theme:a}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let l=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(l+=Math.round(nv(n,r)*t.skeletonWidthVariability));const s=a.cellHorizontalPadding;l+s*2>=o.width&&(l=o.width-s*2-1);const u=t.skeletonHeight??Math.min(18,o.height-2*a.cellVerticalPadding);lr(i,o.x+s,o.y+(o.height-u)/2,l,u,a.roundingRadius??3),i.fillStyle=Ur(a.textDark,.1),i.fill()},onPaste:()=>{}},iv=()=>e=>e.targetWidth,Eu=fn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[iv(),"px"]}}),ov=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:i,targetRect:o,onFinish:a,validatedSelection:l}=e,s=t.data,u=t.readonly===!0,[c,d]=g.useState(s===""||r),f=g.useCallback(()=>{d(m=>!m)},[]),h=s?"gdg-ml-6":"";return c?g.createElement(Eu,{targetWidth:o.width-20},g.createElement(gi,{autoFocus:!0,highlight:!1,validatedSelection:l,value:s,onKeyDown:m=>{m.key==="Enter"&&m.stopPropagation()},onChange:n}),g.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${h}`,onClick:()=>a(t)},g.createElement(_g,null))):g.createElement(Eu,{targetWidth:o.width},g.createElement(om,{contents:s,createNode:i}),!u&&g.createElement(g.Fragment,null,g.createElement("div",{className:"spacer"}),g.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${h}`,onClick:f},g.createElement(_s,null))),g.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},av={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:re.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:oo,measure:(e,t,n)=>{const r=t.data.split(`
175
- `)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>sr(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:a,validatedSelection:l}=e;return g.createElement(ov,{onFinish:i,targetRect:r,value:n,validatedSelection:l,onChange:s=>t({...n,data:s.target.value}),forceEditMode:a,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},sv={getAccessibilityString:e=>e.row.toString(),kind:Un.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:lv,measure:()=>44,draw:e=>cv(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:a}=t,l=n.drawHandle?7+(o-7)/2:o/2,s=a/2;if(Math.abs(r-l)<=10&&Math.abs(i-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function lv(e,t){const{ctx:n,theme:r}=e,i=r.markerFontFull,o=t??{};return(o==null?void 0:o.font)!==i&&(n.font=i,o.font=i),o.deprep=uv,n.textAlign="center",o}function uv(e){const{ctx:t}=e;t.textAlign="start"}function cv(e,t,n,r,i,o){const{ctx:a,rect:l,hoverAmount:s,theme:u}=e,{x:c,y:d,width:f,height:h}=l,m=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&m>0){a.globalAlpha=m;const p=7*(n?s:1);if($s(a,u,n,i?c+p:c,d,i?f-p:f,h,!0,void 0,void 0,18,"center",o),i){a.globalAlpha=s,a.beginPath();for(const v of[3,6])for(const y of[-5,-1,3])a.rect(c+v,d+h/2+y,2,2);a.fillStyle=u.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(r==="number"||r==="both"&&!n){const p=t.toString(),v=u.markerFontFull,y=c+f/2;r==="both"&&s!==0&&(a.globalAlpha=1-s),a.fillStyle=u.textLight,a.font=v,a.fillText(p,y,d+h/2+ur(a,v)),s!==0&&(a.globalAlpha=1)}}const dv={getAccessibilityString:()=>"",kind:Un.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>fv(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function fv(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:a,spriteManager:l}=e,{x:s,y:u,width:c,height:d}=i;r.beginPath(),r.globalAlpha=o,r.rect(s+1,u+1,c,d-2),r.fillStyle=a.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const f=t!=="";let h=0;if(n!==void 0){const p=d-8,v=s+8/2,y=u+8/2;l.drawSprite(n,"normal",r,v,y,p,a,f?1:o),h=p}else{h=24;const m=12,p=f?m:o*m,v=f?0:(1-o)*m*.5,y=a.cellHorizontalPadding+4;p>0&&(r.moveTo(s+y+v,u+d/2),r.lineTo(s+y+v+p,u+d/2),r.moveTo(s+y+v+p*.5,u+d/2-p*.5),r.lineTo(s+y+v+p*.5,u+d/2+p*.5),r.lineWidth=2,r.strokeStyle=a.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=a.textMedium,r.fillText(t,h+s+a.cellHorizontalPadding+.5,u+d/2+ur(r,a)),r.beginPath()}function Dd(e,t,n,r,i,o,a){e.textBaseline="alphabetic";const l=hv(e,i,r,t,(n==null?void 0:n.fullSize)??!1);e.beginPath(),lr(e,l.x,l.y,l.width,l.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=(n==null?void 0:n.bgColor)??Ur(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",a==null||a("text")}function hv(e,t,n,r,i){const o=r.cellHorizontalPadding,a=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+a/2+1,width:t.width-o,height:t.height-a-1};const l=Xr(n,e,r.baseFontFull,"alphabetic"),s=t.height-a,u=Math.min(s,l.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:l.width+o*3,height:u-1}}const gv=g.lazy(async()=>await Es(()=>import("./number-overlay-editor.DLD5-9zx.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url)),mv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:re.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:oo,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:i,rect:o,overrideCursor:a}=e,{hoverEffect:l,displayData:s,hoverEffectTheme:u}=n;l===!0&&t>0&&Dd(r,i,u,s,o,t,a),sr(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 g.createElement(g.Suspense,{fallback:null},g.createElement(gv,{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}}},pv={getAccessibilityString:()=>"",measure:()=>108,kind:re.Protected,needsHover:!1,needsHoverPosition:!1,draw:vv,onPaste:()=>{}};function vv(e){const{ctx:t,theme:n,rect:r}=e,{x:i,y:o,height:a}=r;t.beginPath();const l=2.5;let s=i+n.cellHorizontalPadding+l;const u=o+a/2,c=Math.cos(Yl(30))*l,d=Math.sin(Yl(30))*l;for(let f=0;f<12;f++)t.moveTo(s,u-l),t.lineTo(s,u+l),t.moveTo(s+c,u-d),t.lineTo(s-c,u+d),t.moveTo(s-c,u-d),t.lineTo(s+c,u+d),s+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const bv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:re.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>oo(e,t,e.theme.textLight),draw:e=>sr(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 se.createElement(gi,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},wv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:re.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:oo,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:o,theme:a,overrideCursor:l}=e,{displayData:s,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:f}=t;c===!0&&n>0&&Dd(i,a,f,s,o,n,l),sr(e,s,u,d,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
175
+ `)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>sr(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:a,validatedSelection:l}=e;return g.createElement(ov,{onFinish:i,targetRect:r,value:n,validatedSelection:l,onChange:s=>t({...n,data:s.target.value}),forceEditMode:a,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},sv={getAccessibilityString:e=>e.row.toString(),kind:Un.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:lv,measure:()=>44,draw:e=>cv(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:a}=t,l=n.drawHandle?7+(o-7)/2:o/2,s=a/2;if(Math.abs(r-l)<=10&&Math.abs(i-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function lv(e,t){const{ctx:n,theme:r}=e,i=r.markerFontFull,o=t??{};return(o==null?void 0:o.font)!==i&&(n.font=i,o.font=i),o.deprep=uv,n.textAlign="center",o}function uv(e){const{ctx:t}=e;t.textAlign="start"}function cv(e,t,n,r,i,o){const{ctx:a,rect:l,hoverAmount:s,theme:u}=e,{x:c,y:d,width:f,height:h}=l,m=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&m>0){a.globalAlpha=m;const p=7*(n?s:1);if($s(a,u,n,i?c+p:c,d,i?f-p:f,h,!0,void 0,void 0,18,"center",o),i){a.globalAlpha=s,a.beginPath();for(const v of[3,6])for(const y of[-5,-1,3])a.rect(c+v,d+h/2+y,2,2);a.fillStyle=u.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(r==="number"||r==="both"&&!n){const p=t.toString(),v=u.markerFontFull,y=c+f/2;r==="both"&&s!==0&&(a.globalAlpha=1-s),a.fillStyle=u.textLight,a.font=v,a.fillText(p,y,d+h/2+ur(a,v)),s!==0&&(a.globalAlpha=1)}}const dv={getAccessibilityString:()=>"",kind:Un.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>fv(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function fv(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:a,spriteManager:l}=e,{x:s,y:u,width:c,height:d}=i;r.beginPath(),r.globalAlpha=o,r.rect(s+1,u+1,c,d-2),r.fillStyle=a.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const f=t!=="";let h=0;if(n!==void 0){const p=d-8,v=s+8/2,y=u+8/2;l.drawSprite(n,"normal",r,v,y,p,a,f?1:o),h=p}else{h=24;const m=12,p=f?m:o*m,v=f?0:(1-o)*m*.5,y=a.cellHorizontalPadding+4;p>0&&(r.moveTo(s+y+v,u+d/2),r.lineTo(s+y+v+p,u+d/2),r.moveTo(s+y+v+p*.5,u+d/2-p*.5),r.lineTo(s+y+v+p*.5,u+d/2+p*.5),r.lineWidth=2,r.strokeStyle=a.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=a.textMedium,r.fillText(t,h+s+a.cellHorizontalPadding+.5,u+d/2+ur(r,a)),r.beginPath()}function Dd(e,t,n,r,i,o,a){e.textBaseline="alphabetic";const l=hv(e,i,r,t,(n==null?void 0:n.fullSize)??!1);e.beginPath(),lr(e,l.x,l.y,l.width,l.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=(n==null?void 0:n.bgColor)??Ur(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",a==null||a("text")}function hv(e,t,n,r,i){const o=r.cellHorizontalPadding,a=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+a/2+1,width:t.width-o,height:t.height-a-1};const l=Xr(n,e,r.baseFontFull,"alphabetic"),s=t.height-a,u=Math.min(s,l.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:l.width+o*3,height:u-1}}const gv=g.lazy(async()=>await Es(()=>import("./number-overlay-editor.C7xqWB6m.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url)),mv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:re.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:oo,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:i,rect:o,overrideCursor:a}=e,{hoverEffect:l,displayData:s,hoverEffectTheme:u}=n;l===!0&&t>0&&Dd(r,i,u,s,o,t,a),sr(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 g.createElement(g.Suspense,{fallback:null},g.createElement(gv,{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}}},pv={getAccessibilityString:()=>"",measure:()=>108,kind:re.Protected,needsHover:!1,needsHoverPosition:!1,draw:vv,onPaste:()=>{}};function vv(e){const{ctx:t,theme:n,rect:r}=e,{x:i,y:o,height:a}=r;t.beginPath();const l=2.5;let s=i+n.cellHorizontalPadding+l;const u=o+a/2,c=Math.cos(Yl(30))*l,d=Math.sin(Yl(30))*l;for(let f=0;f<12;f++)t.moveTo(s,u-l),t.lineTo(s,u+l),t.moveTo(s+c,u-d),t.lineTo(s-c,u+d),t.moveTo(s-c,u-d),t.lineTo(s+c,u+d),s+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const bv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:re.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>oo(e,t,e.theme.textLight),draw:e=>sr(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 se.createElement(gi,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},wv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:re.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:oo,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:o,theme:a,overrideCursor:l}=e,{displayData:s,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:f}=t;c===!0&&n>0&&Dd(i,a,f,s,o,n,l),sr(e,s,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 g.createElement(gi,{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:a=>r({...i,data:a.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},yv=fn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Cv=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:i,validatedSelection:o,preview:a}=e,[l,s]=g.useState(!i&&(t===""||r)),u=g.useCallback(()=>{s(!0)},[]);return l?g.createElement(gi,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):g.createElement(yv,null,g.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},a),!i&&g.createElement("div",{className:"gdg-edit-icon",onClick:u},g.createElement(_s,null)),g.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function Od(e,t,n,r){let i=n.cellHorizontalPadding;const o=t.height/2-e.actualBoundingBoxAscent/2,a=e.width,l=e.actualBoundingBoxAscent;return r==="right"?i=t.width-a-n.cellHorizontalPadding:r==="center"&&(i=t.width/2-a/2),{x:i,y:o,width:a,height:l}}function Iu(e){const{cell:t,bounds:n,posX:r,posY:i,theme:o}=e,a=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const l=id(a,o.baseFontFull);if(l===void 0)return!1;const s=Od(l,n,o,t.contentAlign);return Wr({x:s.x-4,y:s.y-4,width:s.width+8,height:s.height+8},r,i)}const Sv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:re.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:oo,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:i,hoverY:o,rect:a,ctx:l}=e,s=t.displayData??t.data,u=t.hoverEffect===!0;if(r!==void 0&&u&&i!==void 0&&o!==void 0){const c=Xr(s,l,n.baseFontFull),d=Od(c,a,n,t.contentAlign),{x:f,y:h,width:m,height:p}=d;if(i>=f-4&&i<=f-4+m+8&&o>=h-4&&o<=h-4+p+8){const v=ur(l,n.baseFontFull);r("pointer");const y=5,b=h-v;l.beginPath(),l.moveTo(a.x+f,Math.floor(a.y+b+p+y)+.5),l.lineTo(a.x+f+m,Math.floor(a.y+b+p+y)+.5),l.strokeStyle=n.linkColor,l.stroke(),l.save(),l.fillStyle=e.cellFillColor,sr({...e,rect:{...a,x:a.x-1}},s,t.contentAlign),sr({...e,rect:{...a,x:a.x-2}},s,t.contentAlign),sr({...e,rect:{...a,x:a.x+1}},s,t.contentAlign),sr({...e,rect:{...a,x:a.x+2}},s,t.contentAlign),l.restore()}}l.fillStyle=u?n.linkColor:n.textDark,sr(e,s,t.contentAlign)},onSelect:e=>{Iu(e)&&e.preventDefault()},onClick:e=>{var r;const{cell:t}=e;Iu(e)&&((r=t.onClickUri)==null||r.call(t,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 g.createElement(Cv,{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:a=>n({...r,data:a.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},xv=[sv,dv,N0,q0,K0,ev,rv,av,mv,pv,bv,wv,Sv];var os,Tu;function kv(){if(Tu)return os;Tu=1;var e=$c(),t=vc(),n="Expected a function";function r(i,o,a){var l=!0,s=!0;if(typeof i!="function")throw new TypeError(n);return t(a)&&(l="leading"in a?!!a.leading:l,s="trailing"in a?!!a.trailing:s),e(i,o,{leading:l,maxWait:o,trailing:s})}return os=r,os}var Mv=kv();const Rv=pr(Mv),as=[];class Ev extends ud{constructor(){super(...arguments);dt(this,"imageLoaded",()=>{});dt(this,"loadedLocations",[]);dt(this,"cache",{});dt(this,"sendLoaded",Rv(()=>{this.imageLoaded(new Ki(this.loadedLocations)),this.loadedLocations=[]},20));dt(this,"clearOutOfWindow",()=>{const n=Object.keys(this.cache);for(const r of n){const i=this.cache[r];let o=!1;for(let a=0;a<i.cells.length;a++){const l=i.cells[a];if(this.isInWindow(l)){o=!0;break}}o?i.cells=i.cells.filter(this.isInWindow):(i.cancel(),delete this.cache[r])}})}setCallback(n){this.imageLoaded=n}loadImage(n,r,i,o){let a=!1;const l=as.pop()??new Image;let s=!1;const u={img:void 0,cells:[er(r,i)],url:n,cancel:()=>{s||(s=!0,as.length<12?as.unshift(l):a||(l.src=""))}},c=new Promise(d=>l.addEventListener("load",()=>d(null)));requestAnimationFrame(async()=>{try{l.src=n,await c,await l.decode();const d=this.cache[o];if(d!==void 0&&!s){d.img=l;for(const f of d.cells)this.loadedLocations.push(Vs(f));a=!0,this.sendLoaded()}}catch{u.cancel()}}),this.cache[o]=u}loadOrGetImage(n,r,i){const o=n,a=this.cache[o];if(a!==void 0){const l=er(r,i);return a.cells.includes(l)||a.cells.push(l),a.img}else this.loadImage(n,r,i,o)}}const Iv=(e,t)=>{const n=g.useMemo(()=>({...bp,...e.headerIcons}),[e.headerIcons]),r=g.useMemo(()=>e.imageWindowLoader??new Ev,[e.imageWindowLoader]);return g.createElement($0,{...e,renderers:xv,headerIcons:n,ref:t,imageWindowLoader:r})},Tv=g.forwardRef(Iv);function Du(e,t){const n=g.useRef(null),r=g.useRef(),i=g.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return g.useEffect(()=>i,[i]),{debouncedCallback:g.useCallback((...a)=>{r.current=a,i(),n.current=setTimeout(()=>{r.current&&(e(...r.current),r.current=void 0)},t)},[e,t,i]),cancel:i}}const Ou=io("div",{target:"eau1w2s0"})(({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"}})),Dv=io("div",{target:"eau1w2s1"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs})),Vo=io("div",{target:"eau1w2s2"})(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing.sm,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,paddingTop:e.spacing.twoXS,paddingBottom:e.spacing.twoXS,cursor:"pointer","&:hover":{backgroundColor:e.colors.darkenedBgMix15},minWidth:e.sizes.minMenuWidth})),Ov=io("div",{target:"eau1w2s3"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs}));function Pv({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:i,onCloseMenu:o,onSortColumn:a}){const l=ma(),{colors:s,fontSizes:u,radii:c,fontWeights:d}=l;g.useEffect(()=>{function h(p){p.preventDefault()}const m=()=>{document.removeEventListener("wheel",h),document.removeEventListener("touchmove",h)};return document.addEventListener("wheel",h,{passive:!1}),document.addEventListener("touchmove",h,{passive:!1}),()=>{m()}},[]);const f=se.useCallback(()=>{o()},[o]);return Kt(xc,{autoFocus:!0,"aria-label":"Dataframe column menu",content:Ir(Dv,{children:[a&&Ir(ch,{children:[Ir(Vo,{onClick:()=>{a("asc"),f()},role:"menuitem",children:[Kt(To,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),Ir(Vo,{onClick:()=>{a("desc"),f()},role:"menuitem",children:[Kt(To,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_downward:"}),"Sort descending"]}),Kt(Ov,{})]}),n&&Ir(Vo,{onClick:()=>{i(),f()},children:[Kt(To,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&Ir(Vo,{onClick:()=>{r(),f()},children:[Kt(To,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep:"}),"Pin column"]})]}),placement:Cc.bottomRight,accessibilityType:yc.menu,showArrow:!1,popoverMargin:$n("0.375rem"),onClickOutside:f,onEsc:f,overrides:{Body:{props:{"data-testid":"stDataFrameColumnMenu"},style:{paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{border:`${l.sizes.borderWidth} solid ${l.colors.borderColor}`,backgroundColor:Sc(l)?s.bgColor:s.secondaryBg,color:s.bodyText,fontSize:u.sm,fontWeight:d.normal,borderTopLeftRadius:c.default,borderTopRightRadius:c.default,borderBottomLeftRadius:c.default,borderBottomRightRadius:c.default,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:!0,children:Kt("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const _v=g.memo(Pv);var Lv=dh();const Fv=pr(Lv);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:re.Text,data:"",displayData:"",allowOverlay:!0,conten
193
193
  40% { opacity: 1; }
194
194
  `]))),Db=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,a=o.colors,l=o.spacing.baseUnit;return qe({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?a.neutral60:a.neutral20,padding:l*2})},ls=function(t){var n=t.delay,r=t.offset;return Be("span",{css:Dc({animation:"".concat(Tb," 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"},"","")})},Ob=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,a=vr(t,Cb);return Be("div",tt({},en(qe(qe({},a),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Be(ls,{delay:0,offset:r}),Be(ls,{delay:160,offset:!0}),Be(ls,{delay:320,offset:!r}))},Pb=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,a=o.colors,l=o.borderRadius,s=o.spacing;return qe({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:s.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?a.neutral5:a.neutral0,borderColor:r?a.neutral10:i?a.primary:a.neutral20,borderRadius:l,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:i?a.primary:a.neutral30}})},_b=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,a=t.innerProps,l=t.menuIsOpen;return Be("div",tt({ref:o},en(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":l}),a,{"aria-disabled":r||void 0}),n)},Lb=_b,Fb=["data"],Ab=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},Hb=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,a=t.Heading,l=t.headingProps,s=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return Be("div",tt({},en(t,"group",{group:!0}),s),Be(a,tt({},l,{selectProps:d,theme:c,getStyles:i,getClassNames:o,cx:r}),u),Be("div",null,n))},zb=function(t,n){var r=t.theme,i=r.colors,o=r.spacing;return qe({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"})},Vb=function(t){var n=jd(t);n.data;var r=vr(n,Fb);return Be("div",tt({},en(t,"groupHeading",{"group-heading":!0}),r))},$b=Hb,Nb=["innerRef","isDisabled","isHidden","inputClassName"],Bb=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,a=o.spacing,l=o.colors;return qe(qe({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},Wb),n?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:l.neutral80})},of={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Wb={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":qe({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},of)},Ub=function(t){return qe({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},of)},qb=function(t){var n=t.cx,r=t.value,i=jd(t),o=i.innerRef,a=i.isDisabled,l=i.isHidden,s=i.inputClassName,u=vr(i,Nb);return Be("div",tt({},en(t,"input",{"input-container":!0}),{"data-value":r||""}),Be("input",tt({className:n({input:!0},s),ref:o,style:Ub(l),disabled:a},u)))},Yb=qb,Xb=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,a=r.colors;return qe({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:a.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},Gb=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,a=t.cropWithEllipsis;return qe({overflow:"hidden",textOverflow:a||a===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},jb=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,a=r.colors,l=t.isFocused;return qe({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:l?a.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},af=function(t){var n=t.children,r=t.innerProps;return Be("div",r,n)},Kb=af,Zb=af;function Jb(e){var t=e.children,n=e.innerProps;return Be("div",tt({role:"button"},n),t||Be(rl,{size:14}))}var Qb=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,a=t.isDisabled,l=t.removeProps,s=t.selectProps,u=r.Container,c=r.Label,d=r.Remove;return Be(u,{data:i,innerProps:qe(qe({},en(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),o),selectProps:s},Be(c,{data:i,innerProps:qe({},en(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},n),Be(d,{data:i,innerProps:qe(qe({},en(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},l),selectProps:s}))},ew=Qb,tw=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,a=t.theme,l=a.spacing,s=a.colors;return qe({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?s.primary:i?s.primary25:"transparent",color:r?s.neutral20:o?s.neutral0:"inherit",padding:"".concat(l.baseUnit*2,"px ").concat(l.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?s.primary:s.primary50}})},nw=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,a=t.innerRef,l=t.innerProps;return Be("div",tt({},en(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:a,"aria-disabled":r},l),n)},rw=nw,iw=function(t,n){var r=t.theme,i=r.spacing,o=r.colors;return qe({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},ow=function(t){var n=t.children,r=t.innerProps;return Be("div",tt({},en(t,"placeholder",{placeholder:!0}),r),n)},aw=ow,sw=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,a=i.colors;return qe({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?a.neutral40:a.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},lw=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return Be("div",tt({},en(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},uw=lw,sf={ClearIndicator:Rb,Control:Lb,DropdownIndicator:kb,DownChevron:nf,CrossIcon:rl,Group:$b,GroupHeading:Vb,IndicatorsContainer:wb,IndicatorSeparator:Ib,Input:Yb,LoadingIndicator:Ob,Menu:ob,MenuList:sb,MenuPortal:hb,LoadingMessage:db,NoOptionsMessage:cb,MultiValue:ew,MultiValueContainer:Kb,MultiValueLabel:Zb,MultiValueRemove:Jb,Option:rw,Placeholder:aw,SelectContainer:mb,SingleValue:uw,ValueContainer:vb},cw=function(t){return qe(qe({},sf),t.components)},Zu=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function dw(e,t){return!!(e===t||Zu(e)&&Zu(t))}function fw(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!dw(e[n],t[n]))return!1;return!0}function hw(e,t){t===void 0&&(t=fw);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 a=e.apply(this,i);return n={lastResult:a,lastArgs:i,lastThis:this},a}return r.clear=function(){n=null},r}var gw={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"},mw=function(t){return Be("span",tt({css:gw},t))},Ju=mw,pw={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,o=t.context,a=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 a?"".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,a=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 a?"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,a=o===void 0?"":o,l=t.selectValue,s=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(p,v){return p&&p.length?"".concat(p.indexOf(v)+1," of ").concat(p.length):""};if(n==="value"&&l)return"value ".concat(a," focused, ").concat(d(l,r),".");if(n==="menu"&&c){var f=s?" disabled":"",h="".concat(u?" selected":"").concat(f);return"".concat(a).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:"",".")}},vw=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,a=t.isFocused,l=t.selectValue,s=t.selectProps,u=t.id,c=t.isAppleDevice,d=s.ariaLiveMessages,f=s.getOptionLabel,h=s.inputValue,m=s.isMulti,p=s.isOptionDisabled,v=s.isSearchable,y=s.menuIsOpen,b=s.options,R=s.screenReaderStatus,O=s.tabSelectsValue,S=s.isLoading,M=s["aria-label"],_=s["aria-live"],E=g.useMemo(function(){return qe(qe({},pw),d||{})},[d]),x=g.useMemo(function(){var k="";if(n&&E.onChange){var z=n.option,N=n.options,U=n.removedValue,oe=n.removedValues,ee=n.value,G=function(P){return Array.isArray(P)?null:P},te=U||z||G(ee),ie=te?f(te):"",ue=N||oe||void 0,ge=ue?ue.map(f):[],J=qe({isDisabled:te&&p(te,l),label:ie,labels:ge},n);k=E.onChange(J)}return k},[n,E,p,l,f]),L=g.useMemo(function(){var k="",z=r||i,N=!!(r&&l&&l.includes(r));if(z&&E.onFocus){var U={focused:z,label:f(z),isDisabled:p(z,l),isSelected:N,options:o,context:z===r?"menu":"value",selectValue:l,isAppleDevice:c};k=E.onFocus(U)}return k},[r,i,f,p,E,o,l,c]),D=g.useMemo(function(){var k="";if(y&&b.length&&!S&&E.onFilter){var z=R({count:o.length});k=E.onFilter({inputValue:h,resultsMessage:z})}return k},[o,h,y,E,b,R,S]),C=(n==null?void 0:n.action)==="initial-input-focus",I=g.useMemo(function(){var k="";if(E.guidance){var z=i?"value":y?"menu":"input";k=E.guidance({"aria-label":M,context:z,isDisabled:r&&p(r,l),isMulti:m,isSearchable:v,tabSelectsValue:O,isInitialFocus:C})}return k},[M,r,i,m,p,v,y,E,l,O,C]),T=Be(g.Fragment,null,Be("span",{id:"aria-selection"},x),Be("span",{id:"aria-focused"},L),Be("span",{id:"aria-results"},D),Be("span",{id:"aria-guidance"},I));return Be(g.Fragment,null,Be(Ju,{id:u},C&&T),Be(Ju,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!C&&T))},bw=vw,Rs=[{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źẑżžẓẕƶȥɀⱬꝣ"}],ww=new RegExp("["+Rs.map(function(e){return e.letters}).join("")+"]","g"),lf={};for(var us=0;us<Rs.length;us++)for(var cs=Rs[us],ds=0;ds<cs.letters.length;ds++)lf[cs.letters[ds]]=cs.base;var uf=function(t){return t.replace(ww,function(n){return lf[n]})},yw=hw(uf),Qu=function(t){return t.replace(/^\s+|\s+$/g,"")},Cw=function(t){return"".concat(t.label," ").concat(t.value)},Sw=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=qe({ignoreCase:!0,ignoreAccents:!0,stringify:Cw,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,a=i.ignoreAccents,l=i.stringify,s=i.trim,u=i.matchFrom,c=s?Qu(r):r,d=s?Qu(l(n)):l(n);return o&&(c=c.toLowerCase(),d=d.toLowerCase()),a&&(c=yw(c),d=uf(d)),u==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},xw=["innerRef"];function kw(e){var t=e.innerRef,n=vr(e,xw),r=Z1(n,"onExited","in","enter","exit","appear");return Be("input",tt({ref:t},r,{css:Dc({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 Mw=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function Rw(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,o=e.onTopLeave,a=g.useRef(!1),l=g.useRef(!1),s=g.useRef(0),u=g.useRef(null),c=g.useCallback(function(v,y){if(u.current!==null){var b=u.current,R=b.scrollTop,O=b.scrollHeight,S=b.clientHeight,M=u.current,_=y>0,E=O-S-R,x=!1;E>y&&a.current&&(r&&r(v),a.current=!1),_&&l.current&&(o&&o(v),l.current=!1),_&&y>E?(n&&!a.current&&n(v),M.scrollTop=O,x=!0,a.current=!0):!_&&-y>R&&(i&&!l.current&&i(v),M.scrollTop=0,x=!0,l.current=!0),x&&Mw(v)}},[n,r,i,o]),d=g.useCallback(function(v){c(v,v.deltaY)},[c]),f=g.useCallback(function(v){s.current=v.changedTouches[0].clientY},[]),h=g.useCallback(function(v){var y=s.current-v.changedTouches[0].clientY;c(v,y)},[c]),m=g.useCallback(function(v){if(v){var y=G1?{passive:!1}:!1;v.addEventListener("wheel",d,y),v.addEventListener("touchstart",f,y),v.addEventListener("touchmove",h,y)}},[h,f,d]),p=g.useCallback(function(v){v&&(v.removeEventListener("wheel",d,!1),v.removeEventListener("touchstart",f,!1),v.removeEventListener("touchmove",h,!1))},[h,f,d]);return g.useEffect(function(){if(t){var v=u.current;return m(v),function(){p(v)}}},[t,m,p]),function(v){u.current=v}}var ec=["boxSizing","height","overflow","paddingRight","position"],tc={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function nc(e){e.preventDefault()}function rc(e){e.stopPropagation()}function ic(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function oc(){return"ontouchstart"in window||navigator.maxTouchPoints}var ac=!!(typeof window<"u"&&window.document&&window.document.createElement),Bi=0,oi={capture:!1,passive:!1};function Ew(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=g.useRef({}),o=g.useRef(null),a=g.useCallback(function(s){if(ac){var u=document.body,c=u&&u.style;if(r&&ec.forEach(function(m){var p=c&&c[m];i.current[m]=p}),r&&Bi<1){var d=parseInt(i.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,h=window.innerWidth-f+d||0;Object.keys(tc).forEach(function(m){var p=tc[m];c&&(c[m]=p)}),c&&(c.paddingRight="".concat(h,"px"))}u&&oc()&&(u.addEventListener("touchmove",nc,oi),s&&(s.addEventListener("touchstart",ic,oi),s.addEventListener("touchmove",rc,oi))),Bi+=1}},[r]),l=g.useCallback(function(s){if(ac){var u=document.body,c=u&&u.style;Bi=Math.max(Bi-1,0),r&&Bi<1&&ec.forEach(function(d){var f=i.current[d];c&&(c[d]=f)}),u&&oc()&&(u.removeEventListener("touchmove",nc,oi),s&&(s.removeEventListener("touchstart",ic,oi),s.removeEventListener("touchmove",rc,oi)))}},[r]);return g.useEffect(function(){if(t){var s=o.current;return a(s),function(){l(s)}}},[t,a,l]),function(s){o.current=s}}var Iw=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},Tw={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Dw(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,o=e.onBottomArrive,a=e.onBottomLeave,l=e.onTopArrive,s=e.onTopLeave,u=Rw({isEnabled:i,onBottomArrive:o,onBottomLeave:a,onTopArrive:l,onTopLeave:s}),c=Ew({isEnabled:n}),d=function(h){u(h),c(h)};return Be(g.Fragment,null,n&&Be("div",{onClick:Iw,css:Tw}),t(d))}var Ow={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Pw=function(t){var n=t.name,r=t.onFocus;return Be("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:Ow,value:"",onChange:function(){}})},_w=Pw;function il(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 Lw(){return il(/^iPhone/i)}function cf(){return il(/^Mac/i)}function Fw(){return il(/^iPad/i)||cf()&&navigator.maxTouchPoints>1}function Aw(){return Lw()||Fw()}function Hw(){return cf()||Aw()}var zw=function(t){return t.label},Vw=function(t){return t.label},$w=function(t){return t.value},Nw=function(t){return!!t.isDisabled},Bw={clearIndicator:Mb,container:gb,control:Pb,dropdownIndicator:xb,group:Ab,groupHeading:zb,indicatorsContainer:bb,indicatorSeparator:Eb,input:Bb,loadingIndicator:Db,loadingMessage:ub,menu:nb,menuList:ab,menuPortal:fb,multiValue:Xb,multiValueLabel:Gb,multiValueRemove:jb,noOptionsMessage:lb,option:tw,placeholder:iw,singleValue:sw,valueContainer:pb},Ww={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%)"},Uw=4,df=4,qw=38,Yw=df*2,Xw={baseUnit:df,controlHeight:qw,menuGutter:Yw},fs={borderRadius:Uw,colors:Ww,spacing:Xw},Gw={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:ju(),captureMenuScroll:!ju(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Sw(),formatGroupLabel:zw,getOptionLabel:Vw,getOptionValue:$w,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Nw,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Y1(),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 sc(e,t,n,r){var i=gf(e,t,n),o=mf(e,t,n),a=hf(e,t),l=ga(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:a,value:l,index:r}}function Zo(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(a,l){return sc(e,a,t,l)}).filter(function(a){return uc(e,a)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=sc(e,n,t,r);return uc(e,o)?o:void 0}).filter(j1)}function ff(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Ts(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function lc(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Ts(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 jw(e,t){return ff(Zo(e,t))}function uc(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,a=t.label,l=t.value;return(!vf(e)||!o)&&pf(e,{label:a,value:l,data:i},r)}function Kw(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 Zw(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var hs=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},hf=function(t,n){return t.getOptionLabel(n)},ga=function(t,n){return t.getOptionValue(n)};function gf(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function mf(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=ga(e,t);return n.some(function(i){return ga(e,i)===r})}function pf(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var vf=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},Jw=1,bf=function(e){ng(n,e);var t=og(n);function n(r){var i;if(ig(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=Hw(),i.controlRef=null,i.getControlRef=function(s){i.controlRef=s},i.focusedOptionRef=null,i.getFocusedOptionRef=function(s){i.focusedOptionRef=s},i.menuListRef=null,i.getMenuListRef=function(s){i.menuListRef=s},i.inputRef=null,i.getInputRef=function(s){i.inputRef=s},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(s,u){var c=i.props,d=c.onChange,f=c.name;u.name=f,i.ariaOnChange(s,u),d(s,u)},i.setValue=function(s,u,c){var d=i.props,f=d.closeMenuOnSelect,h=d.isMulti,m=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:m}),f&&(i.setState({inputIsHiddenAfterUpdate:!h}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(s,{action:u,option:c})},i.selectOption=function(s){var u=i.props,c=u.blurInputOnSelect,d=u.isMulti,f=u.name,h=i.state.selectValue,m=d&&i.isOptionSelected(s,h),p=i.isOptionDisabled(s,h);if(m){var v=i.getOptionValue(s);i.setValue(h.filter(function(y){return i.getOptionValue(y)!==v}),"deselect-option",s)}else if(!p)d?i.setValue([].concat(Ts(h),[s]),"select-option",s):i.setValue(s,"select-option");else{i.ariaOnChange(s,{action:"select-option",option:s,name:f});return}c&&i.blurInput()},i.removeValue=function(s){var u=i.props.isMulti,c=i.state.selectValue,d=i.getOptionValue(s),f=c.filter(function(m){return i.getOptionValue(m)!==d}),h=Yo(u,f,f[0]||null);i.onChange(h,{action:"remove-value",removedValue:s}),i.focusInput()},i.clearValue=function(){var s=i.state.selectValue;i.onChange(Yo(i.props.isMulti,[],null),{action:"clear",removedValues:s})},i.popValue=function(){var s=i.props.isMulti,u=i.state.selectValue,c=u[u.length-1],d=u.slice(0,u.length-1),f=Yo(s,d,d[0]||null);c&&i.onChange(f,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(s){return hs(i.state.focusableOptionsWithIds,s)},i.getFocusableOptionsWithIds=function(){return lc(Zo(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];return N1.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(s){return hf(i.props,s)},i.getOptionValue=function(s){return ga(i.props,s)},i.getStyles=function(s,u){var c=i.props.unstyled,d=Bw[s](u,c);d.boxSizing="border-box";var f=i.props.styles[s];return f?f(d,u):d},i.getClassNames=function(s,u){var c,d;return(c=(d=i.props.classNames)[s])===null||c===void 0?void 0:c.call(d,u)},i.getElementId=function(s){return"".concat(i.state.instancePrefix,"-").concat(s)},i.getComponents=function(){return cw(i.props)},i.buildCategorizedOptions=function(){return Zo(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return ff(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(s,u){i.setState({ariaSelection:qe({value:s},u)})},i.onMenuMouseDown=function(s){s.button===0&&(s.stopPropagation(),s.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(s){i.blockOptionHover=!1},i.onControlMouseDown=function(s){if(!s.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&s.preventDefault()}},i.onDropdownIndicatorMouseDown=function(s){if(!(s&&s.type==="mousedown"&&s.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"),s.preventDefault()}},i.onClearIndicatorMouseDown=function(s){s&&s.type==="mousedown"&&s.button!==0||(i.clearValue(),s.preventDefault(),i.openAfterFocus=!1,s.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(s){typeof i.props.closeMenuOnScroll=="boolean"?s.target instanceof HTMLElement&&wa(s.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(s)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(s){var u=s.touches,c=u&&u.item(0);c&&(i.initialTouchX=c.clientX,i.initialTouchY=c.clientY,i.userIsDragging=!1)},i.onTouchMove=function(s){var u=s.touches,c=u&&u.item(0);if(c){var d=Math.abs(c.clientX-i.initialTouchX),f=Math.abs(c.clientY-i.initialTouchY),h=5;i.userIsDragging=d>h||f>h}},i.onTouchEnd=function(s){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(s.target)&&i.menuListRef&&!i.menuListRef.contains(s.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(s){i.userIsDragging||i.onControlMouseDown(s)},i.onClearIndicatorTouchEnd=function(s){i.userIsDragging||i.onClearIndicatorMouseDown(s)},i.onDropdownIndicatorTouchEnd=function(s){i.userIsDragging||i.onDropdownIndicatorMouseDown(s)},i.handleInputChange=function(s){var u=i.props.inputValue,c=s.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(c,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(s){i.props.onFocus&&i.props.onFocus(s),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(s){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(s),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(s){if(!(i.blockOptionHover||i.state.focusedOption===s)){var u=i.getFocusableOptions(),c=u.indexOf(s);i.setState({focusedOption:s,focusedOptionId:c>-1?i.getFocusedOptionId(s):null})}},i.shouldHideSelectedOptions=function(){return vf(i.props)},i.onValueInputFocus=function(s){s.preventDefault(),s.stopPropagation(),i.focus()},i.onKeyDown=function(s){var u=i.props,c=u.isMulti,d=u.backspaceRemovesValue,f=u.escapeClearsValue,h=u.inputValue,m=u.isClearable,p=u.isDisabled,v=u.menuIsOpen,y=u.onKeyDown,b=u.tabSelectsValue,R=u.openMenuOnFocus,O=i.state,S=O.focusedOption,M=O.focusedValue,_=O.selectValue;if(!p&&!(typeof y=="function"&&(y(s),s.defaultPrevented))){switch(i.blockOptionHover=!0,s.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||s.shiftKey||!v||!b||!S||R&&i.isOptionSelected(S,_))return;i.selectOption(S);break;case"Enter":if(s.keyCode===229)break;if(v){if(!S||i.isComposing)return;i.selectOption(S);break}return;case"Escape":v?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:h}),i.onMenuClose()):m&&f&&i.clearValue();break;case" ":if(h)return;if(!v){i.openMenu("first");break}if(!S)return;i.selectOption(S);break;case"ArrowUp":v?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":v?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!v)return;i.focusOption("pageup");break;case"PageDown":if(!v)return;i.focusOption("pagedown");break;case"Home":if(!v)return;i.focusOption("first");break;case"End":if(!v)return;i.focusOption("last");break;default:return}s.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++Jw),i.state.selectValue=Xu(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),a=i.buildFocusableOptions(),l=a.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=a[l],i.state.focusedOptionId=hs(o,a[l])}return i}return rg(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&&Gu(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var o=this.props,a=o.isDisabled,l=o.menuIsOpen,s=this.state.isFocused;(s&&!a&&i.isDisabled||s&&l&&!i.menuIsOpen)&&this.focusInput(),s&&a&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!s&&!a&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Gu(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,a=this.state,l=a.selectValue,s=a.isFocused,u=this.buildFocusableOptions(),c=i==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(l[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(s&&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,a=o.selectValue,l=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var s=a.indexOf(l);l||(s=-1);var u=a.length-1,c=-1;if(a.length){switch(i){case"previous":s===0?c=0:s===-1?c=u:c=s-1;break;case"next":s>-1&&s<u&&(c=s+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:a[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,a=this.state.focusedOption,l=this.getFocusableOptions();if(l.length){var s=0,u=l.indexOf(a);a||(u=-1),i==="up"?s=u>0?u-1:l.length-1:i==="down"?s=(u+1)%l.length:i==="pageup"?(s=u-o,s<0&&(s=0)):i==="pagedown"?(s=u+o,s>l.length-1&&(s=l.length-1)):i==="last"&&(s=l.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:l[s],focusedValue:null,focusedOptionId:this.getFocusedOptionId(l[s])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(fs):qe(qe({},fs),this.props.theme):fs}},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,a=this.getStyles,l=this.getClassNames,s=this.getValue,u=this.selectOption,c=this.setValue,d=this.props,f=d.isMulti,h=d.isRtl,m=d.options,p=this.hasValue();return{clearValue:i,cx:o,getStyles:a,getClassNames:l,getValue:s,hasValue:p,isMulti:f,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,a=i.isMulti;return o===void 0?a:o}},{key:"isOptionDisabled",value:function(i,o){return gf(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return mf(this.props,i,o)}},{key:"filterOption",value:function(i,o){return pf(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var a=this.props.inputValue,l=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:a,selectValue:l})}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,a=i.isSearchable,l=i.inputId,s=i.inputValue,u=i.tabIndex,c=i.form,d=i.menuIsOpen,f=i.required,h=this.getComponents(),m=h.Input,p=this.state,v=p.inputIsHidden,y=p.ariaSelection,b=this.commonProps,R=l||this.getElementId("input"),O=qe(qe(qe({"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":f,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!a&&{"aria-readonly":!0}),this.hasValue()?(y==null?void 0:y.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return a?g.createElement(m,tt({},b,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:R,innerRef:this.getInputRef,isDisabled:o,isHidden:v,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:s},O)):g.createElement(kw,tt({id:R,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:fa,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},O))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),a=o.MultiValue,l=o.MultiValueContainer,s=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,d=o.Placeholder,f=this.commonProps,h=this.props,m=h.controlShouldRenderValue,p=h.isDisabled,v=h.isMulti,y=h.inputValue,b=h.placeholder,R=this.state,O=R.selectValue,S=R.focusedValue,M=R.isFocused;if(!this.hasValue()||!m)return y?null:g.createElement(d,tt({},f,{key:"placeholder",isDisabled:p,isFocused:M,innerProps:{id:this.getElementId("placeholder")}}),b);if(v)return O.map(function(E,x){var L=E===S,D="".concat(i.getOptionLabel(E),"-").concat(i.getOptionValue(E));return g.createElement(a,tt({},f,{components:{Container:l,Label:s,Remove:u},isFocused:L,isDisabled:p,key:D,index:x,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(y)return null;var _=O[0];return g.createElement(c,tt({},f,{data:_,isDisabled:p}),this.formatOptionLabel(_,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,a=this.commonProps,l=this.props,s=l.isDisabled,u=l.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||s||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return g.createElement(o,tt({},a,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,a=this.commonProps,l=this.props,s=l.isDisabled,u=l.isLoading,c=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return g.createElement(o,tt({},a,{innerProps:d,isDisabled:s,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,a=i.IndicatorSeparator;if(!o||!a)return null;var l=this.commonProps,s=this.props.isDisabled,u=this.state.isFocused;return g.createElement(a,tt({},l,{isDisabled:s,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var a=this.commonProps,l=this.props.isDisabled,s=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return g.createElement(o,tt({},a,{innerProps:u,isDisabled:l,isFocused:s}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),a=o.Group,l=o.GroupHeading,s=o.Menu,u=o.MenuList,c=o.MenuPortal,d=o.LoadingMessage,f=o.NoOptionsMessage,h=o.Option,m=this.commonProps,p=this.state.focusedOption,v=this.props,y=v.captureMenuScroll,b=v.inputValue,R=v.isLoading,O=v.loadingMessage,S=v.minMenuHeight,M=v.maxMenuHeight,_=v.menuIsOpen,E=v.menuPlacement,x=v.menuPosition,L=v.menuPortalTarget,D=v.menuShouldBlockScroll,C=v.menuShouldScrollIntoView,I=v.noOptionsMessage,T=v.onMenuScrollToTop,k=v.onMenuScrollToBottom;if(!_)return null;var z=function(ie,ue){var ge=ie.type,J=ie.data,H=ie.isDisabled,P=ie.isSelected,q=ie.label,he=ie.value,me=p===J,Ve=H?void 0:function(){return i.onOptionHover(J)},ve=H?void 0:function(){return i.selectOption(J)},Xe="".concat(i.getElementId("option"),"-").concat(ue),Me={id:Xe,onClick:ve,onMouseMove:Ve,onMouseOver:Ve,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:P};return g.createElement(h,tt({},m,{innerProps:Me,data:J,isDisabled:H,isSelected:P,key:Xe,label:q,type:ge,value:he,isFocused:me,innerRef:me?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(ie.data,"menu"))},N;if(this.hasOptions())N=this.getCategorizedOptions().map(function(te){if(te.type==="group"){var ie=te.data,ue=te.options,ge=te.index,J="".concat(i.getElementId("group"),"-").concat(ge),H="".concat(J,"-heading");return g.createElement(a,tt({},m,{key:J,data:ie,options:ue,Heading:l,headingProps:{id:H,data:te.data},label:i.formatGroupLabel(te.data)}),te.options.map(function(P){return z(P,"".concat(ge,"-").concat(P.index))}))}else if(te.type==="option")return z(te,"".concat(te.index))});else if(R){var U=O({inputValue:b});if(U===null)return null;N=g.createElement(d,m,U)}else{var oe=I({inputValue:b});if(oe===null)return null;N=g.createElement(f,m,oe)}var ee={minMenuHeight:S,maxMenuHeight:M,menuPlacement:E,menuPosition:x,menuShouldScrollIntoView:C},G=g.createElement(rb,tt({},m,ee),function(te){var ie=te.ref,ue=te.placerProps,ge=ue.placement,J=ue.maxHeight;return g.createElement(s,tt({},m,ee,{innerRef:ie,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:R,placement:ge}),g.createElement(Dw,{captureEnabled:y,onTopArrive:T,onBottomArrive:k,lockEnabled:D},function(H){return g.createElement(u,tt({},m,{innerRef:function(q){i.getMenuListRef(q),H(q)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:i.getElementId("listbox")},isLoading:R,maxHeight:J,focusedOption:p}),N)}))});return L||x==="fixed"?g.createElement(c,tt({},m,{appendTo:L,controlElement:this.controlRef,menuPlacement:E,menuPosition:x}),G):G}},{key:"renderFormField",value:function(){var i=this,o=this.props,a=o.delimiter,l=o.isDisabled,s=o.isMulti,u=o.name,c=o.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!l)return g.createElement(_w,{name:u,onFocus:this.onValueInputFocus});if(!(!u||l))if(s)if(a){var f=d.map(function(p){return i.getOptionValue(p)}).join(a);return g.createElement("input",{name:u,type:"hidden",value:f})}else{var h=d.length>0?d.map(function(p,v){return g.createElement("input",{key:"i-".concat(v),name:u,type:"hidden",value:i.getOptionValue(p)})}):g.createElement("input",{name:u,type:"hidden",value:""});return g.createElement("div",null,h)}else{var m=d[0]?this.getOptionValue(d[0]):"";return g.createElement("input",{name:u,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,a=o.ariaSelection,l=o.focusedOption,s=o.focusedValue,u=o.isFocused,c=o.selectValue,d=this.getFocusableOptions();return g.createElement(bw,tt({},i,{id:this.getElementId("live-region"),ariaSelection:a,focusedOption:l,focusedValue:s,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,a=i.IndicatorsContainer,l=i.SelectContainer,s=i.ValueContainer,u=this.props,c=u.className,d=u.id,f=u.isDisabled,h=u.menuIsOpen,m=this.state.isFocused,p=this.commonProps=this.getCommonProps();return g.createElement(l,tt({},p,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:m}),this.renderLiveRegion(),g.createElement(o,tt({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:m,menuIsOpen:h}),g.createElement(s,tt({},p,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),g.createElement(a,tt({},p,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var a=o.prevProps,l=o.clearFocusValueOnUpdate,s=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,d=o.prevWasFocused,f=o.instancePrefix,h=i.options,m=i.value,p=i.menuIsOpen,v=i.inputValue,y=i.isMulti,b=Xu(m),R={};if(a&&(m!==a.value||h!==a.options||p!==a.menuIsOpen||v!==a.inputValue)){var O=p?jw(i,b):[],S=p?lc(Zo(i,b),"".concat(f,"-option")):[],M=l?Kw(o,b):null,_=Zw(o,O),E=hs(S,_);R={selectValue:b,focusedOption:_,focusedOptionId:E,focusableOptionsWithIds:S,focusedValue:M,clearFocusValueOnUpdate:!1}}var x=s!=null&&i!==a?{inputIsHidden:s,inputIsHiddenAfterUpdate:void 0}:{},L=u,D=c&&d;return c&&!D&&(L={value:Yo(y,b,b[0]||null),options:b,action:"initial-input-focus"},D=!d),(u==null?void 0:u.action)==="initial-input-focus"&&(L=null),qe(qe(qe({},R),x),{},{prevProps:i,ariaSelection:L,prevWasFocused:D})}}]),n}(g.Component);bf.defaultProps=Gw;var Qw=g.forwardRef(function(e,t){var n=k1(e);return g.createElement(bf,tt({ref:t},n))}),ey=Qw;const ty=e=>{const{Menu:t}=sf,{children:n,...r}=e;return g.createElement(t,{...r},n)},ny=fn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),ry=fn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),iy=fn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),oy=e=>{const{value:t,onFinishedEditing:n,initialValue:r}=e,{allowedValues:i,value:o}=t.data,[a,l]=g.useState(o),[s,u]=g.useState(r??""),c=Om(),d=g.useMemo(()=>i.map(f=>typeof f=="string"||f===null||f===void 0?{value:f,label:(f==null?void 0:f.toString())??""}:f),[i]);return t.readonly?g.createElement(iy,null,g.createElement(gi,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):g.createElement(ny,null,g.createElement(ey,{className:"glide-select",inputValue:s,onInputChange:u,menuPlacement:"auto",value:d.find(f=>f.value===a),styles:{control:f=>({...f,border:0,boxShadow:"none"}),option:(f,{isFocused:h})=>({...f,fontSize:c.editorFontSize,fontFamily:c.fontFamily,cursor:h?"pointer":void 0,paddingLeft:c.cellHorizontalPadding,paddingRight:c.cellHorizontalPadding,":active":{...f[":active"],color:c.accentFg},":empty::after":{content:'"&nbsp;"',visibility:"hidden"}})},theme:f=>({...f,colors:{...f.colors,neutral0:c.bgCell,neutral5:c.bgCell,neutral10:c.bgCell,neutral20:c.bgCellMedium,neutral30:c.bgCellMedium,neutral40:c.bgCellMedium,neutral50:c.textLight,neutral60:c.textMedium,neutral70:c.textMedium,neutral80:c.textDark,neutral90:c.textDark,neutral100:c.textDark,primary:c.accentColor,primary75:c.accentColor,primary50:c.accentColor,primary25:c.accentLight}}),menuPortalTarget:document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:f=>g.createElement(ry,null,g.createElement(ty,{className:"click-outside-ignore",...f}))},options:d,onChange:async f=>{f!==null&&(l(f.value),await new Promise(h=>window.requestAnimationFrame(h)),n({...t,data:{...t.data,value:f.value}}))}}))},ay={kind:re.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{value:o}=t.data,a=t.data.allowedValues.find(s=>typeof s=="string"||s===null||s===void 0?s===o:s.value===o),l=typeof a=="string"?a:(a==null?void 0:a.label)??"";return l&&(n.fillStyle=r.textDark,n.fillText(l,i.x+r.cellHorizontalPadding,i.y+i.height/2+ur(n,r))),!0},measure:(e,t,n)=>{const{value:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:oy,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,value:""}})}),onPaste:(e,t)=>({...t,value:t.allowedValues.includes(e)?e:t.value})},$r=6,sy={marginRight:8},ly={display:"flex",alignItems:"center",flexGrow:1},uy={kind:re.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{min:o,max:a,value:l,label:s,measureLabel:u}=t.data,c=i.x+r.cellHorizontalPadding,d=i.y+i.height/2,f=a-o,h=(l-o)/f;n.save();let m=0;s!==void 0&&(n.font=`12px ${r.fontFamily}`,m=Xr(u??s,n,`12px ${r.fontFamily}`).width+r.cellHorizontalPadding);const p=i.width-r.cellHorizontalPadding*2-m;if(p>=$r){const v=n.createLinearGradient(c,d,c+p,d);v.addColorStop(0,r.accentColor),v.addColorStop(h,r.accentColor),v.addColorStop(h,r.bgBubble),v.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=v,Bu(n,c,d-$r/2,p,$r,$r/2),n.fill(),n.beginPath(),Bu(n,c+.5,d-$r/2+.5,p-1,$r-1,($r-1)/2),n.strokeStyle=r.accentLight,n.lineWidth=1,n.stroke()}return s!==void 0&&(n.textAlign="right",n.fillStyle=r.textDark,n.fillText(s,i.x+i.width-r.cellHorizontalPadding,d+ur(n,`12px ${r.fontFamily}`))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,r=t.value.toString(),i=t.min.toString(),o=t.max.toString(),a=t.step.toString(),l=s=>{e.onChange({...e.value,data:{...t,value:Number(s.target.value)}})};return g.createElement("label",{style:ly},g.createElement("input",{style:sy,type:"range",value:r,min:i,max:o,step:a,onChange:l,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}}},cy=fn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),gs=(e,t)=>{if(t==null)return"";const n=t.toISOString();switch(e){case"date":return n.split("T")[0];case"datetime-local":return n.replace("Z","");case"time":return n.split("T")[1].replace("Z","");default:throw new Error(`Unknown date kind ${e}`)}},dy=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.min instanceof Date?gs(n,t.min):t.min,a=t.max instanceof Date?gs(n,t.max):t.max;let l=t.date;const s=t.timezoneOffset?t.timezoneOffset*60*1e3:0;s&&l&&(l=new Date(l.getTime()+s));const u=gs(n,l);return e.value.readonly?se.createElement(gi,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):se.createElement(cy,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:u,min:o,max:a,step:i,autoFocus:!0,onChange:c=>{isNaN(c.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(c.target.valueAsNumber-s)}})}})},fy={kind:re.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return od(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:dy}),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)}}},hy="None";function cc(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-8,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+8),e.fillStyle=n.accentColor,e.fill(),e.restore()}const gy=e=>{const{cell:t,theme:n,ctx:r}=e;od({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`}},hy,t.contentAlign),r.fillStyle=n.textDark};function my(e){const t=se.useCallback((r,i)=>{const{cell:o,theme:a,ctx:l,rect:s}=r,u=r.col;if(di(o))cc(l,s,a);else if(va(o)&&u<e.length){const c=e[u];["checkbox","line_chart","bar_chart","progress"].includes(c.kind)?i():gy(r),c.isRequired&&c.isEditable&&cc(l,s,a);return}i()},[e]),n=se.useMemo(()=>[S1,ay,uy,fy,...Kv],[]);return{drawCell:t,customRenderers:n}}function py(){const e=ma();return se.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:$a(e.colors.primary,.9),borderColor:e.colors.borderColorLight,horizontalBorderColor:e.colors.borderColorLight,fontFamily:e.genericFonts.bodyFont,bgSearchResult:$a(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.bgMix,bgHeaderHasFocus:e.colors.secondaryBg,bgHeaderHovered:e.colors.secondaryBg,textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerFontStyle:`${$n(e.fontSizes.sm)}px`,baseFontStyle:`${$n(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:$a(e.colors.bodyText,.2),textLight:e.colors.fadedText40,textBubble:e.colors.fadedText60,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round($n(e.spacing.sm)),cellVerticalPadding:Math.round($n("0.1875rem")),bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round($n("25rem")),minColumnWidth:Math.round($n("3.125rem")),maxColumnWidth:Math.round($n("62.5rem")),maxColumnAutoWidth:Math.round($n("31.25rem")),defaultRowHeight:Math.round($n("2.1875rem")),defaultHeaderHeight:Math.round($n("2.1875rem")),bgRowHovered:Nh(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:n}},[e])}const vy=Is.getLogger("useDataEditor");function by(e,t,n,r,i,o,a,l,s){const u=se.useCallback(([p,v],y)=>{const b=e[p];if(!b.isEditable)return;const R=b.indexNumber,O=n.current.getOriginalRowIndex(i(v)),S=r([p,v]),M=b.getCellValue(S),_=b.getCellValue(y);if(!di(S)&&_===M)return;const E=b.getCell(_,!0);di(E)?vy.warn(`Not applying the cell edit since it causes this error:
195
195
  ${E.data}`):(n.current.setCell(R,O,{...E,lastUpdated:performance.now()}),l())},[e,n,i,r,l]),c=se.useCallback(()=>{if(t)return;const p=new Map;e.forEach(v=>{p.set(v.indexNumber,v.getCell(v.defaultValue))}),n.current.addRow(p),a()},[e,n,t,a]),d=se.useCallback(()=>{t||(c(),l())},[c,l,t]),f=se.useCallback(p=>{var v;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),a(),s(),l(),!1}if((v=p.current)!=null&&v.range){const y=[],b=p.current.range;for(let R=b.y;R<b.y+b.height;R++)for(let O=b.x;O<b.x+b.width;O++){const S=e[O];S.isEditable&&!S.isRequired&&(y.push({cell:[O,R]}),u([O,R],S.getCell(null)))}return y.length>0&&(l(),o(y)),!1}return!0},[e,n,t,o,i,l,u,s,a]),h=se.useCallback((p,v)=>{const[y,b]=p,R=[];for(let O=0;O<v.length;O++){const S=v[O];if(O+b>=n.current.getNumRows()){if(t)break;c()}for(let M=0;M<S.length;M++){const _=S[M],E=O+b,x=M+y;if(x>=e.length)break;const L=e[x];if(L.isEditable){const D=L.getCell(_,!0);if(bt(D)&&!di(D)){const C=L.indexNumber,I=n.current.getOriginalRowIndex(i(E)),T=L.getCellValue(r([x,E]));L.getCellValue(D)!==T&&(n.current.setCell(C,I,{...D,lastUpdated:performance.now()}),R.push({cell:[x,E]}))}}}R.length>0&&(l(),o(R))}return!1},[e,n,t,i,r,c,l,o]),m=se.useCallback((p,v)=>{const y=p[0];if(y>=e.length)return!0;const b=e[y];if(b.validateInput){const R=b.validateInput(b.getCellValue(v));return R===!0||R===!1?R:b.getCell(R)}return!0},[e]);return{onCellEdited:u,onPaste:h,onRowAppended:d,onDelete:f,validateCell:m}}const wf=",",Yi='"',wy='"',yf=`
196
- `,yy="\uFEFF",Cy=new RegExp(`[${[wf,Yi,yf].join("")}]`),dc=Is.getLogger("useDataExporter");function fc(e){return e.map(t=>Sy(t)).join(wf)+yf}function Sy(e){if(nt(e))return"";const t=xt(e);return Cy.test(t)?`${Yi}${t.replace(new RegExp(Yi,"g"),wy+Yi)}${Yi}`:t}async function hc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(yy));const o=n.map(a=>a.name);await e.write(i.encode(fc(o)));for(let a=0;a<r;a++){const l=[];n.forEach((s,u,c)=>{l.push(s.getCellValue(t([u,a])))}),await e.write(i.encode(fc(l)))}await e.close()}function xy(e,t,n,r){return{exportToCsv:se.useCallback(async()=>{const a=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Es(()=>import("./es6.D670kkuw.js").then(c=>c.a),__vite__mapDeps([14,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:a,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await hc(u,e,t,n)}catch(l){if(l instanceof Error&&l.name==="AbortError")return;try{dc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",l);let s="";const u=new WritableStream({write:async h=>{s+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await hc(u.getWriter(),e,t,n);const c=new Blob([s],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),f=eg({enforceDownloadInNewTab:r,url:d,filename:a});f.style.display="none",document.body.appendChild(f),f.click(),document.body.removeChild(f),URL.revokeObjectURL(d)}catch(s){dc.error("Failed to export data as CSV",s)}}},[t,n,e,r])}}function ky(e,t,n,r){return{getCellContent:se.useCallback(([o,a])=>{var d;if(o>t.length-1)return At("Column index out of bounds","This error should never happen. Please report this bug.");if(a>n-1)return At("Row index out of bounds","This error should never happen. Please report this bug.");const l=t[o],s=l.indexNumber,u=r.current.getOriginalRowIndex(a),c=r.current.isAddedRow(u);if(l.isEditable||c){const f=r.current.getCell(s,u);if(bt(f))return f;if(c)return At("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${s}; row=${u}`)}try{const f=e.getCell(u,s),h=Bh(e,u,s);return s1(l,f,h,(d=e.styler)==null?void 0:d.cssStyles)}catch(f){return At("Error during cell creation",`This error should never happen. Please report this bug.
196
+ `,yy="\uFEFF",Cy=new RegExp(`[${[wf,Yi,yf].join("")}]`),dc=Is.getLogger("useDataExporter");function fc(e){return e.map(t=>Sy(t)).join(wf)+yf}function Sy(e){if(nt(e))return"";const t=xt(e);return Cy.test(t)?`${Yi}${t.replace(new RegExp(Yi,"g"),wy+Yi)}${Yi}`:t}async function hc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(yy));const o=n.map(a=>a.name);await e.write(i.encode(fc(o)));for(let a=0;a<r;a++){const l=[];n.forEach((s,u,c)=>{l.push(s.getCellValue(t([u,a])))}),await e.write(i.encode(fc(l)))}await e.close()}function xy(e,t,n,r){return{exportToCsv:se.useCallback(async()=>{const a=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Es(()=>import("./es6.DwFVXqV3.js").then(c=>c.a),__vite__mapDeps([14,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:a,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await hc(u,e,t,n)}catch(l){if(l instanceof Error&&l.name==="AbortError")return;try{dc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",l);let s="";const u=new WritableStream({write:async h=>{s+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await hc(u.getWriter(),e,t,n);const c=new Blob([s],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),f=eg({enforceDownloadInNewTab:r,url:d,filename:a});f.style.display="none",document.body.appendChild(f),f.click(),document.body.removeChild(f),URL.revokeObjectURL(d)}catch(s){dc.error("Failed to export data as CSV",s)}}},[t,n,e,r])}}function ky(e,t,n,r){return{getCellContent:se.useCallback(([o,a])=>{var d;if(o>t.length-1)return At("Column index out of bounds","This error should never happen. Please report this bug.");if(a>n-1)return At("Row index out of bounds","This error should never happen. Please report this bug.");const l=t[o],s=l.indexNumber,u=r.current.getOriginalRowIndex(a),c=r.current.isAddedRow(u);if(l.isEditable||c){const f=r.current.getCell(s,u);if(bt(f))return f;if(c)return At("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${s}; row=${u}`)}try{const f=e.getCell(u,s),h=Bh(e,u,s);return s1(l,f,h,(d=e.styler)==null?void 0:d.cssStyles)}catch(f){return At("Error during cell creation",`This error should never happen. Please report this bug.
197
197
  Error: ${f}`)}},[t,n,e,r])}}function My(e){const[t,n]=se.useState(void 0),r=se.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,a]=o.location;n(a)}},[n]);return{getRowThemeOverride:se.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function Ry(e,t,n,r,i){const[o,a]=se.useState({columns:vt.empty(),rows:vt.empty(),current:void 0}),l=!t&&!n&&(e.selectionMode.includes(Bn.SelectionMode.MULTI_ROW)||e.selectionMode.includes(Bn.SelectionMode.SINGLE_ROW)),s=l&&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,f=o.columns.length>0,h=o.current!==void 0,m=se.useCallback(v=>{const y=!Na(v.rows.toArray(),o.rows.toArray()),b=!Na(v.columns.toArray(),o.columns.toArray()),R=!Na(v.current,o.current);let O=l&&y||u&&b,S=v;if((l||u)&&v.current!==void 0&&R&&(S={...v,rows:o.rows,columns:o.columns},O=!1),y&&v.rows.length>0&&b&&v.columns.length===0&&(S={...S,columns:o.columns},O=!0),b&&v.columns.length>0&&y&&v.rows.length===0&&(S={...S,rows:o.rows},O=!0),b&&S.columns.length>=0){let M=S.columns;r.forEach((_,E)=>{_.isIndex&&(M=M.remove(E))}),M.length<S.columns.length&&(S={...S,columns:M})}a(S),O&&i(S)},[o,l,u,i,r]),p=se.useCallback((v=!1,y=!1)=>{const b={columns:y?o.columns:vt.empty(),rows:v?o.rows:vt.empty(),current:void 0};a(b),(!v&&l||!y&&u)&&i(b)},[o,l,u,i]);return{gridSelection:o,isRowSelectionActivated:l,isMultiRowSelectionActivated:s,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isRowSelected:d,isColumnSelected:f,isCellSelected:h,clearSelection:p,processSelectionChange:m}}function Ey(e,t,n,r,i,o,a){const l=e.rowHeight??t.defaultRowHeight,s=t.defaultHeaderHeight+l+2*t.tableBorderWidth,u=r?2:1,c=e.editingMode===Bn.EditingMode.DYNAMIC?1:0,d=n+c;let f=Math.max(d*l+u*t.defaultHeaderHeight+2*t.tableBorderWidth,s),h=Math.min(f,t.defaultTableHeight);e.height&&(h=Math.max(e.height,s),f=Math.max(e.height,f)),o&&(h=Math.min(h,o),f=Math.min(f,o),e.height||(h=f));const m=t.minColumnWidth+2*t.tableBorderWidth,p=Math.max(i,m);let v,y=p;e.useContainerWidth?v=p:e.width&&(v=Math.min(Math.max(e.width,m),p),y=Math.min(Math.max(e.width,y),p));const[b,R]=se.useState({width:v||"100%",height:h});return se.useLayoutEffect(()=>{e.useContainerWidth&&b.width==="100%"&&R(O=>({...O,width:p}))},[p]),se.useLayoutEffect(()=>{R(O=>({...O,width:v||"100%"}))},[v]),se.useLayoutEffect(()=>{R(O=>({...O,height:h}))},[h,n]),se.useLayoutEffect(()=>{if(a){const O=e.useContainerWidth||bt(e.width)&&e.width>0;R({width:O?y:"100%",height:f})}else R({width:v||"100%",height:h})},[a]),{minHeight:s,maxHeight:f,minWidth:m,maxWidth:y,rowHeight:l,resizableSize:b,setResizableSize:R}}const Iy=600,Ty="⚠️ Please fill out this cell.";function Dy(e,t,n=[]){const[r,i]=se.useState(),o=se.useRef(null),a=se.useCallback(s=>{if(clearTimeout(o.current),o.current=0,i(void 0),(s.kind==="header"||s.kind==="cell")&&s.location){const u=s.location[0],c=s.location[1];let d;if(u<0||u>=e.length||n.includes(c))return;const f=e[u];if(s.kind==="header"&&bt(f))d=f.help;else if(s.kind==="cell"){const h=t([u,c]);di(h)?d=h.errorDetails:f.isRequired&&f.isEditable&&va(h)?d=Ty:$v(h)&&(d=h.tooltip)}d&&(o.current=setTimeout(()=>{d&&i({content:d,left:s.bounds.x+s.bounds.width/2,top:s.bounds.y})},Iy))}},[e,t,i,o,n]),l=se.useCallback(()=>{i(void 0)},[i]);return{tooltip:r,clearTooltip:l,onItemHovered:a}}function Oy({top:e,left:t,content:n,clearTooltip:r}){const[i,o]=se.useState(!0),a=ma(),{colors:l,fontSizes:s,radii:u,fontWeights:c}=a,d=se.useCallback(()=>{o(!1),r()},[r,o]);return Kt(xc,{content:Kt(Wh,{"data-testid":"stDataFrameTooltipContent",children:Kt(Uh,{style:{fontSize:s.sm},source:n,allowHTML:!1})}),placement:Cc.top,accessibilityType:yc.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:Sc(a)?l.bgColor:l.secondaryBg,color:l.bodyText,fontSize:s.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:i,children:Kt("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const gc=150,Py=15e4,mc=6;function _y({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:i,fragmentId:o}){const{expanded:a,expand:l,collapse:s,width:u,height:c}=jh(Kh),d=se.useRef(null),f=se.useRef(null),h=se.useRef(null),m=py(),{getRowThemeOverride:p,onItemHovered:v}=My(m),{libConfig:{enforceDownloadInNewTab:y=!1}}=se.useContext(qh),[b,R]=se.useState(!0),[O,S]=se.useState(!1),[M,_]=se.useState(!1),[E,x]=se.useState(!1),[L,D]=se.useState(),C=se.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]),I=se.useMemo(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome"),[]);nt(e.editingMode)&&(e.editingMode=Bn.EditingMode.READ_ONLY);const{READ_ONLY:T,DYNAMIC:k}=Bn.EditingMode,z=t.dimensions,N=Math.max(0,z.numDataRows),U=N===0&&!(e.editingMode===k&&z.numDataColumns>0),oe=N>Py,ee=!oe&&!U&&e.editingMode!==k,G=!U&&e.editingMode===k&&!n,te=se.useRef(new Bo(N)),[ie,ue]=se.useState(te.current.getNumRows());se.useEffect(()=>{te.current=new Bo(N),ue(te.current.getNumRows())},[N]);const ge=se.useCallback(()=>{te.current=new Bo(N),ue(te.current.getNumRows())},[N]),[J,H]=se.useState(e.columnOrder),{columns:P,setColumnConfigMapping:q}=f1(e,t,n,J);se.useEffect(()=>{if(e.editingMode===T)return;const de=r.getStringValue({id:e.id,formId:e.formId});de&&(te.current.fromJson(de,P),ue(te.current.getNumRows()))},[]);const{getCellContent:he}=ky(t,P,ie,te),{columns:me,sortColumn:Ve,getOriginalIndex:ve,getCellContent:Xe}=C1(N,P,he),Me=se.useCallback(de=>{const Ne={selection:{rows:[],columns:[]}};Ne.selection.rows=de.rows.toArray().map(on=>ve(on)),Ne.selection.columns=de.columns.toArray().map(on=>Zi(me[on]));const Gt=JSON.stringify(Ne),xn=r.getStringValue({id:e.id,formId:e.formId});(xn===void 0||xn!==Gt)&&r.setStringValue({id:e.id,formId:e.formId},Gt,{fromUi:!0},o)},[me,e.id,e.formId,r,o,ve]),{debouncedCallback:Ot}=Du(Me,gc),{gridSelection:kt,isRowSelectionActivated:et,isMultiRowSelectionActivated:le,isColumnSelectionActivated:Ge,isMultiColumnSelectionActivated:we,isRowSelected:ce,isColumnSelected:be,isCellSelected:$e,clearSelection:Oe,processSelectionChange:rt}=Ry(e,U,n,me,Ot);se.useEffect(()=>{Oe(!0,!0)},[a]);const pe=se.useCallback(de=>{var Ne;(Ne=f.current)==null||Ne.updateCells(de)},[]);se.useEffect(()=>{var Ne,Gt,xn,on;if(!et&&!Ge)return;const de=r.getStringValue({id:e.id,formId:e.formId});if(de){const V=me.map(an=>Zi(an)),Ke=JSON.parse(de);let ze=vt.empty(),Dt=vt.empty();(Gt=(Ne=Ke.selection)==null?void 0:Ne.rows)==null||Gt.forEach(an=>{ze=ze.add(an)}),(on=(xn=Ke.selection)==null?void 0:xn.columns)==null||on.forEach(an=>{Dt=Dt.add(V.indexOf(an))}),(ze.length>0||Dt.length>0)&&rt({rows:ze,columns:Dt,current:void 0})}},[]);const Ee=se.useCallback(()=>{ie!==te.current.getNumRows()&&ue(te.current.getNumRows())},[ie]),lt=se.useCallback(()=>{const de=te.current.toJson(me);let Ne=r.getStringValue({id:e.id,formId:e.formId});Ne===void 0&&(Ne=new Bo(0).toJson([])),de!==Ne&&r.setStringValue({id:e.id,formId:e.formId},de,{fromUi:!0},o)},[me,e.id,e.formId,r,o]),{debouncedCallback:Ae}=Du(lt,gc),{exportToCsv:it}=xy(Xe,me,ie,y),{onCellEdited:pt,onPaste:ht,onRowAppended:He,onDelete:It,validateCell:Ut}=by(me,e.editingMode!==k,te,Xe,ve,pe,Ee,Ae,Oe),{tooltip:mt,clearTooltip:Mt,onItemHovered:Xt}=Dy(me,Xe,G?[ie]:[]),{drawCell:_t,customRenderers:Cn}=my(me),Ht=g.useCallback(de=>({...de,hasMenu:!U}),[U]),Rt=se.useMemo(()=>me.map(de=>Ht(xs(de))),[me,Ht]),{columns:Sn,onColumnResize:vn}=m1(Rt),Pe=t.dimensions.numHeaderRows>1,{minHeight:Lt,maxHeight:cn,minWidth:hn,maxWidth:gn,rowHeight:ot,resizableSize:zt,setResizableSize:Pt}=Ey(e,m,ie,Pe,u||0,c,a),tn=se.useCallback(([de,Ne])=>({...Nv(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:m.glideTheme.textLight},span:[0,Math.max(me.length-1,0)]}),[me,m.glideTheme.textLight]),Tt=se.useCallback(()=>{ge(),Oe()},[ge,Oe]);Xh({element:e,widgetMgr:r,onFormCleared:Tt});const{pinColumn:Ft,unpinColumn:je,freezeColumns:Vt}=h1(me,U,u||0,m.minColumnWidth,Oe,q),{onColumnMoved:$t}=g1(me,Vt,Ft,je,H);return se.useEffect(()=>{setTimeout(()=>{var de,Ne;if(h.current&&f.current){const Gt=(Ne=(de=h.current)==null?void 0:de.querySelector(".dvn-stack"))==null?void 0:Ne.getBoundingClientRect();Gt&&(_(Gt.height>h.current.clientHeight),x(Gt.width>h.current.clientWidth))}},1)},[zt,ie,Sn]),Ir(Ou,{className:"stDataFrame","data-testid":"stDataFrame",hasCustomizedScrollbars:I,ref:h,onMouseDown:de=>{if(h.current&&I){const Ne=h.current.getBoundingClientRect();E&&Ne.height-(mc+1)<de.clientY-Ne.top&&de.stopPropagation(),M&&Ne.width-(mc+1)<de.clientX-Ne.left&&de.stopPropagation()}},onBlur:de=>{!b&&!C&&!de.currentTarget.contains(de.relatedTarget)&&Oe(!0,!0)},children:[Ir(Zh,{isFullScreen:a,disableFullscreenMode:i,locked:ce&&!et||$e||C&&b,onExpand:l,onCollapse:s,target:Ou,children:[(et&&ce||Ge&&be)&&Kt(Di,{label:"Clear selection",icon:tg,onClick:()=>{Oe(),Mt()}}),G&&ce&&Kt(Di,{label:"Delete row(s)",icon:ag,onClick:()=>{It&&(It(kt),Mt())}}),G&&!ce&&Kt(Di,{label:"Add row",icon:Oc,onClick:()=>{var de;He&&(R(!0),He(),Mt(),(de=f.current)==null||de.scrollTo(0,ie,"vertical"))}}),!oe&&!U&&Kt(Di,{label:"Download as CSV",icon:sg,onClick:()=>it()}),!U&&Kt(Di,{label:"Search",icon:Pc,onClick:()=>{O?S(!1):(R(!0),S(!0)),Mt()}})]}),Kt(Yh,{"data-testid":"stDataFrameResizable",ref:d,defaultSize:zt,style:{border:`${m.tableBorderWidth}px solid ${m.glideTheme.borderColor}`,borderRadius:`${m.tableBorderRadius}`},minHeight:Lt,maxHeight:cn,minWidth:hn,maxWidth:gn,size:zt,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,ot],snapGap:ot/3,onResizeStop:(de,Ne,Gt,xn)=>{if(d.current){const on=2*m.tableBorderWidth;Pt({width:d.current.size.width,height:cn-d.current.size.height===on?d.current.size.height+on:d.current.size.height})}},children:Kt(Tv,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:f,columns:Sn,rows:U?1:ie,minColumnWidth:m.minColumnWidth,maxColumnWidth:m.maxColumnWidth,maxColumnAutoWidth:m.maxColumnAutoWidth,rowHeight:ot,headerHeight:m.defaultHeaderHeight,getCellContent:U?tn:Xe,onColumnResize:C?void 0:vn,resizeIndicator:"header",freezeColumns:Vt,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:C?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:Ge?void 0:$t,onItemHovered:de=>{v==null||v(de),Xt==null||Xt(de)},keybindings:{downFill:!0},onKeyDown:de=>{(de.ctrlKey||de.metaKey)&&de.key==="f"&&(S(Ne=>!Ne),de.stopPropagation(),de.preventDefault())},showSearch:O,onSearchClose:()=>{S(!1),Mt()},onHeaderClicked:(de,Ne)=>{!ee||Ge||(et&&ce?Oe():Oe(!0,!0),Ve(de,"auto"))},gridSelection:kt,onGridSelectionChange:de=>{(b||C)&&(rt(de),mt!==void 0&&Mt())},theme:m.glideTheme,getRowThemeOverride:p,onMouseMove:de=>{de.kind==="out-of-bounds"&&b?R(!1):de.kind!=="out-of-bounds"&&!b&&R(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...I&&{paddingBottom:E?-6:void 0,paddingRight:M?-6:void 0}},drawCell:_t,customRenderers:Cn,imageEditorOverride:jv,headerIcons:m.headerIcons,validateCell:Ut,onHeaderMenuClick:(de,Ne)=>{D({columnIdx:de,headerBounds:Ne})},onPaste:!1,...et&&{rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader}},rowSelectionMode:le?"multi":"auto",rowSelect:n?"none":le?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...Ge&&{columnSelect:n?"none":we?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!U&&e.editingMode!==T&&!n&&{fillHandle:!C,onCellEdited:pt,onPaste:ht,onDelete:It},...!U&&e.editingMode===k&&{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:He,onHeaderClicked:void 0}})}),mt&&mt.content&&Kt(Oy,{top:mt.top,left:mt.left,content:mt.content,clearTooltip:Mt}),L&&Tc.createPortal(Kt(_v,{top:L.headerBounds.y+L.headerBounds.height,left:L.headerBounds.x+L.headerBounds.width,onCloseMenu:()=>D(void 0),onSortColumn:ee?de=>{Oe(!0,!0),Ve(L.columnIdx,de,!0)}:void 0,isColumnPinned:P[L.columnIdx].isPinned,onUnpinColumn:()=>{je(P[L.columnIdx].id)},onPinColumn:()=>{Ft(P[L.columnIdx].id)}}),document.querySelector("#portal"))]})}const Ly=g.memo(Gh(_y)),Xy=Object.freeze(Object.defineProperty({__proto__:null,default:Ly},Symbol.toStringTag,{value:"Module"}));export{s0 as C,fd as T,li as a,hg as b,Xy as c,ai as i,Dm as m,fn as s};