streamlit 1.48.0__py3-none-any.whl → 1.48.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. streamlit/elements/iframe.py +13 -22
  2. streamlit/proto/IFrame_pb2.py +8 -2
  3. streamlit/proto/IFrame_pb2.pyi +3 -0
  4. streamlit/static/index.html +1 -1
  5. streamlit/static/manifest.json +214 -214
  6. streamlit/static/static/js/{ErrorOutline.esm.D_4oFNKB.js → ErrorOutline.esm.DjObtx4K.js} +1 -1
  7. streamlit/static/static/js/{FileDownload.esm.NPgaLlUE.js → FileDownload.esm.Bz9nxNC5.js} +1 -1
  8. streamlit/static/static/js/{FileHelper.B2t9ikoS.js → FileHelper.BrQvUXVD.js} +1 -1
  9. streamlit/static/static/js/{FormClearHelper.BLEIUk6L.js → FormClearHelper.DF4gFAOO.js} +1 -1
  10. streamlit/static/static/js/{Hooks.BGm9sd4U.js → Hooks.DEoLCfOE.js} +1 -1
  11. streamlit/static/static/js/{InputInstructions.DtUxCBS8.js → InputInstructions.D8zoMog9.js} +1 -1
  12. streamlit/static/static/js/{Particles.BDRPO7r3.js → Particles.CCFySwdL.js} +1 -1
  13. streamlit/static/static/js/{ProgressBar.B64DUUqp.js → ProgressBar.COK9j1l0.js} +1 -1
  14. streamlit/static/static/js/{Toolbar.B3FquPk5.js → Toolbar.Dt4jIKlY.js} +1 -1
  15. streamlit/static/static/js/{base-input.DeBqm5mN.js → base-input.BmvSaPd2.js} +1 -1
  16. streamlit/static/static/js/{checkbox.C0odQfKb.js → checkbox.Cgxgc0et.js} +1 -1
  17. streamlit/static/static/js/{createSuper.DqQ5L3XG.js → createSuper.siQeagI2.js} +1 -1
  18. streamlit/static/static/js/{data-grid-overlay-editor.DbNsQa8Y.js → data-grid-overlay-editor.Ct51iCb_.js} +1 -1
  19. streamlit/static/static/js/{downloader.Bx1D0jhz.js → downloader.M6jQeNDf.js} +1 -1
  20. streamlit/static/static/js/{es6.CbPK4m0H.js → es6.CMaUdEZ5.js} +2 -2
  21. streamlit/static/static/js/{iframeResizer.contentWindow.CfLKrptA.js → iframeResizer.contentWindow.C33BryyP.js} +1 -1
  22. streamlit/static/static/js/{index.B9vzGbOt.js → index.8GJD0eeD.js} +1 -1
  23. streamlit/static/static/js/{index.9E7bRUBU.js → index.8QEYHMQD.js} +1 -1
  24. streamlit/static/static/js/{index.CjImmcsV.js → index.Ay41Wnu9.js} +1 -1
  25. streamlit/static/static/js/{index.CgUt3tz_.js → index.BLiKiJ7_.js} +1 -1
  26. streamlit/static/static/js/{index.CwAuytgV.js → index.BT78cJmU.js} +1 -1
  27. streamlit/static/static/js/{index.PyIqRRSR.js → index.BXDq9dj4.js} +1 -1
  28. streamlit/static/static/js/index.BdGvnhlM.js +1 -0
  29. streamlit/static/static/js/{index.CNNlC1NL.js → index.BfasrT0d.js} +1 -1
  30. streamlit/static/static/js/{index.CJzdLAun.js → index.CCdtFMFG.js} +1 -1
  31. streamlit/static/static/js/{index.D7GB-kly.js → index.CFRGZDz1.js} +1 -1
  32. streamlit/static/static/js/{index.Cb0xSF7V.js → index.CFSFYiPA.js} +1 -1
  33. streamlit/static/static/js/{index.DwaoC4Zp.js → index.CbdWnLqS.js} +1 -1
  34. streamlit/static/static/js/{index.CtiKsjSC.js → index.CeiIiXap.js} +1 -1
  35. streamlit/static/static/js/{index.ClRTsv8m.js → index.CgZDfhN4.js} +1 -1
  36. streamlit/static/static/js/{index.DCpyIFTV.js → index.Cqa4gqqN.js} +1 -1
  37. streamlit/static/static/js/{index.CZnagxXD.js → index.CzX2xpyc.js} +1 -1
  38. streamlit/static/static/js/{index.HeVbRh9H.js → index.D1EayrNh.js} +1 -1
  39. streamlit/static/static/js/{index.CO1sClzJ.js → index.D1ErX5go.js} +1 -1
  40. streamlit/static/static/js/{index.CnfWsQzS.js → index.D1jHqUJq.js} +1 -1
  41. streamlit/static/static/js/{index.DjMjyJl9.js → index.D5gweoL5.js} +1 -1
  42. streamlit/static/static/js/{index.BPsoiGgP.js → index.DByVKZgq.js} +1 -1
  43. streamlit/static/static/js/{index.mRztGO69.js → index.DEND45D1.js} +1 -1
  44. streamlit/static/static/js/{index.DvRPFfw6.js → index.DKN5MVff.js} +3 -3
  45. streamlit/static/static/js/{index.6s0nVIis.js → index.DfoxW1gP.js} +1 -1
  46. streamlit/static/static/js/{index.dfivzJNz.js → index.Dtf1Ac0x.js} +1 -1
  47. streamlit/static/static/js/{index.CrJ1XD_V.js → index.DxrLhpeO.js} +1 -1
  48. streamlit/static/static/js/{index.DRTn9zvD.js → index.J7o-_HIh.js} +1 -1
  49. streamlit/static/static/js/{index.J2D_m7LY.js → index.LU8juINp.js} +5 -5
  50. streamlit/static/static/js/{index.DE9wNOje.js → index.L_N2iylt.js} +1 -1
  51. streamlit/static/static/js/{index.4lI9TuZm.js → index.PZUX2kRz.js} +1 -1
  52. streamlit/static/static/js/{index.BDrQKMCm.js → index.ROjU6K0k.js} +1 -1
  53. streamlit/static/static/js/{index.B9PgeLrZ.js → index.WSNLkF94.js} +1 -1
  54. streamlit/static/static/js/{index.F9tSej94.js → index.X5W3gJLn.js} +1 -1
  55. streamlit/static/static/js/{index.DA5wU0mQ.js → index.k9LYqfSL.js} +1 -1
  56. streamlit/static/static/js/{index.0XDwe9RV.js → index.pnHtHv_c.js} +1 -1
  57. streamlit/static/static/js/{index.tB1kn_7z.js → index.tPUXqsfW.js} +1 -1
  58. streamlit/static/static/js/{index.wDYef4mQ.js → index.tsvTLdio.js} +1 -1
  59. streamlit/static/static/js/{input.BL2buuce.js → input.DZd6EQlV.js} +1 -1
  60. streamlit/static/static/js/{memory.CUxjUWS7.js → memory.ptkfuI71.js} +1 -1
  61. streamlit/static/static/js/{mergeWith.C1kp1zIi.js → mergeWith.GRNk8iwv.js} +1 -1
  62. streamlit/static/static/js/{number-overlay-editor.WpheGpmR.js → number-overlay-editor.DXS2qb1U.js} +1 -1
  63. streamlit/static/static/js/{possibleConstructorReturn.DbvQboK3.js → possibleConstructorReturn.Bd4ImlQ9.js} +1 -1
  64. streamlit/static/static/js/{sandbox.6lnFVWhX.js → sandbox.DsH8LuID.js} +1 -1
  65. streamlit/static/static/js/{timepicker.Bg4xAK95.js → timepicker.QVekV78C.js} +1 -1
  66. streamlit/static/static/js/{toConsumableArray.D9x7Ktv4.js → toConsumableArray.BJvaP8gb.js} +1 -1
  67. streamlit/static/static/js/{uniqueId.Bm8FHN92.js → uniqueId.D_5M8Dgf.js} +1 -1
  68. streamlit/static/static/js/{useBasicWidgetState.CUSYQZpm.js → useBasicWidgetState.DB3vMS9V.js} +1 -1
  69. streamlit/static/static/js/{useTextInputAutoExpand.Bf2egQOG.js → useTextInputAutoExpand.CBkGkaRt.js} +2 -2
  70. streamlit/static/static/js/{useUpdateUiValue.lE5xnYWF.js → useUpdateUiValue.C7ZKpLQK.js} +1 -1
  71. streamlit/static/static/js/{withFullScreenWrapper.CCOXR7N6.js → withFullScreenWrapper.C-gXt0Rl.js} +1 -1
  72. streamlit/user_info.py +13 -12
  73. streamlit/web/server/oauth_authlib_routes.py +3 -59
  74. {streamlit-1.48.0.dist-info → streamlit-1.48.1.dist-info}/METADATA +1 -1
  75. {streamlit-1.48.0.dist-info → streamlit-1.48.1.dist-info}/RECORD +79 -79
  76. streamlit/static/static/js/index.DHnB-C8A.js +0 -1
  77. {streamlit-1.48.0.data → streamlit-1.48.1.data}/scripts/streamlit.cmd +0 -0
  78. {streamlit-1.48.0.dist-info → streamlit-1.48.1.dist-info}/WHEEL +0 -0
  79. {streamlit-1.48.0.dist-info → streamlit-1.48.1.dist-info}/entry_points.txt +0 -0
  80. {streamlit-1.48.0.dist-info → streamlit-1.48.1.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.DbNsQa8Y.js","./index.DvRPFfw6.js","../css/index.CJVRHjQZ.css","./withFullScreenWrapper.CCOXR7N6.js","./Toolbar.B3FquPk5.js","./FormClearHelper.BLEIUk6L.js","./mergeWith.C1kp1zIi.js","./sprintf.D7DtBTRn.js","./checkbox.C0odQfKb.js","./createDownloadLinkElement.ZaXNnPK4.js","./toConsumableArray.D9x7Ktv4.js","./possibleConstructorReturn.DbvQboK3.js","./createSuper.DqQ5L3XG.js","./FileDownload.esm.NPgaLlUE.js","./number-overlay-editor.WpheGpmR.js","./es6.CbPK4m0H.js"])))=>i.map(i=>d[i]);
2
- import{r as f,E as Ls,_ as Ne,d as fh,g as lr,i as Ua,e as uo,f as hh,h as gh,m as mh,n as Tc,o as Dc,R as Vt,p as ph,q as Oc,t as vh,v as bh,w as wh,x as yh,y as Ch,z as Sh,c as kr,A as As,B as xh,C as kh,D as He,G as Pc,H as lt,I as Yi,J as $r,K as qa,j as Ue,M as Mh,N as Rh,s as Un,O as Ih,Q as Ol,S as Eh,T as Th,U as Dh,V as Oh,W as _c,X as Ph,Y as _h,Z as Cs,$ as Fc,a0 as Lc,a1 as Fh,a2 as Lh,a3 as Ah,a4 as Hh,a5 as zh,a6 as Vh,a7 as $h,a8 as Nh,a9 as Bh,aa as Ac,ab as Wh,ac as Uh,ad as qh,ae as Gh,af as Xh,ag as Yh,ah as jh,ai as Kh,aj as Zh,ak as Jh,al as Qh,am as eg,an as tg,ao as ng,ap as Wr,aq as an,ar as wn,l as pa,as as ji,at as ur,au as _e,av as rg,b as Hc,aw as zc,k as ig,ax as ui,ay as og,az as ag,aA as Ga,F as Vc,aB as va,aC as $c,aD as ba,aE as vn,aF as Bn,aG as wa,aH as Nc,aI as sg,aJ as lg,aK as Pl,aL as ug,aM as cg,L as dg,aN as fg}from"./index.DvRPFfw6.js";import{w as hg,E as gg}from"./withFullScreenWrapper.CCOXR7N6.js";import{T as mg,a as si}from"./Toolbar.B3FquPk5.js";import{u as pg}from"./FormClearHelper.BLEIUk6L.js";import{m as vg}from"./mergeWith.C1kp1zIi.js";import{s as bg}from"./sprintf.D7DtBTRn.js";import{L as wg,S as yg,a as Cg}from"./checkbox.C0odQfKb.js";import{c as Sg}from"./createDownloadLinkElement.ZaXNnPK4.js";import{_ as or,a as Hs,C as xg}from"./toConsumableArray.D9x7Ktv4.js";import{_ as kg,a as Mg,b as Rg}from"./possibleConstructorReturn.DbvQboK3.js";import{_ as Ig}from"./createSuper.DqQ5L3XG.js";import{D as Eg,F as Tg}from"./FileDownload.esm.NPgaLlUE.js";var Bc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ls,Ne({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Bc.displayName="Add";var Wc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ls,Ne({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});Wc.displayName="Search";var Uc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ls,Ne({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M12 6a9.77 9.77 0 018.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0112 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 010 5 2.5 2.5 0 010-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}))});Uc.displayName="Visibility";var Xa,_l;function Dg(){if(_l)return Xa;_l=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return Xa=n,Xa}var Ya,Fl;function Og(){if(Fl)return Ya;Fl=1;var e=Dg(),t=fh();function n(r,i){return r!=null&&t(r,i,e)}return Ya=n,Ya}var Pg=Og();const _g=lr(Pg);function qc(e="This should not happen"){throw new Error(e)}function Dn(e,t="Assertion failed"){if(!e)return qc(t)}function no(e,t){return qc(t??"Hell froze over")}function Fg(e,t){try{return e()}catch{return t}}const Ll=Object.prototype.hasOwnProperty;function vi(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--&&vi(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Ll.call(e,n)&&++r&&!Ll.call(t,n)||!(n in t)||!vi(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const ta=null,zs=void 0;var J;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(J||(J={}));var Al;(function(e){e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay"})(Al||(Al={}));var na;(function(e){e.Triangle="triangle",e.Dots="dots"})(na||(na={}));function Fo(e){return"width"in e&&typeof e.width=="number"}async function Hl(e){return typeof e=="object"?e:await e()}function ci(e){return!(e.kind===J.Loading||e.kind===J.Bubble||e.kind===J.RowID||e.kind===J.Protected||e.kind===J.Drilldown)}function hi(e){return e.kind===Hn.Marker||e.kind===Hn.NewRow}function di(e){if(!ci(e)||e.kind===J.Image)return!1;switch(e.kind){case J.Text:case J.Number:case J.Markdown:case J.Uri:case J.Custom:case J.Boolean:return e.readonly!==!0;default:no(e,"A cell was passed with an invalid kind")}}function Lg(e){return _g(e,"editor")}function Vs(e){return!(e.readonly??!1)}var Hn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Hn||(Hn={}));function Ag(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,i){return r[0]-i[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const i=n[n.length-1];i[1]<r[0]?n.push([...r]):i[1]<r[1]&&(i[1]=r[1])}return n}let zl;class ot{items;constructor(t){this.items=t}static empty=()=>zl??(zl=new ot([]));static fromSingleSelection=t=>ot.empty().add(t);offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new ot(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Ag([...this.items,n]);return new ot(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],i=typeof t=="number"?t+1:t[1];for(const[o,s]of n.entries()){const[a,l]=s;if(a<=i&&r<=l){const u=[];a<r&&u.push([a,r]),i<l&&u.push([i,l]),n.splice(o,1,...u)}}return new ot(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,i]=this.items[n];if(t>=r&&t<i)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],i=this.items[n];if(r[0]!==i[0]||r[1]!==i[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let i=n;i<r;i++)t.push(i);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}}var Hg=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,l]=a.split("_");n[l]=a}else r.push(a)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},Vl=Hg,zg=e=>e.toUpperCase()===e,Vg=e=>t=>e.indexOf(t)===-1,Gc=(e,t)=>{const n={};return Object.keys(e).filter(Vg(t)).forEach(r=>{n[r]=e[r]}),n};function $g(e,t,n){const r=Gc(t,n);if(!e){const i=typeof Ua=="function"?{default:Ua}:Ua;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var Ng=(e,t)=>{};function Bg(e){let t="";return n=>{const r=(o,s)=>{const{as:a=e,class:l=t}=o,u=n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&!zg(a[0])):n.propsAsIs,c=$g(u,o,["as","class"]);c.ref=s,c.className=n.atomic?Vl(n.class,c.className||l):Vl(c.className||l,n.class);const{vars:d}=n;if(d){const g={};for(const p in d){const v=d[p],w=v[0],b=v[1]||"",x=typeof w=="function"?w(o):w;Ng(x,n.name),g[`--${p}`]=`${x}${b}`}const h=c.style||{},m=Object.keys(h);m.length>0&&m.forEach(p=>{g[p]=h[p]}),c.style=g}return e.__wyw_meta&&e!==a?(c.as=a,f.createElement(e,c)):f.createElement(a,c)},i=f.forwardRef?f.forwardRef(r):o=>{const s=Gc(o,["innerRef"]);return r(s,o.innerRef)};return i.displayName=n.name,i.__wyw_meta={className:n.class||t,extends:e},i}}var un=Bg;const Wg=un("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var ja={},Ai={},Lo={},Ao={},$l;function Ug(){return $l||($l=1,function(e){(function(t,n){n(e,uo(),hh())})(Ao,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var i=s(n),o=s(r);function s(b){return b&&b.__esModule?b:{default:b}}var a=Object.assign||function(b){for(var x=1;x<arguments.length;x++){var O=arguments[x];for(var R in O)Object.prototype.hasOwnProperty.call(O,R)&&(b[R]=O[R])}return b};function l(b,x){var O={};for(var R in b)x.indexOf(R)>=0||Object.prototype.hasOwnProperty.call(b,R)&&(O[R]=b[R]);return O}function u(b,x){if(!(b instanceof x))throw new TypeError("Cannot call a class as a function")}var c=function(){function b(x,O){for(var R=0;R<O.length;R++){var M=O[R];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(x,M.key,M)}}return function(x,O,R){return O&&b(x.prototype,O),R&&b(x,R),x}}();function d(b,x){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:b}function g(b,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);b.prototype=Object.create(x&&x.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(b,x):b.__proto__=x)}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 x=b.touches[0],O=x.pageX,R=x.pageY;return{x:O,y:R}}var M=b.screenX,_=b.screenY;return{x:M,y:_}}var w=function(b){g(x,b);function x(){var O;u(this,x);for(var R=arguments.length,M=Array(R),_=0;_<R;_++)M[_]=arguments[_];var I=d(this,(O=x.__proto__||Object.getPrototypeOf(x)).call.apply(O,[this].concat(M)));return I._handleSwipeStart=I._handleSwipeStart.bind(I),I._handleSwipeMove=I._handleSwipeMove.bind(I),I._handleSwipeEnd=I._handleSwipeEnd.bind(I),I._onMouseDown=I._onMouseDown.bind(I),I._onMouseMove=I._onMouseMove.bind(I),I._onMouseUp=I._onMouseUp.bind(I),I._setSwiperRef=I._setSwiperRef.bind(I),I}return c(x,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(R){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(R))}},{key:"_onMouseMove",value:function(R){this.mouseDown&&this._handleSwipeMove(R)}},{key:"_onMouseUp",value:function(R){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(R)}},{key:"_handleSwipeStart",value:function(R){var M=v(R),_=M.x,I=M.y;this.moveStart={x:_,y:I},this.props.onSwipeStart(R)}},{key:"_handleSwipeMove",value:function(R){if(this.moveStart){var M=v(R),_=M.x,I=M.y,k=_-this.moveStart.x,A=I-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x:k,y:A},R);D&&R.cancelable&&R.preventDefault(),this.movePosition={deltaX:k,deltaY:A}}}},{key:"_handleSwipeEnd",value:function(R){this.props.onSwipeEnd(R);var M=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-M?this.props.onSwipeLeft(1,R):this.movePosition.deltaX>M&&this.props.onSwipeRight(1,R),this.movePosition.deltaY<-M?this.props.onSwipeUp(1,R):this.movePosition.deltaY>M&&this.props.onSwipeDown(1,R)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(R){this.swiper=R,this.props.innerRef(R)}},{key:"render",value:function(){var R=this.props;R.tagName;var M=R.className,_=R.style,I=R.children;R.allowMouseEvents,R.onSwipeUp,R.onSwipeDown,R.onSwipeLeft,R.onSwipeRight,R.onSwipeStart,R.onSwipeMove,R.onSwipeEnd,R.innerRef,R.tolerance;var k=l(R,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,a({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:M,style:_},k),I)}}]),x}(n.Component);w.displayName="ReactSwipe",w.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},w.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=w})}(Ao)),Ao}var Nl;function Xc(){return Nl||(Nl=1,function(e){(function(t,n){n(e,Ug())})(Lo,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})}(Lo)),Lo}var Hi={},Bl;function Yc(){if(Bl)return Hi;Bl=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.default=void 0;var e=t(gh());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,s){return o in i?Object.defineProperty(i,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[o]=s,i}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,s){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":s==="horizontal","axis-vertical":s!=="horizontal"})},SLIDER:function(o,s){return(0,e.default)({thumbs:!o,slider:o,animated:!s})},ITEM:function(o,s,a){return(0,e.default)({thumb:!o,slide:o,selected:s,previous:a})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return Hi.default=r,Hi}var zi={},Vi={},Wl;function qg(){if(Wl)return Vi;Wl=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return Vi.outerWidth=e,Vi}var $i={},Ul;function $s(){if(Ul)return $i;Ul=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,s=i==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",l="("+s.join(",")+")";return a+l};return $i.default=e,$i}var Ni={},ql;function jc(){if(ql)return Ni;ql=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.default=void 0;var e=function(){return window};return Ni.default=e,Ni}var Gl;function Kc(){if(Gl)return zi;Gl=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.default=void 0;var e=l(uo()),t=s(Yc()),n=qg(),r=s($s()),i=s(Xc()),o=s(jc());function s(I){return I&&I.__esModule?I:{default:I}}function a(){if(typeof WeakMap!="function")return null;var I=new WeakMap;return a=function(){return I},I}function l(I){if(I&&I.__esModule)return I;if(I===null||u(I)!=="object"&&typeof I!="function")return{default:I};var k=a();if(k&&k.has(I))return k.get(I);var A={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in I)if(Object.prototype.hasOwnProperty.call(I,C)){var E=D?Object.getOwnPropertyDescriptor(I,C):null;E&&(E.get||E.set)?Object.defineProperty(A,C,E):A[C]=I[C]}return A.default=I,k&&k.set(I,A),A}function u(I){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(A){return typeof A}:u=function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},u(I)}function c(){return c=Object.assign||function(I){for(var k=1;k<arguments.length;k++){var A=arguments[k];for(var D in A)Object.prototype.hasOwnProperty.call(A,D)&&(I[D]=A[D])}return I},c.apply(this,arguments)}function d(I,k){if(!(I instanceof k))throw new TypeError("Cannot call a class as a function")}function g(I,k){for(var A=0;A<k.length;A++){var D=k[A];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(I,D.key,D)}}function h(I,k,A){return k&&g(I.prototype,k),I}function m(I,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(k&&k.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),k&&p(I,k)}function p(I,k){return p=Object.setPrototypeOf||function(D,C){return D.__proto__=C,D},p(I,k)}function v(I){var k=x();return function(){var D=O(I),C;if(k){var E=O(this).constructor;C=Reflect.construct(D,arguments,E)}else C=D.apply(this,arguments);return w(this,C)}}function w(I,k){return k&&(u(k)==="object"||typeof k=="function")?k:b(I)}function b(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}function x(){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(I){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)},O(I)}function R(I,k,A){return k in I?Object.defineProperty(I,k,{value:A,enumerable:!0,configurable:!0,writable:!0}):I[k]=A,I}var M=function(k){return k.hasOwnProperty("key")},_=function(I){m(A,I);var k=v(A);function A(D){var C;return d(this,A),C=k.call(this,D),R(b(C),"itemsWrapperRef",void 0),R(b(C),"itemsListRef",void 0),R(b(C),"thumbsRef",void 0),R(b(C),"setItemsWrapperRef",function(E){C.itemsWrapperRef=E}),R(b(C),"setItemsListRef",function(E){C.itemsListRef=E}),R(b(C),"setThumbsRef",function(E,T){C.thumbsRef||(C.thumbsRef=[]),C.thumbsRef[T]=E}),R(b(C),"updateSizes",function(){if(!(!C.props.children||!C.itemsWrapperRef||!C.thumbsRef)){var E=e.Children.count(C.props.children),T=C.itemsWrapperRef.clientWidth,S=C.props.thumbWidth?C.props.thumbWidth:(0,n.outerWidth)(C.thumbsRef[0]),B=Math.floor(T/S),X=B<E,Y=X?E-B:0;C.setState(function(ae,Q){return{itemSize:S,visibleItems:B,firstItem:X?C.getFirstItem(Q.selectedItem):0,lastPosition:Y,showArrows:X}})}}),R(b(C),"handleClickItem",function(E,T,S){if(!M(S)||S.key==="Enter"){var B=C.props.onSelectItem;typeof B=="function"&&B(E,T)}}),R(b(C),"onSwipeStart",function(){C.setState({swiping:!0})}),R(b(C),"onSwipeEnd",function(){C.setState({swiping:!1})}),R(b(C),"onSwipeMove",function(E){var T=E.x;if(!C.state.itemSize||!C.itemsWrapperRef||!C.state.visibleItems)return!1;var S=0,B=e.Children.count(C.props.children),X=-(C.state.firstItem*100)/C.state.visibleItems,Y=Math.max(B-C.state.visibleItems,0),ae=-Y*100/C.state.visibleItems;X===S&&T>0&&(T=0),X===ae&&T<0&&(T=0);var Q=C.itemsWrapperRef.clientWidth,ee=X+100/(Q/T);return C.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(re){C.itemsListRef.style[re]=(0,r.default)(ee,"%",C.props.axis)}),!0}),R(b(C),"slideRight",function(E){C.moveTo(C.state.firstItem-(typeof E=="number"?E:1))}),R(b(C),"slideLeft",function(E){C.moveTo(C.state.firstItem+(typeof E=="number"?E:1))}),R(b(C),"moveTo",function(E){E=E<0?0:E,E=E>=C.state.lastPosition?C.state.lastPosition:E,C.setState({firstItem:E})}),C.state={selectedItem:D.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},C}return h(A,[{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 E=C;return C>=this.state.lastPosition&&(E=this.state.lastPosition),C<this.state.firstItem+this.state.visibleItems&&(E=this.state.firstItem),C<this.state.firstItem&&(E=C),E}},{key:"renderItems",value:function(){var C=this;return this.props.children.map(function(E,T){var S=t.default.ITEM(!1,T===C.state.selectedItem),B={key:T,ref:function(Y){return C.setThumbsRef(Y,T)},className:S,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({},B,{role:"button",tabIndex:0}),E)})}},{key:"render",value:function(){var C=this;if(!this.props.children)return null;var E=e.Children.count(this.props.children)>1,T=this.state.showArrows&&this.state.firstItem>0,S=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,B={},X=-this.state.firstItem*(this.state.itemSize||0),Y=(0,r.default)(X,"px",this.props.axis),ae=this.props.transitionTime+"ms";return B={WebkitTransform:Y,MozTransform:Y,MsTransform:Y,OTransform:Y,transform:Y,msTransform:Y,WebkitTransitionDuration:ae,MozTransitionDuration:ae,MsTransitionDuration:ae,OTransitionDuration:ae,transitionDuration:ae,msTransitionDuration:ae},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}),E?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:B,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(ee){return C.setItemsListRef(ee)},style:B},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!S),onClick:function(){return C.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),A}(e.Component);return zi.default=_,R(_,"displayName","Thumbs"),R(_,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),zi}var Bi={},Xl;function Gg(){if(Xl)return Bi;Xl=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.default=void 0;var e=function(){return document};return Bi.default=e,Bi}var Tn={},Yl;function Zc(){if(Yl)return Tn;Yl=1,Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.setPosition=Tn.getPosition=Tn.isKeyboardEvent=Tn.defaultStatusFormatter=Tn.noop=void 0;var e=uo(),t=n($s());function n(l){return l&&l.__esModule?l:{default:l}}var r=function(){};Tn.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};Tn.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};Tn.isKeyboardEvent=o;var s=function(u,c){if(c.infiniteLoop&&++u,u===0)return 0;var d=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var g=-u*c.centerSlidePercentage,h=d-1;return u&&(u!==h||c.infiniteLoop)?g+=(100-c.centerSlidePercentage)/2:u===h&&(g+=100-c.centerSlidePercentage),g}return-u*100};Tn.getPosition=s;var a=function(u,c){var d={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){d[g]=(0,t.default)(u,"%",c)}),d};return Tn.setPosition=a,Tn}var Nn={},jl;function Xg(){if(jl)return Nn;jl=1,Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.fadeAnimationHandler=Nn.slideStopSwipingHandler=Nn.slideSwipeAnimationHandler=Nn.slideAnimationHandler=void 0;var e=uo(),t=r($s()),n=Zc();function r(d){return d&&d.__esModule?d:{default:d}}function i(d,g){var h=Object.keys(d);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(d);g&&(m=m.filter(function(p){return Object.getOwnPropertyDescriptor(d,p).enumerable})),h.push.apply(h,m)}return h}function o(d){for(var g=1;g<arguments.length;g++){var h=arguments[g]!=null?arguments[g]:{};g%2?i(Object(h),!0).forEach(function(m){s(d,m,h[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(m){Object.defineProperty(d,m,Object.getOwnPropertyDescriptor(h,m))})}return d}function s(d,g,h){return g in d?Object.defineProperty(d,g,{value:h,enumerable:!0,configurable:!0,writable:!0}):d[g]=h,d}var a=function(g,h){var m={},p=h.selectedItem,v=p,w=e.Children.count(g.children)-1,b=g.infiniteLoop&&(p<0||p>w);if(b)return v<0?g.centerMode&&g.centerSlidePercentage&&g.axis==="horizontal"?m.itemListStyle=(0,n.setPosition)(-(w+2)*g.centerSlidePercentage-(100-g.centerSlidePercentage)/2,g.axis):m.itemListStyle=(0,n.setPosition)(-(w+2)*100,g.axis):v>w&&(m.itemListStyle=(0,n.setPosition)(0,g.axis)),m;var x=(0,n.getPosition)(p,g),O=(0,t.default)(x,"%",g.axis),R=g.transitionTime+"ms";return m.itemListStyle={WebkitTransform:O,msTransform:O,OTransform:O,transform:O},h.swiping||(m.itemListStyle=o(o({},m.itemListStyle),{},{WebkitTransitionDuration:R,MozTransitionDuration:R,OTransitionDuration:R,transitionDuration:R,msTransitionDuration:R})),m};Nn.slideAnimationHandler=a;var l=function(g,h,m,p){var v={},w=h.axis==="horizontal",b=e.Children.count(h.children),x=0,O=(0,n.getPosition)(m.selectedItem,h),R=h.infiniteLoop?(0,n.getPosition)(b-1,h)-100:(0,n.getPosition)(b-1,h),M=w?g.x:g.y,_=M;O===x&&M>0&&(_=0),O===R&&M<0&&(_=0);var I=O+100/(m.itemSize/_),k=Math.abs(M)>h.swipeScrollTolerance;return h.infiniteLoop&&k&&(m.selectedItem===0&&I>-100?I-=b*100:m.selectedItem===b-1&&I<-b*100&&(I+=b*100)),(!h.preventMovementUntilSwipeScrollTolerance||k||m.swipeMovementStarted)&&(m.swipeMovementStarted||p({swipeMovementStarted:!0}),v.itemListStyle=(0,n.setPosition)(I,h.axis)),k&&!m.cancelClick&&p({cancelClick:!0}),v};Nn.slideSwipeAnimationHandler=l;var u=function(g,h){var m=(0,n.getPosition)(h.selectedItem,g),p=(0,n.setPosition)(m,g.axis);return{itemListStyle:p}};Nn.slideStopSwipingHandler=u;var c=function(g,h){var m=g.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 Nn.fadeAnimationHandler=c,Nn}var Kl;function Yg(){if(Kl)return Ai;Kl=1,Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=void 0;var e=c(uo()),t=l(Xc()),n=l(Yc()),r=l(Kc()),i=l(Gg()),o=l(jc()),s=Zc(),a=Xg();function l(D){return D&&D.__esModule?D:{default:D}}function u(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return u=function(){return D},D}function c(D){if(D&&D.__esModule)return D;if(D===null||d(D)!=="object"&&typeof D!="function")return{default:D};var C=u();if(C&&C.has(D))return C.get(D);var E={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in D)if(Object.prototype.hasOwnProperty.call(D,S)){var B=T?Object.getOwnPropertyDescriptor(D,S):null;B&&(B.get||B.set)?Object.defineProperty(E,S,B):E[S]=D[S]}return E.default=D,C&&C.set(D,E),E}function d(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(E){return typeof E}:d=function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},d(D)}function g(){return g=Object.assign||function(D){for(var C=1;C<arguments.length;C++){var E=arguments[C];for(var T in E)Object.prototype.hasOwnProperty.call(E,T)&&(D[T]=E[T])}return D},g.apply(this,arguments)}function h(D,C){var E=Object.keys(D);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(D);C&&(T=T.filter(function(S){return Object.getOwnPropertyDescriptor(D,S).enumerable})),E.push.apply(E,T)}return E}function m(D){for(var C=1;C<arguments.length;C++){var E=arguments[C]!=null?arguments[C]:{};C%2?h(Object(E),!0).forEach(function(T){k(D,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(E)):h(Object(E)).forEach(function(T){Object.defineProperty(D,T,Object.getOwnPropertyDescriptor(E,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 E=0;E<C.length;E++){var T=C[E];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(D,T.key,T)}}function w(D,C,E){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&&x(D,C)}function x(D,C){return x=Object.setPrototypeOf||function(T,S){return T.__proto__=S,T},x(D,C)}function O(D){var C=_();return function(){var T=I(D),S;if(C){var B=I(this).constructor;S=Reflect.construct(T,arguments,B)}else S=T.apply(this,arguments);return R(this,S)}}function R(D,C){return C&&(d(C)==="object"||typeof C=="function")?C:M(D)}function M(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function _(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function I(D){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(E){return E.__proto__||Object.getPrototypeOf(E)},I(D)}function k(D,C,E){return C in D?Object.defineProperty(D,C,{value:E,enumerable:!0,configurable:!0,writable:!0}):D[C]=E,D}var A=function(D){b(E,D);var C=O(E);function E(T){var S;p(this,E),S=C.call(this,T),k(M(S),"thumbsRef",void 0),k(M(S),"carouselWrapperRef",void 0),k(M(S),"listRef",void 0),k(M(S),"itemsRef",void 0),k(M(S),"timer",void 0),k(M(S),"animationHandler",void 0),k(M(S),"setThumbsRef",function(X){S.thumbsRef=X}),k(M(S),"setCarouselWrapperRef",function(X){S.carouselWrapperRef=X}),k(M(S),"setListRef",function(X){S.listRef=X}),k(M(S),"setItemsRef",function(X,Y){S.itemsRef||(S.itemsRef=[]),S.itemsRef[Y]=X}),k(M(S),"autoPlay",function(){e.Children.count(S.props.children)<=1||(S.clearAutoPlay(),S.props.autoPlay&&(S.timer=setTimeout(function(){S.increment()},S.props.interval)))}),k(M(S),"clearAutoPlay",function(){S.timer&&clearTimeout(S.timer)}),k(M(S),"resetAutoPlay",function(){S.clearAutoPlay(),S.autoPlay()}),k(M(S),"stopOnHover",function(){S.setState({isMouseEntered:!0},S.clearAutoPlay)}),k(M(S),"startOnLeave",function(){S.setState({isMouseEntered:!1},S.autoPlay)}),k(M(S),"isFocusWithinTheCarousel",function(){return S.carouselWrapperRef?!!((0,i.default)().activeElement===S.carouselWrapperRef||S.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),k(M(S),"navigateWithKeyboard",function(X){if(S.isFocusWithinTheCarousel()){var Y=S.props.axis,ae=Y==="horizontal",Q={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},ee=ae?Q.ArrowRight:Q.ArrowDown,re=ae?Q.ArrowLeft:Q.ArrowUp;ee===X.keyCode?S.increment():re===X.keyCode&&S.decrement()}}),k(M(S),"updateSizes",function(){if(!(!S.state.initialized||!S.itemsRef||S.itemsRef.length===0)){var X=S.props.axis==="horizontal",Y=S.itemsRef[0];if(Y){var ae=X?Y.clientWidth:Y.clientHeight;S.setState({itemSize:ae}),S.thumbsRef&&S.thumbsRef.updateSizes()}}}),k(M(S),"setMountState",function(){S.setState({hasMount:!0}),S.updateSizes()}),k(M(S),"handleClickItem",function(X,Y){if(e.Children.count(S.props.children)!==0){if(S.state.cancelClick){S.setState({cancelClick:!1});return}S.props.onClickItem(X,Y),X!==S.state.selectedItem&&S.setState({selectedItem:X})}}),k(M(S),"handleOnChange",function(X,Y){e.Children.count(S.props.children)<=1||S.props.onChange(X,Y)}),k(M(S),"handleClickThumb",function(X,Y){S.props.onClickThumb(X,Y),S.moveTo(X)}),k(M(S),"onSwipeStart",function(X){S.setState({swiping:!0}),S.props.onSwipeStart(X)}),k(M(S),"onSwipeEnd",function(X){S.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),S.props.onSwipeEnd(X),S.clearAutoPlay(),S.state.autoPlay&&S.autoPlay()}),k(M(S),"onSwipeMove",function(X,Y){S.props.onSwipeMove(Y);var ae=S.props.swipeAnimationHandler(X,S.props,S.state,S.setState.bind(M(S)));return S.setState(m({},ae)),!!Object.keys(ae).length}),k(M(S),"decrement",function(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;S.moveTo(S.state.selectedItem-(typeof X=="number"?X:1))}),k(M(S),"increment",function(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;S.moveTo(S.state.selectedItem+(typeof X=="number"?X:1))}),k(M(S),"moveTo",function(X){if(typeof X=="number"){var Y=e.Children.count(S.props.children)-1;X<0&&(X=S.props.infiniteLoop?Y:0),X>Y&&(X=S.props.infiniteLoop?0:Y),S.selectItem({selectedItem:X}),S.state.autoPlay&&S.state.isMouseEntered===!1&&S.resetAutoPlay()}}),k(M(S),"onClickNext",function(){S.increment(1)}),k(M(S),"onClickPrev",function(){S.decrement(1)}),k(M(S),"onSwipeForward",function(){S.increment(1),S.props.emulateTouch&&S.setState({cancelClick:!0})}),k(M(S),"onSwipeBackwards",function(){S.decrement(1),S.props.emulateTouch&&S.setState({cancelClick:!0})}),k(M(S),"changeItem",function(X){return function(Y){(!(0,s.isKeyboardEvent)(Y)||Y.key==="Enter")&&S.moveTo(X)}}),k(M(S),"selectItem",function(X){S.setState(m({previousItem:S.state.selectedItem},X),function(){S.setState(S.animationHandler(S.props,S.state))}),S.handleOnChange(X.selectedItem,e.Children.toArray(S.props.children)[X.selectedItem])}),k(M(S),"getInitialImage",function(){var X=S.props.selectedItem,Y=S.itemsRef&&S.itemsRef[X],ae=Y&&Y.getElementsByTagName("img")||[];return ae[0]}),k(M(S),"getVariableItemHeight",function(X){var Y=S.itemsRef&&S.itemsRef[X];if(S.state.hasMount&&Y&&Y.children.length){var ae=Y.children[0].getElementsByTagName("img")||[];if(ae.length>0){var Q=ae[0];if(!Q.complete){var ee=function ue(){S.forceUpdate(),Q.removeEventListener("load",ue)};Q.addEventListener("load",ee)}}var re=ae[0]||Y.children[0],te=re.clientHeight;return te>0?te:null}return null});var B={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 S.animationHandler=typeof T.animationHandler=="function"&&T.animationHandler||T.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,S.state=m(m({},B),S.animationHandler(T,B)),S}return w(E,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(S,B){!S.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!S.autoFocus&&this.props.autoFocus&&this.forceFocus(),B.swiping&&!this.state.swiping&&this.setState(m({},this.props.stopSwipingHandler(this.props,this.state))),(S.selectedItem!==this.props.selectedItem||S.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),S.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 S=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 B=S.getInitialImage();B&&!B.complete?B.addEventListener("load",S.setMountState):S.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var S=this.carouselWrapperRef;this.props.stopOnHover&&S&&(S.addEventListener("mouseenter",this.stopOnHover),S.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var S=this.carouselWrapperRef;this.props.stopOnHover&&S&&(S.removeEventListener("mouseenter",this.stopOnHover),S.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 S=this.getInitialImage();S&&S.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var S;(S=this.carouselWrapperRef)===null||S===void 0||S.focus()}},{key:"renderItems",value:function(S){var B=this;return this.props.children?e.Children.map(this.props.children,function(X,Y){var ae=Y===B.state.selectedItem,Q=Y===B.state.previousItem,ee=ae&&B.state.selectedStyle||Q&&B.state.prevStyle||B.state.slideStyle||{};B.props.centerMode&&B.props.axis==="horizontal"&&(ee=m(m({},ee),{},{minWidth:B.props.centerSlidePercentage+"%"})),B.state.swiping&&B.state.swipeMovementStarted&&(ee=m(m({},ee),{},{pointerEvents:"none"}));var re={ref:function(ue){return B.setItemsRef(ue,Y)},key:"itemKey"+Y+(S?"clone":""),className:n.default.ITEM(!0,Y===B.state.selectedItem,Y===B.state.previousItem),onClick:B.handleClickItem.bind(B,Y,X),style:ee};return e.default.createElement("li",re,B.props.renderItem(X,{isSelected:Y===B.state.selectedItem,isPrevious:Y===B.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var S=this,B=this.props,X=B.showIndicators,Y=B.labels,ae=B.renderIndicator,Q=B.children;return X?e.default.createElement("ul",{className:"control-dots"},e.Children.map(Q,function(ee,re){return ae&&ae(S.changeItem(re),re===S.state.selectedItem,re,Y.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 S=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var B=this.props.swipeable&&e.Children.count(this.props.children)>1,X=this.props.axis==="horizontal",Y=this.props.showArrows&&e.Children.count(this.props.children)>1,ae=Y&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,Q=Y&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,ee=this.renderItems(!0),re=ee.shift(),te=ee.pop(),ue={className:n.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},fe={};if(X){if(ue.onSwipeLeft=this.onSwipeForward,ue.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var se=this.getVariableItemHeight(this.state.selectedItem);fe.height=se||"auto"}}else ue.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,ue.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,ue.style=m(m({},ue.style),{},{height:this.state.itemSize}),fe.height=this.state.itemSize;return e.default.createElement("div",{"aria-label":this.props.ariaLabel,className:n.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},e.default.createElement("div",{className:n.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,ae,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:fe},B?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},ue,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&te,this.renderItems(),this.props.infiniteLoop&&re):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(P){return S.setListRef(P)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&te,this.renderItems(),this.props.infiniteLoop&&re)),this.props.renderArrowNext(this.onClickNext,Q,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),E}(e.default.Component);return Ai.default=A,k(A,"displayName","Carousel"),k(A,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:s.noop,onClickThumb:s.noop,onChange:s.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(C,E,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_PREV(!E),onClick:C})},renderArrowNext:function(C,E,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_NEXT(!E),onClick:C})},renderIndicator:function(C,E,T,S){return e.default.createElement("li",{className:n.default.DOT(E),onClick:C,onKeyDown:C,value:T,key:T,role:"button",tabIndex:0,"aria-label":"".concat(S," ").concat(T+1)})},renderItem:function(C){return C},renderThumbs:function(C){var E=e.Children.map(C,function(T){var S=T;if(T.type!=="img"&&(S=e.Children.toArray(T.props.children).find(function(B){return B.type==="img"})),!!S)return S});return E.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"),[]):E},statusFormatter:s.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:a.slideSwipeAnimationHandler,stopSwipingHandler:a.slideStopSwipingHandler}),Ai}var Zl={},Jl;function jg(){return Jl||(Jl=1),Zl}var Ql;function Kg(){return Ql||(Ql=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=i(Yg()),n=jg(),r=i(Kc());function i(o){return o&&o.__esModule?o:{default:o}}}(ja)),ja}var Zg=Kg(),Ka,eu;function Jg(){if(eu)return Ka;eu=1;var e=mh(),t=function(){return e.Date.now()};return Ka=t,Ka}var Za,tu;function Jc(){if(tu)return Za;tu=1;var e=Tc(),t=Jg(),n=Dc(),r="Expected a function",i=Math.max,o=Math.min;function s(a,l,u){var c,d,g,h,m,p,v=0,w=!1,b=!1,x=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,e(u)&&(w=!!u.leading,b="maxWait"in u,g=b?i(n(u.maxWait)||0,l):g,x="trailing"in u?!!u.trailing:x);function O(E){var T=c,S=d;return c=d=void 0,v=E,h=a.apply(S,T),h}function R(E){return v=E,m=setTimeout(I,l),w?O(E):h}function M(E){var T=E-p,S=E-v,B=l-T;return b?o(B,g-S):B}function _(E){var T=E-p,S=E-v;return p===void 0||T>=l||T<0||b&&S>=g}function I(){var E=t();if(_(E))return k(E);m=setTimeout(I,M(E))}function k(E){return m=void 0,x&&c?O(E):(c=d=void 0,h)}function A(){m!==void 0&&clearTimeout(m),v=0,c=p=d=m=void 0}function D(){return m===void 0?h:k(t())}function C(){var E=t(),T=_(E);if(c=arguments,d=this,p=E,T){if(m===void 0)return R(p);if(b)return clearTimeout(m),m=setTimeout(I,l),O(p)}return m===void 0&&(m=setTimeout(I,l)),h}return C.cancel=A,C.flush=D,C}return Za=s,Za}var Qg=Jc();const Qc=lr(Qg);function bn(e,t,n,r,i=!1){const o=f.useRef();o.current=t,f.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const s=n,a=l=>{o.current?.call(s,l)};return s.addEventListener(e,a,{passive:r,capture:i}),()=>{s.removeEventListener(e,a,{capture:i})}},[e,n,r,i])}function Cr(e,t){return e===void 0?void 0:t}const em=Math.PI;function nu(e){return e*em/180}const ed=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),td=(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}},nd=(e,t,n)=>Math.min(e,t-n*2),rd=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Ns=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),f.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},tm=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function nm(e,t,n){const[r,i]=f.useState(e),o=f.useRef(!0);f.useEffect(()=>()=>{o.current=!1},[]);const s=f.useRef(Qc(a=>{o.current&&i(a)},n));return f.useLayoutEffect(()=>{o.current&&s.current(()=>e())},t),r}const rm="֑-߿יִ-﷽ﹰ-ﻼ",im="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",om=new RegExp("^[^"+im+"]*["+rm+"]");function Bs(e){return om.test(e)?"rtl":"not-rtl"}let Ho;function Ss(){if(typeof document>"u")return 0;if(Ho!==void 0)return Ho;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(),Ho=n-r,Ho}const zr=Symbol();function am(e){const t=f.useRef([zr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=f.useState(e),[,i]=f.useState(),o=f.useCallback(a=>{const l=t.current[0];l!==zr&&(a=typeof a=="function"?a(l):a,a===l)||(l!==zr&&i({}),r(u=>typeof a=="function"?a(l===zr?u:l):a),t.current[0]=zr)},[]),s=f.useCallback(()=>{t.current[0]=zr,i({})},[]);return[t.current[0]===zr?n:t.current[0],o,s]}function id(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 sm(e){const t=f.useRef(e);return vi(e,t.current)||(t.current=e),t.current}const lm=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(a=>a!=="");if(o.length===0)return null;const s=o.length>1;return f.createElement(Wg,{"data-testid":"GDG-default-image-overlay-editor"},f.createElement(Zg.Carousel,{showArrows:s,showThumbs:!1,swipeable:s,emulateTouch:s,infiniteLoop:s},o.map(a=>{const l=i?.(a)??f.createElement("img",{draggable:!1,src:a});return f.createElement("div",{className:"gdg-centering-container",key:a},l)})),n&&r&&f.createElement("button",{className:"gdg-edit-icon",onClick:r},f.createElement(Ns,null)))};function od(){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 Ur=od();function um(e){Ur=e}const ad=/[&<>"']/,cm=new RegExp(ad.source,"g"),sd=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,dm=new RegExp(sd.source,"g"),fm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ru=e=>fm[e];function gn(e,t){if(t){if(ad.test(e))return e.replace(cm,ru)}else if(sd.test(e))return e.replace(dm,ru);return e}const hm=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ld(e){return e.replace(hm,(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 gm=/(^|[^\[])\^/g;function Lt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(gm,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const mm=/[^\w:]/g,pm=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function iu(e,t,n){if(e){let r;try{r=decodeURIComponent(ld(n)).replace(mm,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!pm.test(n)&&(n=ym(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const zo={},vm=/^[^:]+:\/*[^/]*$/,bm=/^([^:]+:)[\s\S]*$/,wm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function ym(e,t){zo[" "+e]||(vm.test(e)?zo[" "+e]=e+"/":zo[" "+e]=Ko(e,"/",!0)),e=zo[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(bm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(wm,"$1")+t:e+t}const ra={exec:function(){}};function ou(e,t){const n=e.replace(/\|/g,(o,s,a)=>{let l=!1,u=s;for(;--u>=0&&a[u]==="\\";)l=!l;return l?"|":" |"}),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function Ko(e,t,n){const r=e.length;if(r===0)return"";let i=0;for(;i<r;){const o=e.charAt(r-i-1);if(o===t&&!n)i++;else if(o!==t&&n)i++;else break}return e.slice(0,r-i)}function Cm(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 Sm(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function au(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function su(e,t,n,r){const i=t.href,o=t.title?gn(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:i,title:o,text:gn(s)}}function xm(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.Ct51iCb_.js","./index.DKN5MVff.js","../css/index.CJVRHjQZ.css","./withFullScreenWrapper.C-gXt0Rl.js","./Toolbar.Dt4jIKlY.js","./FormClearHelper.DF4gFAOO.js","./mergeWith.GRNk8iwv.js","./sprintf.D7DtBTRn.js","./checkbox.Cgxgc0et.js","./createDownloadLinkElement.ZaXNnPK4.js","./toConsumableArray.BJvaP8gb.js","./possibleConstructorReturn.Bd4ImlQ9.js","./createSuper.siQeagI2.js","./FileDownload.esm.Bz9nxNC5.js","./number-overlay-editor.DXS2qb1U.js","./es6.CMaUdEZ5.js"])))=>i.map(i=>d[i]);
2
+ import{r as f,E as Ls,_ as Ne,d as fh,g as lr,i as Ua,e as uo,f as hh,h as gh,m as mh,n as Tc,o as Dc,R as Vt,p as ph,q as Oc,t as vh,v as bh,w as wh,x as yh,y as Ch,z as Sh,c as kr,A as As,B as xh,C as kh,D as He,G as Pc,H as lt,I as Yi,J as $r,K as qa,j as Ue,M as Mh,N as Rh,s as Un,O as Ih,Q as Ol,S as Eh,T as Th,U as Dh,V as Oh,W as _c,X as Ph,Y as _h,Z as Cs,$ as Fc,a0 as Lc,a1 as Fh,a2 as Lh,a3 as Ah,a4 as Hh,a5 as zh,a6 as Vh,a7 as $h,a8 as Nh,a9 as Bh,aa as Ac,ab as Wh,ac as Uh,ad as qh,ae as Gh,af as Xh,ag as Yh,ah as jh,ai as Kh,aj as Zh,ak as Jh,al as Qh,am as eg,an as tg,ao as ng,ap as Wr,aq as an,ar as wn,l as pa,as as ji,at as ur,au as _e,av as rg,b as Hc,aw as zc,k as ig,ax as ui,ay as og,az as ag,aA as Ga,F as Vc,aB as va,aC as $c,aD as ba,aE as vn,aF as Bn,aG as wa,aH as Nc,aI as sg,aJ as lg,aK as Pl,aL as ug,aM as cg,L as dg,aN as fg}from"./index.DKN5MVff.js";import{w as hg,E as gg}from"./withFullScreenWrapper.C-gXt0Rl.js";import{T as mg,a as si}from"./Toolbar.Dt4jIKlY.js";import{u as pg}from"./FormClearHelper.DF4gFAOO.js";import{m as vg}from"./mergeWith.GRNk8iwv.js";import{s as bg}from"./sprintf.D7DtBTRn.js";import{L as wg,S as yg,a as Cg}from"./checkbox.Cgxgc0et.js";import{c as Sg}from"./createDownloadLinkElement.ZaXNnPK4.js";import{_ as or,a as Hs,C as xg}from"./toConsumableArray.BJvaP8gb.js";import{_ as kg,a as Mg,b as Rg}from"./possibleConstructorReturn.Bd4ImlQ9.js";import{_ as Ig}from"./createSuper.siQeagI2.js";import{D as Eg,F as Tg}from"./FileDownload.esm.Bz9nxNC5.js";var Bc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ls,Ne({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Bc.displayName="Add";var Wc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ls,Ne({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});Wc.displayName="Search";var Uc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ls,Ne({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M12 6a9.77 9.77 0 018.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0112 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 010 5 2.5 2.5 0 010-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}))});Uc.displayName="Visibility";var Xa,_l;function Dg(){if(_l)return Xa;_l=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return Xa=n,Xa}var Ya,Fl;function Og(){if(Fl)return Ya;Fl=1;var e=Dg(),t=fh();function n(r,i){return r!=null&&t(r,i,e)}return Ya=n,Ya}var Pg=Og();const _g=lr(Pg);function qc(e="This should not happen"){throw new Error(e)}function Dn(e,t="Assertion failed"){if(!e)return qc(t)}function no(e,t){return qc(t??"Hell froze over")}function Fg(e,t){try{return e()}catch{return t}}const Ll=Object.prototype.hasOwnProperty;function vi(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--&&vi(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Ll.call(e,n)&&++r&&!Ll.call(t,n)||!(n in t)||!vi(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const ta=null,zs=void 0;var J;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(J||(J={}));var Al;(function(e){e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay"})(Al||(Al={}));var na;(function(e){e.Triangle="triangle",e.Dots="dots"})(na||(na={}));function Fo(e){return"width"in e&&typeof e.width=="number"}async function Hl(e){return typeof e=="object"?e:await e()}function ci(e){return!(e.kind===J.Loading||e.kind===J.Bubble||e.kind===J.RowID||e.kind===J.Protected||e.kind===J.Drilldown)}function hi(e){return e.kind===Hn.Marker||e.kind===Hn.NewRow}function di(e){if(!ci(e)||e.kind===J.Image)return!1;switch(e.kind){case J.Text:case J.Number:case J.Markdown:case J.Uri:case J.Custom:case J.Boolean:return e.readonly!==!0;default:no(e,"A cell was passed with an invalid kind")}}function Lg(e){return _g(e,"editor")}function Vs(e){return!(e.readonly??!1)}var Hn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Hn||(Hn={}));function Ag(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,i){return r[0]-i[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const i=n[n.length-1];i[1]<r[0]?n.push([...r]):i[1]<r[1]&&(i[1]=r[1])}return n}let zl;class ot{items;constructor(t){this.items=t}static empty=()=>zl??(zl=new ot([]));static fromSingleSelection=t=>ot.empty().add(t);offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new ot(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Ag([...this.items,n]);return new ot(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],i=typeof t=="number"?t+1:t[1];for(const[o,s]of n.entries()){const[a,l]=s;if(a<=i&&r<=l){const u=[];a<r&&u.push([a,r]),i<l&&u.push([i,l]),n.splice(o,1,...u)}}return new ot(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,i]=this.items[n];if(t>=r&&t<i)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],i=this.items[n];if(r[0]!==i[0]||r[1]!==i[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let i=n;i<r;i++)t.push(i);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}}var Hg=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,l]=a.split("_");n[l]=a}else r.push(a)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},Vl=Hg,zg=e=>e.toUpperCase()===e,Vg=e=>t=>e.indexOf(t)===-1,Gc=(e,t)=>{const n={};return Object.keys(e).filter(Vg(t)).forEach(r=>{n[r]=e[r]}),n};function $g(e,t,n){const r=Gc(t,n);if(!e){const i=typeof Ua=="function"?{default:Ua}:Ua;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var Ng=(e,t)=>{};function Bg(e){let t="";return n=>{const r=(o,s)=>{const{as:a=e,class:l=t}=o,u=n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&!zg(a[0])):n.propsAsIs,c=$g(u,o,["as","class"]);c.ref=s,c.className=n.atomic?Vl(n.class,c.className||l):Vl(c.className||l,n.class);const{vars:d}=n;if(d){const g={};for(const p in d){const v=d[p],w=v[0],b=v[1]||"",x=typeof w=="function"?w(o):w;Ng(x,n.name),g[`--${p}`]=`${x}${b}`}const h=c.style||{},m=Object.keys(h);m.length>0&&m.forEach(p=>{g[p]=h[p]}),c.style=g}return e.__wyw_meta&&e!==a?(c.as=a,f.createElement(e,c)):f.createElement(a,c)},i=f.forwardRef?f.forwardRef(r):o=>{const s=Gc(o,["innerRef"]);return r(s,o.innerRef)};return i.displayName=n.name,i.__wyw_meta={className:n.class||t,extends:e},i}}var un=Bg;const Wg=un("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var ja={},Ai={},Lo={},Ao={},$l;function Ug(){return $l||($l=1,function(e){(function(t,n){n(e,uo(),hh())})(Ao,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var i=s(n),o=s(r);function s(b){return b&&b.__esModule?b:{default:b}}var a=Object.assign||function(b){for(var x=1;x<arguments.length;x++){var O=arguments[x];for(var R in O)Object.prototype.hasOwnProperty.call(O,R)&&(b[R]=O[R])}return b};function l(b,x){var O={};for(var R in b)x.indexOf(R)>=0||Object.prototype.hasOwnProperty.call(b,R)&&(O[R]=b[R]);return O}function u(b,x){if(!(b instanceof x))throw new TypeError("Cannot call a class as a function")}var c=function(){function b(x,O){for(var R=0;R<O.length;R++){var M=O[R];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(x,M.key,M)}}return function(x,O,R){return O&&b(x.prototype,O),R&&b(x,R),x}}();function d(b,x){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:b}function g(b,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);b.prototype=Object.create(x&&x.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(b,x):b.__proto__=x)}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 x=b.touches[0],O=x.pageX,R=x.pageY;return{x:O,y:R}}var M=b.screenX,_=b.screenY;return{x:M,y:_}}var w=function(b){g(x,b);function x(){var O;u(this,x);for(var R=arguments.length,M=Array(R),_=0;_<R;_++)M[_]=arguments[_];var I=d(this,(O=x.__proto__||Object.getPrototypeOf(x)).call.apply(O,[this].concat(M)));return I._handleSwipeStart=I._handleSwipeStart.bind(I),I._handleSwipeMove=I._handleSwipeMove.bind(I),I._handleSwipeEnd=I._handleSwipeEnd.bind(I),I._onMouseDown=I._onMouseDown.bind(I),I._onMouseMove=I._onMouseMove.bind(I),I._onMouseUp=I._onMouseUp.bind(I),I._setSwiperRef=I._setSwiperRef.bind(I),I}return c(x,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(R){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(R))}},{key:"_onMouseMove",value:function(R){this.mouseDown&&this._handleSwipeMove(R)}},{key:"_onMouseUp",value:function(R){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(R)}},{key:"_handleSwipeStart",value:function(R){var M=v(R),_=M.x,I=M.y;this.moveStart={x:_,y:I},this.props.onSwipeStart(R)}},{key:"_handleSwipeMove",value:function(R){if(this.moveStart){var M=v(R),_=M.x,I=M.y,k=_-this.moveStart.x,A=I-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x:k,y:A},R);D&&R.cancelable&&R.preventDefault(),this.movePosition={deltaX:k,deltaY:A}}}},{key:"_handleSwipeEnd",value:function(R){this.props.onSwipeEnd(R);var M=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-M?this.props.onSwipeLeft(1,R):this.movePosition.deltaX>M&&this.props.onSwipeRight(1,R),this.movePosition.deltaY<-M?this.props.onSwipeUp(1,R):this.movePosition.deltaY>M&&this.props.onSwipeDown(1,R)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(R){this.swiper=R,this.props.innerRef(R)}},{key:"render",value:function(){var R=this.props;R.tagName;var M=R.className,_=R.style,I=R.children;R.allowMouseEvents,R.onSwipeUp,R.onSwipeDown,R.onSwipeLeft,R.onSwipeRight,R.onSwipeStart,R.onSwipeMove,R.onSwipeEnd,R.innerRef,R.tolerance;var k=l(R,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,a({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:M,style:_},k),I)}}]),x}(n.Component);w.displayName="ReactSwipe",w.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},w.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=w})}(Ao)),Ao}var Nl;function Xc(){return Nl||(Nl=1,function(e){(function(t,n){n(e,Ug())})(Lo,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})}(Lo)),Lo}var Hi={},Bl;function Yc(){if(Bl)return Hi;Bl=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.default=void 0;var e=t(gh());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,s){return o in i?Object.defineProperty(i,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[o]=s,i}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,s){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":s==="horizontal","axis-vertical":s!=="horizontal"})},SLIDER:function(o,s){return(0,e.default)({thumbs:!o,slider:o,animated:!s})},ITEM:function(o,s,a){return(0,e.default)({thumb:!o,slide:o,selected:s,previous:a})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return Hi.default=r,Hi}var zi={},Vi={},Wl;function qg(){if(Wl)return Vi;Wl=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return Vi.outerWidth=e,Vi}var $i={},Ul;function $s(){if(Ul)return $i;Ul=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,s=i==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",l="("+s.join(",")+")";return a+l};return $i.default=e,$i}var Ni={},ql;function jc(){if(ql)return Ni;ql=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.default=void 0;var e=function(){return window};return Ni.default=e,Ni}var Gl;function Kc(){if(Gl)return zi;Gl=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.default=void 0;var e=l(uo()),t=s(Yc()),n=qg(),r=s($s()),i=s(Xc()),o=s(jc());function s(I){return I&&I.__esModule?I:{default:I}}function a(){if(typeof WeakMap!="function")return null;var I=new WeakMap;return a=function(){return I},I}function l(I){if(I&&I.__esModule)return I;if(I===null||u(I)!=="object"&&typeof I!="function")return{default:I};var k=a();if(k&&k.has(I))return k.get(I);var A={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in I)if(Object.prototype.hasOwnProperty.call(I,C)){var E=D?Object.getOwnPropertyDescriptor(I,C):null;E&&(E.get||E.set)?Object.defineProperty(A,C,E):A[C]=I[C]}return A.default=I,k&&k.set(I,A),A}function u(I){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(A){return typeof A}:u=function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},u(I)}function c(){return c=Object.assign||function(I){for(var k=1;k<arguments.length;k++){var A=arguments[k];for(var D in A)Object.prototype.hasOwnProperty.call(A,D)&&(I[D]=A[D])}return I},c.apply(this,arguments)}function d(I,k){if(!(I instanceof k))throw new TypeError("Cannot call a class as a function")}function g(I,k){for(var A=0;A<k.length;A++){var D=k[A];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(I,D.key,D)}}function h(I,k,A){return k&&g(I.prototype,k),I}function m(I,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(k&&k.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),k&&p(I,k)}function p(I,k){return p=Object.setPrototypeOf||function(D,C){return D.__proto__=C,D},p(I,k)}function v(I){var k=x();return function(){var D=O(I),C;if(k){var E=O(this).constructor;C=Reflect.construct(D,arguments,E)}else C=D.apply(this,arguments);return w(this,C)}}function w(I,k){return k&&(u(k)==="object"||typeof k=="function")?k:b(I)}function b(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}function x(){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(I){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)},O(I)}function R(I,k,A){return k in I?Object.defineProperty(I,k,{value:A,enumerable:!0,configurable:!0,writable:!0}):I[k]=A,I}var M=function(k){return k.hasOwnProperty("key")},_=function(I){m(A,I);var k=v(A);function A(D){var C;return d(this,A),C=k.call(this,D),R(b(C),"itemsWrapperRef",void 0),R(b(C),"itemsListRef",void 0),R(b(C),"thumbsRef",void 0),R(b(C),"setItemsWrapperRef",function(E){C.itemsWrapperRef=E}),R(b(C),"setItemsListRef",function(E){C.itemsListRef=E}),R(b(C),"setThumbsRef",function(E,T){C.thumbsRef||(C.thumbsRef=[]),C.thumbsRef[T]=E}),R(b(C),"updateSizes",function(){if(!(!C.props.children||!C.itemsWrapperRef||!C.thumbsRef)){var E=e.Children.count(C.props.children),T=C.itemsWrapperRef.clientWidth,S=C.props.thumbWidth?C.props.thumbWidth:(0,n.outerWidth)(C.thumbsRef[0]),B=Math.floor(T/S),X=B<E,Y=X?E-B:0;C.setState(function(ae,Q){return{itemSize:S,visibleItems:B,firstItem:X?C.getFirstItem(Q.selectedItem):0,lastPosition:Y,showArrows:X}})}}),R(b(C),"handleClickItem",function(E,T,S){if(!M(S)||S.key==="Enter"){var B=C.props.onSelectItem;typeof B=="function"&&B(E,T)}}),R(b(C),"onSwipeStart",function(){C.setState({swiping:!0})}),R(b(C),"onSwipeEnd",function(){C.setState({swiping:!1})}),R(b(C),"onSwipeMove",function(E){var T=E.x;if(!C.state.itemSize||!C.itemsWrapperRef||!C.state.visibleItems)return!1;var S=0,B=e.Children.count(C.props.children),X=-(C.state.firstItem*100)/C.state.visibleItems,Y=Math.max(B-C.state.visibleItems,0),ae=-Y*100/C.state.visibleItems;X===S&&T>0&&(T=0),X===ae&&T<0&&(T=0);var Q=C.itemsWrapperRef.clientWidth,ee=X+100/(Q/T);return C.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(re){C.itemsListRef.style[re]=(0,r.default)(ee,"%",C.props.axis)}),!0}),R(b(C),"slideRight",function(E){C.moveTo(C.state.firstItem-(typeof E=="number"?E:1))}),R(b(C),"slideLeft",function(E){C.moveTo(C.state.firstItem+(typeof E=="number"?E:1))}),R(b(C),"moveTo",function(E){E=E<0?0:E,E=E>=C.state.lastPosition?C.state.lastPosition:E,C.setState({firstItem:E})}),C.state={selectedItem:D.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},C}return h(A,[{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 E=C;return C>=this.state.lastPosition&&(E=this.state.lastPosition),C<this.state.firstItem+this.state.visibleItems&&(E=this.state.firstItem),C<this.state.firstItem&&(E=C),E}},{key:"renderItems",value:function(){var C=this;return this.props.children.map(function(E,T){var S=t.default.ITEM(!1,T===C.state.selectedItem),B={key:T,ref:function(Y){return C.setThumbsRef(Y,T)},className:S,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({},B,{role:"button",tabIndex:0}),E)})}},{key:"render",value:function(){var C=this;if(!this.props.children)return null;var E=e.Children.count(this.props.children)>1,T=this.state.showArrows&&this.state.firstItem>0,S=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,B={},X=-this.state.firstItem*(this.state.itemSize||0),Y=(0,r.default)(X,"px",this.props.axis),ae=this.props.transitionTime+"ms";return B={WebkitTransform:Y,MozTransform:Y,MsTransform:Y,OTransform:Y,transform:Y,msTransform:Y,WebkitTransitionDuration:ae,MozTransitionDuration:ae,MsTransitionDuration:ae,OTransitionDuration:ae,transitionDuration:ae,msTransitionDuration:ae},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}),E?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:B,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(ee){return C.setItemsListRef(ee)},style:B},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!S),onClick:function(){return C.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),A}(e.Component);return zi.default=_,R(_,"displayName","Thumbs"),R(_,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),zi}var Bi={},Xl;function Gg(){if(Xl)return Bi;Xl=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.default=void 0;var e=function(){return document};return Bi.default=e,Bi}var Tn={},Yl;function Zc(){if(Yl)return Tn;Yl=1,Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.setPosition=Tn.getPosition=Tn.isKeyboardEvent=Tn.defaultStatusFormatter=Tn.noop=void 0;var e=uo(),t=n($s());function n(l){return l&&l.__esModule?l:{default:l}}var r=function(){};Tn.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};Tn.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};Tn.isKeyboardEvent=o;var s=function(u,c){if(c.infiniteLoop&&++u,u===0)return 0;var d=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var g=-u*c.centerSlidePercentage,h=d-1;return u&&(u!==h||c.infiniteLoop)?g+=(100-c.centerSlidePercentage)/2:u===h&&(g+=100-c.centerSlidePercentage),g}return-u*100};Tn.getPosition=s;var a=function(u,c){var d={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){d[g]=(0,t.default)(u,"%",c)}),d};return Tn.setPosition=a,Tn}var Nn={},jl;function Xg(){if(jl)return Nn;jl=1,Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.fadeAnimationHandler=Nn.slideStopSwipingHandler=Nn.slideSwipeAnimationHandler=Nn.slideAnimationHandler=void 0;var e=uo(),t=r($s()),n=Zc();function r(d){return d&&d.__esModule?d:{default:d}}function i(d,g){var h=Object.keys(d);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(d);g&&(m=m.filter(function(p){return Object.getOwnPropertyDescriptor(d,p).enumerable})),h.push.apply(h,m)}return h}function o(d){for(var g=1;g<arguments.length;g++){var h=arguments[g]!=null?arguments[g]:{};g%2?i(Object(h),!0).forEach(function(m){s(d,m,h[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(m){Object.defineProperty(d,m,Object.getOwnPropertyDescriptor(h,m))})}return d}function s(d,g,h){return g in d?Object.defineProperty(d,g,{value:h,enumerable:!0,configurable:!0,writable:!0}):d[g]=h,d}var a=function(g,h){var m={},p=h.selectedItem,v=p,w=e.Children.count(g.children)-1,b=g.infiniteLoop&&(p<0||p>w);if(b)return v<0?g.centerMode&&g.centerSlidePercentage&&g.axis==="horizontal"?m.itemListStyle=(0,n.setPosition)(-(w+2)*g.centerSlidePercentage-(100-g.centerSlidePercentage)/2,g.axis):m.itemListStyle=(0,n.setPosition)(-(w+2)*100,g.axis):v>w&&(m.itemListStyle=(0,n.setPosition)(0,g.axis)),m;var x=(0,n.getPosition)(p,g),O=(0,t.default)(x,"%",g.axis),R=g.transitionTime+"ms";return m.itemListStyle={WebkitTransform:O,msTransform:O,OTransform:O,transform:O},h.swiping||(m.itemListStyle=o(o({},m.itemListStyle),{},{WebkitTransitionDuration:R,MozTransitionDuration:R,OTransitionDuration:R,transitionDuration:R,msTransitionDuration:R})),m};Nn.slideAnimationHandler=a;var l=function(g,h,m,p){var v={},w=h.axis==="horizontal",b=e.Children.count(h.children),x=0,O=(0,n.getPosition)(m.selectedItem,h),R=h.infiniteLoop?(0,n.getPosition)(b-1,h)-100:(0,n.getPosition)(b-1,h),M=w?g.x:g.y,_=M;O===x&&M>0&&(_=0),O===R&&M<0&&(_=0);var I=O+100/(m.itemSize/_),k=Math.abs(M)>h.swipeScrollTolerance;return h.infiniteLoop&&k&&(m.selectedItem===0&&I>-100?I-=b*100:m.selectedItem===b-1&&I<-b*100&&(I+=b*100)),(!h.preventMovementUntilSwipeScrollTolerance||k||m.swipeMovementStarted)&&(m.swipeMovementStarted||p({swipeMovementStarted:!0}),v.itemListStyle=(0,n.setPosition)(I,h.axis)),k&&!m.cancelClick&&p({cancelClick:!0}),v};Nn.slideSwipeAnimationHandler=l;var u=function(g,h){var m=(0,n.getPosition)(h.selectedItem,g),p=(0,n.setPosition)(m,g.axis);return{itemListStyle:p}};Nn.slideStopSwipingHandler=u;var c=function(g,h){var m=g.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 Nn.fadeAnimationHandler=c,Nn}var Kl;function Yg(){if(Kl)return Ai;Kl=1,Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=void 0;var e=c(uo()),t=l(Xc()),n=l(Yc()),r=l(Kc()),i=l(Gg()),o=l(jc()),s=Zc(),a=Xg();function l(D){return D&&D.__esModule?D:{default:D}}function u(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return u=function(){return D},D}function c(D){if(D&&D.__esModule)return D;if(D===null||d(D)!=="object"&&typeof D!="function")return{default:D};var C=u();if(C&&C.has(D))return C.get(D);var E={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in D)if(Object.prototype.hasOwnProperty.call(D,S)){var B=T?Object.getOwnPropertyDescriptor(D,S):null;B&&(B.get||B.set)?Object.defineProperty(E,S,B):E[S]=D[S]}return E.default=D,C&&C.set(D,E),E}function d(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(E){return typeof E}:d=function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},d(D)}function g(){return g=Object.assign||function(D){for(var C=1;C<arguments.length;C++){var E=arguments[C];for(var T in E)Object.prototype.hasOwnProperty.call(E,T)&&(D[T]=E[T])}return D},g.apply(this,arguments)}function h(D,C){var E=Object.keys(D);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(D);C&&(T=T.filter(function(S){return Object.getOwnPropertyDescriptor(D,S).enumerable})),E.push.apply(E,T)}return E}function m(D){for(var C=1;C<arguments.length;C++){var E=arguments[C]!=null?arguments[C]:{};C%2?h(Object(E),!0).forEach(function(T){k(D,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(E)):h(Object(E)).forEach(function(T){Object.defineProperty(D,T,Object.getOwnPropertyDescriptor(E,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 E=0;E<C.length;E++){var T=C[E];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(D,T.key,T)}}function w(D,C,E){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&&x(D,C)}function x(D,C){return x=Object.setPrototypeOf||function(T,S){return T.__proto__=S,T},x(D,C)}function O(D){var C=_();return function(){var T=I(D),S;if(C){var B=I(this).constructor;S=Reflect.construct(T,arguments,B)}else S=T.apply(this,arguments);return R(this,S)}}function R(D,C){return C&&(d(C)==="object"||typeof C=="function")?C:M(D)}function M(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function _(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function I(D){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(E){return E.__proto__||Object.getPrototypeOf(E)},I(D)}function k(D,C,E){return C in D?Object.defineProperty(D,C,{value:E,enumerable:!0,configurable:!0,writable:!0}):D[C]=E,D}var A=function(D){b(E,D);var C=O(E);function E(T){var S;p(this,E),S=C.call(this,T),k(M(S),"thumbsRef",void 0),k(M(S),"carouselWrapperRef",void 0),k(M(S),"listRef",void 0),k(M(S),"itemsRef",void 0),k(M(S),"timer",void 0),k(M(S),"animationHandler",void 0),k(M(S),"setThumbsRef",function(X){S.thumbsRef=X}),k(M(S),"setCarouselWrapperRef",function(X){S.carouselWrapperRef=X}),k(M(S),"setListRef",function(X){S.listRef=X}),k(M(S),"setItemsRef",function(X,Y){S.itemsRef||(S.itemsRef=[]),S.itemsRef[Y]=X}),k(M(S),"autoPlay",function(){e.Children.count(S.props.children)<=1||(S.clearAutoPlay(),S.props.autoPlay&&(S.timer=setTimeout(function(){S.increment()},S.props.interval)))}),k(M(S),"clearAutoPlay",function(){S.timer&&clearTimeout(S.timer)}),k(M(S),"resetAutoPlay",function(){S.clearAutoPlay(),S.autoPlay()}),k(M(S),"stopOnHover",function(){S.setState({isMouseEntered:!0},S.clearAutoPlay)}),k(M(S),"startOnLeave",function(){S.setState({isMouseEntered:!1},S.autoPlay)}),k(M(S),"isFocusWithinTheCarousel",function(){return S.carouselWrapperRef?!!((0,i.default)().activeElement===S.carouselWrapperRef||S.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),k(M(S),"navigateWithKeyboard",function(X){if(S.isFocusWithinTheCarousel()){var Y=S.props.axis,ae=Y==="horizontal",Q={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},ee=ae?Q.ArrowRight:Q.ArrowDown,re=ae?Q.ArrowLeft:Q.ArrowUp;ee===X.keyCode?S.increment():re===X.keyCode&&S.decrement()}}),k(M(S),"updateSizes",function(){if(!(!S.state.initialized||!S.itemsRef||S.itemsRef.length===0)){var X=S.props.axis==="horizontal",Y=S.itemsRef[0];if(Y){var ae=X?Y.clientWidth:Y.clientHeight;S.setState({itemSize:ae}),S.thumbsRef&&S.thumbsRef.updateSizes()}}}),k(M(S),"setMountState",function(){S.setState({hasMount:!0}),S.updateSizes()}),k(M(S),"handleClickItem",function(X,Y){if(e.Children.count(S.props.children)!==0){if(S.state.cancelClick){S.setState({cancelClick:!1});return}S.props.onClickItem(X,Y),X!==S.state.selectedItem&&S.setState({selectedItem:X})}}),k(M(S),"handleOnChange",function(X,Y){e.Children.count(S.props.children)<=1||S.props.onChange(X,Y)}),k(M(S),"handleClickThumb",function(X,Y){S.props.onClickThumb(X,Y),S.moveTo(X)}),k(M(S),"onSwipeStart",function(X){S.setState({swiping:!0}),S.props.onSwipeStart(X)}),k(M(S),"onSwipeEnd",function(X){S.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),S.props.onSwipeEnd(X),S.clearAutoPlay(),S.state.autoPlay&&S.autoPlay()}),k(M(S),"onSwipeMove",function(X,Y){S.props.onSwipeMove(Y);var ae=S.props.swipeAnimationHandler(X,S.props,S.state,S.setState.bind(M(S)));return S.setState(m({},ae)),!!Object.keys(ae).length}),k(M(S),"decrement",function(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;S.moveTo(S.state.selectedItem-(typeof X=="number"?X:1))}),k(M(S),"increment",function(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;S.moveTo(S.state.selectedItem+(typeof X=="number"?X:1))}),k(M(S),"moveTo",function(X){if(typeof X=="number"){var Y=e.Children.count(S.props.children)-1;X<0&&(X=S.props.infiniteLoop?Y:0),X>Y&&(X=S.props.infiniteLoop?0:Y),S.selectItem({selectedItem:X}),S.state.autoPlay&&S.state.isMouseEntered===!1&&S.resetAutoPlay()}}),k(M(S),"onClickNext",function(){S.increment(1)}),k(M(S),"onClickPrev",function(){S.decrement(1)}),k(M(S),"onSwipeForward",function(){S.increment(1),S.props.emulateTouch&&S.setState({cancelClick:!0})}),k(M(S),"onSwipeBackwards",function(){S.decrement(1),S.props.emulateTouch&&S.setState({cancelClick:!0})}),k(M(S),"changeItem",function(X){return function(Y){(!(0,s.isKeyboardEvent)(Y)||Y.key==="Enter")&&S.moveTo(X)}}),k(M(S),"selectItem",function(X){S.setState(m({previousItem:S.state.selectedItem},X),function(){S.setState(S.animationHandler(S.props,S.state))}),S.handleOnChange(X.selectedItem,e.Children.toArray(S.props.children)[X.selectedItem])}),k(M(S),"getInitialImage",function(){var X=S.props.selectedItem,Y=S.itemsRef&&S.itemsRef[X],ae=Y&&Y.getElementsByTagName("img")||[];return ae[0]}),k(M(S),"getVariableItemHeight",function(X){var Y=S.itemsRef&&S.itemsRef[X];if(S.state.hasMount&&Y&&Y.children.length){var ae=Y.children[0].getElementsByTagName("img")||[];if(ae.length>0){var Q=ae[0];if(!Q.complete){var ee=function ue(){S.forceUpdate(),Q.removeEventListener("load",ue)};Q.addEventListener("load",ee)}}var re=ae[0]||Y.children[0],te=re.clientHeight;return te>0?te:null}return null});var B={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 S.animationHandler=typeof T.animationHandler=="function"&&T.animationHandler||T.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,S.state=m(m({},B),S.animationHandler(T,B)),S}return w(E,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(S,B){!S.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!S.autoFocus&&this.props.autoFocus&&this.forceFocus(),B.swiping&&!this.state.swiping&&this.setState(m({},this.props.stopSwipingHandler(this.props,this.state))),(S.selectedItem!==this.props.selectedItem||S.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),S.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 S=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 B=S.getInitialImage();B&&!B.complete?B.addEventListener("load",S.setMountState):S.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var S=this.carouselWrapperRef;this.props.stopOnHover&&S&&(S.addEventListener("mouseenter",this.stopOnHover),S.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var S=this.carouselWrapperRef;this.props.stopOnHover&&S&&(S.removeEventListener("mouseenter",this.stopOnHover),S.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 S=this.getInitialImage();S&&S.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var S;(S=this.carouselWrapperRef)===null||S===void 0||S.focus()}},{key:"renderItems",value:function(S){var B=this;return this.props.children?e.Children.map(this.props.children,function(X,Y){var ae=Y===B.state.selectedItem,Q=Y===B.state.previousItem,ee=ae&&B.state.selectedStyle||Q&&B.state.prevStyle||B.state.slideStyle||{};B.props.centerMode&&B.props.axis==="horizontal"&&(ee=m(m({},ee),{},{minWidth:B.props.centerSlidePercentage+"%"})),B.state.swiping&&B.state.swipeMovementStarted&&(ee=m(m({},ee),{},{pointerEvents:"none"}));var re={ref:function(ue){return B.setItemsRef(ue,Y)},key:"itemKey"+Y+(S?"clone":""),className:n.default.ITEM(!0,Y===B.state.selectedItem,Y===B.state.previousItem),onClick:B.handleClickItem.bind(B,Y,X),style:ee};return e.default.createElement("li",re,B.props.renderItem(X,{isSelected:Y===B.state.selectedItem,isPrevious:Y===B.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var S=this,B=this.props,X=B.showIndicators,Y=B.labels,ae=B.renderIndicator,Q=B.children;return X?e.default.createElement("ul",{className:"control-dots"},e.Children.map(Q,function(ee,re){return ae&&ae(S.changeItem(re),re===S.state.selectedItem,re,Y.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 S=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var B=this.props.swipeable&&e.Children.count(this.props.children)>1,X=this.props.axis==="horizontal",Y=this.props.showArrows&&e.Children.count(this.props.children)>1,ae=Y&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,Q=Y&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,ee=this.renderItems(!0),re=ee.shift(),te=ee.pop(),ue={className:n.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},fe={};if(X){if(ue.onSwipeLeft=this.onSwipeForward,ue.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var se=this.getVariableItemHeight(this.state.selectedItem);fe.height=se||"auto"}}else ue.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,ue.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,ue.style=m(m({},ue.style),{},{height:this.state.itemSize}),fe.height=this.state.itemSize;return e.default.createElement("div",{"aria-label":this.props.ariaLabel,className:n.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},e.default.createElement("div",{className:n.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,ae,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:fe},B?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},ue,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&te,this.renderItems(),this.props.infiniteLoop&&re):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(P){return S.setListRef(P)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&te,this.renderItems(),this.props.infiniteLoop&&re)),this.props.renderArrowNext(this.onClickNext,Q,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),E}(e.default.Component);return Ai.default=A,k(A,"displayName","Carousel"),k(A,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:s.noop,onClickThumb:s.noop,onChange:s.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(C,E,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_PREV(!E),onClick:C})},renderArrowNext:function(C,E,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_NEXT(!E),onClick:C})},renderIndicator:function(C,E,T,S){return e.default.createElement("li",{className:n.default.DOT(E),onClick:C,onKeyDown:C,value:T,key:T,role:"button",tabIndex:0,"aria-label":"".concat(S," ").concat(T+1)})},renderItem:function(C){return C},renderThumbs:function(C){var E=e.Children.map(C,function(T){var S=T;if(T.type!=="img"&&(S=e.Children.toArray(T.props.children).find(function(B){return B.type==="img"})),!!S)return S});return E.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"),[]):E},statusFormatter:s.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:a.slideSwipeAnimationHandler,stopSwipingHandler:a.slideStopSwipingHandler}),Ai}var Zl={},Jl;function jg(){return Jl||(Jl=1),Zl}var Ql;function Kg(){return Ql||(Ql=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=i(Yg()),n=jg(),r=i(Kc());function i(o){return o&&o.__esModule?o:{default:o}}}(ja)),ja}var Zg=Kg(),Ka,eu;function Jg(){if(eu)return Ka;eu=1;var e=mh(),t=function(){return e.Date.now()};return Ka=t,Ka}var Za,tu;function Jc(){if(tu)return Za;tu=1;var e=Tc(),t=Jg(),n=Dc(),r="Expected a function",i=Math.max,o=Math.min;function s(a,l,u){var c,d,g,h,m,p,v=0,w=!1,b=!1,x=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,e(u)&&(w=!!u.leading,b="maxWait"in u,g=b?i(n(u.maxWait)||0,l):g,x="trailing"in u?!!u.trailing:x);function O(E){var T=c,S=d;return c=d=void 0,v=E,h=a.apply(S,T),h}function R(E){return v=E,m=setTimeout(I,l),w?O(E):h}function M(E){var T=E-p,S=E-v,B=l-T;return b?o(B,g-S):B}function _(E){var T=E-p,S=E-v;return p===void 0||T>=l||T<0||b&&S>=g}function I(){var E=t();if(_(E))return k(E);m=setTimeout(I,M(E))}function k(E){return m=void 0,x&&c?O(E):(c=d=void 0,h)}function A(){m!==void 0&&clearTimeout(m),v=0,c=p=d=m=void 0}function D(){return m===void 0?h:k(t())}function C(){var E=t(),T=_(E);if(c=arguments,d=this,p=E,T){if(m===void 0)return R(p);if(b)return clearTimeout(m),m=setTimeout(I,l),O(p)}return m===void 0&&(m=setTimeout(I,l)),h}return C.cancel=A,C.flush=D,C}return Za=s,Za}var Qg=Jc();const Qc=lr(Qg);function bn(e,t,n,r,i=!1){const o=f.useRef();o.current=t,f.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const s=n,a=l=>{o.current?.call(s,l)};return s.addEventListener(e,a,{passive:r,capture:i}),()=>{s.removeEventListener(e,a,{capture:i})}},[e,n,r,i])}function Cr(e,t){return e===void 0?void 0:t}const em=Math.PI;function nu(e){return e*em/180}const ed=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),td=(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}},nd=(e,t,n)=>Math.min(e,t-n*2),rd=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Ns=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),f.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},tm=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function nm(e,t,n){const[r,i]=f.useState(e),o=f.useRef(!0);f.useEffect(()=>()=>{o.current=!1},[]);const s=f.useRef(Qc(a=>{o.current&&i(a)},n));return f.useLayoutEffect(()=>{o.current&&s.current(()=>e())},t),r}const rm="֑-߿יִ-﷽ﹰ-ﻼ",im="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",om=new RegExp("^[^"+im+"]*["+rm+"]");function Bs(e){return om.test(e)?"rtl":"not-rtl"}let Ho;function Ss(){if(typeof document>"u")return 0;if(Ho!==void 0)return Ho;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(),Ho=n-r,Ho}const zr=Symbol();function am(e){const t=f.useRef([zr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=f.useState(e),[,i]=f.useState(),o=f.useCallback(a=>{const l=t.current[0];l!==zr&&(a=typeof a=="function"?a(l):a,a===l)||(l!==zr&&i({}),r(u=>typeof a=="function"?a(l===zr?u:l):a),t.current[0]=zr)},[]),s=f.useCallback(()=>{t.current[0]=zr,i({})},[]);return[t.current[0]===zr?n:t.current[0],o,s]}function id(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 sm(e){const t=f.useRef(e);return vi(e,t.current)||(t.current=e),t.current}const lm=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(a=>a!=="");if(o.length===0)return null;const s=o.length>1;return f.createElement(Wg,{"data-testid":"GDG-default-image-overlay-editor"},f.createElement(Zg.Carousel,{showArrows:s,showThumbs:!1,swipeable:s,emulateTouch:s,infiniteLoop:s},o.map(a=>{const l=i?.(a)??f.createElement("img",{draggable:!1,src:a});return f.createElement("div",{className:"gdg-centering-container",key:a},l)})),n&&r&&f.createElement("button",{className:"gdg-edit-icon",onClick:r},f.createElement(Ns,null)))};function od(){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 Ur=od();function um(e){Ur=e}const ad=/[&<>"']/,cm=new RegExp(ad.source,"g"),sd=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,dm=new RegExp(sd.source,"g"),fm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ru=e=>fm[e];function gn(e,t){if(t){if(ad.test(e))return e.replace(cm,ru)}else if(sd.test(e))return e.replace(dm,ru);return e}const hm=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ld(e){return e.replace(hm,(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 gm=/(^|[^\[])\^/g;function Lt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(gm,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const mm=/[^\w:]/g,pm=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function iu(e,t,n){if(e){let r;try{r=decodeURIComponent(ld(n)).replace(mm,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!pm.test(n)&&(n=ym(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const zo={},vm=/^[^:]+:\/*[^/]*$/,bm=/^([^:]+:)[\s\S]*$/,wm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function ym(e,t){zo[" "+e]||(vm.test(e)?zo[" "+e]=e+"/":zo[" "+e]=Ko(e,"/",!0)),e=zo[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(bm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(wm,"$1")+t:e+t}const ra={exec:function(){}};function ou(e,t){const n=e.replace(/\|/g,(o,s,a)=>{let l=!1,u=s;for(;--u>=0&&a[u]==="\\";)l=!l;return l?"|":" |"}),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function Ko(e,t,n){const r=e.length;if(r===0)return"";let i=0;for(;i<r;){const o=e.charAt(r-i-1);if(o===t&&!n)i++;else if(o!==t&&n)i++;else break}return e.slice(0,r-i)}function Cm(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 Sm(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function au(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function su(e,t,n,r){const i=t.href,o=t.title?gn(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:i,title:o,text:gn(s)}}function xm(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
3
3
  `).map(i=>{const o=i.match(/^\s+/);if(o===null)return i;const[s]=o;return s.length>=r.length?i.slice(r.length):i}).join(`
4
4
  `)}class Ws{constructor(t){this.options=t||Ur}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Ko(r,`
5
5
  `)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],i=xm(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:i}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){const i=Ko(r,"#");(this.options.pedantic||!i||/ $/.test(i))&&(r=i.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const r=n[0].replace(/^ *>[ \t]?/gm,""),i=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(r);return this.lexer.state.top=i,{type:"blockquote",raw:n[0],tokens:o,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r,i,o,s,a,l,u,c,d,g,h,m,p=n[1].trim();const v=p.length>1,w={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,s)),i=s+1,a===`
170
170
  `&&(n.push(r),r=[])):a==='"'&&(o=t.inString);break;case t.inString:a==='"'&&(o=t.inStringPostQuote);break;case t.inStringPostQuote:a==='"'?o=t.inString:((a===" "||a===`
171
171
  `)&&(r.push(Pu(e.slice(i,s))),i=s+1,a===`
172
- `&&(n.push(r),r=[])),o=t.None);break}s++}return i<e.length&&r.push(Pu(e.slice(i,e.length))),n.push(r),n.map(a=>a.map(l=>({rawValue:l,formatted:l,format:"string"})))}function _u(e,t,n){const r=W0(e,t),i=a=>{window.navigator.clipboard?.writeText(a)},o=(a,l)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([a],{type:"text/plain"}),"text/html":new Blob([l],{type:"text/html"})})]),!0),s=(a,l)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",a),n?.clipboardData?.setData("text/html",l)}catch{o(a,l)||i(a)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?s(r.textPlain,r.textHtml):i(r.textPlain),n?.preventDefault()}function Ad(e){return e!==!0}function Fu(e){return typeof e=="string"?e:`${e}px`}const G0=()=>e=>e.innerWidth,X0=()=>e=>e.innerHeight,Y0=un("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[G0()],"wmyidgi-1":[X0()]}}),j0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return f.createElement(Y0,{innerHeight:Fu(n),innerWidth:Fu(t),...i},r)},K0=2,Z0=1300;function J0(e,t,n){const r=Vt.useRef(0),[i,o]=e??[0,0];Vt.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let s=!1,a=0;const l=u=>{if(!s){if(a===0)a=u;else{const c=u-a;r.current=Math.min(1,r.current+c/Z0);const d=r.current**1.618*c*K0;t.current?.scrollBy(i*d,o*d),a=u,n?.()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{s=!0}},[t,i,o,n])}function Q0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:s,remSize:a}){const[l,u,c,d,g,h]=Vt.useMemo(()=>{if(!s||a===16)return[e,t,n,r,i,o];const m=a/16,p=e,v=Cd();return[typeof p=="number"?p*m:w=>Math.ceil(p(w)*m),Math.ceil(t*m),Math.ceil(n*m),{...r,headerIconSize:(r?.headerIconSize??v.headerIconSize)*m,cellHorizontalPadding:(r?.cellHorizontalPadding??v.cellHorizontalPadding)*m,cellVerticalPadding:(r?.cellVerticalPadding??v.cellVerticalPadding)*m},Math.ceil((i??0)*m),Math.ceil((o??0)*m)]},[n,t,i,o,a,e,s,r]);return{rowHeight:l,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:g,overscrollY:h}}const yr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function st(e,t){return e===!0?t:e===!1?"":e}function Lu(e){const t=aa.value;return{activateCell:st(e.activateCell," |Enter|shift+Enter"),clear:st(e.clear,"any+Escape"),closeOverlay:st(e.closeOverlay,"any+Escape"),acceptOverlayDown:st(e.acceptOverlayDown,"Enter"),acceptOverlayUp:st(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:st(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:st(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:st(e.delete,t?"Backspace|Delete":"Delete"),downFill:st(e.downFill,"primary+_68"),scrollToSelectedCell:st(e.scrollToSelectedCell,"primary+Enter"),goDownCell:st(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:st(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:st(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:st(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:st(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:st(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:st(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:st(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:st(e.goToFirstCell,"primary+Home"),goToFirstColumn:st(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:st(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:st(e.goToLastCell,"primary+End"),goToLastColumn:st(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:st(e.goToLastRow,"primary+ArrowDown"),goToNextPage:st(e.goToNextPage,"PageDown"),goToPreviousPage:st(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:st(e.rightFill,"primary+_82"),search:st(e.search,"primary+f"),selectAll:st(e.selectAll,"primary+a"),selectColumn:st(e.selectColumn,"ctrl+ "),selectGrowDown:st(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:st(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:st(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:st(e.selectGrowUp,"shift+ArrowUp"),selectRow:st(e.selectRow,"shift+ "),selectToFirstCell:st(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:st(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:st(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:st(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:st(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:st(e.selectToLastRow,"primary+shift+ArrowDown")}}function ev(e){const t=sm(e);return Vt.useMemo(()=>{if(t===void 0)return Lu(yr);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??yr.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??yr.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??yr.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??yr.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??yr.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??yr.selectToLastCell};return Lu({...yr,...n})},[t])}function tv(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const s={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(s.subGroups=r.subGroups.map((a,l)=>t(a,i+1,[...o,l])).sort((a,l)=>a.headerIndex-l.headerIndex)),s}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function Js(e,t){const n=[];function r(a,l,u=!1){let c=l!==null?l-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(c=a.subGroups[0].headerIndex-a.headerIndex),c--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:u,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:c}),a.subGroups)for(let d=0;d<a.subGroups.length;d++){const g=d<a.subGroups.length-1?a.subGroups[d+1].headerIndex:l;r(a.subGroups[d],g,u||a.isCollapsed)}}const i=tv(e.groups);for(let a=0;a<i.length;a++){const l=a<i.length-1?i[a+1].headerIndex:null;r(i[a],l)}let o=0,s=0;for(const a of n)a.contentIndex=s,s+=a.rows,a.rowIndex=o,o+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:l,...u}=a;return u})}function Ts(e,t){if(t===void 0||Js.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(r.isCollapsed)n--;else{if(n<=r.rows)return{path:[...r.path,n-1],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n-1,contentIndex:r.contentIndex+n-1,groupRows:r.rows};n=n-r.rows-1}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function nv(e,t,n,r){const i=Vt.useMemo(()=>e===void 0?void 0:Js(e,t),[e,t]),o=Vt.useMemo(()=>i?.reduce((c,d)=>(c[d.rowIndex]=d,c),{}),[i]),s=Vt.useMemo(()=>i===void 0?t:i.reduce((c,d)=>c+(d.isCollapsed?1:d.rows+1),0),[i,t]),a=Vt.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>o?.[c]?e.height:typeof n=="number"?n:n(c),[o,e,n]),l=Vt.useCallback(c=>{if(i===void 0)return c;let d=c;for(const g of i){if(d===0)return;if(d--,!g.isCollapsed){if(d<g.rows)return g.contentIndex+d;d-=g.rows}}return c},[i]),u=Cr(r??e?.themeOverride,Vt.useCallback(c=>{if(e===void 0)return r?.(c,c,c);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:d,contentIndex:g,groupIndex:h}=Ts(c,i);return d?e.themeOverride:r?.(c,h,g)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:l,getRowThemeOverride:u}:{rowHeight:a,rows:s,rowNumberMapper:l,getRowThemeOverride:u}}function rv(e,t){const n=Vt.useMemo(()=>e===void 0?void 0:Js(e,t),[e,t]);return{getRowGroupingForPath:zd,updateRowGroupingByPath:Hd,mapper:Vt.useCallback(r=>{if(typeof r=="number")return Ts(r,n);const i=Ts(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function Hd(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,s)=>s===r?{...o,...n}:o):e.map((o,s)=>s===r?{...o,subGroups:Hd(o.subGroups??[],i,n)}:o)}function zd(e,t){const[n,...r]=t;return r[0]===-1?e[n]:zd(e[n].subGroups??[],r)}function iv(e,t){const[n]=f.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}));return n.callback=t,n.facade}function ov(e,t,n,r,i){const[o,s]=f.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),a=f.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:s}),[r,s,o]),[l,u,c]=am(a),d=f.useRef(i);d.current=i;const g=iv(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.scrollLeft=e)}),h=(l.height??1)>1;f.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&h){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&c(),d.current()}},[t,h,c,g]);const m=(l.width??1)>1;return f.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&m){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&c(),d.current()}},[e,m,c,g]),{visibleRegion:l,setVisibleRegion:u,scrollRef:g}}const av=f.lazy(async()=>await As(()=>import("./data-grid-overlay-editor.DbNsQa8Y.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url));let sv=0;function lv(e){return cp(Cu(Cu(e).filter(t=>t.span!==void 0).map(t=>kr((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function $o(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const No={kind:J.Loading,allowOverlay:!1},Bo={columns:ot.empty(),rows:ot.empty(),current:void 0},uv=(e,t)=>{const[n,r]=f.useState(Bo),[i,o]=f.useState(),s=f.useRef(null),a=f.useRef(null),[l,u]=f.useState(),c=f.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:h,markdownDivCreateNode:m,width:p,height:v,columns:w,rows:b,getCellContent:x,onCellClicked:O,onCellActivated:R,onFillPattern:M,onFinishedEditing:_,coercePasteValue:I,drawHeader:k,drawCell:A,editorBloom:D,onHeaderClicked:C,onColumnProposeMove:E,rangeSelectionColumnSpanning:T=!0,spanRangeBehavior:S="default",onGroupHeaderClicked:B,onCellContextMenu:X,className:Y,onHeaderContextMenu:ae,getCellsForSelection:Q,onGroupHeaderContextMenu:ee,onGroupHeaderRenamed:re,onCellEdited:te,onCellsEdited:ue,onSearchResultsChanged:fe,searchResults:se,onSearchValueChange:H,searchValue:P,onKeyDown:G,onKeyUp:ce,keybindings:he,editOnType:Ie=!0,onRowAppended:me,onColumnAppended:Qe,onColumnMoved:xe,validateCell:At,highlightRegions:Xe,rangeSelect:qe="rect",columnSelect:ne="multi",rowSelect:ge="multi",rangeSelectionBlending:Ce="exclusive",columnSelectionBlending:de="exclusive",rowSelectionBlending:Se="exclusive",onDelete:Ee,onDragStart:De,onMouseMove:tt,onPaste:Oe,copyHeaders:Fe=!1,freezeColumns:Ve=0,cellActivationBehavior:Te="second-click",rowSelectionMode:Me="auto",onHeaderMenuClick:pt,onHeaderIndicatorClick:ht,getGroupDetails:Ye,rowGrouping:xt,onSearchClose:Yt,onItemHovered:Ht,onSelectionCleared:Mt,showSearch:cn,onVisibleRegionChanged:Ut,gridSelection:tn,onGridSelectionChange:Tt,minColumnWidth:yt=50,maxColumnWidth:nn=500,maxColumnAutoWidth:ut,provideEditor:rn,trailingRowOptions:Nt,freezeTrailingRows:Pe=0,allowedFillDirections:Dt="orthogonal",scrollOffsetX:Rt,scrollOffsetY:Mn,verticalBorder:qt,onDragOverCell:dn,onDrop:Rn,onColumnResize:Zt,onColumnResizeEnd:Jt,onColumnResizeStart:We,customRenderers:Ot,fillHandle:yn,experimental:vt,fixedShadowX:_t,fixedShadowY:Cn,headerIcons:er,imageWindowLoader:zn,initialSize:$,isDraggable:$e,onDragLeave:Ge,onRowMoved:Ct,overscrollX:mn,overscrollY:sn,preventDiagonalScrolling:be,rightElement:dt,rightElementProps:bt,trapFocus:jt=!1,smoothScrollX:Gt,smoothScrollY:qn,scaleToRem:ho=!1,rowHeight:ka=34,headerHeight:go=36,groupHeaderHeight:Er=go,theme:cr,isOutsideClick:Ma,renderers:wi,resizeIndicator:mo,scrollToActiveCell:yi=!0,drawFocusRing:Tr=!0,portalElementRef:ml}=e,Ci=Tr==="no-editor"?i===void 0:Tr,Pn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,Sn=Pn?.kind??e.rowMarkers??"none",Si=Pn?.width??e.rowMarkerWidth,tr=Pn?.startIndex??e.rowMarkerStartIndex??1,nr=Pn?.theme??e.rowMarkerTheme,Yr=Pn?.headerTheme,dr=Pn?.headerAlwaysVisible,Dr=ge!=="multi"||Pn?.headerDisabled===!0,jr=Pn?.checkboxStyle??"square",rr=Math.max(yt,20),Kr=Math.max(nn,rr),Ra=Math.max(ut??Kr,rr),po=f.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Le,rowNumberMapper:xi,rowHeight:vo,getRowThemeOverride:fr}=nv(xt,b,ka,h),Ia=f.useMemo(()=>Number.parseFloat(po.fontSize),[po]),{rowHeight:Gn,headerHeight:ki,groupHeaderHeight:bo,theme:wo,overscrollX:Mi,overscrollY:Ea}=Q0({groupHeaderHeight:Er,headerHeight:go,overscrollX:mn,overscrollY:sn,remSize:Ia,rowHeight:vo,scaleToRem:ho,theme:cr}),Xn=ev(he),hr=Si??(b>1e4?48:b>1e3?44:b>100?36:32),_n=Sn!=="none",U=_n?1:0,Ft=Nt!==void 0,ir=Nt?.sticky===!0,[Ri,yo]=f.useState(!1),Zr=cn??Ri,Ta=f.useCallback(()=>{Yt!==void 0?Yt():yo(!1)},[Yt]),K=f.useMemo(()=>tn===void 0?void 0:$o(tn,U),[tn,U])??n,xn=f.useRef();xn.current===void 0&&(xn.current=new AbortController),f.useEffect(()=>()=>xn?.current.abort(),[]);const[z,ie]=H0(Q,x,U,xn.current,Le),ke=f.useCallback((y,L,F)=>{if(At===void 0)return!0;const W=[y[0]-U,y[1]];return At?.(W,L,F)},[U,At]),Re=f.useRef(tn),oe=f.useCallback((y,L)=>{L&&(y=U0(y,z,U,S,xn.current)),Tt!==void 0?(Re.current=$o(y,-U),Tt(Re.current)):r(y)},[Tt,z,U,S]),ve=Cr(Zt,f.useCallback((y,L,F,W)=>{Zt?.(w[F-U],L,F-U,W)},[Zt,U,w])),je=Cr(Jt,f.useCallback((y,L,F,W)=>{Jt?.(w[F-U],L,F-U,W)},[Jt,U,w])),we=Cr(We,f.useCallback((y,L,F,W)=>{We?.(w[F-U],L,F-U,W)},[We,U,w])),Ke=Cr(k,f.useCallback((y,L)=>k?.({...y,columnIndex:y.columnIndex-U},L)??!1,[k,U])),ct=Cr(A,f.useCallback((y,L)=>A?.({...y,col:y.col-U},L)??!1,[A,U])),Qt=f.useCallback(y=>{if(Ee!==void 0){const L=Ee($o(y,-U));return typeof L=="boolean"?L:$o(L,U)}return!0},[Ee,U]),[ft,It,nt]=A0(K,oe,Ce,de,Se,qe,T),et=f.useMemo(()=>ar(Cd(),wo),[wo]),[zt,Bt]=f.useState([0,0,0]),Or=f.useMemo(()=>{if(wi===void 0)return{};const y={};for(const L of wi)y[L.kind]=L;return y},[wi]),en=f.useCallback(y=>y.kind!==J.Custom?Or[y.kind]:Ot?.find(L=>L.isMatch(y)),[Ot,Or]);let{sizedColumns:on,nonGrowWidth:gr}=tp(w,Le,ie,zt[0]-(U===0?0:hr)-zt[2],rr,Ra,et,en,xn.current);Sn!=="none"&&(gr+=hr);const Pt=f.useMemo(()=>on.some(y=>y.group!==void 0),[on]),kn=Pt?ki+bo:ki,In=K.rows.length,mr=Sn==="none"?void 0:In===0?!1:In===Le?!0:void 0,rt=f.useMemo(()=>Sn==="none"?on:[{title:"",width:hr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:nr,rowMarker:jr,rowMarkerChecked:mr,headerRowMarkerTheme:Yr,headerRowMarkerAlwaysVisible:dr,headerRowMarkerDisabled:Dr},...on],[Sn,on,hr,nr,jr,mr,Yr,dr,Dr]),ln=f.useRef({height:1,width:1,x:0,y:0}),Yn=f.useRef(!1),{setVisibleRegion:pl,visibleRegion:Pr,scrollRef:Wt}=ov(Rt,Mn,Gn,ln,()=>Yn.current=!0);ln.current=Pr;const Lf=Pr.x+U,Co=Pr.y,fn=f.useRef(null),pn=f.useCallback(y=>{y===!0?fn.current?.focus():window.requestAnimationFrame(()=>{fn.current?.focus()})},[]),hn=Ft?Le+1:Le,Fn=f.useCallback(y=>{const L=U===0?y:y.map(W=>({...W,location:[W.location[0]-U,W.location[1]]})),F=ue?.(L);if(F!==!0)for(const W of L)te?.(W.location,W.value);return F},[te,ue,U]),[_r,Da]=f.useState(),So=K.current!==void 0&&K.current.range.width*K.current.range.height>1?K.current.range:void 0,vl=Ci?K.current?.cell:void 0,xo=vl?.[0],ko=vl?.[1],Af=f.useMemo(()=>{if((Xe===void 0||Xe.length===0)&&(So??xo??ko??_r)===void 0)return;const y=[];if(Xe!==void 0)for(const L of Xe){const F=rt.length-L.range.x-U;F>0&&y.push({color:L.color,range:{...L.range,x:L.range.x+U,width:Math.min(F,L.range.width)},style:L.style})}return _r!==void 0&&y.push({color:Br(et.accentColor,0),range:_r,style:"dashed"}),So!==void 0&&y.push({color:Br(et.accentColor,.5),range:So,style:"solid-outline"}),xo!==void 0&&ko!==void 0&&y.push({color:et.accentColor,range:{x:xo,y:ko,width:1,height:1},style:"solid-outline"}),y.length>0?y:void 0},[_r,So,xo,ko,Xe,rt.length,et.accentColor,U]),bl=f.useRef(rt);bl.current=rt;const En=f.useCallback(([y,L],F=!1)=>{const W=Ft&&L===hn-1;if(y===0&&_n){if(W)return No;const j=xi(L);return j===void 0?No:{kind:Hn.Marker,allowOverlay:!1,checkboxStyle:jr,checked:K?.rows.hasIndex(L)===!0,markerKind:Sn==="clickable-number"?"number":Sn,row:tr+j,drawHandle:Ct!==void 0,cursor:Sn==="clickable-number"?"pointer":void 0}}else if(W){const V=y===U?Nt?.hint??"":"",N=bl.current[y];if(N?.trailingRowOptions?.disabled===!0)return No;{const Z=N?.trailingRowOptions?.hint??V,le=N?.trailingRowOptions?.addIcon??Nt?.addIcon;return{kind:Hn.NewRow,hint:Z,allowOverlay:!1,icon:le}}}else{const j=y-U;if(F||vt?.strict===!0){const N=ln.current,Z=N.x>j||j>N.x+N.width||N.y>L||L>N.y+N.height||L>=Fa.current,le=j===N.extras?.selected?.[0]&&L===N.extras?.selected[1];let pe=!1;if(N.extras?.freezeRegions!==void 0){for(const St of N.extras.freezeRegions)if(Nr(St,j,L)){pe=!0;break}}if(Z&&!le&&!pe)return No}let V=x([j,L]);return U!==0&&V.span!==void 0&&(V={...V,span:[V.span[0]+U,V.span[1]+U]}),V}},[Ft,hn,_n,xi,jr,K?.rows,Sn,tr,Ct,U,Nt?.hint,Nt?.addIcon,vt?.strict,x]),Oa=f.useCallback(y=>{let L=Ye?.(y)??{name:y};return re!==void 0&&y!==""&&(L={icon:L.icon,name:L.name,overrideTheme:L.overrideTheme,actions:[...L.actions??[],{title:"Rename",icon:"renameIcon",onClick:F=>Aa({group:L.name,bounds:F.bounds})}]}),L},[Ye,re]),Mo=f.useCallback(y=>{const[L,F]=y.cell,W=rt[L],q=W?.group!==void 0?Oa(W.group)?.overrideTheme:void 0,j=W?.themeOverride,V=fr?.(F);o({...y,theme:ar(et,q,j,V,y.content.themeOverride)})},[fr,rt,Oa,et]),Jr=f.useCallback((y,L,F)=>{if(K.current===void 0)return;const[W,q]=K.current.cell,j=En([W,q]);if(j.kind!==J.Boolean&&j.allowOverlay){let V=j;if(F!==void 0)switch(V.kind){case J.Number:{const N=Fg(()=>F==="-"?-0:Number.parseFloat(F),0);V={...V,data:Number.isNaN(N)?0:N};break}case J.Text:case J.Markdown:case J.Uri:V={...V,data:F};break}Mo({target:y,content:V,initialValue:F,cell:[W,q],highlight:F===void 0,forceEditMode:F!==void 0})}else j.kind===J.Boolean&&L&&j.readonly!==!0&&(Fn([{location:K.current.cell,value:{...j,data:Ad(j.data)}}]),fn.current?.damage([{cell:K.current.cell}]))},[En,K,Fn,Mo]),wl=f.useCallback((y,L)=>{const F=fn.current?.getBounds(y,L);if(F===void 0||Wt.current===null)return;const W=En([y,L]);W.allowOverlay&&Mo({target:F,content:W,initialValue:void 0,highlight:!0,cell:[y,L],forceEditMode:!0})},[En,Wt,Mo]),Xt=f.useCallback((y,L,F="both",W=0,q=0,j=void 0)=>{if(Wt.current!==null){const V=fn.current,N=a.current,Z=typeof y!="number"?y.unit==="cell"?y.amount:void 0:y,le=typeof L!="number"?L.unit==="cell"?L.amount:void 0:L,pe=typeof y!="number"&&y.unit==="px"?y.amount:void 0,St=typeof L!="number"&&L.unit==="px"?L.amount:void 0;if(V!==null&&N!==null){let it={x:0,y:0,width:0,height:0},Ze=0,Je=0;if((Z!==void 0||le!==void 0)&&(it=V.getBounds((Z??0)+U,le??0)??it,it.width===0||it.height===0))return;const gt=N.getBoundingClientRect(),kt=gt.width/N.offsetWidth;if(pe!==void 0&&(it={...it,x:pe-gt.left-Wt.current.scrollLeft,width:1}),St!==void 0&&(it={...it,y:St+gt.top-Wt.current.scrollTop,height:1}),it!==void 0){const wt={x:it.x-W,y:it.y-q,width:it.width+2*W,height:it.height+2*q};let ii=0;for(let Wa=0;Wa<Ve;Wa++)ii+=on[Wa].width;let Fi=0;const Li=Pe+(ir?1:0);Li>0&&(Fi=Gr(hn,Li,Gn));let Kn=ii*kt+gt.left+U*hr*kt,oi=gt.right,Hr=gt.top+kn*kt,ai=gt.bottom-Fi*kt;const Po=it.width+W*2;switch(j?.hAlign){case"start":oi=Kn+Po;break;case"end":Kn=oi-Po;break;case"center":Kn=Math.floor((Kn+oi)/2)-Po/2,oi=Kn+Po;break}const _o=it.height+q*2;switch(j?.vAlign){case"start":ai=Hr+_o;break;case"end":Hr=ai-_o;break;case"center":Hr=Math.floor((Hr+ai)/2)-_o/2,ai=Hr+_o;break}Kn>wt.x?Ze=wt.x-Kn:oi<wt.x+wt.width&&(Ze=wt.x+wt.width-oi),Hr>wt.y?Je=wt.y-Hr:ai<wt.y+wt.height&&(Je=wt.y+wt.height-ai),F==="vertical"||typeof y=="number"&&y<Ve?Ze=0:(F==="horizontal"||typeof L=="number"&&L>=hn-Li)&&(Je=0),(Ze!==0||Je!==0)&&(kt!==1&&(Ze/=kt,Je/=kt),Wt.current.scrollTo({left:Ze+Wt.current.scrollLeft,top:Je+Wt.current.scrollTop,behavior:j?.behavior??"auto"}))}}}},[U,Pe,hr,Wt,kn,Ve,on,hn,ir,Gn]),Pa=f.useRef(wl),_a=f.useRef(x);Pa.current=wl,_a.current=x;const Fa=f.useRef(Le);Fa.current=Le;const yl=f.useRef(rt.length);yl.current=rt.length;const pr=f.useCallback(async(y,L=!0,F)=>{if(rt[y]?.trailingRowOptions?.disabled===!0)return;const q=me?.();let j,V=!0;q!==void 0&&(j=await q,j==="top"&&(V=!1),typeof j=="number"&&(V=!1));let N=0;const Z=()=>{if(Fa.current<=Le){N<500&&window.setTimeout(Z,N),N=50+N*2;return}const le=typeof j=="number"?j:V?Le:0;Oo.current(y-U,le,"both",0,0,F?{behavior:F}:void 0),ft({cell:[y,le],range:{x:y,y:le,width:1,height:1}},!1,!1,"edit");const pe=_a.current([y-U,le]);pe.allowOverlay&&di(pe)&&pe.readonly!==!0&&L&&window.setTimeout(()=>{Pa.current(y,le)},0)};Z()},[rt,me,U,Le,ft]),Ro=f.useCallback(async(y,L=!0)=>{const F=Qe?.();let W,q=!0;F!==void 0&&(W=await F,W==="left"&&(q=!1),typeof W=="number"&&(q=!1));let j=0;const V=()=>{if(yl.current<=rt.length){j<500&&window.setTimeout(V,j),j=50+j*2;return}const N=typeof W=="number"?W:q?rt.length:0;Xt(N-U,y),ft({cell:[N,y],range:{x:N,y,width:1,height:1}},!1,!1,"edit");const Z=_a.current([N-U,y]);Z.allowOverlay&&di(Z)&&Z.readonly!==!0&&L&&window.setTimeout(()=>{Pa.current(N,y)},0)};V()},[rt,Qe,U,Xt,ft]),Qr=f.useCallback(y=>{const L=on[y]?.trailingRowOptions?.targetColumn??Nt?.targetColumn;if(typeof L=="number")return L+(_n?1:0);if(typeof L=="object"){const F=w.indexOf(L);if(F>=0)return F+(_n?1:0)}},[on,w,_n,Nt?.targetColumn]),vr=f.useRef(),ei=f.useRef(),Ei=f.useCallback((y,L)=>{const[F,W]=L;return ar(et,rt[F]?.themeOverride,fr?.(W),y.themeOverride)},[fr,rt,et]),{mapper:Fr}=rv(xt,b),Vn=xt?.navigationBehavior,Ti=f.useCallback(y=>{const L=aa.value?y.metaKey:y.ctrlKey,F=L&&ge==="multi",W=L&&ne==="multi",[q,j]=y.location,V=K.columns,N=K.rows,[Z,le]=K.current?.cell??[];if(y.kind==="cell"){if(ei.current=void 0,Lr.current=[q,j],q===0&&_n){if(Ft===!0&&j===Le||Sn==="number"||ge==="none")return;const pe=En(y.location);if(pe.kind!==Hn.Marker)return;if(Ct!==void 0){const Ze=en(pe);Dn(Ze?.kind===Hn.Marker);const Je=Ze?.onClick?.({...y,cell:pe,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,theme:Ei(pe,y.location),preventDefault:()=>{}});if(Je===void 0||Je.checked===pe.checked)return}o(void 0),pn();const St=N.hasIndex(j),it=vr.current;if(ge==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&it!==void 0&&N.hasIndex(it)){const Ze=[Math.min(it,j),Math.max(it,j)+1];F||Me==="multi"?It(void 0,Ze,!0):It(ot.fromSingleSelection(Ze),void 0,F)}else ge==="multi"&&(F||y.isTouch||Me==="multi")?St?It(N.remove(j),void 0,!0):(It(void 0,j,!0),vr.current=j):St&&N.length===1?It(ot.empty(),void 0,L):(It(ot.fromSingleSelection(j),void 0,L),vr.current=j)}else if(q>=U&&Ft&&j===Le){const pe=Qr(q);pr(pe??q)}else if(Z!==q||le!==j){const pe=En(y.location),St=en(pe);if(St?.onSelect!==void 0){let Je=!1;if(St.onSelect({...y,cell:pe,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,preventDefault:()=>Je=!0,theme:Ei(pe,y.location)}),Je)return}if(Vn==="block"&&Fr(j).isGroupHeader)return;const it=ir&&j===Le,Ze=ir&&K!==void 0&&K.current?.cell[1]===Le;if((y.shiftKey||y.isLongTouch===!0)&&Z!==void 0&&le!==void 0&&K.current!==void 0&&!Ze){if(it)return;const Je=Math.min(q,Z),gt=Math.max(q,Z),kt=Math.min(j,le),wt=Math.max(j,le);ft({...K.current,range:{x:Je,y:kt,width:gt-Je+1,height:wt-kt+1}},!0,L,"click"),vr.current=void 0,pn()}else ft({cell:[q,j],range:{x:q,y:j,width:1,height:1}},!0,L,"click"),vr.current=void 0,o(void 0),pn()}}else if(y.kind==="header")if(Lr.current=[q,j],o(void 0),_n&&q===0)vr.current=void 0,ei.current=void 0,!Dr&&ge==="multi"&&(N.length!==Le?It(ot.fromSingleSelection([0,Le]),void 0,L):It(ot.empty(),void 0,L),pn());else{const pe=ei.current;if(ne==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&pe!==void 0&&V.hasIndex(pe)){const St=[Math.min(pe,q),Math.max(pe,q)+1];W?nt(void 0,St,L):nt(ot.fromSingleSelection(St),void 0,L)}else W?(V.hasIndex(q)?nt(V.remove(q),void 0,L):nt(void 0,q,L),ei.current=q):ne!=="none"&&(V.hasIndex(q)?nt(V.remove(q),void 0,L):nt(ot.fromSingleSelection(q),void 0,L),ei.current=q);vr.current=void 0,pn()}else y.kind===An?Lr.current=[q,j]:y.kind===sa&&!y.isMaybeScrollbar&&(oe(Bo,!1),o(void 0),pn(),Mt?.(),vr.current=void 0,ei.current=void 0)},[ge,ne,K,_n,U,Ft,Le,Sn,En,Ct,pn,Me,en,Ei,It,Qr,pr,Vn,Fr,ir,ft,nt,oe,Mt]),Di=f.useRef(!1),Lr=f.useRef(),Cl=f.useRef(Pr),jn=f.useRef(),Hf=f.useCallback(y=>{if(ti.current=!1,Cl.current=ln.current,y.button!==0&&y.button!==1){jn.current=void 0;return}const L=performance.now();jn.current={button:y.button,time:L,location:y.location},y?.kind==="header"&&(Di.current=!0);const F=y.kind==="cell"&&y.isFillHandle;!F&&y.kind!=="cell"&&y.isEdge||(u({previousSelection:K,fillHandle:F}),Lr.current=void 0,!y.isTouch&&y.button===0&&!F?Ti(y):!y.isTouch&&y.button===1&&(Lr.current=y.location))},[K,Ti]),[La,Aa]=f.useState(),Sl=f.useCallback(y=>{if(y.kind!==An||ne!=="multi")return;const L=aa.value?y.metaKey:y.ctrlKey,[F]=y.location,W=K.columns;if(F<U)return;const q=rt[F];let j=F,V=F;for(let N=F-1;N>=U&&ro(q.group,rt[N].group);N--)j--;for(let N=F+1;N<rt.length&&ro(q.group,rt[N].group);N++)V++;if(pn(),L)if(W.hasAll([j,V+1])){let N=W;for(let Z=j;Z<=V;Z++)N=N.remove(Z);nt(N,void 0,L)}else nt(void 0,[j,V+1],L);else nt(ot.fromSingleSelection([j,V+1]),void 0,L)},[ne,pn,K.columns,rt,U,nt]),ti=f.useRef(!1),Io=f.useCallback(async y=>{if(z!==void 0&&ve!==void 0){const L=ln.current.y,F=ln.current.height;let W=z({x:y,y:L,width:1,height:Math.min(F,Le-L)},xn.current.signal);typeof W!="object"&&(W=await W());const q=on[y-U],V=document.createElement("canvas").getContext("2d",{alpha:!1});if(V!==null){V.font=et.baseFontFull;const N=xd(V,et,q,0,W,rr,Kr,!1,en);ve?.(q,N.width,y,N.width)}}},[on,z,Kr,et,rr,ve,U,Le,en]),[zf,Ha]=f.useState(),ni=f.useCallback(async(y,L)=>{const F=y.current?.range;if(F===void 0||z===void 0||L.current===void 0)return;const W=L.current.range;if(M!==void 0){let N=!1;if(M({fillDestination:{...W,x:W.x-U},patternSource:{...F,x:F.x-U},preventDefault:()=>N=!0}),N)return}let q=z(F,xn.current.signal);typeof q!="object"&&(q=await q());const j=q,V=[];for(let N=0;N<W.width;N++)for(let Z=0;Z<W.height;Z++){const le=[W.x+N,W.y+Z];if(fd(le,F))continue;const pe=j[Z%F.height][N%F.width];hi(pe)||!di(pe)||V.push({location:le,value:{...pe}})}Fn(V),fn.current?.damage(V.map(N=>({cell:N.location})))},[z,Fn,M,U]),xl=f.useCallback(()=>{if(K.current===void 0||K.current.range.width<=1)return;const y={...K,current:{...K.current,range:{...K.current.range,width:1}}};ni(y,K)},[ni,K]),kl=f.useCallback(()=>{if(K.current===void 0||K.current.range.height<=1)return;const y={...K,current:{...K.current,range:{...K.current.range,height:1}}};ni(y,K)},[ni,K]),Vf=f.useCallback((y,L)=>{const F=l;if(u(void 0),Da(void 0),Ha(void 0),Di.current=!1,L)return;if(F?.fillHandle===!0&&K.current!==void 0&&F.previousSelection?.current!==void 0){if(_r===void 0)return;const pe={...K,current:{...K.current,range:Ed(F.previousSelection.current.range,_r)}};ni(F.previousSelection,pe),oe(pe,!0);return}const[W,q]=y.location,[j,V]=Lr.current??[],N=()=>{ti.current=!0},Z=pe=>{const St=pe.isTouch||j===W&&V===q;if(St&&O?.([W-U,q],{...pe,preventDefault:N}),pe.button===1)return!ti.current;if(!ti.current){const it=En(y.location),Ze=en(it);if(Ze!==void 0&&Ze.onClick!==void 0&&St){const gt=Ze.onClick({...pe,cell:it,posX:pe.localEventX,posY:pe.localEventY,bounds:pe.bounds,theme:Ei(it,y.location),preventDefault:N});gt!==void 0&&!hi(gt)&&ci(gt)&&(Fn([{location:pe.location,value:gt}]),fn.current?.damage([{cell:pe.location}]))}if(ti.current||K.current===void 0)return!1;let Je=!1;switch(it.activationBehaviorOverride??Te){case"double-click":case"second-click":{if(F?.previousSelection?.current?.cell===void 0)break;const[gt,kt]=K.current.cell,[wt,ii]=F.previousSelection.current.cell;Je=W===gt&&W===wt&&q===kt&&q===ii&&(pe.isDoubleClick===!0||Te==="second-click");break}case"single-click":{Je=!0;break}}if(Je)return R?.([W-U,q]),Jr(pe.bounds,!1),!0}return!1},le=y.location[0]-U;if(y.isTouch){const pe=ln.current,St=Cl.current;if(pe.x!==St.x||pe.y!==St.y)return;if(y.isLongTouch===!0){if(y.kind==="cell"&&Ji(K.current?.cell,y.location)){X?.([le,y.location[1]],{...y,preventDefault:N});return}else if(y.kind==="header"&&K.columns.hasIndex(W)){ae?.(le,{...y,preventDefault:N});return}else if(y.kind===An){if(le<0)return;ee?.(le,{...y,preventDefault:N});return}}y.kind==="cell"?Z(y)||Ti(y):y.kind===An?B?.(le,{...y,preventDefault:N}):(y.kind===Sr&&C?.(le,{...y,preventDefault:N}),Ti(y));return}if(y.kind==="header"){if(le<0)return;y.isEdge?y.isDoubleClick===!0&&Io(W):y.button===0&&W===j&&q===V&&C?.(le,{...y,preventDefault:N})}if(y.kind===An){if(le<0)return;y.button===0&&W===j&&q===V&&(B?.(le,{...y,preventDefault:N}),ti.current||Sl(y))}y.kind==="cell"&&(y.button===0||y.button===1)&&Z(y),Lr.current=void 0},[l,K,U,_r,ni,oe,O,En,en,Te,Ei,Fn,R,Jr,X,ae,ee,Ti,B,C,Io,Sl]),$f=f.useCallback(y=>{const L={...y,location:[y.location[0]-U,y.location[1]]};tt?.(L),l!==void 0&&y.buttons===0&&(u(void 0),Da(void 0),Ha(void 0),Di.current=!1),Ha(F=>Di.current?[y.scrollEdge[0],0]:y.scrollEdge[0]===F?.[0]&&y.scrollEdge[1]===F[1]?F:l===void 0||(jn.current?.location[0]??0)<U?void 0:y.scrollEdge)},[l,tt,U]),Nf=f.useCallback((y,L)=>{pt?.(y-U,L)},[pt,U]),Bf=f.useCallback((y,L)=>{ht?.(y-U,L)},[ht,U]),ri=K?.current?.cell,Wf=f.useCallback((y,L,F,W,q,j)=>{Yn.current=!1;let V=ri;V!==void 0&&(V=[V[0]-U,V[1]]);const N=Ve===0?void 0:{x:0,y:y.y,width:Ve,height:y.height},Z=[];N!==void 0&&Z.push(N),Pe>0&&(Z.push({x:y.x-U,y:Le-Pe,width:y.width,height:Pe}),Ve>0&&Z.push({x:0,y:Le-Pe,width:Ve,height:Pe}));const le={x:y.x-U,y:y.y,width:y.width,height:Ft&&y.y+y.height>=Le?y.height-1:y.height,tx:q,ty:j,extras:{selected:V,freezeRegion:N,freezeRegions:Z}};ln.current=le,pl(le),Bt([L,F,W]),Ut?.(le,le.tx,le.ty,le.extras)},[ri,U,Ft,Le,Ve,Pe,pl,Ut]),Uf=Cr(E,f.useCallback((y,L)=>E?.(y-U,L-U)!==!1,[E,U])),qf=Cr(xe,f.useCallback((y,L)=>{xe?.(y-U,L-U),ne!=="none"&&nt(ot.fromSingleSelection(L),void 0,!0)},[ne,xe,U,nt])),za=f.useRef(!1),Gf=f.useCallback(y=>{if(y.location[0]===0&&U>0){y.preventDefault();return}De?.({...y,location:[y.location[0]-U,y.location[1]]}),y.defaultPrevented()||(za.current=!0),u(void 0)},[De,U]),Xf=f.useCallback(()=>{za.current=!1},[]),Ml=xt?.selectionBehavior,Eo=f.useCallback(y=>{if(Ml!=="block-spanning")return;const{isGroupHeader:L,path:F,groupRows:W}=Fr(y);if(L)return[y,y];const q=F[F.length-1],j=y-q,V=y+W-q-1;return[j,V]},[Fr,Ml]),Va=f.useRef(),$a=f.useCallback(y=>{if(!Fd(y,Va.current)&&(Va.current=y,!(jn?.current?.button!==void 0&&jn.current.button>=1))){if(y.buttons!==0&&l!==void 0&&jn.current?.location[0]===0&&y.location[0]===0&&U===1&&ge==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(jn.current.location[1])&&K.rows.hasIndex(jn.current.location[1])){const L=Math.min(jn.current.location[1],y.location[1]),F=Math.max(jn.current.location[1],y.location[1])+1;It(ot.fromSingleSelection([L,F]),void 0,!1)}if(y.buttons!==0&&l!==void 0&&K.current!==void 0&&!za.current&&!Di.current&&(qe==="rect"||qe==="multi-rect")){const[L,F]=K.current.cell;let[W,q]=y.location;if(q<0&&(q=ln.current.y),l.fillHandle===!0&&l.previousSelection?.current!==void 0){const j=l.previousSelection.current.range;q=Math.min(q,Ft?Le-1:Le);const V=Wp(j,W,q,Dt);Da(V)}else{if(Ft&&F===Le)return;if(Ft&&q===Le)if(y.kind===sa)q--;else return;W=Math.max(W,U);const N=Eo(F);q=N===void 0?q:Ln(q,N[0],N[1]);const Z=W-L,le=q-F,pe={x:Z>=0?L:W,y:le>=0?F:q,width:Math.abs(Z)+1,height:Math.abs(le)+1};ft({...K.current,range:pe},!0,!1,"drag")}}Ht?.({...y,location:[y.location[0]-U,y.location[1]]})}},[l,U,ge,K,qe,Ht,It,Ft,Le,Dt,Eo,ft]),Yf=f.useCallback(()=>{const y=Va.current;if(y===void 0)return;const[L,F]=y.scrollEdge;let[W,q]=y.location;const j=ln.current;L===-1?W=j.extras?.freezeRegion?.x??j.x:L===1&&(W=j.x+j.width),F===-1?q=Math.max(0,j.y):F===1&&(q=Math.min(Le-1,j.y+j.height)),W=Ln(W,0,rt.length-1),q=Ln(q,0,Le-1),$a({...y,location:[W,q]})},[rt.length,$a,Le]);J0(zf,Wt,Yf);const $n=f.useCallback(y=>{if(K.current===void 0)return;const[L,F]=y,[W,q]=K.current.cell,j=K.current.range;let V=j.x,N=j.x+j.width,Z=j.y,le=j.y+j.height;const[pe,St]=Eo(q)??[0,Le-1],it=St+1;if(F!==0)switch(F){case 2:{le=it,Z=q,Xt(0,le,"vertical");break}case-2:{Z=pe,le=q+1,Xt(0,Z,"vertical");break}case 1:{Z<q?(Z++,Xt(0,Z,"vertical")):(le=Math.min(it,le+1),Xt(0,le,"vertical"));break}case-1:{le>q+1?(le--,Xt(0,le,"vertical")):(Z=Math.max(pe,Z-1),Xt(0,Z,"vertical"));break}default:no()}if(L!==0)if(L===2)N=rt.length,V=W,Xt(N-1-U,0,"horizontal");else if(L===-2)V=U,N=W+1,Xt(V-U,0,"horizontal");else{let Ze=[];if(z!==void 0){const Je=z({x:V,y:Z,width:N-V-U,height:le-Z},xn.current.signal);typeof Je=="object"&&(Ze=lv(Je))}if(L===1){let Je=!1;if(V<W){if(Ze.length>0){const gt=kr(V+1,W+1).find(kt=>!Ze.includes(kt-U));gt!==void 0&&(V=gt,Je=!0)}else V++,Je=!0;Je&&Xt(V,0,"horizontal")}Je||(N=Math.min(rt.length,N+1),Xt(N-1-U,0,"horizontal"))}else if(L===-1){let Je=!1;if(N>W+1){if(Ze.length>0){const gt=kr(N-1,W,-1).find(kt=>!Ze.includes(kt-U));gt!==void 0&&(N=gt,Je=!0)}else N--,Je=!0;Je&&Xt(N-U,0,"horizontal")}Je||(V=Math.max(U,V-1),Xt(V-U,0,"horizontal"))}else no()}ft({cell:K.current.cell,range:{x:V,y:Z,width:N-V,height:le-Z}},!0,!1,"keyboard-select")},[z,Eo,K,rt.length,U,Le,Xt,ft]),Na=f.useRef(yi);Na.current=yi;const br=f.useCallback((y,L,F,W)=>{const q=hn-(F?0:1);y=Ln(y,U,on.length-1+U),L=Ln(L,0,q);const j=ri?.[0],V=ri?.[1];if(y===j&&L===V)return!1;if(W&&K.current!==void 0){const N=[...K.current.rangeStack];(K.current.range.width>1||K.current.range.height>1)&&N.push(K.current.range),oe({...K,current:{cell:[y,L],range:{x:y,y:L,width:1,height:1},rangeStack:N}},!0)}else ft({cell:[y,L],range:{x:y,y:L,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===y&&c.current[1]===L&&(c.current=void 0),Na.current&&Xt(y-U,L),!0},[hn,U,on.length,ri,K,Xt,oe,ft]),jf=f.useCallback((y,L)=>{i?.cell!==void 0&&y!==void 0&&ci(y)&&(Fn([{location:i.cell,value:y}]),window.requestAnimationFrame(()=>{fn.current?.damage([{cell:i.cell}])})),pn(!0),o(void 0);const[F,W]=L;if(K.current!==void 0&&(F!==0||W!==0)){const q=K.current.cell[1]===hn-1&&y!==void 0,j=K.current.cell[0]===rt.length-1&&y!==void 0;let V=!0;if(q&&W===1&&me!==void 0){V=!1;const N=K.current.cell[0]+F,Z=Qr(N);pr(Z??N,!1)}if(j&&F===1&&Qe!==void 0){V=!1;const N=K.current.cell[1]+W;Ro(N,!1)}V&&br(Ln(K.current.cell[0]+F,0,rt.length-1),Ln(K.current.cell[1]+W,0,hn-1),q,!1)}_?.(y,L)},[i?.cell,pn,K,_,Fn,hn,br,rt.length,pr,Ro,me,Qe,Qr]),Kf=f.useMemo(()=>`gdg-overlay-${sv++}`,[]),Ar=f.useCallback(y=>{pn();const L=[];for(let F=y.x;F<y.x+y.width;F++)for(let W=y.y;W<y.y+y.height;W++){const q=x([F-U,W]);if(!q.allowOverlay&&q.kind!==J.Boolean)continue;let j;if(q.kind===J.Custom){const V=en(q),N=V?.provideEditor?.({...q,location:[F-U,W]});V?.onDelete!==void 0?j=V.onDelete(q):Lg(N)&&(j=N?.deletedValue?.(q))}else(ci(q)&&q.allowOverlay||q.kind===J.Boolean)&&(j=en(q)?.onDelete?.(q));j!==void 0&&!hi(j)&&ci(j)&&L.push({location:[F,W],value:j})}Fn(L),fn.current?.damage(L.map(F=>({cell:F.location})))},[pn,x,en,Fn,U]),Oi=i!==void 0,Rl=f.useCallback(y=>{const L=()=>{y.stopPropagation(),y.preventDefault()},F={didMatch:!1},{bounds:W}=y,q=K.columns,j=K.rows,V=Xn;if(!Oi&&at(V.clear,y,F))oe(Bo,!1),Mt?.();else if(!Oi&&at(V.selectAll,y,F))oe({columns:ot.empty(),rows:ot.empty(),current:{cell:K.current?.cell??[U,0],range:{x:U,y:0,width:w.length,height:Le},rangeStack:[]}},!1);else if(at(V.search,y,F))s?.current?.focus({preventScroll:!0}),yo(!0);else if(at(V.delete,y,F)){const gt=Qt?.(K)??!0;if(gt!==!1){const kt=gt===!0?K:gt;if(kt.current!==void 0){Ar(kt.current.range);for(const wt of kt.current.rangeStack)Ar(wt)}for(const wt of kt.rows)Ar({x:U,y:wt,width:w.length,height:1});for(const wt of kt.columns)Ar({x:wt,y:0,width:1,height:Le})}}if(F.didMatch)return L(),!0;if(K.current===void 0)return!1;let[N,Z]=K.current.cell;const[,le]=K.current.cell;let pe=!1,St=!1;if(at(V.scrollToSelectedCell,y,F)?Oo.current(N-U,Z):ne!=="none"&&at(V.selectColumn,y,F)?q.hasIndex(N)?nt(q.remove(N),void 0,!0):ne==="single"?nt(ot.fromSingleSelection(N),void 0,!0):nt(void 0,N,!0):ge!=="none"&&at(V.selectRow,y,F)?j.hasIndex(Z)?It(j.remove(Z),void 0,!0):ge==="single"?It(ot.fromSingleSelection(Z),void 0,!0):It(void 0,Z,!0):!Oi&&W!==void 0&&at(V.activateCell,y,F)?Z===Le&&Ft?window.setTimeout(()=>{const gt=Qr(N);pr(gt??N)},0):(R?.([N-U,Z]),Jr(W,!0)):K.current.range.height>1&&at(V.downFill,y,F)?kl():K.current.range.width>1&&at(V.rightFill,y,F)?xl():at(V.goToNextPage,y,F)?Z+=Math.max(1,ln.current.height-4):at(V.goToPreviousPage,y,F)?Z-=Math.max(1,ln.current.height-4):at(V.goToFirstCell,y,F)?(o(void 0),Z=0,N=0):at(V.goToLastCell,y,F)?(o(void 0),Z=Number.MAX_SAFE_INTEGER,N=Number.MAX_SAFE_INTEGER):at(V.selectToFirstCell,y,F)?(o(void 0),$n([-2,-2])):at(V.selectToLastCell,y,F)?(o(void 0),$n([2,2])):Oi?(at(V.closeOverlay,y,F)&&o(void 0),at(V.acceptOverlayDown,y,F)&&(o(void 0),Z++),at(V.acceptOverlayUp,y,F)&&(o(void 0),Z--),at(V.acceptOverlayLeft,y,F)&&(o(void 0),N--),at(V.acceptOverlayRight,y,F)&&(o(void 0),N++)):(at(V.goDownCell,y,F)?Z+=1:at(V.goUpCell,y,F)?Z-=1:at(V.goRightCell,y,F)?N+=1:at(V.goLeftCell,y,F)?N-=1:at(V.goDownCellRetainSelection,y,F)?(Z+=1,pe=!0):at(V.goUpCellRetainSelection,y,F)?(Z-=1,pe=!0):at(V.goRightCellRetainSelection,y,F)?(N+=1,pe=!0):at(V.goLeftCellRetainSelection,y,F)?(N-=1,pe=!0):at(V.goToLastRow,y,F)?Z=Le-1:at(V.goToFirstRow,y,F)?Z=Number.MIN_SAFE_INTEGER:at(V.goToLastColumn,y,F)?N=Number.MAX_SAFE_INTEGER:at(V.goToFirstColumn,y,F)?N=Number.MIN_SAFE_INTEGER:(qe==="rect"||qe==="multi-rect")&&(at(V.selectGrowDown,y,F)?$n([0,1]):at(V.selectGrowUp,y,F)?$n([0,-1]):at(V.selectGrowRight,y,F)?$n([1,0]):at(V.selectGrowLeft,y,F)?$n([-1,0]):at(V.selectToLastRow,y,F)?$n([0,2]):at(V.selectToFirstRow,y,F)?$n([0,-2]):at(V.selectToLastColumn,y,F)?$n([2,0]):at(V.selectToFirstColumn,y,F)&&$n([-2,0])),St=F.didMatch),Vn!==void 0&&Vn!=="normal"&&Z!==le){const gt=Vn==="skip-up"||Vn==="skip"||Vn==="block",kt=Vn==="skip-down"||Vn==="skip"||Vn==="block",wt=Z<le;if(wt&&gt){for(;Z>=0&&Fr(Z).isGroupHeader;)Z--;Z<0&&(Z=le)}else if(!wt&&kt){for(;Z<Le&&Fr(Z).isGroupHeader;)Z++;Z>=Le&&(Z=le)}}const Ze=br(N,Z,!1,pe),Je=F.didMatch;return Je&&(Ze||!St||jt)&&L(),Je},[Vn,Oi,K,Xn,ne,ge,qe,U,Fr,Le,br,oe,Mt,w.length,Qt,jt,Ar,nt,It,Ft,Qr,pr,R,Jr,kl,xl,$n]),Pi=f.useCallback(y=>{let L=!1;if(G!==void 0&&G({...y,...y.location&&{location:[y.location[0]-U,y.location[1]]},cancel:()=>{L=!0}}),L||Rl(y)||K.current===void 0)return;const[F,W]=K.current.cell,q=ln.current;if(Ie&&!y.metaKey&&!y.ctrlKey&&K.current!==void 0&&y.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(y.key)&&y.bounds!==void 0&&di(x([F-U,Math.max(0,Math.min(W,Le-1))]))){if((!Ft||W!==Le)&&(q.y>W||W>q.y+q.height||q.x>F||F>q.x+q.width))return;R?.([F-U,W]),Jr(y.bounds,!0,y.key),y.stopPropagation(),y.preventDefault()}},[Ie,G,Rl,K,x,U,Le,Ft,R,Jr]),Zf=f.useCallback((y,L)=>{const F=y.location[0]-U;if(y.kind==="header"&&ae?.(F,{...y,preventDefault:L}),y.kind===An){if(F<0)return;ee?.(F,{...y,preventDefault:L})}if(y.kind==="cell"){const[W,q]=y.location;X?.([F,q],{...y,preventDefault:L}),zm(K,y.location)||br(W,q,!1,!1)}},[K,X,ee,ae,U,br]),Ba=f.useCallback(async y=>{if(!Xn.paste)return;function L(V,N,Z,le){const pe=typeof Z=="object"?Z?.join(`
172
+ `&&(n.push(r),r=[])),o=t.None);break}s++}return i<e.length&&r.push(Pu(e.slice(i,e.length))),n.push(r),n.map(a=>a.map(l=>({rawValue:l,formatted:l,format:"string"})))}function _u(e,t,n){const r=W0(e,t),i=a=>{window.navigator.clipboard?.writeText(a)},o=(a,l)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([a],{type:"text/plain"}),"text/html":new Blob([l],{type:"text/html"})})]),!0),s=(a,l)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",a),n?.clipboardData?.setData("text/html",l)}catch{o(a,l)||i(a)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?s(r.textPlain,r.textHtml):i(r.textPlain),n?.preventDefault()}function Ad(e){return e!==!0}function Fu(e){return typeof e=="string"?e:`${e}px`}const G0=()=>e=>e.innerWidth,X0=()=>e=>e.innerHeight,Y0=un("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[G0()],"wmyidgi-1":[X0()]}}),j0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return f.createElement(Y0,{innerHeight:Fu(n),innerWidth:Fu(t),...i},r)},K0=2,Z0=1300;function J0(e,t,n){const r=Vt.useRef(0),[i,o]=e??[0,0];Vt.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let s=!1,a=0;const l=u=>{if(!s){if(a===0)a=u;else{const c=u-a;r.current=Math.min(1,r.current+c/Z0);const d=r.current**1.618*c*K0;t.current?.scrollBy(i*d,o*d),a=u,n?.()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{s=!0}},[t,i,o,n])}function Q0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:s,remSize:a}){const[l,u,c,d,g,h]=Vt.useMemo(()=>{if(!s||a===16)return[e,t,n,r,i,o];const m=a/16,p=e,v=Cd();return[typeof p=="number"?p*m:w=>Math.ceil(p(w)*m),Math.ceil(t*m),Math.ceil(n*m),{...r,headerIconSize:(r?.headerIconSize??v.headerIconSize)*m,cellHorizontalPadding:(r?.cellHorizontalPadding??v.cellHorizontalPadding)*m,cellVerticalPadding:(r?.cellVerticalPadding??v.cellVerticalPadding)*m},Math.ceil((i??0)*m),Math.ceil((o??0)*m)]},[n,t,i,o,a,e,s,r]);return{rowHeight:l,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:g,overscrollY:h}}const yr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function st(e,t){return e===!0?t:e===!1?"":e}function Lu(e){const t=aa.value;return{activateCell:st(e.activateCell," |Enter|shift+Enter"),clear:st(e.clear,"any+Escape"),closeOverlay:st(e.closeOverlay,"any+Escape"),acceptOverlayDown:st(e.acceptOverlayDown,"Enter"),acceptOverlayUp:st(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:st(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:st(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:st(e.delete,t?"Backspace|Delete":"Delete"),downFill:st(e.downFill,"primary+_68"),scrollToSelectedCell:st(e.scrollToSelectedCell,"primary+Enter"),goDownCell:st(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:st(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:st(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:st(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:st(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:st(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:st(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:st(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:st(e.goToFirstCell,"primary+Home"),goToFirstColumn:st(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:st(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:st(e.goToLastCell,"primary+End"),goToLastColumn:st(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:st(e.goToLastRow,"primary+ArrowDown"),goToNextPage:st(e.goToNextPage,"PageDown"),goToPreviousPage:st(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:st(e.rightFill,"primary+_82"),search:st(e.search,"primary+f"),selectAll:st(e.selectAll,"primary+a"),selectColumn:st(e.selectColumn,"ctrl+ "),selectGrowDown:st(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:st(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:st(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:st(e.selectGrowUp,"shift+ArrowUp"),selectRow:st(e.selectRow,"shift+ "),selectToFirstCell:st(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:st(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:st(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:st(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:st(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:st(e.selectToLastRow,"primary+shift+ArrowDown")}}function ev(e){const t=sm(e);return Vt.useMemo(()=>{if(t===void 0)return Lu(yr);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??yr.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??yr.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??yr.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??yr.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??yr.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??yr.selectToLastCell};return Lu({...yr,...n})},[t])}function tv(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const s={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(s.subGroups=r.subGroups.map((a,l)=>t(a,i+1,[...o,l])).sort((a,l)=>a.headerIndex-l.headerIndex)),s}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function Js(e,t){const n=[];function r(a,l,u=!1){let c=l!==null?l-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(c=a.subGroups[0].headerIndex-a.headerIndex),c--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:u,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:c}),a.subGroups)for(let d=0;d<a.subGroups.length;d++){const g=d<a.subGroups.length-1?a.subGroups[d+1].headerIndex:l;r(a.subGroups[d],g,u||a.isCollapsed)}}const i=tv(e.groups);for(let a=0;a<i.length;a++){const l=a<i.length-1?i[a+1].headerIndex:null;r(i[a],l)}let o=0,s=0;for(const a of n)a.contentIndex=s,s+=a.rows,a.rowIndex=o,o+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:l,...u}=a;return u})}function Ts(e,t){if(t===void 0||Js.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(r.isCollapsed)n--;else{if(n<=r.rows)return{path:[...r.path,n-1],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n-1,contentIndex:r.contentIndex+n-1,groupRows:r.rows};n=n-r.rows-1}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function nv(e,t,n,r){const i=Vt.useMemo(()=>e===void 0?void 0:Js(e,t),[e,t]),o=Vt.useMemo(()=>i?.reduce((c,d)=>(c[d.rowIndex]=d,c),{}),[i]),s=Vt.useMemo(()=>i===void 0?t:i.reduce((c,d)=>c+(d.isCollapsed?1:d.rows+1),0),[i,t]),a=Vt.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>o?.[c]?e.height:typeof n=="number"?n:n(c),[o,e,n]),l=Vt.useCallback(c=>{if(i===void 0)return c;let d=c;for(const g of i){if(d===0)return;if(d--,!g.isCollapsed){if(d<g.rows)return g.contentIndex+d;d-=g.rows}}return c},[i]),u=Cr(r??e?.themeOverride,Vt.useCallback(c=>{if(e===void 0)return r?.(c,c,c);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:d,contentIndex:g,groupIndex:h}=Ts(c,i);return d?e.themeOverride:r?.(c,h,g)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:l,getRowThemeOverride:u}:{rowHeight:a,rows:s,rowNumberMapper:l,getRowThemeOverride:u}}function rv(e,t){const n=Vt.useMemo(()=>e===void 0?void 0:Js(e,t),[e,t]);return{getRowGroupingForPath:zd,updateRowGroupingByPath:Hd,mapper:Vt.useCallback(r=>{if(typeof r=="number")return Ts(r,n);const i=Ts(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function Hd(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,s)=>s===r?{...o,...n}:o):e.map((o,s)=>s===r?{...o,subGroups:Hd(o.subGroups??[],i,n)}:o)}function zd(e,t){const[n,...r]=t;return r[0]===-1?e[n]:zd(e[n].subGroups??[],r)}function iv(e,t){const[n]=f.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}));return n.callback=t,n.facade}function ov(e,t,n,r,i){const[o,s]=f.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),a=f.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:s}),[r,s,o]),[l,u,c]=am(a),d=f.useRef(i);d.current=i;const g=iv(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.scrollLeft=e)}),h=(l.height??1)>1;f.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&h){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&c(),d.current()}},[t,h,c,g]);const m=(l.width??1)>1;return f.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&m){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&c(),d.current()}},[e,m,c,g]),{visibleRegion:l,setVisibleRegion:u,scrollRef:g}}const av=f.lazy(async()=>await As(()=>import("./data-grid-overlay-editor.Ct51iCb_.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url));let sv=0;function lv(e){return cp(Cu(Cu(e).filter(t=>t.span!==void 0).map(t=>kr((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function $o(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const No={kind:J.Loading,allowOverlay:!1},Bo={columns:ot.empty(),rows:ot.empty(),current:void 0},uv=(e,t)=>{const[n,r]=f.useState(Bo),[i,o]=f.useState(),s=f.useRef(null),a=f.useRef(null),[l,u]=f.useState(),c=f.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:h,markdownDivCreateNode:m,width:p,height:v,columns:w,rows:b,getCellContent:x,onCellClicked:O,onCellActivated:R,onFillPattern:M,onFinishedEditing:_,coercePasteValue:I,drawHeader:k,drawCell:A,editorBloom:D,onHeaderClicked:C,onColumnProposeMove:E,rangeSelectionColumnSpanning:T=!0,spanRangeBehavior:S="default",onGroupHeaderClicked:B,onCellContextMenu:X,className:Y,onHeaderContextMenu:ae,getCellsForSelection:Q,onGroupHeaderContextMenu:ee,onGroupHeaderRenamed:re,onCellEdited:te,onCellsEdited:ue,onSearchResultsChanged:fe,searchResults:se,onSearchValueChange:H,searchValue:P,onKeyDown:G,onKeyUp:ce,keybindings:he,editOnType:Ie=!0,onRowAppended:me,onColumnAppended:Qe,onColumnMoved:xe,validateCell:At,highlightRegions:Xe,rangeSelect:qe="rect",columnSelect:ne="multi",rowSelect:ge="multi",rangeSelectionBlending:Ce="exclusive",columnSelectionBlending:de="exclusive",rowSelectionBlending:Se="exclusive",onDelete:Ee,onDragStart:De,onMouseMove:tt,onPaste:Oe,copyHeaders:Fe=!1,freezeColumns:Ve=0,cellActivationBehavior:Te="second-click",rowSelectionMode:Me="auto",onHeaderMenuClick:pt,onHeaderIndicatorClick:ht,getGroupDetails:Ye,rowGrouping:xt,onSearchClose:Yt,onItemHovered:Ht,onSelectionCleared:Mt,showSearch:cn,onVisibleRegionChanged:Ut,gridSelection:tn,onGridSelectionChange:Tt,minColumnWidth:yt=50,maxColumnWidth:nn=500,maxColumnAutoWidth:ut,provideEditor:rn,trailingRowOptions:Nt,freezeTrailingRows:Pe=0,allowedFillDirections:Dt="orthogonal",scrollOffsetX:Rt,scrollOffsetY:Mn,verticalBorder:qt,onDragOverCell:dn,onDrop:Rn,onColumnResize:Zt,onColumnResizeEnd:Jt,onColumnResizeStart:We,customRenderers:Ot,fillHandle:yn,experimental:vt,fixedShadowX:_t,fixedShadowY:Cn,headerIcons:er,imageWindowLoader:zn,initialSize:$,isDraggable:$e,onDragLeave:Ge,onRowMoved:Ct,overscrollX:mn,overscrollY:sn,preventDiagonalScrolling:be,rightElement:dt,rightElementProps:bt,trapFocus:jt=!1,smoothScrollX:Gt,smoothScrollY:qn,scaleToRem:ho=!1,rowHeight:ka=34,headerHeight:go=36,groupHeaderHeight:Er=go,theme:cr,isOutsideClick:Ma,renderers:wi,resizeIndicator:mo,scrollToActiveCell:yi=!0,drawFocusRing:Tr=!0,portalElementRef:ml}=e,Ci=Tr==="no-editor"?i===void 0:Tr,Pn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,Sn=Pn?.kind??e.rowMarkers??"none",Si=Pn?.width??e.rowMarkerWidth,tr=Pn?.startIndex??e.rowMarkerStartIndex??1,nr=Pn?.theme??e.rowMarkerTheme,Yr=Pn?.headerTheme,dr=Pn?.headerAlwaysVisible,Dr=ge!=="multi"||Pn?.headerDisabled===!0,jr=Pn?.checkboxStyle??"square",rr=Math.max(yt,20),Kr=Math.max(nn,rr),Ra=Math.max(ut??Kr,rr),po=f.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Le,rowNumberMapper:xi,rowHeight:vo,getRowThemeOverride:fr}=nv(xt,b,ka,h),Ia=f.useMemo(()=>Number.parseFloat(po.fontSize),[po]),{rowHeight:Gn,headerHeight:ki,groupHeaderHeight:bo,theme:wo,overscrollX:Mi,overscrollY:Ea}=Q0({groupHeaderHeight:Er,headerHeight:go,overscrollX:mn,overscrollY:sn,remSize:Ia,rowHeight:vo,scaleToRem:ho,theme:cr}),Xn=ev(he),hr=Si??(b>1e4?48:b>1e3?44:b>100?36:32),_n=Sn!=="none",U=_n?1:0,Ft=Nt!==void 0,ir=Nt?.sticky===!0,[Ri,yo]=f.useState(!1),Zr=cn??Ri,Ta=f.useCallback(()=>{Yt!==void 0?Yt():yo(!1)},[Yt]),K=f.useMemo(()=>tn===void 0?void 0:$o(tn,U),[tn,U])??n,xn=f.useRef();xn.current===void 0&&(xn.current=new AbortController),f.useEffect(()=>()=>xn?.current.abort(),[]);const[z,ie]=H0(Q,x,U,xn.current,Le),ke=f.useCallback((y,L,F)=>{if(At===void 0)return!0;const W=[y[0]-U,y[1]];return At?.(W,L,F)},[U,At]),Re=f.useRef(tn),oe=f.useCallback((y,L)=>{L&&(y=U0(y,z,U,S,xn.current)),Tt!==void 0?(Re.current=$o(y,-U),Tt(Re.current)):r(y)},[Tt,z,U,S]),ve=Cr(Zt,f.useCallback((y,L,F,W)=>{Zt?.(w[F-U],L,F-U,W)},[Zt,U,w])),je=Cr(Jt,f.useCallback((y,L,F,W)=>{Jt?.(w[F-U],L,F-U,W)},[Jt,U,w])),we=Cr(We,f.useCallback((y,L,F,W)=>{We?.(w[F-U],L,F-U,W)},[We,U,w])),Ke=Cr(k,f.useCallback((y,L)=>k?.({...y,columnIndex:y.columnIndex-U},L)??!1,[k,U])),ct=Cr(A,f.useCallback((y,L)=>A?.({...y,col:y.col-U},L)??!1,[A,U])),Qt=f.useCallback(y=>{if(Ee!==void 0){const L=Ee($o(y,-U));return typeof L=="boolean"?L:$o(L,U)}return!0},[Ee,U]),[ft,It,nt]=A0(K,oe,Ce,de,Se,qe,T),et=f.useMemo(()=>ar(Cd(),wo),[wo]),[zt,Bt]=f.useState([0,0,0]),Or=f.useMemo(()=>{if(wi===void 0)return{};const y={};for(const L of wi)y[L.kind]=L;return y},[wi]),en=f.useCallback(y=>y.kind!==J.Custom?Or[y.kind]:Ot?.find(L=>L.isMatch(y)),[Ot,Or]);let{sizedColumns:on,nonGrowWidth:gr}=tp(w,Le,ie,zt[0]-(U===0?0:hr)-zt[2],rr,Ra,et,en,xn.current);Sn!=="none"&&(gr+=hr);const Pt=f.useMemo(()=>on.some(y=>y.group!==void 0),[on]),kn=Pt?ki+bo:ki,In=K.rows.length,mr=Sn==="none"?void 0:In===0?!1:In===Le?!0:void 0,rt=f.useMemo(()=>Sn==="none"?on:[{title:"",width:hr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:nr,rowMarker:jr,rowMarkerChecked:mr,headerRowMarkerTheme:Yr,headerRowMarkerAlwaysVisible:dr,headerRowMarkerDisabled:Dr},...on],[Sn,on,hr,nr,jr,mr,Yr,dr,Dr]),ln=f.useRef({height:1,width:1,x:0,y:0}),Yn=f.useRef(!1),{setVisibleRegion:pl,visibleRegion:Pr,scrollRef:Wt}=ov(Rt,Mn,Gn,ln,()=>Yn.current=!0);ln.current=Pr;const Lf=Pr.x+U,Co=Pr.y,fn=f.useRef(null),pn=f.useCallback(y=>{y===!0?fn.current?.focus():window.requestAnimationFrame(()=>{fn.current?.focus()})},[]),hn=Ft?Le+1:Le,Fn=f.useCallback(y=>{const L=U===0?y:y.map(W=>({...W,location:[W.location[0]-U,W.location[1]]})),F=ue?.(L);if(F!==!0)for(const W of L)te?.(W.location,W.value);return F},[te,ue,U]),[_r,Da]=f.useState(),So=K.current!==void 0&&K.current.range.width*K.current.range.height>1?K.current.range:void 0,vl=Ci?K.current?.cell:void 0,xo=vl?.[0],ko=vl?.[1],Af=f.useMemo(()=>{if((Xe===void 0||Xe.length===0)&&(So??xo??ko??_r)===void 0)return;const y=[];if(Xe!==void 0)for(const L of Xe){const F=rt.length-L.range.x-U;F>0&&y.push({color:L.color,range:{...L.range,x:L.range.x+U,width:Math.min(F,L.range.width)},style:L.style})}return _r!==void 0&&y.push({color:Br(et.accentColor,0),range:_r,style:"dashed"}),So!==void 0&&y.push({color:Br(et.accentColor,.5),range:So,style:"solid-outline"}),xo!==void 0&&ko!==void 0&&y.push({color:et.accentColor,range:{x:xo,y:ko,width:1,height:1},style:"solid-outline"}),y.length>0?y:void 0},[_r,So,xo,ko,Xe,rt.length,et.accentColor,U]),bl=f.useRef(rt);bl.current=rt;const En=f.useCallback(([y,L],F=!1)=>{const W=Ft&&L===hn-1;if(y===0&&_n){if(W)return No;const j=xi(L);return j===void 0?No:{kind:Hn.Marker,allowOverlay:!1,checkboxStyle:jr,checked:K?.rows.hasIndex(L)===!0,markerKind:Sn==="clickable-number"?"number":Sn,row:tr+j,drawHandle:Ct!==void 0,cursor:Sn==="clickable-number"?"pointer":void 0}}else if(W){const V=y===U?Nt?.hint??"":"",N=bl.current[y];if(N?.trailingRowOptions?.disabled===!0)return No;{const Z=N?.trailingRowOptions?.hint??V,le=N?.trailingRowOptions?.addIcon??Nt?.addIcon;return{kind:Hn.NewRow,hint:Z,allowOverlay:!1,icon:le}}}else{const j=y-U;if(F||vt?.strict===!0){const N=ln.current,Z=N.x>j||j>N.x+N.width||N.y>L||L>N.y+N.height||L>=Fa.current,le=j===N.extras?.selected?.[0]&&L===N.extras?.selected[1];let pe=!1;if(N.extras?.freezeRegions!==void 0){for(const St of N.extras.freezeRegions)if(Nr(St,j,L)){pe=!0;break}}if(Z&&!le&&!pe)return No}let V=x([j,L]);return U!==0&&V.span!==void 0&&(V={...V,span:[V.span[0]+U,V.span[1]+U]}),V}},[Ft,hn,_n,xi,jr,K?.rows,Sn,tr,Ct,U,Nt?.hint,Nt?.addIcon,vt?.strict,x]),Oa=f.useCallback(y=>{let L=Ye?.(y)??{name:y};return re!==void 0&&y!==""&&(L={icon:L.icon,name:L.name,overrideTheme:L.overrideTheme,actions:[...L.actions??[],{title:"Rename",icon:"renameIcon",onClick:F=>Aa({group:L.name,bounds:F.bounds})}]}),L},[Ye,re]),Mo=f.useCallback(y=>{const[L,F]=y.cell,W=rt[L],q=W?.group!==void 0?Oa(W.group)?.overrideTheme:void 0,j=W?.themeOverride,V=fr?.(F);o({...y,theme:ar(et,q,j,V,y.content.themeOverride)})},[fr,rt,Oa,et]),Jr=f.useCallback((y,L,F)=>{if(K.current===void 0)return;const[W,q]=K.current.cell,j=En([W,q]);if(j.kind!==J.Boolean&&j.allowOverlay){let V=j;if(F!==void 0)switch(V.kind){case J.Number:{const N=Fg(()=>F==="-"?-0:Number.parseFloat(F),0);V={...V,data:Number.isNaN(N)?0:N};break}case J.Text:case J.Markdown:case J.Uri:V={...V,data:F};break}Mo({target:y,content:V,initialValue:F,cell:[W,q],highlight:F===void 0,forceEditMode:F!==void 0})}else j.kind===J.Boolean&&L&&j.readonly!==!0&&(Fn([{location:K.current.cell,value:{...j,data:Ad(j.data)}}]),fn.current?.damage([{cell:K.current.cell}]))},[En,K,Fn,Mo]),wl=f.useCallback((y,L)=>{const F=fn.current?.getBounds(y,L);if(F===void 0||Wt.current===null)return;const W=En([y,L]);W.allowOverlay&&Mo({target:F,content:W,initialValue:void 0,highlight:!0,cell:[y,L],forceEditMode:!0})},[En,Wt,Mo]),Xt=f.useCallback((y,L,F="both",W=0,q=0,j=void 0)=>{if(Wt.current!==null){const V=fn.current,N=a.current,Z=typeof y!="number"?y.unit==="cell"?y.amount:void 0:y,le=typeof L!="number"?L.unit==="cell"?L.amount:void 0:L,pe=typeof y!="number"&&y.unit==="px"?y.amount:void 0,St=typeof L!="number"&&L.unit==="px"?L.amount:void 0;if(V!==null&&N!==null){let it={x:0,y:0,width:0,height:0},Ze=0,Je=0;if((Z!==void 0||le!==void 0)&&(it=V.getBounds((Z??0)+U,le??0)??it,it.width===0||it.height===0))return;const gt=N.getBoundingClientRect(),kt=gt.width/N.offsetWidth;if(pe!==void 0&&(it={...it,x:pe-gt.left-Wt.current.scrollLeft,width:1}),St!==void 0&&(it={...it,y:St+gt.top-Wt.current.scrollTop,height:1}),it!==void 0){const wt={x:it.x-W,y:it.y-q,width:it.width+2*W,height:it.height+2*q};let ii=0;for(let Wa=0;Wa<Ve;Wa++)ii+=on[Wa].width;let Fi=0;const Li=Pe+(ir?1:0);Li>0&&(Fi=Gr(hn,Li,Gn));let Kn=ii*kt+gt.left+U*hr*kt,oi=gt.right,Hr=gt.top+kn*kt,ai=gt.bottom-Fi*kt;const Po=it.width+W*2;switch(j?.hAlign){case"start":oi=Kn+Po;break;case"end":Kn=oi-Po;break;case"center":Kn=Math.floor((Kn+oi)/2)-Po/2,oi=Kn+Po;break}const _o=it.height+q*2;switch(j?.vAlign){case"start":ai=Hr+_o;break;case"end":Hr=ai-_o;break;case"center":Hr=Math.floor((Hr+ai)/2)-_o/2,ai=Hr+_o;break}Kn>wt.x?Ze=wt.x-Kn:oi<wt.x+wt.width&&(Ze=wt.x+wt.width-oi),Hr>wt.y?Je=wt.y-Hr:ai<wt.y+wt.height&&(Je=wt.y+wt.height-ai),F==="vertical"||typeof y=="number"&&y<Ve?Ze=0:(F==="horizontal"||typeof L=="number"&&L>=hn-Li)&&(Je=0),(Ze!==0||Je!==0)&&(kt!==1&&(Ze/=kt,Je/=kt),Wt.current.scrollTo({left:Ze+Wt.current.scrollLeft,top:Je+Wt.current.scrollTop,behavior:j?.behavior??"auto"}))}}}},[U,Pe,hr,Wt,kn,Ve,on,hn,ir,Gn]),Pa=f.useRef(wl),_a=f.useRef(x);Pa.current=wl,_a.current=x;const Fa=f.useRef(Le);Fa.current=Le;const yl=f.useRef(rt.length);yl.current=rt.length;const pr=f.useCallback(async(y,L=!0,F)=>{if(rt[y]?.trailingRowOptions?.disabled===!0)return;const q=me?.();let j,V=!0;q!==void 0&&(j=await q,j==="top"&&(V=!1),typeof j=="number"&&(V=!1));let N=0;const Z=()=>{if(Fa.current<=Le){N<500&&window.setTimeout(Z,N),N=50+N*2;return}const le=typeof j=="number"?j:V?Le:0;Oo.current(y-U,le,"both",0,0,F?{behavior:F}:void 0),ft({cell:[y,le],range:{x:y,y:le,width:1,height:1}},!1,!1,"edit");const pe=_a.current([y-U,le]);pe.allowOverlay&&di(pe)&&pe.readonly!==!0&&L&&window.setTimeout(()=>{Pa.current(y,le)},0)};Z()},[rt,me,U,Le,ft]),Ro=f.useCallback(async(y,L=!0)=>{const F=Qe?.();let W,q=!0;F!==void 0&&(W=await F,W==="left"&&(q=!1),typeof W=="number"&&(q=!1));let j=0;const V=()=>{if(yl.current<=rt.length){j<500&&window.setTimeout(V,j),j=50+j*2;return}const N=typeof W=="number"?W:q?rt.length:0;Xt(N-U,y),ft({cell:[N,y],range:{x:N,y,width:1,height:1}},!1,!1,"edit");const Z=_a.current([N-U,y]);Z.allowOverlay&&di(Z)&&Z.readonly!==!0&&L&&window.setTimeout(()=>{Pa.current(N,y)},0)};V()},[rt,Qe,U,Xt,ft]),Qr=f.useCallback(y=>{const L=on[y]?.trailingRowOptions?.targetColumn??Nt?.targetColumn;if(typeof L=="number")return L+(_n?1:0);if(typeof L=="object"){const F=w.indexOf(L);if(F>=0)return F+(_n?1:0)}},[on,w,_n,Nt?.targetColumn]),vr=f.useRef(),ei=f.useRef(),Ei=f.useCallback((y,L)=>{const[F,W]=L;return ar(et,rt[F]?.themeOverride,fr?.(W),y.themeOverride)},[fr,rt,et]),{mapper:Fr}=rv(xt,b),Vn=xt?.navigationBehavior,Ti=f.useCallback(y=>{const L=aa.value?y.metaKey:y.ctrlKey,F=L&&ge==="multi",W=L&&ne==="multi",[q,j]=y.location,V=K.columns,N=K.rows,[Z,le]=K.current?.cell??[];if(y.kind==="cell"){if(ei.current=void 0,Lr.current=[q,j],q===0&&_n){if(Ft===!0&&j===Le||Sn==="number"||ge==="none")return;const pe=En(y.location);if(pe.kind!==Hn.Marker)return;if(Ct!==void 0){const Ze=en(pe);Dn(Ze?.kind===Hn.Marker);const Je=Ze?.onClick?.({...y,cell:pe,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,theme:Ei(pe,y.location),preventDefault:()=>{}});if(Je===void 0||Je.checked===pe.checked)return}o(void 0),pn();const St=N.hasIndex(j),it=vr.current;if(ge==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&it!==void 0&&N.hasIndex(it)){const Ze=[Math.min(it,j),Math.max(it,j)+1];F||Me==="multi"?It(void 0,Ze,!0):It(ot.fromSingleSelection(Ze),void 0,F)}else ge==="multi"&&(F||y.isTouch||Me==="multi")?St?It(N.remove(j),void 0,!0):(It(void 0,j,!0),vr.current=j):St&&N.length===1?It(ot.empty(),void 0,L):(It(ot.fromSingleSelection(j),void 0,L),vr.current=j)}else if(q>=U&&Ft&&j===Le){const pe=Qr(q);pr(pe??q)}else if(Z!==q||le!==j){const pe=En(y.location),St=en(pe);if(St?.onSelect!==void 0){let Je=!1;if(St.onSelect({...y,cell:pe,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,preventDefault:()=>Je=!0,theme:Ei(pe,y.location)}),Je)return}if(Vn==="block"&&Fr(j).isGroupHeader)return;const it=ir&&j===Le,Ze=ir&&K!==void 0&&K.current?.cell[1]===Le;if((y.shiftKey||y.isLongTouch===!0)&&Z!==void 0&&le!==void 0&&K.current!==void 0&&!Ze){if(it)return;const Je=Math.min(q,Z),gt=Math.max(q,Z),kt=Math.min(j,le),wt=Math.max(j,le);ft({...K.current,range:{x:Je,y:kt,width:gt-Je+1,height:wt-kt+1}},!0,L,"click"),vr.current=void 0,pn()}else ft({cell:[q,j],range:{x:q,y:j,width:1,height:1}},!0,L,"click"),vr.current=void 0,o(void 0),pn()}}else if(y.kind==="header")if(Lr.current=[q,j],o(void 0),_n&&q===0)vr.current=void 0,ei.current=void 0,!Dr&&ge==="multi"&&(N.length!==Le?It(ot.fromSingleSelection([0,Le]),void 0,L):It(ot.empty(),void 0,L),pn());else{const pe=ei.current;if(ne==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&pe!==void 0&&V.hasIndex(pe)){const St=[Math.min(pe,q),Math.max(pe,q)+1];W?nt(void 0,St,L):nt(ot.fromSingleSelection(St),void 0,L)}else W?(V.hasIndex(q)?nt(V.remove(q),void 0,L):nt(void 0,q,L),ei.current=q):ne!=="none"&&(V.hasIndex(q)?nt(V.remove(q),void 0,L):nt(ot.fromSingleSelection(q),void 0,L),ei.current=q);vr.current=void 0,pn()}else y.kind===An?Lr.current=[q,j]:y.kind===sa&&!y.isMaybeScrollbar&&(oe(Bo,!1),o(void 0),pn(),Mt?.(),vr.current=void 0,ei.current=void 0)},[ge,ne,K,_n,U,Ft,Le,Sn,En,Ct,pn,Me,en,Ei,It,Qr,pr,Vn,Fr,ir,ft,nt,oe,Mt]),Di=f.useRef(!1),Lr=f.useRef(),Cl=f.useRef(Pr),jn=f.useRef(),Hf=f.useCallback(y=>{if(ti.current=!1,Cl.current=ln.current,y.button!==0&&y.button!==1){jn.current=void 0;return}const L=performance.now();jn.current={button:y.button,time:L,location:y.location},y?.kind==="header"&&(Di.current=!0);const F=y.kind==="cell"&&y.isFillHandle;!F&&y.kind!=="cell"&&y.isEdge||(u({previousSelection:K,fillHandle:F}),Lr.current=void 0,!y.isTouch&&y.button===0&&!F?Ti(y):!y.isTouch&&y.button===1&&(Lr.current=y.location))},[K,Ti]),[La,Aa]=f.useState(),Sl=f.useCallback(y=>{if(y.kind!==An||ne!=="multi")return;const L=aa.value?y.metaKey:y.ctrlKey,[F]=y.location,W=K.columns;if(F<U)return;const q=rt[F];let j=F,V=F;for(let N=F-1;N>=U&&ro(q.group,rt[N].group);N--)j--;for(let N=F+1;N<rt.length&&ro(q.group,rt[N].group);N++)V++;if(pn(),L)if(W.hasAll([j,V+1])){let N=W;for(let Z=j;Z<=V;Z++)N=N.remove(Z);nt(N,void 0,L)}else nt(void 0,[j,V+1],L);else nt(ot.fromSingleSelection([j,V+1]),void 0,L)},[ne,pn,K.columns,rt,U,nt]),ti=f.useRef(!1),Io=f.useCallback(async y=>{if(z!==void 0&&ve!==void 0){const L=ln.current.y,F=ln.current.height;let W=z({x:y,y:L,width:1,height:Math.min(F,Le-L)},xn.current.signal);typeof W!="object"&&(W=await W());const q=on[y-U],V=document.createElement("canvas").getContext("2d",{alpha:!1});if(V!==null){V.font=et.baseFontFull;const N=xd(V,et,q,0,W,rr,Kr,!1,en);ve?.(q,N.width,y,N.width)}}},[on,z,Kr,et,rr,ve,U,Le,en]),[zf,Ha]=f.useState(),ni=f.useCallback(async(y,L)=>{const F=y.current?.range;if(F===void 0||z===void 0||L.current===void 0)return;const W=L.current.range;if(M!==void 0){let N=!1;if(M({fillDestination:{...W,x:W.x-U},patternSource:{...F,x:F.x-U},preventDefault:()=>N=!0}),N)return}let q=z(F,xn.current.signal);typeof q!="object"&&(q=await q());const j=q,V=[];for(let N=0;N<W.width;N++)for(let Z=0;Z<W.height;Z++){const le=[W.x+N,W.y+Z];if(fd(le,F))continue;const pe=j[Z%F.height][N%F.width];hi(pe)||!di(pe)||V.push({location:le,value:{...pe}})}Fn(V),fn.current?.damage(V.map(N=>({cell:N.location})))},[z,Fn,M,U]),xl=f.useCallback(()=>{if(K.current===void 0||K.current.range.width<=1)return;const y={...K,current:{...K.current,range:{...K.current.range,width:1}}};ni(y,K)},[ni,K]),kl=f.useCallback(()=>{if(K.current===void 0||K.current.range.height<=1)return;const y={...K,current:{...K.current,range:{...K.current.range,height:1}}};ni(y,K)},[ni,K]),Vf=f.useCallback((y,L)=>{const F=l;if(u(void 0),Da(void 0),Ha(void 0),Di.current=!1,L)return;if(F?.fillHandle===!0&&K.current!==void 0&&F.previousSelection?.current!==void 0){if(_r===void 0)return;const pe={...K,current:{...K.current,range:Ed(F.previousSelection.current.range,_r)}};ni(F.previousSelection,pe),oe(pe,!0);return}const[W,q]=y.location,[j,V]=Lr.current??[],N=()=>{ti.current=!0},Z=pe=>{const St=pe.isTouch||j===W&&V===q;if(St&&O?.([W-U,q],{...pe,preventDefault:N}),pe.button===1)return!ti.current;if(!ti.current){const it=En(y.location),Ze=en(it);if(Ze!==void 0&&Ze.onClick!==void 0&&St){const gt=Ze.onClick({...pe,cell:it,posX:pe.localEventX,posY:pe.localEventY,bounds:pe.bounds,theme:Ei(it,y.location),preventDefault:N});gt!==void 0&&!hi(gt)&&ci(gt)&&(Fn([{location:pe.location,value:gt}]),fn.current?.damage([{cell:pe.location}]))}if(ti.current||K.current===void 0)return!1;let Je=!1;switch(it.activationBehaviorOverride??Te){case"double-click":case"second-click":{if(F?.previousSelection?.current?.cell===void 0)break;const[gt,kt]=K.current.cell,[wt,ii]=F.previousSelection.current.cell;Je=W===gt&&W===wt&&q===kt&&q===ii&&(pe.isDoubleClick===!0||Te==="second-click");break}case"single-click":{Je=!0;break}}if(Je)return R?.([W-U,q]),Jr(pe.bounds,!1),!0}return!1},le=y.location[0]-U;if(y.isTouch){const pe=ln.current,St=Cl.current;if(pe.x!==St.x||pe.y!==St.y)return;if(y.isLongTouch===!0){if(y.kind==="cell"&&Ji(K.current?.cell,y.location)){X?.([le,y.location[1]],{...y,preventDefault:N});return}else if(y.kind==="header"&&K.columns.hasIndex(W)){ae?.(le,{...y,preventDefault:N});return}else if(y.kind===An){if(le<0)return;ee?.(le,{...y,preventDefault:N});return}}y.kind==="cell"?Z(y)||Ti(y):y.kind===An?B?.(le,{...y,preventDefault:N}):(y.kind===Sr&&C?.(le,{...y,preventDefault:N}),Ti(y));return}if(y.kind==="header"){if(le<0)return;y.isEdge?y.isDoubleClick===!0&&Io(W):y.button===0&&W===j&&q===V&&C?.(le,{...y,preventDefault:N})}if(y.kind===An){if(le<0)return;y.button===0&&W===j&&q===V&&(B?.(le,{...y,preventDefault:N}),ti.current||Sl(y))}y.kind==="cell"&&(y.button===0||y.button===1)&&Z(y),Lr.current=void 0},[l,K,U,_r,ni,oe,O,En,en,Te,Ei,Fn,R,Jr,X,ae,ee,Ti,B,C,Io,Sl]),$f=f.useCallback(y=>{const L={...y,location:[y.location[0]-U,y.location[1]]};tt?.(L),l!==void 0&&y.buttons===0&&(u(void 0),Da(void 0),Ha(void 0),Di.current=!1),Ha(F=>Di.current?[y.scrollEdge[0],0]:y.scrollEdge[0]===F?.[0]&&y.scrollEdge[1]===F[1]?F:l===void 0||(jn.current?.location[0]??0)<U?void 0:y.scrollEdge)},[l,tt,U]),Nf=f.useCallback((y,L)=>{pt?.(y-U,L)},[pt,U]),Bf=f.useCallback((y,L)=>{ht?.(y-U,L)},[ht,U]),ri=K?.current?.cell,Wf=f.useCallback((y,L,F,W,q,j)=>{Yn.current=!1;let V=ri;V!==void 0&&(V=[V[0]-U,V[1]]);const N=Ve===0?void 0:{x:0,y:y.y,width:Ve,height:y.height},Z=[];N!==void 0&&Z.push(N),Pe>0&&(Z.push({x:y.x-U,y:Le-Pe,width:y.width,height:Pe}),Ve>0&&Z.push({x:0,y:Le-Pe,width:Ve,height:Pe}));const le={x:y.x-U,y:y.y,width:y.width,height:Ft&&y.y+y.height>=Le?y.height-1:y.height,tx:q,ty:j,extras:{selected:V,freezeRegion:N,freezeRegions:Z}};ln.current=le,pl(le),Bt([L,F,W]),Ut?.(le,le.tx,le.ty,le.extras)},[ri,U,Ft,Le,Ve,Pe,pl,Ut]),Uf=Cr(E,f.useCallback((y,L)=>E?.(y-U,L-U)!==!1,[E,U])),qf=Cr(xe,f.useCallback((y,L)=>{xe?.(y-U,L-U),ne!=="none"&&nt(ot.fromSingleSelection(L),void 0,!0)},[ne,xe,U,nt])),za=f.useRef(!1),Gf=f.useCallback(y=>{if(y.location[0]===0&&U>0){y.preventDefault();return}De?.({...y,location:[y.location[0]-U,y.location[1]]}),y.defaultPrevented()||(za.current=!0),u(void 0)},[De,U]),Xf=f.useCallback(()=>{za.current=!1},[]),Ml=xt?.selectionBehavior,Eo=f.useCallback(y=>{if(Ml!=="block-spanning")return;const{isGroupHeader:L,path:F,groupRows:W}=Fr(y);if(L)return[y,y];const q=F[F.length-1],j=y-q,V=y+W-q-1;return[j,V]},[Fr,Ml]),Va=f.useRef(),$a=f.useCallback(y=>{if(!Fd(y,Va.current)&&(Va.current=y,!(jn?.current?.button!==void 0&&jn.current.button>=1))){if(y.buttons!==0&&l!==void 0&&jn.current?.location[0]===0&&y.location[0]===0&&U===1&&ge==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(jn.current.location[1])&&K.rows.hasIndex(jn.current.location[1])){const L=Math.min(jn.current.location[1],y.location[1]),F=Math.max(jn.current.location[1],y.location[1])+1;It(ot.fromSingleSelection([L,F]),void 0,!1)}if(y.buttons!==0&&l!==void 0&&K.current!==void 0&&!za.current&&!Di.current&&(qe==="rect"||qe==="multi-rect")){const[L,F]=K.current.cell;let[W,q]=y.location;if(q<0&&(q=ln.current.y),l.fillHandle===!0&&l.previousSelection?.current!==void 0){const j=l.previousSelection.current.range;q=Math.min(q,Ft?Le-1:Le);const V=Wp(j,W,q,Dt);Da(V)}else{if(Ft&&F===Le)return;if(Ft&&q===Le)if(y.kind===sa)q--;else return;W=Math.max(W,U);const N=Eo(F);q=N===void 0?q:Ln(q,N[0],N[1]);const Z=W-L,le=q-F,pe={x:Z>=0?L:W,y:le>=0?F:q,width:Math.abs(Z)+1,height:Math.abs(le)+1};ft({...K.current,range:pe},!0,!1,"drag")}}Ht?.({...y,location:[y.location[0]-U,y.location[1]]})}},[l,U,ge,K,qe,Ht,It,Ft,Le,Dt,Eo,ft]),Yf=f.useCallback(()=>{const y=Va.current;if(y===void 0)return;const[L,F]=y.scrollEdge;let[W,q]=y.location;const j=ln.current;L===-1?W=j.extras?.freezeRegion?.x??j.x:L===1&&(W=j.x+j.width),F===-1?q=Math.max(0,j.y):F===1&&(q=Math.min(Le-1,j.y+j.height)),W=Ln(W,0,rt.length-1),q=Ln(q,0,Le-1),$a({...y,location:[W,q]})},[rt.length,$a,Le]);J0(zf,Wt,Yf);const $n=f.useCallback(y=>{if(K.current===void 0)return;const[L,F]=y,[W,q]=K.current.cell,j=K.current.range;let V=j.x,N=j.x+j.width,Z=j.y,le=j.y+j.height;const[pe,St]=Eo(q)??[0,Le-1],it=St+1;if(F!==0)switch(F){case 2:{le=it,Z=q,Xt(0,le,"vertical");break}case-2:{Z=pe,le=q+1,Xt(0,Z,"vertical");break}case 1:{Z<q?(Z++,Xt(0,Z,"vertical")):(le=Math.min(it,le+1),Xt(0,le,"vertical"));break}case-1:{le>q+1?(le--,Xt(0,le,"vertical")):(Z=Math.max(pe,Z-1),Xt(0,Z,"vertical"));break}default:no()}if(L!==0)if(L===2)N=rt.length,V=W,Xt(N-1-U,0,"horizontal");else if(L===-2)V=U,N=W+1,Xt(V-U,0,"horizontal");else{let Ze=[];if(z!==void 0){const Je=z({x:V,y:Z,width:N-V-U,height:le-Z},xn.current.signal);typeof Je=="object"&&(Ze=lv(Je))}if(L===1){let Je=!1;if(V<W){if(Ze.length>0){const gt=kr(V+1,W+1).find(kt=>!Ze.includes(kt-U));gt!==void 0&&(V=gt,Je=!0)}else V++,Je=!0;Je&&Xt(V,0,"horizontal")}Je||(N=Math.min(rt.length,N+1),Xt(N-1-U,0,"horizontal"))}else if(L===-1){let Je=!1;if(N>W+1){if(Ze.length>0){const gt=kr(N-1,W,-1).find(kt=>!Ze.includes(kt-U));gt!==void 0&&(N=gt,Je=!0)}else N--,Je=!0;Je&&Xt(N-U,0,"horizontal")}Je||(V=Math.max(U,V-1),Xt(V-U,0,"horizontal"))}else no()}ft({cell:K.current.cell,range:{x:V,y:Z,width:N-V,height:le-Z}},!0,!1,"keyboard-select")},[z,Eo,K,rt.length,U,Le,Xt,ft]),Na=f.useRef(yi);Na.current=yi;const br=f.useCallback((y,L,F,W)=>{const q=hn-(F?0:1);y=Ln(y,U,on.length-1+U),L=Ln(L,0,q);const j=ri?.[0],V=ri?.[1];if(y===j&&L===V)return!1;if(W&&K.current!==void 0){const N=[...K.current.rangeStack];(K.current.range.width>1||K.current.range.height>1)&&N.push(K.current.range),oe({...K,current:{cell:[y,L],range:{x:y,y:L,width:1,height:1},rangeStack:N}},!0)}else ft({cell:[y,L],range:{x:y,y:L,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===y&&c.current[1]===L&&(c.current=void 0),Na.current&&Xt(y-U,L),!0},[hn,U,on.length,ri,K,Xt,oe,ft]),jf=f.useCallback((y,L)=>{i?.cell!==void 0&&y!==void 0&&ci(y)&&(Fn([{location:i.cell,value:y}]),window.requestAnimationFrame(()=>{fn.current?.damage([{cell:i.cell}])})),pn(!0),o(void 0);const[F,W]=L;if(K.current!==void 0&&(F!==0||W!==0)){const q=K.current.cell[1]===hn-1&&y!==void 0,j=K.current.cell[0]===rt.length-1&&y!==void 0;let V=!0;if(q&&W===1&&me!==void 0){V=!1;const N=K.current.cell[0]+F,Z=Qr(N);pr(Z??N,!1)}if(j&&F===1&&Qe!==void 0){V=!1;const N=K.current.cell[1]+W;Ro(N,!1)}V&&br(Ln(K.current.cell[0]+F,0,rt.length-1),Ln(K.current.cell[1]+W,0,hn-1),q,!1)}_?.(y,L)},[i?.cell,pn,K,_,Fn,hn,br,rt.length,pr,Ro,me,Qe,Qr]),Kf=f.useMemo(()=>`gdg-overlay-${sv++}`,[]),Ar=f.useCallback(y=>{pn();const L=[];for(let F=y.x;F<y.x+y.width;F++)for(let W=y.y;W<y.y+y.height;W++){const q=x([F-U,W]);if(!q.allowOverlay&&q.kind!==J.Boolean)continue;let j;if(q.kind===J.Custom){const V=en(q),N=V?.provideEditor?.({...q,location:[F-U,W]});V?.onDelete!==void 0?j=V.onDelete(q):Lg(N)&&(j=N?.deletedValue?.(q))}else(ci(q)&&q.allowOverlay||q.kind===J.Boolean)&&(j=en(q)?.onDelete?.(q));j!==void 0&&!hi(j)&&ci(j)&&L.push({location:[F,W],value:j})}Fn(L),fn.current?.damage(L.map(F=>({cell:F.location})))},[pn,x,en,Fn,U]),Oi=i!==void 0,Rl=f.useCallback(y=>{const L=()=>{y.stopPropagation(),y.preventDefault()},F={didMatch:!1},{bounds:W}=y,q=K.columns,j=K.rows,V=Xn;if(!Oi&&at(V.clear,y,F))oe(Bo,!1),Mt?.();else if(!Oi&&at(V.selectAll,y,F))oe({columns:ot.empty(),rows:ot.empty(),current:{cell:K.current?.cell??[U,0],range:{x:U,y:0,width:w.length,height:Le},rangeStack:[]}},!1);else if(at(V.search,y,F))s?.current?.focus({preventScroll:!0}),yo(!0);else if(at(V.delete,y,F)){const gt=Qt?.(K)??!0;if(gt!==!1){const kt=gt===!0?K:gt;if(kt.current!==void 0){Ar(kt.current.range);for(const wt of kt.current.rangeStack)Ar(wt)}for(const wt of kt.rows)Ar({x:U,y:wt,width:w.length,height:1});for(const wt of kt.columns)Ar({x:wt,y:0,width:1,height:Le})}}if(F.didMatch)return L(),!0;if(K.current===void 0)return!1;let[N,Z]=K.current.cell;const[,le]=K.current.cell;let pe=!1,St=!1;if(at(V.scrollToSelectedCell,y,F)?Oo.current(N-U,Z):ne!=="none"&&at(V.selectColumn,y,F)?q.hasIndex(N)?nt(q.remove(N),void 0,!0):ne==="single"?nt(ot.fromSingleSelection(N),void 0,!0):nt(void 0,N,!0):ge!=="none"&&at(V.selectRow,y,F)?j.hasIndex(Z)?It(j.remove(Z),void 0,!0):ge==="single"?It(ot.fromSingleSelection(Z),void 0,!0):It(void 0,Z,!0):!Oi&&W!==void 0&&at(V.activateCell,y,F)?Z===Le&&Ft?window.setTimeout(()=>{const gt=Qr(N);pr(gt??N)},0):(R?.([N-U,Z]),Jr(W,!0)):K.current.range.height>1&&at(V.downFill,y,F)?kl():K.current.range.width>1&&at(V.rightFill,y,F)?xl():at(V.goToNextPage,y,F)?Z+=Math.max(1,ln.current.height-4):at(V.goToPreviousPage,y,F)?Z-=Math.max(1,ln.current.height-4):at(V.goToFirstCell,y,F)?(o(void 0),Z=0,N=0):at(V.goToLastCell,y,F)?(o(void 0),Z=Number.MAX_SAFE_INTEGER,N=Number.MAX_SAFE_INTEGER):at(V.selectToFirstCell,y,F)?(o(void 0),$n([-2,-2])):at(V.selectToLastCell,y,F)?(o(void 0),$n([2,2])):Oi?(at(V.closeOverlay,y,F)&&o(void 0),at(V.acceptOverlayDown,y,F)&&(o(void 0),Z++),at(V.acceptOverlayUp,y,F)&&(o(void 0),Z--),at(V.acceptOverlayLeft,y,F)&&(o(void 0),N--),at(V.acceptOverlayRight,y,F)&&(o(void 0),N++)):(at(V.goDownCell,y,F)?Z+=1:at(V.goUpCell,y,F)?Z-=1:at(V.goRightCell,y,F)?N+=1:at(V.goLeftCell,y,F)?N-=1:at(V.goDownCellRetainSelection,y,F)?(Z+=1,pe=!0):at(V.goUpCellRetainSelection,y,F)?(Z-=1,pe=!0):at(V.goRightCellRetainSelection,y,F)?(N+=1,pe=!0):at(V.goLeftCellRetainSelection,y,F)?(N-=1,pe=!0):at(V.goToLastRow,y,F)?Z=Le-1:at(V.goToFirstRow,y,F)?Z=Number.MIN_SAFE_INTEGER:at(V.goToLastColumn,y,F)?N=Number.MAX_SAFE_INTEGER:at(V.goToFirstColumn,y,F)?N=Number.MIN_SAFE_INTEGER:(qe==="rect"||qe==="multi-rect")&&(at(V.selectGrowDown,y,F)?$n([0,1]):at(V.selectGrowUp,y,F)?$n([0,-1]):at(V.selectGrowRight,y,F)?$n([1,0]):at(V.selectGrowLeft,y,F)?$n([-1,0]):at(V.selectToLastRow,y,F)?$n([0,2]):at(V.selectToFirstRow,y,F)?$n([0,-2]):at(V.selectToLastColumn,y,F)?$n([2,0]):at(V.selectToFirstColumn,y,F)&&$n([-2,0])),St=F.didMatch),Vn!==void 0&&Vn!=="normal"&&Z!==le){const gt=Vn==="skip-up"||Vn==="skip"||Vn==="block",kt=Vn==="skip-down"||Vn==="skip"||Vn==="block",wt=Z<le;if(wt&&gt){for(;Z>=0&&Fr(Z).isGroupHeader;)Z--;Z<0&&(Z=le)}else if(!wt&&kt){for(;Z<Le&&Fr(Z).isGroupHeader;)Z++;Z>=Le&&(Z=le)}}const Ze=br(N,Z,!1,pe),Je=F.didMatch;return Je&&(Ze||!St||jt)&&L(),Je},[Vn,Oi,K,Xn,ne,ge,qe,U,Fr,Le,br,oe,Mt,w.length,Qt,jt,Ar,nt,It,Ft,Qr,pr,R,Jr,kl,xl,$n]),Pi=f.useCallback(y=>{let L=!1;if(G!==void 0&&G({...y,...y.location&&{location:[y.location[0]-U,y.location[1]]},cancel:()=>{L=!0}}),L||Rl(y)||K.current===void 0)return;const[F,W]=K.current.cell,q=ln.current;if(Ie&&!y.metaKey&&!y.ctrlKey&&K.current!==void 0&&y.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(y.key)&&y.bounds!==void 0&&di(x([F-U,Math.max(0,Math.min(W,Le-1))]))){if((!Ft||W!==Le)&&(q.y>W||W>q.y+q.height||q.x>F||F>q.x+q.width))return;R?.([F-U,W]),Jr(y.bounds,!0,y.key),y.stopPropagation(),y.preventDefault()}},[Ie,G,Rl,K,x,U,Le,Ft,R,Jr]),Zf=f.useCallback((y,L)=>{const F=y.location[0]-U;if(y.kind==="header"&&ae?.(F,{...y,preventDefault:L}),y.kind===An){if(F<0)return;ee?.(F,{...y,preventDefault:L})}if(y.kind==="cell"){const[W,q]=y.location;X?.([F,q],{...y,preventDefault:L}),zm(K,y.location)||br(W,q,!1,!1)}},[K,X,ee,ae,U,br]),Ba=f.useCallback(async y=>{if(!Xn.paste)return;function L(V,N,Z,le){const pe=typeof Z=="object"?Z?.join(`
173
173
  `)??"":Z?.toString()??"";if(!hi(V)&&di(V)&&V.readonly!==!0){const St=I?.(pe,V);if(St!==void 0&&ci(St))return{location:N,value:St};const it=en(V);if(it===void 0)return;if(it.kind===J.Custom){Dn(V.kind===J.Custom);const Ze=it.onPaste?.(pe,V.data);return Ze===void 0?void 0:{location:N,value:{...V,data:Ze}}}else{const Ze=it.onPaste?.(pe,V,{formatted:le,formattedString:typeof le=="string"?le:le?.join(`
174
174
  `),rawValue:Z});return Ze===void 0?void 0:(Dn(Ze.kind===V.kind),{location:N,value:Ze})}}}const F=K.columns,W=K.rows,q=Wt.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0;let j;if(K.current!==void 0?j=[K.current.range.x,K.current.range.y]:F.length===1?j=[F.first()??0,0]:W.length===1&&(j=[U,W.first()??0]),q&&j!==void 0){let V,N;const Z="text/plain",le="text/html";if(navigator.clipboard.read!==void 0){const Ze=await navigator.clipboard.read();for(const Je of Ze){if(Je.types.includes(le)){const kt=await(await Je.getType(le)).text(),wt=Ou(kt);if(wt!==void 0){V=wt;break}}Je.types.includes(Z)&&(N=await(await Je.getType(Z)).text())}}else if(navigator.clipboard.readText!==void 0)N=await navigator.clipboard.readText();else if(y!==void 0&&y?.clipboardData!==null){if(y.clipboardData.types.includes(le)){const Ze=y.clipboardData.getData(le);V=Ou(Ze)}V===void 0&&y.clipboardData.types.includes(Z)&&(N=y.clipboardData.getData(Z))}else return;const[pe,St]=j,it=[];do{if(Oe===void 0){const Ze=En(j),Je=N??V?.map(kt=>kt.map(wt=>wt.rawValue).join(" ")).join(" ")??"",gt=L(Ze,j,Je,void 0);gt!==void 0&&it.push(gt);break}if(V===void 0){if(N===void 0)return;V=q0(N)}if(Oe===!1||typeof Oe=="function"&&Oe?.([j[0]-U,j[1]],V.map(Ze=>Ze.map(Je=>Je.rawValue?.toString()??"")))!==!0)return;for(const[Ze,Je]of V.entries()){if(Ze+St>=Le)break;for(const[gt,kt]of Je.entries()){const wt=[gt+pe,Ze+St],[ii,Fi]=wt;if(ii>=rt.length||Fi>=hn)continue;const Li=En(wt),Kn=L(Li,wt,kt.rawValue,kt.formatted);Kn!==void 0&&it.push(Kn)}}}while(!1);Fn(it),fn.current?.damage(it.map(Ze=>({cell:Ze.location})))}},[I,en,En,K,Xn.paste,Wt,rt.length,Fn,hn,Oe,U,Le]);bn("paste",Ba,d,!1,!0);const _i=f.useCallback(async(y,L)=>{if(!Xn.copy)return;const F=L===!0||Wt.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0,W=K.columns,q=K.rows,j=(V,N)=>{if(!Fe)_u(V,N,y);else{const Z=N.map(le=>({kind:J.Text,data:w[le].title,displayData:w[le].title,allowOverlay:!1}));_u([Z,...V],N,y)}};if(F&&z!==void 0){if(K.current!==void 0){let V=z(K.current.range,xn.current.signal);typeof V!="object"&&(V=await V()),j(V,kr(K.current.range.x-U,K.current.range.x+K.current.range.width-U))}else if(q!==void 0&&q.length>0){const N=[...q].map(Z=>{const le=z({x:U,y:Z,width:w.length,height:1},xn.current.signal);return typeof le=="object"?le[0]:le().then(pe=>pe[0])});if(N.some(Z=>Z instanceof Promise)){const Z=await Promise.all(N);j(Z,kr(w.length))}else j(N,kr(w.length))}else if(W.length>0){const V=[],N=[];for(const Z of W){let le=z({x:Z,y:0,width:1,height:Le},xn.current.signal);typeof le!="object"&&(le=await le()),V.push(le),N.push(Z-U)}if(V.length===1)j(V[0],N);else{const Z=V.reduce((le,pe)=>le.map((St,it)=>[...St,...pe[it]]));j(Z,N)}}}},[w,z,K,Xn.copy,U,Wt,Le,Fe]);bn("copy",_i,d,!1,!1);const Jf=f.useCallback(async y=>{if(!(!Xn.cut||!(Wt.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0))&&(await _i(y),K.current!==void 0)){let F={current:{cell:K.current.cell,range:K.current.range,rangeStack:[]},rows:ot.empty(),columns:ot.empty()};const W=Qt?.(F);if(W===!1||(F=W===!0?F:W,F.current===void 0))return;Ar(F.current.range)}},[Ar,K,Xn.cut,_i,Wt,Qt]);bn("cut",Jf,d,!1,!1);const Qf=f.useCallback((y,L)=>{if(fe!==void 0){U!==0&&(y=y.map(q=>[q[0]-U,q[1]])),fe(y,L);return}if(y.length===0||L===-1)return;const[F,W]=y[L];c.current!==void 0&&c.current[0]===F&&c.current[1]===W||(c.current=[F,W],br(F,W,!1,!1))},[fe,U,br]),[To,Do]=tn?.current?.cell??[],Oo=f.useRef(Xt);Oo.current=Xt,f.useLayoutEffect(()=>{Na.current&&!Yn.current&&To!==void 0&&Do!==void 0&&(To!==Re.current?.current?.cell[0]||Do!==Re.current?.current?.cell[1])&&Oo.current(To,Do),Yn.current=!1},[To,Do]);const Il=K.current!==void 0&&(K.current.cell[0]>=rt.length||K.current.cell[1]>=hn);f.useLayoutEffect(()=>{Il&&oe(Bo,!1)},[Il,oe]);const eh=f.useMemo(()=>Ft===!0&&Nt?.tint===!0?ot.fromSingleSelection(hn-1):ot.empty(),[hn,Ft,Nt?.tint]),th=f.useCallback(y=>typeof qt=="boolean"?qt:qt?.(y-U)??!0,[U,qt]),nh=f.useMemo(()=>{if(La===void 0||a.current===null)return null;const{bounds:y,group:L}=La,F=a.current.getBoundingClientRect();return f.createElement(F0,{bounds:y,group:L,canvasBounds:F,onClose:()=>Aa(void 0),onFinish:W=>{Aa(void 0),re?.(L,W)}})},[re,La]),rh=Math.min(rt.length,Ve+(_n?1:0));f.useImperativeHandle(t,()=>({appendRow:(y,L)=>pr(y+U,L),appendColumn:(y,L)=>Ro(y,L),updateCells:y=>(U!==0&&(y=y.map(L=>({cell:[L.cell[0]+U,L.cell[1]]}))),fn.current?.damage(y)),getBounds:(y,L)=>{if(!(a?.current===null||Wt?.current===null)){if(y===void 0&&L===void 0){const F=a.current.getBoundingClientRect(),W=F.width/Wt.current.clientWidth;return{x:F.x-Wt.current.scrollLeft*W,y:F.y-Wt.current.scrollTop*W,width:Wt.current.scrollWidth*W,height:Wt.current.scrollHeight*W}}return fn.current?.getBounds((y??0)+U,L)}},focus:()=>fn.current?.focus(),emit:async y=>{switch(y){case"delete":Pi({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":Pi({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":Pi({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 _i(void 0,!0);break;case"paste":await Ba();break}},scrollTo:Xt,remeasureColumns:y=>{for(const L of y)Io(L+U)},getMouseArgsForPosition:(y,L,F)=>{if(fn?.current===null)return;const W=fn.current.getMouseArgsForPosition(y,L,F);if(W!==void 0)return{...W,location:[W.location[0]-U,W.location[1]]}}}),[pr,Ro,Io,Wt,_i,Pi,Ba,U,Xt]);const[El,Tl]=ri??[],ih=f.useCallback(y=>{const[L,F]=y;if(F===-1){ne!=="none"&&(nt(ot.fromSingleSelection(L),void 0,!1),pn());return}El===L&&Tl===F||(ft({cell:y,range:{x:L,y:F,width:1,height:1}},!0,!1,"keyboard-nav"),Xt(L,F))},[ne,pn,Xt,El,Tl,ft,nt]),[oh,ah]=f.useState(!1),Dl=f.useRef(Qc(y=>{ah(y)},5)),sh=f.useCallback(()=>{Dl.current(!0),K.current===void 0&&K.columns.length===0&&K.rows.length===0&&l===void 0&&ft({cell:[U,Co],range:{x:U,y:Co,width:1,height:1}},!0,!1,"keyboard-select")},[Co,K,l,U,ft]),lh=f.useCallback(()=>{Dl.current(!1)},[]),[uh,ch]=f.useMemo(()=>{let y;const L=vt?.scrollbarWidthOverride??Ss(),F=Le+(Ft?1:0);if(typeof Gn=="number")y=kn+F*Gn;else{let q=0;const j=Math.min(F,10);for(let V=0;V<j;V++)q+=Gn(V);q=Math.floor(q/j),y=kn+F*q}y+=L;const W=rt.reduce((q,j)=>j.width+q,0)+L;return[`${Math.min(1e5,W)}px`,`${Math.min(1e5,y)}px`]},[rt,vt?.scrollbarWidthOverride,Gn,Le,Ft,kn]),dh=f.useMemo(()=>Jm(et),[et]);return f.createElement(Sd.Provider,{value:et},f.createElement(j0,{style:dh,className:Y,inWidth:p??uh,inHeight:v??ch},f.createElement(D0,{fillHandle:yn,drawFocusRing:Ci,experimental:vt,fixedShadowX:_t,fixedShadowY:Cn,getRowThemeOverride:fr,headerIcons:er,imageWindowLoader:zn,initialSize:$,isDraggable:$e,onDragLeave:Ge,onRowMoved:Ct,overscrollX:Mi,overscrollY:Ea,preventDiagonalScrolling:be,rightElement:dt,rightElementProps:bt,smoothScrollX:Gt,smoothScrollY:qn,className:Y,enableGroups:Pt,onCanvasFocused:sh,onCanvasBlur:lh,canvasRef:a,onContextMenu:Zf,theme:et,cellXOffset:Lf,cellYOffset:Co,accessibilityHeight:Pr.height,onDragEnd:Xf,columns:rt,nonGrowWidth:gr,drawHeader:Ke,onColumnProposeMove:Uf,drawCell:ct,disabledRows:eh,freezeColumns:rh,lockColumns:U,firstColAccessible:U===0,getCellContent:En,minColumnWidth:rr,maxColumnWidth:Kr,searchInputRef:s,showSearch:Zr,onSearchClose:Ta,highlightRegions:Af,getCellsForSelection:z,getGroupDetails:Oa,headerHeight:ki,isFocused:oh,groupHeaderHeight:Pt?bo:0,freezeTrailingRows:Pe+(Ft&&Nt?.sticky===!0?1:0),hasAppendRow:Ft,onColumnResize:ve,onColumnResizeEnd:je,onColumnResizeStart:we,onCellFocused:ih,onColumnMoved:qf,onDragStart:Gf,onHeaderMenuClick:Nf,onHeaderIndicatorClick:Bf,onItemHovered:$a,isFilling:l?.fillHandle===!0,onMouseMove:$f,onKeyDown:Pi,onKeyUp:ce,onMouseDown:Hf,onMouseUp:Vf,onDragOverCell:dn,onDrop:Rn,onSearchResultsChanged:Qf,onVisibleRegionChanged:Wf,clientSize:zt,rowHeight:Gn,searchResults:se,searchValue:P,onSearchValueChange:H,rows:hn,scrollRef:Wt,selection:K,translateX:Pr.tx,translateY:Pr.ty,verticalBorder:th,gridRef:fn,getCellRenderer:en,resizeIndicator:mo}),nh,i!==void 0&&f.createElement(f.Suspense,{fallback:null},f.createElement(av,{...i,validateCell:ke,bloom:D,id:Kf,getCellRenderer:en,className:vt?.isSubGrid===!0?"click-outside-ignore":void 0,provideEditor:rn,imageEditorOverride:g,portalElementRef:ml,onFinishEditing:jf,markdownDivCreateNode:m,isOutsideClick:Ma,customEventTarget:vt?.eventTarget}))))},cv=f.forwardRef(uv);function Au(e){const{cell:t,posX:n,posY:r,bounds:i,theme:o}=e,{width:s,height:a,x:l,y:u}=i,c=t.maxSize??o.checkboxMaxSize,d=Math.floor(i.y+a/2),g=nd(c,a,o.cellVerticalPadding),h=td(t.contentAlign??"center",l,s,o.cellHorizontalPadding,g),m=ed(h,d,g),p=rd(l+n,u+r,m);return Vs(t)&&p}const dv={getAccessibilityString:e=>e.data?.toString()??"false",kind:J.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>fv(e,e.cell.data,Vs(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{Au(e)&&e.preventDefault()},onClick:e=>{if(Au(e))return{...e.cell,data:Ad(e.cell.data)}},onPaste:(e,t)=>{let n=ta;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=zs),n===t.data?void 0:{...t,data:n}}};function fv(e,t,n,r,i){if(!n&&t===ta)return;const{ctx:o,hoverAmount:s,theme:a,rect:l,highlighted:u,hoverX:c,hoverY:d,cell:{contentAlign:g}}=e,{x:h,y:m,width:p,height:v}=l;let w=!1;if(i>0){let b=n?1-i+i*s:.4;if(t===ta&&(b*=s),b===0)return;b<1&&(w=!0,o.globalAlpha=b)}Ks(o,a,t,h,m,p,v,u,c,d,r,g),w&&(o.globalAlpha=1)}const hv=un("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),gv=e=>{const{bubbles:t}=e;return f.createElement(hv,null,t.map((n,r)=>f.createElement("div",{key:r,className:"boe-bubble"},n)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},mv={getAccessibilityString:e=>id(e.data),kind:J.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>{const r=t.data.reduce((i,o)=>e.measureText(o).width+i+n.bubblePadding*2+n.bubbleMargin,0);return t.data.length===0?n.cellHorizontalPadding*2:r+2*n.cellHorizontalPadding-n.bubbleMargin},draw:e=>pv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(gv,{bubbles:t.data})},onPaste:()=>{}};function pv(e,t){const{rect:n,theme:r,ctx:i,highlighted:o}=e,{x:s,y:a,width:l,height:u}=n;let c=s+r.cellHorizontalPadding;const d=[];for(const g of t){if(c>s+l)break;const h=Xr(g,i,r.baseFontFull).width;d.push({x:c,width:h}),c+=h+r.bubblePadding*2+r.bubbleMargin}i.beginPath();for(const g of d)Jn(i,g.x,a+(u-r.bubbleHeight)/2,g.width+r.bubblePadding*2,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2);i.fillStyle=o?r.bgBubbleSelected:r.bgBubble,i.fill();for(const[g,h]of d.entries())i.beginPath(),i.fillStyle=r.textBubble,i.fillText(t[g],h.x+r.bubblePadding,a+u/2+Qn(i,r))}const vv=un("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),bv=e=>{const{drilldowns:t}=e;return f.createElement(vv,null,t.map((n,r)=>f.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&f.createElement("img",{src:n.img}),f.createElement("div",null,n.text))))},wv={getAccessibilityString:e=>id(e.data.map(t=>t.text)),kind:J.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,i)=>e.measureText(i.text).width+r+n.bubblePadding*2+n.bubbleMargin+(i.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>Cv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(bv,{drilldowns:t.data})},onPaste:()=>{}},ls={};function yv(e,t,n,r){const i=Math.ceil(window.devicePixelRatio),o=5,s=n-o*2,a=4,l=n*i,u=r+o,c=r*3,d=(c+o*2)*i,g=`${e},${t},${i},${n}`;if(ls[g]!==void 0)return{el:ls[g],height:l,width:d,middleWidth:a*i,sideWidth:u*i,padding:o*i,dpr:i};const h=document.createElement("canvas"),m=h.getContext("2d");return m===null?null:(h.width=d,h.height=l,m.scale(i,i),ls[g]=h,m.beginPath(),Jn(m,o,o,c,s,r),m.shadowColor="rgba(24, 25, 34, 0.4)",m.shadowBlur=1,m.fillStyle=e,m.fill(),m.shadowColor="rgba(24, 25, 34, 0.3)",m.shadowOffsetY=1,m.shadowBlur=5,m.fillStyle=e,m.fill(),m.shadowOffsetY=0,m.shadowBlur=0,m.shadowBlur=0,m.beginPath(),Jn(m,o+.5,o+.5,c,s,r),m.strokeStyle=t,m.lineWidth=1,m.stroke(),{el:h,height:l,width:d,sideWidth:u*i,middleWidth:r*i,padding:o*i,dpr:i})}function Cv(e,t){const{rect:n,theme:r,ctx:i,imageLoader:o,col:s,row:a}=e,{x:l,width:u}=n,c=r.baseFontFull,d=Gs(i,c),g=Math.min(n.height,Math.max(16,Math.ceil(d*r.lineHeight)*2)),h=Math.floor(n.y+(n.height-g)/2),m=g-10,p=r.bubblePadding,v=r.bubbleMargin;let w=l+r.cellHorizontalPadding;const b=r.roundingRadius??6,x=yv(r.bgCell,r.drilldownBorder,g,b),O=[];for(const R of t){if(w>l+u)break;const _=Xr(R.text,i,c).width;let I=0;R.img!==void 0&&o.loadOrGetImage(R.img,s,a)!==void 0&&(I=m-8+4);const k=_+I+p*2;O.push({x:w,width:k}),w+=k+v}if(x!==null){const{el:R,height:M,middleWidth:_,sideWidth:I,width:k,dpr:A,padding:D}=x,C=I/A,E=D/A;for(const T of O){const S=Math.floor(T.x),B=Math.floor(T.width),X=B-(C-E)*2;i.imageSmoothingEnabled=!1,i.drawImage(R,0,0,I,M,S-E,h,C,g),X>0&&i.drawImage(R,I,0,_,M,S+(C-E),h,X,g),i.drawImage(R,k-I,0,I,M,S+B-(C-E),h,C,g),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[R,M]of O.entries()){const _=t[R];let I=M.x+p;if(_.img!==void 0){const k=o.loadOrGetImage(_.img,s,a);if(k!==void 0){const A=m-8;let D=0,C=0,E=k.width,T=k.height;E>T?(D+=(E-T)/2,E=T):T>E&&(C+=(T-E)/2,T=E),i.beginPath(),Jn(i,I,h+g/2-A/2,A,A,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(k,D,C,E,T,I,h+g/2-A/2,A,A),i.restore(),I+=A+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(_.text,I,h+g/2+Qn(i,r))}}const Sv={getAccessibilityString:e=>e.data.join(", "),kind:J.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>xv(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??lm;return f.createElement(i,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:o=>{n({...t,data:[o]})}})},onPaste:(e,t)=>{e=e.trim();const r=e.split(",").map(i=>{try{return new URL(i),i}catch{return}}).filter(i=>i!==void 0);if(!(r.length===t.data.length&&r.every((i,o)=>i===t.data[o])))return{...t,data:r}}},us=4;function xv(e,t,n,r){const{rect:i,col:o,row:s,theme:a,ctx:l,imageLoader:u}=e,{x:c,y:d,height:g,width:h}=i,m=g-a.cellVerticalPadding*2,p=[];let v=0;for(let b=0;b<t.length;b++){const x=t[b];if(x.length===0)continue;const O=u.loadOrGetImage(x,o,s);if(O!==void 0){p[b]=O;const R=O.width*(m/O.height);v+=R+us}}if(v===0)return;v-=us;let w=c+a.cellHorizontalPadding;r==="right"?w=Math.floor(c+h-a.cellHorizontalPadding-v):r==="center"&&(w=Math.floor(c+h/2-v/2));for(const b of p){if(b===void 0)continue;const x=b.width*(m/b.height);n>0&&(l.beginPath(),Jn(l,w,d+a.cellVerticalPadding,x,m,n),l.save(),l.clip()),l.drawImage(b,w,d+a.cellVerticalPadding,x,m),n>0&&l.restore(),w+=x+us}}function kv(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const Mv={getAccessibilityString:()=>"",kind:J.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:i,rect:o,theme:s}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let a=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(a+=Math.round(kv(n,r)*t.skeletonWidthVariability));const l=s.cellHorizontalPadding;a+l*2>=o.width&&(a=o.width-l*2-1);const u=t.skeletonHeight??Math.min(18,o.height-2*s.cellVerticalPadding);Jn(i,o.x+l,o.y+(o.height-u)/2,a,u,s.roundingRadius??3),i.fillStyle=Br(s.textDark,.1),i.fill()},onPaste:()=>{}},Rv=()=>e=>e.targetWidth,Hu=un("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[Rv(),"px"]}}),Iv=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:i,targetRect:o,onFinish:s,validatedSelection:a}=e,l=t.data,u=t.readonly===!0,[c,d]=f.useState(l===""||r),g=f.useCallback(()=>{d(m=>!m)},[]),h=l?"gdg-ml-6":"";return c?f.createElement(Hu,{targetWidth:o.width-20},f.createElement(qr,{autoFocus:!0,highlight:!1,validatedSelection:a,value:l,onKeyDown:m=>{m.key==="Enter"&&m.stopPropagation()},onChange:n}),f.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${h}`,onClick:()=>s(t)},f.createElement(tm,null))):f.createElement(Hu,{targetWidth:o.width},f.createElement(Im,{contents:l,createNode:i}),!u&&f.createElement(f.Fragment,null,f.createElement("div",{className:"spacer"}),f.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${h}`,onClick:g},f.createElement(Ns,null))),f.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Ev={getAccessibilityString:e=>e.data?.toString()??"",kind:J.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:co,measure:(e,t,n)=>{const r=t.data.split(`
175
- `)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>Zn(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:i,markdownDivCreateNode:o,forceEditMode:s,validatedSelection:a}=e;return f.createElement(Iv,{onFinish:i,targetRect:r,value:n,validatedSelection:a,onChange:l=>t({...n,data:l.target.value}),forceEditMode:s,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Tv={getAccessibilityString:e=>e.row.toString(),kind:Hn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Dv,measure:()=>44,draw:e=>Pv(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:i}=e,{width:o,height:s}=t,a=n.drawHandle?7+(o-7)/2:o/2,l=s/2;if(Math.abs(r-a)<=10&&Math.abs(i-l)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Dv(e,t){const{ctx:n,theme:r}=e,i=r.markerFontFull,o=t??{};return o?.font!==i&&(n.font=i,o.font=i),o.deprep=Ov,n.textAlign="center",o}function Ov(e){const{ctx:t}=e;t.textAlign="start"}function Pv(e,t,n,r,i,o){const{ctx:s,rect:a,hoverAmount:l,theme:u}=e,{x:c,y:d,width:g,height:h}=a,m=n?1:r==="checkbox-visible"?.6+.4*l:l;if(r!=="number"&&m>0){s.globalAlpha=m;const p=7*(n?l:1);if(Ks(s,u,n,i?c+p:c,d,i?g-p:g,h,!0,void 0,void 0,u.checkboxMaxSize,"center",o),i){s.globalAlpha=l,s.beginPath();for(const v of[3,6])for(const w of[-5,-1,3])s.rect(c+v,d+h/2+w,2,2);s.fillStyle=u.textLight,s.fill(),s.beginPath()}s.globalAlpha=1}if(r==="number"||r==="both"&&!n){const p=t.toString(),v=u.markerFontFull,w=c+g/2;r==="both"&&l!==0&&(s.globalAlpha=1-l),s.fillStyle=u.textLight,s.font=v,s.fillText(p,w,d+h/2+Qn(s,v)),l!==0&&(s.globalAlpha=1)}}const _v={getAccessibilityString:()=>"",kind:Hn.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:s,spriteManager:a}=e,{x:l,y:u,width:c,height:d}=i;r.beginPath(),r.globalAlpha=o,r.rect(l+1,u+1,c,d-2),r.fillStyle=s.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let h=0;if(n!==void 0){const p=d-8,v=l+8/2,w=u+8/2;a.drawSprite(n,"normal",r,v,w,p,s,g?1:o),h=p}else{h=24;const m=12,p=g?m:o*m,v=g?0:(1-o)*m*.5,w=s.cellHorizontalPadding+4;p>0&&(r.moveTo(l+w+v,u+d/2),r.lineTo(l+w+v+p,u+d/2),r.moveTo(l+w+v+p*.5,u+d/2-p*.5),r.lineTo(l+w+v+p*.5,u+d/2+p*.5),r.lineWidth=2,r.strokeStyle=s.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=s.textMedium,r.fillText(t,h+l+s.cellHorizontalPadding+.5,u+d/2+Qn(r,s)),r.beginPath()}function Vd(e,t,n,r,i,o,s){e.textBaseline="alphabetic";const a=Lv(e,i,r,t,n?.fullSize??!1);e.beginPath(),Jn(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=n?.bgColor??Br(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",s?.("text")}function Lv(e,t,n,r,i){const o=r.cellHorizontalPadding,s=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+s/2+1,width:t.width-o,height:t.height-s-1};const a=Xr(n,e,r.baseFontFull,"alphabetic"),l=t.height-s,u=Math.min(l,a.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:a.width+o*3,height:u-1}}const Av=f.lazy(async()=>await As(()=>import("./number-overlay-editor.WpheGpmR.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)),Hv={getAccessibilityString:e=>e.data?.toString()??"",kind:J.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:co,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:i,rect:o,overrideCursor:s}=e,{hoverEffect:a,displayData:l,hoverEffectTheme:u}=n;a===!0&&t>0&&Vd(r,i,u,l,o,t,s),Zn(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return f.createElement(f.Suspense,{fallback:null},f.createElement(Av,{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}}},zv={getAccessibilityString:()=>"",measure:()=>108,kind:J.Protected,needsHover:!1,needsHoverPosition:!1,draw:Vv,onPaste:()=>{}};function Vv(e){const{ctx:t,theme:n,rect:r}=e,{x:i,y:o,height:s}=r;t.beginPath();const a=2.5;let l=i+n.cellHorizontalPadding+a;const u=o+s/2,c=Math.cos(nu(30))*a,d=Math.sin(nu(30))*a;for(let g=0;g<12;g++)t.moveTo(l,u-a),t.lineTo(l,u+a),t.moveTo(l+c,u-d),t.lineTo(l-c,u+d),t.moveTo(l-c,u-d),t.lineTo(l+c,u+d),l+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const $v={getAccessibilityString:e=>e.data?.toString()??"",kind:J.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>co(e,t,e.theme.textLight),draw:e=>Zn(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return Vt.createElement(qr,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},Nv={getAccessibilityString:e=>e.data?.toString()??"",kind:J.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:co,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:o,theme:s,overrideCursor:a}=e,{displayData:l,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:g}=t;c===!0&&n>0&&Vd(i,s,g,l,o,n,a),Zn(e,l,u,d,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
175
+ `)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>Zn(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:i,markdownDivCreateNode:o,forceEditMode:s,validatedSelection:a}=e;return f.createElement(Iv,{onFinish:i,targetRect:r,value:n,validatedSelection:a,onChange:l=>t({...n,data:l.target.value}),forceEditMode:s,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Tv={getAccessibilityString:e=>e.row.toString(),kind:Hn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Dv,measure:()=>44,draw:e=>Pv(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:i}=e,{width:o,height:s}=t,a=n.drawHandle?7+(o-7)/2:o/2,l=s/2;if(Math.abs(r-a)<=10&&Math.abs(i-l)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Dv(e,t){const{ctx:n,theme:r}=e,i=r.markerFontFull,o=t??{};return o?.font!==i&&(n.font=i,o.font=i),o.deprep=Ov,n.textAlign="center",o}function Ov(e){const{ctx:t}=e;t.textAlign="start"}function Pv(e,t,n,r,i,o){const{ctx:s,rect:a,hoverAmount:l,theme:u}=e,{x:c,y:d,width:g,height:h}=a,m=n?1:r==="checkbox-visible"?.6+.4*l:l;if(r!=="number"&&m>0){s.globalAlpha=m;const p=7*(n?l:1);if(Ks(s,u,n,i?c+p:c,d,i?g-p:g,h,!0,void 0,void 0,u.checkboxMaxSize,"center",o),i){s.globalAlpha=l,s.beginPath();for(const v of[3,6])for(const w of[-5,-1,3])s.rect(c+v,d+h/2+w,2,2);s.fillStyle=u.textLight,s.fill(),s.beginPath()}s.globalAlpha=1}if(r==="number"||r==="both"&&!n){const p=t.toString(),v=u.markerFontFull,w=c+g/2;r==="both"&&l!==0&&(s.globalAlpha=1-l),s.fillStyle=u.textLight,s.font=v,s.fillText(p,w,d+h/2+Qn(s,v)),l!==0&&(s.globalAlpha=1)}}const _v={getAccessibilityString:()=>"",kind:Hn.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:s,spriteManager:a}=e,{x:l,y:u,width:c,height:d}=i;r.beginPath(),r.globalAlpha=o,r.rect(l+1,u+1,c,d-2),r.fillStyle=s.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let h=0;if(n!==void 0){const p=d-8,v=l+8/2,w=u+8/2;a.drawSprite(n,"normal",r,v,w,p,s,g?1:o),h=p}else{h=24;const m=12,p=g?m:o*m,v=g?0:(1-o)*m*.5,w=s.cellHorizontalPadding+4;p>0&&(r.moveTo(l+w+v,u+d/2),r.lineTo(l+w+v+p,u+d/2),r.moveTo(l+w+v+p*.5,u+d/2-p*.5),r.lineTo(l+w+v+p*.5,u+d/2+p*.5),r.lineWidth=2,r.strokeStyle=s.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=s.textMedium,r.fillText(t,h+l+s.cellHorizontalPadding+.5,u+d/2+Qn(r,s)),r.beginPath()}function Vd(e,t,n,r,i,o,s){e.textBaseline="alphabetic";const a=Lv(e,i,r,t,n?.fullSize??!1);e.beginPath(),Jn(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=n?.bgColor??Br(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",s?.("text")}function Lv(e,t,n,r,i){const o=r.cellHorizontalPadding,s=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+s/2+1,width:t.width-o,height:t.height-s-1};const a=Xr(n,e,r.baseFontFull,"alphabetic"),l=t.height-s,u=Math.min(l,a.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:a.width+o*3,height:u-1}}const Av=f.lazy(async()=>await As(()=>import("./number-overlay-editor.DXS2qb1U.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)),Hv={getAccessibilityString:e=>e.data?.toString()??"",kind:J.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:co,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:i,rect:o,overrideCursor:s}=e,{hoverEffect:a,displayData:l,hoverEffectTheme:u}=n;a===!0&&t>0&&Vd(r,i,u,l,o,t,s),Zn(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return f.createElement(f.Suspense,{fallback:null},f.createElement(Av,{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}}},zv={getAccessibilityString:()=>"",measure:()=>108,kind:J.Protected,needsHover:!1,needsHoverPosition:!1,draw:Vv,onPaste:()=>{}};function Vv(e){const{ctx:t,theme:n,rect:r}=e,{x:i,y:o,height:s}=r;t.beginPath();const a=2.5;let l=i+n.cellHorizontalPadding+a;const u=o+s/2,c=Math.cos(nu(30))*a,d=Math.sin(nu(30))*a;for(let g=0;g<12;g++)t.moveTo(l,u-a),t.lineTo(l,u+a),t.moveTo(l+c,u-d),t.lineTo(l-c,u+d),t.moveTo(l-c,u-d),t.lineTo(l+c,u+d),l+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const $v={getAccessibilityString:e=>e.data?.toString()??"",kind:J.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>co(e,t,e.theme.textLight),draw:e=>Zn(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return Vt.createElement(qr,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},Nv={getAccessibilityString:e=>e.data?.toString()??"",kind:J.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:co,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:o,theme:s,overrideCursor:a}=e,{displayData:l,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:g}=t;c===!0&&n>0&&Vd(i,s,g,l,o,n,a),Zn(e,l,u,d,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
176
176
  `,t.allowWrapping===!0?void 0:1);let i=0;for(const o of r)i=Math.max(i,e.measureText(o).width);return i+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:r,value:i,validatedSelection:o}=t;return f.createElement(qr,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:i.readonly!==!0,disabled:i.readonly===!0,altNewline:!0,value:i.data,validatedSelection:o,onChange:s=>r({...i,data:s.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Bv=un("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Wv=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:i,validatedSelection:o,preview:s}=e,[a,l]=f.useState(!i&&(t===""||r)),u=f.useCallback(()=>{l(!0)},[]);return a?f.createElement(qr,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):f.createElement(Bv,null,f.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},s),!i&&f.createElement("div",{className:"gdg-edit-icon",onClick:u},f.createElement(Ns,null)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function $d(e,t,n,r){let i=n.cellHorizontalPadding;const o=t.height/2-e.actualBoundingBoxAscent/2,s=e.width,a=e.actualBoundingBoxAscent;return r==="right"?i=t.width-s-n.cellHorizontalPadding:r==="center"&&(i=t.width/2-s/2),{x:i,y:o,width:s,height:a}}function zu(e){const{cell:t,bounds:n,posX:r,posY:i,theme:o}=e,s=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const a=pd(s,o.baseFontFull);if(a===void 0)return!1;const l=$d(a,n,o,t.contentAlign);return Nr({x:l.x-4,y:l.y-4,width:l.width+8,height:l.height+8},r,i)}const Uv={getAccessibilityString:e=>e.data?.toString()??"",kind:J.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:co,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:i,hoverY:o,rect:s,ctx:a}=e,l=t.displayData??t.data,u=t.hoverEffect===!0;if(r!==void 0&&u&&i!==void 0&&o!==void 0){const c=Xr(l,a,n.baseFontFull),d=$d(c,s,n,t.contentAlign),{x:g,y:h,width:m,height:p}=d;if(i>=g-4&&i<=g-4+m+8&&o>=h-4&&o<=h-4+p+8){const v=Qn(a,n.baseFontFull);r("pointer");const w=5,b=h-v;a.beginPath(),a.moveTo(s.x+g,Math.floor(s.y+b+p+w)+.5),a.lineTo(s.x+g+m,Math.floor(s.y+b+p+w)+.5),a.strokeStyle=n.linkColor,a.stroke(),a.save(),a.fillStyle=e.cellFillColor,Zn({...e,rect:{...s,x:s.x-1}},l,t.contentAlign),Zn({...e,rect:{...s,x:s.x-2}},l,t.contentAlign),Zn({...e,rect:{...s,x:s.x+1}},l,t.contentAlign),Zn({...e,rect:{...s,x:s.x+2}},l,t.contentAlign),a.restore()}}a.fillStyle=u?n.linkColor:n.textDark,Zn(e,l,t.contentAlign)},onSelect:e=>{zu(e)&&e.preventDefault()},onClick:e=>{const{cell:t}=e;zu(e)&&t.onClickUri?.(e)},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:r,forceEditMode:i,validatedSelection:o}=t;return f.createElement(Wv,{forceEditMode:r.readonly!==!0&&(i||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:o,readonly:r.readonly===!0,onChange:s=>n({...r,data:s.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},qv=[Tv,_v,dv,mv,wv,Sv,Mv,Ev,Hv,zv,$v,Nv,Uv];var cs,Vu;function Gv(){if(Vu)return cs;Vu=1;var e=Jc(),t=Tc(),n="Expected a function";function r(i,o,s){var a=!0,l=!0;if(typeof i!="function")throw new TypeError(n);return t(s)&&(a="leading"in s?!!s.leading:a,l="trailing"in s?!!s.trailing:l),e(i,o,{leading:a,maxWait:o,trailing:l})}return cs=r,cs}var Xv=Gv();const Yv=lr(Xv),ds=[];class jv extends wd{imageLoaded=()=>{};loadedLocations=[];cache={};setCallback(t){this.imageLoaded=t}sendLoaded=Yv(()=>{this.imageLoaded(new eo(this.loadedLocations)),this.loadedLocations=[]},20);clearOutOfWindow=()=>{const t=Object.keys(this.cache);for(const n of t){const r=this.cache[n];let i=!1;for(let o=0;o<r.cells.length;o++){const s=r.cells[o];if(this.isInWindow(s)){i=!0;break}}i?r.cells=r.cells.filter(this.isInWindow):(r.cancel(),delete this.cache[n])}};loadImage(t,n,r,i){let o=!1;const s=ds.pop()??new Image;let a=!1;const l={img:void 0,cells:[Wn(n,r)],url:t,cancel:()=>{a||(a=!0,ds.length<12?ds.unshift(s):o||(s.src=""))}},u=new Promise(c=>s.addEventListener("load",()=>c(null)));requestAnimationFrame(async()=>{try{s.src=t,await u,await s.decode();const c=this.cache[i];if(c!==void 0&&!a){c.img=s;for(const d of c.cells)this.loadedLocations.push(js(d));o=!0,this.sendLoaded()}}catch{l.cancel()}}),this.cache[i]=l}loadOrGetImage(t,n,r){const i=t,o=this.cache[i];if(o!==void 0){const s=Wn(n,r);return o.cells.includes(s)||o.cells.push(s),o.img}else this.loadImage(t,n,r,i)}}const Kv=(e,t)=>{const n=f.useMemo(()=>({...$p,...e.headerIcons}),[e.headerIcons]),r=f.useMemo(()=>e.renderers??qv,[e.renderers]),i=f.useMemo(()=>e.imageWindowLoader??new jv,[e.imageWindowLoader]);return f.createElement(cv,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:i})},Zv=f.forwardRef(Kv);function $u(e,t){const n=f.useRef(null),r=f.useRef(),i=f.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return f.useEffect(()=>i,[i]),{debouncedCallback:f.useCallback((...s)=>{r.current=s,i(),n.current=setTimeout(()=>{r.current&&(e(...r.current),r.current=void 0)},t)},[e,t,i]),cancel:i}}var Jv=xh();const Qv=lr(Jv);var Jo={exports:{}};/*! Moment Duration Format v2.2.2
177
177
  * https://github.com/jsmreese/moment-duration-format
178
178
  * Date: 2018-02-16
@@ -193,5 +193,5 @@ Error: ${o}`}const r={kind:J.Text,data:"",displayData:"",allowOverlay:!0,content
193
193
  40% { opacity: 1; }
194
194
  `]))),Z1=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,s=o.colors,a=o.spacing.baseUnit;return Ae({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?s.neutral60:s.neutral20,padding:a*2})},gs=function(t){var n=t.delay,r=t.offset;return _e("span",{css:zc({animation:"".concat(K1," 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"},"","")})},J1=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,s=ur(t,B1);return _e("div",Ne({},Kt(Ae(Ae({},s),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),_e(gs,{delay:0,offset:r}),_e(gs,{delay:160,offset:!0}),_e(gs,{delay:320,offset:!r}))},Q1=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,s=o.colors,a=o.borderRadius,l=o.spacing;return Ae({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?s.neutral5:s.neutral0,borderColor:r?s.neutral10:i?s.primary:s.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(s.primary):void 0,"&:hover":{borderColor:i?s.primary:s.neutral30}})},ew=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,s=t.innerProps,a=t.menuIsOpen;return _e("div",Ne({ref:o},Kt(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":a}),s,{"aria-disabled":r||void 0}),n)},tw=ew,nw=["data"],rw=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},iw=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,s=t.Heading,a=t.headingProps,l=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return _e("div",Ne({},Kt(t,"group",{group:!0}),l),_e(s,Ne({},a,{selectProps:d,theme:c,getStyles:i,getClassNames:o,cx:r}),u),_e("div",null,n))},ow=function(t,n){var r=t.theme,i=r.colors,o=r.spacing;return Ae({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"})},aw=function(t){var n=uf(t);n.data;var r=ur(n,nw);return _e("div",Ne({},Kt(t,"groupHeading",{"group-heading":!0}),r))},sw=iw,lw=["innerRef","isDisabled","isHidden","inputClassName"],uw=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,s=o.spacing,a=o.colors;return Ae(Ae({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},cw),n?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:a.neutral80})},bf={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},cw={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Ae({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},bf)},dw=function(t){return Ae({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},bf)},fw=function(t){var n=t.cx,r=t.value,i=uf(t),o=i.innerRef,s=i.isDisabled,a=i.isHidden,l=i.inputClassName,u=ur(i,lw);return _e("div",Ne({},Kt(t,"input",{"input-container":!0}),{"data-value":r||""}),_e("input",Ne({className:n({input:!0},l),ref:o,style:dw(a),disabled:s},u)))},hw=fw,gw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,s=r.colors;return Ae({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:s.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},mw=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,s=t.cropWithEllipsis;return Ae({overflow:"hidden",textOverflow:s||s===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},pw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,s=r.colors,a=t.isFocused;return Ae({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:a?s.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:s.dangerLight,color:s.danger}})},wf=function(t){var n=t.children,r=t.innerProps;return _e("div",r,n)},vw=wf,bw=wf;function ww(e){var t=e.children,n=e.innerProps;return _e("div",Ne({role:"button"},n),t||_e(hl,{size:14}))}var yw=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,s=t.isDisabled,a=t.removeProps,l=t.selectProps,u=r.Container,c=r.Label,d=r.Remove;return _e(u,{data:i,innerProps:Ae(Ae({},Kt(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),o),selectProps:l},_e(c,{data:i,innerProps:Ae({},Kt(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),_e(d,{data:i,innerProps:Ae(Ae({},Kt(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:l}))},Cw=yw,Sw=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,s=t.theme,a=s.spacing,l=s.colors;return Ae({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?l.primary:i?l.primary25:"transparent",color:r?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?l.primary:l.primary50}})},xw=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,s=t.innerRef,a=t.innerProps;return _e("div",Ne({},Kt(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:s,"aria-disabled":r},a),n)},kw=xw,Mw=function(t,n){var r=t.theme,i=r.spacing,o=r.colors;return Ae({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},Rw=function(t){var n=t.children,r=t.innerProps;return _e("div",Ne({},Kt(t,"placeholder",{placeholder:!0}),r),n)},Iw=Rw,Ew=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,s=i.colors;return Ae({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?s.neutral40:s.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},Tw=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return _e("div",Ne({},Kt(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},Dw=Tw,yf={ClearIndicator:X1,Control:tw,DropdownIndicator:q1,DownChevron:pf,CrossIcon:hl,Group:sw,GroupHeading:aw,IndicatorsContainer:$1,IndicatorSeparator:j1,Input:hw,LoadingIndicator:J1,Menu:R1,MenuList:E1,MenuPortal:F1,LoadingMessage:P1,NoOptionsMessage:O1,MultiValue:Cw,MultiValueContainer:vw,MultiValueLabel:bw,MultiValueRemove:ww,Option:kw,Placeholder:Iw,SelectContainer:A1,SingleValue:Dw,ValueContainer:z1},Ow=function(t){return Ae(Ae({},yf),t.components)},lc=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Pw(e,t){return!!(e===t||lc(e)&&lc(t))}function _w(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Pw(e[n],t[n]))return!1;return!0}function Fw(e,t){t===void 0&&(t=_w);var n=null;function r(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var s=e.apply(this,i);return n={lastResult:s,lastArgs:i,lastThis:this},s}return r.clear=function(){n=null},r}var Lw={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"},Aw=function(t){return _e("span",Ne({css:Lw},t))},uc=Aw,Hw={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,o=t.context,s=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return s?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,i=r===void 0?"":r,o=t.labels,s=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return s?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,i=t.options,o=t.label,s=o===void 0?"":o,a=t.selectValue,l=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(p,v){return p&&p.length?"".concat(p.indexOf(v)+1," of ").concat(p.length):""};if(n==="value"&&a)return"value ".concat(s," focused, ").concat(d(a,r),".");if(n==="menu"&&c){var g=l?" disabled":"",h="".concat(u?" selected":"").concat(g);return"".concat(s).concat(h,", ").concat(d(i,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},zw=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,s=t.isFocused,a=t.selectValue,l=t.selectProps,u=t.id,c=t.isAppleDevice,d=l.ariaLiveMessages,g=l.getOptionLabel,h=l.inputValue,m=l.isMulti,p=l.isOptionDisabled,v=l.isSearchable,w=l.menuIsOpen,b=l.options,x=l.screenReaderStatus,O=l.tabSelectsValue,R=l.isLoading,M=l["aria-label"],_=l["aria-live"],I=f.useMemo(function(){return Ae(Ae({},Hw),d||{})},[d]),k=f.useMemo(function(){var S="";if(n&&I.onChange){var B=n.option,X=n.options,Y=n.removedValue,ae=n.removedValues,Q=n.value,ee=function(P){return Array.isArray(P)?null:P},re=Y||B||ee(Q),te=re?g(re):"",ue=X||ae||void 0,fe=ue?ue.map(g):[],se=Ae({isDisabled:re&&p(re,a),label:te,labels:fe},n);S=I.onChange(se)}return S},[n,I,p,a,g]),A=f.useMemo(function(){var S="",B=r||i,X=!!(r&&a&&a.includes(r));if(B&&I.onFocus){var Y={focused:B,label:g(B),isDisabled:p(B,a),isSelected:X,options:o,context:B===r?"menu":"value",selectValue:a,isAppleDevice:c};S=I.onFocus(Y)}return S},[r,i,g,p,I,o,a,c]),D=f.useMemo(function(){var S="";if(w&&b.length&&!R&&I.onFilter){var B=x({count:o.length});S=I.onFilter({inputValue:h,resultsMessage:B})}return S},[o,h,w,I,b,x,R]),C=n?.action==="initial-input-focus",E=f.useMemo(function(){var S="";if(I.guidance){var B=i?"value":w?"menu":"input";S=I.guidance({"aria-label":M,context:B,isDisabled:r&&p(r,a),isMulti:m,isSearchable:v,tabSelectsValue:O,isInitialFocus:C})}return S},[M,r,i,m,p,v,w,I,a,O,C]),T=_e(f.Fragment,null,_e("span",{id:"aria-selection"},k),_e("span",{id:"aria-focused"},A),_e("span",{id:"aria-results"},D),_e("span",{id:"aria-guidance"},E));return _e(f.Fragment,null,_e(uc,{id:u},C&&T),_e(uc,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},s&&!C&&T))},Vw=zw,Fs=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],$w=new RegExp("["+Fs.map(function(e){return e.letters}).join("")+"]","g"),Cf={};for(var ms=0;ms<Fs.length;ms++)for(var ps=Fs[ms],vs=0;vs<ps.letters.length;vs++)Cf[ps.letters[vs]]=ps.base;var Sf=function(t){return t.replace($w,function(n){return Cf[n]})},Nw=Fw(Sf),cc=function(t){return t.replace(/^\s+|\s+$/g,"")},Bw=function(t){return"".concat(t.label," ").concat(t.value)},Ww=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=Ae({ignoreCase:!0,ignoreAccents:!0,stringify:Bw,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,s=i.ignoreAccents,a=i.stringify,l=i.trim,u=i.matchFrom,c=l?cc(r):r,d=l?cc(a(n)):a(n);return o&&(c=c.toLowerCase(),d=d.toLowerCase()),s&&(c=Nw(c),d=Sf(d)),u==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},Uw=["innerRef"];function qw(e){var t=e.innerRef,n=ur(e,Uw),r=b1(n,"onExited","in","enter","exit","appear");return _e("input",Ne({ref:t},r,{css:zc({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 Gw=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function Xw(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,o=e.onTopLeave,s=f.useRef(!1),a=f.useRef(!1),l=f.useRef(0),u=f.useRef(null),c=f.useCallback(function(v,w){if(u.current!==null){var b=u.current,x=b.scrollTop,O=b.scrollHeight,R=b.clientHeight,M=u.current,_=w>0,I=O-R-x,k=!1;I>w&&s.current&&(r&&r(v),s.current=!1),_&&a.current&&(o&&o(v),a.current=!1),_&&w>I?(n&&!s.current&&n(v),M.scrollTop=O,k=!0,s.current=!0):!_&&-w>x&&(i&&!a.current&&i(v),M.scrollTop=0,k=!0,a.current=!0),k&&Gw(v)}},[n,r,i,o]),d=f.useCallback(function(v){c(v,v.deltaY)},[c]),g=f.useCallback(function(v){l.current=v.changedTouches[0].clientY},[]),h=f.useCallback(function(v){var w=l.current-v.changedTouches[0].clientY;c(v,w)},[c]),m=f.useCallback(function(v){if(v){var w=m1?{passive:!1}:!1;v.addEventListener("wheel",d,w),v.addEventListener("touchstart",g,w),v.addEventListener("touchmove",h,w)}},[h,g,d]),p=f.useCallback(function(v){v&&(v.removeEventListener("wheel",d,!1),v.removeEventListener("touchstart",g,!1),v.removeEventListener("touchmove",h,!1))},[h,g,d]);return f.useEffect(function(){if(t){var v=u.current;return m(v),function(){p(v)}}},[t,m,p]),function(v){u.current=v}}var dc=["boxSizing","height","overflow","paddingRight","position"],fc={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function hc(e){e.cancelable&&e.preventDefault()}function gc(e){e.stopPropagation()}function mc(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function pc(){return"ontouchstart"in window||navigator.maxTouchPoints}var vc=!!(typeof window<"u"&&window.document&&window.document.createElement),Xi=0,li={capture:!1,passive:!1};function Yw(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=f.useRef({}),o=f.useRef(null),s=f.useCallback(function(l){if(vc){var u=document.body,c=u&&u.style;if(r&&dc.forEach(function(m){var p=c&&c[m];i.current[m]=p}),r&&Xi<1){var d=parseInt(i.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,h=window.innerWidth-g+d||0;Object.keys(fc).forEach(function(m){var p=fc[m];c&&(c[m]=p)}),c&&(c.paddingRight="".concat(h,"px"))}u&&pc()&&(u.addEventListener("touchmove",hc,li),l&&(l.addEventListener("touchstart",mc,li),l.addEventListener("touchmove",gc,li))),Xi+=1}},[r]),a=f.useCallback(function(l){if(vc){var u=document.body,c=u&&u.style;Xi=Math.max(Xi-1,0),r&&Xi<1&&dc.forEach(function(d){var g=i.current[d];c&&(c[d]=g)}),u&&pc()&&(u.removeEventListener("touchmove",hc,li),l&&(l.removeEventListener("touchstart",mc,li),l.removeEventListener("touchmove",gc,li)))}},[r]);return f.useEffect(function(){if(t){var l=o.current;return s(l),function(){a(l)}}},[t,s,a]),function(l){o.current=l}}var jw=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},Kw={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Zw(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,o=e.onBottomArrive,s=e.onBottomLeave,a=e.onTopArrive,l=e.onTopLeave,u=Xw({isEnabled:i,onBottomArrive:o,onBottomLeave:s,onTopArrive:a,onTopLeave:l}),c=Yw({isEnabled:n}),d=function(h){u(h),c(h)};return _e(f.Fragment,null,n&&_e("div",{onClick:jw,css:Kw}),t(d))}var Jw={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Qw=function(t){var n=t.name,r=t.onFocus;return _e("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:Jw,value:"",onChange:function(){}})},ey=Qw;function gl(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 ty(){return gl(/^iPhone/i)}function xf(){return gl(/^Mac/i)}function ny(){return gl(/^iPad/i)||xf()&&navigator.maxTouchPoints>1}function ry(){return ty()||ny()}function iy(){return xf()||ry()}var oy=function(t){return t.label},ay=function(t){return t.label},sy=function(t){return t.value},ly=function(t){return!!t.isDisabled},uy={clearIndicator:G1,container:L1,control:Q1,dropdownIndicator:U1,group:rw,groupHeading:ow,indicatorsContainer:V1,indicatorSeparator:Y1,input:uw,loadingIndicator:Z1,loadingMessage:D1,menu:x1,menuList:I1,menuPortal:_1,multiValue:gw,multiValueLabel:mw,multiValueRemove:pw,noOptionsMessage:T1,option:Sw,placeholder:Mw,singleValue:Ew,valueContainer:H1},cy={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%)"},dy=4,kf=4,fy=38,hy=kf*2,gy={baseUnit:kf,controlHeight:fy,menuGutter:hy},bs={borderRadius:dy,colors:cy,spacing:gy},my={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:ac(),captureMenuScroll:!ac(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Ww(),formatGroupLabel:oy,getOptionLabel:ay,getOptionValue:sy,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:ly,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!h1(),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 bc(e,t,n,r){var i=If(e,t,n),o=Ef(e,t,n),s=Rf(e,t),a=ma(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:s,value:a,index:r}}function ea(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(s,a){return bc(e,s,t,a)}).filter(function(s){return yc(e,s)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=bc(e,n,t,r);return yc(e,o)?o:void 0}).filter(p1)}function Mf(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Hs(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function wc(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Hs(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 py(e,t){return Mf(ea(e,t))}function yc(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,s=t.label,a=t.value;return(!Df(e)||!o)&&Tf(e,{label:s,value:a,data:i},r)}function vy(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 by(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var ws=function(t,n){var r,i=(r=t.find(function(o){return o.data===n}))===null||r===void 0?void 0:r.id;return i||null},Rf=function(t,n){return t.getOptionLabel(n)},ma=function(t,n){return t.getOptionValue(n)};function If(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function Ef(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=ma(e,t);return n.some(function(i){return ma(e,i)===r})}function Tf(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var Df=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},wy=1,Of=function(e){kg(n,e);var t=Ig(n);function n(r){var i;if(Rg(this,n),i=t.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.isAppleDevice=iy(),i.controlRef=null,i.getControlRef=function(l){i.controlRef=l},i.focusedOptionRef=null,i.getFocusedOptionRef=function(l){i.focusedOptionRef=l},i.menuListRef=null,i.getMenuListRef=function(l){i.menuListRef=l},i.inputRef=null,i.getInputRef=function(l){i.inputRef=l},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(l,u){var c=i.props,d=c.onChange,g=c.name;u.name=g,i.ariaOnChange(l,u),d(l,u)},i.setValue=function(l,u,c){var d=i.props,g=d.closeMenuOnSelect,h=d.isMulti,m=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:m}),g&&(i.setState({inputIsHiddenAfterUpdate:!h}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(l,{action:u,option:c})},i.selectOption=function(l){var u=i.props,c=u.blurInputOnSelect,d=u.isMulti,g=u.name,h=i.state.selectValue,m=d&&i.isOptionSelected(l,h),p=i.isOptionDisabled(l,h);if(m){var v=i.getOptionValue(l);i.setValue(h.filter(function(w){return i.getOptionValue(w)!==v}),"deselect-option",l)}else if(!p)d?i.setValue([].concat(Hs(h),[l]),"select-option",l):i.setValue(l,"select-option");else{i.ariaOnChange(l,{action:"select-option",option:l,name:g});return}c&&i.blurInput()},i.removeValue=function(l){var u=i.props.isMulti,c=i.state.selectValue,d=i.getOptionValue(l),g=c.filter(function(m){return i.getOptionValue(m)!==d}),h=jo(u,g,g[0]||null);i.onChange(h,{action:"remove-value",removedValue:l}),i.focusInput()},i.clearValue=function(){var l=i.state.selectValue;i.onChange(jo(i.props.isMulti,[],null),{action:"clear",removedValues:l})},i.popValue=function(){var l=i.props.isMulti,u=i.state.selectValue,c=u[u.length-1],d=u.slice(0,u.length-1),g=jo(l,d,d[0]||null);c&&i.onChange(g,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(l){return ws(i.state.focusableOptionsWithIds,l)},i.getFocusableOptionsWithIds=function(){return wc(ea(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var l=arguments.length,u=new Array(l),c=0;c<l;c++)u[c]=arguments[c];return l1.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(l){return Rf(i.props,l)},i.getOptionValue=function(l){return ma(i.props,l)},i.getStyles=function(l,u){var c=i.props.unstyled,d=uy[l](u,c);d.boxSizing="border-box";var g=i.props.styles[l];return g?g(d,u):d},i.getClassNames=function(l,u){var c,d;return(c=(d=i.props.classNames)[l])===null||c===void 0?void 0:c.call(d,u)},i.getElementId=function(l){return"".concat(i.state.instancePrefix,"-").concat(l)},i.getComponents=function(){return Ow(i.props)},i.buildCategorizedOptions=function(){return ea(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return Mf(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(l,u){i.setState({ariaSelection:Ae({value:l},u)})},i.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(l){i.blockOptionHover=!1},i.onControlMouseDown=function(l){if(!l.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},i.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!i.props.isDisabled){var u=i.props,c=u.isMulti,d=u.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!c}),i.onMenuClose()):i.openMenu("first"),l.preventDefault()}},i.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(i.clearValue(),l.preventDefault(),i.openAfterFocus=!1,l.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(l){typeof i.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&xa(l.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(l)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(l){var u=l.touches,c=u&&u.item(0);c&&(i.initialTouchX=c.clientX,i.initialTouchY=c.clientY,i.userIsDragging=!1)},i.onTouchMove=function(l){var u=l.touches,c=u&&u.item(0);if(c){var d=Math.abs(c.clientX-i.initialTouchX),g=Math.abs(c.clientY-i.initialTouchY),h=5;i.userIsDragging=d>h||g>h}},i.onTouchEnd=function(l){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(l.target)&&i.menuListRef&&!i.menuListRef.contains(l.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(l){i.userIsDragging||i.onControlMouseDown(l)},i.onClearIndicatorTouchEnd=function(l){i.userIsDragging||i.onClearIndicatorMouseDown(l)},i.onDropdownIndicatorTouchEnd=function(l){i.userIsDragging||i.onDropdownIndicatorMouseDown(l)},i.handleInputChange=function(l){var u=i.props.inputValue,c=l.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(c,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(l){i.props.onFocus&&i.props.onFocus(l),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(l){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(l),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(l){if(!(i.blockOptionHover||i.state.focusedOption===l)){var u=i.getFocusableOptions(),c=u.indexOf(l);i.setState({focusedOption:l,focusedOptionId:c>-1?i.getFocusedOptionId(l):null})}},i.shouldHideSelectedOptions=function(){return Df(i.props)},i.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),i.focus()},i.onKeyDown=function(l){var u=i.props,c=u.isMulti,d=u.backspaceRemovesValue,g=u.escapeClearsValue,h=u.inputValue,m=u.isClearable,p=u.isDisabled,v=u.menuIsOpen,w=u.onKeyDown,b=u.tabSelectsValue,x=u.openMenuOnFocus,O=i.state,R=O.focusedOption,M=O.focusedValue,_=O.selectValue;if(!p&&!(typeof w=="function"&&(w(l),l.defaultPrevented))){switch(i.blockOptionHover=!0,l.key){case"ArrowLeft":if(!c||h)return;i.focusValue("previous");break;case"ArrowRight":if(!c||h)return;i.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(M)i.removeValue(M);else{if(!d)return;c?i.popValue():m&&i.clearValue()}break;case"Tab":if(i.isComposing||l.shiftKey||!v||!b||!R||x&&i.isOptionSelected(R,_))return;i.selectOption(R);break;case"Enter":if(l.keyCode===229)break;if(v){if(!R||i.isComposing)return;i.selectOption(R);break}return;case"Escape":v?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:h}),i.onMenuClose()):m&&g&&i.clearValue();break;case" ":if(h)return;if(!v){i.openMenu("first");break}if(!R)return;i.selectOption(R);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}l.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++wy),i.state.selectValue=ic(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),s=i.buildFocusableOptions(),a=s.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=s[a],i.state.focusedOptionId=ws(o,s[a])}return i}return Mg(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&&oc(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var o=this.props,s=o.isDisabled,a=o.menuIsOpen,l=this.state.isFocused;(l&&!s&&i.isDisabled||l&&a&&!i.menuIsOpen)&&this.focusInput(),l&&s&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!s&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(oc(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,o){this.props.onInputChange(i,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var o=this,s=this.state,a=s.selectValue,l=s.isFocused,u=this.buildFocusableOptions(),c=i==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(a[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(i){var o=this.state,s=o.selectValue,a=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=s.indexOf(a);a||(l=-1);var u=s.length-1,c=-1;if(s.length){switch(i){case"previous":l===0?c=0:l===-1?c=u:c=l-1;break;case"next":l>-1&&l<u&&(c=l+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:s[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,s=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,u=a.indexOf(s);s||(u=-1),i==="up"?l=u>0?u-1:a.length-1:i==="down"?l=(u+1)%a.length:i==="pageup"?(l=u-o,l<0&&(l=0)):i==="pagedown"?(l=u+o,l>a.length-1&&(l=a.length-1)):i==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(bs):Ae(Ae({},bs),this.props.theme):bs}},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,s=this.getStyles,a=this.getClassNames,l=this.getValue,u=this.selectOption,c=this.setValue,d=this.props,g=d.isMulti,h=d.isRtl,m=d.options,p=this.hasValue();return{clearValue:i,cx:o,getStyles:s,getClassNames:a,getValue:l,hasValue:p,isMulti:g,isRtl:h,options:m,selectOption:u,selectProps:d,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,o=i.isClearable,s=i.isMulti;return o===void 0?s:o}},{key:"isOptionDisabled",value:function(i,o){return If(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return Ef(this.props,i,o)}},{key:"filterOption",value:function(i,o){return Tf(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var s=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:s,selectValue:a})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,o=i.isDisabled,s=i.isSearchable,a=i.inputId,l=i.inputValue,u=i.tabIndex,c=i.form,d=i.menuIsOpen,g=i.required,h=this.getComponents(),m=h.Input,p=this.state,v=p.inputIsHidden,w=p.ariaSelection,b=this.commonProps,x=a||this.getElementId("input"),O=Ae(Ae(Ae({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":g,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!s&&{"aria-readonly":!0}),this.hasValue()?w?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return s?f.createElement(m,Ne({},b,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:x,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:l},O)):f.createElement(qw,Ne({id:x,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:ha,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},O))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),s=o.MultiValue,a=o.MultiValueContainer,l=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,d=o.Placeholder,g=this.commonProps,h=this.props,m=h.controlShouldRenderValue,p=h.isDisabled,v=h.isMulti,w=h.inputValue,b=h.placeholder,x=this.state,O=x.selectValue,R=x.focusedValue,M=x.isFocused;if(!this.hasValue()||!m)return w?null:f.createElement(d,Ne({},g,{key:"placeholder",isDisabled:p,isFocused:M,innerProps:{id:this.getElementId("placeholder")}}),b);if(v)return O.map(function(I,k){var A=I===R,D="".concat(i.getOptionLabel(I),"-").concat(i.getOptionValue(I));return f.createElement(s,Ne({},g,{components:{Container:a,Label:l,Remove:u},isFocused:A,isDisabled:p,key:D,index:k,removeProps:{onClick:function(){return i.removeValue(I)},onTouchEnd:function(){return i.removeValue(I)},onMouseDown:function(E){E.preventDefault()}},data:I}),i.formatOptionLabel(I,"value"))});if(w)return null;var _=O[0];return f.createElement(c,Ne({},g,{data:_,isDisabled:p}),this.formatOptionLabel(_,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,Ne({},s,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return f.createElement(o,Ne({},s,{innerProps:d,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,s=i.IndicatorSeparator;if(!o||!s)return null;var a=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return f.createElement(s,Ne({},a,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var s=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,Ne({},s,{innerProps:u,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),s=o.Group,a=o.GroupHeading,l=o.Menu,u=o.MenuList,c=o.MenuPortal,d=o.LoadingMessage,g=o.NoOptionsMessage,h=o.Option,m=this.commonProps,p=this.state.focusedOption,v=this.props,w=v.captureMenuScroll,b=v.inputValue,x=v.isLoading,O=v.loadingMessage,R=v.minMenuHeight,M=v.maxMenuHeight,_=v.menuIsOpen,I=v.menuPlacement,k=v.menuPosition,A=v.menuPortalTarget,D=v.menuShouldBlockScroll,C=v.menuShouldScrollIntoView,E=v.noOptionsMessage,T=v.onMenuScrollToTop,S=v.onMenuScrollToBottom;if(!_)return null;var B=function(te,ue){var fe=te.type,se=te.data,H=te.isDisabled,P=te.isSelected,G=te.label,ce=te.value,he=p===se,Ie=H?void 0:function(){return i.onOptionHover(se)},me=H?void 0:function(){return i.selectOption(se)},Qe="".concat(i.getElementId("option"),"-").concat(ue),xe={id:Qe,onClick:me,onMouseMove:Ie,onMouseOver:Ie,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:P};return f.createElement(h,Ne({},m,{innerProps:xe,data:se,isDisabled:H,isSelected:P,key:Qe,label:G,type:fe,value:ce,isFocused:he,innerRef:he?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(te.data,"menu"))},X;if(this.hasOptions())X=this.getCategorizedOptions().map(function(re){if(re.type==="group"){var te=re.data,ue=re.options,fe=re.index,se="".concat(i.getElementId("group"),"-").concat(fe),H="".concat(se,"-heading");return f.createElement(s,Ne({},m,{key:se,data:te,options:ue,Heading:a,headingProps:{id:H,data:re.data},label:i.formatGroupLabel(re.data)}),re.options.map(function(P){return B(P,"".concat(fe,"-").concat(P.index))}))}else if(re.type==="option")return B(re,"".concat(re.index))});else if(x){var Y=O({inputValue:b});if(Y===null)return null;X=f.createElement(d,m,Y)}else{var ae=E({inputValue:b});if(ae===null)return null;X=f.createElement(g,m,ae)}var Q={minMenuHeight:R,maxMenuHeight:M,menuPlacement:I,menuPosition:k,menuShouldScrollIntoView:C},ee=f.createElement(k1,Ne({},m,Q),function(re){var te=re.ref,ue=re.placerProps,fe=ue.placement,se=ue.maxHeight;return f.createElement(l,Ne({},m,Q,{innerRef:te,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:x,placement:fe}),f.createElement(Zw,{captureEnabled:w,onTopArrive:T,onBottomArrive:S,lockEnabled:D},function(H){return f.createElement(u,Ne({},m,{innerRef:function(G){i.getMenuListRef(G),H(G)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:i.getElementId("listbox")},isLoading:x,maxHeight:se,focusedOption:p}),X)}))});return A||k==="fixed"?f.createElement(c,Ne({},m,{appendTo:A,controlElement:this.controlRef,menuPlacement:I,menuPosition:k}),ee):ee}},{key:"renderFormField",value:function(){var i=this,o=this.props,s=o.delimiter,a=o.isDisabled,l=o.isMulti,u=o.name,c=o.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!a)return f.createElement(ey,{name:u,onFocus:this.onValueInputFocus});if(!(!u||a))if(l)if(s){var g=d.map(function(p){return i.getOptionValue(p)}).join(s);return f.createElement("input",{name:u,type:"hidden",value:g})}else{var h=d.length>0?d.map(function(p,v){return f.createElement("input",{key:"i-".concat(v),name:u,type:"hidden",value:i.getOptionValue(p)})}):f.createElement("input",{name:u,type:"hidden",value:""});return f.createElement("div",null,h)}else{var m=d[0]?this.getOptionValue(d[0]):"";return f.createElement("input",{name:u,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,s=o.ariaSelection,a=o.focusedOption,l=o.focusedValue,u=o.isFocused,c=o.selectValue,d=this.getFocusableOptions();return f.createElement(Vw,Ne({},i,{id:this.getElementId("live-region"),ariaSelection:s,focusedOption:a,focusedValue:l,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,s=i.IndicatorsContainer,a=i.SelectContainer,l=i.ValueContainer,u=this.props,c=u.className,d=u.id,g=u.isDisabled,h=u.menuIsOpen,m=this.state.isFocused,p=this.commonProps=this.getCommonProps();return f.createElement(a,Ne({},p,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:g,isFocused:m}),this.renderLiveRegion(),f.createElement(o,Ne({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:g,isFocused:m,menuIsOpen:h}),f.createElement(l,Ne({},p,{isDisabled:g}),this.renderPlaceholderOrValue(),this.renderInput()),f.createElement(s,Ne({},p,{isDisabled:g}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var s=o.prevProps,a=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,d=o.prevWasFocused,g=o.instancePrefix,h=i.options,m=i.value,p=i.menuIsOpen,v=i.inputValue,w=i.isMulti,b=ic(m),x={};if(s&&(m!==s.value||h!==s.options||p!==s.menuIsOpen||v!==s.inputValue)){var O=p?py(i,b):[],R=p?wc(ea(i,b),"".concat(g,"-option")):[],M=a?vy(o,b):null,_=by(o,O),I=ws(R,_);x={selectValue:b,focusedOption:_,focusedOptionId:I,focusableOptionsWithIds:R,focusedValue:M,clearFocusValueOnUpdate:!1}}var k=l!=null&&i!==s?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},A=u,D=c&&d;return c&&!D&&(A={value:jo(w,b,b[0]||null),options:b,action:"initial-input-focus"},D=!d),u?.action==="initial-input-focus"&&(A=null),Ae(Ae(Ae({},x),k),{},{prevProps:i,ariaSelection:A,prevWasFocused:D})}}]),n}(f.Component);Of.defaultProps=my;var yy=f.forwardRef(function(e,t){var n=qb(e);return f.createElement(Of,Ne({ref:t},n))}),Cy=yy;const Sy=e=>{const{Menu:t}=yf,{children:n,...r}=e;return f.createElement(t,{...r},n)},xy=un("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),ky=un("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),My=un("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),Ry=e=>{const{value:t,onFinishedEditing:n,initialValue:r,portalElementRef:i}=e,{allowedValues:o,value:s}=t.data,[a,l]=f.useState(s),[u,c]=f.useState(r??""),d=Qm(),g=f.useMemo(()=>o.map(h=>typeof h=="string"||h===null||h===void 0?{value:h,label:h?.toString()??""}:h),[o]);return t.readonly?f.createElement(My,null,f.createElement(qr,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):f.createElement(xy,null,f.createElement(Cy,{className:"glide-select",inputValue:u,onInputChange:c,menuPlacement:"auto",value:g.find(h=>h.value===a),styles:{control:h=>({...h,border:0,boxShadow:"none"}),option:(h,{isFocused:m})=>({...h,fontSize:d.editorFontSize,fontFamily:d.fontFamily,cursor:m?"pointer":void 0,paddingLeft:d.cellHorizontalPadding,paddingRight:d.cellHorizontalPadding,":active":{...h[":active"],color:d.accentFg},":empty::after":{content:'"&nbsp;"',visibility:"hidden"}})},theme:h=>({...h,colors:{...h.colors,neutral0:d.bgCell,neutral5:d.bgCell,neutral10:d.bgCell,neutral20:d.bgCellMedium,neutral30:d.bgCellMedium,neutral40:d.bgCellMedium,neutral50:d.textLight,neutral60:d.textMedium,neutral70:d.textMedium,neutral80:d.textDark,neutral90:d.textDark,neutral100:d.textDark,primary:d.accentColor,primary75:d.accentColor,primary50:d.accentColor,primary25:d.accentLight}}),menuPortalTarget:i?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:h=>f.createElement(ky,null,f.createElement(Sy,{className:"click-outside-ignore",...h}))},options:g,onChange:async h=>{h!==null&&(l(h.value),await new Promise(m=>window.requestAnimationFrame(m)),n({...t,data:{...t.data,value:h.value}}))}}))},Iy={kind:J.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{value:o}=t.data,s=t.data.allowedValues.find(l=>typeof l=="string"||l===null||l===void 0?l===o:l.value===o),a=typeof s=="string"?s:s?.label??"";return a&&(n.fillStyle=r.textDark,n.fillText(a,i.x+r.cellHorizontalPadding,i.y+i.height/2+Qn(n,r))),!0},measure:(e,t,n)=>{const{value:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Ry,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,value:""}})}),onPaste:(e,t)=>({...t,value:t.allowedValues.some(n=>n==null?!1:typeof n=="string"?n===e:n.value===e)?e:t.value})};function Ey(e,t){const n=/(\d+\.?\d*)\s*(px|rem|em|%|pt)/,r=e.match(n);if(r){const i=parseFloat(r[1]),o=r[2],s=i*t;return e.replace(n,`${Number(s.toPrecision(3))}${o}`)}return e}const Ty={marginRight:8},Dy={display:"flex",alignItems:"center",flexGrow:1},Oy={kind:J.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{min:o,max:s,value:a,label:l,measureLabel:u}=t.data,c=i.x+r.cellHorizontalPadding,d=i.y+i.height/2,g=s-o,h=(a-o)/g,m=`${Ey(r.baseFontStyle,.9)} ${r.fontFamily}`,v=Gs(n,m)/2;n.save();let w=0;l!==void 0&&(n.font=m,w=Xr(u??l,n,m).width+r.cellHorizontalPadding);const b=i.width-r.cellHorizontalPadding*2-w;if(b>=v){const x=n.createLinearGradient(c,d,c+b,d);x.addColorStop(0,r.accentColor),x.addColorStop(h,r.accentColor),x.addColorStop(h,r.bgBubble),x.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=x,Qu(n,c,d-v/2,b,v,v/2),n.fill(),n.beginPath(),Qu(n,c+.5,d-v/2+.5,b-1,v-1,(v-1)/2),n.strokeStyle=r.accentLight,n.lineWidth=1,n.stroke()}return l!==void 0&&(n.textAlign="right",n.fillStyle=r.textDark,n.fillText(l,i.x+i.width-r.cellHorizontalPadding,d+Qn(n,m))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,r=t.value.toString(),i=t.min.toString(),o=t.max.toString(),s=t.step.toString(),a=l=>{e.onChange({...e.value,data:{...t,value:Number(l.target.value)}})};return f.createElement("label",{style:Dy},f.createElement("input",{style:Ty,type:"range",value:r,min:i,max:o,step:s,onChange:a,disabled:n}),r)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},Py=un("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),ys=(e,t,n)=>{if(t==null)return"";n&&(t=new Date(t.getTime()+n));const r=t.toISOString();switch(e){case"date":return r.split("T")[0];case"datetime-local":return r.replace("Z","");case"time":return r.split("T")[1].replace("Z","");default:throw new Error(`Unknown date kind ${e}`)}},_y=e=>{const t=e.value.data,{format:n,displayDate:r}=t,i=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,o=t.timezoneOffset?t.timezoneOffset*60*1e3:0,s=t.min instanceof Date?ys(n,t.min,o):t.min,a=t.max instanceof Date?ys(n,t.max,o):t.max,l=ys(n,t.date,o);return e.value.readonly?Vt.createElement(qr,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):Vt.createElement(Py,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:l,min:s,max:a,step:i,autoFocus:!0,onChange:u=>{isNaN(u.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(u.target.valueAsNumber-o)}})}})},Fy={kind:J.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return qs(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:_y}),onPaste:(e,t)=>{let n=NaN;return e&&(n=Number(e).valueOf(),Number.isNaN(n)&&(n=Date.parse(e),t.format==="time"&&Number.isNaN(n)&&(n=Date.parse(`1970-01-01T${e}Z`)))),{...t,date:Number.isNaN(n)?void 0:new Date(n)}}},Ly="None";function Cc(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-n.cellHorizontalPadding,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+n.cellHorizontalPadding),e.fillStyle=n.accentColor,e.fill(),e.restore()}const Ay=e=>{const{cell:t,theme:n,ctx:r}=e;qs({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`}},Ly,t.contentAlign),r.fillStyle=n.textDark};function Hy(e){const t=f.useCallback((r,i)=>{const{cell:o,theme:s,ctx:a,rect:l}=r,u=r.col;if(pi(o))Cc(a,l,s);else if(Ca(o)&&u<e.length){const c=e[u];["checkbox","line_chart","bar_chart","progress"].includes(c.kind)?i():Ay(r),c.isRequired&&c.isEditable&&Cc(a,l,s);return}i()},[e]),n=f.useMemo(()=>[Wb,Iy,Oy,Fy,...vb],[]);return{drawCell:t,customRenderers:n}}function zy(){const e=Wr();return f.useMemo(()=>{const n={editable:i=>`<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="${i.bgColor}"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>`};return{glideTheme:{accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:ui(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:ui(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroundColor,bgHeaderHasFocus:ui(e.colors.darkenedBgMix100,.9),bgHeaderHovered:ui(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(an("1.125rem")),headerFontStyle:`${e.fontWeights.normal} ${an(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${an(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:ui(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(an(e.spacing.sm)),cellVerticalPadding:Math.round(an("0.1875rem")),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,bubbleHeight:Math.round(an("1.25rem")),bubblePadding:Math.round(an(e.spacing.sm)),bubbleMargin:Math.round(an(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(an(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(an("25rem")),minColumnWidth:Math.round(an("3.125rem")),maxColumnWidth:Math.round(an("62.5rem")),maxColumnAutoWidth:Math.round(an("31.25rem")),defaultRowHeight:Math.round(an("2.1875rem")),defaultHeaderHeight:Math.round(an("2.1875rem")),bgRowHovered:og(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:n}},[e])}const Vy=pa.getLogger("useDataEditor");function $y(e,t,n,r,i,o,s,a,l){const u=f.useCallback(([p,v],w)=>{const b=e[p];if(!b.isEditable)return;const x=b.indexNumber,O=n.current.getOriginalRowIndex(i(v)),R=r([p,v]),M=b.getCellValue(R),_=b.getCellValue(w);if(!pi(R)&&_===M)return;const I=b.getCell(_,!0);pi(I)?Vy.warn(`Not applying the cell edit since it causes this error:
195
195
  ${I.data}`):(n.current.setCell(x,O,{...I,lastUpdated:performance.now()}),a())},[e,n,i,r,a]),c=f.useCallback(()=>{if(t)return;const p=new Map;e.forEach(v=>{p.set(v.indexNumber,v.getCell(v.defaultValue))}),n.current.addRow(p),s()},[e,n,t,s]),d=f.useCallback(()=>{t||(c(),a())},[c,a,t]),g=f.useCallback(p=>{if(p.rows.length>0){if(t)return!0;const v=p.rows.toArray().map(w=>n.current.getOriginalRowIndex(i(w)));return n.current.deleteRows(v),s(),l(),a(),!1}if(p.current?.range){const v=[],w=p.current.range;for(let b=w.y;b<w.y+w.height;b++)for(let x=w.x;x<w.x+w.width;x++){const O=e[x];O.isEditable&&!O.isRequired&&(v.push({cell:[x,b]}),u([x,b],O.getCell(null)))}return v.length>0&&(a(),o(v)),!1}return!0},[e,n,t,o,i,a,u,l,s]),h=f.useCallback((p,v)=>{const[w,b]=p,x=[];for(let O=0;O<v.length;O++){const R=v[O];if(O+b>=n.current.getNumRows()){if(t)break;c()}for(let M=0;M<R.length;M++){const _=R[M],I=O+b,k=M+w;if(k>=e.length)break;const A=e[k];if(A.isEditable){const D=A.getCell(_,!0);if(lt(D)&&!pi(D)){const C=A.indexNumber,E=n.current.getOriginalRowIndex(i(I)),T=A.getCellValue(r([k,I]));A.getCellValue(D)!==T&&(n.current.setCell(C,E,{...D,lastUpdated:performance.now()}),x.push({cell:[k,I]}))}}}x.length>0&&(a(),o(x))}return!1},[e,n,t,i,r,c,a,o]),m=f.useCallback((p,v)=>{const w=p[0];if(w>=e.length)return!0;const b=e[w];if(b.validateInput){const x=b.validateInput(b.getCellValue(v));return x===!0||x===!1?x:b.getCell(x)}return!0},[e]);return{onCellEdited:u,onPaste:h,onRowAppended:d,onDelete:g,validateCell:m}}const Pf=",",Ki='"',Ny='"',_f=`
196
- `,By="\uFEFF",Wy=new RegExp(`[${[Pf,Ki,_f].join("")}]`),Sc=pa.getLogger("useDataExporter");function xc(e){return e.map(t=>Uy(t)).join(Pf)+_f}function Uy(e){if(He(e))return"";const t=mt(e);return Wy.test(t)?`${Ki}${t.replace(new RegExp(Ki,"g"),Ny+Ki)}${Ki}`:t}async function kc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(By));const o=n.map(s=>s.name);await e.write(i.encode(xc(o)));for(let s=0;s<r;s++){const a=[];n.forEach((l,u,c)=>{a.push(l.getCellValue(t([u,s])))}),await e.write(i.encode(xc(a)))}await e.close()}function qy(e,t,n,r){return{exportToCsv:f.useCallback(async()=>{const s=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await As(()=>import("./es6.CbPK4m0H.js").then(c=>c.a),__vite__mapDeps([15,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:s,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await kc(u,e,t,n)}catch(a){if(a instanceof Error&&a.name==="AbortError")return;try{Sc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",a);let l="";const u=new WritableStream({write:h=>{l+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await kc(u.getWriter(),e,t,n);const c=new Blob([l],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),g=Sg({enforceDownloadInNewTab:r,url:d,filename:s});g.style.display="none",document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(d)}catch(l){Sc.error("Failed to export data as CSV",l)}}},[t,n,e,r])}}function Gy(e,t,n,r){return{getCellContent:f.useCallback(([o,s])=>{if(o>t.length-1)return Et("Column index out of bounds","This error should never happen. Please report this bug.");if(s>n-1)return Et("Row index out of bounds","This error should never happen. Please report this bug.");try{const a=t[o],l=a.indexNumber,u=r.current.getOriginalRowIndex(s),c=r.current.isAddedRow(u);if(a.isEditable||c){const h=r.current.getCell(l,u);if(lt(h))return{...a.getCell(a.getCellValue(h),!1),lastUpdated:h.lastUpdated};if(c)return Et("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${l}; row=${u}`)}const d=e.getCell(u,l),g=ag(e,u,l);return Ib(a,d,g,e.styler?.cssStyles)}catch(a){return Et("Error during cell creation",`This error should never happen. Please report this bug.
196
+ `,By="\uFEFF",Wy=new RegExp(`[${[Pf,Ki,_f].join("")}]`),Sc=pa.getLogger("useDataExporter");function xc(e){return e.map(t=>Uy(t)).join(Pf)+_f}function Uy(e){if(He(e))return"";const t=mt(e);return Wy.test(t)?`${Ki}${t.replace(new RegExp(Ki,"g"),Ny+Ki)}${Ki}`:t}async function kc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(By));const o=n.map(s=>s.name);await e.write(i.encode(xc(o)));for(let s=0;s<r;s++){const a=[];n.forEach((l,u,c)=>{a.push(l.getCellValue(t([u,s])))}),await e.write(i.encode(xc(a)))}await e.close()}function qy(e,t,n,r){return{exportToCsv:f.useCallback(async()=>{const s=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await As(()=>import("./es6.CMaUdEZ5.js").then(c=>c.a),__vite__mapDeps([15,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:s,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await kc(u,e,t,n)}catch(a){if(a instanceof Error&&a.name==="AbortError")return;try{Sc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",a);let l="";const u=new WritableStream({write:h=>{l+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await kc(u.getWriter(),e,t,n);const c=new Blob([l],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),g=Sg({enforceDownloadInNewTab:r,url:d,filename:s});g.style.display="none",document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(d)}catch(l){Sc.error("Failed to export data as CSV",l)}}},[t,n,e,r])}}function Gy(e,t,n,r){return{getCellContent:f.useCallback(([o,s])=>{if(o>t.length-1)return Et("Column index out of bounds","This error should never happen. Please report this bug.");if(s>n-1)return Et("Row index out of bounds","This error should never happen. Please report this bug.");try{const a=t[o],l=a.indexNumber,u=r.current.getOriginalRowIndex(s),c=r.current.isAddedRow(u);if(a.isEditable||c){const h=r.current.getCell(l,u);if(lt(h))return{...a.getCell(a.getCellValue(h),!1),lastUpdated:h.lastUpdated};if(c)return Et("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${l}; row=${u}`)}const d=e.getCell(u,l),g=ag(e,u,l);return Ib(a,d,g,e.styler?.cssStyles)}catch(a){return Et("Error during cell creation",`This error should never happen. Please report this bug.
197
197
  Error: ${a}`)}},[t,n,e,r])}}function Xy(e){const[t,n]=f.useState(void 0),r=f.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,s]=o.location;n(s)}},[n]);return{getRowThemeOverride:f.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function Yy(e,t,n,r,i){const[o,s]=f.useState({columns:ot.empty(),rows:ot.empty(),current:void 0}),a=!t&&!n&&(e.selectionMode.includes(wn.SelectionMode.MULTI_ROW)||e.selectionMode.includes(wn.SelectionMode.SINGLE_ROW)),l=a&&e.selectionMode.includes(wn.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(wn.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(wn.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(wn.SelectionMode.MULTI_COLUMN),d=o.rows.length>0,g=o.columns.length>0,h=o.current!==void 0,m=f.useCallback(v=>{const w=!Ga(v.rows.toArray(),o.rows.toArray()),b=!Ga(v.columns.toArray(),o.columns.toArray()),x=!Ga(v.current,o.current);let O=a&&w||u&&b,R=v;if((a||u)&&v.current!==void 0&&x&&(R={...v,rows:o.rows,columns:o.columns},O=!1),w&&v.rows.length>0&&b&&v.columns.length===0&&(R={...R,columns:o.columns},O=!0),b&&v.columns.length>0&&w&&v.rows.length===0&&(R={...R,rows:o.rows},O=!0),b&&R.columns.length>=0){let M=R.columns;r.forEach((_,I)=>{_.isIndex&&(M=M.remove(I))}),M.length<R.columns.length&&(R={...R,columns:M})}s(R),O&&i(R)},[o,a,u,i,r]),p=f.useCallback((v=!1,w=!1)=>{const b={columns:w?o.columns:ot.empty(),rows:v?o.rows:ot.empty(),current:void 0};s(b),(!v&&a||!w&&u)&&i(b)},[o,a,u,i]);return{gridSelection:o,isRowSelectionActivated:a,isMultiRowSelectionActivated:l,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isRowSelected:d,isColumnSelected:g,isCellSelected:h,clearSelection:p,processSelectionChange:m}}function jy(e,t,n,r,i,o,s){const a=e.rowHeight??t.defaultRowHeight,l=t.defaultHeaderHeight+a+2*t.tableBorderWidth,u=r?2:1,c=e.editingMode===wn.EditingMode.DYNAMIC?1:0,d=n+c;let g=Math.max(d*a+u*t.defaultHeaderHeight+2*t.tableBorderWidth,l),h=Math.min(g,t.defaultTableHeight);e.height&&(h=Math.max(e.height,l),g=Math.max(e.height,g)),o&&(h=Math.min(h,o),g=Math.min(g,o),e.height||(h=g));const m=t.minColumnWidth+2*t.tableBorderWidth,p=Math.max(i,m);let v,w=p;e.useContainerWidth?v=p:e.width&&(v=Math.min(Math.max(e.width,m),p),w=Math.min(Math.max(e.width,w),p));const[b,x]=f.useState({width:v||"100%",height:h});return f.useLayoutEffect(()=>{e.useContainerWidth&&b.width==="100%"&&x(O=>({...O,width:p}))},[p]),f.useLayoutEffect(()=>{x(O=>({...O,width:v||"100%"}))},[v]),f.useLayoutEffect(()=>{x(O=>({...O,height:h}))},[h,n]),f.useLayoutEffect(()=>{if(s){const O=e.useContainerWidth||lt(e.width)&&e.width>0;x({width:O?w:"100%",height:g})}else x({width:v||"100%",height:h})},[s]),{minHeight:l,maxHeight:g,minWidth:m,maxWidth:w,rowHeight:a,resizableSize:b,setResizableSize:x}}const Ky=600,Zy="⚠️ Please fill out this cell.";function Jy(e,t,n=[]){const[r,i]=f.useState(),o=f.useRef(null),s=f.useCallback(l=>{if(clearTimeout(o.current),o.current=0,i(void 0),(l.kind==="header"||l.kind==="cell")&&l.location){const u=l.location[0],c=l.location[1];let d;if(u<0||u>=e.length||n.includes(c))return;const g=e[u];if(l.kind==="header"&&lt(g))d=g.help;else if(l.kind==="cell"){const h=t([u,c]);pi(h)?d=h.errorDetails:g.isRequired&&g.isEditable&&Ca(h)?d=Zy:ib(h)&&(d=h.tooltip)}d&&(o.current=setTimeout(()=>{d&&i({content:d,left:l.bounds.x+l.bounds.width/2,top:l.bounds.y})},Ky))}},[e,t,i,o,n]),a=f.useCallback(()=>{i(void 0)},[i]);return{tooltip:r,clearTooltip:a,onItemHovered:s}}const Ff=Un("div",{target:"e32gfpu0"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs})),xr=Un("div",{target:"e32gfpu1"})(({theme:e,isActive:t,hasSubmenu:n})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,paddingTop:e.spacing.twoXS,paddingBottom:e.spacing.twoXS,cursor:"pointer",backgroundColor:t?e.colors.darkenedBgMix15:void 0,"&:hover":{backgroundColor:e.colors.darkenedBgMix15},minWidth:e.sizes.minMenuWidth,...n&&{justifyContent:"space-between","& > :first-of-type":{display:"flex",alignItems:"center",gap:e.spacing.sm}}})),Qy=Un("div",{target:"e32gfpu2"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs})),eC=Un("div",{target:"e32gfpu3"})(({theme:e})=>({display:"flex",alignItems:"center",padding:`${e.spacing.sm} ${e.spacing.sm}`,cursor:"default",gap:e.spacing.twoXS})),tC=Un("div",{target:"e32gfpu4"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",padding:e.spacing.twoXS,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.md,backgroundColor:"transparent",color:e.colors.bodyText,height:"fit-content"})),nC=Un("div",{target:"e32gfpu5"})(({theme:e})=>({display:"flex",alignItems:"center",flexGrow:1,padding:`${e.spacing.threeXS} ${e.spacing.threeXS}`,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.md,backgroundColor:e.colors.secondaryBg,minWidth:0,overflow:"hidden"})),rC=Un("span",{target:"e32gfpu6"})(({theme:e})=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1,margin:`0 ${e.spacing.xs}`,fontSize:e.fontSizes.twoSm,maxWidth:"4rem"})),iC=Un("button",{target:"e32gfpu7"})(({theme:e})=>({background:"none",border:"none",padding:e.spacing.twoXS,cursor:"pointer",color:e.colors.bodyText,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:e.radii.md,transition:"background-color 0.2s ease","&:hover":{backgroundColor:e.colors.fadedText05},"&:active":{backgroundColor:e.colors.fadedText10}})),Mc=[{format:"",label:"Automatic",icon:":material/123:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"plain",label:"Plain",icon:":material/speed_1_75:"},{format:"compact",label:"Compact",icon:":material/1k:"},{format:"dollar",label:"Dollar",icon:":material/attach_money:"},{format:"euro",label:"Euro",icon:":material/euro:"},{format:"yen",label:"Yen",icon:":material/currency_yen:"},{format:"percent",label:"Percent",icon:":material/percent:"},{format:"scientific",label:"Scientific",icon:":material/experiment:"},{format:"accounting",label:"Accounting",icon:":material/finance_chip:"}],oC={number:Mc,progress:Mc,datetime:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"distance",label:"Distance",icon:":material/search_activity:"},{format:"calendar",label:"Calendar",icon:":material/today:"}],date:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"distance",label:"Distance",icon:":material/search_activity:"}],time:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"}]};function aC({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:i,onCloseMenu:o,children:s}){const a=Wr(),{colors:l,fontSizes:u,radii:c,fontWeights:d}=a,g=oC[e]||[];return g.length===0?Ue(Vc,{}):Ue(wa,{triggerType:$c.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:Ue(Ff,{role:"menu",children:g.map(h=>vn(xr,{onClick:()=>{i(h.format),o()},role:"menuitem",children:[Ue(Bn,{size:"base",margin:"0",color:"inherit",iconValue:h.icon}),h.label]},h.format))}),placement:va.right,showArrow:!1,popoverMargin:2,overrides:{Body:{props:{"data-testid":"stDataFrameColumnFormattingMenu"},style:{borderTopLeftRadius:c.default,borderTopRightRadius:c.default,borderBottomLeftRadius:c.default,borderBottomRightRadius:c.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${a.sizes.borderWidth} solid ${a.colors.borderColor}`}},Inner:{style:{backgroundColor:ba(a)?l.bgColor:l.secondaryBg,color:l.bodyText,fontSize:u.sm,fontWeight:d.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:s})}const sC=f.memo(aC),Rc=pa.getLogger("ColumnMenu");function lC({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:i,onCloseMenu:o,onSortColumn:s,onHideColumn:a,column:l,onChangeFormat:u,onAutosize:c}){const d=Wr(),[g,h]=f.useState(!1),{colors:m,fontSizes:p,radii:v,fontWeights:w}=d;f.useEffect(()=>{function O(R){R.preventDefault()}return document.addEventListener("wheel",O,{passive:!1}),document.addEventListener("touchmove",O,{passive:!1}),()=>{document.removeEventListener("wheel",O),document.removeEventListener("touchmove",O)}},[]);const b=f.useCallback(()=>{o()},[o]),x=f.useCallback(()=>{navigator.clipboard?navigator.clipboard.writeText(l.title).catch(O=>{Rc.error("Failed to copy column name to clipboard:",O)}):Rc.error("Clipboard API not supported.")},[l.title]);return Ue(wa,{autoFocus:!0,"aria-label":"Dataframe column menu",content:vn(Ff,{children:[vn(eC,{children:[Ue(tC,{title:l.kind,children:Ue(Bn,{iconValue:l.typeIcon||":material/notes:",size:"base",color:"inherit"})}),vn(nC,{title:l.title,children:[Ue(rC,{children:l.title}),Ue(iC,{onClick:x,title:"Copy column name","aria-label":"Copy column name",children:Ue(Bn,{iconValue:":material/content_copy:",size:"sm",margin:"0",color:"inherit"})})]})]}),s&&vn(Vc,{children:[vn(xr,{onClick:()=>{s("asc"),b()},role:"menuitem",children:[Ue(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),vn(xr,{onClick:()=>{s("desc"),b()},role:"menuitem",children:[Ue(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_downward:"}),"Sort descending"]}),Ue(Qy,{})]}),u&&Ue(sC,{columnKind:l.kind,isOpen:g,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onChangeFormat:u,onCloseMenu:b,children:vn(xr,{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),isActive:g,hasSubmenu:!0,children:[vn("div",{children:[Ue(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/format_list_numbered:"}),"Format"]}),Ue(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/chevron_right:"})]})}),c&&vn(xr,{onClick:()=>{c(),b()},children:[Ue(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&vn(xr,{onClick:()=>{i(),b()},children:[Ue(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&vn(xr,{onClick:()=>{r(),b()},children:[Ue(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep:"}),"Pin column"]}),a&&vn(xr,{onClick:()=>{a(),b()},children:[Ue(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:va.bottomRight,accessibilityType:Nc.menu,showArrow:!1,popoverMargin:an("0.375rem"),onClickOutside:g?void 0:b,onEsc:b,overrides:{Body:{props:{"data-testid":"stDataFrameColumnMenu"},style:{paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{border:`${d.sizes.borderWidth} solid ${d.colors.borderColor}`,backgroundColor:ba(d)?m.bgColor:m.secondaryBg,color:m.bodyText,fontSize:p.sm,fontWeight:w.normal,borderTopLeftRadius:v.default,borderTopRightRadius:v.default,borderBottomLeftRadius:v.default,borderBottomRightRadius:v.default,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:!0,children:Ue("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const uC=f.memo(lC),cC="(index)",dC=({label:e,initialValue:t,onChange:n})=>{const r=Wr();return Ue(Cg,{checked:t,onChange:i=>{n(i.target.checked)},"aria-label":e,checkmarkType:yg.default,labelPlacement:wg.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:r.spacing.none,marginTop:r.spacing.none,paddingLeft:r.spacing.md,paddingRight:r.spacing.md,paddingTop:r.spacing.twoXS,paddingBottom:r.spacing.twoXS,backgroundColor:i?r.colors.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Checkmark:{style:({$isFocusVisible:i,$checked:o})=>{const s=o?r.colors.primary:r.colors.fadedText40;return{outline:0,width:r.sizes.checkbox,height:r.sizes.checkbox,marginTop:r.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&o?`0 0 0 0.2rem ${ui(r.colors.primary,.5)}`:"",borderLeftWidth:r.sizes.borderWidth,borderRightWidth:r.sizes.borderWidth,borderTopWidth:r.sizes.borderWidth,borderBottomWidth:r.sizes.borderWidth,borderLeftColor:s,borderRightColor:s,borderTopColor:s,borderBottomColor:s}}},Label:{style:{lineHeight:r.lineHeights.small,paddingLeft:r.spacing.sm,position:"relative",color:r.colors.bodyText,fontSize:r.fontSizes.sm,fontWeight:r.fontWeights.normal}}},children:e})},fC=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:i,children:o,isOpen:s,onClose:a})=>{const l=Wr();return Ue(wa,{triggerType:$c.click,placement:va.bottomRight,autoFocus:!0,focusLock:!0,content:()=>Ue("div",{style:{paddingTop:l.spacing.sm,paddingBottom:l.spacing.sm},children:e.map(u=>{const c=t.length&&!u.isIndex?!t.includes(u.id)&&!t.includes(u.name):!1;return Ue(dC,{label:!u.title&&u.isIndex?cC:u.title,initialValue:!(u.isHidden===!0||c),onChange:d=>{d?(i(u.id),c&&n(g=>[...g,u.id])):r(u.id)}},u.id)})}),isOpen:s,onClickOutside:a,onClick:()=>s?a():void 0,onEsc:a,ignoreBoundary:!1,overrides:{Body:{props:{"data-testid":"stDataFrameColumnVisibilityMenu"},style:{borderTopLeftRadius:l.radii.default,borderTopRightRadius:l.radii.default,borderBottomLeftRadius:l.radii.default,borderBottomRightRadius:l.radii.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${l.sizes.borderWidth} solid ${l.colors.borderColor}`}},Inner:{style:{backgroundColor:ba(l)?l.colors.bgColor:l.colors.secondaryBg,color:l.colors.bodyText,fontSize:l.fontSizes.sm,fontWeight:l.fontWeights.normal,minWidth:l.sizes.minMenuWidth,maxWidth:`calc(${l.sizes.minMenuWidth} * 2)`,maxHeight:l.sizes.maxDropdownHeight,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:Ue("div",{children:o})})},hC=f.memo(fC),Ic=Un("div",{target:"e8es05k0"})(({theme:e,isInHorizontalLayout:t})=>({position:"relative",display:t?"flex":"inline-block","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",borderRadius:e.radii.default},"& .dvn-scroller":{overflowX:"auto !important",overflowY:"auto !important"},"& .gdg-search-bar":{maxWidth:"19rem",width:"80%",minWidth:"6rem",top:e.spacing.sm,right:e.spacing.sm,padding:e.spacing.sm,borderRadius:e.radii.default,"& .gdg-search-status":{paddingTop:e.spacing.twoXS,fontSize:e.fontSizes.twoSm},"& .gdg-search-progress":{display:"none"},"& input":{width:"100%"},"& button":{width:e.iconSizes.xl,height:e.iconSizes.xl,"& .button-icon":{width:e.iconSizes.base,height:e.iconSizes.base}}}}));function gC({top:e,left:t,content:n,clearTooltip:r}){const[i,o]=f.useState(!0),s=Wr(),{colors:a,fontSizes:l,radii:u,fontWeights:c}=s,d=f.useCallback(()=>{o(!1),r()},[r,o]);return Ue(wa,{content:Ue(sg,{"data-testid":"stDataFrameTooltipContent",children:Ue(lg,{style:{fontSize:l.sm},source:n,allowHTML:!1})}),placement:va.top,accessibilityType:Nc.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:ba(s)?a.bgColor:a.secondaryBg,color:a.bodyText,fontSize:l.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:i,children:Ue("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const mC=f.memo(gC),Ec=150,pC=15e4,vC="0.5rem";function bC({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:i,fragmentId:o}){const{expanded:s,expand:a,collapse:l,width:u,height:c}=Pl(gg),{isInHorizontalLayout:d}=Pl(ug),g=f.useRef(null),h=f.useRef(null),m=f.useRef(null),p=cg(),v=zy(),{getRowThemeOverride:w,onItemHovered:b}=Xy(v),{libConfig:{enforceDownloadInNewTab:x=!1}}=f.useContext(dg),[O,R]=f.useState(!0),[M,_]=f.useState(!1),[I,k]=f.useState(!1),[A,D]=f.useState(!1),[C,E]=f.useState(),[T,S]=f.useState(!1),B=f.useCallback(()=>S(be=>!be),[]),X=f.useCallback(()=>S(!1),[]),Y=f.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]);He(e.editingMode)&&(e.editingMode=wn.EditingMode.READ_ONLY);const{READ_ONLY:ae,DYNAMIC:Q}=wn.EditingMode,ee=t.dimensions,re=Math.max(0,ee.numDataRows),te=re===0&&!(e.editingMode===Q&&ee.numDataColumns>0),ue=re>pC,fe=!ue&&!te&&e.editingMode!==Q,se=!te&&e.editingMode===Q&&!n,H=f.useRef(new qo(re)),[P,G]=f.useState(H.current.getNumRows());f.useEffect(()=>{H.current=new qo(re),G(H.current.getNumRows())},[re]);const ce=f.useCallback(()=>{H.current=new qo(re),G(H.current.getNumRows())},[re]),[he,Ie]=f.useState(e.columnOrder);f.useEffect(()=>{Ie(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:me,allColumns:Qe,setColumnConfigMapping:xe}=Db(e,t,n,he);f.useEffect(()=>{if(e.editingMode===ae)return;const be=r.getStringValue({id:e.id,formId:e.formId});be&&(H.current.fromJson(be,me),G(H.current.getNumRows()))},[]);const{getCellContent:At}=Gy(t,me,P,H),{columns:Xe,sortColumn:qe,getOriginalIndex:ne,getCellContent:ge}=$b(re,me,At),Ce=f.useCallback(be=>{const dt={selection:{rows:[],columns:[]}};dt.selection.rows=be.rows.toArray().map(Gt=>ne(Gt)),dt.selection.columns=be.columns.toArray().map(Gt=>to(Xe[Gt]));const bt=JSON.stringify(dt),jt=r.getStringValue({id:e.id,formId:e.formId});(jt===void 0||jt!==bt)&&r.setStringValue({id:e.id,formId:e.formId},bt,{fromUi:!0},o)},[Xe,e.id,e.formId,r,o,ne]),{debouncedCallback:de}=$u(Ce,Ec),{gridSelection:Se,isRowSelectionActivated:Ee,isMultiRowSelectionActivated:De,isColumnSelectionActivated:tt,isMultiColumnSelectionActivated:Oe,isRowSelected:Fe,isColumnSelected:Ve,isCellSelected:Te,clearSelection:Me,processSelectionChange:pt}=Yy(e,te,n,Xe,de);f.useEffect(()=>{Me(!0,!0)},[s]);const ht=f.useCallback(be=>{h.current?.updateCells(be)},[]);f.useEffect(()=>{if(!Ee&&!tt)return;const be=r.getStringValue({id:e.id,formId:e.formId});if(be){const dt=Xe.map(qn=>to(qn)),bt=JSON.parse(be);let jt=ot.empty(),Gt=ot.empty();bt.selection?.rows?.forEach(qn=>{jt=jt.add(qn)}),bt.selection?.columns?.forEach(qn=>{Gt=Gt.add(dt.indexOf(qn))}),(jt.length>0||Gt.length>0)&&pt({rows:jt,columns:Gt,current:void 0})}},[]);const Ye=f.useCallback(()=>{P!==H.current.getNumRows()&&G(H.current.getNumRows())},[P]),xt=f.useCallback(()=>{const be=H.current.toJson(Xe);let dt=r.getStringValue({id:e.id,formId:e.formId});dt===void 0&&(dt=new qo(0).toJson([])),be!==dt&&r.setStringValue({id:e.id,formId:e.formId},be,{fromUi:!0},o)},[Xe,e.id,e.formId,r,o]),{debouncedCallback:Yt}=$u(xt,Ec),{exportToCsv:Ht}=qy(ge,Xe,P,x),{onCellEdited:Mt,onPaste:cn,onRowAppended:Ut,onDelete:tn,validateCell:Tt}=$y(Xe,e.editingMode!==Q,H,ge,ne,ht,Ye,Yt,Me),yt=f.useMemo(()=>te?[0]:se?[P]:[],[te,se,P]),{tooltip:nn,clearTooltip:ut,onItemHovered:rn}=Jy(Xe,ge,yt),{drawCell:Nt,customRenderers:Pe}=Hy(Xe),{provideEditor:Dt}=Bb(),Rt=f.useCallback(be=>({...be,hasMenu:!te}),[te]),Mn=f.useMemo(()=>Xe.map(be=>Rt(Os(be))),[Xe,Rt]),{columns:qt,onColumnResize:dn}=Fb(Mn),Rn=t.dimensions.numHeaderRows>1,{minHeight:Zt,maxHeight:Jt,minWidth:We,maxWidth:Ot,rowHeight:yn,resizableSize:vt,setResizableSize:_t}=jy(e,v,P,Rn,u||0,c,s),Cn=f.useCallback(([be,dt])=>({...ob(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:v.glideTheme.textLight},span:[0,Math.max(Xe.length-1,0)]}),[Xe,v.glideTheme.textLight]),er=f.useCallback(()=>{ce(),Me()},[ce,Me]);pg({element:e,widgetMgr:r,onFormCleared:er});const{pinColumn:zn,unpinColumn:$,freezeColumns:$e}=Pb(Xe,te,u||0,v.minColumnWidth,Me,xe),{changeColumnFormat:Ge}=Ob(xe),{hideColumn:Ct,showColumn:mn}=Nb(Me,xe),{onColumnMoved:sn}=_b(Xe,$e,zn,$,Ie);return f.useEffect(()=>{let be;const dt=requestAnimationFrame(()=>{be=setTimeout(()=>{if(m.current&&h.current){const bt=m.current?.querySelector(".dvn-stack")?.getBoundingClientRect();bt&&(k(bt.height>m.current.clientHeight),D(bt.width>m.current.clientWidth))}},0)});return()=>{cancelAnimationFrame(dt),be&&clearTimeout(be)}},[vt,P,qt]),f.useEffect(()=>{Qe.length==Xe.length&&S(!1)},[Qe.length,Xe.length]),vn(Ic,{className:"stDataFrame","data-testid":"stDataFrame",ref:m,isInHorizontalLayout:d,onPointerDown:be=>{if(m.current){const dt=m.current.getBoundingClientRect(),bt=(p||Math.round(an(vC)))+1;A&&dt.height-bt<be.clientY-dt.top&&be.stopPropagation(),I&&dt.width-bt<be.clientX-dt.left&&be.stopPropagation()}},onBlur:be=>{!O&&!Y&&!be.currentTarget.contains(be.relatedTarget)&&Me(!0,!0)},children:[vn(mg,{isFullScreen:s,disableFullscreenMode:i,locked:Fe&&!Ee||Te||Y&&O||T,onExpand:a,onCollapse:l,target:Ic,children:[(Ee&&Fe||tt&&Ve)&&Ue(si,{label:"Clear selection",icon:xg,onClick:()=>{Me(),ut()}}),se&&Fe&&Ue(si,{label:"Delete row(s)",icon:Eg,onClick:()=>{tn&&(tn(Se),ut())}}),se&&!Fe&&Ue(si,{label:"Add row",icon:Bc,onClick:()=>{Ut&&(R(!0),Ut(),ut(),h.current?.scrollTo(0,P,"vertical"))}}),!te&&Qe.length>Xe.length&&Ue(hC,{columns:Qe,columnOrder:he,setColumnOrder:Ie,hideColumn:Ct,showColumn:mn,isOpen:T,onClose:X,children:Ue(si,{label:"Show/hide columns",icon:Uc,onClick:B})}),!ue&&!te&&Ue(si,{label:"Download as CSV",icon:Tg,onClick:Ht}),!te&&Ue(si,{label:"Search",icon:Wc,onClick:()=>{M?_(!1):(R(!0),_(!0)),ut()}})]}),Ue(fg,{"data-testid":"stDataFrameResizable",ref:g,defaultSize:vt,style:{border:`${v.tableBorderWidth}px solid ${v.glideTheme.borderColor}`,borderRadius:`${v.tableBorderRadius}`},minHeight:Zt,maxHeight:Jt,minWidth:We,maxWidth:d?void 0:Ot,size:vt,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!d,bottomLeft:!1,topLeft:!1},grid:[1,yn],snapGap:yn/3,onResizeStop:(be,dt,bt,jt)=>{if(g.current){const Gt=2*v.tableBorderWidth;_t({width:g.current.size.width,height:Jt-g.current.size.height===Gt?g.current.size.height+Gt:g.current.size.height})}},children:Ue(Zv,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:h,columns:qt,rows:te?1:P,minColumnWidth:v.minColumnWidth,maxColumnWidth:v.maxColumnWidth,maxColumnAutoWidth:v.maxColumnAutoWidth,rowHeight:yn,headerHeight:v.defaultHeaderHeight,getCellContent:te?Cn:ge,onColumnResize:Y?void 0:dn,resizeIndicator:"header",freezeColumns:$e,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:Y?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:tt?void 0:sn,onItemHovered:be=>{b?.(be),rn?.(be)},keybindings:{downFill:!0},onKeyDown:be=>{(be.ctrlKey||be.metaKey)&&be.key==="f"&&(_(dt=>!dt),be.stopPropagation(),be.preventDefault())},showSearch:M,searchResults:M?void 0:[],onSearchClose:()=>{_(!1),ut()},onHeaderClicked:(be,dt)=>{!fe||tt||(M&&_(!1),Ee&&Fe?Me():Me(!0,!0),qe(be,"auto"))},gridSelection:Se,onGridSelectionChange:be=>{(O||Y)&&(pt(be),nn!==void 0&&ut())},theme:v.glideTheme,getRowThemeOverride:w,onMouseMove:be=>{be.kind==="out-of-bounds"&&O?R(!1):be.kind!=="out-of-bounds"&&!O&&R(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,paddingBottom:A?-p:void 0,paddingRight:I?-p:void 0},provideEditor:Dt,drawCell:Nt,customRenderers:Pe,imageEditorOverride:pb,headerIcons:v.headerIcons,validateCell:Tt,onHeaderMenuClick:(be,dt)=>{E({columnIdx:be,headerBounds:dt})},onPaste:!1,...Ee&&{rowMarkers:{kind:"checkbox-visible",checkboxStyle:"square",theme:{bgCell:v.glideTheme.bgHeader,bgCellMedium:v.glideTheme.bgHeader,textMedium:v.glideTheme.textLight}},rowSelectionMode:De?"multi":"auto",rowSelect:n?"none":De?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...tt&&{columnSelect:n?"none":Oe?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!te&&e.editingMode!==ae&&!n&&{fillHandle:!Y,onCellEdited:Mt,onPaste:cn,onDelete:tn},...!te&&e.editingMode===Q&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:v.glideTheme.bgHeader,bgCellMedium:v.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:Ut,onHeaderClicked:void 0}})}),nn&&nn.content&&Ue(mC,{top:nn.top,left:nn.left,content:nn.content,clearTooltip:ut}),C&&Hc.createPortal(Ue(uC,{top:C.headerBounds.y+C.headerBounds.height,left:C.headerBounds.x+C.headerBounds.width,column:me[C.columnIdx],onCloseMenu:()=>E(void 0),onSortColumn:fe?be=>{M&&_(!1),Me(!(Ee&&Fe),!0),qe(C.columnIdx,be,!0)}:void 0,isColumnPinned:me[C.columnIdx].isPinned,onUnpinColumn:()=>{$(me[C.columnIdx].id)},onPinColumn:()=>{zn(me[C.columnIdx].id)},onHideColumn:()=>{Ct(me[C.columnIdx].id)},onChangeFormat:be=>{Ge(me[C.columnIdx].id,be),setTimeout(()=>{h.current?.remeasureColumns(ot.fromSingleSelection(C.columnIdx))},100)},onAutosize:()=>{h.current?.remeasureColumns(ot.fromSingleSelection(C.columnIdx))}}),document.querySelector("#portal"))]})}const wC=hg(bC),yC=f.memo(wC),_C=Object.freeze(Object.defineProperty({__proto__:null,default:yC},Symbol.toStringTag,{value:"Module"}));export{O0 as C,Sd as T,hi as a,Lg as b,_C as c,ci as i,Jm as m,un as s};