streamlit-nightly 1.46.2.dev20250715__py3-none-any.whl → 1.47.1.dev20250717__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.
- streamlit/connections/snowflake_connection.py +2 -2
- streamlit/elements/graphviz_chart.py +7 -0
- streamlit/elements/lib/file_uploader_utils.py +21 -2
- streamlit/elements/plotly_chart.py +6 -2
- streamlit/elements/pyplot.py +5 -1
- streamlit/elements/widgets/chat.py +6 -0
- streamlit/elements/widgets/file_uploader.py +6 -0
- streamlit/static/index.html +1 -1
- streamlit/static/manifest.json +218 -218
- streamlit/static/static/js/{ErrorOutline.esm.CaUhmcG6.js → ErrorOutline.esm.77fHhxmf.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.ZEl-HfEg.js → FileDownload.esm.qBSGbtBF.js} +1 -1
- streamlit/static/static/js/{FileHelper.BKIVKQnB.js → FileHelper.BYzZxqTl.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.C4W8xjEX.js → FormClearHelper.BapTKtHM.js} +1 -1
- streamlit/static/static/js/{Hooks.Bcs7Dqad.js → Hooks.DQUBTvpJ.js} +1 -1
- streamlit/static/static/js/{InputInstructions.CAp9mFM6.js → InputInstructions.DfmDQyfZ.js} +1 -1
- streamlit/static/static/js/{ProgressBar.DBmbQ5U6.js → ProgressBar.DH8nVA3A.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.BGENGpwt.js → RenderInPortalIfExists.Dc3T7qg7.js} +1 -1
- streamlit/static/static/js/{Toolbar.CA92Moni.js → Toolbar.DoQICZLn.js} +1 -1
- streamlit/static/static/js/{base-input.C-H36mFE.js → base-input.DJLL2PiI.js} +1 -1
- streamlit/static/static/js/{checkbox.B6I7DbdE.js → checkbox.BEZCVkdu.js} +1 -1
- streamlit/static/static/js/{createSuper.DEaMobJa.js → createSuper.Cd0gz3ZP.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.CxvB719M.js → data-grid-overlay-editor.DBCkAuJT.js} +1 -1
- streamlit/static/static/js/{downloader.CDDSxxak.js → downloader.CNEzyeJy.js} +1 -1
- streamlit/static/static/js/{es6.BMYexa9t.js → es6.Dj_qfQ-J.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.D-l9cCws.js → iframeResizer.contentWindow.DWZGbVE9.js} +1 -1
- streamlit/static/static/js/{index.CqALE_Sz.js → index.3629iKJ_.js} +1 -1
- streamlit/static/static/js/{index.1ZtAvXND.js → index.9H0CGffC.js} +1 -1
- streamlit/static/static/js/{index.Bb5Sxtkx.js → index.B5PCerES.js} +1 -1
- streamlit/static/static/js/{index.BQQ5JTaz.js → index.BCYov0Z6.js} +1 -1
- streamlit/static/static/js/{index.CfoE7jon.js → index.BQkb06fM.js} +1 -1
- streamlit/static/static/js/{index.DzH3Qe6P.js → index.BlsArqdU.js} +1 -1
- streamlit/static/static/js/{index.CEUhSvrW.js → index.Bnbuv9NG.js} +1 -1
- streamlit/static/static/js/{index.Ct2v9YN2.js → index.BqR_ah2P.js} +1 -1
- streamlit/static/static/js/{index.aLRZj3JI.js → index.Bwe6rc_e.js} +1 -1
- streamlit/static/static/js/{index.phUFaJLn.js → index.BwewuyvV.js} +1 -1
- streamlit/static/static/js/{index.BoTBd6Jn.js → index.CA4nGH2a.js} +1 -1
- streamlit/static/static/js/{index.Ch30W6NP.js → index.CHmeRQB0.js} +1 -1
- streamlit/static/static/js/{index.Ce906Q5W.js → index.CSEGzY5i.js} +1 -1
- streamlit/static/static/js/{index.CS9yBABI.js → index.CoYP8GwB.js} +1 -1
- streamlit/static/static/js/{index.Ou3kxN43.js → index.Co_D1bGa.js} +1 -1
- streamlit/static/static/js/{index.Dm8vdcs9.js → index.CtsW3eJF.js} +1 -1
- streamlit/static/static/js/{index.BdazK8za.js → index.D4efqxNs.js} +1 -1
- streamlit/static/static/js/{index.CphcnmQO.js → index.DF-6qVO2.js} +1 -1
- streamlit/static/static/js/{index.DNoDZbuV.js → index.DIxNMQxZ.js} +1 -1
- streamlit/static/static/js/{index.D9XZpDDt.js → index.DYQbjkZY.js} +1 -1
- streamlit/static/static/js/{index.Buz-cCdK.js → index.DaegFwX9.js} +1 -1
- streamlit/static/static/js/{index.DHv7KxuP.js → index.DcXKaleC.js} +1 -1
- streamlit/static/static/js/{index.vRRu8CJW.js → index.Dh4PSyeU.js} +1 -1
- streamlit/static/static/js/{index.CZbA_QY0.js → index.Dj_sBWoU.js} +1 -1
- streamlit/static/static/js/{index.C_f3O5DO.js → index.DkYSvvUe.js} +1 -1
- streamlit/static/static/js/{index.DMzpbFDn.js → index.Dxi0xeeC.js} +1 -1
- streamlit/static/static/js/{index.Br2RYgMU.js → index.Dy9mt1lb.js} +1 -1
- streamlit/static/static/js/{index.B-g_Erog.js → index.DyKNikeb.js} +72 -72
- streamlit/static/static/js/{index.C9PLrvrw.js → index.HTy-ykxC.js} +1 -1
- streamlit/static/static/js/{index.DBVPN8iJ.js → index.HcR5RThE.js} +1 -1
- streamlit/static/static/js/{index.EAQB8Tuq.js → index.SCzIN5SB.js} +3 -3
- streamlit/static/static/js/{index.DygxY7Lg.js → index.Uzv6ooYp.js} +2 -2
- streamlit/static/static/js/{index.DYvo87DK.js → index.gupvSUiZ.js} +1 -1
- streamlit/static/static/js/{index.kIS8fJE1.js → index.hExo-vs3.js} +1 -1
- streamlit/static/static/js/{index.DFjvmFUl.js → index.jtH7YSzj.js} +1 -1
- streamlit/static/static/js/{index.DJ6SMXzt.js → index.nKiB2Lb1.js} +1 -1
- streamlit/static/static/js/{index.BjJqANY4.js → index.r5SsG0UH.js} +1 -1
- streamlit/static/static/js/{input.DjnwsrgF.js → input.C4PKmVyq.js} +1 -1
- streamlit/static/static/js/{memory.C-fF2BpE.js → memory.BlWtC9mT.js} +1 -1
- streamlit/static/static/js/{mergeWith.Cjweouij.js → mergeWith.BpStvP-d.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.BFTlQD7x.js → number-overlay-editor.h2wH-G_L.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.Cy1PJuxU.js → possibleConstructorReturn.CU3h0WWI.js} +1 -1
- streamlit/static/static/js/{sandbox.DvSXZ4R-.js → sandbox.BW2Eycz9.js} +1 -1
- streamlit/static/static/js/{timepicker.bPCY7gSF.js → timepicker.ASDBDZeB.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.DaNXH4b3.js → toConsumableArray.Dn5dJvBy.js} +1 -1
- streamlit/static/static/js/{uniqueId.CDZNs_pn.js → uniqueId.8z-ePOzb.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.YAhDGDM8.js → useBasicWidgetState.Bg3DrOCg.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.HiDk3WIa.js → useOnInputChange.SNHZF6F7.js} +1 -1
- streamlit/static/static/js/{useTextInputAutoExpand.CwuIWHHK.js → useTextInputAutoExpand.Dm8V44AL.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.C4lh8vGd.js → withFullScreenWrapper.Drneg2_8.js} +1 -1
- streamlit/user_info.py +5 -1
- {streamlit_nightly-1.46.2.dev20250715.dist-info → streamlit_nightly-1.47.1.dev20250717.dist-info}/METADATA +13 -1
- {streamlit_nightly-1.46.2.dev20250715.dist-info → streamlit_nightly-1.47.1.dev20250717.dist-info}/RECORD +82 -82
- {streamlit_nightly-1.46.2.dev20250715.data → streamlit_nightly-1.47.1.dev20250717.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.46.2.dev20250715.dist-info → streamlit_nightly-1.47.1.dev20250717.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.46.2.dev20250715.dist-info → streamlit_nightly-1.47.1.dev20250717.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.46.2.dev20250715.dist-info → streamlit_nightly-1.47.1.dev20250717.dist-info}/top_level.txt +0 -0
@@ -1,18 +1,18 @@
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.
|
2
|
-
import{r as f,E as Ls,_ as ze,c as uh,g as ar,i as Ua,d as lo,e as ch,f as dh,h as fh,m as Ic,n as Tc,R as Vt,o as hh,p as Dc,q as gh,t as mh,u as ph,v as vh,w as bh,x as wh,a as Sr,y as As,s as vi,z as $r,j as nt,F as Oc,A as pa,T as Pc,B as va,C as Tn,D as nr,G as ba,H as ln,I as _c,J as si,K as yh,L as Ch,M as Le,N as Fc,O as lt,Q as Yi,S as zr,U as qa,V as Sh,W as xh,X as kh,Y as Pl,Z as Mh,$ as Rh,a0 as Eh,a1 as Ih,a2 as Lc,a3 as Th,a4 as Dh,a5 as Cs,a6 as Ac,a7 as Hc,a8 as Oh,a9 as Ph,aa as _h,ab as Fh,ac as Lh,ad as Ah,ae as Hh,af as zh,ag as Vh,ah as zc,ai as Nh,aj as $h,ak as Bh,al as Wh,am as Uh,an as qh,ao as Gh,ap as Yh,aq as jh,ar as Xh,as as Kh,at as Zh,au as Jh,av as Qh,aw as bn,l as Hs,ax as ji,ay as sr,az as Oe,aA as eg,b as Vc,aB as Nc,k as tg,aC as ng,aD as rg,aE as Ga,aF as ig,aG as og,aH as ag,aI as sg,aJ as lg}from"./index.EAQB8Tuq.js";import{u as ug}from"./FormClearHelper.C4W8xjEX.js";import{w as cg,E as dg}from"./withFullScreenWrapper.C4lh8vGd.js";import{T as fg,a as oi}from"./Toolbar.CA92Moni.js";import{L as hg,S as gg,a as mg}from"./checkbox.B6I7DbdE.js";import{m as pg}from"./mergeWith.Cjweouij.js";import{s as vg}from"./sprintf.D7DtBTRn.js";import{c as bg}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as rr,a as zs,C as wg}from"./toConsumableArray.DaNXH4b3.js";import{_ as yg,a as Cg,b as Sg}from"./possibleConstructorReturn.Cy1PJuxU.js";import{_ as xg}from"./createSuper.DEaMobJa.js";import{D as kg,F as Mg}from"./FileDownload.esm.ZEl-HfEg.js";var $c=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ls,ze({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});$c.displayName="Add";var Bc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ls,ze({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});Bc.displayName="Search";var Wc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ls,ze({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M12 6a9.77 9.77 0 018.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0112 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 010 5 2.5 2.5 0 010-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}))});Wc.displayName="Visibility";var Ya,_l;function Rg(){if(_l)return Ya;_l=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return Ya=n,Ya}var ja,Fl;function Eg(){if(Fl)return ja;Fl=1;var e=Rg(),t=uh();function n(r,i){return r!=null&&t(r,i,e)}return ja=n,ja}var Ig=Eg();const Tg=ar(Ig);function Uc(e="This should not happen"){throw new Error(e)}function Dn(e,t="Assertion failed"){if(!e)return Uc(t)}function to(e,t){return Uc(t??"Hell froze over")}function Dg(e,t){try{return e()}catch{return t}}const Ll=Object.prototype.hasOwnProperty;function mi(e,t){let n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&mi(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Ll.call(e,n)&&++r&&!Ll.call(t,n)||!(n in t)||!mi(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const ta=null,Vs=void 0;var J;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(J||(J={}));var Al;(function(e){e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay"})(Al||(Al={}));var na;(function(e){e.Triangle="triangle",e.Dots="dots"})(na||(na={}));function _o(e){return"width"in e&&typeof e.width=="number"}async function Hl(e){return typeof e=="object"?e:await e()}function li(e){return!(e.kind===J.Loading||e.kind===J.Bubble||e.kind===J.RowID||e.kind===J.Protected||e.kind===J.Drilldown)}function di(e){return e.kind===Hn.Marker||e.kind===Hn.NewRow}function ui(e){if(!li(e)||e.kind===J.Image)return!1;switch(e.kind){case J.Text:case J.Number:case J.Markdown:case J.Uri:case J.Custom:case J.Boolean:return e.readonly!==!0;default:to(e,"A cell was passed with an invalid kind")}}function Og(e){return Tg(e,"editor")}function Ns(e){return!(e.readonly??!1)}var Hn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Hn||(Hn={}));function Pg(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,i){return r[0]-i[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const i=n[n.length-1];i[1]<r[0]?n.push([...r]):i[1]<r[1]&&(i[1]=r[1])}return n}let zl;class it{items;constructor(t){this.items=t}static empty=()=>zl??(zl=new it([]));static fromSingleSelection=t=>it.empty().add(t);offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new it(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Pg([...this.items,n]);return new it(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],i=typeof t=="number"?t+1:t[1];for(const[o,s]of n.entries()){const[a,l]=s;if(a<=i&&r<=l){const u=[];a<r&&u.push([a,r]),i<l&&u.push([i,l]),n.splice(o,1,...u)}}return new it(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,i]=this.items[n];if(t>=r&&t<i)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],i=this.items[n];if(r[0]!==i[0]||r[1]!==i[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let i=n;i<r;i++)t.push(i);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}}var _g=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,l]=a.split("_");n[l]=a}else r.push(a)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},Vl=_g,Fg=e=>e.toUpperCase()===e,Lg=e=>t=>e.indexOf(t)===-1,qc=(e,t)=>{const n={};return Object.keys(e).filter(Lg(t)).forEach(r=>{n[r]=e[r]}),n};function Ag(e,t,n){const r=qc(t,n);if(!e){const i=typeof Ua=="function"?{default:Ua}:Ua;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var Hg=(e,t)=>{};function zg(e){let t="";return n=>{const r=(o,s)=>{const{as:a=e,class:l=t}=o,u=n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&!Fg(a[0])):n.propsAsIs,c=Ag(u,o,["as","class"]);c.ref=s,c.className=n.atomic?Vl(n.class,c.className||l):Vl(c.className||l,n.class);const{vars:d}=n;if(d){const g={};for(const p in d){const y=d[p],b=y[0],v=y[1]||"",S=typeof b=="function"?b(o):b;Hg(S,n.name),g[`--${p}`]=`${S}${v}`}const h=c.style||{},m=Object.keys(h);m.length>0&&m.forEach(p=>{g[p]=h[p]}),c.style=g}return e.__wyw_meta&&e!==a?(c.as=a,f.createElement(e,c)):f.createElement(a,c)},i=f.forwardRef?f.forwardRef(r):o=>{const s=qc(o,["innerRef"]);return r(s,o.innerRef)};return i.displayName=n.name,i.__wyw_meta={className:n.class||t,extends:e},i}}var un=zg;const Vg=un("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Xa={},Li={},Fo={},Lo={},Nl;function Ng(){return Nl||(Nl=1,function(e){(function(t,n){n(e,lo(),ch())})(Lo,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var i=s(n),o=s(r);function s(v){return v&&v.__esModule?v:{default:v}}var a=Object.assign||function(v){for(var S=1;S<arguments.length;S++){var O=arguments[S];for(var R in O)Object.prototype.hasOwnProperty.call(O,R)&&(v[R]=O[R])}return v};function l(v,S){var O={};for(var R in v)S.indexOf(R)>=0||Object.prototype.hasOwnProperty.call(v,R)&&(O[R]=v[R]);return O}function u(v,S){if(!(v instanceof S))throw new TypeError("Cannot call a class as a function")}var c=function(){function v(S,O){for(var R=0;R<O.length;R++){var M=O[R];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(S,M.key,M)}}return function(S,O,R){return O&&v(S.prototype,O),R&&v(S,R),S}}();function d(v,S){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:v}function g(v,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);v.prototype=Object.create(S&&S.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(v,S):v.__proto__=S)}var h=!1;function m(v){h=v}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){m(!0)}}))}catch{}function p(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return h?v:v.capture}function y(v){if("touches"in v){var S=v.touches[0],O=S.pageX,R=S.pageY;return{x:O,y:R}}var M=v.screenX,_=v.screenY;return{x:M,y:_}}var b=function(v){g(S,v);function S(){var O;u(this,S);for(var R=arguments.length,M=Array(R),_=0;_<R;_++)M[_]=arguments[_];var E=d(this,(O=S.__proto__||Object.getPrototypeOf(S)).call.apply(O,[this].concat(M)));return E._handleSwipeStart=E._handleSwipeStart.bind(E),E._handleSwipeMove=E._handleSwipeMove.bind(E),E._handleSwipeEnd=E._handleSwipeEnd.bind(E),E._onMouseDown=E._onMouseDown.bind(E),E._onMouseMove=E._onMouseMove.bind(E),E._onMouseUp=E._onMouseUp.bind(E),E._setSwiperRef=E._setSwiperRef.bind(E),E}return c(S,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(R){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(R))}},{key:"_onMouseMove",value:function(R){this.mouseDown&&this._handleSwipeMove(R)}},{key:"_onMouseUp",value:function(R){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(R)}},{key:"_handleSwipeStart",value:function(R){var M=y(R),_=M.x,E=M.y;this.moveStart={x:_,y:E},this.props.onSwipeStart(R)}},{key:"_handleSwipeMove",value:function(R){if(this.moveStart){var M=y(R),_=M.x,E=M.y,k=_-this.moveStart.x,F=E-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x:k,y:F},R);D&&R.cancelable&&R.preventDefault(),this.movePosition={deltaX:k,deltaY:F}}}},{key:"_handleSwipeEnd",value:function(R){this.props.onSwipeEnd(R);var M=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-M?this.props.onSwipeLeft(1,R):this.movePosition.deltaX>M&&this.props.onSwipeRight(1,R),this.movePosition.deltaY<-M?this.props.onSwipeUp(1,R):this.movePosition.deltaY>M&&this.props.onSwipeDown(1,R)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(R){this.swiper=R,this.props.innerRef(R)}},{key:"render",value:function(){var R=this.props;R.tagName;var M=R.className,_=R.style,E=R.children;R.allowMouseEvents,R.onSwipeUp,R.onSwipeDown,R.onSwipeLeft,R.onSwipeRight,R.onSwipeStart,R.onSwipeMove,R.onSwipeEnd,R.innerRef,R.tolerance;var k=l(R,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,a({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:M,style:_},k),E)}}]),S}(n.Component);b.displayName="ReactSwipe",b.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},b.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=b})}(Lo)),Lo}var $l;function Gc(){return $l||($l=1,function(e){(function(t,n){n(e,Ng())})(Fo,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=i(n);function i(o){return o&&o.__esModule?o:{default:o}}t.default=r.default})}(Fo)),Fo}var Ai={},Bl;function Yc(){if(Bl)return Ai;Bl=1,Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=void 0;var e=t(dh());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,s){return o in i?Object.defineProperty(i,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[o]=s,i}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,s){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":s==="horizontal","axis-vertical":s!=="horizontal"})},SLIDER:function(o,s){return(0,e.default)({thumbs:!o,slider:o,animated:!s})},ITEM:function(o,s,a){return(0,e.default)({thumb:!o,slide:o,selected:s,previous:a})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return Ai.default=r,Ai}var Hi={},zi={},Wl;function $g(){if(Wl)return zi;Wl=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return zi.outerWidth=e,zi}var Vi={},Ul;function $s(){if(Ul)return Vi;Ul=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,s=i==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",l="("+s.join(",")+")";return a+l};return Vi.default=e,Vi}var Ni={},ql;function jc(){if(ql)return Ni;ql=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.default=void 0;var e=function(){return window};return Ni.default=e,Ni}var Gl;function Xc(){if(Gl)return Hi;Gl=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.default=void 0;var e=l(lo()),t=s(Yc()),n=$g(),r=s($s()),i=s(Gc()),o=s(jc());function s(E){return E&&E.__esModule?E:{default:E}}function a(){if(typeof WeakMap!="function")return null;var E=new WeakMap;return a=function(){return E},E}function l(E){if(E&&E.__esModule)return E;if(E===null||u(E)!=="object"&&typeof E!="function")return{default:E};var k=a();if(k&&k.has(E))return k.get(E);var F={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in E)if(Object.prototype.hasOwnProperty.call(E,C)){var I=D?Object.getOwnPropertyDescriptor(E,C):null;I&&(I.get||I.set)?Object.defineProperty(F,C,I):F[C]=E[C]}return F.default=E,k&&k.set(E,F),F}function u(E){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(F){return typeof F}:u=function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},u(E)}function c(){return c=Object.assign||function(E){for(var k=1;k<arguments.length;k++){var F=arguments[k];for(var D in F)Object.prototype.hasOwnProperty.call(F,D)&&(E[D]=F[D])}return E},c.apply(this,arguments)}function d(E,k){if(!(E instanceof k))throw new TypeError("Cannot call a class as a function")}function g(E,k){for(var F=0;F<k.length;F++){var D=k[F];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(E,D.key,D)}}function h(E,k,F){return k&&g(E.prototype,k),E}function m(E,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(k&&k.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),k&&p(E,k)}function p(E,k){return p=Object.setPrototypeOf||function(D,C){return D.__proto__=C,D},p(E,k)}function y(E){var k=S();return function(){var D=O(E),C;if(k){var I=O(this).constructor;C=Reflect.construct(D,arguments,I)}else C=D.apply(this,arguments);return b(this,C)}}function b(E,k){return k&&(u(k)==="object"||typeof k=="function")?k:v(E)}function v(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function S(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function O(E){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(F){return F.__proto__||Object.getPrototypeOf(F)},O(E)}function R(E,k,F){return k in E?Object.defineProperty(E,k,{value:F,enumerable:!0,configurable:!0,writable:!0}):E[k]=F,E}var M=function(k){return k.hasOwnProperty("key")},_=function(E){m(F,E);var k=y(F);function F(D){var C;return d(this,F),C=k.call(this,D),R(v(C),"itemsWrapperRef",void 0),R(v(C),"itemsListRef",void 0),R(v(C),"thumbsRef",void 0),R(v(C),"setItemsWrapperRef",function(I){C.itemsWrapperRef=I}),R(v(C),"setItemsListRef",function(I){C.itemsListRef=I}),R(v(C),"setThumbsRef",function(I,T){C.thumbsRef||(C.thumbsRef=[]),C.thumbsRef[T]=I}),R(v(C),"updateSizes",function(){if(!(!C.props.children||!C.itemsWrapperRef||!C.thumbsRef)){var I=e.Children.count(C.props.children),T=C.itemsWrapperRef.clientWidth,x=C.props.thumbWidth?C.props.thumbWidth:(0,n.outerWidth)(C.thumbsRef[0]),$=Math.floor(T/x),G=$<I,X=G?I-$:0;C.setState(function(ie,ee){return{itemSize:x,visibleItems:$,firstItem:G?C.getFirstItem(ee.selectedItem):0,lastPosition:X,showArrows:G}})}}),R(v(C),"handleClickItem",function(I,T,x){if(!M(x)||x.key==="Enter"){var $=C.props.onSelectItem;typeof $=="function"&&$(I,T)}}),R(v(C),"onSwipeStart",function(){C.setState({swiping:!0})}),R(v(C),"onSwipeEnd",function(){C.setState({swiping:!1})}),R(v(C),"onSwipeMove",function(I){var T=I.x;if(!C.state.itemSize||!C.itemsWrapperRef||!C.state.visibleItems)return!1;var x=0,$=e.Children.count(C.props.children),G=-(C.state.firstItem*100)/C.state.visibleItems,X=Math.max($-C.state.visibleItems,0),ie=-X*100/C.state.visibleItems;G===x&&T>0&&(T=0),G===ie&&T<0&&(T=0);var ee=C.itemsWrapperRef.clientWidth,Q=G+100/(ee/T);return C.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(te){C.itemsListRef.style[te]=(0,r.default)(Q,"%",C.props.axis)}),!0}),R(v(C),"slideRight",function(I){C.moveTo(C.state.firstItem-(typeof I=="number"?I:1))}),R(v(C),"slideLeft",function(I){C.moveTo(C.state.firstItem+(typeof I=="number"?I:1))}),R(v(C),"moveTo",function(I){I=I<0?0:I,I=I>=C.state.lastPosition?C.state.lastPosition:I,C.setState({firstItem:I})}),C.state={selectedItem:D.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},C}return h(F,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(C){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==C.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(C){var I=C;return C>=this.state.lastPosition&&(I=this.state.lastPosition),C<this.state.firstItem+this.state.visibleItems&&(I=this.state.firstItem),C<this.state.firstItem&&(I=C),I}},{key:"renderItems",value:function(){var C=this;return this.props.children.map(function(I,T){var x=t.default.ITEM(!1,T===C.state.selectedItem),$={key:T,ref:function(X){return C.setThumbsRef(X,T)},className:x,onClick:C.handleClickItem.bind(C,T,C.props.children[T]),onKeyDown:C.handleClickItem.bind(C,T,C.props.children[T]),"aria-label":"".concat(C.props.labels.item," ").concat(T+1),style:{width:C.props.thumbWidth}};return e.default.createElement("li",c({},$,{role:"button",tabIndex:0}),I)})}},{key:"render",value:function(){var C=this;if(!this.props.children)return null;var I=e.Children.count(this.props.children)>1,T=this.state.showArrows&&this.state.firstItem>0,x=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,$={},G=-this.state.firstItem*(this.state.itemSize||0),X=(0,r.default)(G,"px",this.props.axis),ie=this.props.transitionTime+"ms";return $={WebkitTransform:X,MozTransform:X,MsTransform:X,OTransform:X,transform:X,msTransform:X,WebkitTransitionDuration:ie,MozTransitionDuration:ie,MsTransitionDuration:ie,OTransitionDuration:ie,transitionDuration:ie,msTransitionDuration:ie},e.default.createElement("div",{className:t.default.CAROUSEL(!1)},e.default.createElement("div",{className:t.default.WRAPPER(!1),ref:this.setItemsWrapperRef},e.default.createElement("button",{type:"button",className:t.default.ARROW_PREV(!T),onClick:function(){return C.slideRight()},"aria-label":this.props.labels.leftArrow}),I?e.default.createElement(i.default,{tagName:"ul",className:t.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:$,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(Q){return C.setItemsListRef(Q)},style:$},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!x),onClick:function(){return C.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),F}(e.Component);return Hi.default=_,R(_,"displayName","Thumbs"),R(_,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Hi}var $i={},Yl;function Bg(){if(Yl)return $i;Yl=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.default=void 0;var e=function(){return document};return $i.default=e,$i}var In={},jl;function Kc(){if(jl)return In;jl=1,Object.defineProperty(In,"__esModule",{value:!0}),In.setPosition=In.getPosition=In.isKeyboardEvent=In.defaultStatusFormatter=In.noop=void 0;var e=lo(),t=n($s());function n(l){return l&&l.__esModule?l:{default:l}}var r=function(){};In.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};In.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};In.isKeyboardEvent=o;var s=function(u,c){if(c.infiniteLoop&&++u,u===0)return 0;var d=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var g=-u*c.centerSlidePercentage,h=d-1;return u&&(u!==h||c.infiniteLoop)?g+=(100-c.centerSlidePercentage)/2:u===h&&(g+=100-c.centerSlidePercentage),g}return-u*100};In.getPosition=s;var a=function(u,c){var d={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){d[g]=(0,t.default)(u,"%",c)}),d};return In.setPosition=a,In}var $n={},Xl;function Wg(){if(Xl)return $n;Xl=1,Object.defineProperty($n,"__esModule",{value:!0}),$n.fadeAnimationHandler=$n.slideStopSwipingHandler=$n.slideSwipeAnimationHandler=$n.slideAnimationHandler=void 0;var e=lo(),t=r($s()),n=Kc();function r(d){return d&&d.__esModule?d:{default:d}}function i(d,g){var h=Object.keys(d);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(d);g&&(m=m.filter(function(p){return Object.getOwnPropertyDescriptor(d,p).enumerable})),h.push.apply(h,m)}return h}function o(d){for(var g=1;g<arguments.length;g++){var h=arguments[g]!=null?arguments[g]:{};g%2?i(Object(h),!0).forEach(function(m){s(d,m,h[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(m){Object.defineProperty(d,m,Object.getOwnPropertyDescriptor(h,m))})}return d}function s(d,g,h){return g in d?Object.defineProperty(d,g,{value:h,enumerable:!0,configurable:!0,writable:!0}):d[g]=h,d}var a=function(g,h){var m={},p=h.selectedItem,y=p,b=e.Children.count(g.children)-1,v=g.infiniteLoop&&(p<0||p>b);if(v)return y<0?g.centerMode&&g.centerSlidePercentage&&g.axis==="horizontal"?m.itemListStyle=(0,n.setPosition)(-(b+2)*g.centerSlidePercentage-(100-g.centerSlidePercentage)/2,g.axis):m.itemListStyle=(0,n.setPosition)(-(b+2)*100,g.axis):y>b&&(m.itemListStyle=(0,n.setPosition)(0,g.axis)),m;var S=(0,n.getPosition)(p,g),O=(0,t.default)(S,"%",g.axis),R=g.transitionTime+"ms";return m.itemListStyle={WebkitTransform:O,msTransform:O,OTransform:O,transform:O},h.swiping||(m.itemListStyle=o(o({},m.itemListStyle),{},{WebkitTransitionDuration:R,MozTransitionDuration:R,OTransitionDuration:R,transitionDuration:R,msTransitionDuration:R})),m};$n.slideAnimationHandler=a;var l=function(g,h,m,p){var y={},b=h.axis==="horizontal",v=e.Children.count(h.children),S=0,O=(0,n.getPosition)(m.selectedItem,h),R=h.infiniteLoop?(0,n.getPosition)(v-1,h)-100:(0,n.getPosition)(v-1,h),M=b?g.x:g.y,_=M;O===S&&M>0&&(_=0),O===R&&M<0&&(_=0);var E=O+100/(m.itemSize/_),k=Math.abs(M)>h.swipeScrollTolerance;return h.infiniteLoop&&k&&(m.selectedItem===0&&E>-100?E-=v*100:m.selectedItem===v-1&&E<-v*100&&(E+=v*100)),(!h.preventMovementUntilSwipeScrollTolerance||k||m.swipeMovementStarted)&&(m.swipeMovementStarted||p({swipeMovementStarted:!0}),y.itemListStyle=(0,n.setPosition)(E,h.axis)),k&&!m.cancelClick&&p({cancelClick:!0}),y};$n.slideSwipeAnimationHandler=l;var u=function(g,h){var m=(0,n.getPosition)(h.selectedItem,g),p=(0,n.setPosition)(m,g.axis);return{itemListStyle:p}};$n.slideStopSwipingHandler=u;var c=function(g,h){var m=g.transitionTime+"ms",p="ease-in-out",y={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:p,msTransitionTimingFunction:p,MozTransitionTimingFunction:p,WebkitTransitionTimingFunction:p,OTransitionTimingFunction:p};return h.swiping||(y=o(o({},y),{},{WebkitTransitionDuration:m,MozTransitionDuration:m,OTransitionDuration:m,transitionDuration:m,msTransitionDuration:m})),{slideStyle:y,selectedStyle:o(o({},y),{},{opacity:1,position:"relative"}),prevStyle:o({},y)}};return $n.fadeAnimationHandler=c,$n}var Kl;function Ug(){if(Kl)return Li;Kl=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.default=void 0;var e=c(lo()),t=l(Gc()),n=l(Yc()),r=l(Xc()),i=l(Bg()),o=l(jc()),s=Kc(),a=Wg();function l(D){return D&&D.__esModule?D:{default:D}}function u(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return u=function(){return D},D}function c(D){if(D&&D.__esModule)return D;if(D===null||d(D)!=="object"&&typeof D!="function")return{default:D};var C=u();if(C&&C.has(D))return C.get(D);var I={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in D)if(Object.prototype.hasOwnProperty.call(D,x)){var $=T?Object.getOwnPropertyDescriptor(D,x):null;$&&($.get||$.set)?Object.defineProperty(I,x,$):I[x]=D[x]}return I.default=D,C&&C.set(D,I),I}function d(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(I){return typeof I}:d=function(I){return I&&typeof Symbol=="function"&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},d(D)}function g(){return g=Object.assign||function(D){for(var C=1;C<arguments.length;C++){var I=arguments[C];for(var T in I)Object.prototype.hasOwnProperty.call(I,T)&&(D[T]=I[T])}return D},g.apply(this,arguments)}function h(D,C){var I=Object.keys(D);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(D);C&&(T=T.filter(function(x){return Object.getOwnPropertyDescriptor(D,x).enumerable})),I.push.apply(I,T)}return I}function m(D){for(var C=1;C<arguments.length;C++){var I=arguments[C]!=null?arguments[C]:{};C%2?h(Object(I),!0).forEach(function(T){k(D,T,I[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(I)):h(Object(I)).forEach(function(T){Object.defineProperty(D,T,Object.getOwnPropertyDescriptor(I,T))})}return D}function p(D,C){if(!(D instanceof C))throw new TypeError("Cannot call a class as a function")}function y(D,C){for(var I=0;I<C.length;I++){var T=C[I];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(D,T.key,T)}}function b(D,C,I){return C&&y(D.prototype,C),D}function v(D,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(C&&C.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),C&&S(D,C)}function S(D,C){return S=Object.setPrototypeOf||function(T,x){return T.__proto__=x,T},S(D,C)}function O(D){var C=_();return function(){var T=E(D),x;if(C){var $=E(this).constructor;x=Reflect.construct(T,arguments,$)}else x=T.apply(this,arguments);return R(this,x)}}function R(D,C){return C&&(d(C)==="object"||typeof C=="function")?C:M(D)}function M(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function _(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function E(D){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(I){return I.__proto__||Object.getPrototypeOf(I)},E(D)}function k(D,C,I){return C in D?Object.defineProperty(D,C,{value:I,enumerable:!0,configurable:!0,writable:!0}):D[C]=I,D}var F=function(D){v(I,D);var C=O(I);function I(T){var x;p(this,I),x=C.call(this,T),k(M(x),"thumbsRef",void 0),k(M(x),"carouselWrapperRef",void 0),k(M(x),"listRef",void 0),k(M(x),"itemsRef",void 0),k(M(x),"timer",void 0),k(M(x),"animationHandler",void 0),k(M(x),"setThumbsRef",function(G){x.thumbsRef=G}),k(M(x),"setCarouselWrapperRef",function(G){x.carouselWrapperRef=G}),k(M(x),"setListRef",function(G){x.listRef=G}),k(M(x),"setItemsRef",function(G,X){x.itemsRef||(x.itemsRef=[]),x.itemsRef[X]=G}),k(M(x),"autoPlay",function(){e.Children.count(x.props.children)<=1||(x.clearAutoPlay(),x.props.autoPlay&&(x.timer=setTimeout(function(){x.increment()},x.props.interval)))}),k(M(x),"clearAutoPlay",function(){x.timer&&clearTimeout(x.timer)}),k(M(x),"resetAutoPlay",function(){x.clearAutoPlay(),x.autoPlay()}),k(M(x),"stopOnHover",function(){x.setState({isMouseEntered:!0},x.clearAutoPlay)}),k(M(x),"startOnLeave",function(){x.setState({isMouseEntered:!1},x.autoPlay)}),k(M(x),"isFocusWithinTheCarousel",function(){return x.carouselWrapperRef?!!((0,i.default)().activeElement===x.carouselWrapperRef||x.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),k(M(x),"navigateWithKeyboard",function(G){if(x.isFocusWithinTheCarousel()){var X=x.props.axis,ie=X==="horizontal",ee={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},Q=ie?ee.ArrowRight:ee.ArrowDown,te=ie?ee.ArrowLeft:ee.ArrowUp;Q===G.keyCode?x.increment():te===G.keyCode&&x.decrement()}}),k(M(x),"updateSizes",function(){if(!(!x.state.initialized||!x.itemsRef||x.itemsRef.length===0)){var G=x.props.axis==="horizontal",X=x.itemsRef[0];if(X){var ie=G?X.clientWidth:X.clientHeight;x.setState({itemSize:ie}),x.thumbsRef&&x.thumbsRef.updateSizes()}}}),k(M(x),"setMountState",function(){x.setState({hasMount:!0}),x.updateSizes()}),k(M(x),"handleClickItem",function(G,X){if(e.Children.count(x.props.children)!==0){if(x.state.cancelClick){x.setState({cancelClick:!1});return}x.props.onClickItem(G,X),G!==x.state.selectedItem&&x.setState({selectedItem:G})}}),k(M(x),"handleOnChange",function(G,X){e.Children.count(x.props.children)<=1||x.props.onChange(G,X)}),k(M(x),"handleClickThumb",function(G,X){x.props.onClickThumb(G,X),x.moveTo(G)}),k(M(x),"onSwipeStart",function(G){x.setState({swiping:!0}),x.props.onSwipeStart(G)}),k(M(x),"onSwipeEnd",function(G){x.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),x.props.onSwipeEnd(G),x.clearAutoPlay(),x.state.autoPlay&&x.autoPlay()}),k(M(x),"onSwipeMove",function(G,X){x.props.onSwipeMove(X);var ie=x.props.swipeAnimationHandler(G,x.props,x.state,x.setState.bind(M(x)));return x.setState(m({},ie)),!!Object.keys(ie).length}),k(M(x),"decrement",function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;x.moveTo(x.state.selectedItem-(typeof G=="number"?G:1))}),k(M(x),"increment",function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;x.moveTo(x.state.selectedItem+(typeof G=="number"?G:1))}),k(M(x),"moveTo",function(G){if(typeof G=="number"){var X=e.Children.count(x.props.children)-1;G<0&&(G=x.props.infiniteLoop?X:0),G>X&&(G=x.props.infiniteLoop?0:X),x.selectItem({selectedItem:G}),x.state.autoPlay&&x.state.isMouseEntered===!1&&x.resetAutoPlay()}}),k(M(x),"onClickNext",function(){x.increment(1)}),k(M(x),"onClickPrev",function(){x.decrement(1)}),k(M(x),"onSwipeForward",function(){x.increment(1),x.props.emulateTouch&&x.setState({cancelClick:!0})}),k(M(x),"onSwipeBackwards",function(){x.decrement(1),x.props.emulateTouch&&x.setState({cancelClick:!0})}),k(M(x),"changeItem",function(G){return function(X){(!(0,s.isKeyboardEvent)(X)||X.key==="Enter")&&x.moveTo(G)}}),k(M(x),"selectItem",function(G){x.setState(m({previousItem:x.state.selectedItem},G),function(){x.setState(x.animationHandler(x.props,x.state))}),x.handleOnChange(G.selectedItem,e.Children.toArray(x.props.children)[G.selectedItem])}),k(M(x),"getInitialImage",function(){var G=x.props.selectedItem,X=x.itemsRef&&x.itemsRef[G],ie=X&&X.getElementsByTagName("img")||[];return ie[0]}),k(M(x),"getVariableItemHeight",function(G){var X=x.itemsRef&&x.itemsRef[G];if(x.state.hasMount&&X&&X.children.length){var ie=X.children[0].getElementsByTagName("img")||[];if(ie.length>0){var ee=ie[0];if(!ee.complete){var Q=function ue(){x.forceUpdate(),ee.removeEventListener("load",ue)};ee.addEventListener("load",Q)}}var te=ie[0]||X.children[0],se=te.clientHeight;return se>0?se:null}return null});var $={initialized:!1,previousItem:T.selectedItem,selectedItem:T.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:T.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return x.animationHandler=typeof T.animationHandler=="function"&&T.animationHandler||T.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,x.state=m(m({},$),x.animationHandler(T,$)),x}return b(I,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(x,$){!x.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!x.autoFocus&&this.props.autoFocus&&this.forceFocus(),$.swiping&&!this.state.swiping&&this.setState(m({},this.props.stopSwipingHandler(this.props,this.state))),(x.selectedItem!==this.props.selectedItem||x.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),x.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var x=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var $=x.getInitialImage();$&&!$.complete?$.addEventListener("load",x.setMountState):x.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var x=this.carouselWrapperRef;this.props.stopOnHover&&x&&(x.addEventListener("mouseenter",this.stopOnHover),x.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var x=this.carouselWrapperRef;this.props.stopOnHover&&x&&(x.removeEventListener("mouseenter",this.stopOnHover),x.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,i.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var x=this.getInitialImage();x&&x.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var x;(x=this.carouselWrapperRef)===null||x===void 0||x.focus()}},{key:"renderItems",value:function(x){var $=this;return this.props.children?e.Children.map(this.props.children,function(G,X){var ie=X===$.state.selectedItem,ee=X===$.state.previousItem,Q=ie&&$.state.selectedStyle||ee&&$.state.prevStyle||$.state.slideStyle||{};$.props.centerMode&&$.props.axis==="horizontal"&&(Q=m(m({},Q),{},{minWidth:$.props.centerSlidePercentage+"%"})),$.state.swiping&&$.state.swipeMovementStarted&&(Q=m(m({},Q),{},{pointerEvents:"none"}));var te={ref:function(ue){return $.setItemsRef(ue,X)},key:"itemKey"+X+(x?"clone":""),className:n.default.ITEM(!0,X===$.state.selectedItem,X===$.state.previousItem),onClick:$.handleClickItem.bind($,X,G),style:Q};return e.default.createElement("li",te,$.props.renderItem(G,{isSelected:X===$.state.selectedItem,isPrevious:X===$.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var x=this,$=this.props,G=$.showIndicators,X=$.labels,ie=$.renderIndicator,ee=$.children;return G?e.default.createElement("ul",{className:"control-dots"},e.Children.map(ee,function(Q,te){return ie&&ie(x.changeItem(te),te===x.state.selectedItem,te,X.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||e.Children.count(this.props.children)===0?null:e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var x=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var $=this.props.swipeable&&e.Children.count(this.props.children)>1,G=this.props.axis==="horizontal",X=this.props.showArrows&&e.Children.count(this.props.children)>1,ie=X&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ee=X&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,Q=this.renderItems(!0),te=Q.shift(),se=Q.pop(),ue={className:n.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},fe={};if(G){if(ue.onSwipeLeft=this.onSwipeForward,ue.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var re=this.getVariableItemHeight(this.state.selectedItem);fe.height=re||"auto"}}else ue.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,ue.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,ue.style=m(m({},ue.style),{},{height:this.state.itemSize}),fe.height=this.state.itemSize;return e.default.createElement("div",{"aria-label":this.props.ariaLabel,className:n.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},e.default.createElement("div",{className:n.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,ie,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:fe},$?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},ue,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&se,this.renderItems(),this.props.infiniteLoop&&te):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(P){return x.setListRef(P)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&se,this.renderItems(),this.props.infiniteLoop&&te)),this.props.renderArrowNext(this.onClickNext,ee,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),I}(e.default.Component);return Li.default=F,k(F,"displayName","Carousel"),k(F,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:s.noop,onClickThumb:s.noop,onChange:s.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(C,I,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_PREV(!I),onClick:C})},renderArrowNext:function(C,I,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_NEXT(!I),onClick:C})},renderIndicator:function(C,I,T,x){return e.default.createElement("li",{className:n.default.DOT(I),onClick:C,onKeyDown:C,value:T,key:T,role:"button",tabIndex:0,"aria-label":"".concat(x," ").concat(T+1)})},renderItem:function(C){return C},renderThumbs:function(C){var I=e.Children.map(C,function(T){var x=T;if(T.type!=="img"&&(x=e.Children.toArray(T.props.children).find(function($){return $.type==="img"})),!!x)return x});return I.filter(function(T){return T}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):I},statusFormatter:s.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:a.slideSwipeAnimationHandler,stopSwipingHandler:a.slideStopSwipingHandler}),Li}var Zl={},Jl;function qg(){return Jl||(Jl=1),Zl}var Ql;function Gg(){return Ql||(Ql=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=i(Ug()),n=qg(),r=i(Xc());function i(o){return o&&o.__esModule?o:{default:o}}}(Xa)),Xa}var Yg=Gg(),Ka,eu;function jg(){if(eu)return Ka;eu=1;var e=fh(),t=function(){return e.Date.now()};return Ka=t,Ka}var Za,tu;function Zc(){if(tu)return Za;tu=1;var e=Ic(),t=jg(),n=Tc(),r="Expected a function",i=Math.max,o=Math.min;function s(a,l,u){var c,d,g,h,m,p,y=0,b=!1,v=!1,S=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,e(u)&&(b=!!u.leading,v="maxWait"in u,g=v?i(n(u.maxWait)||0,l):g,S="trailing"in u?!!u.trailing:S);function O(I){var T=c,x=d;return c=d=void 0,y=I,h=a.apply(x,T),h}function R(I){return y=I,m=setTimeout(E,l),b?O(I):h}function M(I){var T=I-p,x=I-y,$=l-T;return v?o($,g-x):$}function _(I){var T=I-p,x=I-y;return p===void 0||T>=l||T<0||v&&x>=g}function E(){var I=t();if(_(I))return k(I);m=setTimeout(E,M(I))}function k(I){return m=void 0,S&&c?O(I):(c=d=void 0,h)}function F(){m!==void 0&&clearTimeout(m),y=0,c=p=d=m=void 0}function D(){return m===void 0?h:k(t())}function C(){var I=t(),T=_(I);if(c=arguments,d=this,p=I,T){if(m===void 0)return R(p);if(v)return clearTimeout(m),m=setTimeout(E,l),O(p)}return m===void 0&&(m=setTimeout(E,l)),h}return C.cancel=F,C.flush=D,C}return Za=s,Za}var Xg=Zc();const Jc=ar(Xg);function vn(e,t,n,r,i=!1){const o=f.useRef();o.current=t,f.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const s=n,a=l=>{o.current?.call(s,l)};return s.addEventListener(e,a,{passive:r,capture:i}),()=>{s.removeEventListener(e,a,{capture:i})}},[e,n,r,i])}function wr(e,t){return e===void 0?void 0:t}const Kg=Math.PI;function nu(e){return e*Kg/180}const Qc=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),ed=(e,t,n,r,i)=>{switch(e){case"left":return Math.floor(t)+r+i/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-i/2}},td=(e,t,n)=>Math.min(e,t-n*2),nd=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Bs=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),f.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},Zg=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function Jg(e,t,n){const[r,i]=f.useState(e),o=f.useRef(!0);f.useEffect(()=>()=>{o.current=!1},[]);const s=f.useRef(Jc(a=>{o.current&&i(a)},n));return f.useLayoutEffect(()=>{o.current&&s.current(()=>e())},t),r}const Qg="֑-߿יִ-﷽ﹰ-ﻼ",em="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",tm=new RegExp("^[^"+em+"]*["+Qg+"]");function Ws(e){return tm.test(e)?"rtl":"not-rtl"}let Ao;function Ss(){if(typeof document>"u")return 0;if(Ao!==void 0)return Ao;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),Ao=n-r,Ao}const Ar=Symbol();function nm(e){const t=f.useRef([Ar,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=f.useState(e),[,i]=f.useState(),o=f.useCallback(a=>{const l=t.current[0];l!==Ar&&(a=typeof a=="function"?a(l):a,a===l)||(l!==Ar&&i({}),r(u=>typeof a=="function"?a(l===Ar?u:l):a),t.current[0]=Ar)},[]),s=f.useCallback(()=>{t.current[0]=Ar,i({})},[]);return[t.current[0]===Ar?n:t.current[0],o,s]}function rd(e){if(e.length===0)return"";let t=0,n=0;for(const r of e){if(n+=r.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}function rm(e){const t=f.useRef(e);return mi(e,t.current)||(t.current=e),t.current}const im=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(a=>a!=="");if(o.length===0)return null;const s=o.length>1;return f.createElement(Vg,{"data-testid":"GDG-default-image-overlay-editor"},f.createElement(Yg.Carousel,{showArrows:s,showThumbs:!1,swipeable:s,emulateTouch:s,infiniteLoop:s},o.map(a=>{const l=i?.(a)??f.createElement("img",{draggable:!1,src:a});return f.createElement("div",{className:"gdg-centering-container",key:a},l)})),n&&r&&f.createElement("button",{className:"gdg-edit-icon",onClick:r},f.createElement(Bs,null)))};function id(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Br=id();function om(e){Br=e}const od=/[&<>"']/,am=new RegExp(od.source,"g"),ad=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,sm=new RegExp(ad.source,"g"),lm={"&":"&","<":"<",">":">",'"':""","'":"'"},ru=e=>lm[e];function gn(e,t){if(t){if(od.test(e))return e.replace(am,ru)}else if(ad.test(e))return e.replace(sm,ru);return e}const um=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function sd(e){return e.replace(um,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const cm=/(^|[^\[])\^/g;function At(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(cm,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const dm=/[^\w:]/g,fm=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function iu(e,t,n){if(e){let r;try{r=decodeURIComponent(sd(n)).replace(dm,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!fm.test(n)&&(n=pm(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Ho={},hm=/^[^:]+:\/*[^/]*$/,gm=/^([^:]+:)[\s\S]*$/,mm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function pm(e,t){Ho[" "+e]||(hm.test(e)?Ho[" "+e]=e+"/":Ho[" "+e]=Ko(e,"/",!0)),e=Ho[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(gm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(mm,"$1")+t:e+t}const ra={exec:function(){}};function ou(e,t){const n=e.replace(/\|/g,(o,s,a)=>{let l=!1,u=s;for(;--u>=0&&a[u]==="\\";)l=!l;return l?"|":" |"}),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function Ko(e,t,n){const r=e.length;if(r===0)return"";let i=0;for(;i<r;){const o=e.charAt(r-i-1);if(o===t&&!n)i++;else if(o!==t&&n)i++;else break}return e.slice(0,r-i)}function vm(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let r=0,i=0;for(;i<n;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return-1}function bm(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function au(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function su(e,t,n,r){const i=t.href,o=t.title?gn(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:i,title:o,text:gn(s)}}function wm(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.DBCkAuJT.js","./index.SCzIN5SB.js","../css/index.CJVRHjQZ.css","./FormClearHelper.BapTKtHM.js","./withFullScreenWrapper.Drneg2_8.js","./Toolbar.DoQICZLn.js","./checkbox.BEZCVkdu.js","./mergeWith.BpStvP-d.js","./sprintf.D7DtBTRn.js","./createDownloadLinkElement.DZMwyjvU.js","./toConsumableArray.Dn5dJvBy.js","./possibleConstructorReturn.CU3h0WWI.js","./createSuper.Cd0gz3ZP.js","./FileDownload.esm.qBSGbtBF.js","./number-overlay-editor.h2wH-G_L.js","./es6.Dj_qfQ-J.js"])))=>i.map(i=>d[i]);
|
2
|
+
import{r as f,E as As,_ as ze,c as fh,g as sr,i as qa,d as lo,e as hh,f as gh,h as mh,m as Tc,n as Dc,R as Vt,o as ph,p as Oc,q as vh,t as bh,u as wh,v as yh,w as Ch,x as Sh,a as xr,y as Hs,s as Un,z as Br,j as qe,F as Pc,A as pa,T as _c,B as va,C as vn,D as Bn,G as ba,l as wa,H as ln,I as Fc,J as li,K as xh,L as kh,M as Le,N as Lc,O as lt,Q as Xi,S as Vr,U as Ga,V as Mh,W as Rh,X as Ih,Y as Pl,Z as Eh,$ as Th,a0 as Dh,a1 as Oh,a2 as Ac,a3 as Ph,a4 as _h,a5 as Ss,a6 as Hc,a7 as zc,a8 as Fh,a9 as Lh,aa as Ah,ab as Hh,ac as zh,ad as Vh,ae as $h,af as Nh,ag as Bh,ah as Vc,ai as Wh,aj as Uh,ak as qh,al as Gh,am as Xh,an as Yh,ao as jh,ap as Kh,aq as Zh,ar as Jh,as as Qh,at as eg,au as tg,av as ng,aw as wn,ax as Yi,ay as lr,az as Oe,aA as rg,b as $c,aB as Nc,k as ig,aC as og,aD as ag,aE as Xa,aF as sg,aG as lg,aH as ug,aI as cg,aJ as dg}from"./index.SCzIN5SB.js";import{u as fg}from"./FormClearHelper.BapTKtHM.js";import{w as hg,E as gg}from"./withFullScreenWrapper.Drneg2_8.js";import{T as mg,a as ai}from"./Toolbar.DoQICZLn.js";import{L as pg,S as vg,a as bg}from"./checkbox.BEZCVkdu.js";import{m as wg}from"./mergeWith.BpStvP-d.js";import{s as yg}from"./sprintf.D7DtBTRn.js";import{c as Cg}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as ir,a as zs,C as Sg}from"./toConsumableArray.Dn5dJvBy.js";import{_ as xg,a as kg,b as Mg}from"./possibleConstructorReturn.CU3h0WWI.js";import{_ as Rg}from"./createSuper.Cd0gz3ZP.js";import{D as Ig,F as Eg}from"./FileDownload.esm.qBSGbtBF.js";var Bc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(As,ze({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Bc.displayName="Add";var Wc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(As,ze({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});Wc.displayName="Search";var Uc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(As,ze({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M12 6a9.77 9.77 0 018.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0112 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 010 5 2.5 2.5 0 010-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}))});Uc.displayName="Visibility";var Ya,_l;function Tg(){if(_l)return Ya;_l=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return Ya=n,Ya}var ja,Fl;function Dg(){if(Fl)return ja;Fl=1;var e=Tg(),t=fh();function n(r,i){return r!=null&&t(r,i,e)}return ja=n,ja}var Og=Dg();const Pg=sr(Og);function qc(e="This should not happen"){throw new Error(e)}function Dn(e,t="Assertion failed"){if(!e)return qc(t)}function to(e,t){return qc(t??"Hell froze over")}function _g(e,t){try{return e()}catch{return t}}const Ll=Object.prototype.hasOwnProperty;function pi(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--&&pi(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)||!pi(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const ta=null,Vs=void 0;var J;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(J||(J={}));var Al;(function(e){e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay"})(Al||(Al={}));var na;(function(e){e.Triangle="triangle",e.Dots="dots"})(na||(na={}));function _o(e){return"width"in e&&typeof e.width=="number"}async function Hl(e){return typeof e=="object"?e:await e()}function ui(e){return!(e.kind===J.Loading||e.kind===J.Bubble||e.kind===J.RowID||e.kind===J.Protected||e.kind===J.Drilldown)}function fi(e){return e.kind===Hn.Marker||e.kind===Hn.NewRow}function ci(e){if(!ui(e)||e.kind===J.Image)return!1;switch(e.kind){case J.Text:case J.Number:case J.Markdown:case J.Uri:case J.Custom:case J.Boolean:return e.readonly!==!0;default:to(e,"A cell was passed with an invalid kind")}}function Fg(e){return Pg(e,"editor")}function $s(e){return!(e.readonly??!1)}var Hn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Hn||(Hn={}));function Lg(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,i){return r[0]-i[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const i=n[n.length-1];i[1]<r[0]?n.push([...r]):i[1]<r[1]&&(i[1]=r[1])}return n}let zl;class it{items;constructor(t){this.items=t}static empty=()=>zl??(zl=new it([]));static fromSingleSelection=t=>it.empty().add(t);offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new it(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Lg([...this.items,n]);return new it(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],i=typeof t=="number"?t+1:t[1];for(const[o,s]of n.entries()){const[a,l]=s;if(a<=i&&r<=l){const u=[];a<r&&u.push([a,r]),i<l&&u.push([i,l]),n.splice(o,1,...u)}}return new it(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,i]=this.items[n];if(t>=r&&t<i)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],i=this.items[n];if(r[0]!==i[0]||r[1]!==i[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let i=n;i<r;i++)t.push(i);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}}var Ag=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=Ag,Hg=e=>e.toUpperCase()===e,zg=e=>t=>e.indexOf(t)===-1,Gc=(e,t)=>{const n={};return Object.keys(e).filter(zg(t)).forEach(r=>{n[r]=e[r]}),n};function Vg(e,t,n){const r=Gc(t,n);if(!e){const i=typeof qa=="function"?{default:qa}:qa;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var $g=(e,t)=>{};function Ng(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&&!Hg(a[0])):n.propsAsIs,c=Vg(u,o,["as","class"]);c.ref=s,c.className=n.atomic?Vl(n.class,c.className||l):Vl(c.className||l,n.class);const{vars:d}=n;if(d){const g={};for(const p in d){const y=d[p],b=y[0],v=y[1]||"",S=typeof b=="function"?b(o):b;$g(S,n.name),g[`--${p}`]=`${S}${v}`}const h=c.style||{},m=Object.keys(h);m.length>0&&m.forEach(p=>{g[p]=h[p]}),c.style=g}return e.__wyw_meta&&e!==a?(c.as=a,f.createElement(e,c)):f.createElement(a,c)},i=f.forwardRef?f.forwardRef(r):o=>{const s=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=Ng;const Bg=un("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Ka={},Li={},Fo={},Lo={},$l;function Wg(){return $l||($l=1,function(e){(function(t,n){n(e,lo(),hh())})(Lo,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var i=s(n),o=s(r);function s(v){return v&&v.__esModule?v:{default:v}}var a=Object.assign||function(v){for(var S=1;S<arguments.length;S++){var O=arguments[S];for(var M in O)Object.prototype.hasOwnProperty.call(O,M)&&(v[M]=O[M])}return v};function l(v,S){var O={};for(var M in v)S.indexOf(M)>=0||Object.prototype.hasOwnProperty.call(v,M)&&(O[M]=v[M]);return O}function u(v,S){if(!(v instanceof S))throw new TypeError("Cannot call a class as a function")}var c=function(){function v(S,O){for(var M=0;M<O.length;M++){var R=O[M];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(S,R.key,R)}}return function(S,O,M){return O&&v(S.prototype,O),M&&v(S,M),S}}();function d(v,S){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:v}function g(v,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);v.prototype=Object.create(S&&S.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(v,S):v.__proto__=S)}var h=!1;function m(v){h=v}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){m(!0)}}))}catch{}function p(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return h?v:v.capture}function y(v){if("touches"in v){var S=v.touches[0],O=S.pageX,M=S.pageY;return{x:O,y:M}}var R=v.screenX,_=v.screenY;return{x:R,y:_}}var b=function(v){g(S,v);function S(){var O;u(this,S);for(var M=arguments.length,R=Array(M),_=0;_<M;_++)R[_]=arguments[_];var I=d(this,(O=S.__proto__||Object.getPrototypeOf(S)).call.apply(O,[this].concat(R)));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(S,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(M){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(M))}},{key:"_onMouseMove",value:function(M){this.mouseDown&&this._handleSwipeMove(M)}},{key:"_onMouseUp",value:function(M){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(M)}},{key:"_handleSwipeStart",value:function(M){var R=y(M),_=R.x,I=R.y;this.moveStart={x:_,y:I},this.props.onSwipeStart(M)}},{key:"_handleSwipeMove",value:function(M){if(this.moveStart){var R=y(M),_=R.x,I=R.y,k=_-this.moveStart.x,F=I-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x:k,y:F},M);D&&M.cancelable&&M.preventDefault(),this.movePosition={deltaX:k,deltaY:F}}}},{key:"_handleSwipeEnd",value:function(M){this.props.onSwipeEnd(M);var R=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-R?this.props.onSwipeLeft(1,M):this.movePosition.deltaX>R&&this.props.onSwipeRight(1,M),this.movePosition.deltaY<-R?this.props.onSwipeUp(1,M):this.movePosition.deltaY>R&&this.props.onSwipeDown(1,M)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(M){this.swiper=M,this.props.innerRef(M)}},{key:"render",value:function(){var M=this.props;M.tagName;var R=M.className,_=M.style,I=M.children;M.allowMouseEvents,M.onSwipeUp,M.onSwipeDown,M.onSwipeLeft,M.onSwipeRight,M.onSwipeStart,M.onSwipeMove,M.onSwipeEnd,M.innerRef,M.tolerance;var k=l(M,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,a({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:R,style:_},k),I)}}]),S}(n.Component);b.displayName="ReactSwipe",b.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},b.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=b})}(Lo)),Lo}var Nl;function Xc(){return Nl||(Nl=1,function(e){(function(t,n){n(e,Wg())})(Fo,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=i(n);function i(o){return o&&o.__esModule?o:{default:o}}t.default=r.default})}(Fo)),Fo}var Ai={},Bl;function Yc(){if(Bl)return Ai;Bl=1,Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=void 0;var e=t(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 Ai.default=r,Ai}var Hi={},zi={},Wl;function Ug(){if(Wl)return zi;Wl=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return zi.outerWidth=e,zi}var Vi={},Ul;function Ns(){if(Ul)return Vi;Ul=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,s=i==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",l="("+s.join(",")+")";return a+l};return Vi.default=e,Vi}var $i={},ql;function jc(){if(ql)return $i;ql=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.default=void 0;var e=function(){return window};return $i.default=e,$i}var Gl;function Kc(){if(Gl)return Hi;Gl=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.default=void 0;var e=l(lo()),t=s(Yc()),n=Ug(),r=s(Ns()),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 F={},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(F,C,E):F[C]=I[C]}return F.default=I,k&&k.set(I,F),F}function u(I){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(F){return typeof F}:u=function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},u(I)}function c(){return c=Object.assign||function(I){for(var k=1;k<arguments.length;k++){var F=arguments[k];for(var D in F)Object.prototype.hasOwnProperty.call(F,D)&&(I[D]=F[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 F=0;F<k.length;F++){var D=k[F];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(I,D.key,D)}}function h(I,k,F){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 y(I){var k=S();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 b(this,C)}}function b(I,k){return k&&(u(k)==="object"||typeof k=="function")?k:v(I)}function v(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}function S(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function O(I){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(F){return F.__proto__||Object.getPrototypeOf(F)},O(I)}function M(I,k,F){return k in I?Object.defineProperty(I,k,{value:F,enumerable:!0,configurable:!0,writable:!0}):I[k]=F,I}var R=function(k){return k.hasOwnProperty("key")},_=function(I){m(F,I);var k=y(F);function F(D){var C;return d(this,F),C=k.call(this,D),M(v(C),"itemsWrapperRef",void 0),M(v(C),"itemsListRef",void 0),M(v(C),"thumbsRef",void 0),M(v(C),"setItemsWrapperRef",function(E){C.itemsWrapperRef=E}),M(v(C),"setItemsListRef",function(E){C.itemsListRef=E}),M(v(C),"setThumbsRef",function(E,T){C.thumbsRef||(C.thumbsRef=[]),C.thumbsRef[T]=E}),M(v(C),"updateSizes",function(){if(!(!C.props.children||!C.itemsWrapperRef||!C.thumbsRef)){var E=e.Children.count(C.props.children),T=C.itemsWrapperRef.clientWidth,x=C.props.thumbWidth?C.props.thumbWidth:(0,n.outerWidth)(C.thumbsRef[0]),N=Math.floor(T/x),G=N<E,j=G?E-N:0;C.setState(function(ie,ee){return{itemSize:x,visibleItems:N,firstItem:G?C.getFirstItem(ee.selectedItem):0,lastPosition:j,showArrows:G}})}}),M(v(C),"handleClickItem",function(E,T,x){if(!R(x)||x.key==="Enter"){var N=C.props.onSelectItem;typeof N=="function"&&N(E,T)}}),M(v(C),"onSwipeStart",function(){C.setState({swiping:!0})}),M(v(C),"onSwipeEnd",function(){C.setState({swiping:!1})}),M(v(C),"onSwipeMove",function(E){var T=E.x;if(!C.state.itemSize||!C.itemsWrapperRef||!C.state.visibleItems)return!1;var x=0,N=e.Children.count(C.props.children),G=-(C.state.firstItem*100)/C.state.visibleItems,j=Math.max(N-C.state.visibleItems,0),ie=-j*100/C.state.visibleItems;G===x&&T>0&&(T=0),G===ie&&T<0&&(T=0);var ee=C.itemsWrapperRef.clientWidth,Q=G+100/(ee/T);return C.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(te){C.itemsListRef.style[te]=(0,r.default)(Q,"%",C.props.axis)}),!0}),M(v(C),"slideRight",function(E){C.moveTo(C.state.firstItem-(typeof E=="number"?E:1))}),M(v(C),"slideLeft",function(E){C.moveTo(C.state.firstItem+(typeof E=="number"?E:1))}),M(v(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(F,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(C){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==C.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(C){var 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 x=t.default.ITEM(!1,T===C.state.selectedItem),N={key:T,ref:function(j){return C.setThumbsRef(j,T)},className:x,onClick:C.handleClickItem.bind(C,T,C.props.children[T]),onKeyDown:C.handleClickItem.bind(C,T,C.props.children[T]),"aria-label":"".concat(C.props.labels.item," ").concat(T+1),style:{width:C.props.thumbWidth}};return e.default.createElement("li",c({},N,{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,x=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,N={},G=-this.state.firstItem*(this.state.itemSize||0),j=(0,r.default)(G,"px",this.props.axis),ie=this.props.transitionTime+"ms";return N={WebkitTransform:j,MozTransform:j,MsTransform:j,OTransform:j,transform:j,msTransform:j,WebkitTransitionDuration:ie,MozTransitionDuration:ie,MsTransitionDuration:ie,OTransitionDuration:ie,transitionDuration:ie,msTransitionDuration:ie},e.default.createElement("div",{className:t.default.CAROUSEL(!1)},e.default.createElement("div",{className:t.default.WRAPPER(!1),ref:this.setItemsWrapperRef},e.default.createElement("button",{type:"button",className:t.default.ARROW_PREV(!T),onClick:function(){return C.slideRight()},"aria-label":this.props.labels.leftArrow}),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:N,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(Q){return C.setItemsListRef(Q)},style:N},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!x),onClick:function(){return C.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),F}(e.Component);return Hi.default=_,M(_,"displayName","Thumbs"),M(_,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Hi}var Ni={},Xl;function qg(){if(Xl)return Ni;Xl=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.default=void 0;var e=function(){return document};return Ni.default=e,Ni}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=lo(),t=n(Ns());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 Gg(){if(jl)return Nn;jl=1,Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.fadeAnimationHandler=Nn.slideStopSwipingHandler=Nn.slideSwipeAnimationHandler=Nn.slideAnimationHandler=void 0;var e=lo(),t=r(Ns()),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,y=p,b=e.Children.count(g.children)-1,v=g.infiniteLoop&&(p<0||p>b);if(v)return y<0?g.centerMode&&g.centerSlidePercentage&&g.axis==="horizontal"?m.itemListStyle=(0,n.setPosition)(-(b+2)*g.centerSlidePercentage-(100-g.centerSlidePercentage)/2,g.axis):m.itemListStyle=(0,n.setPosition)(-(b+2)*100,g.axis):y>b&&(m.itemListStyle=(0,n.setPosition)(0,g.axis)),m;var S=(0,n.getPosition)(p,g),O=(0,t.default)(S,"%",g.axis),M=g.transitionTime+"ms";return m.itemListStyle={WebkitTransform:O,msTransform:O,OTransform:O,transform:O},h.swiping||(m.itemListStyle=o(o({},m.itemListStyle),{},{WebkitTransitionDuration:M,MozTransitionDuration:M,OTransitionDuration:M,transitionDuration:M,msTransitionDuration:M})),m};Nn.slideAnimationHandler=a;var l=function(g,h,m,p){var y={},b=h.axis==="horizontal",v=e.Children.count(h.children),S=0,O=(0,n.getPosition)(m.selectedItem,h),M=h.infiniteLoop?(0,n.getPosition)(v-1,h)-100:(0,n.getPosition)(v-1,h),R=b?g.x:g.y,_=R;O===S&&R>0&&(_=0),O===M&&R<0&&(_=0);var I=O+100/(m.itemSize/_),k=Math.abs(R)>h.swipeScrollTolerance;return h.infiniteLoop&&k&&(m.selectedItem===0&&I>-100?I-=v*100:m.selectedItem===v-1&&I<-v*100&&(I+=v*100)),(!h.preventMovementUntilSwipeScrollTolerance||k||m.swipeMovementStarted)&&(m.swipeMovementStarted||p({swipeMovementStarted:!0}),y.itemListStyle=(0,n.setPosition)(I,h.axis)),k&&!m.cancelClick&&p({cancelClick:!0}),y};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",y={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:p,msTransitionTimingFunction:p,MozTransitionTimingFunction:p,WebkitTransitionTimingFunction:p,OTransitionTimingFunction:p};return h.swiping||(y=o(o({},y),{},{WebkitTransitionDuration:m,MozTransitionDuration:m,OTransitionDuration:m,transitionDuration:m,msTransitionDuration:m})),{slideStyle:y,selectedStyle:o(o({},y),{},{opacity:1,position:"relative"}),prevStyle:o({},y)}};return Nn.fadeAnimationHandler=c,Nn}var Kl;function Xg(){if(Kl)return Li;Kl=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.default=void 0;var e=c(lo()),t=l(Xc()),n=l(Yc()),r=l(Kc()),i=l(qg()),o=l(jc()),s=Zc(),a=Gg();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 x in D)if(Object.prototype.hasOwnProperty.call(D,x)){var N=T?Object.getOwnPropertyDescriptor(D,x):null;N&&(N.get||N.set)?Object.defineProperty(E,x,N):E[x]=D[x]}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(x){return Object.getOwnPropertyDescriptor(D,x).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 y(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 b(D,C,E){return C&&y(D.prototype,C),D}function v(D,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(C&&C.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),C&&S(D,C)}function S(D,C){return S=Object.setPrototypeOf||function(T,x){return T.__proto__=x,T},S(D,C)}function O(D){var C=_();return function(){var T=I(D),x;if(C){var N=I(this).constructor;x=Reflect.construct(T,arguments,N)}else x=T.apply(this,arguments);return M(this,x)}}function M(D,C){return C&&(d(C)==="object"||typeof C=="function")?C:R(D)}function R(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function _(){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 F=function(D){v(E,D);var C=O(E);function E(T){var x;p(this,E),x=C.call(this,T),k(R(x),"thumbsRef",void 0),k(R(x),"carouselWrapperRef",void 0),k(R(x),"listRef",void 0),k(R(x),"itemsRef",void 0),k(R(x),"timer",void 0),k(R(x),"animationHandler",void 0),k(R(x),"setThumbsRef",function(G){x.thumbsRef=G}),k(R(x),"setCarouselWrapperRef",function(G){x.carouselWrapperRef=G}),k(R(x),"setListRef",function(G){x.listRef=G}),k(R(x),"setItemsRef",function(G,j){x.itemsRef||(x.itemsRef=[]),x.itemsRef[j]=G}),k(R(x),"autoPlay",function(){e.Children.count(x.props.children)<=1||(x.clearAutoPlay(),x.props.autoPlay&&(x.timer=setTimeout(function(){x.increment()},x.props.interval)))}),k(R(x),"clearAutoPlay",function(){x.timer&&clearTimeout(x.timer)}),k(R(x),"resetAutoPlay",function(){x.clearAutoPlay(),x.autoPlay()}),k(R(x),"stopOnHover",function(){x.setState({isMouseEntered:!0},x.clearAutoPlay)}),k(R(x),"startOnLeave",function(){x.setState({isMouseEntered:!1},x.autoPlay)}),k(R(x),"isFocusWithinTheCarousel",function(){return x.carouselWrapperRef?!!((0,i.default)().activeElement===x.carouselWrapperRef||x.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),k(R(x),"navigateWithKeyboard",function(G){if(x.isFocusWithinTheCarousel()){var j=x.props.axis,ie=j==="horizontal",ee={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},Q=ie?ee.ArrowRight:ee.ArrowDown,te=ie?ee.ArrowLeft:ee.ArrowUp;Q===G.keyCode?x.increment():te===G.keyCode&&x.decrement()}}),k(R(x),"updateSizes",function(){if(!(!x.state.initialized||!x.itemsRef||x.itemsRef.length===0)){var G=x.props.axis==="horizontal",j=x.itemsRef[0];if(j){var ie=G?j.clientWidth:j.clientHeight;x.setState({itemSize:ie}),x.thumbsRef&&x.thumbsRef.updateSizes()}}}),k(R(x),"setMountState",function(){x.setState({hasMount:!0}),x.updateSizes()}),k(R(x),"handleClickItem",function(G,j){if(e.Children.count(x.props.children)!==0){if(x.state.cancelClick){x.setState({cancelClick:!1});return}x.props.onClickItem(G,j),G!==x.state.selectedItem&&x.setState({selectedItem:G})}}),k(R(x),"handleOnChange",function(G,j){e.Children.count(x.props.children)<=1||x.props.onChange(G,j)}),k(R(x),"handleClickThumb",function(G,j){x.props.onClickThumb(G,j),x.moveTo(G)}),k(R(x),"onSwipeStart",function(G){x.setState({swiping:!0}),x.props.onSwipeStart(G)}),k(R(x),"onSwipeEnd",function(G){x.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),x.props.onSwipeEnd(G),x.clearAutoPlay(),x.state.autoPlay&&x.autoPlay()}),k(R(x),"onSwipeMove",function(G,j){x.props.onSwipeMove(j);var ie=x.props.swipeAnimationHandler(G,x.props,x.state,x.setState.bind(R(x)));return x.setState(m({},ie)),!!Object.keys(ie).length}),k(R(x),"decrement",function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;x.moveTo(x.state.selectedItem-(typeof G=="number"?G:1))}),k(R(x),"increment",function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;x.moveTo(x.state.selectedItem+(typeof G=="number"?G:1))}),k(R(x),"moveTo",function(G){if(typeof G=="number"){var j=e.Children.count(x.props.children)-1;G<0&&(G=x.props.infiniteLoop?j:0),G>j&&(G=x.props.infiniteLoop?0:j),x.selectItem({selectedItem:G}),x.state.autoPlay&&x.state.isMouseEntered===!1&&x.resetAutoPlay()}}),k(R(x),"onClickNext",function(){x.increment(1)}),k(R(x),"onClickPrev",function(){x.decrement(1)}),k(R(x),"onSwipeForward",function(){x.increment(1),x.props.emulateTouch&&x.setState({cancelClick:!0})}),k(R(x),"onSwipeBackwards",function(){x.decrement(1),x.props.emulateTouch&&x.setState({cancelClick:!0})}),k(R(x),"changeItem",function(G){return function(j){(!(0,s.isKeyboardEvent)(j)||j.key==="Enter")&&x.moveTo(G)}}),k(R(x),"selectItem",function(G){x.setState(m({previousItem:x.state.selectedItem},G),function(){x.setState(x.animationHandler(x.props,x.state))}),x.handleOnChange(G.selectedItem,e.Children.toArray(x.props.children)[G.selectedItem])}),k(R(x),"getInitialImage",function(){var G=x.props.selectedItem,j=x.itemsRef&&x.itemsRef[G],ie=j&&j.getElementsByTagName("img")||[];return ie[0]}),k(R(x),"getVariableItemHeight",function(G){var j=x.itemsRef&&x.itemsRef[G];if(x.state.hasMount&&j&&j.children.length){var ie=j.children[0].getElementsByTagName("img")||[];if(ie.length>0){var ee=ie[0];if(!ee.complete){var Q=function ue(){x.forceUpdate(),ee.removeEventListener("load",ue)};ee.addEventListener("load",Q)}}var te=ie[0]||j.children[0],se=te.clientHeight;return se>0?se:null}return null});var N={initialized:!1,previousItem:T.selectedItem,selectedItem:T.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:T.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return x.animationHandler=typeof T.animationHandler=="function"&&T.animationHandler||T.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,x.state=m(m({},N),x.animationHandler(T,N)),x}return b(E,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(x,N){!x.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!x.autoFocus&&this.props.autoFocus&&this.forceFocus(),N.swiping&&!this.state.swiping&&this.setState(m({},this.props.stopSwipingHandler(this.props,this.state))),(x.selectedItem!==this.props.selectedItem||x.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),x.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var x=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var N=x.getInitialImage();N&&!N.complete?N.addEventListener("load",x.setMountState):x.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var x=this.carouselWrapperRef;this.props.stopOnHover&&x&&(x.addEventListener("mouseenter",this.stopOnHover),x.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var x=this.carouselWrapperRef;this.props.stopOnHover&&x&&(x.removeEventListener("mouseenter",this.stopOnHover),x.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,i.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var x=this.getInitialImage();x&&x.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var x;(x=this.carouselWrapperRef)===null||x===void 0||x.focus()}},{key:"renderItems",value:function(x){var N=this;return this.props.children?e.Children.map(this.props.children,function(G,j){var ie=j===N.state.selectedItem,ee=j===N.state.previousItem,Q=ie&&N.state.selectedStyle||ee&&N.state.prevStyle||N.state.slideStyle||{};N.props.centerMode&&N.props.axis==="horizontal"&&(Q=m(m({},Q),{},{minWidth:N.props.centerSlidePercentage+"%"})),N.state.swiping&&N.state.swipeMovementStarted&&(Q=m(m({},Q),{},{pointerEvents:"none"}));var te={ref:function(ue){return N.setItemsRef(ue,j)},key:"itemKey"+j+(x?"clone":""),className:n.default.ITEM(!0,j===N.state.selectedItem,j===N.state.previousItem),onClick:N.handleClickItem.bind(N,j,G),style:Q};return e.default.createElement("li",te,N.props.renderItem(G,{isSelected:j===N.state.selectedItem,isPrevious:j===N.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var x=this,N=this.props,G=N.showIndicators,j=N.labels,ie=N.renderIndicator,ee=N.children;return G?e.default.createElement("ul",{className:"control-dots"},e.Children.map(ee,function(Q,te){return ie&&ie(x.changeItem(te),te===x.state.selectedItem,te,j.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||e.Children.count(this.props.children)===0?null:e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var x=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var N=this.props.swipeable&&e.Children.count(this.props.children)>1,G=this.props.axis==="horizontal",j=this.props.showArrows&&e.Children.count(this.props.children)>1,ie=j&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ee=j&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,Q=this.renderItems(!0),te=Q.shift(),se=Q.pop(),ue={className:n.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},fe={};if(G){if(ue.onSwipeLeft=this.onSwipeForward,ue.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var re=this.getVariableItemHeight(this.state.selectedItem);fe.height=re||"auto"}}else ue.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,ue.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,ue.style=m(m({},ue.style),{},{height:this.state.itemSize}),fe.height=this.state.itemSize;return e.default.createElement("div",{"aria-label":this.props.ariaLabel,className:n.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},e.default.createElement("div",{className:n.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,ie,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:fe},N?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},ue,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&se,this.renderItems(),this.props.infiniteLoop&&te):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(P){return x.setListRef(P)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&se,this.renderItems(),this.props.infiniteLoop&&te)),this.props.renderArrowNext(this.onClickNext,ee,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),E}(e.default.Component);return Li.default=F,k(F,"displayName","Carousel"),k(F,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:s.noop,onClickThumb:s.noop,onChange:s.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(C,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,x){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(x," ").concat(T+1)})},renderItem:function(C){return C},renderThumbs:function(C){var E=e.Children.map(C,function(T){var x=T;if(T.type!=="img"&&(x=e.Children.toArray(T.props.children).find(function(N){return N.type==="img"})),!!x)return x});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}),Li}var Zl={},Jl;function Yg(){return Jl||(Jl=1),Zl}var Ql;function jg(){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(Xg()),n=Yg(),r=i(Kc());function i(o){return o&&o.__esModule?o:{default:o}}}(Ka)),Ka}var Kg=jg(),Za,eu;function Zg(){if(eu)return Za;eu=1;var e=mh(),t=function(){return e.Date.now()};return Za=t,Za}var Ja,tu;function Jc(){if(tu)return Ja;tu=1;var e=Tc(),t=Zg(),n=Dc(),r="Expected a function",i=Math.max,o=Math.min;function s(a,l,u){var c,d,g,h,m,p,y=0,b=!1,v=!1,S=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,e(u)&&(b=!!u.leading,v="maxWait"in u,g=v?i(n(u.maxWait)||0,l):g,S="trailing"in u?!!u.trailing:S);function O(E){var T=c,x=d;return c=d=void 0,y=E,h=a.apply(x,T),h}function M(E){return y=E,m=setTimeout(I,l),b?O(E):h}function R(E){var T=E-p,x=E-y,N=l-T;return v?o(N,g-x):N}function _(E){var T=E-p,x=E-y;return p===void 0||T>=l||T<0||v&&x>=g}function I(){var E=t();if(_(E))return k(E);m=setTimeout(I,R(E))}function k(E){return m=void 0,S&&c?O(E):(c=d=void 0,h)}function F(){m!==void 0&&clearTimeout(m),y=0,c=p=d=m=void 0}function D(){return m===void 0?h:k(t())}function C(){var E=t(),T=_(E);if(c=arguments,d=this,p=E,T){if(m===void 0)return M(p);if(v)return clearTimeout(m),m=setTimeout(I,l),O(p)}return m===void 0&&(m=setTimeout(I,l)),h}return C.cancel=F,C.flush=D,C}return Ja=s,Ja}var Jg=Jc();const Qc=sr(Jg);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 yr(e,t){return e===void 0?void 0:t}const Qg=Math.PI;function nu(e){return e*Qg/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,Bs=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),f.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},em=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 tm(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 nm="֑-߿יִ-﷽ﹰ-ﻼ",rm="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",im=new RegExp("^[^"+rm+"]*["+nm+"]");function Ws(e){return im.test(e)?"rtl":"not-rtl"}let Ao;function xs(){if(typeof document>"u")return 0;if(Ao!==void 0)return Ao;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),Ao=n-r,Ao}const Hr=Symbol();function om(e){const t=f.useRef([Hr,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!==Hr&&(a=typeof a=="function"?a(l):a,a===l)||(l!==Hr&&i({}),r(u=>typeof a=="function"?a(l===Hr?u:l):a),t.current[0]=Hr)},[]),s=f.useCallback(()=>{t.current[0]=Hr,i({})},[]);return[t.current[0]===Hr?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 am(e){const t=f.useRef(e);return pi(e,t.current)||(t.current=e),t.current}const sm=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(Bg,{"data-testid":"GDG-default-image-overlay-editor"},f.createElement(Kg.Carousel,{showArrows:s,showThumbs:!1,swipeable:s,emulateTouch:s,infiniteLoop:s},o.map(a=>{const l=i?.(a)??f.createElement("img",{draggable:!1,src:a});return f.createElement("div",{className:"gdg-centering-container",key:a},l)})),n&&r&&f.createElement("button",{className:"gdg-edit-icon",onClick:r},f.createElement(Bs,null)))};function 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 Wr=od();function lm(e){Wr=e}const ad=/[&<>"']/,um=new RegExp(ad.source,"g"),sd=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,cm=new RegExp(sd.source,"g"),dm={"&":"&","<":"<",">":">",'"':""","'":"'"},ru=e=>dm[e];function gn(e,t){if(t){if(ad.test(e))return e.replace(um,ru)}else if(sd.test(e))return e.replace(cm,ru);return e}const fm=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ld(e){return e.replace(fm,(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 hm=/(^|[^\[])\^/g;function At(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(hm,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const gm=/[^\w:]/g,mm=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function iu(e,t,n){if(e){let r;try{r=decodeURIComponent(ld(n)).replace(gm,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!mm.test(n)&&(n=wm(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Ho={},pm=/^[^:]+:\/*[^/]*$/,vm=/^([^:]+:)[\s\S]*$/,bm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function wm(e,t){Ho[" "+e]||(pm.test(e)?Ho[" "+e]=e+"/":Ho[" "+e]=Ko(e,"/",!0)),e=Ho[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(vm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(bm,"$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 ym(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 Cm(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 Sm(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
|
-
`)}class Us{constructor(t){this.options=t||
|
5
|
-
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],i=
|
4
|
+
`)}class Us{constructor(t){this.options=t||Wr}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
|
+
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],i=Sm(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:i}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){const i=Ko(r,"#");(this.options.pedantic||!i||/ $/.test(i))&&(r=i.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const r=n[0].replace(/^ *>[ \t]?/gm,""),i=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(r);return this.lexer.state.top=i,{type:"blockquote",raw:n[0],tokens:o,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r,i,o,s,a,l,u,c,d,g,h,m,p=n[1].trim();const y=p.length>1,b={type:"list",raw:"",ordered:y,start:y?+p.slice(0,-1):"",loose:!1,items:[]};p=y?`\\d{1,9}\\${p.slice(-1)}`:`\\${p}`,this.options.pedantic&&(p=y?p:"[*+-]");const v=new RegExp(`^( {0,3}${p})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(m=!1,!(!(n=v.exec(t))||this.rules.block.hr.test(t)));){if(r=n[0],t=t.substring(r.length),c=n[2].split(`
|
6
6
|
`,1)[0].replace(/^\t+/,O=>" ".repeat(3*O.length)),d=t.split(`
|
7
7
|
`,1)[0],this.options.pedantic?(s=2,h=c.trimLeft()):(s=n[2].search(/[^ ]/),s=s>4?1:s,h=c.slice(s),s+=n[1].length),l=!1,!c&&/^ *$/.test(d)&&(r+=d+`
|
8
|
-
`,t=t.substring(d.length+1),m=!0),!m){const O=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
|
9
|
-
`,1)[0],d=g,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(
|
10
|
-
`+d.slice(s);else{if(l||c.search(/[^ ]/)>=4||
|
8
|
+
`,t=t.substring(d.length+1),m=!0),!m){const O=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),M=new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),R=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),_=new RegExp(`^ {0,${Math.min(3,s-1)}}#`);for(;t&&(g=t.split(`
|
9
|
+
`,1)[0],d=g,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(R.test(d)||_.test(d)||O.test(d)||M.test(t)));){if(d.search(/[^ ]/)>=s||!d.trim())h+=`
|
10
|
+
`+d.slice(s);else{if(l||c.search(/[^ ]/)>=4||R.test(c)||_.test(c)||M.test(c))break;h+=`
|
11
11
|
`+d}!l&&!d.trim()&&(l=!0),r+=g+`
|
12
|
-
`,t=t.substring(g.length+1),c=d.slice(s)}}b.loose||(u?b.loose=!0:/\n *\n *$/.test(r)&&(u=!0)),this.options.gfm&&(i=/^\[[ xX]\] /.exec(h),i&&(o=i[0]!=="[ ] ",h=h.replace(/^\[[ xX]\] +/,""))),b.items.push({type:"list_item",raw:r,task:!!i,checked:o,loose:!1,text:h}),b.raw+=r}b.items[b.items.length-1].raw=r.trimRight(),b.items[b.items.length-1].text=h.trimRight(),b.raw=b.raw.trimRight();const S=b.items.length;for(a=0;a<S;a++)if(this.lexer.state.top=!1,b.items[a].tokens=this.lexer.blockTokens(b.items[a].text,[]),!b.loose){const O=b.items[a].tokens.filter(
|
12
|
+
`,t=t.substring(g.length+1),c=d.slice(s)}}b.loose||(u?b.loose=!0:/\n *\n *$/.test(r)&&(u=!0)),this.options.gfm&&(i=/^\[[ xX]\] /.exec(h),i&&(o=i[0]!=="[ ] ",h=h.replace(/^\[[ xX]\] +/,""))),b.items.push({type:"list_item",raw:r,task:!!i,checked:o,loose:!1,text:h}),b.raw+=r}b.items[b.items.length-1].raw=r.trimRight(),b.items[b.items.length-1].text=h.trimRight(),b.raw=b.raw.trimRight();const S=b.items.length;for(a=0;a<S;a++)if(this.lexer.state.top=!1,b.items[a].tokens=this.lexer.blockTokens(b.items[a].text,[]),!b.loose){const O=b.items[a].tokens.filter(R=>R.type==="space"),M=O.length>0&&O.some(R=>/\n.*\n/.test(R.raw));b.loose=M}if(b.loose)for(a=0;a<S;a++)b.items[a].loose=!0;return b}}html(t){const n=this.rules.block.html.exec(t);if(n){const r={type:"html",raw:n[0],pre:!this.options.sanitizer&&(n[1]==="pre"||n[1]==="script"||n[1]==="style"),text:n[0]};if(this.options.sanitize){const i=this.options.sanitizer?this.options.sanitizer(n[0]):gn(n[0]);r.type="paragraph",r.text=i,r.tokens=this.lexer.inline(i)}return r}}def(t){const n=this.rules.block.def.exec(t);if(n){const r=n[1].toLowerCase().replace(/\s+/g," "),i=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",o=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:i,title:o}}}table(t){const n=this.rules.block.table.exec(t);if(n){const r={type:"table",header:ou(n[1]).map(i=>({text:i})),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
|
13
13
|
`):[]};if(r.header.length===r.align.length){r.raw=n[0];let i=r.align.length,o,s,a,l;for(o=0;o<i;o++)/^ *-+: *$/.test(r.align[o])?r.align[o]="right":/^ *:-+: *$/.test(r.align[o])?r.align[o]="center":/^ *:-+ *$/.test(r.align[o])?r.align[o]="left":r.align[o]=null;for(i=r.rows.length,o=0;o<i;o++)r.rows[o]=ou(r.rows[o],r.header.length).map(u=>({text:u}));for(i=r.header.length,s=0;s<i;s++)r.header[s].tokens=this.lexer.inline(r.header[s].text);for(i=r.rows.length,s=0;s<i;s++)for(l=r.rows[s],a=0;a<l.length;a++)l[a].tokens=this.lexer.inline(l[a].text);return r}}}lheading(t){const n=this.rules.block.lheading.exec(t);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(t){const n=this.rules.block.paragraph.exec(t);if(n){const r=n[1].charAt(n[1].length-1)===`
|
14
|
-
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(t){const n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){const n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:gn(n[1])}}tag(t){const n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&/^<a /i.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):gn(n[0]):n[0]}}link(t){const n=this.rules.inline.link.exec(t);if(n){const r=n[2].trim();if(!this.options.pedantic&&/^</.test(r)){if(!/>$/.test(r))return;const s=Ko(r.slice(0,-1),"\\");if((r.length-s.length)%2===0)return}else{const s=
|
15
|
-
]`).replace("lheading",Ae.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Ce={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ra,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ra,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};Ce._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";Ce.punctuation=At(Ce.punctuation).replace(/punctuation/g,Ce._punctuation).getRegex();Ce.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;Ce.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;Ce._comment=At(Ae._comment).replace("(?:-->|$)","-->").getRegex();Ce.emStrong.lDelim=At(Ce.emStrong.lDelim).replace(/punct/g,Ce._punctuation).getRegex();Ce.emStrong.rDelimAst=At(Ce.emStrong.rDelimAst,"g").replace(/punct/g,Ce._punctuation).getRegex();Ce.emStrong.rDelimUnd=At(Ce.emStrong.rDelimUnd,"g").replace(/punct/g,Ce._punctuation).getRegex();Ce._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;Ce._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;Ce._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;Ce.autolink=At(Ce.autolink).replace("scheme",Ce._scheme).replace("email",Ce._email).getRegex();Ce._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;Ce.tag=At(Ce.tag).replace("comment",Ce._comment).replace("attribute",Ce._attribute).getRegex();Ce._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;Ce._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;Ce._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;Ce.link=At(Ce.link).replace("label",Ce._label).replace("href",Ce._href).replace("title",Ce._title).getRegex();Ce.reflink=At(Ce.reflink).replace("label",Ce._label).replace("ref",Ae._label).getRegex();Ce.nolink=At(Ce.nolink).replace("ref",Ae._label).getRegex();Ce.reflinkSearch=At(Ce.reflinkSearch,"g").replace("reflink",Ce.reflink).replace("nolink",Ce.nolink).getRegex();Ce.normal={...Ce};Ce.pedantic={...Ce.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:At(/^!?\[(label)\]\((.*?)\)/).replace("label",Ce._label).getRegex(),reflink:At(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ce._label).getRegex()};Ce.gfm={...Ce.normal,escape:At(Ce.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/};Ce.gfm.url=At(Ce.gfm.url,"i").replace("email",Ce.gfm._extended_email).getRegex();Ce.breaks={...Ce.gfm,br:At(Ce.br).replace("{2,}","*").getRegex(),text:At(Ce.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};function
|
14
|
+
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(t){const n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){const n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:gn(n[1])}}tag(t){const n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&/^<a /i.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):gn(n[0]):n[0]}}link(t){const n=this.rules.inline.link.exec(t);if(n){const r=n[2].trim();if(!this.options.pedantic&&/^</.test(r)){if(!/>$/.test(r))return;const s=Ko(r.slice(0,-1),"\\");if((r.length-s.length)%2===0)return}else{const s=ym(n[2],"()");if(s>-1){const l=(n[0].indexOf("!")===0?5:4)+n[1].length+s;n[2]=n[2].substring(0,s),n[0]=n[0].substring(0,l).trim(),n[3]=""}}let i=n[2],o="";if(this.options.pedantic){const s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);s&&(i=s[1],o=s[3])}else o=n[3]?n[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(r)?i=i.slice(1):i=i.slice(1,-1)),su(n,{href:i&&i.replace(this.rules.inline._escapes,"$1"),title:o&&o.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(t,n){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let i=(r[2]||r[1]).replace(/\s+/g," ");if(i=n[i.toLowerCase()],!i){const o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return su(r,i,r[0],this.lexer)}}emStrong(t,n,r=""){let i=this.rules.inline.emStrong.lDelim.exec(t);if(!i||i[3]&&r.match(/[\p{L}\p{N}]/u))return;const o=i[1]||i[2]||"";if(!o||o&&(r===""||this.rules.inline.punctuation.exec(r))){const s=i[0].length-1;let a,l,u=s,c=0;const d=i[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,n=n.slice(-1*t.length+s);(i=d.exec(n))!=null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(l=a.length,i[3]||i[4]){u+=l;continue}else if((i[5]||i[6])&&s%3&&!((s+l)%3)){c+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+c);const g=t.slice(0,s+i.index+(i[0].length-a.length)+l);if(Math.min(s,l)%2){const m=g.slice(1,-1);return{type:"em",raw:g,text:m,tokens:this.lexer.inlineTokens(m)}}const h=g.slice(2,-2);return{type:"strong",raw:g,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let r=n[2].replace(/\n/g," ");const i=/[^ ]/.test(r),o=/^ /.test(r)&&/ $/.test(r);return i&&o&&(r=r.substring(1,r.length-1)),r=gn(r,!0),{type:"codespan",raw:n[0],text:r}}}br(t){const n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){const n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t,n){const r=this.rules.inline.autolink.exec(t);if(r){let i,o;return r[2]==="@"?(i=gn(this.options.mangle?n(r[1]):r[1]),o="mailto:"+i):(i=gn(r[1]),o=i),{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(t,n){let r;if(r=this.rules.inline.url.exec(t)){let i,o;if(r[2]==="@")i=gn(this.options.mangle?n(r[0]):r[0]),o="mailto:"+i;else{let s;do s=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])[0];while(s!==r[0]);i=gn(r[0]),r[1]==="www."?o="http://"+r[0]:o=r[0]}return{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t,n){const r=this.rules.inline.text.exec(t);if(r){let i;return this.lexer.state.inRawBlock?i=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):gn(r[0]):r[0]:i=gn(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}}}}const Ae={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:ra,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};Ae._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;Ae._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;Ae.def=At(Ae.def).replace("label",Ae._label).replace("title",Ae._title).getRegex();Ae.bullet=/(?:[*+-]|\d{1,9}[.)])/;Ae.listItemStart=At(/^( *)(bull) */).replace("bull",Ae.bullet).getRegex();Ae.list=At(Ae.list).replace(/bull/g,Ae.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ae.def.source+")").getRegex();Ae._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";Ae._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;Ae.html=At(Ae.html,"i").replace("comment",Ae._comment).replace("tag",Ae._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();Ae.paragraph=At(Ae._paragraph).replace("hr",Ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ae._tag).getRegex();Ae.blockquote=At(Ae.blockquote).replace("paragraph",Ae.paragraph).getRegex();Ae.normal={...Ae};Ae.gfm={...Ae.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};Ae.gfm.table=At(Ae.gfm.table).replace("hr",Ae.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ae._tag).getRegex();Ae.gfm.paragraph=At(Ae._paragraph).replace("hr",Ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Ae.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ae._tag).getRegex();Ae.pedantic={...Ae.normal,html:At(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ae._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ra,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:At(Ae.normal._paragraph).replace("hr",Ae.hr).replace("heading",` *#{1,6} *[^
|
15
|
+
]`).replace("lheading",Ae.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Ce={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ra,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ra,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};Ce._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";Ce.punctuation=At(Ce.punctuation).replace(/punctuation/g,Ce._punctuation).getRegex();Ce.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;Ce.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;Ce._comment=At(Ae._comment).replace("(?:-->|$)","-->").getRegex();Ce.emStrong.lDelim=At(Ce.emStrong.lDelim).replace(/punct/g,Ce._punctuation).getRegex();Ce.emStrong.rDelimAst=At(Ce.emStrong.rDelimAst,"g").replace(/punct/g,Ce._punctuation).getRegex();Ce.emStrong.rDelimUnd=At(Ce.emStrong.rDelimUnd,"g").replace(/punct/g,Ce._punctuation).getRegex();Ce._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;Ce._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;Ce._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;Ce.autolink=At(Ce.autolink).replace("scheme",Ce._scheme).replace("email",Ce._email).getRegex();Ce._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;Ce.tag=At(Ce.tag).replace("comment",Ce._comment).replace("attribute",Ce._attribute).getRegex();Ce._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;Ce._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;Ce._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;Ce.link=At(Ce.link).replace("label",Ce._label).replace("href",Ce._href).replace("title",Ce._title).getRegex();Ce.reflink=At(Ce.reflink).replace("label",Ce._label).replace("ref",Ae._label).getRegex();Ce.nolink=At(Ce.nolink).replace("ref",Ae._label).getRegex();Ce.reflinkSearch=At(Ce.reflinkSearch,"g").replace("reflink",Ce.reflink).replace("nolink",Ce.nolink).getRegex();Ce.normal={...Ce};Ce.pedantic={...Ce.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:At(/^!?\[(label)\]\((.*?)\)/).replace("label",Ce._label).getRegex(),reflink:At(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ce._label).getRegex()};Ce.gfm={...Ce.normal,escape:At(Ce.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/};Ce.gfm.url=At(Ce.gfm.url,"i").replace("email",Ce.gfm._extended_email).getRegex();Ce.breaks={...Ce.gfm,br:At(Ce.br).replace("{2,}","*").getRegex(),text:At(Ce.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};function xm(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function lu(e){let t="",n,r;const i=e.length;for(n=0;n<i;n++)r=e.charCodeAt(n),Math.random()>.5&&(r="x"+r.toString(16)),t+="&#"+r+";";return t}class kr{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Wr,this.options.tokenizer=this.options.tokenizer||new Us,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:Ae.normal,inline:Ce.normal};this.options.pedantic?(n.block=Ae.pedantic,n.inline=Ce.pedantic):this.options.gfm&&(n.block=Ae.gfm,this.options.breaks?n.inline=Ce.breaks:n.inline=Ce.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ae,inline:Ce}}static lex(t,n){return new kr(n).lex(t)}static lexInline(t,n){return new kr(n).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
|
16
16
|
`),this.blockTokens(t,this.tokens);let n;for(;n=this.inlineQueue.shift();)this.inlineTokens(n.src,n.tokens);return this.tokens}blockTokens(t,n=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(a,l,u)=>l+" ".repeat(u.length));let r,i,o,s;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(r=a.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length),r.raw.length===1&&n.length>0?n[n.length-1].raw+=`
|
17
17
|
`:n.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
|
18
18
|
`+r.raw,i.text+=`
|
@@ -22,7 +22,7 @@ import{r as f,E as Ls,_ as ze,c as uh,g as ar,i as Ua,d as lo,e as ch,f as dh,h
|
|
22
22
|
`+r.raw,i.text+=`
|
23
23
|
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r),s=o.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length),i=n[n.length-1],i&&i.type==="text"?(i.raw+=`
|
24
24
|
`+r.raw,i.text+=`
|
25
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r,i,o,s=t,a,l,u;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)c.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+au("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,a.index)+"["+au("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(s))!=null;)s=s.slice(0,a.index+a[0].length-2)+"++"+s.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;t;)if(l||(u=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(r=c.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.escape(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.tag(t)){t=t.substring(r.raw.length),i=n[n.length-1],i&&r.type==="text"&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):n.push(r);continue}if(r=this.tokenizer.link(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(r.raw.length),i=n[n.length-1],i&&r.type==="text"&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):n.push(r);continue}if(r=this.tokenizer.emStrong(t,s,u)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.codespan(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.br(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.del(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.autolink(t,lu)){t=t.substring(r.raw.length),n.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(t,lu))){t=t.substring(r.raw.length),n.push(r);continue}if(o=t,this.options.extensions&&this.options.extensions.startInline){let c=1/0;const d=t.slice(1);let g;this.options.extensions.startInline.forEach(function(h){g=h.call({lexer:this},d),typeof g=="number"&&g>=0&&(c=Math.min(c,g))}),c<1/0&&c>=0&&(o=t.substring(0,c+1))}if(r=this.tokenizer.inlineText(o,
|
25
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r,i,o,s=t,a,l,u;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)c.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+au("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,a.index)+"["+au("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(s))!=null;)s=s.slice(0,a.index+a[0].length-2)+"++"+s.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;t;)if(l||(u=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(r=c.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.escape(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.tag(t)){t=t.substring(r.raw.length),i=n[n.length-1],i&&r.type==="text"&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):n.push(r);continue}if(r=this.tokenizer.link(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(r.raw.length),i=n[n.length-1],i&&r.type==="text"&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):n.push(r);continue}if(r=this.tokenizer.emStrong(t,s,u)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.codespan(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.br(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.del(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.autolink(t,lu)){t=t.substring(r.raw.length),n.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(t,lu))){t=t.substring(r.raw.length),n.push(r);continue}if(o=t,this.options.extensions&&this.options.extensions.startInline){let c=1/0;const d=t.slice(1);let g;this.options.extensions.startInline.forEach(function(h){g=h.call({lexer:this},d),typeof g=="number"&&g>=0&&(c=Math.min(c,g))}),c<1/0&&c>=0&&(o=t.substring(0,c+1))}if(r=this.tokenizer.inlineText(o,xm)){t=t.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(u=r.raw.slice(-1)),l=!0,i=n[n.length-1],i&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):n.push(r);continue}if(t){const c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return n}}class qs{constructor(t){this.options=t||Wr}code(t,n,r){const i=(n||"").match(/\S*/)[0];if(this.options.highlight){const o=this.options.highlight(t,i);o!=null&&o!==t&&(r=!0,t=o)}return t=t.replace(/\n$/,"")+`
|
26
26
|
`,i?'<pre><code class="'+this.options.langPrefix+gn(i)+'">'+(r?t:gn(t,!0))+`</code></pre>
|
27
27
|
`:"<pre><code>"+(r?t:gn(t,!0))+`</code></pre>
|
28
28
|
`}blockquote(t){return`<blockquote>
|
@@ -42,20 +42,20 @@ ${t}</blockquote>
|
|
42
42
|
`}tablerow(t){return`<tr>
|
43
43
|
${t}</tr>
|
44
44
|
`}tablecell(t,n){const r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+t+`</${r}>
|
45
|
-
`}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(t){return`<del>${t}</del>`}link(t,n,r){if(t=iu(this.options.sanitize,this.options.baseUrl,t),t===null)return r;let i='<a href="'+t+'"';return n&&(i+=' title="'+n+'"'),i+=">"+r+"</a>",i}image(t,n,r){if(t=iu(this.options.sanitize,this.options.baseUrl,t),t===null)return r;let i=`<img src="${t}" alt="${r}"`;return n&&(i+=` title="${n}"`),i+=this.options.xhtml?"/>":">",i}text(t){return t}}class
|
46
|
-
`+(h.tokens?this.parseInline(h.tokens):h.text);r+=n?this.renderer.paragraph(g):g;continue}default:{const
|
47
|
-
Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+gn(r.message+"",!0)+"</pre>";if(t)return Promise.resolve(i);if(n){n(null,i);return}return i}if(t)return Promise.reject(r);if(n){n(r);return}throw r}}function
|
48
|
-
`),f.createElement(
|
49
|
-
`),c=
|
50
|
-
`)&&(e=e.split(/\r?\n/,1)[0]);const n=t/4;return e.length>n&&(e=e.slice(0,n)),e}function Um(e,t,n,r,i,o,s,a,l,u){const c=a.baseFontFull,d=Pm(e,t,c,i-a.cellHorizontalPadding*2,u??!1),g=Ys(e,c),h=a.lineHeight*g,m=g+h*(d.length-1),p=m+a.cellVerticalPadding>o;p&&(e.save(),e.rect(n,r,i,o),e.clip());const y=r+o/2-m/2;let b=Math.max(r+a.cellVerticalPadding,y);for(const v of d)if(pd(e,v,n,b,i,g,s,a,l),b+=h,b>r+o)break;p&&e.restore()}function Xn(e,t,n,r,i){const{ctx:o,rect:s,theme:a}=e,{x:l,y:u,width:c,height:d}=s;r=r??!1,r||(t=Wm(t,c));const g=Zn(o,a),h=Ws(t)==="rtl";if(n===void 0&&h&&(n="right"),h&&(o.direction="rtl"),t.length>0){let m=!1;n==="right"?(o.textAlign="right",m=!0):n!==void 0&&n!=="left"&&(o.textAlign=n,m=!0),r?Um(o,t,l,u,c,d,g,a,n,i):pd(o,t,l,u,c,d,g,a,n),m&&(o.textAlign="start"),h&&(o.direction="inherit")}}function Kn(e,t,n,r,i,o){typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.max(0,Math.min(o.tl,i/2,r/2)),tr:Math.max(0,Math.min(o.tr,i/2,r/2)),bl:Math.max(0,Math.min(o.bl,i/2,r/2)),br:Math.max(0,Math.min(o.br,i/2,r/2))},e.moveTo(t+o.tl,n),e.arcTo(t+r,n,t+r,n+o.tr,o.tr),e.arcTo(t+r,n+i,t+r-o.br,n+i,o.br),e.arcTo(t,n+i,t,n+i-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}function qm(e,t,n){e.arc(t,n-1.25*3.5,1.25,0,2*Math.PI,!1),e.arc(t,n,1.25,0,2*Math.PI,!1),e.arc(t,n+1.25*3.5,1.25,0,2*Math.PI,!1)}function Gm(e,t,n){const r=function(a,l){const u=l.x-a.x,c=l.y-a.y,d=Math.sqrt(u*u+c*c),g=u/d,h=c/d;return{x:u,y:l.y-a.y,len:d,nx:g,ny:h,ang:Math.atan2(h,g)}};let i;const o=t.length;let s=t[o-1];for(let a=0;a<o;a++){let l=t[a%o];const u=t[(a+1)%o],c=r(l,s),d=r(l,u),g=c.nx*d.ny-c.ny*d.nx,h=c.nx*d.nx-c.ny*-d.ny;let m=Math.asin(g<-1?-1:g>1?1:g),p=1,y=!1;h<0?m<0?m=Math.PI+m:(m=Math.PI-m,p=-1,y=!0):m>0&&(p=-1,y=!0),i=l.radius!==void 0?l.radius:n;const b=m/2;let v=Math.abs(Math.cos(b)*i/Math.sin(b)),S;v>Math.min(c.len/2,d.len/2)?(v=Math.min(c.len/2,d.len/2),S=Math.abs(v*Math.sin(b)/Math.cos(b))):S=i;let O=l.x+d.nx*v,R=l.y+d.ny*v;O+=-d.ny*S*p,R+=d.nx*S*p,e.arc(O,R,S,c.ang+Math.PI/2*p,d.ang-Math.PI/2*p,y),s=l,l=u}e.closePath()}function Rs(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m){const p={x:0,y:o+u,width:0,height:0};if(e>=h.length||t>=c||t<-2||e<0)return p;const y=o-i;if(e>=d){const b=s>e?-1:1,v=pi(h);p.x+=v+l;for(let S=s;S!==e;S+=b)p.x+=h[b===1?S:S-1].width*b}else for(let b=0;b<e;b++)p.x+=h[b].width;if(p.width=h[e].width+1,t===-1)p.y=i,p.height=y;else if(t===-2){p.y=0,p.height=i;let b=e;const v=h[e].group,S=h[e].sticky;for(;b>0&&no(h[b-1].group,v)&&h[b-1].sticky===S;){const R=h[b-1];p.x-=R.width,p.width+=R.width,b--}let O=e;for(;O+1<h.length&&no(h[O+1].group,v)&&h[O+1].sticky===S;){const R=h[O+1];p.width+=R.width,O++}if(!S){const R=pi(h),M=p.x-R;M<0&&(p.x-=M,p.width+=M),p.x+p.width>n&&(p.width=n-p.x)}}else if(t>=c-g){let b=c-t;for(p.y=r;b>0;){const v=t+b-1;p.height=typeof m=="number"?m:m(v),p.y-=p.height,b--}p.height+=1}else{const b=a>t?-1:1;if(typeof m=="number"){const v=t-a;p.y+=v*m}else for(let v=a;v!==t;v+=b)p.y+=m(v)*b;p.height=(typeof m=="number"?m:m(t))+1}return p}const js=1<<21;function Bn(e,t){return(t+2)*js+e}function vd(e){return e%js}function Xs(e){return Math.floor(e/js)-2}function Ks(e){const t=vd(e),n=Xs(e);return[t,n]}class bd{visibleWindow={x:0,y:0,width:0,height:0};freezeCols=0;freezeRows=[];isInWindow=t=>{const n=vd(t),r=Xs(t),i=this.visibleWindow,o=n>=i.x&&n<=i.x+i.width||n<this.freezeCols,s=r>=i.y&&r<=i.y+i.height||this.freezeRows.includes(r);return o&&s};setWindow(t,n,r){this.visibleWindow.x===t.x&&this.visibleWindow.y===t.y&&this.visibleWindow.width===t.width&&this.visibleWindow.height===t.height&&this.freezeCols===n&&mi(this.freezeRows,r)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=r,this.clearOutOfWindow())}}class Ym extends bd{cache=new Map;setValue=(t,n)=>{this.cache.set(Bn(t[0],t[1]),n)};getValue=t=>this.cache.get(Bn(t[0],t[1]));clearOutOfWindow=()=>{for(const[t]of this.cache.entries())this.isInWindow(t)||this.cache.delete(t)}}class Qi{cells;constructor(t=[]){this.cells=new Set(t.map(n=>Bn(n[0],n[1])))}add(t){this.cells.add(Bn(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(Bn(t[0],t[1]))}remove(t){this.cells.delete(Bn(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(Xs(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n<t.y+t.height;n++)for(let r=t.x;r<t.x+t.width;r++)if(this.cells.has(Bn(r,n)))return!0;return!1}hasItemInRegion(t){for(const n of t)if(this.hasItemInRectangle(n))return!0;return!1}*values(){for(const t of this.cells)yield Ks(t)}}function jm(e){return{"--gdg-accent-color":e.accentColor,"--gdg-accent-fg":e.accentFg,"--gdg-accent-light":e.accentLight,"--gdg-text-dark":e.textDark,"--gdg-text-medium":e.textMedium,"--gdg-text-light":e.textLight,"--gdg-text-bubble":e.textBubble,"--gdg-bg-icon-header":e.bgIconHeader,"--gdg-fg-icon-header":e.fgIconHeader,"--gdg-text-header":e.textHeader,"--gdg-text-group-header":e.textGroupHeader??e.textHeader,"--gdg-bg-group-header":e.bgGroupHeader??e.bgHeader,"--gdg-bg-group-header-hovered":e.bgGroupHeaderHovered??e.bgHeaderHovered,"--gdg-text-header-selected":e.textHeaderSelected,"--gdg-bg-cell":e.bgCell,"--gdg-bg-cell-medium":e.bgCellMedium,"--gdg-bg-header":e.bgHeader,"--gdg-bg-header-has-focus":e.bgHeaderHasFocus,"--gdg-bg-header-hovered":e.bgHeaderHovered,"--gdg-bg-bubble":e.bgBubble,"--gdg-bg-bubble-selected":e.bgBubbleSelected,"--gdg-bubble-height":`${e.bubbleHeight}px`,"--gdg-bubble-padding":`${e.bubblePadding}px`,"--gdg-bubble-margin":`${e.bubbleMargin}px`,"--gdg-bg-search-result":e.bgSearchResult,"--gdg-border-color":e.borderColor,"--gdg-horizontal-border-color":e.horizontalBorderColor??e.borderColor,"--gdg-drilldown-border":e.drilldownBorder,"--gdg-link-color":e.linkColor,"--gdg-cell-horizontal-padding":`${e.cellHorizontalPadding}px`,"--gdg-cell-vertical-padding":`${e.cellVerticalPadding}px`,"--gdg-header-font-style":e.headerFontStyle,"--gdg-base-font-style":e.baseFontStyle,"--gdg-marker-font-style":e.markerFontStyle,"--gdg-font-family":e.fontFamily,"--gdg-editor-font-size":e.editorFontSize,"--gdg-checkbox-max-size":`${e.checkboxMaxSize}px`,...e.resizeIndicatorColor===void 0?{}:{"--gdg-resize-indicator-color":e.resizeIndicatorColor},...e.headerBottomBorderColor===void 0?{}:{"--gdg-header-bottom-border-color":e.headerBottomBorderColor},...e.roundingRadius===void 0?{}:{"--gdg-rounding-radius":`${e.roundingRadius}px`}}}const wd={accentColor:"#4F5DFF",accentFg:"#FFFFFF",accentLight:"rgba(62, 116, 253, 0.1)",textDark:"#313139",textMedium:"#737383",textLight:"#B2B2C0",textBubble:"#313139",bgIconHeader:"#737383",fgIconHeader:"#FFFFFF",textHeader:"#313139",textGroupHeader:"#313139BB",textHeaderSelected:"#FFFFFF",bgCell:"#FFFFFF",bgCellMedium:"#FAFAFB",bgHeader:"#F7F7F8",bgHeaderHasFocus:"#E9E9EB",bgHeaderHovered:"#EFEFF1",bgBubble:"#EDEDF3",bgBubbleSelected:"#FFFFFF",bubbleHeight:20,bubblePadding:6,bubbleMargin:4,bgSearchResult:"#fff9e3",borderColor:"rgba(115, 116, 131, 0.16)",drilldownBorder:"rgba(0, 0, 0, 0)",linkColor:"#353fb5",cellHorizontalPadding:8,cellVerticalPadding:3,headerIconSize:18,headerFontStyle:"600 13px",baseFontStyle:"13px",markerFontStyle:"9px",fontFamily:"Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif",editorFontSize:"13px",lineHeight:1.4,checkboxMaxSize:18};function yd(){return wd}const Cd=Vt.createContext(wd);function Xm(){return Vt.useContext(Cd)}function ir(e,...t){const n={...e};for(const r of t)if(r!==void 0)for(const i in r)r.hasOwnProperty(i)&&(i==="bgCell"?n[i]=On(r[i],n[i]):n[i]=r[i]);return(n.headerFontFull===void 0||e.fontFamily!==n.fontFamily||e.headerFontStyle!==n.headerFontStyle)&&(n.headerFontFull=`${n.headerFontStyle} ${n.fontFamily}`),(n.baseFontFull===void 0||e.fontFamily!==n.fontFamily||e.baseFontStyle!==n.baseFontStyle)&&(n.baseFontFull=`${n.baseFontStyle} ${n.fontFamily}`),(n.markerFontFull===void 0||e.fontFamily!==n.fontFamily||e.markerFontStyle!==n.markerFontStyle)&&(n.markerFontFull=`${n.markerFontStyle} ${n.fontFamily}`),n}const Es=150;function Km(e,t,n,r){return r(t)?.measure?.(e,t,n)??Es}function Sd(e,t,n,r,i,o,s,a,l){let u=0;const c=i===void 0?[]:i.map(h=>{const m=Km(e,h[r],t,l);return u=Math.max(u,m),m});if(c.length>5&&a){u=0;let h=0;for(const p of c)h+=p;const m=h/c.length;for(let p=0;p<c.length;p++)c[p]>=m*2?c[p]=0:u=Math.max(u,c[p])}const d=e.font;e.font=t.headerFontFull,u=Math.max(u,e.measureText(n.title).width+t.cellHorizontalPadding*2+(n.icon===void 0?0:28)),e.font=d;const g=Math.max(Math.ceil(o),Math.min(Math.floor(s),Math.ceil(u)));return{...n,width:g}}function Zm(e,t,n,r,i,o,s,a,l){const u=f.useRef(t),c=f.useRef(n),d=f.useRef(s);u.current=t,c.current=n,d.current=s;const[g,h]=f.useMemo(()=>{if(typeof window>"u")return[null,null];const v=document.createElement("canvas");return v.style.display="none",v.style.opacity="0",v.style.position="fixed",[v,v.getContext("2d",{alpha:!1})]},[]);f.useLayoutEffect(()=>(g&&document.documentElement.append(g),()=>{g?.remove()}),[g]);const m=f.useRef({}),p=f.useRef(),[y,b]=f.useState();return f.useLayoutEffect(()=>{const v=c.current;if(v===void 0||e.every(_o))return;let S=Math.max(1,10-Math.floor(e.length/1e4)),O=0;S<u.current&&S>1&&(S--,O=1);const R={x:0,y:0,width:e.length,height:Math.min(u.current,S)},M={x:0,y:u.current-1,width:e.length,height:1};(async()=>{const E=v(R,l.signal),k=O>0?v(M,l.signal):void 0;let F;typeof E=="object"?F=E:F=await Hl(E),k!==void 0&&(typeof k=="object"?F=[...F,...k]:F=[...F,...await Hl(k)]),p.current=e,b(F)})()},[l.signal,e]),f.useMemo(()=>{let S=e.every(_o)?e:h===null?e.map(_=>_o(_)?_:{..._,width:Es}):(h.font=d.current.baseFontFull,e.map((_,E)=>{if(_o(_))return _;if(m.current[_.id]!==void 0)return{..._,width:m.current[_.id]};if(y===void 0||p.current!==e||_.id===void 0)return{..._,width:Es};const k=Sd(h,s,_,E,y,i,o,!0,a);return m.current[_.id]=k.width,k})),O=0,R=0;const M=[];for(const[_,E]of S.entries())O+=E.width,E.grow!==void 0&&E.grow>0&&(R+=E.grow,M.push(_));if(O<r&&M.length>0){const _=[...S],E=r-O;let k=E;for(let F=0;F<M.length;F++){const D=M[F],C=(S[D].grow??0)/R,I=F===M.length-1?k:Math.min(k,Math.floor(E*C));_[D]={...S[D],growOffset:I,width:S[D].width+I},k-=I}S=_}return{sizedColumns:S,nonGrowWidth:O}},[r,e,h,y,s,i,o,a])}var Qa,mu;function Jm(){if(mu)return Qa;mu=1;function e(t,n,r){return t===t&&(r!==void 0&&(t=t<=r?t:r),n!==void 0&&(t=t>=n?t:n)),t}return Qa=e,Qa}var es,pu;function Qm(){if(pu)return es;pu=1;var e=Jm(),t=Tc();function n(r,i,o){return o===void 0&&(o=i,i=void 0),o!==void 0&&(o=t(o),o=o===o?o:0),i!==void 0&&(i=t(i),i=i===i?i:0),e(t(r),i,o)}return es=n,es}var ep=Qm();const Ln=ar(ep);var ts,vu;function tp(){if(vu)return ts;vu=1;function e(){}return ts=e,ts}var ns,bu;function np(){if(bu)return ns;bu=1;var e=hh(),t=tp(),n=Dc(),r=1/0,i=e&&1/n(new e([,-0]))[1]==r?function(o){return new e(o)}:t;return ns=i,ns}var rs,wu;function rp(){if(wu)return rs;wu=1;var e=gh(),t=mh(),n=vh(),r=ph(),i=np(),o=Dc(),s=200;function a(l,u,c){var d=-1,g=t,h=l.length,m=!0,p=[],y=p;if(c)m=!1,g=n;else if(h>=s){var b=u?null:i(l);if(b)return o(b);m=!1,g=r,y=new e}else y=u?[]:p;e:for(;++d<h;){var v=l[d],S=u?u(v):v;if(v=c||v!==0?v:0,m&&S===S){for(var O=y.length;O--;)if(y[O]===S)continue e;u&&y.push(S),p.push(v)}else g(y,S,c)||(y!==p&&y.push(S),p.push(v))}return p}return rs=a,rs}var is,yu;function ip(){if(yu)return is;yu=1;var e=rp();function t(n){return n&&n.length?e(n):[]}return is=t,is}var op=ip();const ap=ar(op);var sp=bh();const Cu=ar(sp),Nt='<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">',lp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
51
|
-
${
|
52
|
-
${
|
45
|
+
`}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(t){return`<del>${t}</del>`}link(t,n,r){if(t=iu(this.options.sanitize,this.options.baseUrl,t),t===null)return r;let i='<a href="'+t+'"';return n&&(i+=' title="'+n+'"'),i+=">"+r+"</a>",i}image(t,n,r){if(t=iu(this.options.sanitize,this.options.baseUrl,t),t===null)return r;let i=`<img src="${t}" alt="${r}"`;return n&&(i+=` title="${n}"`),i+=this.options.xhtml?"/>":">",i}text(t){return t}}class ud{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,n,r){return""+r}image(t,n,r){return""+r}br(){return""}}class cd{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,n){let r=t,i=0;if(this.seen.hasOwnProperty(r)){i=this.seen[t];do i++,r=t+"-"+i;while(this.seen.hasOwnProperty(r))}return n||(this.seen[t]=i,this.seen[r]=0),r}slug(t,n={}){const r=this.serialize(t);return this.getNextSafeSlug(r,n.dryrun)}}class Mr{constructor(t){this.options=t||Wr,this.options.renderer=this.options.renderer||new qs,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ud,this.slugger=new cd}static parse(t,n){return new Mr(n).parse(t)}static parseInline(t,n){return new Mr(n).parseInline(t)}parse(t,n=!0){let r="",i,o,s,a,l,u,c,d,g,h,m,p,y,b,v,S,O,M,R;const _=t.length;for(i=0;i<_;i++){if(h=t[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[h.type]&&(R=this.options.extensions.renderers[h.type].call({parser:this},h),R!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(h.type))){r+=R||"";continue}switch(h.type){case"space":continue;case"hr":{r+=this.renderer.hr();continue}case"heading":{r+=this.renderer.heading(this.parseInline(h.tokens),h.depth,ld(this.parseInline(h.tokens,this.textRenderer)),this.slugger);continue}case"code":{r+=this.renderer.code(h.text,h.lang,h.escaped);continue}case"table":{for(d="",c="",a=h.header.length,o=0;o<a;o++)c+=this.renderer.tablecell(this.parseInline(h.header[o].tokens),{header:!0,align:h.align[o]});for(d+=this.renderer.tablerow(c),g="",a=h.rows.length,o=0;o<a;o++){for(u=h.rows[o],c="",l=u.length,s=0;s<l;s++)c+=this.renderer.tablecell(this.parseInline(u[s].tokens),{header:!1,align:h.align[s]});g+=this.renderer.tablerow(c)}r+=this.renderer.table(d,g);continue}case"blockquote":{g=this.parse(h.tokens),r+=this.renderer.blockquote(g);continue}case"list":{for(m=h.ordered,p=h.start,y=h.loose,a=h.items.length,g="",o=0;o<a;o++)v=h.items[o],S=v.checked,O=v.task,b="",v.task&&(M=this.renderer.checkbox(S),y?v.tokens.length>0&&v.tokens[0].type==="paragraph"?(v.tokens[0].text=M+" "+v.tokens[0].text,v.tokens[0].tokens&&v.tokens[0].tokens.length>0&&v.tokens[0].tokens[0].type==="text"&&(v.tokens[0].tokens[0].text=M+" "+v.tokens[0].tokens[0].text)):v.tokens.unshift({type:"text",text:M}):b+=M),b+=this.parse(v.tokens,y),g+=this.renderer.listitem(b,O,S);r+=this.renderer.list(g,m,p);continue}case"html":{r+=this.renderer.html(h.text);continue}case"paragraph":{r+=this.renderer.paragraph(this.parseInline(h.tokens));continue}case"text":{for(g=h.tokens?this.parseInline(h.tokens):h.text;i+1<_&&t[i+1].type==="text";)h=t[++i],g+=`
|
46
|
+
`+(h.tokens?this.parseInline(h.tokens):h.text);r+=n?this.renderer.paragraph(g):g;continue}default:{const I='Token with "'+h.type+'" type was not found.';if(this.options.silent){console.error(I);return}else throw new Error(I)}}}return r}parseInline(t,n){n=n||this.renderer;let r="",i,o,s;const a=t.length;for(i=0;i<a;i++){if(o=t[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]&&(s=this.options.extensions.renderers[o.type].call({parser:this},o),s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type))){r+=s||"";continue}switch(o.type){case"escape":{r+=n.text(o.text);break}case"html":{r+=n.html(o.text);break}case"link":{r+=n.link(o.href,o.title,this.parseInline(o.tokens,n));break}case"image":{r+=n.image(o.href,o.title,o.text);break}case"strong":{r+=n.strong(this.parseInline(o.tokens,n));break}case"em":{r+=n.em(this.parseInline(o.tokens,n));break}case"codespan":{r+=n.codespan(o.text);break}case"br":{r+=n.br();break}case"del":{r+=n.del(this.parseInline(o.tokens,n));break}case"text":{r+=n.text(o.text);break}default:{const l='Token with "'+o.type+'" type was not found.';if(this.options.silent){console.error(l);return}else throw new Error(l)}}}return r}}class ks{constructor(t){this.options=t||Wr}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(t){return t}postprocess(t){return t}}function km(e,t,n){return r=>{if(r.message+=`
|
47
|
+
Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+gn(r.message+"",!0)+"</pre>";if(t)return Promise.resolve(i);if(n){n(null,i);return}return i}if(t)return Promise.reject(r);if(n){n(r);return}throw r}}function dd(e,t){return(n,r,i)=>{typeof r=="function"&&(i=r,r=null);const o={...r};r={...Ve.defaults,...o};const s=km(r.silent,r.async,i);if(typeof n>"u"||n===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(Cm(r),r.hooks&&(r.hooks.options=r),i){const a=r.highlight;let l;try{r.hooks&&(n=r.hooks.preprocess(n)),l=e(n,r)}catch(d){return s(d)}const u=function(d){let g;if(!d)try{r.walkTokens&&Ve.walkTokens(l,r.walkTokens),g=t(l,r),r.hooks&&(g=r.hooks.postprocess(g))}catch(h){d=h}return r.highlight=a,d?s(d):i(null,g)};if(!a||a.length<3||(delete r.highlight,!l.length))return u();let c=0;Ve.walkTokens(l,function(d){d.type==="code"&&(c++,setTimeout(()=>{a(d.text,d.lang,function(g,h){if(g)return u(g);h!=null&&h!==d.text&&(d.text=h,d.escaped=!0),c--,c===0&&u()})},0))}),c===0&&u();return}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then(a=>e(a,r)).then(a=>r.walkTokens?Promise.all(Ve.walkTokens(a,r.walkTokens)).then(()=>a):a).then(a=>t(a,r)).then(a=>r.hooks?r.hooks.postprocess(a):a).catch(s);try{r.hooks&&(n=r.hooks.preprocess(n));const a=e(n,r);r.walkTokens&&Ve.walkTokens(a,r.walkTokens);let l=t(a,r);return r.hooks&&(l=r.hooks.postprocess(l)),l}catch(a){return s(a)}}}function Ve(e,t,n){return dd(kr.lex,Mr.parse)(e,t,n)}Ve.options=Ve.setOptions=function(e){return Ve.defaults={...Ve.defaults,...e},lm(Ve.defaults),Ve};Ve.getDefaults=od;Ve.defaults=Wr;Ve.use=function(...e){const t=Ve.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(n=>{const r={...n};if(r.async=Ve.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if(i.renderer){const o=t.renderers[i.name];o?t.renderers[i.name]=function(...s){let a=i.renderer.apply(this,s);return a===!1&&(a=o.apply(this,s)),a}:t.renderers[i.name]=i.renderer}if(i.tokenizer){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[i.level]?t[i.level].unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){const i=Ve.defaults.renderer||new qs;for(const o in n.renderer){const s=i[o];i[o]=(...a)=>{let l=n.renderer[o].apply(i,a);return l===!1&&(l=s.apply(i,a)),l}}r.renderer=i}if(n.tokenizer){const i=Ve.defaults.tokenizer||new Us;for(const o in n.tokenizer){const s=i[o];i[o]=(...a)=>{let l=n.tokenizer[o].apply(i,a);return l===!1&&(l=s.apply(i,a)),l}}r.tokenizer=i}if(n.hooks){const i=Ve.defaults.hooks||new ks;for(const o in n.hooks){const s=i[o];ks.passThroughHooks.has(o)?i[o]=a=>{if(Ve.defaults.async)return Promise.resolve(n.hooks[o].call(i,a)).then(u=>s.call(i,u));const l=n.hooks[o].call(i,a);return s.call(i,l)}:i[o]=(...a)=>{let l=n.hooks[o].apply(i,a);return l===!1&&(l=s.apply(i,a)),l}}r.hooks=i}if(n.walkTokens){const i=Ve.defaults.walkTokens;r.walkTokens=function(o){let s=[];return s.push(n.walkTokens.call(this,o)),i&&(s=s.concat(i.call(this,o))),s}}Ve.setOptions(r)})};Ve.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(Ve,r)),r.type){case"table":{for(const i of r.header)n=n.concat(Ve.walkTokens(i.tokens,t));for(const i of r.rows)for(const o of i)n=n.concat(Ve.walkTokens(o.tokens,t));break}case"list":{n=n.concat(Ve.walkTokens(r.items,t));break}default:Ve.defaults.extensions&&Ve.defaults.extensions.childTokens&&Ve.defaults.extensions.childTokens[r.type]?Ve.defaults.extensions.childTokens[r.type].forEach(function(i){n=n.concat(Ve.walkTokens(r[i],t))}):r.tokens&&(n=n.concat(Ve.walkTokens(r.tokens,t)))}return n};Ve.parseInline=dd(kr.lexInline,Mr.parseInline);Ve.Parser=Mr;Ve.parser=Mr.parse;Ve.Renderer=qs;Ve.TextRenderer=ud;Ve.Lexer=kr;Ve.lexer=kr.lex;Ve.Tokenizer=Us;Ve.Slugger=cd;Ve.Hooks=ks;Ve.parse=Ve;Ve.options;Ve.setOptions;Ve.use;Ve.walkTokens;Ve.parseInline;Mr.parse;kr.lex;const Mm=un("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class Rm extends Vt.PureComponent{targetElement=null;renderMarkdownIntoDiv(){const{targetElement:t,props:n}=this;if(t===null)return;const{contents:r,createNode:i}=n,o=Ve(r),s=document.createRange();s.selectNodeContents(t),s.deleteContents();let a=i?.(o);if(a===void 0){const u=document.createElement("template");u.innerHTML=o,a=u.content}t.append(a);const l=t.getElementsByTagName("a");for(const u of l)u.target="_blank",u.rel="noreferrer noopener"}containerRefHook=t=>{this.targetElement=t,this.renderMarkdownIntoDiv()};render(){return this.renderMarkdownIntoDiv(),Vt.createElement(Mm,{ref:this.containerRefHook})}}const Im=un("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),Em=un("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),Tm=un("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let uu=0;const Ur=e=>{const{placeholder:t,value:n,onKeyDown:r,highlight:i,altNewline:o,validatedSelection:s,...a}=e,{onChange:l,className:u}=a,c=f.useRef(null),d=n??"";Dn(l!==void 0,"GrowingEntry must be a controlled input area");const[g]=f.useState(()=>"input-box-"+(uu=(uu+1)%1e7));f.useEffect(()=>{const m=c.current;if(m===null||m.disabled)return;const p=d.toString().length;m.focus(),m.setSelectionRange(i?0:p,p)},[]),f.useLayoutEffect(()=>{if(s!==void 0){const m=typeof s=="number"?[s,null]:s;c.current?.setSelectionRange(m[0],m[1])}},[s]);const h=f.useCallback(m=>{m.key==="Enter"&&m.shiftKey&&o===!0||r?.(m)},[o,r]);return f.createElement(Tm,{className:"gdg-growing-entry"},f.createElement(Em,{className:u},d+`
|
48
|
+
`),f.createElement(Im,{...a,className:(u??"")+" gdg-input",id:g,ref:c,onKeyDown:h,value:d,placeholder:t,dir:"auto"}))},Qa={};let br=null;function Dm(){const e=document.createElement("div");return e.style.opacity="0",e.style.pointerEvents="none",e.style.position="fixed",document.body.append(e),e}function ia(e){const t=e.toLowerCase().trim();if(Qa[t]!==void 0)return Qa[t];br=br||Dm(),br.style.color="#000",br.style.color=t;const n=getComputedStyle(br).color;br.style.color="#fff",br.style.color=t;const r=getComputedStyle(br).color;if(r!==n)return[0,0,0,1];let i=r.replace(/[^\d.,]/g,"").split(",").map(Number.parseFloat);return i.length<4&&i.push(1),i=i.map(o=>Number.isNaN(o)?0:o),Qa[t]=i,i}function Nr(e,t){const[n,r,i]=ia(e);return`rgba(${n}, ${r}, ${i}, ${t})`}const cu=new Map;function du(e,t){const n=`${e}-${t}`,r=cu.get(n);if(r!==void 0)return r;const i=On(e,t);return cu.set(n,i),i}function On(e,t){if(t===void 0)return e;const[n,r,i,o]=ia(e);if(o===1)return e;const[s,a,l,u]=ia(t),c=o+u*(1-o),d=(o*n+u*s*(1-o))/c,g=(o*r+u*a*(1-o))/c,h=(o*i+u*l*(1-o))/c;return`rgba(${d}, ${g}, ${h}, ${c})`}var di=new Map,hi=new Map,Ms=new Map;function Om(){di.clear(),Ms.clear(),hi.clear()}function Pm(e,t,n,r,i){var o,s,a;let l=0,u={};for(let d of e)l+=(o=n.get(d))!=null?o:i,u[d]=((s=u[d])!=null?s:0)+1;let c=t-l;for(let d of Object.keys(u)){let g=u[d],h=(a=n.get(d))!=null?a:i,m=h*g/l,p=c*m*r/g,y=h+p;n.set(d,y)}}function _m(e,t){var n;let r=new Map,i=0;for(let u of"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-+=?"){let c=e.measureText(u).width;r.set(u,c),i+=c}let o=i/r.size,s=3,a=(t/o+s)/(s+1),l=r.keys();for(let u of l)r.set(u,((n=r.get(u))!=null?n:o)*a);return r}function Ki(e,t,n,r){var i,o;let s=hi.get(n);if(r&&s!==void 0&&s.count>2e4){let u=Ms.get(n);if(u===void 0&&(u=_m(e,s.size),Ms.set(n,u)),s.count>5e5){let d=0;for(let g of t)d+=(i=u.get(g))!=null?i:s.size;return d*1.01}let c=e.measureText(t);return Pm(t,c.width,u,Math.max(.05,1-s.count/2e5),s.size),hi.set(n,{count:s.count+t.length,size:s.size}),c.width}let a=e.measureText(t),l=a.width/t.length;if(((o=s?.count)!=null?o:0)>2e4)return a.width;if(s===void 0)hi.set(n,{count:t.length,size:l});else{let u=l-s.size,c=t.length/(s.count+t.length),d=s.size+u*c;hi.set(n,{count:s.count+t.length,size:d})}return a.width}function Fm(e,t,n,r,i,o,s,a){if(t.length<=1)return t.length;if(i<n)return-1;let l=Math.floor(n/i*o),u=Ki(e,t.slice(0,Math.max(0,l)),r,s);if(u!==n)if(u<n){for(;u<n;)l++,u=Ki(e,t.slice(0,Math.max(0,l)),r,s);l--}else for(;u>n;){let c=t.lastIndexOf(" ",l-1);c>0?l=c:l--,u=Ki(e,t.slice(0,Math.max(0,l)),r,s)}if(t[l]!==" "){let c=0;c=t.lastIndexOf(" ",l),c>0&&(l=c)}return l}function Lm(e,t,n,r,i,o){let s=`${t}_${n}_${r}px`,a=di.get(s);if(a!==void 0)return a;if(r<=0)return[];let l=[],u=t.split(`
|
49
|
+
`),c=hi.get(n),d=c===void 0?t.length:r/c.size*1.5,g=i&&c!==void 0&&c.count>2e4;for(let h of u){let m=Ki(e,h.slice(0,Math.max(0,d)),n,g),p=Math.min(h.length,d);if(m<=r)l.push(h);else{for(;m>r;){let y=Fm(e,h,r,n,m,p,g),b=h.slice(0,Math.max(0,y));h=h.slice(b.length),l.push(b),m=Ki(e,h.slice(0,Math.max(0,d)),n,g),p=Math.min(h.length,d)}m>0&&l.push(h)}}return l=l.map((h,m)=>m===0?h.trimEnd():h.trim()),di.set(s,l),di.size>500&&di.delete(di.keys().next().value),l}function Am(e,t){return Vt.useMemo(()=>e.map((n,r)=>({group:n.group,grow:n.grow,hasMenu:n.hasMenu,icon:n.icon,id:n.id,menuIcon:n.menuIcon,overlayIcon:n.overlayIcon,sourceIndex:r,sticky:r<t,indicatorIcon:n.indicatorIcon,style:n.style,themeOverride:n.themeOverride,title:n.title,trailingRowOptions:n.trailingRowOptions,width:n.width,growOffset:n.growOffset,rowMarker:n.rowMarker,rowMarkerChecked:n.rowMarkerChecked,headerRowMarkerTheme:n.headerRowMarkerTheme,headerRowMarkerAlwaysVisible:n.headerRowMarkerAlwaysVisible,headerRowMarkerDisabled:n.headerRowMarkerDisabled})),[e,t])}function Hm(e,t){const[n,r]=t;if(e.columns.hasIndex(n)||e.rows.hasIndex(r))return!0;if(e.current!==void 0){if(Zi(e.current.cell,t))return!0;const i=[e.current.range,...e.current.rangeStack];for(const o of i)if(n>=o.x&&n<o.x+o.width&&r>=o.y&&r<o.y+o.height)return!0}return!1}function no(e,t){return(e??"")===(t??"")}function zm(e,t,n){return n.current===void 0||e[1]!==n.current.cell[1]?!1:t.span===void 0?n.current.cell[0]===e[0]:n.current.cell[0]>=t.span[0]&&n.current.cell[0]<=t.span[1]}function fd(e,t){const[n,r]=e;return n>=t.x&&n<t.x+t.width&&r>=t.y&&r<t.y+t.height}function Zi(e,t){return e?.[0]===t?.[0]&&e?.[1]===t?.[1]}function hd(e){return[e.x+e.width-1,e.y+e.height-1]}function fu(e,t,n){const r=n.x,i=n.x+n.width-1,o=n.y,s=n.y+n.height-1,[a,l]=e;if(l<o||l>s)return!1;if(t.span===void 0)return a>=r&&a<=i;const[u,c]=t.span;return u>=r&&u<=i||c>=r&&u<=i||u<r&&c>i}function Vm(e,t,n,r){let i=0;if(n.current===void 0)return i;const o=n.current.range;(r||o.height*o.width>1)&&fu(e,t,o)&&i++;for(const s of n.current.rangeStack)fu(e,t,s)&&i++;return i}function gd(e,t){let n=e;if(t!==void 0){let r=[...e];const i=n[t.src];t.src>t.dest?(r.splice(t.src,1),r.splice(t.dest,0,i)):(r.splice(t.dest+1,0,i),r.splice(t.src,1)),r=r.map((o,s)=>({...o,sticky:e[s].sticky})),n=r}return n}function vi(e,t){let n=0;const r=gd(e,t);for(let i=0;i<r.length;i++){const o=r[i];if(o.sticky)n+=o.width;else break}return n}function qr(e,t,n){if(typeof n=="number")return t*n;{let r=0;for(let i=e-t;i<e;i++)r+=n(i);return r}}function Rs(e,t,n,r,i){const o=gd(e,r),s=[];for(const u of o)if(u.sticky)s.push(u);else break;if(s.length>0)for(const u of s)n-=u.width;let a=t,l=i??0;for(;l<=n&&a<o.length;)l+=o[a].width,a++;for(let u=t;u<a;u++){const c=o[u];c.sticky||s.push(c)}return s}function $m(e,t,n){let r=0;for(const i of t){const o=i.sticky?r:r+(n??0);if(e<=o+i.width)return i.sourceIndex;r+=i.width}return-1}function Nm(e,t,n,r,i,o,s,a,l,u){const c=r+i;if(n&&e<=i)return-2;if(e<=c)return-1;let d=t;for(let m=0;m<u;m++){const p=o-1-m,y=typeof s=="number"?s:s(p);if(d-=y,e>=d)return p}const g=o-u,h=e-(l??0);if(typeof s=="number"){const m=Math.floor((h-c)/s)+a;return m>=g?void 0:m}else{let m=c;for(let p=a;p<g;p++){const y=s(p);if(h<=m+y)return p;m+=y}return}}let Zo=0,Ji={};const Bm=typeof window>"u";async function Wm(){Bm||document?.fonts?.ready===void 0||(await document.fonts.ready,Zo=0,Ji={},Om())}Wm();function md(e,t,n,r){return`${e}_${r??t?.font}_${n}`}function Gr(e,t,n,r="middle"){const i=md(e,t,r,n);let o=Ji[i];return o===void 0&&(o=t.measureText(e),Ji[i]=o,Zo++),Zo>1e4&&(Ji={},Zo=0),o}function pd(e,t){const n=md(e,void 0,"middle",t);return Ji[n]}function Qn(e,t){return typeof t!="string"&&(t=t.baseFontFull),Um(e,t)}function hu(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const r=e.measureText(n);return e.restore(),r}const gu=[];function Um(e,t){for(const o of gu)if(o.key===t)return o.val;const n=hu(e,"alphabetic"),i=-(hu(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return gu.push({key:t,val:i}),i}function qm(e,t,n,r,i,o){const{ctx:s,rect:a,theme:l}=e;let u=Number.MAX_SAFE_INTEGER;const c=500;if(t!==void 0&&(u=n-t,u<c)){const d=1-u/c;s.globalAlpha=d,s.fillStyle=l.bgSearchResult,s.fillRect(a.x+1,a.y+1,a.width-(i?2:1),a.height-(o?2:1)),s.globalAlpha=1,r!==void 0&&(r.fillStyle=l.bgSearchResult)}return u<c}function uo(e,t,n){const{ctx:r,theme:i}=e,o=t??{},s=n??i.textDark;return s!==o.fillStyle&&(r.fillStyle=s,o.fillStyle=s),o}function Gs(e,t,n,r,i){const{rect:o,ctx:s,theme:a}=e;s.fillStyle=a.textDark,Zn({ctx:s,rect:o,theme:a},t,n,r,i)}function vd(e,t,n,r,i,o,s,a,l){l==="right"?e.fillText(t,n+i-(a.cellHorizontalPadding+.5),r+o/2+s):l==="center"?e.fillText(t,n+i/2,r+o/2+s):e.fillText(t,n+a.cellHorizontalPadding+.5,r+o/2+s)}function Xs(e,t){const n=Gr("ABCi09jgqpy",e,t);return n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}function Gm(e,t){e.includes(`
|
50
|
+
`)&&(e=e.split(/\r?\n/,1)[0]);const n=t/4;return e.length>n&&(e=e.slice(0,n)),e}function Xm(e,t,n,r,i,o,s,a,l,u){const c=a.baseFontFull,d=Lm(e,t,c,i-a.cellHorizontalPadding*2,u??!1),g=Xs(e,c),h=a.lineHeight*g,m=g+h*(d.length-1),p=m+a.cellVerticalPadding>o;p&&(e.save(),e.rect(n,r,i,o),e.clip());const y=r+o/2-m/2;let b=Math.max(r+a.cellVerticalPadding,y);for(const v of d)if(vd(e,v,n,b,i,g,s,a,l),b+=h,b>r+o)break;p&&e.restore()}function Zn(e,t,n,r,i){const{ctx:o,rect:s,theme:a}=e,{x:l,y:u,width:c,height:d}=s;r=r??!1,r||(t=Gm(t,c));const g=Qn(o,a),h=Ws(t)==="rtl";if(n===void 0&&h&&(n="right"),h&&(o.direction="rtl"),t.length>0){let m=!1;n==="right"?(o.textAlign="right",m=!0):n!==void 0&&n!=="left"&&(o.textAlign=n,m=!0),r?Xm(o,t,l,u,c,d,g,a,n,i):vd(o,t,l,u,c,d,g,a,n),m&&(o.textAlign="start"),h&&(o.direction="inherit")}}function Jn(e,t,n,r,i,o){typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.max(0,Math.min(o.tl,i/2,r/2)),tr:Math.max(0,Math.min(o.tr,i/2,r/2)),bl:Math.max(0,Math.min(o.bl,i/2,r/2)),br:Math.max(0,Math.min(o.br,i/2,r/2))},e.moveTo(t+o.tl,n),e.arcTo(t+r,n,t+r,n+o.tr,o.tr),e.arcTo(t+r,n+i,t+r-o.br,n+i,o.br),e.arcTo(t,n+i,t,n+i-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}function Ym(e,t,n){e.arc(t,n-1.25*3.5,1.25,0,2*Math.PI,!1),e.arc(t,n,1.25,0,2*Math.PI,!1),e.arc(t,n+1.25*3.5,1.25,0,2*Math.PI,!1)}function jm(e,t,n){const r=function(a,l){const u=l.x-a.x,c=l.y-a.y,d=Math.sqrt(u*u+c*c),g=u/d,h=c/d;return{x:u,y:l.y-a.y,len:d,nx:g,ny:h,ang:Math.atan2(h,g)}};let i;const o=t.length;let s=t[o-1];for(let a=0;a<o;a++){let l=t[a%o];const u=t[(a+1)%o],c=r(l,s),d=r(l,u),g=c.nx*d.ny-c.ny*d.nx,h=c.nx*d.nx-c.ny*-d.ny;let m=Math.asin(g<-1?-1:g>1?1:g),p=1,y=!1;h<0?m<0?m=Math.PI+m:(m=Math.PI-m,p=-1,y=!0):m>0&&(p=-1,y=!0),i=l.radius!==void 0?l.radius:n;const b=m/2;let v=Math.abs(Math.cos(b)*i/Math.sin(b)),S;v>Math.min(c.len/2,d.len/2)?(v=Math.min(c.len/2,d.len/2),S=Math.abs(v*Math.sin(b)/Math.cos(b))):S=i;let O=l.x+d.nx*v,M=l.y+d.ny*v;O+=-d.ny*S*p,M+=d.nx*S*p,e.arc(O,M,S,c.ang+Math.PI/2*p,d.ang-Math.PI/2*p,y),s=l,l=u}e.closePath()}function Is(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m){const p={x:0,y:o+u,width:0,height:0};if(e>=h.length||t>=c||t<-2||e<0)return p;const y=o-i;if(e>=d){const b=s>e?-1:1,v=vi(h);p.x+=v+l;for(let S=s;S!==e;S+=b)p.x+=h[b===1?S:S-1].width*b}else for(let b=0;b<e;b++)p.x+=h[b].width;if(p.width=h[e].width+1,t===-1)p.y=i,p.height=y;else if(t===-2){p.y=0,p.height=i;let b=e;const v=h[e].group,S=h[e].sticky;for(;b>0&&no(h[b-1].group,v)&&h[b-1].sticky===S;){const M=h[b-1];p.x-=M.width,p.width+=M.width,b--}let O=e;for(;O+1<h.length&&no(h[O+1].group,v)&&h[O+1].sticky===S;){const M=h[O+1];p.width+=M.width,O++}if(!S){const M=vi(h),R=p.x-M;R<0&&(p.x-=R,p.width+=R),p.x+p.width>n&&(p.width=n-p.x)}}else if(t>=c-g){let b=c-t;for(p.y=r;b>0;){const v=t+b-1;p.height=typeof m=="number"?m:m(v),p.y-=p.height,b--}p.height+=1}else{const b=a>t?-1:1;if(typeof m=="number"){const v=t-a;p.y+=v*m}else for(let v=a;v!==t;v+=b)p.y+=m(v)*b;p.height=(typeof m=="number"?m:m(t))+1}return p}const Ys=1<<21;function Wn(e,t){return(t+2)*Ys+e}function bd(e){return e%Ys}function js(e){return Math.floor(e/Ys)-2}function Ks(e){const t=bd(e),n=js(e);return[t,n]}class wd{visibleWindow={x:0,y:0,width:0,height:0};freezeCols=0;freezeRows=[];isInWindow=t=>{const n=bd(t),r=js(t),i=this.visibleWindow,o=n>=i.x&&n<=i.x+i.width||n<this.freezeCols,s=r>=i.y&&r<=i.y+i.height||this.freezeRows.includes(r);return o&&s};setWindow(t,n,r){this.visibleWindow.x===t.x&&this.visibleWindow.y===t.y&&this.visibleWindow.width===t.width&&this.visibleWindow.height===t.height&&this.freezeCols===n&&pi(this.freezeRows,r)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=r,this.clearOutOfWindow())}}class Km extends wd{cache=new Map;setValue=(t,n)=>{this.cache.set(Wn(t[0],t[1]),n)};getValue=t=>this.cache.get(Wn(t[0],t[1]));clearOutOfWindow=()=>{for(const[t]of this.cache.entries())this.isInWindow(t)||this.cache.delete(t)}}class Qi{cells;constructor(t=[]){this.cells=new Set(t.map(n=>Wn(n[0],n[1])))}add(t){this.cells.add(Wn(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(Wn(t[0],t[1]))}remove(t){this.cells.delete(Wn(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(js(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n<t.y+t.height;n++)for(let r=t.x;r<t.x+t.width;r++)if(this.cells.has(Wn(r,n)))return!0;return!1}hasItemInRegion(t){for(const n of t)if(this.hasItemInRectangle(n))return!0;return!1}*values(){for(const t of this.cells)yield Ks(t)}}function Zm(e){return{"--gdg-accent-color":e.accentColor,"--gdg-accent-fg":e.accentFg,"--gdg-accent-light":e.accentLight,"--gdg-text-dark":e.textDark,"--gdg-text-medium":e.textMedium,"--gdg-text-light":e.textLight,"--gdg-text-bubble":e.textBubble,"--gdg-bg-icon-header":e.bgIconHeader,"--gdg-fg-icon-header":e.fgIconHeader,"--gdg-text-header":e.textHeader,"--gdg-text-group-header":e.textGroupHeader??e.textHeader,"--gdg-bg-group-header":e.bgGroupHeader??e.bgHeader,"--gdg-bg-group-header-hovered":e.bgGroupHeaderHovered??e.bgHeaderHovered,"--gdg-text-header-selected":e.textHeaderSelected,"--gdg-bg-cell":e.bgCell,"--gdg-bg-cell-medium":e.bgCellMedium,"--gdg-bg-header":e.bgHeader,"--gdg-bg-header-has-focus":e.bgHeaderHasFocus,"--gdg-bg-header-hovered":e.bgHeaderHovered,"--gdg-bg-bubble":e.bgBubble,"--gdg-bg-bubble-selected":e.bgBubbleSelected,"--gdg-bubble-height":`${e.bubbleHeight}px`,"--gdg-bubble-padding":`${e.bubblePadding}px`,"--gdg-bubble-margin":`${e.bubbleMargin}px`,"--gdg-bg-search-result":e.bgSearchResult,"--gdg-border-color":e.borderColor,"--gdg-horizontal-border-color":e.horizontalBorderColor??e.borderColor,"--gdg-drilldown-border":e.drilldownBorder,"--gdg-link-color":e.linkColor,"--gdg-cell-horizontal-padding":`${e.cellHorizontalPadding}px`,"--gdg-cell-vertical-padding":`${e.cellVerticalPadding}px`,"--gdg-header-font-style":e.headerFontStyle,"--gdg-base-font-style":e.baseFontStyle,"--gdg-marker-font-style":e.markerFontStyle,"--gdg-font-family":e.fontFamily,"--gdg-editor-font-size":e.editorFontSize,"--gdg-checkbox-max-size":`${e.checkboxMaxSize}px`,...e.resizeIndicatorColor===void 0?{}:{"--gdg-resize-indicator-color":e.resizeIndicatorColor},...e.headerBottomBorderColor===void 0?{}:{"--gdg-header-bottom-border-color":e.headerBottomBorderColor},...e.roundingRadius===void 0?{}:{"--gdg-rounding-radius":`${e.roundingRadius}px`}}}const yd={accentColor:"#4F5DFF",accentFg:"#FFFFFF",accentLight:"rgba(62, 116, 253, 0.1)",textDark:"#313139",textMedium:"#737383",textLight:"#B2B2C0",textBubble:"#313139",bgIconHeader:"#737383",fgIconHeader:"#FFFFFF",textHeader:"#313139",textGroupHeader:"#313139BB",textHeaderSelected:"#FFFFFF",bgCell:"#FFFFFF",bgCellMedium:"#FAFAFB",bgHeader:"#F7F7F8",bgHeaderHasFocus:"#E9E9EB",bgHeaderHovered:"#EFEFF1",bgBubble:"#EDEDF3",bgBubbleSelected:"#FFFFFF",bubbleHeight:20,bubblePadding:6,bubbleMargin:4,bgSearchResult:"#fff9e3",borderColor:"rgba(115, 116, 131, 0.16)",drilldownBorder:"rgba(0, 0, 0, 0)",linkColor:"#353fb5",cellHorizontalPadding:8,cellVerticalPadding:3,headerIconSize:18,headerFontStyle:"600 13px",baseFontStyle:"13px",markerFontStyle:"9px",fontFamily:"Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif",editorFontSize:"13px",lineHeight:1.4,checkboxMaxSize:18};function Cd(){return yd}const Sd=Vt.createContext(yd);function Jm(){return Vt.useContext(Sd)}function or(e,...t){const n={...e};for(const r of t)if(r!==void 0)for(const i in r)r.hasOwnProperty(i)&&(i==="bgCell"?n[i]=On(r[i],n[i]):n[i]=r[i]);return(n.headerFontFull===void 0||e.fontFamily!==n.fontFamily||e.headerFontStyle!==n.headerFontStyle)&&(n.headerFontFull=`${n.headerFontStyle} ${n.fontFamily}`),(n.baseFontFull===void 0||e.fontFamily!==n.fontFamily||e.baseFontStyle!==n.baseFontStyle)&&(n.baseFontFull=`${n.baseFontStyle} ${n.fontFamily}`),(n.markerFontFull===void 0||e.fontFamily!==n.fontFamily||e.markerFontStyle!==n.markerFontStyle)&&(n.markerFontFull=`${n.markerFontStyle} ${n.fontFamily}`),n}const Es=150;function Qm(e,t,n,r){return r(t)?.measure?.(e,t,n)??Es}function xd(e,t,n,r,i,o,s,a,l){let u=0;const c=i===void 0?[]:i.map(h=>{const m=Qm(e,h[r],t,l);return u=Math.max(u,m),m});if(c.length>5&&a){u=0;let h=0;for(const p of c)h+=p;const m=h/c.length;for(let p=0;p<c.length;p++)c[p]>=m*2?c[p]=0:u=Math.max(u,c[p])}const d=e.font;e.font=t.headerFontFull,u=Math.max(u,e.measureText(n.title).width+t.cellHorizontalPadding*2+(n.icon===void 0?0:28)),e.font=d;const g=Math.max(Math.ceil(o),Math.min(Math.floor(s),Math.ceil(u)));return{...n,width:g}}function ep(e,t,n,r,i,o,s,a,l){const u=f.useRef(t),c=f.useRef(n),d=f.useRef(s);u.current=t,c.current=n,d.current=s;const[g,h]=f.useMemo(()=>{if(typeof window>"u")return[null,null];const v=document.createElement("canvas");return v.style.display="none",v.style.opacity="0",v.style.position="fixed",[v,v.getContext("2d",{alpha:!1})]},[]);f.useLayoutEffect(()=>(g&&document.documentElement.append(g),()=>{g?.remove()}),[g]);const m=f.useRef({}),p=f.useRef(),[y,b]=f.useState();return f.useLayoutEffect(()=>{const v=c.current;if(v===void 0||e.every(_o))return;let S=Math.max(1,10-Math.floor(e.length/1e4)),O=0;S<u.current&&S>1&&(S--,O=1);const M={x:0,y:0,width:e.length,height:Math.min(u.current,S)},R={x:0,y:u.current-1,width:e.length,height:1};(async()=>{const I=v(M,l.signal),k=O>0?v(R,l.signal):void 0;let F;typeof I=="object"?F=I:F=await Hl(I),k!==void 0&&(typeof k=="object"?F=[...F,...k]:F=[...F,...await Hl(k)]),p.current=e,b(F)})()},[l.signal,e]),f.useMemo(()=>{let S=e.every(_o)?e:h===null?e.map(_=>_o(_)?_:{..._,width:Es}):(h.font=d.current.baseFontFull,e.map((_,I)=>{if(_o(_))return _;if(m.current[_.id]!==void 0)return{..._,width:m.current[_.id]};if(y===void 0||p.current!==e||_.id===void 0)return{..._,width:Es};const k=xd(h,s,_,I,y,i,o,!0,a);return m.current[_.id]=k.width,k})),O=0,M=0;const R=[];for(const[_,I]of S.entries())O+=I.width,I.grow!==void 0&&I.grow>0&&(M+=I.grow,R.push(_));if(O<r&&R.length>0){const _=[...S],I=r-O;let k=I;for(let F=0;F<R.length;F++){const D=R[F],C=(S[D].grow??0)/M,E=F===R.length-1?k:Math.min(k,Math.floor(I*C));_[D]={...S[D],growOffset:E,width:S[D].width+E},k-=E}S=_}return{sizedColumns:S,nonGrowWidth:O}},[r,e,h,y,s,i,o,a])}var es,mu;function tp(){if(mu)return es;mu=1;function e(t,n,r){return t===t&&(r!==void 0&&(t=t<=r?t:r),n!==void 0&&(t=t>=n?t:n)),t}return es=e,es}var ts,pu;function np(){if(pu)return ts;pu=1;var e=tp(),t=Dc();function n(r,i,o){return o===void 0&&(o=i,i=void 0),o!==void 0&&(o=t(o),o=o===o?o:0),i!==void 0&&(i=t(i),i=i===i?i:0),e(t(r),i,o)}return ts=n,ts}var rp=np();const Ln=sr(rp);var ns,vu;function ip(){if(vu)return ns;vu=1;function e(){}return ns=e,ns}var rs,bu;function op(){if(bu)return rs;bu=1;var e=ph(),t=ip(),n=Oc(),r=1/0,i=e&&1/n(new e([,-0]))[1]==r?function(o){return new e(o)}:t;return rs=i,rs}var is,wu;function ap(){if(wu)return is;wu=1;var e=vh(),t=bh(),n=yh(),r=wh(),i=op(),o=Oc(),s=200;function a(l,u,c){var d=-1,g=t,h=l.length,m=!0,p=[],y=p;if(c)m=!1,g=n;else if(h>=s){var b=u?null:i(l);if(b)return o(b);m=!1,g=r,y=new e}else y=u?[]:p;e:for(;++d<h;){var v=l[d],S=u?u(v):v;if(v=c||v!==0?v:0,m&&S===S){for(var O=y.length;O--;)if(y[O]===S)continue e;u&&y.push(S),p.push(v)}else g(y,S,c)||(y!==p&&y.push(S),p.push(v))}return p}return is=a,is}var os,yu;function sp(){if(yu)return os;yu=1;var e=ap();function t(n){return n&&n.length?e(n):[]}return os=t,os}var lp=sp();const up=sr(lp);var cp=Ch();const Cu=sr(cp),$t='<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">',dp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
51
|
+
${$t}<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/><path d="M15.75 4h-1.5a.25.25 0 0 0-.177.074L9.308 8.838a3.75 3.75 0 1 0 1.854 1.854l1.155-1.157.967.322a.5.5 0 0 0 .65-.55l-.18-1.208.363-.363.727.331a.5.5 0 0 0 .69-.59l-.254-.904.647-.647A.25.25 0 0 0 16 5.75v-1.5a.25.25 0 0 0-.25-.25zM7.5 13.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0z" fill="${t}"/></svg>`},fp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
52
|
+
${$t}<rect x="2" y="2" width="16" height="16" rx="4" fill="${n}"/><path d="m12.223 13.314 3.052-2.826a.65.65 0 0 0 0-.984l-3.052-2.822c-.27-.25-.634-.242-.865.022-.232.263-.206.636.056.882l2.601 2.41-2.601 2.41c-.262.245-.288.619-.056.882.231.263.595.277.865.026Zm-4.444.005c.266.25.634.241.866-.027.231-.263.206-.636-.06-.882L5.983 10l2.602-2.405c.266-.25.291-.62.06-.887-.232-.263-.596-.272-.866-.022L4.723 9.51a.653.653 0 0 0 0 .983l3.056 2.827Z" fill="${t}"/></svg>`},hp=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
53
53
|
<path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
|
54
54
|
<path d="M6.52 12.78H5.51V8.74l-1.33.47v-.87l2.29-.83h.05v5.27zm5.2 0H8.15v-.69l1.7-1.83a6.38 6.38 0 0 0 .34-.4c.09-.11.16-.22.22-.32s.1-.19.12-.27a.9.9 0 0 0 0-.56.63.63 0 0 0-.15-.23.58.58 0 0 0-.22-.15.75.75 0 0 0-.29-.05c-.27 0-.48.08-.62.23a.95.95 0 0 0-.2.65H8.03c0-.24.04-.46.13-.67a1.67 1.67 0 0 1 .97-.91c.23-.1.49-.14.77-.14.26 0 .5.04.7.11.21.08.38.18.52.32.14.13.25.3.32.48a1.74 1.74 0 0 1 .03 1.13 2.05 2.05 0 0 1-.24.47 4.16 4.16 0 0 1-.35.47l-.47.5-1 1.05h2.32v.8zm1.8-3.08h.55c.28 0 .48-.06.61-.2a.76.76 0 0 0 .2-.55.8.8 0 0 0-.05-.28.56.56 0 0 0-.13-.22.6.6 0 0 0-.23-.15.93.93 0 0 0-.32-.05.92.92 0 0 0-.29.05.72.72 0 0 0-.23.12.57.57 0 0 0-.21.46H12.4a1.3 1.3 0 0 1 .5-1.04c.15-.13.33-.23.54-.3a2.48 2.48 0 0 1 1.4 0c.2.06.4.15.55.28.15.13.27.28.36.47.08.19.13.4.13.65a1.15 1.15 0 0 1-.2.65 1.36 1.36 0 0 1-.58.49c.15.05.28.12.38.2a1.14 1.14 0 0 1 .43.62c.03.13.05.26.05.4 0 .25-.05.47-.14.66a1.42 1.42 0 0 1-.4.49c-.16.13-.35.23-.58.3a2.51 2.51 0 0 1-.73.1c-.22 0-.44-.03-.65-.09a1.8 1.8 0 0 1-.57-.28 1.43 1.43 0 0 1-.4-.47 1.41 1.41 0 0 1-.15-.66h1a.66.66 0 0 0 .22.5.87.87 0 0 0 .58.2c.25 0 .45-.07.6-.2a.71.71 0 0 0 .21-.56.97.97 0 0 0-.06-.36.61.61 0 0 0-.18-.25.74.74 0 0 0-.28-.15 1.33 1.33 0 0 0-.37-.04h-.55V9.7z" fill="${t}"/>
|
55
|
-
</svg>`},
|
55
|
+
</svg>`},gp=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
56
56
|
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
|
57
57
|
<path d="M8.182 12.4h3.636l.655 1.6H14l-3.454-8H9.455L6 14h1.527l.655-1.6zM10 7.44l1.36 3.651H8.64L10 7.441z" fill="${t}"/>
|
58
|
-
</svg>`},
|
58
|
+
</svg>`},mp=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
59
59
|
<path
|
60
60
|
d="M16.2222 2H3.77778C2.8 2 2 2.8 2 3.77778V16.2222C2 17.2 2.8 18 3.77778 18H16.2222C17.2 18 17.9911 17.2 17.9911 16.2222L18 3.77778C18 2.8 17.2 2 16.2222 2Z"
|
61
61
|
fill="${n}"
|
@@ -66,21 +66,21 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
|
|
66
66
|
d="M7.66667 6.66669C5.73368 6.66669 4.16667 8.15907 4.16667 10C4.16667 11.841 5.73368 13.3334 7.66667 13.3334H12.3333C14.2663 13.3334 15.8333 11.841 15.8333 10C15.8333 8.15907 14.2663 6.66669 12.3333 6.66669H7.66667ZM12.5 12.5C13.8807 12.5 15 11.3807 15 10C15 8.61931 13.8807 7.50002 12.5 7.50002C11.1193 7.50002 10 8.61931 10 10C10 11.3807 11.1193 12.5 12.5 12.5Z"
|
67
67
|
fill="${t}"
|
68
68
|
/>
|
69
|
-
</svg>`},
|
69
|
+
</svg>`},kd=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
70
70
|
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
|
71
71
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.29 4.947a3.368 3.368 0 014.723.04 3.375 3.375 0 01.041 4.729l-.009.009-1.596 1.597a3.367 3.367 0 01-5.081-.364.71.71 0 011.136-.85 1.95 1.95 0 002.942.21l1.591-1.593a1.954 1.954 0 00-.027-2.733 1.95 1.95 0 00-2.732-.027l-.91.907a.709.709 0 11-1.001-1.007l.915-.911.007-.007z" fill="${t}"/>
|
72
72
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.55 8.678a3.368 3.368 0 015.082.364.71.71 0 01-1.136.85 1.95 1.95 0 00-2.942-.21l-1.591 1.593a1.954 1.954 0 00.027 2.733 1.95 1.95 0 002.73.028l.906-.906a.709.709 0 111.003 1.004l-.91.91-.008.01a3.368 3.368 0 01-4.724-.042 3.375 3.375 0 01-.041-4.728l.009-.009L6.55 8.678z" fill="${t}"/>
|
73
73
|
</svg>
|
74
|
-
`},
|
74
|
+
`},pp=e=>{const t=e.bgColor;return`${$t}
|
75
75
|
<path stroke="${t}" stroke-width="2" d="M12 3v14"/>
|
76
76
|
<path stroke="${t}" stroke-width="2" stroke-linecap="round" d="M10 4h4m-4 12h4"/>
|
77
77
|
<path d="M11 14h4a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3h-4v2h4a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-4v2ZM9.5 8H5a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h4.5v2H5a3 3 0 0 1-3-3V9a3 3 0 0 1 3-3h4.5v2Z" fill="${t}"/>
|
78
78
|
</svg>
|
79
|
-
`},
|
79
|
+
`},vp=kd,bp=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
80
80
|
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
|
81
81
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M7 13.138a.5.5 0 00.748.434l5.492-3.138a.5.5 0 000-.868L7.748 6.427A.5.5 0 007 6.862v6.276z" fill="${t}"/>
|
82
|
-
</svg>`},
|
83
|
-
${
|
82
|
+
</svg>`},wp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
83
|
+
${$t}
|
84
84
|
<path d="M10 5a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm0 9.17A4.17 4.17 0 0 1 5.83 10 4.17 4.17 0 0 1 10 5.83 4.17 4.17 0 0 1 14.17 10 4.17 4.17 0 0 1 10 14.17z" fill="${t}"/>
|
85
85
|
<path d="M8.33 8.21a.83.83 0 1 0-.03 1.67.83.83 0 0 0 .03-1.67zm3.34 0a.83.83 0 1 0-.04 1.67.83.83 0 0 0 .04-1.67z" fill="${t}"/>
|
86
86
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.53 13.9a2.82 2.82 0 0 1-5.06 0l.77-.38a1.97 1.97 0 0 0 3.52 0l.77.39z" fill="${t}"/>
|
@@ -88,92 +88,92 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
|
|
88
88
|
<path d="M10 4a6 6 0 1 0 0 12 6 6 0 0 0 0-12zm0 11a5 5 0 1 1 .01-10.01A5 5 0 0 1 10 15z" fill="${t}"/>
|
89
89
|
<path d="M8 7.86a1 1 0 1 0-.04 2 1 1 0 0 0 .04-2zm4 0a1 1 0 1 0-.04 2 1 1 0 0 0 .04-2z" fill="${t}"/>
|
90
90
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.53 11.9a2.82 2.82 0 0 1-5.06 0l.77-.38a1.97 1.97 0 0 0 3.52 0l.77.39z" fill="${t}"/>
|
91
|
-
</svg>`},
|
91
|
+
</svg>`},yp=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
92
92
|
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
|
93
93
|
<path opacity=".5" fill-rule="evenodd" clip-rule="evenodd" d="M12.499 10.801a.5.5 0 01.835 0l2.698 4.098a.5.5 0 01-.418.775H10.22a.5.5 0 01-.417-.775l2.697-4.098z" fill="${t}"/>
|
94
94
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.07 8.934a.5.5 0 01.824 0l4.08 5.958a.5.5 0 01-.412.782h-8.16a.5.5 0 01-.413-.782l4.08-5.958zM13.75 8.333a2.083 2.083 0 100-4.166 2.083 2.083 0 000 4.166z" fill="${t}"/>
|
95
|
-
</svg>`},
|
96
|
-
${
|
95
|
+
</svg>`},Cp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
96
|
+
${$t}
|
97
97
|
<path fill="${t}" d="M3 3h14v14H3z"/>
|
98
98
|
<path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2zm-7.24 9.78h1.23c.15 0 .27.06.36.18l.98 1.28a.43.43 0 0 1-.05.58l-1.2 1.21a.45.45 0 0 1-.6.04A6.72 6.72 0 0 1 7.33 10c0-.61.1-1.2.25-1.78a6.68 6.68 0 0 1 2.12-3.3.44.44 0 0 1 .6.04l1.2 1.2c.16.17.18.42.05.59l-.98 1.29a.43.43 0 0 1-.36.17H8.98A5.38 5.38 0 0 0 8.67 10c0 .62.11 1.23.3 1.79z" fill="${n}"/>
|
99
|
-
</svg>`},
|
100
|
-
${
|
99
|
+
</svg>`},Sp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
100
|
+
${$t}
|
101
101
|
<path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
|
102
102
|
<path d="m13.49 13.15-2.32-3.27h1.4V7h1.86v2.88h1.4l-2.34 3.27zM11 13H9v-3l-1.5 1.92L6 10v3H4V7h2l1.5 2L9 7h2v6z" fill="${t}"/>
|
103
|
-
</svg>`},
|
103
|
+
</svg>`},xp=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
104
104
|
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
|
105
105
|
<path d="M14.8 4.182h-.6V3H13v1.182H7V3H5.8v1.182h-.6c-.66 0-1.2.532-1.2 1.182v9.454C4 15.468 4.54 16 5.2 16h9.6c.66 0 1.2-.532 1.2-1.182V5.364c0-.65-.54-1.182-1.2-1.182zm0 10.636H5.2V7.136h9.6v7.682z" fill="${t}"/>
|
106
|
-
</svg>`},
|
107
|
-
${
|
106
|
+
</svg>`},kp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
107
|
+
${$t}
|
108
108
|
<path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
|
109
109
|
<path d="M10 4a6 6 0 0 0-6 6 6 6 0 0 0 6 6 6 6 0 0 0 6-6 6 6 0 0 0-6-6zm0 10.8A4.8 4.8 0 0 1 5.2 10a4.8 4.8 0 1 1 4.8 4.8z" fill="${t}"/>
|
110
110
|
<path d="M10 7H9v3.93L12.5 13l.5-.8-3-1.76V7z" fill="${t}"/>
|
111
|
-
</svg>`},
|
111
|
+
</svg>`},Mp=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
112
112
|
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
113
113
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 8.643a1.357 1.357 0 100 2.714 1.357 1.357 0 000-2.714zM7.357 10a2.643 2.643 0 115.286 0 2.643 2.643 0 01-5.286 0z" fill="${t}"/>
|
114
114
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.589 4.898A5.643 5.643 0 0115.643 10v.5a2.143 2.143 0 01-4.286 0V8a.643.643 0 011.286 0v2.5a.857.857 0 001.714 0V10a4.357 4.357 0 10-1.708 3.46.643.643 0 01.782 1.02 5.643 5.643 0 11-5.842-9.582z" fill="${t}"/>
|
115
|
-
</svg>`},
|
116
|
-
${
|
115
|
+
</svg>`},Rp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
116
|
+
${$t}
|
117
117
|
<rect x="2" y="8" width="10" height="8" rx="2" fill="${n}"/>
|
118
118
|
<rect x="8" y="4" width="10" height="8" rx="2" fill="${n}"/>
|
119
119
|
<path d="M10.68 7.73V6l2.97 3.02-2.97 3.02v-1.77c-2.13 0-3.62.7-4.68 2.2.43-2.15 1.7-4.31 4.68-4.74z" fill="${t}"/>
|
120
|
-
</svg>`},
|
120
|
+
</svg>`},Ip=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
121
121
|
<path fill="${t}" d="M4 3h12v14H4z"/>
|
122
122
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.6 2A1.6 1.6 0 002 3.6v12.8A1.6 1.6 0 003.6 18h12.8a1.6 1.6 0 001.6-1.6V3.6A1.6 1.6 0 0016.4 2H3.6zm11.3 10.8a.7.7 0 01.7.7v1.4a.7.7 0 01-.7.7h-1.4a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.6-.693.117.117 0 00.1-.115V10.35a.117.117 0 00-.117-.116h-2.8a.117.117 0 00-.117.116v2.333c0 .064.053.117.117.117h.117a.7.7 0 01.7.7v1.4a.7.7 0 01-.7.7H9.3a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.7-.7h.117a.117.117 0 00.117-.117V10.35a.117.117 0 00-.117-.117h-2.8a.117.117 0 00-.117.117v2.342c0 .058.042.106.1.115a.7.7 0 01.6.693v1.4a.7.7 0 01-.7.7H5.1a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.7-.7h.35a.116.116 0 00.116-.117v-2.45c0-.515.418-.933.934-.933h2.917a.117.117 0 00.117-.117V6.85a.117.117 0 00-.117-.116h-2.45a.7.7 0 01-.7-.7V5.1a.7.7 0 01.7-.7h6.067a.7.7 0 01.7.7v.934a.7.7 0 01-.7.7h-2.45a.117.117 0 00-.118.116v2.333c0 .064.053.117.117.117H13.5c.516 0 .934.418.934.934v2.45c0 .063.052.116.116.116h.35z" fill="${n}"/>
|
123
|
-
</svg>`},
|
124
|
-
${
|
123
|
+
</svg>`},Ep=e=>{const t=e.fgColor,n=e.bgColor;return`
|
124
|
+
${$t}
|
125
125
|
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
126
126
|
<path d="M9.98 13.33c.45 0 .74-.3.73-.75l-.01-.1-.16-1.67 1.45 1.05a.81.81 0 0 0 .5.18c.37 0 .72-.32.72-.76 0-.3-.17-.54-.49-.68l-1.63-.77 1.63-.77c.32-.14.49-.37.49-.67 0-.45-.34-.76-.71-.76a.81.81 0 0 0-.5.18l-1.47 1.03.16-1.74.01-.08c.01-.46-.27-.76-.72-.76-.46 0-.76.32-.75.76l.01.08.16 1.74-1.47-1.03a.77.77 0 0 0-.5-.18.74.74 0 0 0-.72.76c0 .3.17.53.49.67l1.63.77-1.62.77c-.32.14-.5.37-.5.68 0 .44.35.75.72.75a.78.78 0 0 0 .5-.17L9.4 10.8l-.16 1.68v.09c-.02.44.28.75.74.75z" fill="${t}"/>
|
127
|
-
</svg>`},
|
128
|
-
${
|
127
|
+
</svg>`},Tp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
128
|
+
${$t}
|
129
129
|
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
130
130
|
<path d="M8 5.83H5.83a.83.83 0 0 0 0 1.67h1.69A4.55 4.55 0 0 1 8 5.83zm-.33 3.34H5.83a.83.83 0 0 0 0 1.66h2.72a4.57 4.57 0 0 1-.88-1.66zM5.83 12.5a.83.83 0 0 0 0 1.67h7.5a.83.83 0 1 0 0-1.67h-7.5zm8.8-2.9a3.02 3.02 0 0 0 .46-1.6c0-1.66-1.32-3-2.94-3C10.52 5 9.2 6.34 9.2 8s1.31 3 2.93 3c.58 0 1.11-.17 1.56-.47l2.04 2.08.93-.94-2.04-2.08zm-2.48.07c-.9 0-1.63-.75-1.63-1.67s.73-1.67 1.63-1.67c.9 0 1.63.75 1.63 1.67s-.73 1.67-1.63 1.67z" fill="${t}"/>
|
131
|
-
</svg>`},
|
131
|
+
</svg>`},Dp=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
132
132
|
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
133
133
|
<path d="M7.676 4.726V3l2.976 3.021-2.976 3.022v-1.77c-2.125 0-3.613.69-4.676 2.201.425-2.158 1.7-4.316 4.676-4.748zM10.182 14.4h3.636l.655 1.6H16l-3.454-8h-1.091L8 16h1.527l.655-1.6zM12 9.44l1.36 3.65h-2.72L12 9.44z" fill="${t}"/>
|
134
|
-
</svg>`},
|
134
|
+
</svg>`},Op=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
135
135
|
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
136
136
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.167 5.417a.833.833 0 100 1.666h4.166a.833.833 0 100-1.666H4.167z" fill="${t}"/>
|
137
137
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.083 4.167a.833.833 0 10-1.666 0v4.166a.833.833 0 101.666 0V4.167zM11.667 5.417a.833.833 0 100 1.666h4.166a.833.833 0 100-1.666h-4.166zM5.367 11.688a.833.833 0 00-1.179 1.179l2.947 2.946a.833.833 0 001.178-1.178l-2.946-2.947z" fill="${t}"/>
|
138
138
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.313 12.867a.833.833 0 10-1.178-1.179l-2.947 2.947a.833.833 0 101.179 1.178l2.946-2.946z" fill="${t}"/>
|
139
139
|
<path d="M10.833 12.5c0-.46.373-.833.834-.833h4.166a.833.833 0 110 1.666h-4.166a.833.833 0 01-.834-.833zM10.833 15c0-.46.373-.833.834-.833h4.166a.833.833 0 110 1.666h-4.166a.833.833 0 01-.834-.833z" fill="${t}"/>
|
140
|
-
</svg>`},
|
141
|
-
${
|
140
|
+
</svg>`},Pp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
141
|
+
${$t}
|
142
142
|
<path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
|
143
143
|
<path d="M10 8.84a1.16 1.16 0 1 0 0 2.32 1.16 1.16 0 0 0 0-2.32zm3.02 3.61a3.92 3.92 0 0 0 .78-3.28.49.49 0 1 0-.95.2c.19.87-.02 1.78-.58 2.47a2.92 2.92 0 1 1-4.13-4.08 2.94 2.94 0 0 1 2.43-.62.49.49 0 1 0 .17-.96 3.89 3.89 0 1 0 2.28 6.27zM10 4.17a5.84 5.84 0 0 0-5.44 7.93.49.49 0 1 0 .9-.35 4.86 4.86 0 1 1 2.5 2.67.49.49 0 1 0-.4.88c.76.35 1.6.54 2.44.53a5.83 5.83 0 0 0 0-11.66zm3.02 3.5a.7.7 0 1 0-1.4 0 .7.7 0 0 0 1.4 0zm-6.97 5.35a.7.7 0 1 1 0 1.4.7.7 0 0 1 0-1.4z" fill="${t}"/>
|
144
|
-
</svg>`},
|
144
|
+
</svg>`},_p=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
145
145
|
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
146
146
|
<path d="M12.4 13.565c1.865-.545 3.645-2.083 3.645-4.396 0-1.514-.787-2.604-2.071-2.604C12.69 6.565 12 7.63 12 8.939c1.114.072 1.865.726 1.865 1.683 0 .933-.8 1.647-1.84 2.023l.375.92zM4 5h6v2H4zM4 9h5v2H4zM4 13h4v2H4z" fill="${t}"/>
|
147
|
-
</svg>`},
|
148
|
-
${
|
147
|
+
</svg>`},Fp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
148
|
+
${$t}
|
149
149
|
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
150
150
|
<path d="M12.4 13.56c1.86-.54 3.65-2.08 3.65-4.4 0-1.5-.8-2.6-2.08-2.6S12 7.64 12 8.95c1.11.07 1.86.73 1.86 1.68 0 .94-.8 1.65-1.83 2.03l.37.91zM4 5h6v2H4zm0 4h5v2H4zm0 4h4v2H4z" fill="${t}"/>
|
151
|
-
</svg>`},
|
151
|
+
</svg>`},Lp=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
152
152
|
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
|
153
153
|
<path d="M10 7a1 1 0 100-2v2zm0 6a1 1 0 100 2v-2zm0-8H7v2h3V5zm-3 6h5V9H7v2zm5 2h-2v2h2v-2zm1-1a1 1 0 01-1 1v2a3 3 0 003-3h-2zm-1-1a1 1 0 011 1h2a3 3 0 00-3-3v2zM4 8a3 3 0 003 3V9a1 1 0 01-1-1H4zm3-3a3 3 0 00-3 3h2a1 1 0 011-1V5z" fill="${t}"/>
|
154
154
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.856 12.014a.5.5 0 00-.712.702L5.409 14l-1.265 1.284a.5.5 0 00.712.702l1.255-1.274 1.255 1.274a.5.5 0 00.712-.702L6.813 14l1.265-1.284a.5.5 0 00-.712-.702L6.11 13.288l-1.255-1.274zM12.856 4.014a.5.5 0 00-.712.702L13.409 6l-1.265 1.284a.5.5 0 10.712.702l1.255-1.274 1.255 1.274a.5.5 0 10.712-.702L14.813 6l1.265-1.284a.5.5 0 00-.712-.702L14.11 5.288l-1.255-1.274z" fill="${t}"/>
|
155
|
-
</svg>`},
|
155
|
+
</svg>`},Ap=e=>{const t=e.fgColor,n=e.bgColor;return`${$t}
|
156
156
|
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
157
157
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.25 7.25a.75.75 0 000-1.5h-6.5a.75.75 0 100 1.5h6.5zM15 10a.75.75 0 01-.75.75h-6.5a.75.75 0 010-1.5h6.5A.75.75 0 0115 10zm-.75 4.25a.75.75 0 000-1.5h-6.5a.75.75 0 000 1.5h6.5zm-8.987-7a.75.75 0 100-1.5.75.75 0 000 1.5zm.75 2.75a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm-.75 4.25a.75.75 0 100-1.5.75.75 0 000 1.5z" fill="${t}"/>
|
158
|
-
</svg>`},
|
158
|
+
</svg>`},Hp=e=>{const t=e.fgColor;return`
|
159
159
|
<svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
160
160
|
<path d="M2 15v1h14v-2.5c0-.87-.44-1.55-.98-2.04a6.19 6.19 0 0 0-1.9-1.14 12.1 12.1 0 0 0-2.48-.67A4 4 0 1 0 5 6a4 4 0 0 0 2.36 3.65c-.82.13-1.7.36-2.48.67-.69.28-1.37.65-1.9 1.13A2.8 2.8 0 0 0 2 13.5V15z" fill="${e.bgColor}" stroke="${t}" stroke-width="2"/>
|
161
|
-
</svg>`},
|
161
|
+
</svg>`},zp=e=>{const t=e.fgColor;return`
|
162
162
|
<svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
163
163
|
<path d="M12.43 6.04v-.18a3.86 3.86 0 0 0-7.72 0v.18A2.15 2.15 0 0 0 3 8.14v5.72C3 15.04 3.96 16 5.14 16H12c1.18 0 2.14-.96 2.14-2.14V8.14c0-1.03-.73-1.9-1.71-2.1zM7.86 6v-.14a.71.71 0 1 1 1.43 0V6H7.86z" fill="${e.bgColor}" stroke="${t}" stroke-width="2"/>
|
164
164
|
</svg>
|
165
|
-
`},Ap={headerRowID:lp,headerNumber:cp,headerCode:up,headerString:dp,headerBoolean:fp,headerAudioUri:gp,headerVideoUri:mp,headerEmoji:pp,headerImage:vp,headerUri:xd,headerPhone:bp,headerMarkdown:wp,headerDate:yp,headerTime:Cp,headerEmail:Sp,headerReference:xp,headerIfThenElse:kp,headerSingleValue:Mp,headerLookup:Rp,headerTextTemplate:Ep,headerMath:Ip,headerRollup:Tp,headerJoinStrings:Dp,headerSplitString:Op,headerGeoDistance:Pp,headerArray:_p,rowOwnerOverlay:Fp,protectedColumnOverlay:Lp,renameIcon:hp};function Hp(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}class zp{onSettled;spriteMap=new Map;headerIcons;inFlight=0;constructor(t,n){this.onSettled=n,this.headerIcons=t??{}}drawSprite(t,n,r,i,o,s,a,l=1){const[u,c]=Hp(n,a),d=s*Math.ceil(window.devicePixelRatio),g=`${u}_${c}_${d}_${t}`;let h=this.spriteMap.get(g);if(h===void 0){const m=this.headerIcons[t];if(m===void 0)return;h=document.createElement("canvas");const p=h.getContext("2d");if(p===null)return;const y=new Image;y.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m({fgColor:c,bgColor:u}))}`,this.spriteMap.set(g,h);const b=y.decode();if(b===void 0)return;this.inFlight++,b.then(()=>{p.drawImage(y,0,0,d,d)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else l<1&&(r.globalAlpha=l),r.drawImage(h,0,0,d,d,i,o,s,s),l<1&&(r.globalAlpha=1)}}function kd(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y)}function wa(e,t,n,r,i,o,s,a,l){a=a??t;let u=t,c=e;const d=r-o;let g=!1;for(;u<n&&c<d;){const h=i(c);if(u+h>a&&l(u,c,h,!1,s&&c===r-1)===!0){g=!0;break}u+=h,c++}if(!g){u=n;for(let h=0;h<o;h++){c=r-1-h;const m=i(c);u-=m,l(u,c,m,!0,s&&c===r-1)}}}function Mr(e,t,n,r,i,o){let s=0,a=0;const l=i+r;for(const u of e){const c=u.sticky?a:s+n;if(o(u,c,l,u.sticky?0:a,t)===!0)break;s+=u.width,a+=u.sticky?u.width:0}}function Md(e,t,n,r,i){let o=0,s=0;for(let a=0;a<e.length;a++){const l=e[a];let u=a+1,c=l.width;for(l.sticky&&(s+=c);u<e.length&&no(e[u].group,l.group)&&e[u].sticky===e[a].sticky;){const p=e[u];c+=p.width,u++,a++,p.sticky&&(s+=p.width)}const d=l.sticky?0:n,g=o+d,h=l.sticky?0:Math.max(0,s-g),m=Math.min(c-h,t-(g+h));i([l.sourceIndex,e[u-1].sourceIndex],l.group??"",g+h,0,m,r),o+=c}}function Rd(e,t,n,r,i,o,s){const[a,l]=e;let u,c;const d=s.find(g=>!g.sticky)?.sourceIndex??0;if(l>d){const g=Math.max(a,d);let h=t,m=r;for(let p=o.sourceIndex-1;p>=g;p--)h-=s[p].width,m+=s[p].width;for(let p=o.sourceIndex+1;p<=l;p++)m+=s[p].width;c={x:h,y:n,width:m,height:i}}if(d>a){const g=Math.min(l,d-1);let h=t,m=r;for(let p=o.sourceIndex-1;p>=a;p--)h-=s[p].width,m+=s[p].width;for(let p=o.sourceIndex+1;p<=g;p++)m+=s[p].width;u={x:h,y:n,width:m,height:i}}return[u,c]}function Vp(e,t,n,r){if(r==="any")return Ed(e,{x:t,y:n,width:1,height:1});if(r==="vertical"&&(t=e.x),r==="horizontal"&&(n=e.y),dd([t,n],e))return;const i=t-e.x,o=e.x+e.width-t,s=n-e.y+1,a=e.y+e.height-n,l=Math.min(r==="vertical"?Number.MAX_SAFE_INTEGER:i,r==="vertical"?Number.MAX_SAFE_INTEGER:o,r==="horizontal"?Number.MAX_SAFE_INTEGER:s,r==="horizontal"?Number.MAX_SAFE_INTEGER:a);return l===a?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:l===s?{x:e.x,y:n,width:e.width,height:e.y-n}:l===o?{x:e.x+e.width,y:e.y,width:t-e.x-e.width+1,height:e.height}:{x:t,y:e.y,width:e.x-t,height:e.height}}function ro(e,t,n,r,i,o,s,a){return e<=i+s&&i<=e+n&&t<=o+a&&o<=t+r}function Vr(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Ed(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y),i=Math.max(e.x+e.width,t.x+t.width)-n,o=Math.max(e.y+e.height,t.y+t.height)-r;return{x:n,y:r,width:i,height:o}}function Np(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function $p(e,t,n,r){if(e.x>t||e.y>n||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>n)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=n)return e;const i=-4,o=-4,s=t+4,a=n+4,l=i-e.x,u=e.x+e.width-s,c=o-e.y,d=e.y+e.height-a,g=l>0?e.x+Math.floor(l/r)*r:e.x,h=u>0?e.x+e.width-Math.floor(u/r)*r:e.x+e.width,m=c>0?e.y+Math.floor(c/r)*r:e.y,p=d>0?e.y+e.height-Math.floor(d/r)*r:e.y+e.height;return{x:g,y:m,width:h-g,height:p-m}}function Bp(e,t,n,r,i){const[o,s,a,l]=t,[u,c,d,g]=i,{x:h,y:m,width:p,height:y}=e,b=[];if(p<=0||y<=0)return b;const v=h+p,S=m+y,O=h<o,R=m<s,M=h+p>a,_=m+y>l,E=h>=o&&h<a||v>o&&v<=a||h<o&&v>a,k=m>=s&&m<l||S>s&&S<=l||m<s&&S>l;if(E&&k){const D=Math.max(h,o),C=Math.max(m,s),I=Math.min(v,a),T=Math.min(S,l);b.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:u,y:c,width:d-u+1,height:g-c+1}})}if(O&&R){const D=h,C=m,I=Math.min(v,o),T=Math.min(S,s);b.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:0,y:0,width:u+1,height:c+1}})}if(R&&E){const D=Math.max(h,o),C=m,I=Math.min(v,a),T=Math.min(S,s);b.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:u,y:0,width:d-u+1,height:c+1}})}if(R&&M){const D=Math.max(h,a),C=m,I=v,T=Math.min(S,s);b.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:d,y:0,width:n-d+1,height:c+1}})}if(O&&k){const D=h,C=Math.max(m,s),I=Math.min(v,o),T=Math.min(S,l);b.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:0,y:c,width:u+1,height:g-c+1}})}if(M&&k){const D=Math.max(h,a),C=Math.max(m,s),I=v,T=Math.min(S,l);b.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:d,y:c,width:n-d+1,height:g-c+1}})}if(O&&_){const D=h,C=Math.max(m,l),I=Math.min(v,o),T=S;b.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:0,y:g,width:u+1,height:r-g+1}})}if(_&&E){const D=Math.max(h,o),C=Math.max(m,l),I=Math.min(v,a),T=S;b.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:u,y:g,width:d-u+1,height:r-g+1}})}if(M&&_){const D=Math.max(h,a),C=Math.max(m,l),I=v,T=S;b.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:d,y:g,width:n-d+1,height:r-g+1}})}return b}const Wp={kind:J.Loading,allowOverlay:!1};function Su(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m,p,y,b,v,S,O,R,M,_,E,k,F,D,C,I,T,x,$,G,X){let ie=S?.size??Number.MAX_SAFE_INTEGER;const ee=performance.now();let Q=I.baseFontFull;e.font=Q;const te={ctx:e},se=[0,0],ue=y>0?Ur(l,y,u):0;let fe,re;const H=kd(v);return Mr(t,a,o,s,i,(P,Y,ce,he,ke)=>{const Se=Math.max(0,he-Y),Je=Y+Se,Ie=i+1,Qe=P.width-Se,kt=r-i-1;if(v.length>0){let Pe=!1;for(let Te=0;Te<v.length;Te++){const st=v[Te];if(ro(Je,Ie,Qe,kt,st.x,st.y,st.width,st.height)){Pe=!0;break}}if(!Pe)return}const $e=()=>{e.save(),e.beginPath(),e.rect(Je,Ie,Qe,kt),e.clip()},ne=O.columns.hasIndex(P.sourceIndex),me=d(P.group??"").overrideTheme,xe=P.themeOverride===void 0&&me===void 0?I:ir(I,me,P.themeOverride),de=xe.baseFontFull;de!==Q&&(Q=de,e.font=de),$e();let be;return wa(ke,ce,r,l,u,y,b,H,(Pe,Te,st,Re,qe)=>{if(Te<0||(se[0]=P.sourceIndex,se[1]=Te,S!==void 0&&!S.has(se)))return;if(v.length>0){let De=!1;for(let It=0;It<v.length;It++){const Pt=v[It];if(ro(Y,Pe,P.width,st,Pt.x,Pt.y,Pt.width,Pt.height)){De=!0;break}}if(!De)return}const He=O.rows.hasIndex(Te),we=h.hasIndex(Te),Be=Te<l?c(se):Wp;let mt=Y,ft=P.width,Ge=!1,yt=!1;if(Be.span!==void 0){const[De,It]=Be.span,Pt=`${Te},${De},${It},${P.sticky}`;if(re===void 0&&(re=new Set),re.has(Pt)){ie--;return}else{const wn=Rd(Be.span,Y,Pe,P.width,st,P,n),jt=P.sticky?wn[0]:wn[1];if(!P.sticky&&wn[0]!==void 0&&(yt=!0),jt!==void 0){mt=jt.x,ft=jt.width,re.add(Pt),e.restore(),be=void 0,e.save(),e.beginPath();const dn=Math.max(0,he-jt.x);e.rect(jt.x+dn,Pe,jt.width-dn,st),fe===void 0&&(fe=[]),fe.push({x:jt.x+dn,y:Pe,width:jt.width-dn,height:st}),e.clip(),Ge=!0}}}const Yt=g?.(Te),Ht=qe&&P.trailingRowOptions?.themeOverride!==void 0?P.trailingRowOptions?.themeOverride:void 0,Mt=Be.themeOverride===void 0&&Yt===void 0&&Ht===void 0?xe:ir(xe,Yt,Ht,Be.themeOverride);e.beginPath();const nn=Lm(se,Be,O);let qt=Am(se,Be,O,p);const cn=Be.span!==void 0&&O.columns.some(De=>Be.span!==void 0&&De>=Be.span[0]&&De<=Be.span[1]);nn&&!m&&p?qt=0:nn&&p&&(qt=Math.max(qt,1)),cn&&qt++,nn||(He&&qt++,ne&&!qe&&qt++);const Ot=Be.kind===J.Protected?Mt.bgCellMedium:Mt.bgCell;let ut;if((Re||Ot!==I.bgCell)&&(ut=On(Ot,ut)),qt>0||we){we&&(ut=On(Mt.bgHeader,ut));for(let De=0;De<qt;De++)ut=On(Mt.accentLight,ut)}else if(R!==void 0){for(const De of R)if(De[0]===P.sourceIndex&&De[1]===Te){ut=On(Mt.bgSearchResult,ut);break}}if(M!==void 0)for(let De=0;De<M.length;De++){const It=M[De],Pt=It.range;It.style!=="solid-outline"&&Pt.x<=P.sourceIndex&&P.sourceIndex<Pt.x+Pt.width&&Pt.y<=Te&&Te<Pt.y+Pt.height&&(ut=On(It.color,ut))}let tn=!1;if(S!==void 0){const De=Pe+1,Pt=(Re?De+st-1:Math.min(De+st-1,r-ue))-De;(Pt!==st-1||mt+1<=he)&&(tn=!0,e.save(),e.beginPath(),e.rect(mt+1,De,ft-1,Pt),e.clip()),ut=ut===void 0?Mt.bgCell:On(ut,Mt.bgCell)}const Ct=P.sourceIndex===n.length-1,rn=Te===l-1;ut!==void 0&&(e.fillStyle=ut,be!==void 0&&(be.fillStyle=ut),S!==void 0?e.fillRect(mt+1,Pe+1,ft-(Ct?2:1),st-(rn?2:1)):e.fillRect(mt,Pe,ft,st)),Be.style==="faded"&&(e.globalAlpha=.6);let Bt;for(let De=0;De<k.length;De++){const It=k[De];if(It.item[0]===P.sourceIndex&&It.item[1]===Te){Bt=It;break}}if(ft>X&&!yt){const De=Mt.baseFontFull;De!==Q&&(e.font=De,Q=De),be=Id(e,Be,P.sourceIndex,Te,Ct,rn,mt,Pe,ft,st,qt>0,Mt,ut??Mt.bgCell,_,E,Bt?.hoverAmount??0,F,C,ee,D,be,T,x,$,G)}return tn&&e.restore(),Be.style==="faded"&&(e.globalAlpha=1),ie--,Ge&&(e.restore(),be?.deprep?.(te),be=void 0,$e(),Q=de,e.font=de),ie<=0}),e.restore(),ie<=0}),fe}const Bi=[0,0],Wi={x:0,y:0,width:0,height:0},os=[void 0,()=>{}];let Is=!1;function Up(){Is=!0}function Id(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m,p,y,b,v,S,O,R,M,_,E){let k,F;y!==void 0&&y[0][0]===n&&y[0][1]===r&&(k=y[1][0],F=y[1][1]);let D;Bi[0]=n,Bi[1]=r,Wi.x=s,Wi.y=a,Wi.width=l,Wi.height=u,os[0]=M.getValue(Bi),os[1]=x=>M.setValue(Bi,x),Is=!1;const C={ctx:e,theme:d,col:n,row:r,cell:t,rect:Wi,highlighted:c,cellFillColor:g,hoverAmount:p,frameTime:v,hoverX:k,drawState:os,hoverY:F,imageLoader:h,spriteManager:m,hyperWrapping:b,overrideCursor:k!==void 0?E:void 0,requestAnimationFrame:Up},I=Bm(C,t.lastUpdated,v,O,i,o),T=_(t);if(T!==void 0){O?.renderer!==T&&(O?.deprep?.(C),O=void 0);const x=T.drawPrep?.(C,O);S!==void 0&&!di(C.cell)?S(C,()=>T.draw(C,t)):T.draw(C,t),D=x===void 0?void 0:{deprep:x?.deprep,fillStyle:x?.fillStyle,font:x?.font,renderer:T}}return(I||Is)&&R?.(Bi),D}function Zs(e,t,n,r,i,o,s,a,l=-20,u=-20,c=void 0,d="center",g="square"){const h=Math.floor(i+s/2),m=g==="circle"?1e4:t.roundingRadius??4;let p=td(c??t.checkboxMaxSize,s,t.cellVerticalPadding),y=p/2;const b=ed(d,r,o,t.cellHorizontalPadding,p),v=Qc(b,h,p),S=nd(r+l,i+u,v);switch(n){case!0:{e.beginPath(),Kn(e,b-p/2,h-p/2,p,p,m),g==="circle"&&(y*=.8,p*=.8),e.fillStyle=a?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(b-y+p/4.23,h-y+p/1.97),e.lineTo(b-y+p/2.42,h-y+p/1.44),e.lineTo(b-y+p/1.29,h-y+p/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case ta:case!1:{e.beginPath(),Kn(e,b-p/2+.5,h-p/2+.5,p-1,p-1,m),e.lineWidth=1,e.strokeStyle=S?t.textDark:t.textMedium,e.stroke();break}case Vs:{e.beginPath(),Kn(e,b-p/2,h-p/2,p,p,m),e.fillStyle=S?t.textMedium:t.textLight,e.fill(),g==="circle"&&(y*=.8,p*=.8),e.beginPath(),e.moveTo(b-p/3,h),e.lineTo(b+p/3,h),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:to()}}function qp(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m,p,y,b,v){const S=s+a;if(S<=0)return;e.fillStyle=d.bgHeader,e.fillRect(0,0,i,S);const O=r?.[0]?.[0],R=r?.[0]?.[1],M=r?.[1]?.[0],_=r?.[1]?.[1],E=d.headerFontFull;e.font=E,Mr(t,0,o,0,S,(k,F,D,C)=>{if(y!==void 0&&!y.has([k.sourceIndex,-1]))return;const I=Math.max(0,C-F);e.save(),e.beginPath(),e.rect(F+I,a,k.width-I,s),e.clip();const T=p(k.group??"").overrideTheme,x=k.themeOverride===void 0&&T===void 0?d:ir(d,T,k.themeOverride);x.bgHeader!==d.bgHeader&&(e.fillStyle=x.bgHeader,e.fill()),x!==d&&(e.font=x.headerFontFull);const $=c.columns.hasIndex(k.sourceIndex),G=l!==void 0||u||k.headerRowMarkerDisabled===!0,X=!G&&R===-1&&O===k.sourceIndex,ie=G?0:h.find(ue=>ue.item[0]===k.sourceIndex&&ue.item[1]===-1)?.hoverAmount??0,ee=c?.current!==void 0&&c.current.cell[0]===k.sourceIndex,Q=$?x.accentColor:ee?x.bgHeaderHasFocus:x.bgHeader,te=n?a:0,se=k.sourceIndex===0?0:1;$?(e.fillStyle=Q,e.fillRect(F+se,te,k.width-se,s)):(ee||ie>0)&&(e.beginPath(),e.rect(F+se,te,k.width-se,s),ee&&(e.fillStyle=x.bgHeaderHasFocus,e.fill()),ie>0&&(e.globalAlpha=ie,e.fillStyle=x.bgHeaderHovered,e.fill(),e.globalAlpha=1)),Od(e,F,te,k.width,s,k,$,x,X,X?M:void 0,X?_:void 0,ee,ie,g,b,v),e.restore()}),n&&Gp(e,t,i,o,a,r,d,g,h,m,p,y)}function Gp(e,t,n,r,i,o,s,a,l,u,c,d){const[h,m]=o?.[0]??[];let p=0;Md(t,n,r,i,(y,b,v,S,O,R)=>{if(d!==void 0&&!d.hasItemInRectangle({x:y[0],y:-2,width:y[1]-y[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(v,S,O,R),e.clip();const M=c(b),_=M?.overrideTheme===void 0?s:ir(s,M.overrideTheme),E=m===-2&&h!==void 0&&h>=y[0]&&h<=y[1],k=E?_.bgGroupHeaderHovered??_.bgHeaderHovered:_.bgGroupHeader??_.bgHeader;if(k!==s.bgHeader&&(e.fillStyle=k,e.fill()),e.fillStyle=_.textGroupHeader??_.textHeader,M!==void 0){let F=v;if(M.icon!==void 0&&(a.drawSprite(M.icon,"normal",e,F+8,(i-20)/2,20,_),F+=26),e.fillText(M.name,F+8,i/2+Zn(e,s.headerFontFull)),M.actions!==void 0&&E){const D=Td({x:v,y:S,width:O,height:R},M.actions);e.beginPath();const C=D[0].x-10,I=v+O-C;e.rect(C,0,I,i);const T=e.createLinearGradient(C,0,C+I,0),x=Nr(k,0);T.addColorStop(0,x),T.addColorStop(10/I,k),T.addColorStop(1,k),e.fillStyle=T,e.fill(),e.globalAlpha=.6;const[$,G]=o?.[1]??[-1,-1];for(let X=0;X<M.actions.length;X++){const ie=M.actions[X],ee=D[X],Q=Vr(ee,$+v,G);Q&&(e.globalAlpha=1),a.drawSprite(ie.icon,"normal",e,ee.x+ee.width/2-10,ee.y+ee.height/2-10,20,_),Q&&(e.globalAlpha=.6)}e.globalAlpha=1}}v!==0&&u(y[0])&&(e.beginPath(),e.moveTo(v+.5,0),e.lineTo(v+.5,i),e.strokeStyle=s.borderColor,e.lineWidth=1,e.stroke()),e.restore(),p=v+O}),e.beginPath(),e.moveTo(p+.5,0),e.lineTo(p+.5,i),e.moveTo(0,i+.5),e.lineTo(n,i+.5),e.strokeStyle=s.borderColor,e.lineWidth=1,e.stroke()}const zo=30;function Yp(e,t,n,r,i){return{x:e+n-zo,y:Math.max(t,t+r/2-zo/2),width:zo,height:Math.min(zo,r)}}function Td(e,t){const n=[];let r=e.x+e.width-26*t.length;const i=e.y+e.height/2-13,o=26,s=26;for(let a=0;a<t.length;a++)n.push({x:r,y:i,width:s,height:o}),r+=26;return n}function Ui(e,t,n){return!n||e===void 0||(e.x=t-(e.x-t)-e.width),e}function Dd(e,t,n,r,i,o,s,a){const l=s.cellHorizontalPadding,u=s.headerIconSize,c=Yp(n,r,i,o);let d=n+l;const g=t.icon===void 0?void 0:{x:d,y:r+(o-u)/2,width:u,height:u},h=g===void 0||t.overlayIcon===void 0?void 0:{x:g.x+9,y:g.y+6,width:18,height:18};g!==void 0&&(d+=Math.ceil(u*1.3));const m={x:d,y:r,width:i-d,height:o};let p;if(t.indicatorIcon!==void 0){const b=e===void 0?md(t.title,s.headerFontFull)?.width??0:qr(t.title,e,s.headerFontFull).width;m.width=b,d+=b+l,p={x:d,y:r+(o-u)/2,width:u,height:u}}const y=n+i/2;return{menuBounds:Ui(c,y,a),iconBounds:Ui(g,y,a),iconOverlayBounds:Ui(h,y,a),textBounds:Ui(m,y,a),indicatorIconBounds:Ui(p,y,a)}}function xu(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m,p){if(o.rowMarker!==void 0&&o.headerRowMarkerDisabled!==!0){const v=o.rowMarkerChecked;v!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=d);const S=o.headerRowMarkerTheme!==void 0?ir(a,o.headerRowMarkerTheme):a;Zs(e,S,v,t,n,r,i,!1,void 0,void 0,a.checkboxMaxSize,"center",o.rowMarker),v!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=1);return}const y=s?a.textHeaderSelected:a.textHeader,b=o.hasMenu===!0&&(l||h&&s)&&p.menuBounds!==void 0;if(o.icon!==void 0&&p.iconBounds!==void 0){let v=s?"selected":"normal";o.style==="highlight"&&(v=s?"selected":"special"),g.drawSprite(o.icon,v,e,p.iconBounds.x,p.iconBounds.y,p.iconBounds.width,a),o.overlayIcon!==void 0&&p.iconOverlayBounds!==void 0&&g.drawSprite(o.overlayIcon,s?"selected":"special",e,p.iconOverlayBounds.x,p.iconOverlayBounds.y,p.iconOverlayBounds.width,a)}if(b&&r>35){const S=m?35:r-35,O=m?35*.7:r-35*.7,R=S/r,M=O/r,_=e.createLinearGradient(t,0,t+r,0),E=Nr(y,0);_.addColorStop(m?1:0,y),_.addColorStop(R,y),_.addColorStop(M,E),_.addColorStop(m?0:1,E),e.fillStyle=_}else e.fillStyle=y;if(m&&(e.textAlign="right"),p.textBounds!==void 0&&e.fillText(o.title,m?p.textBounds.x+p.textBounds.width:p.textBounds.x,n+i/2+Zn(e,a.headerFontFull)),m&&(e.textAlign="left"),o.indicatorIcon!==void 0&&p.indicatorIconBounds!==void 0&&(!b||!ro(p.menuBounds.x,p.menuBounds.y,p.menuBounds.width,p.menuBounds.height,p.indicatorIconBounds.x,p.indicatorIconBounds.y,p.indicatorIconBounds.width,p.indicatorIconBounds.height))){let v=s?"selected":"normal";o.style==="highlight"&&(v=s?"selected":"special"),g.drawSprite(o.indicatorIcon,v,e,p.indicatorIconBounds.x,p.indicatorIconBounds.y,p.indicatorIconBounds.width,a)}if(b&&p.menuBounds!==void 0){const v=p.menuBounds,S=u!==void 0&&c!==void 0&&Vr(v,u+t,c+n);if(S||(e.globalAlpha=.7),o.menuIcon===void 0||o.menuIcon===na.Triangle){e.beginPath();const O=v.x+v.width/2-5.5,R=v.y+v.height/2-3;Gm(e,[{x:O,y:R},{x:O+11,y:R},{x:O+5.5,y:R+6}],1),e.fillStyle=y,e.fill()}else if(o.menuIcon===na.Dots){e.beginPath();const O=v.x+v.width/2,R=v.y+v.height/2;qm(e,O,R),e.fillStyle=y,e.fill()}else{const O=v.x+(v.width-a.headerIconSize)/2,R=v.y+(v.height-a.headerIconSize)/2;g.drawSprite(o.menuIcon,"normal",e,O,R,a.headerIconSize,a)}S||(e.globalAlpha=1)}}function Od(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m,p){const y=Ws(o.title)==="rtl",b=Dd(e,o,t,n,r,i,a,y);m!==void 0?m({ctx:e,theme:a,rect:{x:t,y:n,width:r,height:i},column:o,columnIndex:o.sourceIndex,isSelected:s,hoverAmount:g,isHovered:l,hasSelectedCell:d,spriteManager:h,menuBounds:b?.menuBounds??{x:0,y:0,height:0,width:0},hoverX:u,hoverY:c},()=>xu(e,t,n,r,i,o,s,a,l,u,c,g,h,p,y,b)):xu(e,t,n,r,i,o,s,a,l,u,c,g,h,p,y,b)}function jp(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m,p,y,b,v){if(b!==void 0||t[t.length-1]!==n[t.length-1])return;const S=kd(y);Mr(t,l,s,a,o,(O,R,M,_,E)=>{if(O!==t[t.length-1])return;R+=O.width;const k=Math.max(R,_);k>r||(e.save(),e.beginPath(),e.rect(k,o+1,1e4,i-o-1),e.clip(),wa(E,M,i,u,c,m,p,S,(F,D,C,I)=>{if(!I&&y.length>0&&!y.some(X=>ro(R,F,1e4,C,X.x,X.y,X.width,X.height)))return;const T=g.hasIndex(D),x=h.hasIndex(D);e.beginPath();const $=d?.(D),G=$===void 0?v:ir(v,$);G.bgCell!==v.bgCell&&(e.fillStyle=G.bgCell,e.fillRect(R,F,1e4,C)),x&&(e.fillStyle=G.bgHeader,e.fillRect(R,F,1e4,C)),T&&(e.fillStyle=G.accentLight,e.fillRect(R,F,1e4,C))}),e.restore())})}function Xp(e,t,n,r,i,o,s,a,l){let u=!1;for(const m of t)if(!m.sticky){u=s(m.sourceIndex);break}const c=l.horizontalBorderColor??l.borderColor,d=l.borderColor,g=u?pi(t):0;let h;if(g!==0&&(h=du(d,l.bgCell),e.beginPath(),e.moveTo(g+.5,0),e.lineTo(g+.5,r),e.strokeStyle=h,e.stroke()),i>0){const m=d===c&&h!==void 0?h:du(c,l.bgCell),p=Ur(o,i,a);e.beginPath(),e.moveTo(0,r-p+.5),e.lineTo(n,r-p+.5),e.strokeStyle=m,e.stroke()}}const Pd=(e,t,n)=>{let r=0,i=t,o=0,s=n;if(e!==void 0&&e.length>0){r=Number.MAX_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;for(const a of e)r=Math.min(r,a.x-1),i=Math.max(i,a.x+a.width+1),o=Math.min(o,a.y-1),s=Math.max(s,a.y+a.height+1)}return{minX:r,maxX:i,minY:o,maxY:s}};function Kp(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m){const p=m.bgCell,{minX:y,maxX:b,minY:v,maxY:S}=Pd(a,o,s),O=[],R=s-Ur(h,g,u);let M=l,_=n,E=0;for(;M+i<R;){const C=M+i,I=u(_);if(C>=v&&C<=S-1){const x=c?.(_)?.bgCell;x!==void 0&&x!==p&&_>=h-g&&O.push({x:y,y:C,w:b-y,h:I,color:x})}M+=I,_<h-g&&(E=M),_++}let k=0;const F=Math.min(R,S)-E;if(F>0)for(let C=0;C<t.length;C++){const I=t[C];if(I.width===0)continue;const T=I.sticky?k:k+r,x=I.themeOverride?.bgCell;x!==void 0&&x!==p&&T>=y&&T<=b&&d(C+1)&&O.push({x:T,y:E,w:I.width,h:F,color:x}),k+=I.width}if(O.length===0)return;let D;e.beginPath();for(let C=O.length-1;C>=0;C--){const I=O[C];D===void 0?D=I.color:I.color!==D&&(e.fillStyle=D,e.fill(),e.beginPath(),D=I.color),e.rect(I.x,I.y,I.w,I.h)}D!==void 0&&(e.fillStyle=D,e.fill()),e.beginPath()}function ku(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m,p,y,b=!1){if(l!==void 0){e.beginPath(),e.save(),e.rect(0,0,o,s);for(const C of l)e.rect(C.x+1,C.y+1,C.width-1,C.height-1);e.clip("evenodd")}const v=y.horizontalBorderColor??y.borderColor,S=y.borderColor,{minX:O,maxX:R,minY:M,maxY:_}=Pd(a,o,s),E=[];e.beginPath();let k=.5;for(let C=0;C<t.length;C++){const I=t[C];if(I.width===0)continue;k+=I.width;const T=I.sticky?k:k+r;T>=O&&T<=R&&h(C+1)&&E.push({x1:T,y1:Math.max(u,M),x2:T,y2:Math.min(s,_),color:S})}let F=s+.5;for(let C=p-m;C<p;C++){const I=d(C);F-=I,E.push({x1:O,y1:F,x2:R,y2:F,color:v})}if(b!==!0){let C=c+.5,I=n;const T=F;for(;C+i<T;){const x=C+i;if(x>=M&&x<=_-1){const $=g?.(I);E.push({x1:O,y1:x,x2:R,y2:x,color:$?.horizontalBorderColor??$?.borderColor??v})}C+=d(I),I++}}const D=wh(E,C=>C.color);for(const C of Object.keys(D)){e.strokeStyle=C;for(const I of D[C])e.moveTo(I.x1,I.y1),e.lineTo(I.x2,I.y2);e.stroke(),e.beginPath()}l!==void 0&&e.restore()}function Zp(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m,p,y,b,v){const S=[];e.imageSmoothingEnabled=!1;const O=Math.min(i.cellYOffset,s),R=Math.max(i.cellYOffset,s);let M=0;if(typeof b=="number")M+=(R-O)*b;else for(let T=O;T<R;T++)M+=b(T);s>i.cellYOffset&&(M=-M),M+=l-i.translateY;const _=Math.min(i.cellXOffset,o),E=Math.max(i.cellXOffset,o);let k=0;for(let T=_;T<E;T++)k+=p[T].width;o>i.cellXOffset&&(k=-k),k+=a-i.translateX;const F=pi(y);if(k!==0&&M!==0)return{regions:[]};const D=u>0?Ur(g,u,b):0,C=c-F-Math.abs(k),I=d-h-D-Math.abs(M)-1;if(C>150&&I>150){const T={sx:0,sy:0,sw:c*m,sh:d*m,dx:0,dy:0,dw:c*m,dh:d*m};if(M>0?(T.sy=(h+1)*m,T.sh=I*m,T.dy=(M+h+1)*m,T.dh=I*m,S.push({x:0,y:h,width:c,height:M+1})):M<0&&(T.sy=(-M+h+1)*m,T.sh=I*m,T.dy=(h+1)*m,T.dh=I*m,S.push({x:0,y:d+M-D,width:c,height:-M+D})),k>0?(T.sx=F*m,T.sw=C*m,T.dx=(k+F)*m,T.dw=C*m,S.push({x:F-1,y:0,width:k+2,height:d})):k<0&&(T.sx=(F-k)*m,T.sw=C*m,T.dx=F*m,T.dw=C*m,S.push({x:c+k,y:0,width:-k,height:d})),e.setTransform(1,0,0,1,0,0),v){if(F>0&&k!==0&&M===0&&(r===void 0||n?.[1]!==!1)){const x=F*m,$=d*m;e.drawImage(t,0,0,x,$,0,0,x,$)}if(D>0&&k===0&&M!==0&&(r===void 0||n?.[0]!==!1)){const x=(d-D)*m,$=c*m,G=D*m;e.drawImage(t,0,x,$,G,0,x,$,G)}}e.drawImage(t,T.sx,T.sy,T.sw,T.sh,T.dx,T.dy,T.dw,T.dh),e.scale(m,m)}return e.imageSmoothingEnabled=!0,{regions:S}}function Jp(e,t,n,r,i,o,s,a,l,u){const c=[];return t!==e.cellXOffset||n!==e.cellYOffset||r!==e.translateX||i!==e.translateY||Mr(l,n,r,i,a,(d,g,h,m)=>{if(d.sourceIndex===u){const p=Math.max(g,m)+1;return c.push({x:p,y:0,width:o-p,height:s}),!0}}),c}function Qp(e,t){if(t===void 0||e.width!==t.width||e.height!==t.height||e.theme!==t.theme||e.headerHeight!==t.headerHeight||e.rowHeight!==t.rowHeight||e.rows!==t.rows||e.freezeColumns!==t.freezeColumns||e.getRowThemeOverride!==t.getRowThemeOverride||e.isFocused!==t.isFocused||e.isResizing!==t.isResizing||e.verticalBorder!==t.verticalBorder||e.getCellContent!==t.getCellContent||e.highlightRegions!==t.highlightRegions||e.selection!==t.selection||e.dragAndDropState!==t.dragAndDropState||e.prelightCells!==t.prelightCells||e.touchMode!==t.touchMode||e.maxScaleFactor!==t.maxScaleFactor)return!1;if(e.mappedColumns!==t.mappedColumns){if(e.mappedColumns.length>100||e.mappedColumns.length!==t.mappedColumns.length)return!1;let n;for(let r=0;r<e.mappedColumns.length;r++){const i=e.mappedColumns[r],o=t.mappedColumns[r];if(mi(i,o))continue;if(n!==void 0||i.width===o.width)return!1;const{width:s,...a}=i,{width:l,...u}=o;if(!mi(a,u))return!1;n=r}return n===void 0?!0:n}return!0}function Mu(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m,p){const y=m?.filter(_=>_.style!=="no-outline");if(y===void 0||y.length===0)return;const b=pi(a),v=Ur(h,g,d),S=[l,0,a.length,h-g],O=[b,0,t,n-v],R=y.map(_=>{const E=_.range,k=_.style??"dashed";return Bp(E,S,t,n,O).map(F=>{const D=F.rect,C=Rs(D.x,D.y,t,n,c,u+c,r,i,o,s,h,l,g,a,d),I=D.width===1&&D.height===1?C:Rs(D.x+D.width-1,D.y+D.height-1,t,n,c,u+c,r,i,o,s,h,l,g,a,d);return D.x+D.width>=a.length&&(I.width-=1),D.y+D.height>=h&&(I.height-=1),{color:_.color,style:k,clip:F.clip,rect:$p({x:C.x,y:C.y,width:I.x+I.width-C.x,height:I.y+I.height-C.y},t,n,8)}})}),M=()=>{e.lineWidth=1;let _=!1;for(const E of R)for(const k of E)if(k?.rect!==void 0&&ro(0,0,t,n,k.rect.x,k.rect.y,k.rect.width,k.rect.height)){const F=_,D=!Np(k.clip,k.rect);e.beginPath(),D&&(e.save(),e.rect(k.clip.x,k.clip.y,k.clip.width,k.clip.height),e.clip()),k.style==="dashed"&&!_?(e.setLineDash([5,3]),_=!0):(k.style==="solid"||k.style==="solid-outline")&&_&&(e.setLineDash([]),_=!1),e.strokeStyle=k.style==="solid-outline"?On(On(k.color,p.borderColor),p.bgCell):Nr(k.color,1),e.closePath(),e.strokeRect(k.rect.x+.5,k.rect.y+.5,k.rect.width-1,k.rect.height-1),D&&(e.restore(),_=F)}_&&e.setLineDash([])};return M(),M}function Ru(e,t,n,r,i){e.beginPath(),e.moveTo(t,n),e.lineTo(t,r),e.lineWidth=2,e.strokeStyle=i,e.stroke(),e.globalAlpha=1}function as(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m,p,y){if(c.current===void 0)return;const b=c.current.range,v=c.current.cell,S=[b.x+b.width-1,b.y+b.height-1];if(v[1]>=y&&S[1]>=y||!s.some(T=>T.sourceIndex===v[0]||T.sourceIndex===S[0]))return;const[R,M]=c.current.cell,_=g(c.current.cell),E=_.span??[R,R],k=M>=y-h,F=h>0&&!k?Ur(y,h,d)-1:0,D=S[1];let C;if(Mr(s,r,i,o,u,(T,x,$,G,X)=>{if(T.sticky&&R>T.sourceIndex)return;const ie=T.sourceIndex<E[0],ee=T.sourceIndex>E[1],Q=T.sourceIndex===S[0];if(!(!Q&&(ie||ee)))return wa(X,$,n,y,d,h,m,void 0,(te,se,ue)=>{if(se!==M&&se!==D)return;let fe=x,re=T.width;if(_.span!==void 0){const P=Rd(_.span,x,te,T.width,ue,T,a),Y=T.sticky?P[0]:P[1];Y!==void 0&&(fe=Y.x,re=Y.width)}return se===D&&Q&&p&&(C=()=>{G>fe&&!T.sticky&&(e.beginPath(),e.rect(G,0,t-G,n),e.clip()),e.beginPath(),e.rect(fe+re-4,te+ue-4,4,4),e.fillStyle=T.themeOverride?.accentColor??l.accentColor,e.fill()}),C!==void 0}),C!==void 0}),C===void 0)return;const I=()=>{e.save(),e.beginPath(),e.rect(0,u,t,n-u-F),e.clip(),C?.(),e.restore()};return I(),I}function e0(e,t,n,r,i,o,s,a,l){l===void 0||l.size===0||(e.beginPath(),Md(t,n,o,r,(u,c,d,g,h,m)=>{l.hasItemInRectangle({x:u[0],y:-2,width:u[1]-u[0]+1,height:1})&&e.rect(d,g,h,m)}),Mr(t,a,o,s,i,(u,c,d,g)=>{const h=Math.max(0,g-c),m=c+h+1,p=u.width-h-1;l.has([u.sourceIndex,-1])&&e.rect(m,r,p,i-r)}),e.clip())}function t0(e,t,n,r,i,o,s,a,l,u){let c=0;return Mr(e,o,r,i,n,(d,g,h,m,p)=>(wa(p,h,t,s,a,l,u,void 0,(y,b,v,S)=>{S||(c=Math.max(b,c))}),!0)),c}function Eu(e,t){const{canvasCtx:n,headerCanvasCtx:r,width:i,height:o,cellXOffset:s,cellYOffset:a,translateX:l,translateY:u,mappedColumns:c,enableGroups:d,freezeColumns:g,dragAndDropState:h,theme:m,drawFocus:p,headerHeight:y,groupHeaderHeight:b,disabledRows:v,rowHeight:S,verticalBorder:O,overrideCursor:R,isResizing:M,selection:_,fillHandle:E,freezeTrailingRows:k,rows:F,getCellContent:D,getGroupDetails:C,getRowThemeOverride:I,isFocused:T,drawHeaderCallback:x,prelightCells:$,drawCellCallback:G,highlightRegions:X,resizeCol:ie,imageLoader:ee,lastBlitData:Q,hoverValues:te,hyperWrapping:se,hoverInfo:ue,spriteManager:fe,maxScaleFactor:re,hasAppendRow:H,touchMode:P,enqueue:Y,renderStateProvider:ce,getCellRenderer:he,renderStrategy:ke,bufferACtx:Se,bufferBCtx:Je,damage:Ie,minimumCellWidth:Qe,resizeIndicator:kt}=e;if(i===0||o===0)return;const $e=ke==="double-buffer",ne=Math.min(re,Math.ceil(window.devicePixelRatio??1)),me=ke!=="direct"&&Qp(e,t),xe=n.canvas;(xe.width!==i*ne||xe.height!==o*ne)&&(xe.width=i*ne,xe.height=o*ne,xe.style.width=i+"px",xe.style.height=o+"px");const de=r.canvas,be=d?b+y:y,Pe=be+1;(de.width!==i*ne||de.height!==Pe*ne)&&(de.width=i*ne,de.height=Pe*ne,de.style.width=i+"px",de.style.height=Pe+"px");const Te=Se.canvas,st=Je.canvas;$e&&(Te.width!==i*ne||Te.height!==o*ne)&&(Te.width=i*ne,Te.height=o*ne,Q.current!==void 0&&(Q.current.aBufferScroll=void 0)),$e&&(st.width!==i*ne||st.height!==o*ne)&&(st.width=i*ne,st.height=o*ne,Q.current!==void 0&&(Q.current.bBufferScroll=void 0));const Re=Q.current;if(me===!0&&s===Re?.cellXOffset&&a===Re?.cellYOffset&&l===Re?.translateX&&u===Re?.translateY)return;let qe=null;$e&&(qe=n);const He=r;let we;$e?Ie!==void 0?we=Re?.lastBuffer==="b"?Je:Se:we=Re?.lastBuffer==="b"?Se:Je:we=n;const Be=we.canvas,mt=$e?Be===Te?st:Te:xe,ft=typeof S=="number"?()=>S:S;He.save(),we.save(),He.beginPath(),we.beginPath(),He.textBaseline="middle",we.textBaseline="middle",ne!==1&&(He.scale(ne,ne),we.scale(ne,ne));const Ge=Ms(c,s,i,h,l);let yt=[];const Yt=p&&_.current?.cell[1]===a&&u===0;let Ht=!1;if(X!==void 0){for(const Ct of X)if(Ct.style!=="no-outline"&&Ct.range.y===a&&u===0){Ht=!0;break}}const Mt=()=>{qp(He,Ge,d,ue,i,l,y,b,h,M,_,m,fe,te,O,C,Ie,x,P),ku(He,Ge,a,l,u,i,o,void 0,void 0,b,be,ft,I,O,k,F,m,!0),He.beginPath(),He.moveTo(0,Pe-.5),He.lineTo(i,Pe-.5),He.strokeStyle=On(m.headerBottomBorderColor??m.horizontalBorderColor??m.borderColor,m.bgHeader),He.stroke(),Ht&&Mu(He,i,o,s,a,l,u,c,g,y,b,S,k,F,X,m),Yt&&as(He,i,o,a,l,u,Ge,c,m,be,_,ft,D,k,H,E,F)};if(Ie!==void 0){const Ct=Ge[Ge.length-1].sourceIndex+1,rn=Ie.hasItemInRegion([{x:s,y:-2,width:Ct,height:2},{x:s,y:a,width:Ct,height:300},{x:0,y:a,width:g,height:300},{x:0,y:-2,width:g,height:2},{x:s,y:F-k,width:Ct,height:k,when:k>0}]),Bt=De=>{Su(De,Ge,c,o,be,l,u,a,F,ft,D,C,I,v,T,p,k,H,yt,Ie,_,$,X,ee,fe,te,ue,G,se,m,Y,ce,he,R,Qe);const It=_.current;E&&p&&It!==void 0&&Ie.has(fd(It.range))&&as(De,i,o,a,l,u,Ge,c,m,be,_,ft,D,k,H,E,F)};rn&&(Bt(we),qe!==null&&(qe.save(),qe.scale(ne,ne),qe.textBaseline="middle",Bt(qe),qe.restore()),Ie.hasHeader()&&(e0(He,Ge,i,b,be,l,u,a,Ie),Mt())),we.restore(),He.restore();return}if((me!==!0||s!==Re?.cellXOffset||l!==Re?.translateX||Yt!==Re?.mustDrawFocusOnHeader||Ht!==Re?.mustDrawHighlightRingsOnHeader)&&Mt(),me===!0){Dn(mt!==void 0&&Re!==void 0);const{regions:Ct}=Zp(we,mt,mt===Te?Re.aBufferScroll:Re.bBufferScroll,mt===Te?Re.bBufferScroll:Re.aBufferScroll,Re,s,a,l,u,k,i,o,F,be,ne,c,Ge,S,$e);yt=Ct}else me!==!1&&(Dn(Re!==void 0),yt=Jp(Re,s,a,l,u,i,o,be,Ge,me));Xp(we,Ge,i,o,k,F,O,ft,m);const nn=Mu(we,i,o,s,a,l,u,c,g,y,b,S,k,F,X,m),qt=p?as(we,i,o,a,l,u,Ge,c,m,be,_,ft,D,k,H,E,F):void 0;if(we.fillStyle=m.bgCell,yt.length>0){we.beginPath();for(const Ct of yt)we.rect(Ct.x,Ct.y,Ct.width,Ct.height);we.clip(),we.fill(),we.beginPath()}else we.fillRect(0,0,i,o);const cn=Su(we,Ge,c,o,be,l,u,a,F,ft,D,C,I,v,T,p,k,H,yt,Ie,_,$,X,ee,fe,te,ue,G,se,m,Y,ce,he,R,Qe);jp(we,Ge,c,i,o,be,l,u,a,F,ft,I,_.rows,v,k,H,yt,Ie,m),Kp(we,Ge,a,l,u,i,o,yt,be,ft,I,O,k,F,m),ku(we,Ge,a,l,u,i,o,yt,cn,b,be,ft,I,O,k,F,m),nn?.(),qt?.(),M&&kt!=="none"&&Mr(Ge,0,l,0,be,(Ct,rn)=>Ct.sourceIndex===ie?(Ru(He,rn+Ct.width,0,be+1,On(m.resizeIndicatorColor??m.accentLight,m.bgHeader)),kt==="full"&&Ru(we,rn+Ct.width,be,o,On(m.resizeIndicatorColor??m.accentLight,m.bgCell)),!0):!1),qe!==null&&(qe.fillStyle=m.bgCell,qe.fillRect(0,0,i,o),qe.drawImage(we.canvas,0,0));const Ot=t0(Ge,o,be,l,u,a,F,ft,k,H);ee?.setWindow({x:s,y:a,width:Ge.length,height:Ot-a},g,Array.from({length:k},(Ct,rn)=>F-1-rn));const ut=Re!==void 0&&(s!==Re.cellXOffset||l!==Re.translateX),tn=Re!==void 0&&(a!==Re.cellYOffset||u!==Re.translateY);Q.current={cellXOffset:s,cellYOffset:a,translateX:l,translateY:u,mustDrawFocusOnHeader:Yt,mustDrawHighlightRingsOnHeader:Ht,lastBuffer:$e?Be===Te?"a":"b":void 0,aBufferScroll:Be===Te?[ut,tn]:Re?.aBufferScroll,bBufferScroll:Be===st?[ut,tn]:Re?.bBufferScroll},we.restore(),He.restore()}const n0=80;function r0(e){const t=e-1;return t*t*t+1}class i0{callback;constructor(t){this.callback=t}currentHoveredItem=void 0;leavingItems=[];lastAnimationTime;addToLeavingItems=t=>{this.leavingItems.some(r=>Zi(r.item,t.item))||this.leavingItems.push(t)};removeFromLeavingItems=t=>{const n=this.leavingItems.find(r=>Zi(r.item,t));return this.leavingItems=this.leavingItems.filter(r=>r!==n),n?.hoverAmount??0};cleanUpLeavingElements=()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)};shouldStep=()=>{const t=this.leavingItems.length>0,n=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||n};getAnimatingItems=()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>({...t,hoverAmount:r0(t.hoverAmount)}));step=t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const r=(t-this.lastAnimationTime)/n0;for(const o of this.leavingItems)o.hoverAmount=Ln(o.hoverAmount-r,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=Ln(this.currentHoveredItem.hoverAmount+r,0,1));const i=this.getAnimatingItems();this.callback(i),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0};setHovered=t=>{if(!Zi(this.currentHoveredItem?.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){const n=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:n}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}}}class o0{fn;val;constructor(t){this.fn=t}get value(){return this.val??(this.val=this.fn())}}function Js(e){return new o0(e)}const a0=Js(()=>window.navigator.userAgent.includes("Firefox")),oa=Js(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),aa=Js(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function s0(e){const t=f.useRef([]),n=f.useRef(0),r=f.useRef(e);r.current=e;const i=f.useCallback(()=>{const o=()=>window.requestAnimationFrame(s),s=()=>{const a=t.current.map(Ks);t.current=[],r.current(new Qi(a)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?o:s)},[]);return f.useCallback(o=>{t.current.length===0&&i();const s=Bn(o[0],o[1]);t.current.includes(s)||t.current.push(s)},[i])}const yr="header",An="group-header",sa="out-of-bounds";var hi;(function(e){e[e.Start=-2]="Start",e[e.StartPadding=-1]="StartPadding",e[e.Center=0]="Center",e[e.EndPadding=1]="EndPadding",e[e.End=2]="End"})(hi||(hi={}));function _d(e,t){return e===t?!0:e?.kind==="out-of-bounds"?e?.kind===t?.kind&&e?.location[0]===t?.location[0]&&e?.location[1]===t?.location[1]&&e?.region[0]===t?.region[0]&&e?.region[1]===t?.region[1]:e?.kind===t?.kind&&e?.location[0]===t?.location[0]&&e?.location[1]===t?.location[1]}const Iu=6,l0=(e,t)=>e.kind===J.Custom?e.copyData:t?.(e)?.getAccessibilityString(e)??"",u0=(e,t)=>{const{width:n,height:r,accessibilityHeight:i,columns:o,cellXOffset:s,cellYOffset:a,headerHeight:l,fillHandle:u=!1,groupHeaderHeight:c,rowHeight:d,rows:g,getCellContent:h,getRowThemeOverride:m,onHeaderMenuClick:p,onHeaderIndicatorClick:y,enableGroups:b,isFilling:v,onCanvasFocused:S,onCanvasBlur:O,isFocused:R,selection:M,freezeColumns:_,onContextMenu:E,freezeTrailingRows:k,fixedShadowX:F=!0,fixedShadowY:D=!0,drawFocusRing:C,onMouseDown:I,onMouseUp:T,onMouseMoveRaw:x,onMouseMove:$,onItemHovered:G,dragAndDropState:X,firstColAccessible:ie,onKeyDown:ee,onKeyUp:Q,highlightRegions:te,canvasRef:se,onDragStart:ue,onDragEnd:fe,eventTargetRef:re,isResizing:H,resizeColumn:P,isDragging:Y,isDraggable:ce=!1,allowResize:he,disabledRows:ke,hasAppendRow:Se,getGroupDetails:Je,theme:Ie,prelightCells:Qe,headerIcons:kt,verticalBorder:$e,drawCell:ne,drawHeader:me,onCellFocused:xe,onDragOverCell:de,onDrop:be,onDragLeave:Pe,imageWindowLoader:Te,smoothScrollX:st=!1,smoothScrollY:Re=!1,experimental:qe,getCellRenderer:He,resizeIndicator:we="full"}=e,Be=e.translateX??0,mt=e.translateY??0,ft=Math.max(_,Math.min(o.length-1,s)),Ge=f.useRef(null),yt=f.useRef(qe?.eventTarget??window),Yt=yt.current,Ht=Te,Mt=f.useRef(),[nn,qt]=f.useState(!1),cn=f.useRef([]),Ot=f.useRef(),[ut,tn]=f.useState(),[Ct,rn]=f.useState(),Bt=f.useRef(null),[De,It]=f.useState(),[Pt,wn]=f.useState(!1),jt=f.useRef(Pt);jt.current=Pt;const dn=f.useMemo(()=>new zp(kt,()=>{ge.current=void 0,$t.current()}),[kt]),Mn=b?c+l:l,Xt=f.useRef(-1),Jt=(qe?.enableFirefoxRescaling??!1)&&a0.value,We=(qe?.enableSafariRescaling??!1)&&oa.value;f.useLayoutEffect(()=>{window.devicePixelRatio===1||!Jt&&!We||(Xt.current!==-1&&qt(!0),window.clearTimeout(Xt.current),Xt.current=window.setTimeout(()=>{qt(!1),Xt.current=-1},200))},[a,ft,Be,mt,Jt,We]);const Rt=_m(o,_),yn=f.useMemo(()=>F?pi(Rt,X):0,[Rt,X,F]),vt=f.useCallback((z,oe,Me)=>{const Ee=z.getBoundingClientRect();if(oe>=Rt.length||Me>=g)return;const ae=Ee.width/n,ve=Rs(oe,Me,n,r,c,Mn,ft,a,Be,mt,g,_,k,Rt,d);return ae!==1&&(ve.x*=ae,ve.y*=ae,ve.width*=ae,ve.height*=ae),ve.x+=Ee.x,ve.y+=Ee.y,ve},[n,r,c,Mn,ft,a,Be,mt,g,_,k,Rt,d]),Ft=f.useCallback((z,oe,Me,Ee)=>{const ae=z.getBoundingClientRect(),ve=ae.width/n,Ye=(oe-ae.left)/ve,ye=(Me-ae.top)/ve,je=5,ct=Ms(Rt,ft,n,void 0,Be);let Zt=0,dt=0;const Tt=typeof PointerEvent<"u"&&Ee instanceof PointerEvent&&Ee.pointerType==="mouse"||typeof MouseEvent<"u"&&Ee instanceof MouseEvent,et=typeof PointerEvent<"u"&&Ee instanceof PointerEvent&&Ee.pointerType==="touch"||typeof TouchEvent<"u"&&Ee instanceof TouchEvent;Tt&&(Zt=Ee.button,dt=Ee.buttons);const Ze=Hm(Ye,ct,Be),zt=zm(ye,r,b,l,c,g,d,a,mt,k),Wt=Ee?.shiftKey===!0,Tr=Ee?.ctrlKey===!0,en=Ee?.metaKey===!0,an=[Ye<0?-1:n<Ye?1:0,ye<Mn?-1:r<ye?1:0];let fr;if(Ze===-1||ye<0||Ye<0||zt===void 0||Ye>n||ye>r){const _t=Ye>n?1:Ye<0?-1:0,kn=ye>r?1:ye<0?-1:0;let Rn=_t*2,hr=kn*2;_t===0&&(Rn=Ze===-1?hi.EndPadding:hi.Center),kn===0&&(hr=zt===void 0?hi.EndPadding:hi.Center);let tt=!1;if(Ze===-1&&zt===-1){const Gn=vt(z,Rt.length-1,-1);Dn(Gn!==void 0),tt=oe<Gn.x+Gn.width+je}const sn=Ye>n&&Ye<n+Ss()||ye>r&&ye<r+Ss();fr={kind:sa,location:[Ze!==-1?Ze:Ye<0?0:Rt.length-1,zt??g-1],region:[Rn,hr],shiftKey:Wt,ctrlKey:Tr,metaKey:en,isEdge:tt,isTouch:et,button:Zt,buttons:dt,scrollEdge:an,isMaybeScrollbar:sn}}else if(zt<=-1){let _t=vt(z,Ze,zt);Dn(_t!==void 0);let kn=_t!==void 0&&_t.x+_t.width-oe<=je;const Rn=Ze-1;oe-_t.x<=je&&Rn>=0?(kn=!0,_t=vt(z,Rn,zt),Dn(_t!==void 0),fr={kind:b&&zt===-2?An:yr,location:[Rn,zt],bounds:_t,group:Rt[Rn].group??"",isEdge:kn,shiftKey:Wt,ctrlKey:Tr,metaKey:en,isTouch:et,localEventX:oe-_t.x,localEventY:Me-_t.y,button:Zt,buttons:dt,scrollEdge:an}):fr={kind:b&&zt===-2?An:yr,group:Rt[Ze].group??"",location:[Ze,zt],bounds:_t,isEdge:kn,shiftKey:Wt,ctrlKey:Tr,metaKey:en,isTouch:et,localEventX:oe-_t.x,localEventY:Me-_t.y,button:Zt,buttons:dt,scrollEdge:an}}else{const _t=vt(z,Ze,zt);Dn(_t!==void 0);const kn=_t!==void 0&&_t.x+_t.width-oe<je;let Rn=!1;if(u&&M.current!==void 0){const hr=fd(M.current.range),tt=vt(z,hr[0],hr[1]);if(tt!==void 0){const sn=tt.x+tt.width-2,Gn=tt.y+tt.height-2;Rn=Math.abs(sn-oe)<Iu&&Math.abs(Gn-Me)<Iu}}fr={kind:"cell",location:[Ze,zt],bounds:_t,isEdge:kn,shiftKey:Wt,ctrlKey:Tr,isFillHandle:Rn,metaKey:en,isTouch:et,localEventX:oe-_t.x,localEventY:Me-_t.y,button:Zt,buttons:dt,scrollEdge:an}}return fr},[n,Rt,ft,Be,r,b,l,c,g,d,a,mt,k,vt,u,M,Mn]),[Cn]=ut??[],Wn=f.useRef(()=>{}),zn=f.useRef(ut);zn.current=ut;const[N,Ne]=f.useMemo(()=>{const z=document.createElement("canvas"),oe=document.createElement("canvas");return z.style.display="none",z.style.opacity="0",z.style.position="fixed",oe.style.display="none",oe.style.opacity="0",oe.style.position="fixed",[z.getContext("2d",{alpha:!1}),oe.getContext("2d",{alpha:!1})]},[]);f.useLayoutEffect(()=>{if(!(N===null||Ne===null))return document.documentElement.append(N.canvas),document.documentElement.append(Ne.canvas),()=>{N.canvas.remove(),Ne.canvas.remove()}},[N,Ne]);const Ue=f.useMemo(()=>new Ym,[]),St=Jt&&nn?1:We&&nn?2:5,mn=qe?.disableMinimumCellWidth===!0?1:10,ge=f.useRef(),bt=f.useRef(null),Qt=f.useRef(null),Et=f.useCallback(()=>{const z=Ge.current,oe=Bt.current;if(z===null||oe===null||(bt.current===null&&(bt.current=z.getContext("2d",{alpha:!1}),z.width=0,z.height=0),Qt.current===null&&(Qt.current=oe.getContext("2d",{alpha:!1}),oe.width=0,oe.height=0),bt.current===null||Qt.current===null||N===null||Ne===null))return;let Me=!1;const Ee=Ye=>{Me=!0,It(Ye)},ae=ge.current,ve={headerCanvasCtx:Qt.current,canvasCtx:bt.current,bufferACtx:N,bufferBCtx:Ne,width:n,height:r,cellXOffset:ft,cellYOffset:a,translateX:Math.round(Be),translateY:Math.round(mt),mappedColumns:Rt,enableGroups:b,freezeColumns:_,dragAndDropState:X,theme:Ie,headerHeight:l,groupHeaderHeight:c,disabledRows:ke??it.empty(),rowHeight:d,verticalBorder:$e,isResizing:H,resizeCol:P,isFocused:R,selection:M,fillHandle:u,drawCellCallback:ne,hasAppendRow:Se,overrideCursor:Ee,maxScaleFactor:St,freezeTrailingRows:k,rows:g,drawFocus:C,getCellContent:h,getGroupDetails:Je??(Ye=>({name:Ye})),getRowThemeOverride:m,drawHeaderCallback:me,prelightCells:Qe,highlightRegions:te,imageLoader:Ht,lastBlitData:Ot,damage:Mt.current,hoverValues:cn.current,hoverInfo:zn.current,spriteManager:dn,scrolling:nn,hyperWrapping:qe?.hyperWrapping??!1,touchMode:Pt,enqueue:Wn.current,renderStateProvider:Ue,renderStrategy:qe?.renderStrategy??(oa.value?"double-buffer":"single-buffer"),getCellRenderer:He,minimumCellWidth:mn,resizeIndicator:we};ve.damage===void 0?(ge.current=ve,Eu(ve,ae)):Eu(ve,void 0),!Me&&(ve.damage===void 0||ve.damage.has(zn?.current?.[0]))&&It(void 0)},[N,Ne,n,r,ft,a,Be,mt,Rt,b,_,X,Ie,l,c,ke,d,$e,H,Se,P,R,M,u,k,g,C,St,h,Je,m,ne,me,Qe,te,Ht,dn,nn,qe?.hyperWrapping,qe?.renderStrategy,Pt,Ue,He,mn,we]),$t=f.useRef(Et);f.useLayoutEffect(()=>{Et(),$t.current=Et},[Et]),f.useLayoutEffect(()=>{(async()=>{document?.fonts?.ready!==void 0&&(await document.fonts.ready,ge.current=void 0,$t.current())})()},[]);const on=f.useCallback(z=>{Mt.current=z,$t.current(),Mt.current=void 0},[]),xa=s0(on);Wn.current=xa;const fo=f.useCallback(z=>{on(new Qi(z.map(oe=>oe.cell)))},[on]);Ht.setCallback(on);const[ka,ho]=f.useState(!1),[Rr,lr]=Cn??[],Ma=Rr!==void 0&&lr===-1&&o[Rr].headerRowMarkerDisabled!==!0,bi=Rr!==void 0&&lr===-2;let go=!1,wi=!1,Er=De;if(Er===void 0&&Rr!==void 0&&lr!==void 0&&lr>-1&&lr<g){const z=h([Rr,lr],!0);go=z.kind===Hn.NewRow||z.kind===Hn.Marker&&z.markerKind!=="number",wi=z.kind===J.Boolean&&Ns(z),Er=z.cursor}const yi=Y?"grabbing":(Ct??!1)||H?"col-resize":ka||v?"crosshair":Er!==void 0?Er:Ma||go||wi||bi?"pointer":"default",Pn=f.useMemo(()=>({contain:"strict",display:"block",cursor:yi}),[yi]),Sn=f.useRef("default"),Ci=re?.current;Ci!=null&&Sn.current!==Pn.cursor&&(Ci.style.cursor=Sn.current=Pn.cursor);const Jn=f.useCallback((z,oe,Me,Ee)=>{if(Je===void 0)return;const ae=Je(z);if(ae.actions!==void 0){const ve=Td(oe,ae.actions);for(const[Ye,ye]of ve.entries())if(Vr(ye,Me+oe.x,Ee+ye.y))return ae.actions[Ye]}},[Je]),Qn=f.useCallback((z,oe,Me,Ee)=>{const ae=Rt[oe];if(!Y&&!H&&!(Ct??!1)){const ve=vt(z,oe,-1);Dn(ve!==void 0);const Ye=Dd(void 0,ae,ve.x,ve.y,ve.width,ve.height,Ie,Ws(ae.title)==="rtl");if(ae.hasMenu===!0&&Ye.menuBounds!==void 0&&Vr(Ye.menuBounds,Me,Ee))return{area:"menu",bounds:Ye.menuBounds};if(ae.indicatorIcon!==void 0&&Ye.indicatorIconBounds!==void 0&&Vr(Ye.indicatorIconBounds,Me,Ee))return{area:"indicator",bounds:Ye.indicatorIconBounds}}},[Rt,vt,Ct,Y,H,Ie]),Gr=f.useRef(0),ur=f.useRef(),Ir=f.useRef(!1),Yr=f.useCallback(z=>{const oe=Ge.current,Me=re?.current;if(oe===null||z.target!==oe&&z.target!==Me)return;Ir.current=!0;const Ee=z.clientX,ae=z.clientY;if(z.target===Me&&Me!==null){const Ye=Me.getBoundingClientRect();if(Ee>Ye.right||ae>Ye.bottom)return}const ve=Ft(oe,Ee,ae,z);ur.current=ve.location,ve.isTouch&&(Gr.current=Date.now()),jt.current!==ve.isTouch&&wn(ve.isTouch),!(ve.kind===yr&&Qn(oe,ve.location[0],Ee,ae)!==void 0)&&(ve.kind===An&&Jn(ve.group,ve.bounds,ve.localEventX,ve.localEventY)!==void 0||(I?.(ve),!ve.isTouch&&ce!==!0&&ce!==ve.kind&&ve.button<3&&ve.button!==1&&z.preventDefault()))},[re,ce,Ft,Jn,Qn,I]);vn("pointerdown",Yr,Yt,!1);const er=f.useRef(0),jr=f.useCallback(z=>{const oe=er.current;er.current=Date.now();const Me=Ge.current;if(Ir.current=!1,T===void 0||Me===null)return;const Ee=re?.current,ae=z.target!==Me&&z.target!==Ee,ve=z.clientX,Ye=z.clientY,ye=z.pointerType==="mouse"?z.button<3:!0;let je=Ft(Me,ve,Ye,z);je.isTouch&&Gr.current!==0&&Date.now()-Gr.current>500&&(je={...je,isLongTouch:!0}),oe!==0&&Date.now()-oe<(je.isTouch?1e3:500)&&(je={...je,isDoubleClick:!0}),jt.current!==je.isTouch&&wn(je.isTouch),!ae&&z.cancelable&&ye&&z.preventDefault();const[ct]=je.location,Zt=Qn(Me,ct,ve,Ye);if(je.kind===yr&&Zt!==void 0){(je.button!==0||ur.current?.[0]!==ct||ur.current?.[1]!==-1)&&T(je,!0);return}else if(je.kind===An){const dt=Jn(je.group,je.bounds,je.localEventX,je.localEventY);if(dt!==void 0){je.button===0&&dt.onClick(je);return}}T(je,ae)},[T,re,Ft,Qn,Jn]);vn("pointerup",jr,Yt,!1);const Ra=f.useCallback(z=>{const oe=Ge.current;if(oe===null)return;const Me=re?.current,Ee=z.target!==oe&&z.target!==Me;let ae,ve,Ye=!0;z instanceof MouseEvent?(ae=z.clientX,ve=z.clientY,Ye=z.button<3):(ae=z.changedTouches[0].clientX,ve=z.changedTouches[0].clientY);const ye=Ft(oe,ae,ve,z);jt.current!==ye.isTouch&&wn(ye.isTouch),!Ee&&z.cancelable&&Ye&&z.preventDefault();const[je]=ye.location;if(ye.kind===yr){const ct=Qn(oe,je,ae,ve);ct!==void 0&&ye.button===0&&ur.current?.[0]===je&&ur.current?.[1]===-1&&(ct.area==="menu"?p?.(je,ct.bounds):ct.area==="indicator"&&y?.(je,ct.bounds))}else if(ye.kind===An){const ct=Jn(ye.group,ye.bounds,ye.localEventX,ye.localEventY);ct!==void 0&&ye.button===0&&ct.onClick(ye)}},[re,Ft,Qn,p,y,Jn]);vn("click",Ra,Yt,!1);const mo=f.useCallback(z=>{const oe=Ge.current,Me=re?.current;if(oe===null||z.target!==oe&&z.target!==Me||E===void 0)return;const Ee=Ft(oe,z.clientX,z.clientY,z);E(Ee,()=>{z.cancelable&&z.preventDefault()})},[re,Ft,E]);vn("contextmenu",mo,re?.current??null,!1);const _e=f.useCallback(z=>{Mt.current=new Qi(z.map(oe=>oe.item)),cn.current=z,$t.current(),Mt.current=void 0},[]),Si=f.useMemo(()=>new i0(_e),[_e]),po=f.useRef(Si);po.current=Si,f.useLayoutEffect(()=>{const z=po.current;if(Cn===void 0||Cn[1]<0){z.setHovered(Cn);return}const oe=h(Cn,!0),Me=He(oe),Ee=Me===void 0&&oe.kind===J.Custom||Me?.needsHover!==void 0&&(typeof Me.needsHover=="boolean"?Me.needsHover:Me.needsHover(oe));z.setHovered(Ee?Cn:void 0)},[h,He,Cn]);const cr=f.useRef(),Ea=f.useCallback(z=>{const oe=Ge.current;if(oe===null)return;const Me=re?.current,Ee=z.target!==oe&&z.target!==Me,ae=Ft(oe,z.clientX,z.clientY,z);if(ae.kind!=="out-of-bounds"&&Ee&&!Ir.current&&!ae.isTouch)return;const ve=(ye,je)=>{tn(ct=>ct===ye||ct?.[0][0]===ye?.[0][0]&&ct?.[0][1]===ye?.[0][1]&&(ct?.[1][0]===ye?.[1][0]&&ct?.[1][1]===ye?.[1][1]||!je)?ct:ye)};if(!_d(ae,cr.current))It(void 0),G?.(ae),ve(ae.kind===sa?void 0:[ae.location,[ae.localEventX,ae.localEventY]],!0),cr.current=ae;else if(ae.kind==="cell"||ae.kind===yr||ae.kind===An){let ye=!1,je=!0;if(ae.kind==="cell"){const Zt=h(ae.location);je=He(Zt)?.needsHoverPosition??Zt.kind===J.Custom,ye=je}else ye=!0;const ct=[ae.location,[ae.localEventX,ae.localEventY]];ve(ct,je),zn.current=ct,ye&&on(new Qi([ae.location]))}const Ye=ae.location[0]>=(ie?0:1);rn(ae.kind===yr&&ae.isEdge&&Ye&&he===!0),ho(ae.kind==="cell"&&ae.isFillHandle),x?.(z),$(ae)},[re,Ft,ie,he,x,$,G,h,He,on]);vn("pointermove",Ea,Yt,!0);const Un=f.useCallback(z=>{const oe=Ge.current;if(oe===null)return;let Me,Ee;M.current!==void 0&&(Me=vt(oe,M.current.cell[0],M.current.cell[1]),Ee=M.current.cell),ee?.({bounds:Me,stopPropagation:()=>z.stopPropagation(),preventDefault:()=>z.preventDefault(),cancel:()=>{},ctrlKey:z.ctrlKey,metaKey:z.metaKey,shiftKey:z.shiftKey,altKey:z.altKey,key:z.key,keyCode:z.keyCode,rawEvent:z,location:Ee})},[ee,M,vt]),xi=f.useCallback(z=>{const oe=Ge.current;if(oe===null)return;let Me,Ee;M.current!==void 0&&(Me=vt(oe,M.current.cell[0],M.current.cell[1]),Ee=M.current.cell),Q?.({bounds:Me,stopPropagation:()=>z.stopPropagation(),preventDefault:()=>z.preventDefault(),cancel:()=>{},ctrlKey:z.ctrlKey,metaKey:z.metaKey,shiftKey:z.shiftKey,altKey:z.altKey,key:z.key,keyCode:z.keyCode,rawEvent:z,location:Ee})},[Q,M,vt]),vo=f.useCallback(z=>{if(Ge.current=z,se!==void 0&&(se.current=z),qe?.eventTarget)yt.current=qe.eventTarget;else if(z===null)yt.current=window;else{const oe=z.getRootNode();oe===document&&(yt.current=window),yt.current=oe}},[se,qe?.eventTarget]),bo=f.useCallback(z=>{const oe=Ge.current;if(oe===null||ce===!1||H){z.preventDefault();return}let Me,Ee;const ae=Ft(oe,z.clientX,z.clientY);if(ce!==!0&&ae.kind!==ce){z.preventDefault();return}const ve=(dt,Tt)=>{Me=dt,Ee=Tt};let Ye,ye,je;const ct=(dt,Tt,et)=>{Ye=dt,ye=Tt,je=et};let Zt=!1;if(ue?.({...ae,setData:ve,setDragImage:ct,preventDefault:()=>Zt=!0,defaultPrevented:()=>Zt}),!Zt&&Me!==void 0&&Ee!==void 0&&z.dataTransfer!==null)if(z.dataTransfer.setData(Me,Ee),z.dataTransfer.effectAllowed="copyLink",Ye!==void 0&&ye!==void 0&&je!==void 0)z.dataTransfer.setDragImage(Ye,ye,je);else{const[dt,Tt]=ae.location;if(Tt!==void 0){const et=document.createElement("canvas"),Ze=vt(oe,dt,Tt);Dn(Ze!==void 0);const zt=Math.ceil(window.devicePixelRatio??1);et.width=Ze.width*zt,et.height=Ze.height*zt;const Wt=et.getContext("2d");Wt!==null&&(Wt.scale(zt,zt),Wt.textBaseline="middle",Tt===-1?(Wt.font=Ie.headerFontFull,Wt.fillStyle=Ie.bgHeader,Wt.fillRect(0,0,et.width,et.height),Od(Wt,0,0,Ze.width,Ze.height,Rt[dt],!1,Ie,!1,void 0,void 0,!1,0,dn,me,!1)):(Wt.font=Ie.baseFontFull,Wt.fillStyle=Ie.bgCell,Wt.fillRect(0,0,et.width,et.height),Id(Wt,h([dt,Tt]),0,Tt,!1,!1,0,0,Ze.width,Ze.height,!1,Ie,Ie.bgCell,Ht,dn,1,void 0,!1,0,void 0,void 0,void 0,Ue,He,()=>{}))),et.style.left="-100%",et.style.position="absolute",et.style.width=`${Ze.width}px`,et.style.height=`${Ze.height}px`,document.body.append(et),z.dataTransfer.setDragImage(et,Ze.width/2,Ze.height/2),window.setTimeout(()=>{et.remove()},0)}}else z.preventDefault()},[ce,H,Ft,ue,vt,Ie,Rt,dn,me,h,Ht,Ue,He]);vn("dragstart",bo,re?.current??null,!1,!1);const ki=f.useRef(),Ia=f.useCallback(z=>{const oe=Ge.current;if(be!==void 0&&z.preventDefault(),oe===null||de===void 0)return;const Me=Ft(oe,z.clientX,z.clientY),[Ee,ae]=Me.location,ve=Ee-(ie?0:1),[Ye,ye]=ki.current??[];(Ye!==ve||ye!==ae)&&(ki.current=[ve,ae],de([ve,ae],z.dataTransfer))},[ie,Ft,de,be]);vn("dragover",Ia,re?.current??null,!1,!1);const qn=f.useCallback(()=>{ki.current=void 0,fe?.()},[fe]);vn("dragend",qn,re?.current??null,!1,!1);const dr=f.useCallback(z=>{const oe=Ge.current;if(oe===null||be===void 0)return;z.preventDefault();const Me=Ft(oe,z.clientX,z.clientY),[Ee,ae]=Me.location,ve=Ee-(ie?0:1);be([ve,ae],z.dataTransfer)},[ie,Ft,be]);vn("drop",dr,re?.current??null,!1,!1);const _n=f.useCallback(()=>{Pe?.()},[Pe]);vn("dragleave",_n,re?.current??null,!1,!1);const U=f.useRef(M);U.current=M;const Lt=f.useRef(null),tr=f.useCallback(z=>{Ge.current===null||!Ge.current.contains(document.activeElement)||(z===null&&U.current.current!==void 0?se?.current?.focus({preventScroll:!0}):z!==null&&z.focus({preventScroll:!0}),Lt.current=z)},[se]);f.useImperativeHandle(t,()=>({focus:()=>{const z=Lt.current;z===null||!document.contains(z)?se?.current?.focus({preventScroll:!0}):z.focus({preventScroll:!0})},getBounds:(z,oe)=>{if(!(se===void 0||se.current===null))return vt(se.current,z??0,oe??-1)},damage:fo,getMouseArgsForPosition:(z,oe,Me)=>{if(!(se===void 0||se.current===null))return Ft(se.current,z,oe,Me)}}),[se,fo,vt]);const Mi=f.useRef(),wo=Jg(()=>{if(n<50||qe?.disableAccessibilityTree===!0)return null;let z=Ms(Rt,ft,n,X,Be);const oe=ie?0:-1;!ie&&z[0]?.sourceIndex===0&&(z=z.slice(1));const[Me,Ee]=M.current?.cell??[],ae=M.current?.range,ve=z.map(ye=>ye.sourceIndex),Ye=Sr(a,Math.min(g,a+i));return Me!==void 0&&Ee!==void 0&&!(ve.includes(Me)&&Ye.includes(Ee))&&tr(null),f.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":g+1,"aria-multiselectable":"true","aria-colcount":Rt.length+oe},f.createElement("thead",{role:"rowgroup"},f.createElement("tr",{role:"row","aria-rowindex":1},z.map(ye=>f.createElement("th",{role:"columnheader","aria-selected":M.columns.hasIndex(ye.sourceIndex),"aria-colindex":ye.sourceIndex+1+oe,tabIndex:-1,onFocus:je=>{if(je.target!==Lt.current)return xe?.([ye.sourceIndex,-1])},key:ye.sourceIndex},ye.title)))),f.createElement("tbody",{role:"rowgroup"},Ye.map(ye=>f.createElement("tr",{role:"row","aria-selected":M.rows.hasIndex(ye),key:ye,"aria-rowindex":ye+2},z.map(je=>{const ct=je.sourceIndex,Zt=Bn(ct,ye),dt=Me===ct&&Ee===ye,Tt=ae!==void 0&&ct>=ae.x&&ct<ae.x+ae.width&&ye>=ae.y&&ye<ae.y+ae.height,et=`glide-cell-${ct}-${ye}`,Ze=[ct,ye],zt=h(Ze,!0);return f.createElement("td",{key:Zt,role:"gridcell","aria-colindex":ct+1+oe,"aria-selected":Tt,"aria-readonly":di(zt)||!ui(zt),id:et,"data-testid":et,onClick:()=>{const Wt=se?.current;if(Wt!=null)return ee?.({bounds:vt(Wt,ct,ye),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:Ze})},onFocusCapture:Wt=>{if(!(Wt.target===Lt.current||Mi.current?.[0]===ct&&Mi.current?.[1]===ye))return Mi.current=Ze,xe?.(Ze)},ref:dt?tr:void 0,tabIndex:-1},l0(zt,He))})))))},[n,Rt,ft,X,Be,g,a,i,M,tr,h,se,ee,vt,xe],200),Xr=_===0||!F?0:ft>_?1:Ln(-Be/100,0,1),Ta=-a*32+mt,Ri=D?Ln(-Ta/100,0,1):0,K=f.useMemo(()=>{if(!Xr&&!Ri)return null;const z={position:"absolute",top:0,left:yn,width:n-yn,height:r,opacity:Xr,pointerEvents:"none",transition:st?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},oe={position:"absolute",top:Mn,left:0,width:n,height:r,opacity:Ri,pointerEvents:"none",transition:Re?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return f.createElement(f.Fragment,null,Xr>0&&f.createElement("div",{id:"shadow-x",style:z}),Ri>0&&f.createElement("div",{id:"shadow-y",style:oe}))},[Xr,Ri,yn,n,st,Mn,r,Re]),xn=f.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return f.createElement(f.Fragment,null,f.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:Un,onKeyUp:xi,onFocus:S,onBlur:O,ref:vo,style:Pn},wo),f.createElement("canvas",{ref:Bt,style:xn}),K)},c0=f.memo(f.forwardRef(u0));function qi(e,t,n,r){return Ln(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(r))}const d0=e=>{const[t,n]=f.useState(),[r,i]=f.useState(),[o,s]=f.useState(),[a,l]=f.useState(),[u,c]=f.useState(!1),[d,g]=f.useState(),[h,m]=f.useState(),[p,y]=f.useState(),[b,v]=f.useState(!1),[S,O]=f.useState(),{onHeaderMenuClick:R,onHeaderIndicatorClick:M,getCellContent:_,onColumnMoved:E,onColumnResize:k,onColumnResizeStart:F,onColumnResizeEnd:D,gridRef:C,maxColumnWidth:I,minColumnWidth:T,onRowMoved:x,lockColumns:$,onColumnProposeMove:G,onMouseDown:X,onMouseUp:ie,onItemHovered:ee,onDragStart:Q,canvasRef:te}=e,se=(k??D??F)!==void 0,{columns:ue,selection:fe}=e,re=fe.columns,H=f.useCallback(ne=>{const[me,xe]=ne.location;o!==void 0&&a!==me&&me>=$?(c(!0),l(me)):h!==void 0&&xe!==void 0?(v(!0),y(Math.max(0,xe))):r===void 0&&!u&&!b&&ee?.(ne)},[o,h,a,ee,$,r,u,b]),P=E!==void 0,Y=f.useCallback(ne=>{if(ne.button===0){const[me,xe]=ne.location;if(ne.kind==="out-of-bounds"&&ne.isEdge&&se){const de=C?.current?.getBounds(ue.length-1,-1);de!==void 0&&(n(de.x),i(ue.length-1))}else if(ne.kind==="header"&&me>=$){const de=te?.current;if(ne.isEdge&&se&&de){n(ne.bounds.x),i(me);const Pe=de.getBoundingClientRect().width/de.offsetWidth,Te=ne.bounds.width/Pe;F?.(ue[me],Te,me,Te+(ue[me].growOffset??0))}else ne.kind==="header"&&P&&(g(ne.bounds.x),s(me))}else ne.kind==="cell"&&$>0&&me===0&&xe!==void 0&&x!==void 0&&(O(ne.bounds.y),m(xe))}X?.(ne)},[X,se,$,x,C,ue,P,F,te]),ce=f.useCallback((ne,me)=>{u||b||R?.(ne,me)},[u,b,R]),he=f.useCallback((ne,me)=>{u||b||M?.(ne,me)},[u,b,M]),ke=f.useRef(-1),Se=f.useCallback(()=>{ke.current=-1,m(void 0),y(void 0),O(void 0),v(!1),s(void 0),l(void 0),g(void 0),c(!1),i(void 0),n(void 0)},[]),Je=f.useCallback((ne,me)=>{if(ne.button===0){if(r!==void 0){if(re?.hasIndex(r)===!0)for(const de of re){if(de===r)continue;const be=ue[de],Pe=qi(be,ke.current,T,I);k?.(be,Pe,de,Pe+(be.growOffset??0))}const xe=qi(ue[r],ke.current,T,I);if(D?.(ue[r],xe,r,xe+(ue[r].growOffset??0)),re.hasIndex(r))for(const de of re){if(de===r)continue;const be=ue[de],Pe=qi(be,ke.current,T,I);D?.(be,Pe,de,Pe+(be.growOffset??0))}}Se(),o!==void 0&&a!==void 0&&G?.(o,a)!==!1&&E?.(o,a),h!==void 0&&p!==void 0&&x?.(h,p)}ie?.(ne,me)},[ie,r,o,a,h,p,re,D,ue,T,I,k,E,x,Se,G]),Ie=f.useMemo(()=>{if(!(o===void 0||a===void 0)&&o!==a&&G?.(o,a)!==!1)return{src:o,dest:a}},[o,a,G]),Qe=f.useCallback(ne=>{const me=te?.current;if(o!==void 0&&d!==void 0)Math.abs(ne.clientX-d)>20&&c(!0);else if(h!==void 0&&S!==void 0)Math.abs(ne.clientY-S)>20&&v(!0);else if(r!==void 0&&t!==void 0&&me){const de=me.getBoundingClientRect().width/me.offsetWidth,be=(ne.clientX-t)/de,Pe=ue[r],Te=qi(Pe,be,T,I);if(k?.(Pe,Te,r,Te+(Pe.growOffset??0)),ke.current=be,re?.first()===r)for(const st of re){if(st===r)continue;const Re=ue[st],qe=qi(Re,ke.current,T,I);k?.(Re,qe,st,qe+(Re.growOffset??0))}}},[o,d,h,S,r,t,ue,T,I,k,re,te]),kt=f.useCallback((ne,me)=>{if(h===void 0||p===void 0)return _(ne,me);let[xe,de]=ne;return de===p?de=h:(de>p&&(de-=1),de>=h&&(de+=1)),_([xe,de],me)},[h,p,_]),$e=f.useCallback(ne=>{Q?.(ne),ne.defaultPrevented()||Se()},[Se,Q]);return f.createElement(c0,{accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,enableGroups:e.enableGroups,eventTargetRef:e.eventTargetRef,experimental:e.experimental,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,headerIcons:e.headerIcons,height:e.height,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,resizeColumn:r,isDraggable:e.isDraggable,isFilling:e.isFilling,isFocused:e.isFocused,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDrop:e.onDrop,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,resizeIndicator:e.resizeIndicator,verticalBorder:e.verticalBorder,width:e.width,getCellContent:kt,isResizing:r!==void 0,onHeaderMenuClick:ce,onHeaderIndicatorClick:he,isDragging:u,onItemHovered:H,onDragStart:$e,onMouseDown:Y,allowResize:se,onMouseUp:Je,dragAndDropState:Ie,onMouseMoveRaw:Qe,ref:C})};function f0(e){const t=f.useRef(null),[n,r]=f.useState({width:e?.[0],height:e?.[1]});return f.useLayoutEffect(()=>{const i=s=>{for(const a of s){const{width:l,height:u}=a&&a.contentRect||{};r(c=>c.width===l&&c.height===u?c:{width:l,height:u})}},o=new window.ResizeObserver(i);return t.current&&o.observe(t.current,void 0),()=>{o.disconnect()}},[t.current]),{ref:t,...n}}const h0=(e,t,n)=>{const r=f.useRef(null),i=f.useRef(null),o=f.useRef(null),s=f.useRef(0),a=f.useRef(t);a.current=t;const l=n.current;f.useEffect(()=>{const u=()=>{if(i.current===!1&&l!==null){const g=[l.scrollLeft,l.scrollTop];if(o.current?.[0]===g[0]&&o.current?.[1]===g[1])if(s.current>10){o.current=null,i.current=null;return}else s.current++;else s.current=0,a.current(g[0],g[1]),o.current=g;r.current=window.setTimeout(u,8.333333333333334)}},c=()=>{i.current=!0,o.current=null,r.current!==null&&(window.clearTimeout(r.current),r.current=null)},d=g=>{g.touches.length===0&&(i.current=!1,s.current=0,r.current=window.setTimeout(u,8.333333333333334))};if(e&&l!==null){const g=l;return g.addEventListener("touchstart",c),g.addEventListener("touchend",d),()=>{g.removeEventListener("touchstart",c),g.removeEventListener("touchend",d),r.current!==null&&window.clearTimeout(r.current)}}},[e,l])},g0=()=>e=>e.isSafari?"scroll":"auto",m0=un("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[g0()]}}),p0=33554400,v0=5e6;function b0(e){const[t,n]=f.useState(!1),r=typeof window>"u"?null:window,i=f.useRef(0);return vn("touchstart",f.useCallback(()=>{window.clearTimeout(i.current),n(!0)},[]),r,!0,!1),vn("touchend",f.useCallback(o=>{o.touches.length===0&&(i.current=window.setTimeout(()=>n(!1),e))},[e]),r,!0,!1),t}const w0=e=>{const{children:t,clientHeight:n,scrollHeight:r,scrollWidth:i,update:o,draggable:s,className:a,preventDiagonalScrolling:l=!1,paddingBottom:u=0,paddingRight:c=0,rightElement:d,rightElementProps:g,kineticScrollPerfHack:h=!1,scrollRef:m,initialSize:p}=e,y=[],b=g?.sticky??!1,v=g?.fill??!1,S=f.useRef(0),O=f.useRef(0),R=f.useRef(null),M=typeof window>"u"?1:window.devicePixelRatio,_=f.useRef(M);f.useEffect(()=>{if(_.current!==M){S.current=0,O.current=0,_.current=M;const fe=R.current;fe!==null&&x.current(fe.scrollLeft,fe.scrollTop)}},[M]);const E=f.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),k=f.useRef(null),F=b0(200),[D,C]=f.useState(!0),I=f.useRef(0);f.useLayoutEffect(()=>{if(!D||F||E.current.lockDirection===void 0)return;const fe=R.current;if(fe===null)return;const[re,H]=E.current.lockDirection;re!==void 0?fe.scrollLeft=re:H!==void 0&&(fe.scrollTop=H),E.current.lockDirection=void 0},[F,D]);const T=f.useCallback((fe,re)=>{const H=R.current;if(H===null)return;re=re??H.scrollTop,fe=fe??H.scrollLeft;const P=E.current.scrollTop,Y=E.current.scrollLeft,ce=fe-Y,he=re-P;F&&ce!==0&&he!==0&&(Math.abs(ce)>3||Math.abs(he)>3)&&l&&E.current.lockDirection===void 0&&(E.current.lockDirection=Math.abs(ce)<Math.abs(he)?[Y,void 0]:[void 0,P]);const ke=E.current.lockDirection;fe=ke?.[0]??fe,re=ke?.[1]??re,E.current.scrollLeft=fe,E.current.scrollTop=re;const Se=H.clientWidth,Je=H.clientHeight,Ie=re,Qe=O.current-Ie,kt=H.scrollHeight-Je;O.current=Ie;let $e;if(kt>0&&r>H.scrollHeight+5)if(Math.abs(Qe)>2e3||Ie===0||Ie===kt){const ne=Math.max(0,Math.min(1,Ie/kt)),me=r-Je;$e=ne*me,S.current=$e}else S.current-=Qe,$e=S.current;else $e=Ie,S.current=$e;$e=Math.max(0,Math.min($e,r-Je)),S.current=$e,ke!==void 0&&(window.clearTimeout(I.current),C(!1),I.current=window.setTimeout(()=>C(!0),200)),o({x:fe,y:$e,width:Se-c,height:Je-u,paddingRight:k.current?.clientWidth??0})},[u,c,r,o,l,F]);h0(h&&oa.value,T,R);const x=f.useRef(T);x.current=T;const $=f.useRef(),G=f.useRef(!1);f.useLayoutEffect(()=>{G.current?T():G.current=!0},[T,u,c]);const X=f.useCallback(fe=>{R.current=fe,m!==void 0&&(m.current=fe)},[m]);let ie=0,ee=0;const Q=Math.min(r,p0);for(y.push(f.createElement("div",{key:ie++,style:{width:i,height:0}}));ee<Q;){const fe=Math.min(v0,Q-ee);y.push(f.createElement("div",{key:ie++,style:{width:0,height:fe}})),ee+=fe}const{ref:te,width:se,height:ue}=f0(p);return typeof window<"u"&&($.current?.height!==ue||$.current?.width!==se)&&(window.setTimeout(()=>x.current(),0),$.current={width:se,height:ue}),(se??0)===0||(ue??0)===0?f.createElement("div",{ref:te}):f.createElement("div",{ref:te},f.createElement(m0,{isSafari:oa.value},f.createElement("div",{className:"dvn-underlay"},t),f.createElement("div",{ref:X,style:$.current,draggable:s,onDragStart:fe=>{s||(fe.stopPropagation(),fe.preventDefault())},className:"dvn-scroller "+(a??""),onScroll:()=>T()},f.createElement("div",{className:"dvn-scroll-inner"+(d===void 0?" dvn-hidden":"")},f.createElement("div",{className:"dvn-stack"},y),d!==void 0&&f.createElement(f.Fragment,null,!v&&f.createElement("div",{className:"dvn-spacer"}),f.createElement("div",{ref:k,style:{height:ue,maxHeight:n-Math.ceil(M%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:c,flexGrow:v?1:void 0,right:b?c??0:void 0,pointerEvents:"auto"}},d))))))},y0=e=>{const{columns:t,rows:n,rowHeight:r,headerHeight:i,groupHeaderHeight:o,enableGroups:s,freezeColumns:a,experimental:l,nonGrowWidth:u,clientSize:c,className:d,onVisibleRegionChanged:g,scrollRef:h,preventDiagonalScrolling:m,rightElement:p,rightElementProps:y,overscrollX:b,overscrollY:v,initialSize:S,smoothScrollX:O=!1,smoothScrollY:R=!1,isDraggable:M}=e,{paddingRight:_,paddingBottom:E}=l??{},[k,F]=c,D=f.useRef(),C=f.useRef(),I=f.useRef(),T=f.useRef(),x=u+Math.max(0,b??0);let $=s?i+o:i;if(typeof r=="number")$+=n*r;else for(let ee=0;ee<n;ee++)$+=r(ee);v!==void 0&&($+=v);const G=f.useRef(),X=f.useCallback(()=>{if(G.current===void 0)return;const ee={...G.current};let Q=0,te=ee.x<0?-ee.x:0,se=0,ue=0;ee.x=ee.x<0?0:ee.x;let fe=0;for(let he=0;he<a;he++)fe+=t[he].width;for(const he of t){const ke=Q-fe;if(ee.x>=ke+he.width)Q+=he.width,ue++,se++;else if(ee.x>ke)Q+=he.width,O?te+=ke-ee.x:ue++,se++;else if(ee.x+ee.width>ke)Q+=he.width,se++;else break}let re=0,H=0,P=0;if(typeof r=="number")R?(H=Math.floor(ee.y/r),re=H*r-ee.y):H=Math.ceil(ee.y/r),P=Math.ceil(ee.height/r)+H,re<0&&P++;else{let he=0;for(let ke=0;ke<n;ke++){const Se=r(ke),Je=he+(R?0:Se/2);if(ee.y>=he+Se)he+=Se,H++,P++;else if(ee.y>Je)he+=Se,R?re+=Je-ee.y:H++,P++;else if(ee.y+ee.height>Se/2+he)he+=Se,P++;else break}}H=Math.max(0,Math.min(H,n-1)),P=Math.max(H,Math.min(P,n));const Y={x:ue,y:H,width:se-ue,height:P-H},ce=D.current;(ce===void 0||ce.y!==Y.y||ce.x!==Y.x||ce.height!==Y.height||ce.width!==Y.width||C.current!==te||I.current!==re||ee.width!==T.current?.[0]||ee.height!==T.current?.[1])&&(g?.({x:ue,y:H,width:se-ue,height:P-H},ee.width,ee.height,ee.paddingRight??0,te,re),D.current=Y,C.current=te,I.current=re,T.current=[ee.width,ee.height])},[t,r,n,g,a,O,R]),ie=f.useCallback(ee=>{G.current=ee,X()},[X]);return f.useEffect(()=>{X()},[X]),f.createElement(w0,{scrollRef:h,className:d,kineticScrollPerfHack:l?.kineticScrollPerfHack,preventDiagonalScrolling:m,draggable:M===!0||typeof M=="string",scrollWidth:x+(_??0),scrollHeight:$+(E??0),clientHeight:F,rightElement:p,paddingBottom:E,paddingRight:_,rightElementProps:y,update:ie,initialSize:S},f.createElement(d0,{eventTargetRef:h,width:k,height:F,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}))},C0=un("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),S0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),x0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),k0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),M0=10,R0=e=>{const{canvasRef:t,cellYOffset:n,rows:r,columns:i,searchInputRef:o,searchValue:s,searchResults:a,onSearchValueChange:l,getCellsForSelection:u,onSearchResultsChanged:c,showSearch:d=!1,onSearchClose:g}=e,[h]=f.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[m,p]=f.useState(""),y=s??m,b=f.useCallback(Q=>{p(Q),l?.(Q)},[l]),[v,S]=f.useState(),O=f.useRef(v);O.current=v,f.useEffect(()=>{a!==void 0&&(a.length>0?S(Q=>({rowsSearched:r,results:a.length,selectedIndex:Q?.selectedIndex??-1})):S(void 0))},[r,a]);const R=f.useRef();R.current===void 0&&(R.current=new AbortController);const M=f.useRef(),[_,E]=f.useState([]),k=a??_,F=f.useCallback(()=>{M.current!==void 0&&(window.cancelAnimationFrame(M.current),M.current=void 0,R.current.abort())},[]),D=f.useRef(n);D.current=n;const C=f.useCallback(Q=>{const te=new RegExp(Q.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let se=D.current,ue=Math.min(10,r),fe=0;S(void 0),E([]);const re=[],H=async()=>{if(u===void 0)return;const P=performance.now(),Y=r-fe;let ce=u({x:0,y:se,width:i.length,height:Math.min(ue,Y,r-se)},R.current.signal);typeof ce=="function"&&(ce=await ce());let he=!1;for(const[kt,$e]of ce.entries())for(const[ne,me]of $e.entries()){let xe;switch(me.kind){case J.Text:case J.Number:xe=me.displayData;break;case J.Uri:case J.Markdown:xe=me.data;break;case J.Boolean:xe=typeof me.data=="boolean"?me.data.toString():void 0;break;case J.Image:case J.Bubble:xe=me.data.join("🐳");break;case J.Custom:xe=me.copyData;break}xe!==void 0&&te.test(xe)&&(re.push([ne,kt+se]),he=!0)}const ke=performance.now();he&&E([...re]),fe+=ce.length,Dn(fe<=r);const Se=O.current?.selectedIndex??-1;S({results:re.length,rowsSearched:fe,selectedIndex:Se}),c?.(re,Se),se+ue>=r?se=0:se+=ue;const Je=ke-P,Ie=Math.max(Je,1),Qe=M0/Ie;ue=Math.ceil(ue*Qe),fe<r&&re.length<1e3&&(M.current=window.requestAnimationFrame(H))};F(),M.current=window.requestAnimationFrame(H)},[F,i.length,u,c,r]),I=f.useCallback(()=>{g?.(),S(void 0),E([]),c?.([],-1),F(),t?.current?.focus()},[F,t,g,c]),T=f.useCallback(Q=>{b(Q.target.value),a===void 0&&(Q.target.value===""?(S(void 0),E([]),F()):C(Q.target.value))},[C,F,b,a]);f.useEffect(()=>{d&&o.current!==null&&(b(""),o.current.focus({preventScroll:!0}))},[d,o,b]);const x=f.useCallback(Q=>{if(Q?.stopPropagation?.(),v===void 0)return;const te=(v.selectedIndex+1)%v.results;S({...v,selectedIndex:te}),c?.(k,te)},[v,c,k]),$=f.useCallback(Q=>{if(Q?.stopPropagation?.(),v===void 0)return;let te=(v.selectedIndex-1)%v.results;te<0&&(te+=v.results),S({...v,selectedIndex:te}),c?.(k,te)},[c,k,v]),G=f.useCallback(Q=>{(Q.ctrlKey||Q.metaKey)&&Q.nativeEvent.code==="KeyF"||Q.key==="Escape"?(I(),Q.stopPropagation(),Q.preventDefault()):Q.key==="Enter"&&(Q.shiftKey?$():x())},[I,x,$]);f.useEffect(()=>()=>{F()},[F]);const[X,ie]=f.useState(!1);f.useEffect(()=>{if(d)ie(!0);else{const Q=setTimeout(()=>ie(!1),150);return()=>clearTimeout(Q)}},[d]);const ee=f.useMemo(()=>{if(!d&&!X)return null;let Q;v!==void 0&&(Q=v.results>=1e3?"over 1000":`${v.results} result${v.results!==1?"s":""}`,v.selectedIndex>=0&&(Q=`${v.selectedIndex+1} of ${Q}`));const te=fe=>{fe.stopPropagation()},ue={width:`${Math.floor((v?.rowsSearched??0)/r*100)}%`};return f.createElement(C0,{className:"gdg-search-bar"+(d?"":" out"),onMouseDown:te,onMouseMove:te,onMouseUp:te,onClick:te},f.createElement("div",{className:"gdg-search-bar-inner"},f.createElement("input",{id:h,"aria-hidden":!d,"data-testid":"search-input",ref:o,onChange:T,value:y,tabIndex:d?void 0:-1,onKeyDownCapture:G}),f.createElement("button",{type:"button","aria-label":"Previous Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:$,disabled:(v?.results??0)===0},S0),f.createElement("button",{type:"button","aria-label":"Next Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:x,disabled:(v?.results??0)===0},x0),g!==void 0&&f.createElement("button",{type:"button","aria-label":"Close Search","aria-hidden":!d,"data-testid":"search-close-button",tabIndex:d?void 0:-1,onClick:I},k0)),v!==void 0?f.createElement(f.Fragment,null,f.createElement("div",{className:"gdg-search-status"},f.createElement("div",{"data-testid":"search-result-area"},Q)),f.createElement("div",{className:"gdg-search-progress",style:ue})):f.createElement("div",{className:"gdg-search-status"},f.createElement("label",{htmlFor:h},"Type to search")))},[d,X,v,r,h,o,T,y,G,$,x,g,I]);return f.createElement(f.Fragment,null,f.createElement(y0,{prelightCells:k,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}),ee)};class E0 extends f.PureComponent{wrapperRef=f.createRef();componentDidMount(){const t=this.props.customEventTarget??document;t.addEventListener("pointerdown",this.clickOutside,!0),t.addEventListener("contextmenu",this.clickOutside,!0)}componentWillUnmount(){const t=this.props.customEventTarget??document;t.removeEventListener("pointerdown",this.clickOutside,!0),t.removeEventListener("contextmenu",this.clickOutside,!0)}clickOutside=t=>{if(!(this.props.isOutsideClick&&!this.props.isOutsideClick(t))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(t.target)){let n=t.target;for(;n!==null;){if(n.classList.contains("click-outside-ignore"))return;n=n.parentElement}this.props.onClickOutside()}};render(){const{onClickOutside:t,isOutsideClick:n,customEventTarget:r,...i}=this.props;return f.createElement("div",{...i,ref:this.wrapperRef},this.props.children)}}const I0=()=>e=>Math.max(16,e.targetHeight-10),T0=un("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[I0(),"px"]}}),D0=e=>{const{bounds:t,group:n,onClose:r,canvasBounds:i,onFinish:o}=e,[s,a]=Vt.useState(n);return Vt.createElement(E0,{style:{position:"absolute",left:t.x-i.left+1,top:t.y-i.top,width:t.width-2,height:t.height},className:"gdg-c1tqibwd",onClickOutside:r},Vt.createElement(T0,{targetHeight:t.height,"data-testid":"group-rename-input",value:s,onBlur:r,onFocus:l=>l.target.setSelectionRange(0,s.length),onChange:l=>a(l.target.value),onKeyDown:l=>{l.key==="Enter"?o(s):l.key==="Escape"&&r()},autoFocus:!0}))};function O0(e,t){return e===void 0?!1:e.length>1&&e.startsWith("_")?Number.parseInt(e.slice(1))===t.keyCode:e.length===1&&e>="a"&&e<="z"?e.toUpperCase().codePointAt(0)===t.keyCode:e===t.key}function ot(e,t,n){const r=Fd(e,t);return r&&(n.didMatch=!0),r}function Fd(e,t){if(e.length===0)return!1;if(e.includes("|")){const l=e.split("|");for(const u of l)if(Fd(u,t))return!0;return!1}let n=!1,r=!1,i=!1,o=!1;const s=e.split("+"),a=s.pop();if(!O0(a,t))return!1;if(s[0]==="any")return!0;for(const l of s)switch(l){case"ctrl":n=!0;break;case"shift":r=!0;break;case"alt":i=!0;break;case"meta":o=!0;break;case"primary":aa.value?o=!0:n=!0;break}return t.altKey===i&&t.ctrlKey===n&&t.shiftKey===r&&t.metaKey===o}function P0(e,t,n,r,i,o,s){const a=Vt.useCallback((c,d,g,h)=>{(o==="cell"||o==="multi-cell")&&c!==void 0&&(c={...c,range:{x:c.cell[0],y:c.cell[1],width:1,height:1}}),!s&&c!==void 0&&c.range.width>1&&(c={...c,range:{...c.range,width:1,x:c.cell[0]}});const m=n==="mixed"&&(g||h==="drag"),p=r==="mixed"&&m,y=i==="mixed"&&m;let b={current:c===void 0?void 0:{...c,rangeStack:h==="drag"?e.current?.rangeStack??[]:[]},columns:p?e.columns:it.empty(),rows:y?e.rows:it.empty()};g&&(o==="multi-rect"||o==="multi-cell")&&b.current!==void 0&&e.current!==void 0&&(b={...b,current:{...b.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(b,d)},[r,e,n,o,s,i,t]),l=Vt.useCallback((c,d,g)=>{c=c??e.rows,d!==void 0&&(c=c.add(d));let h;if(i==="exclusive"&&c.length>0)h={current:void 0,columns:it.empty(),rows:c};else{const m=g&&n==="mixed",p=g&&r==="mixed";h={current:m?e.current:void 0,columns:p?e.columns:it.empty(),rows:c}}t(h,!1)},[r,e,n,i,t]),u=Vt.useCallback((c,d,g)=>{c=c??e.columns,d!==void 0&&(c=c.add(d));let h;if(r==="exclusive"&&c.length>0)h={current:void 0,rows:it.empty(),columns:c};else{const m=g&&n==="mixed",p=g&&i==="mixed";h={current:m?e.current:void 0,rows:p?e.rows:it.empty(),columns:c}}t(h,!1)},[r,e,n,i,t]);return[a,l,u]}function _0(e,t,n,r,i){const o=f.useCallback(u=>{if(e===!0){const c=[];for(let d=u.y;d<u.y+u.height;d++){const g=[];for(let h=u.x;h<u.x+u.width;h++)h<0||d>=i?g.push({kind:J.Loading,allowOverlay:!1}):g.push(t([h,d]));c.push(g)}return c}return e?.(u,r.signal)??[]},[r.signal,t,e,i]),s=e!==void 0?o:void 0,a=f.useCallback(u=>{if(s===void 0)return[];const c={...u,x:u.x-n};if(c.x<0){c.x=0,c.width--;const d=s(c,r.signal);return typeof d=="function"?async()=>(await d()).map(g=>[{kind:J.Loading,allowOverlay:!1},...g]):d.map(g=>[{kind:J.Loading,allowOverlay:!1},...g])}return s(c,r.signal)},[r.signal,s,n]);return[e!==void 0?a:void 0,s]}function F0(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string",doNotEscape:!0};switch(e.kind){case J.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===Vs?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case J.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case J.Image:case J.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case J.Drilldown:return{formatted:e.data.map(t=>t.text),rawValue:e.data.map(t=>t.text),format:"string-array"};case J.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:"string"};case J.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:"url"};case J.Markdown:case J.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case J.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case J.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case J.Protected:return{formatted:"************",rawValue:"",format:"string"};default:to()}}function L0(e,t){return e.map((r,i)=>{const o=t[i];return r.map(s=>s.span!==void 0&&s.span[0]!==o?{formatted:"",rawValue:"",format:"string"}:F0(s))})}function Tu(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function A0(e){const t=[];for(const n of e){const r=[];for(const i of n)i.format==="url"?r.push(i.rawValue?.toString()??""):i.format==="string-array"?r.push(i.formatted.map(o=>Tu(o,!0)).join(",")):r.push(i.doNotEscape===!0?i.formatted:Tu(i.formatted,!1));t.push(r.join(" "))}return t.join(`
|
166
|
-
`)}function
|
167
|
-
`);const g=a.getAttribute("gdg-raw-value"),h=a.getAttribute("gdg-format")??"string";if(a.querySelector("a")!==null)o?.push({rawValue:a.querySelector("a")?.getAttribute("href")??"",formatted:a.textContent??"",format:h});else if(a.querySelector("ol")!==null){const m=a.querySelectorAll("li");o?.push({rawValue:[...m].map(p=>p.getAttribute("gdg-raw-value")??""),formatted:[...m].map(p=>p.textContent??""),format:"string-array"})}else if(g!==null)o?.push({rawValue
|
165
|
+
`},Vp={headerRowID:dp,headerNumber:hp,headerCode:fp,headerString:gp,headerBoolean:mp,headerAudioUri:vp,headerVideoUri:bp,headerEmoji:wp,headerImage:yp,headerUri:kd,headerPhone:Cp,headerMarkdown:Sp,headerDate:xp,headerTime:kp,headerEmail:Mp,headerReference:Rp,headerIfThenElse:Ip,headerSingleValue:Ep,headerLookup:Tp,headerTextTemplate:Dp,headerMath:Op,headerRollup:Pp,headerJoinStrings:_p,headerSplitString:Fp,headerGeoDistance:Lp,headerArray:Ap,rowOwnerOverlay:Hp,protectedColumnOverlay:zp,renameIcon:pp};function $p(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}class Np{onSettled;spriteMap=new Map;headerIcons;inFlight=0;constructor(t,n){this.onSettled=n,this.headerIcons=t??{}}drawSprite(t,n,r,i,o,s,a,l=1){const[u,c]=$p(n,a),d=s*Math.ceil(window.devicePixelRatio),g=`${u}_${c}_${d}_${t}`;let h=this.spriteMap.get(g);if(h===void 0){const m=this.headerIcons[t];if(m===void 0)return;h=document.createElement("canvas");const p=h.getContext("2d");if(p===null)return;const y=new Image;y.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m({fgColor:c,bgColor:u}))}`,this.spriteMap.set(g,h);const b=y.decode();if(b===void 0)return;this.inFlight++,b.then(()=>{p.drawImage(y,0,0,d,d)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else l<1&&(r.globalAlpha=l),r.drawImage(h,0,0,d,d,i,o,s,s),l<1&&(r.globalAlpha=1)}}function Md(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y)}function ya(e,t,n,r,i,o,s,a,l){a=a??t;let u=t,c=e;const d=r-o;let g=!1;for(;u<n&&c<d;){const h=i(c);if(u+h>a&&l(u,c,h,!1,s&&c===r-1)===!0){g=!0;break}u+=h,c++}if(!g){u=n;for(let h=0;h<o;h++){c=r-1-h;const m=i(c);u-=m,l(u,c,m,!0,s&&c===r-1)}}}function Rr(e,t,n,r,i,o){let s=0,a=0;const l=i+r;for(const u of e){const c=u.sticky?a:s+n;if(o(u,c,l,u.sticky?0:a,t)===!0)break;s+=u.width,a+=u.sticky?u.width:0}}function Rd(e,t,n,r,i){let o=0,s=0;for(let a=0;a<e.length;a++){const l=e[a];let u=a+1,c=l.width;for(l.sticky&&(s+=c);u<e.length&&no(e[u].group,l.group)&&e[u].sticky===e[a].sticky;){const p=e[u];c+=p.width,u++,a++,p.sticky&&(s+=p.width)}const d=l.sticky?0:n,g=o+d,h=l.sticky?0:Math.max(0,s-g),m=Math.min(c-h,t-(g+h));i([l.sourceIndex,e[u-1].sourceIndex],l.group??"",g+h,0,m,r),o+=c}}function Id(e,t,n,r,i,o,s){const[a,l]=e;let u,c;const d=s.find(g=>!g.sticky)?.sourceIndex??0;if(l>d){const g=Math.max(a,d);let h=t,m=r;for(let p=o.sourceIndex-1;p>=g;p--)h-=s[p].width,m+=s[p].width;for(let p=o.sourceIndex+1;p<=l;p++)m+=s[p].width;c={x:h,y:n,width:m,height:i}}if(d>a){const g=Math.min(l,d-1);let h=t,m=r;for(let p=o.sourceIndex-1;p>=a;p--)h-=s[p].width,m+=s[p].width;for(let p=o.sourceIndex+1;p<=g;p++)m+=s[p].width;u={x:h,y:n,width:m,height:i}}return[u,c]}function Bp(e,t,n,r){if(r==="any")return Ed(e,{x:t,y:n,width:1,height:1});if(r==="vertical"&&(t=e.x),r==="horizontal"&&(n=e.y),fd([t,n],e))return;const i=t-e.x,o=e.x+e.width-t,s=n-e.y+1,a=e.y+e.height-n,l=Math.min(r==="vertical"?Number.MAX_SAFE_INTEGER:i,r==="vertical"?Number.MAX_SAFE_INTEGER:o,r==="horizontal"?Number.MAX_SAFE_INTEGER:s,r==="horizontal"?Number.MAX_SAFE_INTEGER:a);return l===a?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:l===s?{x:e.x,y:n,width:e.width,height:e.y-n}:l===o?{x:e.x+e.width,y:e.y,width:t-e.x-e.width+1,height:e.height}:{x:t,y:e.y,width:e.x-t,height:e.height}}function ro(e,t,n,r,i,o,s,a){return e<=i+s&&i<=e+n&&t<=o+a&&o<=t+r}function $r(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Ed(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y),i=Math.max(e.x+e.width,t.x+t.width)-n,o=Math.max(e.y+e.height,t.y+t.height)-r;return{x:n,y:r,width:i,height:o}}function Wp(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function Up(e,t,n,r){if(e.x>t||e.y>n||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>n)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=n)return e;const i=-4,o=-4,s=t+4,a=n+4,l=i-e.x,u=e.x+e.width-s,c=o-e.y,d=e.y+e.height-a,g=l>0?e.x+Math.floor(l/r)*r:e.x,h=u>0?e.x+e.width-Math.floor(u/r)*r:e.x+e.width,m=c>0?e.y+Math.floor(c/r)*r:e.y,p=d>0?e.y+e.height-Math.floor(d/r)*r:e.y+e.height;return{x:g,y:m,width:h-g,height:p-m}}function qp(e,t,n,r,i){const[o,s,a,l]=t,[u,c,d,g]=i,{x:h,y:m,width:p,height:y}=e,b=[];if(p<=0||y<=0)return b;const v=h+p,S=m+y,O=h<o,M=m<s,R=h+p>a,_=m+y>l,I=h>=o&&h<a||v>o&&v<=a||h<o&&v>a,k=m>=s&&m<l||S>s&&S<=l||m<s&&S>l;if(I&&k){const D=Math.max(h,o),C=Math.max(m,s),E=Math.min(v,a),T=Math.min(S,l);b.push({rect:{x:D,y:C,width:E-D,height:T-C},clip:{x:u,y:c,width:d-u+1,height:g-c+1}})}if(O&&M){const D=h,C=m,E=Math.min(v,o),T=Math.min(S,s);b.push({rect:{x:D,y:C,width:E-D,height:T-C},clip:{x:0,y:0,width:u+1,height:c+1}})}if(M&&I){const D=Math.max(h,o),C=m,E=Math.min(v,a),T=Math.min(S,s);b.push({rect:{x:D,y:C,width:E-D,height:T-C},clip:{x:u,y:0,width:d-u+1,height:c+1}})}if(M&&R){const D=Math.max(h,a),C=m,E=v,T=Math.min(S,s);b.push({rect:{x:D,y:C,width:E-D,height:T-C},clip:{x:d,y:0,width:n-d+1,height:c+1}})}if(O&&k){const D=h,C=Math.max(m,s),E=Math.min(v,o),T=Math.min(S,l);b.push({rect:{x:D,y:C,width:E-D,height:T-C},clip:{x:0,y:c,width:u+1,height:g-c+1}})}if(R&&k){const D=Math.max(h,a),C=Math.max(m,s),E=v,T=Math.min(S,l);b.push({rect:{x:D,y:C,width:E-D,height:T-C},clip:{x:d,y:c,width:n-d+1,height:g-c+1}})}if(O&&_){const D=h,C=Math.max(m,l),E=Math.min(v,o),T=S;b.push({rect:{x:D,y:C,width:E-D,height:T-C},clip:{x:0,y:g,width:u+1,height:r-g+1}})}if(_&&I){const D=Math.max(h,o),C=Math.max(m,l),E=Math.min(v,a),T=S;b.push({rect:{x:D,y:C,width:E-D,height:T-C},clip:{x:u,y:g,width:d-u+1,height:r-g+1}})}if(R&&_){const D=Math.max(h,a),C=Math.max(m,l),E=v,T=S;b.push({rect:{x:D,y:C,width:E-D,height:T-C},clip:{x:d,y:g,width:n-d+1,height:r-g+1}})}return b}const Gp={kind:J.Loading,allowOverlay:!1};function Su(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m,p,y,b,v,S,O,M,R,_,I,k,F,D,C,E,T,x,N,G,j){let ie=S?.size??Number.MAX_SAFE_INTEGER;const ee=performance.now();let Q=E.baseFontFull;e.font=Q;const te={ctx:e},se=[0,0],ue=y>0?qr(l,y,u):0;let fe,re;const H=Md(v);return Rr(t,a,o,s,i,(P,X,ce,he,ke)=>{const Se=Math.max(0,he-X),Qe=X+Se,Ee=i+1,et=P.width-Se,kt=r-i-1;if(v.length>0){let Pe=!1;for(let Te=0;Te<v.length;Te++){const st=v[Te];if(ro(Qe,Ee,et,kt,st.x,st.y,st.width,st.height)){Pe=!0;break}}if(!Pe)return}const Ne=()=>{e.save(),e.beginPath(),e.rect(Qe,Ee,et,kt),e.clip()},ne=O.columns.hasIndex(P.sourceIndex),me=d(P.group??"").overrideTheme,xe=P.themeOverride===void 0&&me===void 0?E:or(E,me,P.themeOverride),de=xe.baseFontFull;de!==Q&&(Q=de,e.font=de),Ne();let be;return ya(ke,ce,r,l,u,y,b,H,(Pe,Te,st,Re,Ge)=>{if(Te<0||(se[0]=P.sourceIndex,se[1]=Te,S!==void 0&&!S.has(se)))return;if(v.length>0){let De=!1;for(let Et=0;Et<v.length;Et++){const Pt=v[Et];if(ro(X,Pe,P.width,st,Pt.x,Pt.y,Pt.width,Pt.height)){De=!0;break}}if(!De)return}const He=O.rows.hasIndex(Te),we=h.hasIndex(Te),Be=Te<l?c(se):Gp;let mt=X,ft=P.width,Xe=!1,yt=!1;if(Be.span!==void 0){const[De,Et]=Be.span,Pt=`${Te},${De},${Et},${P.sticky}`;if(re===void 0&&(re=new Set),re.has(Pt)){ie--;return}else{const yn=Id(Be.span,X,Pe,P.width,st,P,n),Yt=P.sticky?yn[0]:yn[1];if(!P.sticky&&yn[0]!==void 0&&(yt=!0),Yt!==void 0){mt=Yt.x,ft=Yt.width,re.add(Pt),e.restore(),be=void 0,e.save(),e.beginPath();const dn=Math.max(0,he-Yt.x);e.rect(Yt.x+dn,Pe,Yt.width-dn,st),fe===void 0&&(fe=[]),fe.push({x:Yt.x+dn,y:Pe,width:Yt.width-dn,height:st}),e.clip(),Xe=!0}}}const Xt=g?.(Te),Ht=Ge&&P.trailingRowOptions?.themeOverride!==void 0?P.trailingRowOptions?.themeOverride:void 0,Mt=Be.themeOverride===void 0&&Xt===void 0&&Ht===void 0?xe:or(xe,Xt,Ht,Be.themeOverride);e.beginPath();const nn=zm(se,Be,O);let qt=Vm(se,Be,O,p);const cn=Be.span!==void 0&&O.columns.some(De=>Be.span!==void 0&&De>=Be.span[0]&&De<=Be.span[1]);nn&&!m&&p?qt=0:nn&&p&&(qt=Math.max(qt,1)),cn&&qt++,nn||(He&&qt++,ne&&!Ge&&qt++);const Ot=Be.kind===J.Protected?Mt.bgCellMedium:Mt.bgCell;let ut;if((Re||Ot!==E.bgCell)&&(ut=On(Ot,ut)),qt>0||we){we&&(ut=On(Mt.bgHeader,ut));for(let De=0;De<qt;De++)ut=On(Mt.accentLight,ut)}else if(M!==void 0){for(const De of M)if(De[0]===P.sourceIndex&&De[1]===Te){ut=On(Mt.bgSearchResult,ut);break}}if(R!==void 0)for(let De=0;De<R.length;De++){const Et=R[De],Pt=Et.range;Et.style!=="solid-outline"&&Pt.x<=P.sourceIndex&&P.sourceIndex<Pt.x+Pt.width&&Pt.y<=Te&&Te<Pt.y+Pt.height&&(ut=On(Et.color,ut))}let tn=!1;if(S!==void 0){const De=Pe+1,Pt=(Re?De+st-1:Math.min(De+st-1,r-ue))-De;(Pt!==st-1||mt+1<=he)&&(tn=!0,e.save(),e.beginPath(),e.rect(mt+1,De,ft-1,Pt),e.clip()),ut=ut===void 0?Mt.bgCell:On(ut,Mt.bgCell)}const Ct=P.sourceIndex===n.length-1,rn=Te===l-1;ut!==void 0&&(e.fillStyle=ut,be!==void 0&&(be.fillStyle=ut),S!==void 0?e.fillRect(mt+1,Pe+1,ft-(Ct?2:1),st-(rn?2:1)):e.fillRect(mt,Pe,ft,st)),Be.style==="faded"&&(e.globalAlpha=.6);let Bt;for(let De=0;De<k.length;De++){const Et=k[De];if(Et.item[0]===P.sourceIndex&&Et.item[1]===Te){Bt=Et;break}}if(ft>j&&!yt){const De=Mt.baseFontFull;De!==Q&&(e.font=De,Q=De),be=Td(e,Be,P.sourceIndex,Te,Ct,rn,mt,Pe,ft,st,qt>0,Mt,ut??Mt.bgCell,_,I,Bt?.hoverAmount??0,F,C,ee,D,be,T,x,N,G)}return tn&&e.restore(),Be.style==="faded"&&(e.globalAlpha=1),ie--,Xe&&(e.restore(),be?.deprep?.(te),be=void 0,Ne(),Q=de,e.font=de),ie<=0}),e.restore(),ie<=0}),fe}const Bi=[0,0],Wi={x:0,y:0,width:0,height:0},as=[void 0,()=>{}];let Ts=!1;function Xp(){Ts=!0}function Td(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m,p,y,b,v,S,O,M,R,_,I){let k,F;y!==void 0&&y[0][0]===n&&y[0][1]===r&&(k=y[1][0],F=y[1][1]);let D;Bi[0]=n,Bi[1]=r,Wi.x=s,Wi.y=a,Wi.width=l,Wi.height=u,as[0]=R.getValue(Bi),as[1]=x=>R.setValue(Bi,x),Ts=!1;const C={ctx:e,theme:d,col:n,row:r,cell:t,rect:Wi,highlighted:c,cellFillColor:g,hoverAmount:p,frameTime:v,hoverX:k,drawState:as,hoverY:F,imageLoader:h,spriteManager:m,hyperWrapping:b,overrideCursor:k!==void 0?I:void 0,requestAnimationFrame:Xp},E=qm(C,t.lastUpdated,v,O,i,o),T=_(t);if(T!==void 0){O?.renderer!==T&&(O?.deprep?.(C),O=void 0);const x=T.drawPrep?.(C,O);S!==void 0&&!fi(C.cell)?S(C,()=>T.draw(C,t)):T.draw(C,t),D=x===void 0?void 0:{deprep:x?.deprep,fillStyle:x?.fillStyle,font:x?.font,renderer:T}}return(E||Ts)&&M?.(Bi),D}function Zs(e,t,n,r,i,o,s,a,l=-20,u=-20,c=void 0,d="center",g="square"){const h=Math.floor(i+s/2),m=g==="circle"?1e4:t.roundingRadius??4;let p=nd(c??t.checkboxMaxSize,s,t.cellVerticalPadding),y=p/2;const b=td(d,r,o,t.cellHorizontalPadding,p),v=ed(b,h,p),S=rd(r+l,i+u,v);switch(n){case!0:{e.beginPath(),Jn(e,b-p/2,h-p/2,p,p,m),g==="circle"&&(y*=.8,p*=.8),e.fillStyle=a?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(b-y+p/4.23,h-y+p/1.97),e.lineTo(b-y+p/2.42,h-y+p/1.44),e.lineTo(b-y+p/1.29,h-y+p/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case ta:case!1:{e.beginPath(),Jn(e,b-p/2+.5,h-p/2+.5,p-1,p-1,m),e.lineWidth=1,e.strokeStyle=S?t.textDark:t.textMedium,e.stroke();break}case Vs:{e.beginPath(),Jn(e,b-p/2,h-p/2,p,p,m),e.fillStyle=S?t.textMedium:t.textLight,e.fill(),g==="circle"&&(y*=.8,p*=.8),e.beginPath(),e.moveTo(b-p/3,h),e.lineTo(b+p/3,h),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:to()}}function Yp(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m,p,y,b,v){const S=s+a;if(S<=0)return;e.fillStyle=d.bgHeader,e.fillRect(0,0,i,S);const O=r?.[0]?.[0],M=r?.[0]?.[1],R=r?.[1]?.[0],_=r?.[1]?.[1],I=d.headerFontFull;e.font=I,Rr(t,0,o,0,S,(k,F,D,C)=>{if(y!==void 0&&!y.has([k.sourceIndex,-1]))return;const E=Math.max(0,C-F);e.save(),e.beginPath(),e.rect(F+E,a,k.width-E,s),e.clip();const T=p(k.group??"").overrideTheme,x=k.themeOverride===void 0&&T===void 0?d:or(d,T,k.themeOverride);x.bgHeader!==d.bgHeader&&(e.fillStyle=x.bgHeader,e.fill()),x!==d&&(e.font=x.headerFontFull);const N=c.columns.hasIndex(k.sourceIndex),G=l!==void 0||u||k.headerRowMarkerDisabled===!0,j=!G&&M===-1&&O===k.sourceIndex,ie=G?0:h.find(ue=>ue.item[0]===k.sourceIndex&&ue.item[1]===-1)?.hoverAmount??0,ee=c?.current!==void 0&&c.current.cell[0]===k.sourceIndex,Q=N?x.accentColor:ee?x.bgHeaderHasFocus:x.bgHeader,te=n?a:0,se=k.sourceIndex===0?0:1;N?(e.fillStyle=Q,e.fillRect(F+se,te,k.width-se,s)):(ee||ie>0)&&(e.beginPath(),e.rect(F+se,te,k.width-se,s),ee&&(e.fillStyle=x.bgHeaderHasFocus,e.fill()),ie>0&&(e.globalAlpha=ie,e.fillStyle=x.bgHeaderHovered,e.fill(),e.globalAlpha=1)),Pd(e,F,te,k.width,s,k,N,x,j,j?R:void 0,j?_:void 0,ee,ie,g,b,v),e.restore()}),n&&jp(e,t,i,o,a,r,d,g,h,m,p,y)}function jp(e,t,n,r,i,o,s,a,l,u,c,d){const[h,m]=o?.[0]??[];let p=0;Rd(t,n,r,i,(y,b,v,S,O,M)=>{if(d!==void 0&&!d.hasItemInRectangle({x:y[0],y:-2,width:y[1]-y[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(v,S,O,M),e.clip();const R=c(b),_=R?.overrideTheme===void 0?s:or(s,R.overrideTheme),I=m===-2&&h!==void 0&&h>=y[0]&&h<=y[1],k=I?_.bgGroupHeaderHovered??_.bgHeaderHovered:_.bgGroupHeader??_.bgHeader;if(k!==s.bgHeader&&(e.fillStyle=k,e.fill()),e.fillStyle=_.textGroupHeader??_.textHeader,R!==void 0){let F=v;if(R.icon!==void 0&&(a.drawSprite(R.icon,"normal",e,F+8,(i-20)/2,20,_),F+=26),e.fillText(R.name,F+8,i/2+Qn(e,s.headerFontFull)),R.actions!==void 0&&I){const D=Dd({x:v,y:S,width:O,height:M},R.actions);e.beginPath();const C=D[0].x-10,E=v+O-C;e.rect(C,0,E,i);const T=e.createLinearGradient(C,0,C+E,0),x=Nr(k,0);T.addColorStop(0,x),T.addColorStop(10/E,k),T.addColorStop(1,k),e.fillStyle=T,e.fill(),e.globalAlpha=.6;const[N,G]=o?.[1]??[-1,-1];for(let j=0;j<R.actions.length;j++){const ie=R.actions[j],ee=D[j],Q=$r(ee,N+v,G);Q&&(e.globalAlpha=1),a.drawSprite(ie.icon,"normal",e,ee.x+ee.width/2-10,ee.y+ee.height/2-10,20,_),Q&&(e.globalAlpha=.6)}e.globalAlpha=1}}v!==0&&u(y[0])&&(e.beginPath(),e.moveTo(v+.5,0),e.lineTo(v+.5,i),e.strokeStyle=s.borderColor,e.lineWidth=1,e.stroke()),e.restore(),p=v+O}),e.beginPath(),e.moveTo(p+.5,0),e.lineTo(p+.5,i),e.moveTo(0,i+.5),e.lineTo(n,i+.5),e.strokeStyle=s.borderColor,e.lineWidth=1,e.stroke()}const zo=30;function Kp(e,t,n,r,i){return{x:e+n-zo,y:Math.max(t,t+r/2-zo/2),width:zo,height:Math.min(zo,r)}}function Dd(e,t){const n=[];let r=e.x+e.width-26*t.length;const i=e.y+e.height/2-13,o=26,s=26;for(let a=0;a<t.length;a++)n.push({x:r,y:i,width:s,height:o}),r+=26;return n}function Ui(e,t,n){return!n||e===void 0||(e.x=t-(e.x-t)-e.width),e}function Od(e,t,n,r,i,o,s,a){const l=s.cellHorizontalPadding,u=s.headerIconSize,c=Kp(n,r,i,o);let d=n+l;const g=t.icon===void 0?void 0:{x:d,y:r+(o-u)/2,width:u,height:u},h=g===void 0||t.overlayIcon===void 0?void 0:{x:g.x+9,y:g.y+6,width:18,height:18};g!==void 0&&(d+=Math.ceil(u*1.3));const m={x:d,y:r,width:i-d,height:o};let p;if(t.indicatorIcon!==void 0){const b=e===void 0?pd(t.title,s.headerFontFull)?.width??0:Gr(t.title,e,s.headerFontFull).width;m.width=b,d+=b+l,p={x:d,y:r+(o-u)/2,width:u,height:u}}const y=n+i/2;return{menuBounds:Ui(c,y,a),iconBounds:Ui(g,y,a),iconOverlayBounds:Ui(h,y,a),textBounds:Ui(m,y,a),indicatorIconBounds:Ui(p,y,a)}}function xu(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m,p){if(o.rowMarker!==void 0&&o.headerRowMarkerDisabled!==!0){const v=o.rowMarkerChecked;v!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=d);const S=o.headerRowMarkerTheme!==void 0?or(a,o.headerRowMarkerTheme):a;Zs(e,S,v,t,n,r,i,!1,void 0,void 0,a.checkboxMaxSize,"center",o.rowMarker),v!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=1);return}const y=s?a.textHeaderSelected:a.textHeader,b=o.hasMenu===!0&&(l||h&&s)&&p.menuBounds!==void 0;if(o.icon!==void 0&&p.iconBounds!==void 0){let v=s?"selected":"normal";o.style==="highlight"&&(v=s?"selected":"special"),g.drawSprite(o.icon,v,e,p.iconBounds.x,p.iconBounds.y,p.iconBounds.width,a),o.overlayIcon!==void 0&&p.iconOverlayBounds!==void 0&&g.drawSprite(o.overlayIcon,s?"selected":"special",e,p.iconOverlayBounds.x,p.iconOverlayBounds.y,p.iconOverlayBounds.width,a)}if(b&&r>35){const S=m?35:r-35,O=m?35*.7:r-35*.7,M=S/r,R=O/r,_=e.createLinearGradient(t,0,t+r,0),I=Nr(y,0);_.addColorStop(m?1:0,y),_.addColorStop(M,y),_.addColorStop(R,I),_.addColorStop(m?0:1,I),e.fillStyle=_}else e.fillStyle=y;if(m&&(e.textAlign="right"),p.textBounds!==void 0&&e.fillText(o.title,m?p.textBounds.x+p.textBounds.width:p.textBounds.x,n+i/2+Qn(e,a.headerFontFull)),m&&(e.textAlign="left"),o.indicatorIcon!==void 0&&p.indicatorIconBounds!==void 0&&(!b||!ro(p.menuBounds.x,p.menuBounds.y,p.menuBounds.width,p.menuBounds.height,p.indicatorIconBounds.x,p.indicatorIconBounds.y,p.indicatorIconBounds.width,p.indicatorIconBounds.height))){let v=s?"selected":"normal";o.style==="highlight"&&(v=s?"selected":"special"),g.drawSprite(o.indicatorIcon,v,e,p.indicatorIconBounds.x,p.indicatorIconBounds.y,p.indicatorIconBounds.width,a)}if(b&&p.menuBounds!==void 0){const v=p.menuBounds,S=u!==void 0&&c!==void 0&&$r(v,u+t,c+n);if(S||(e.globalAlpha=.7),o.menuIcon===void 0||o.menuIcon===na.Triangle){e.beginPath();const O=v.x+v.width/2-5.5,M=v.y+v.height/2-3;jm(e,[{x:O,y:M},{x:O+11,y:M},{x:O+5.5,y:M+6}],1),e.fillStyle=y,e.fill()}else if(o.menuIcon===na.Dots){e.beginPath();const O=v.x+v.width/2,M=v.y+v.height/2;Ym(e,O,M),e.fillStyle=y,e.fill()}else{const O=v.x+(v.width-a.headerIconSize)/2,M=v.y+(v.height-a.headerIconSize)/2;g.drawSprite(o.menuIcon,"normal",e,O,M,a.headerIconSize,a)}S||(e.globalAlpha=1)}}function Pd(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m,p){const y=Ws(o.title)==="rtl",b=Od(e,o,t,n,r,i,a,y);m!==void 0?m({ctx:e,theme:a,rect:{x:t,y:n,width:r,height:i},column:o,columnIndex:o.sourceIndex,isSelected:s,hoverAmount:g,isHovered:l,hasSelectedCell:d,spriteManager:h,menuBounds:b?.menuBounds??{x:0,y:0,height:0,width:0},hoverX:u,hoverY:c},()=>xu(e,t,n,r,i,o,s,a,l,u,c,g,h,p,y,b)):xu(e,t,n,r,i,o,s,a,l,u,c,g,h,p,y,b)}function Zp(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m,p,y,b,v){if(b!==void 0||t[t.length-1]!==n[t.length-1])return;const S=Md(y);Rr(t,l,s,a,o,(O,M,R,_,I)=>{if(O!==t[t.length-1])return;M+=O.width;const k=Math.max(M,_);k>r||(e.save(),e.beginPath(),e.rect(k,o+1,1e4,i-o-1),e.clip(),ya(I,R,i,u,c,m,p,S,(F,D,C,E)=>{if(!E&&y.length>0&&!y.some(j=>ro(M,F,1e4,C,j.x,j.y,j.width,j.height)))return;const T=g.hasIndex(D),x=h.hasIndex(D);e.beginPath();const N=d?.(D),G=N===void 0?v:or(v,N);G.bgCell!==v.bgCell&&(e.fillStyle=G.bgCell,e.fillRect(M,F,1e4,C)),x&&(e.fillStyle=G.bgHeader,e.fillRect(M,F,1e4,C)),T&&(e.fillStyle=G.accentLight,e.fillRect(M,F,1e4,C))}),e.restore())})}function Jp(e,t,n,r,i,o,s,a,l){let u=!1;for(const m of t)if(!m.sticky){u=s(m.sourceIndex);break}const c=l.horizontalBorderColor??l.borderColor,d=l.borderColor,g=u?vi(t):0;let h;if(g!==0&&(h=du(d,l.bgCell),e.beginPath(),e.moveTo(g+.5,0),e.lineTo(g+.5,r),e.strokeStyle=h,e.stroke()),i>0){const m=d===c&&h!==void 0?h:du(c,l.bgCell),p=qr(o,i,a);e.beginPath(),e.moveTo(0,r-p+.5),e.lineTo(n,r-p+.5),e.strokeStyle=m,e.stroke()}}const _d=(e,t,n)=>{let r=0,i=t,o=0,s=n;if(e!==void 0&&e.length>0){r=Number.MAX_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;for(const a of e)r=Math.min(r,a.x-1),i=Math.max(i,a.x+a.width+1),o=Math.min(o,a.y-1),s=Math.max(s,a.y+a.height+1)}return{minX:r,maxX:i,minY:o,maxY:s}};function Qp(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m){const p=m.bgCell,{minX:y,maxX:b,minY:v,maxY:S}=_d(a,o,s),O=[],M=s-qr(h,g,u);let R=l,_=n,I=0;for(;R+i<M;){const C=R+i,E=u(_);if(C>=v&&C<=S-1){const x=c?.(_)?.bgCell;x!==void 0&&x!==p&&_>=h-g&&O.push({x:y,y:C,w:b-y,h:E,color:x})}R+=E,_<h-g&&(I=R),_++}let k=0;const F=Math.min(M,S)-I;if(F>0)for(let C=0;C<t.length;C++){const E=t[C];if(E.width===0)continue;const T=E.sticky?k:k+r,x=E.themeOverride?.bgCell;x!==void 0&&x!==p&&T>=y&&T<=b&&d(C+1)&&O.push({x:T,y:I,w:E.width,h:F,color:x}),k+=E.width}if(O.length===0)return;let D;e.beginPath();for(let C=O.length-1;C>=0;C--){const E=O[C];D===void 0?D=E.color:E.color!==D&&(e.fillStyle=D,e.fill(),e.beginPath(),D=E.color),e.rect(E.x,E.y,E.w,E.h)}D!==void 0&&(e.fillStyle=D,e.fill()),e.beginPath()}function ku(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m,p,y,b=!1){if(l!==void 0){e.beginPath(),e.save(),e.rect(0,0,o,s);for(const C of l)e.rect(C.x+1,C.y+1,C.width-1,C.height-1);e.clip("evenodd")}const v=y.horizontalBorderColor??y.borderColor,S=y.borderColor,{minX:O,maxX:M,minY:R,maxY:_}=_d(a,o,s),I=[];e.beginPath();let k=.5;for(let C=0;C<t.length;C++){const E=t[C];if(E.width===0)continue;k+=E.width;const T=E.sticky?k:k+r;T>=O&&T<=M&&h(C+1)&&I.push({x1:T,y1:Math.max(u,R),x2:T,y2:Math.min(s,_),color:S})}let F=s+.5;for(let C=p-m;C<p;C++){const E=d(C);F-=E,I.push({x1:O,y1:F,x2:M,y2:F,color:v})}if(b!==!0){let C=c+.5,E=n;const T=F;for(;C+i<T;){const x=C+i;if(x>=R&&x<=_-1){const N=g?.(E);I.push({x1:O,y1:x,x2:M,y2:x,color:N?.horizontalBorderColor??N?.borderColor??v})}C+=d(E),E++}}const D=Sh(I,C=>C.color);for(const C of Object.keys(D)){e.strokeStyle=C;for(const E of D[C])e.moveTo(E.x1,E.y1),e.lineTo(E.x2,E.y2);e.stroke(),e.beginPath()}l!==void 0&&e.restore()}function e0(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m,p,y,b,v){const S=[];e.imageSmoothingEnabled=!1;const O=Math.min(i.cellYOffset,s),M=Math.max(i.cellYOffset,s);let R=0;if(typeof b=="number")R+=(M-O)*b;else for(let T=O;T<M;T++)R+=b(T);s>i.cellYOffset&&(R=-R),R+=l-i.translateY;const _=Math.min(i.cellXOffset,o),I=Math.max(i.cellXOffset,o);let k=0;for(let T=_;T<I;T++)k+=p[T].width;o>i.cellXOffset&&(k=-k),k+=a-i.translateX;const F=vi(y);if(k!==0&&R!==0)return{regions:[]};const D=u>0?qr(g,u,b):0,C=c-F-Math.abs(k),E=d-h-D-Math.abs(R)-1;if(C>150&&E>150){const T={sx:0,sy:0,sw:c*m,sh:d*m,dx:0,dy:0,dw:c*m,dh:d*m};if(R>0?(T.sy=(h+1)*m,T.sh=E*m,T.dy=(R+h+1)*m,T.dh=E*m,S.push({x:0,y:h,width:c,height:R+1})):R<0&&(T.sy=(-R+h+1)*m,T.sh=E*m,T.dy=(h+1)*m,T.dh=E*m,S.push({x:0,y:d+R-D,width:c,height:-R+D})),k>0?(T.sx=F*m,T.sw=C*m,T.dx=(k+F)*m,T.dw=C*m,S.push({x:F-1,y:0,width:k+2,height:d})):k<0&&(T.sx=(F-k)*m,T.sw=C*m,T.dx=F*m,T.dw=C*m,S.push({x:c+k,y:0,width:-k,height:d})),e.setTransform(1,0,0,1,0,0),v){if(F>0&&k!==0&&R===0&&(r===void 0||n?.[1]!==!1)){const x=F*m,N=d*m;e.drawImage(t,0,0,x,N,0,0,x,N)}if(D>0&&k===0&&R!==0&&(r===void 0||n?.[0]!==!1)){const x=(d-D)*m,N=c*m,G=D*m;e.drawImage(t,0,x,N,G,0,x,N,G)}}e.drawImage(t,T.sx,T.sy,T.sw,T.sh,T.dx,T.dy,T.dw,T.dh),e.scale(m,m)}return e.imageSmoothingEnabled=!0,{regions:S}}function t0(e,t,n,r,i,o,s,a,l,u){const c=[];return t!==e.cellXOffset||n!==e.cellYOffset||r!==e.translateX||i!==e.translateY||Rr(l,n,r,i,a,(d,g,h,m)=>{if(d.sourceIndex===u){const p=Math.max(g,m)+1;return c.push({x:p,y:0,width:o-p,height:s}),!0}}),c}function n0(e,t){if(t===void 0||e.width!==t.width||e.height!==t.height||e.theme!==t.theme||e.headerHeight!==t.headerHeight||e.rowHeight!==t.rowHeight||e.rows!==t.rows||e.freezeColumns!==t.freezeColumns||e.getRowThemeOverride!==t.getRowThemeOverride||e.isFocused!==t.isFocused||e.isResizing!==t.isResizing||e.verticalBorder!==t.verticalBorder||e.getCellContent!==t.getCellContent||e.highlightRegions!==t.highlightRegions||e.selection!==t.selection||e.dragAndDropState!==t.dragAndDropState||e.prelightCells!==t.prelightCells||e.touchMode!==t.touchMode||e.maxScaleFactor!==t.maxScaleFactor)return!1;if(e.mappedColumns!==t.mappedColumns){if(e.mappedColumns.length>100||e.mappedColumns.length!==t.mappedColumns.length)return!1;let n;for(let r=0;r<e.mappedColumns.length;r++){const i=e.mappedColumns[r],o=t.mappedColumns[r];if(pi(i,o))continue;if(n!==void 0||i.width===o.width)return!1;const{width:s,...a}=i,{width:l,...u}=o;if(!pi(a,u))return!1;n=r}return n===void 0?!0:n}return!0}function Mu(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m,p){const y=m?.filter(_=>_.style!=="no-outline");if(y===void 0||y.length===0)return;const b=vi(a),v=qr(h,g,d),S=[l,0,a.length,h-g],O=[b,0,t,n-v],M=y.map(_=>{const I=_.range,k=_.style??"dashed";return qp(I,S,t,n,O).map(F=>{const D=F.rect,C=Is(D.x,D.y,t,n,c,u+c,r,i,o,s,h,l,g,a,d),E=D.width===1&&D.height===1?C:Is(D.x+D.width-1,D.y+D.height-1,t,n,c,u+c,r,i,o,s,h,l,g,a,d);return D.x+D.width>=a.length&&(E.width-=1),D.y+D.height>=h&&(E.height-=1),{color:_.color,style:k,clip:F.clip,rect:Up({x:C.x,y:C.y,width:E.x+E.width-C.x,height:E.y+E.height-C.y},t,n,8)}})}),R=()=>{e.lineWidth=1;let _=!1;for(const I of M)for(const k of I)if(k?.rect!==void 0&&ro(0,0,t,n,k.rect.x,k.rect.y,k.rect.width,k.rect.height)){const F=_,D=!Wp(k.clip,k.rect);e.beginPath(),D&&(e.save(),e.rect(k.clip.x,k.clip.y,k.clip.width,k.clip.height),e.clip()),k.style==="dashed"&&!_?(e.setLineDash([5,3]),_=!0):(k.style==="solid"||k.style==="solid-outline")&&_&&(e.setLineDash([]),_=!1),e.strokeStyle=k.style==="solid-outline"?On(On(k.color,p.borderColor),p.bgCell):Nr(k.color,1),e.closePath(),e.strokeRect(k.rect.x+.5,k.rect.y+.5,k.rect.width-1,k.rect.height-1),D&&(e.restore(),_=F)}_&&e.setLineDash([])};return R(),R}function Ru(e,t,n,r,i){e.beginPath(),e.moveTo(t,n),e.lineTo(t,r),e.lineWidth=2,e.strokeStyle=i,e.stroke(),e.globalAlpha=1}function ss(e,t,n,r,i,o,s,a,l,u,c,d,g,h,m,p,y){if(c.current===void 0)return;const b=c.current.range,v=c.current.cell,S=[b.x+b.width-1,b.y+b.height-1];if(v[1]>=y&&S[1]>=y||!s.some(T=>T.sourceIndex===v[0]||T.sourceIndex===S[0]))return;const[M,R]=c.current.cell,_=g(c.current.cell),I=_.span??[M,M],k=R>=y-h,F=h>0&&!k?qr(y,h,d)-1:0,D=S[1];let C;if(Rr(s,r,i,o,u,(T,x,N,G,j)=>{if(T.sticky&&M>T.sourceIndex)return;const ie=T.sourceIndex<I[0],ee=T.sourceIndex>I[1],Q=T.sourceIndex===S[0];if(!(!Q&&(ie||ee)))return ya(j,N,n,y,d,h,m,void 0,(te,se,ue)=>{if(se!==R&&se!==D)return;let fe=x,re=T.width;if(_.span!==void 0){const P=Id(_.span,x,te,T.width,ue,T,a),X=T.sticky?P[0]:P[1];X!==void 0&&(fe=X.x,re=X.width)}return se===D&&Q&&p&&(C=()=>{G>fe&&!T.sticky&&(e.beginPath(),e.rect(G,0,t-G,n),e.clip()),e.beginPath(),e.rect(fe+re-4,te+ue-4,4,4),e.fillStyle=T.themeOverride?.accentColor??l.accentColor,e.fill()}),C!==void 0}),C!==void 0}),C===void 0)return;const E=()=>{e.save(),e.beginPath(),e.rect(0,u,t,n-u-F),e.clip(),C?.(),e.restore()};return E(),E}function r0(e,t,n,r,i,o,s,a,l){l===void 0||l.size===0||(e.beginPath(),Rd(t,n,o,r,(u,c,d,g,h,m)=>{l.hasItemInRectangle({x:u[0],y:-2,width:u[1]-u[0]+1,height:1})&&e.rect(d,g,h,m)}),Rr(t,a,o,s,i,(u,c,d,g)=>{const h=Math.max(0,g-c),m=c+h+1,p=u.width-h-1;l.has([u.sourceIndex,-1])&&e.rect(m,r,p,i-r)}),e.clip())}function i0(e,t,n,r,i,o,s,a,l,u){let c=0;return Rr(e,o,r,i,n,(d,g,h,m,p)=>(ya(p,h,t,s,a,l,u,void 0,(y,b,v,S)=>{S||(c=Math.max(b,c))}),!0)),c}function Iu(e,t){const{canvasCtx:n,headerCanvasCtx:r,width:i,height:o,cellXOffset:s,cellYOffset:a,translateX:l,translateY:u,mappedColumns:c,enableGroups:d,freezeColumns:g,dragAndDropState:h,theme:m,drawFocus:p,headerHeight:y,groupHeaderHeight:b,disabledRows:v,rowHeight:S,verticalBorder:O,overrideCursor:M,isResizing:R,selection:_,fillHandle:I,freezeTrailingRows:k,rows:F,getCellContent:D,getGroupDetails:C,getRowThemeOverride:E,isFocused:T,drawHeaderCallback:x,prelightCells:N,drawCellCallback:G,highlightRegions:j,resizeCol:ie,imageLoader:ee,lastBlitData:Q,hoverValues:te,hyperWrapping:se,hoverInfo:ue,spriteManager:fe,maxScaleFactor:re,hasAppendRow:H,touchMode:P,enqueue:X,renderStateProvider:ce,getCellRenderer:he,renderStrategy:ke,bufferACtx:Se,bufferBCtx:Qe,damage:Ee,minimumCellWidth:et,resizeIndicator:kt}=e;if(i===0||o===0)return;const Ne=ke==="double-buffer",ne=Math.min(re,Math.ceil(window.devicePixelRatio??1)),me=ke!=="direct"&&n0(e,t),xe=n.canvas;(xe.width!==i*ne||xe.height!==o*ne)&&(xe.width=i*ne,xe.height=o*ne,xe.style.width=i+"px",xe.style.height=o+"px");const de=r.canvas,be=d?b+y:y,Pe=be+1;(de.width!==i*ne||de.height!==Pe*ne)&&(de.width=i*ne,de.height=Pe*ne,de.style.width=i+"px",de.style.height=Pe+"px");const Te=Se.canvas,st=Qe.canvas;Ne&&(Te.width!==i*ne||Te.height!==o*ne)&&(Te.width=i*ne,Te.height=o*ne,Q.current!==void 0&&(Q.current.aBufferScroll=void 0)),Ne&&(st.width!==i*ne||st.height!==o*ne)&&(st.width=i*ne,st.height=o*ne,Q.current!==void 0&&(Q.current.bBufferScroll=void 0));const Re=Q.current;if(me===!0&&s===Re?.cellXOffset&&a===Re?.cellYOffset&&l===Re?.translateX&&u===Re?.translateY)return;let Ge=null;Ne&&(Ge=n);const He=r;let we;Ne?Ee!==void 0?we=Re?.lastBuffer==="b"?Qe:Se:we=Re?.lastBuffer==="b"?Se:Qe:we=n;const Be=we.canvas,mt=Ne?Be===Te?st:Te:xe,ft=typeof S=="number"?()=>S:S;He.save(),we.save(),He.beginPath(),we.beginPath(),He.textBaseline="middle",we.textBaseline="middle",ne!==1&&(He.scale(ne,ne),we.scale(ne,ne));const Xe=Rs(c,s,i,h,l);let yt=[];const Xt=p&&_.current?.cell[1]===a&&u===0;let Ht=!1;if(j!==void 0){for(const Ct of j)if(Ct.style!=="no-outline"&&Ct.range.y===a&&u===0){Ht=!0;break}}const Mt=()=>{Yp(He,Xe,d,ue,i,l,y,b,h,R,_,m,fe,te,O,C,Ee,x,P),ku(He,Xe,a,l,u,i,o,void 0,void 0,b,be,ft,E,O,k,F,m,!0),He.beginPath(),He.moveTo(0,Pe-.5),He.lineTo(i,Pe-.5),He.strokeStyle=On(m.headerBottomBorderColor??m.horizontalBorderColor??m.borderColor,m.bgHeader),He.stroke(),Ht&&Mu(He,i,o,s,a,l,u,c,g,y,b,S,k,F,j,m),Xt&&ss(He,i,o,a,l,u,Xe,c,m,be,_,ft,D,k,H,I,F)};if(Ee!==void 0){const Ct=Xe[Xe.length-1].sourceIndex+1,rn=Ee.hasItemInRegion([{x:s,y:-2,width:Ct,height:2},{x:s,y:a,width:Ct,height:300},{x:0,y:a,width:g,height:300},{x:0,y:-2,width:g,height:2},{x:s,y:F-k,width:Ct,height:k,when:k>0}]),Bt=De=>{Su(De,Xe,c,o,be,l,u,a,F,ft,D,C,E,v,T,p,k,H,yt,Ee,_,N,j,ee,fe,te,ue,G,se,m,X,ce,he,M,et);const Et=_.current;I&&p&&Et!==void 0&&Ee.has(hd(Et.range))&&ss(De,i,o,a,l,u,Xe,c,m,be,_,ft,D,k,H,I,F)};rn&&(Bt(we),Ge!==null&&(Ge.save(),Ge.scale(ne,ne),Ge.textBaseline="middle",Bt(Ge),Ge.restore()),Ee.hasHeader()&&(r0(He,Xe,i,b,be,l,u,a,Ee),Mt())),we.restore(),He.restore();return}if((me!==!0||s!==Re?.cellXOffset||l!==Re?.translateX||Xt!==Re?.mustDrawFocusOnHeader||Ht!==Re?.mustDrawHighlightRingsOnHeader)&&Mt(),me===!0){Dn(mt!==void 0&&Re!==void 0);const{regions:Ct}=e0(we,mt,mt===Te?Re.aBufferScroll:Re.bBufferScroll,mt===Te?Re.bBufferScroll:Re.aBufferScroll,Re,s,a,l,u,k,i,o,F,be,ne,c,Xe,S,Ne);yt=Ct}else me!==!1&&(Dn(Re!==void 0),yt=t0(Re,s,a,l,u,i,o,be,Xe,me));Jp(we,Xe,i,o,k,F,O,ft,m);const nn=Mu(we,i,o,s,a,l,u,c,g,y,b,S,k,F,j,m),qt=p?ss(we,i,o,a,l,u,Xe,c,m,be,_,ft,D,k,H,I,F):void 0;if(we.fillStyle=m.bgCell,yt.length>0){we.beginPath();for(const Ct of yt)we.rect(Ct.x,Ct.y,Ct.width,Ct.height);we.clip(),we.fill(),we.beginPath()}else we.fillRect(0,0,i,o);const cn=Su(we,Xe,c,o,be,l,u,a,F,ft,D,C,E,v,T,p,k,H,yt,Ee,_,N,j,ee,fe,te,ue,G,se,m,X,ce,he,M,et);Zp(we,Xe,c,i,o,be,l,u,a,F,ft,E,_.rows,v,k,H,yt,Ee,m),Qp(we,Xe,a,l,u,i,o,yt,be,ft,E,O,k,F,m),ku(we,Xe,a,l,u,i,o,yt,cn,b,be,ft,E,O,k,F,m),nn?.(),qt?.(),R&&kt!=="none"&&Rr(Xe,0,l,0,be,(Ct,rn)=>Ct.sourceIndex===ie?(Ru(He,rn+Ct.width,0,be+1,On(m.resizeIndicatorColor??m.accentLight,m.bgHeader)),kt==="full"&&Ru(we,rn+Ct.width,be,o,On(m.resizeIndicatorColor??m.accentLight,m.bgCell)),!0):!1),Ge!==null&&(Ge.fillStyle=m.bgCell,Ge.fillRect(0,0,i,o),Ge.drawImage(we.canvas,0,0));const Ot=i0(Xe,o,be,l,u,a,F,ft,k,H);ee?.setWindow({x:s,y:a,width:Xe.length,height:Ot-a},g,Array.from({length:k},(Ct,rn)=>F-1-rn));const ut=Re!==void 0&&(s!==Re.cellXOffset||l!==Re.translateX),tn=Re!==void 0&&(a!==Re.cellYOffset||u!==Re.translateY);Q.current={cellXOffset:s,cellYOffset:a,translateX:l,translateY:u,mustDrawFocusOnHeader:Xt,mustDrawHighlightRingsOnHeader:Ht,lastBuffer:Ne?Be===Te?"a":"b":void 0,aBufferScroll:Be===Te?[ut,tn]:Re?.aBufferScroll,bBufferScroll:Be===st?[ut,tn]:Re?.bBufferScroll},we.restore(),He.restore()}const o0=80;function a0(e){const t=e-1;return t*t*t+1}class s0{callback;constructor(t){this.callback=t}currentHoveredItem=void 0;leavingItems=[];lastAnimationTime;addToLeavingItems=t=>{this.leavingItems.some(r=>Zi(r.item,t.item))||this.leavingItems.push(t)};removeFromLeavingItems=t=>{const n=this.leavingItems.find(r=>Zi(r.item,t));return this.leavingItems=this.leavingItems.filter(r=>r!==n),n?.hoverAmount??0};cleanUpLeavingElements=()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)};shouldStep=()=>{const t=this.leavingItems.length>0,n=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||n};getAnimatingItems=()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>({...t,hoverAmount:a0(t.hoverAmount)}));step=t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const r=(t-this.lastAnimationTime)/o0;for(const o of this.leavingItems)o.hoverAmount=Ln(o.hoverAmount-r,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=Ln(this.currentHoveredItem.hoverAmount+r,0,1));const i=this.getAnimatingItems();this.callback(i),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0};setHovered=t=>{if(!Zi(this.currentHoveredItem?.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){const n=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:n}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}}}class l0{fn;val;constructor(t){this.fn=t}get value(){return this.val??(this.val=this.fn())}}function Js(e){return new l0(e)}const u0=Js(()=>window.navigator.userAgent.includes("Firefox")),oa=Js(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),aa=Js(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function c0(e){const t=f.useRef([]),n=f.useRef(0),r=f.useRef(e);r.current=e;const i=f.useCallback(()=>{const o=()=>window.requestAnimationFrame(s),s=()=>{const a=t.current.map(Ks);t.current=[],r.current(new Qi(a)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?o:s)},[]);return f.useCallback(o=>{t.current.length===0&&i();const s=Wn(o[0],o[1]);t.current.includes(s)||t.current.push(s)},[i])}const Cr="header",An="group-header",sa="out-of-bounds";var gi;(function(e){e[e.Start=-2]="Start",e[e.StartPadding=-1]="StartPadding",e[e.Center=0]="Center",e[e.EndPadding=1]="EndPadding",e[e.End=2]="End"})(gi||(gi={}));function Fd(e,t){return e===t?!0:e?.kind==="out-of-bounds"?e?.kind===t?.kind&&e?.location[0]===t?.location[0]&&e?.location[1]===t?.location[1]&&e?.region[0]===t?.region[0]&&e?.region[1]===t?.region[1]:e?.kind===t?.kind&&e?.location[0]===t?.location[0]&&e?.location[1]===t?.location[1]}const Eu=6,d0=(e,t)=>e.kind===J.Custom?e.copyData:t?.(e)?.getAccessibilityString(e)??"",f0=(e,t)=>{const{width:n,height:r,accessibilityHeight:i,columns:o,cellXOffset:s,cellYOffset:a,headerHeight:l,fillHandle:u=!1,groupHeaderHeight:c,rowHeight:d,rows:g,getCellContent:h,getRowThemeOverride:m,onHeaderMenuClick:p,onHeaderIndicatorClick:y,enableGroups:b,isFilling:v,onCanvasFocused:S,onCanvasBlur:O,isFocused:M,selection:R,freezeColumns:_,onContextMenu:I,freezeTrailingRows:k,fixedShadowX:F=!0,fixedShadowY:D=!0,drawFocusRing:C,onMouseDown:E,onMouseUp:T,onMouseMoveRaw:x,onMouseMove:N,onItemHovered:G,dragAndDropState:j,firstColAccessible:ie,onKeyDown:ee,onKeyUp:Q,highlightRegions:te,canvasRef:se,onDragStart:ue,onDragEnd:fe,eventTargetRef:re,isResizing:H,resizeColumn:P,isDragging:X,isDraggable:ce=!1,allowResize:he,disabledRows:ke,hasAppendRow:Se,getGroupDetails:Qe,theme:Ee,prelightCells:et,headerIcons:kt,verticalBorder:Ne,drawCell:ne,drawHeader:me,onCellFocused:xe,onDragOverCell:de,onDrop:be,onDragLeave:Pe,imageWindowLoader:Te,smoothScrollX:st=!1,smoothScrollY:Re=!1,experimental:Ge,getCellRenderer:He,resizeIndicator:we="full"}=e,Be=e.translateX??0,mt=e.translateY??0,ft=Math.max(_,Math.min(o.length-1,s)),Xe=f.useRef(null),yt=f.useRef(Ge?.eventTarget??window),Xt=yt.current,Ht=Te,Mt=f.useRef(),[nn,qt]=f.useState(!1),cn=f.useRef([]),Ot=f.useRef(),[ut,tn]=f.useState(),[Ct,rn]=f.useState(),Bt=f.useRef(null),[De,Et]=f.useState(),[Pt,yn]=f.useState(!1),Yt=f.useRef(Pt);Yt.current=Pt;const dn=f.useMemo(()=>new Np(kt,()=>{ge.current=void 0,Nt.current()}),[kt]),Rn=b?c+l:l,jt=f.useRef(-1),Jt=(Ge?.enableFirefoxRescaling??!1)&&u0.value,We=(Ge?.enableSafariRescaling??!1)&&oa.value;f.useLayoutEffect(()=>{window.devicePixelRatio===1||!Jt&&!We||(jt.current!==-1&&qt(!0),window.clearTimeout(jt.current),jt.current=window.setTimeout(()=>{qt(!1),jt.current=-1},200))},[a,ft,Be,mt,Jt,We]);const Rt=Am(o,_),Cn=f.useMemo(()=>F?vi(Rt,j):0,[Rt,j,F]),vt=f.useCallback((z,oe,Me)=>{const Ie=z.getBoundingClientRect();if(oe>=Rt.length||Me>=g)return;const ae=Ie.width/n,ve=Is(oe,Me,n,r,c,Rn,ft,a,Be,mt,g,_,k,Rt,d);return ae!==1&&(ve.x*=ae,ve.y*=ae,ve.width*=ae,ve.height*=ae),ve.x+=Ie.x,ve.y+=Ie.y,ve},[n,r,c,Rn,ft,a,Be,mt,g,_,k,Rt,d]),Ft=f.useCallback((z,oe,Me,Ie)=>{const ae=z.getBoundingClientRect(),ve=ae.width/n,Ye=(oe-ae.left)/ve,ye=(Me-ae.top)/ve,je=5,ct=Rs(Rt,ft,n,void 0,Be);let Zt=0,dt=0;const Tt=typeof PointerEvent<"u"&&Ie instanceof PointerEvent&&Ie.pointerType==="mouse"||typeof MouseEvent<"u"&&Ie instanceof MouseEvent,tt=typeof PointerEvent<"u"&&Ie instanceof PointerEvent&&Ie.pointerType==="touch"||typeof TouchEvent<"u"&&Ie instanceof TouchEvent;Tt&&(Zt=Ie.button,dt=Ie.buttons);const Je=$m(Ye,ct,Be),zt=Nm(ye,r,b,l,c,g,d,a,mt,k),Wt=Ie?.shiftKey===!0,Dr=Ie?.ctrlKey===!0,en=Ie?.metaKey===!0,an=[Ye<0?-1:n<Ye?1:0,ye<Rn?-1:r<ye?1:0];let hr;if(Je===-1||ye<0||Ye<0||zt===void 0||Ye>n||ye>r){const _t=Ye>n?1:Ye<0?-1:0,Mn=ye>r?1:ye<0?-1:0;let In=_t*2,gr=Mn*2;_t===0&&(In=Je===-1?gi.EndPadding:gi.Center),Mn===0&&(gr=zt===void 0?gi.EndPadding:gi.Center);let nt=!1;if(Je===-1&&zt===-1){const Yn=vt(z,Rt.length-1,-1);Dn(Yn!==void 0),nt=oe<Yn.x+Yn.width+je}const sn=Ye>n&&Ye<n+xs()||ye>r&&ye<r+xs();hr={kind:sa,location:[Je!==-1?Je:Ye<0?0:Rt.length-1,zt??g-1],region:[In,gr],shiftKey:Wt,ctrlKey:Dr,metaKey:en,isEdge:nt,isTouch:tt,button:Zt,buttons:dt,scrollEdge:an,isMaybeScrollbar:sn}}else if(zt<=-1){let _t=vt(z,Je,zt);Dn(_t!==void 0);let Mn=_t!==void 0&&_t.x+_t.width-oe<=je;const In=Je-1;oe-_t.x<=je&&In>=0?(Mn=!0,_t=vt(z,In,zt),Dn(_t!==void 0),hr={kind:b&&zt===-2?An:Cr,location:[In,zt],bounds:_t,group:Rt[In].group??"",isEdge:Mn,shiftKey:Wt,ctrlKey:Dr,metaKey:en,isTouch:tt,localEventX:oe-_t.x,localEventY:Me-_t.y,button:Zt,buttons:dt,scrollEdge:an}):hr={kind:b&&zt===-2?An:Cr,group:Rt[Je].group??"",location:[Je,zt],bounds:_t,isEdge:Mn,shiftKey:Wt,ctrlKey:Dr,metaKey:en,isTouch:tt,localEventX:oe-_t.x,localEventY:Me-_t.y,button:Zt,buttons:dt,scrollEdge:an}}else{const _t=vt(z,Je,zt);Dn(_t!==void 0);const Mn=_t!==void 0&&_t.x+_t.width-oe<je;let In=!1;if(u&&R.current!==void 0){const gr=hd(R.current.range),nt=vt(z,gr[0],gr[1]);if(nt!==void 0){const sn=nt.x+nt.width-2,Yn=nt.y+nt.height-2;In=Math.abs(sn-oe)<Eu&&Math.abs(Yn-Me)<Eu}}hr={kind:"cell",location:[Je,zt],bounds:_t,isEdge:Mn,shiftKey:Wt,ctrlKey:Dr,isFillHandle:In,metaKey:en,isTouch:tt,localEventX:oe-_t.x,localEventY:Me-_t.y,button:Zt,buttons:dt,scrollEdge:an}}return hr},[n,Rt,ft,Be,r,b,l,c,g,d,a,mt,k,vt,u,R,Rn]),[Sn]=ut??[],qn=f.useRef(()=>{}),zn=f.useRef(ut);zn.current=ut;const[$,$e]=f.useMemo(()=>{const z=document.createElement("canvas"),oe=document.createElement("canvas");return z.style.display="none",z.style.opacity="0",z.style.position="fixed",oe.style.display="none",oe.style.opacity="0",oe.style.position="fixed",[z.getContext("2d",{alpha:!1}),oe.getContext("2d",{alpha:!1})]},[]);f.useLayoutEffect(()=>{if(!($===null||$e===null))return document.documentElement.append($.canvas),document.documentElement.append($e.canvas),()=>{$.canvas.remove(),$e.canvas.remove()}},[$,$e]);const Ue=f.useMemo(()=>new Km,[]),St=Jt&&nn?1:We&&nn?2:5,mn=Ge?.disableMinimumCellWidth===!0?1:10,ge=f.useRef(),bt=f.useRef(null),Qt=f.useRef(null),It=f.useCallback(()=>{const z=Xe.current,oe=Bt.current;if(z===null||oe===null||(bt.current===null&&(bt.current=z.getContext("2d",{alpha:!1}),z.width=0,z.height=0),Qt.current===null&&(Qt.current=oe.getContext("2d",{alpha:!1}),oe.width=0,oe.height=0),bt.current===null||Qt.current===null||$===null||$e===null))return;let Me=!1;const Ie=Ye=>{Me=!0,Et(Ye)},ae=ge.current,ve={headerCanvasCtx:Qt.current,canvasCtx:bt.current,bufferACtx:$,bufferBCtx:$e,width:n,height:r,cellXOffset:ft,cellYOffset:a,translateX:Math.round(Be),translateY:Math.round(mt),mappedColumns:Rt,enableGroups:b,freezeColumns:_,dragAndDropState:j,theme:Ee,headerHeight:l,groupHeaderHeight:c,disabledRows:ke??it.empty(),rowHeight:d,verticalBorder:Ne,isResizing:H,resizeCol:P,isFocused:M,selection:R,fillHandle:u,drawCellCallback:ne,hasAppendRow:Se,overrideCursor:Ie,maxScaleFactor:St,freezeTrailingRows:k,rows:g,drawFocus:C,getCellContent:h,getGroupDetails:Qe??(Ye=>({name:Ye})),getRowThemeOverride:m,drawHeaderCallback:me,prelightCells:et,highlightRegions:te,imageLoader:Ht,lastBlitData:Ot,damage:Mt.current,hoverValues:cn.current,hoverInfo:zn.current,spriteManager:dn,scrolling:nn,hyperWrapping:Ge?.hyperWrapping??!1,touchMode:Pt,enqueue:qn.current,renderStateProvider:Ue,renderStrategy:Ge?.renderStrategy??(oa.value?"double-buffer":"single-buffer"),getCellRenderer:He,minimumCellWidth:mn,resizeIndicator:we};ve.damage===void 0?(ge.current=ve,Iu(ve,ae)):Iu(ve,void 0),!Me&&(ve.damage===void 0||ve.damage.has(zn?.current?.[0]))&&Et(void 0)},[$,$e,n,r,ft,a,Be,mt,Rt,b,_,j,Ee,l,c,ke,d,Ne,H,Se,P,M,R,u,k,g,C,St,h,Qe,m,ne,me,et,te,Ht,dn,nn,Ge?.hyperWrapping,Ge?.renderStrategy,Pt,Ue,He,mn,we]),Nt=f.useRef(It);f.useLayoutEffect(()=>{It(),Nt.current=It},[It]),f.useLayoutEffect(()=>{(async()=>{document?.fonts?.ready!==void 0&&(await document.fonts.ready,ge.current=void 0,Nt.current())})()},[]);const on=f.useCallback(z=>{Mt.current=z,Nt.current(),Mt.current=void 0},[]),ka=c0(on);qn.current=ka;const fo=f.useCallback(z=>{on(new Qi(z.map(oe=>oe.cell)))},[on]);Ht.setCallback(on);const[Ma,ho]=f.useState(!1),[Ir,ur]=Sn??[],Ra=Ir!==void 0&&ur===-1&&o[Ir].headerRowMarkerDisabled!==!0,bi=Ir!==void 0&&ur===-2;let go=!1,wi=!1,Er=De;if(Er===void 0&&Ir!==void 0&&ur!==void 0&&ur>-1&&ur<g){const z=h([Ir,ur],!0);go=z.kind===Hn.NewRow||z.kind===Hn.Marker&&z.markerKind!=="number",wi=z.kind===J.Boolean&&$s(z),Er=z.cursor}const yi=X?"grabbing":(Ct??!1)||H?"col-resize":Ma||v?"crosshair":Er!==void 0?Er:Ra||go||wi||bi?"pointer":"default",Pn=f.useMemo(()=>({contain:"strict",display:"block",cursor:yi}),[yi]),xn=f.useRef("default"),Ci=re?.current;Ci!=null&&xn.current!==Pn.cursor&&(Ci.style.cursor=xn.current=Pn.cursor);const er=f.useCallback((z,oe,Me,Ie)=>{if(Qe===void 0)return;const ae=Qe(z);if(ae.actions!==void 0){const ve=Dd(oe,ae.actions);for(const[Ye,ye]of ve.entries())if($r(ye,Me+oe.x,Ie+ye.y))return ae.actions[Ye]}},[Qe]),tr=f.useCallback((z,oe,Me,Ie)=>{const ae=Rt[oe];if(!X&&!H&&!(Ct??!1)){const ve=vt(z,oe,-1);Dn(ve!==void 0);const Ye=Od(void 0,ae,ve.x,ve.y,ve.width,ve.height,Ee,Ws(ae.title)==="rtl");if(ae.hasMenu===!0&&Ye.menuBounds!==void 0&&$r(Ye.menuBounds,Me,Ie))return{area:"menu",bounds:Ye.menuBounds};if(ae.indicatorIcon!==void 0&&Ye.indicatorIconBounds!==void 0&&$r(Ye.indicatorIconBounds,Me,Ie))return{area:"indicator",bounds:Ye.indicatorIconBounds}}},[Rt,vt,Ct,X,H,Ee]),Xr=f.useRef(0),cr=f.useRef(),Tr=f.useRef(!1),Yr=f.useCallback(z=>{const oe=Xe.current,Me=re?.current;if(oe===null||z.target!==oe&&z.target!==Me)return;Tr.current=!0;const Ie=z.clientX,ae=z.clientY;if(z.target===Me&&Me!==null){const Ye=Me.getBoundingClientRect();if(Ie>Ye.right||ae>Ye.bottom)return}const ve=Ft(oe,Ie,ae,z);cr.current=ve.location,ve.isTouch&&(Xr.current=Date.now()),Yt.current!==ve.isTouch&&yn(ve.isTouch),!(ve.kind===Cr&&tr(oe,ve.location[0],Ie,ae)!==void 0)&&(ve.kind===An&&er(ve.group,ve.bounds,ve.localEventX,ve.localEventY)!==void 0||(E?.(ve),!ve.isTouch&&ce!==!0&&ce!==ve.kind&&ve.button<3&&ve.button!==1&&z.preventDefault()))},[re,ce,Ft,er,tr,E]);bn("pointerdown",Yr,Xt,!1);const nr=f.useRef(0),jr=f.useCallback(z=>{const oe=nr.current;nr.current=Date.now();const Me=Xe.current;if(Tr.current=!1,T===void 0||Me===null)return;const Ie=re?.current,ae=z.target!==Me&&z.target!==Ie,ve=z.clientX,Ye=z.clientY,ye=z.pointerType==="mouse"?z.button<3:!0;let je=Ft(Me,ve,Ye,z);je.isTouch&&Xr.current!==0&&Date.now()-Xr.current>500&&(je={...je,isLongTouch:!0}),oe!==0&&Date.now()-oe<(je.isTouch?1e3:500)&&(je={...je,isDoubleClick:!0}),Yt.current!==je.isTouch&&yn(je.isTouch),!ae&&z.cancelable&&ye&&z.preventDefault();const[ct]=je.location,Zt=tr(Me,ct,ve,Ye);if(je.kind===Cr&&Zt!==void 0){(je.button!==0||cr.current?.[0]!==ct||cr.current?.[1]!==-1)&&T(je,!0);return}else if(je.kind===An){const dt=er(je.group,je.bounds,je.localEventX,je.localEventY);if(dt!==void 0){je.button===0&&dt.onClick(je);return}}T(je,ae)},[T,re,Ft,tr,er]);bn("pointerup",jr,Xt,!1);const Ia=f.useCallback(z=>{const oe=Xe.current;if(oe===null)return;const Me=re?.current,Ie=z.target!==oe&&z.target!==Me;let ae,ve,Ye=!0;z instanceof MouseEvent?(ae=z.clientX,ve=z.clientY,Ye=z.button<3):(ae=z.changedTouches[0].clientX,ve=z.changedTouches[0].clientY);const ye=Ft(oe,ae,ve,z);Yt.current!==ye.isTouch&&yn(ye.isTouch),!Ie&&z.cancelable&&Ye&&z.preventDefault();const[je]=ye.location;if(ye.kind===Cr){const ct=tr(oe,je,ae,ve);ct!==void 0&&ye.button===0&&cr.current?.[0]===je&&cr.current?.[1]===-1&&(ct.area==="menu"?p?.(je,ct.bounds):ct.area==="indicator"&&y?.(je,ct.bounds))}else if(ye.kind===An){const ct=er(ye.group,ye.bounds,ye.localEventX,ye.localEventY);ct!==void 0&&ye.button===0&&ct.onClick(ye)}},[re,Ft,tr,p,y,er]);bn("click",Ia,Xt,!1);const mo=f.useCallback(z=>{const oe=Xe.current,Me=re?.current;if(oe===null||z.target!==oe&&z.target!==Me||I===void 0)return;const Ie=Ft(oe,z.clientX,z.clientY,z);I(Ie,()=>{z.cancelable&&z.preventDefault()})},[re,Ft,I]);bn("contextmenu",mo,re?.current??null,!1);const _e=f.useCallback(z=>{Mt.current=new Qi(z.map(oe=>oe.item)),cn.current=z,Nt.current(),Mt.current=void 0},[]),Si=f.useMemo(()=>new s0(_e),[_e]),po=f.useRef(Si);po.current=Si,f.useLayoutEffect(()=>{const z=po.current;if(Sn===void 0||Sn[1]<0){z.setHovered(Sn);return}const oe=h(Sn,!0),Me=He(oe),Ie=Me===void 0&&oe.kind===J.Custom||Me?.needsHover!==void 0&&(typeof Me.needsHover=="boolean"?Me.needsHover:Me.needsHover(oe));z.setHovered(Ie?Sn:void 0)},[h,He,Sn]);const dr=f.useRef(),Ea=f.useCallback(z=>{const oe=Xe.current;if(oe===null)return;const Me=re?.current,Ie=z.target!==oe&&z.target!==Me,ae=Ft(oe,z.clientX,z.clientY,z);if(ae.kind!=="out-of-bounds"&&Ie&&!Tr.current&&!ae.isTouch)return;const ve=(ye,je)=>{tn(ct=>ct===ye||ct?.[0][0]===ye?.[0][0]&&ct?.[0][1]===ye?.[0][1]&&(ct?.[1][0]===ye?.[1][0]&&ct?.[1][1]===ye?.[1][1]||!je)?ct:ye)};if(!Fd(ae,dr.current))Et(void 0),G?.(ae),ve(ae.kind===sa?void 0:[ae.location,[ae.localEventX,ae.localEventY]],!0),dr.current=ae;else if(ae.kind==="cell"||ae.kind===Cr||ae.kind===An){let ye=!1,je=!0;if(ae.kind==="cell"){const Zt=h(ae.location);je=He(Zt)?.needsHoverPosition??Zt.kind===J.Custom,ye=je}else ye=!0;const ct=[ae.location,[ae.localEventX,ae.localEventY]];ve(ct,je),zn.current=ct,ye&&on(new Qi([ae.location]))}const Ye=ae.location[0]>=(ie?0:1);rn(ae.kind===Cr&&ae.isEdge&&Ye&&he===!0),ho(ae.kind==="cell"&&ae.isFillHandle),x?.(z),N(ae)},[re,Ft,ie,he,x,N,G,h,He,on]);bn("pointermove",Ea,Xt,!0);const Gn=f.useCallback(z=>{const oe=Xe.current;if(oe===null)return;let Me,Ie;R.current!==void 0&&(Me=vt(oe,R.current.cell[0],R.current.cell[1]),Ie=R.current.cell),ee?.({bounds:Me,stopPropagation:()=>z.stopPropagation(),preventDefault:()=>z.preventDefault(),cancel:()=>{},ctrlKey:z.ctrlKey,metaKey:z.metaKey,shiftKey:z.shiftKey,altKey:z.altKey,key:z.key,keyCode:z.keyCode,rawEvent:z,location:Ie})},[ee,R,vt]),xi=f.useCallback(z=>{const oe=Xe.current;if(oe===null)return;let Me,Ie;R.current!==void 0&&(Me=vt(oe,R.current.cell[0],R.current.cell[1]),Ie=R.current.cell),Q?.({bounds:Me,stopPropagation:()=>z.stopPropagation(),preventDefault:()=>z.preventDefault(),cancel:()=>{},ctrlKey:z.ctrlKey,metaKey:z.metaKey,shiftKey:z.shiftKey,altKey:z.altKey,key:z.key,keyCode:z.keyCode,rawEvent:z,location:Ie})},[Q,R,vt]),vo=f.useCallback(z=>{if(Xe.current=z,se!==void 0&&(se.current=z),Ge?.eventTarget)yt.current=Ge.eventTarget;else if(z===null)yt.current=window;else{const oe=z.getRootNode();oe===document&&(yt.current=window),yt.current=oe}},[se,Ge?.eventTarget]),bo=f.useCallback(z=>{const oe=Xe.current;if(oe===null||ce===!1||H){z.preventDefault();return}let Me,Ie;const ae=Ft(oe,z.clientX,z.clientY);if(ce!==!0&&ae.kind!==ce){z.preventDefault();return}const ve=(dt,Tt)=>{Me=dt,Ie=Tt};let Ye,ye,je;const ct=(dt,Tt,tt)=>{Ye=dt,ye=Tt,je=tt};let Zt=!1;if(ue?.({...ae,setData:ve,setDragImage:ct,preventDefault:()=>Zt=!0,defaultPrevented:()=>Zt}),!Zt&&Me!==void 0&&Ie!==void 0&&z.dataTransfer!==null)if(z.dataTransfer.setData(Me,Ie),z.dataTransfer.effectAllowed="copyLink",Ye!==void 0&&ye!==void 0&&je!==void 0)z.dataTransfer.setDragImage(Ye,ye,je);else{const[dt,Tt]=ae.location;if(Tt!==void 0){const tt=document.createElement("canvas"),Je=vt(oe,dt,Tt);Dn(Je!==void 0);const zt=Math.ceil(window.devicePixelRatio??1);tt.width=Je.width*zt,tt.height=Je.height*zt;const Wt=tt.getContext("2d");Wt!==null&&(Wt.scale(zt,zt),Wt.textBaseline="middle",Tt===-1?(Wt.font=Ee.headerFontFull,Wt.fillStyle=Ee.bgHeader,Wt.fillRect(0,0,tt.width,tt.height),Pd(Wt,0,0,Je.width,Je.height,Rt[dt],!1,Ee,!1,void 0,void 0,!1,0,dn,me,!1)):(Wt.font=Ee.baseFontFull,Wt.fillStyle=Ee.bgCell,Wt.fillRect(0,0,tt.width,tt.height),Td(Wt,h([dt,Tt]),0,Tt,!1,!1,0,0,Je.width,Je.height,!1,Ee,Ee.bgCell,Ht,dn,1,void 0,!1,0,void 0,void 0,void 0,Ue,He,()=>{}))),tt.style.left="-100%",tt.style.position="absolute",tt.style.width=`${Je.width}px`,tt.style.height=`${Je.height}px`,document.body.append(tt),z.dataTransfer.setDragImage(tt,Je.width/2,Je.height/2),window.setTimeout(()=>{tt.remove()},0)}}else z.preventDefault()},[ce,H,Ft,ue,vt,Ee,Rt,dn,me,h,Ht,Ue,He]);bn("dragstart",bo,re?.current??null,!1,!1);const ki=f.useRef(),Ta=f.useCallback(z=>{const oe=Xe.current;if(be!==void 0&&z.preventDefault(),oe===null||de===void 0)return;const Me=Ft(oe,z.clientX,z.clientY),[Ie,ae]=Me.location,ve=Ie-(ie?0:1),[Ye,ye]=ki.current??[];(Ye!==ve||ye!==ae)&&(ki.current=[ve,ae],de([ve,ae],z.dataTransfer))},[ie,Ft,de,be]);bn("dragover",Ta,re?.current??null,!1,!1);const Xn=f.useCallback(()=>{ki.current=void 0,fe?.()},[fe]);bn("dragend",Xn,re?.current??null,!1,!1);const fr=f.useCallback(z=>{const oe=Xe.current;if(oe===null||be===void 0)return;z.preventDefault();const Me=Ft(oe,z.clientX,z.clientY),[Ie,ae]=Me.location,ve=Ie-(ie?0:1);be([ve,ae],z.dataTransfer)},[ie,Ft,be]);bn("drop",fr,re?.current??null,!1,!1);const _n=f.useCallback(()=>{Pe?.()},[Pe]);bn("dragleave",_n,re?.current??null,!1,!1);const U=f.useRef(R);U.current=R;const Lt=f.useRef(null),rr=f.useCallback(z=>{Xe.current===null||!Xe.current.contains(document.activeElement)||(z===null&&U.current.current!==void 0?se?.current?.focus({preventScroll:!0}):z!==null&&z.focus({preventScroll:!0}),Lt.current=z)},[se]);f.useImperativeHandle(t,()=>({focus:()=>{const z=Lt.current;z===null||!document.contains(z)?se?.current?.focus({preventScroll:!0}):z.focus({preventScroll:!0})},getBounds:(z,oe)=>{if(!(se===void 0||se.current===null))return vt(se.current,z??0,oe??-1)},damage:fo,getMouseArgsForPosition:(z,oe,Me)=>{if(!(se===void 0||se.current===null))return Ft(se.current,z,oe,Me)}}),[se,fo,vt]);const Mi=f.useRef(),wo=tm(()=>{if(n<50||Ge?.disableAccessibilityTree===!0)return null;let z=Rs(Rt,ft,n,j,Be);const oe=ie?0:-1;!ie&&z[0]?.sourceIndex===0&&(z=z.slice(1));const[Me,Ie]=R.current?.cell??[],ae=R.current?.range,ve=z.map(ye=>ye.sourceIndex),Ye=xr(a,Math.min(g,a+i));return Me!==void 0&&Ie!==void 0&&!(ve.includes(Me)&&Ye.includes(Ie))&&rr(null),f.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":g+1,"aria-multiselectable":"true","aria-colcount":Rt.length+oe},f.createElement("thead",{role:"rowgroup"},f.createElement("tr",{role:"row","aria-rowindex":1},z.map(ye=>f.createElement("th",{role:"columnheader","aria-selected":R.columns.hasIndex(ye.sourceIndex),"aria-colindex":ye.sourceIndex+1+oe,tabIndex:-1,onFocus:je=>{if(je.target!==Lt.current)return xe?.([ye.sourceIndex,-1])},key:ye.sourceIndex},ye.title)))),f.createElement("tbody",{role:"rowgroup"},Ye.map(ye=>f.createElement("tr",{role:"row","aria-selected":R.rows.hasIndex(ye),key:ye,"aria-rowindex":ye+2},z.map(je=>{const ct=je.sourceIndex,Zt=Wn(ct,ye),dt=Me===ct&&Ie===ye,Tt=ae!==void 0&&ct>=ae.x&&ct<ae.x+ae.width&&ye>=ae.y&&ye<ae.y+ae.height,tt=`glide-cell-${ct}-${ye}`,Je=[ct,ye],zt=h(Je,!0);return f.createElement("td",{key:Zt,role:"gridcell","aria-colindex":ct+1+oe,"aria-selected":Tt,"aria-readonly":fi(zt)||!ci(zt),id:tt,"data-testid":tt,onClick:()=>{const Wt=se?.current;if(Wt!=null)return ee?.({bounds:vt(Wt,ct,ye),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:Je})},onFocusCapture:Wt=>{if(!(Wt.target===Lt.current||Mi.current?.[0]===ct&&Mi.current?.[1]===ye))return Mi.current=Je,xe?.(Je)},ref:dt?rr:void 0,tabIndex:-1},d0(zt,He))})))))},[n,Rt,ft,j,Be,g,a,i,R,rr,h,se,ee,vt,xe],200),Kr=_===0||!F?0:ft>_?1:Ln(-Be/100,0,1),Da=-a*32+mt,Ri=D?Ln(-Da/100,0,1):0,K=f.useMemo(()=>{if(!Kr&&!Ri)return null;const z={position:"absolute",top:0,left:Cn,width:n-Cn,height:r,opacity:Kr,pointerEvents:"none",transition:st?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},oe={position:"absolute",top:Rn,left:0,width:n,height:r,opacity:Ri,pointerEvents:"none",transition:Re?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return f.createElement(f.Fragment,null,Kr>0&&f.createElement("div",{id:"shadow-x",style:z}),Ri>0&&f.createElement("div",{id:"shadow-y",style:oe}))},[Kr,Ri,Cn,n,st,Rn,r,Re]),kn=f.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return f.createElement(f.Fragment,null,f.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:Gn,onKeyUp:xi,onFocus:S,onBlur:O,ref:vo,style:Pn},wo),f.createElement("canvas",{ref:Bt,style:kn}),K)},h0=f.memo(f.forwardRef(f0));function qi(e,t,n,r){return Ln(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(r))}const g0=e=>{const[t,n]=f.useState(),[r,i]=f.useState(),[o,s]=f.useState(),[a,l]=f.useState(),[u,c]=f.useState(!1),[d,g]=f.useState(),[h,m]=f.useState(),[p,y]=f.useState(),[b,v]=f.useState(!1),[S,O]=f.useState(),{onHeaderMenuClick:M,onHeaderIndicatorClick:R,getCellContent:_,onColumnMoved:I,onColumnResize:k,onColumnResizeStart:F,onColumnResizeEnd:D,gridRef:C,maxColumnWidth:E,minColumnWidth:T,onRowMoved:x,lockColumns:N,onColumnProposeMove:G,onMouseDown:j,onMouseUp:ie,onItemHovered:ee,onDragStart:Q,canvasRef:te}=e,se=(k??D??F)!==void 0,{columns:ue,selection:fe}=e,re=fe.columns,H=f.useCallback(ne=>{const[me,xe]=ne.location;o!==void 0&&a!==me&&me>=N?(c(!0),l(me)):h!==void 0&&xe!==void 0?(v(!0),y(Math.max(0,xe))):r===void 0&&!u&&!b&&ee?.(ne)},[o,h,a,ee,N,r,u,b]),P=I!==void 0,X=f.useCallback(ne=>{if(ne.button===0){const[me,xe]=ne.location;if(ne.kind==="out-of-bounds"&&ne.isEdge&&se){const de=C?.current?.getBounds(ue.length-1,-1);de!==void 0&&(n(de.x),i(ue.length-1))}else if(ne.kind==="header"&&me>=N){const de=te?.current;if(ne.isEdge&&se&&de){n(ne.bounds.x),i(me);const Pe=de.getBoundingClientRect().width/de.offsetWidth,Te=ne.bounds.width/Pe;F?.(ue[me],Te,me,Te+(ue[me].growOffset??0))}else ne.kind==="header"&&P&&(g(ne.bounds.x),s(me))}else ne.kind==="cell"&&N>0&&me===0&&xe!==void 0&&x!==void 0&&(O(ne.bounds.y),m(xe))}j?.(ne)},[j,se,N,x,C,ue,P,F,te]),ce=f.useCallback((ne,me)=>{u||b||M?.(ne,me)},[u,b,M]),he=f.useCallback((ne,me)=>{u||b||R?.(ne,me)},[u,b,R]),ke=f.useRef(-1),Se=f.useCallback(()=>{ke.current=-1,m(void 0),y(void 0),O(void 0),v(!1),s(void 0),l(void 0),g(void 0),c(!1),i(void 0),n(void 0)},[]),Qe=f.useCallback((ne,me)=>{if(ne.button===0){if(r!==void 0){if(re?.hasIndex(r)===!0)for(const de of re){if(de===r)continue;const be=ue[de],Pe=qi(be,ke.current,T,E);k?.(be,Pe,de,Pe+(be.growOffset??0))}const xe=qi(ue[r],ke.current,T,E);if(D?.(ue[r],xe,r,xe+(ue[r].growOffset??0)),re.hasIndex(r))for(const de of re){if(de===r)continue;const be=ue[de],Pe=qi(be,ke.current,T,E);D?.(be,Pe,de,Pe+(be.growOffset??0))}}Se(),o!==void 0&&a!==void 0&&G?.(o,a)!==!1&&I?.(o,a),h!==void 0&&p!==void 0&&x?.(h,p)}ie?.(ne,me)},[ie,r,o,a,h,p,re,D,ue,T,E,k,I,x,Se,G]),Ee=f.useMemo(()=>{if(!(o===void 0||a===void 0)&&o!==a&&G?.(o,a)!==!1)return{src:o,dest:a}},[o,a,G]),et=f.useCallback(ne=>{const me=te?.current;if(o!==void 0&&d!==void 0)Math.abs(ne.clientX-d)>20&&c(!0);else if(h!==void 0&&S!==void 0)Math.abs(ne.clientY-S)>20&&v(!0);else if(r!==void 0&&t!==void 0&&me){const de=me.getBoundingClientRect().width/me.offsetWidth,be=(ne.clientX-t)/de,Pe=ue[r],Te=qi(Pe,be,T,E);if(k?.(Pe,Te,r,Te+(Pe.growOffset??0)),ke.current=be,re?.first()===r)for(const st of re){if(st===r)continue;const Re=ue[st],Ge=qi(Re,ke.current,T,E);k?.(Re,Ge,st,Ge+(Re.growOffset??0))}}},[o,d,h,S,r,t,ue,T,E,k,re,te]),kt=f.useCallback((ne,me)=>{if(h===void 0||p===void 0)return _(ne,me);let[xe,de]=ne;return de===p?de=h:(de>p&&(de-=1),de>=h&&(de+=1)),_([xe,de],me)},[h,p,_]),Ne=f.useCallback(ne=>{Q?.(ne),ne.defaultPrevented()||Se()},[Se,Q]);return f.createElement(h0,{accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,enableGroups:e.enableGroups,eventTargetRef:e.eventTargetRef,experimental:e.experimental,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,headerIcons:e.headerIcons,height:e.height,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,resizeColumn:r,isDraggable:e.isDraggable,isFilling:e.isFilling,isFocused:e.isFocused,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDrop:e.onDrop,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,resizeIndicator:e.resizeIndicator,verticalBorder:e.verticalBorder,width:e.width,getCellContent:kt,isResizing:r!==void 0,onHeaderMenuClick:ce,onHeaderIndicatorClick:he,isDragging:u,onItemHovered:H,onDragStart:Ne,onMouseDown:X,allowResize:se,onMouseUp:Qe,dragAndDropState:Ee,onMouseMoveRaw:et,ref:C})};function m0(e){const t=f.useRef(null),[n,r]=f.useState({width:e?.[0],height:e?.[1]});return f.useLayoutEffect(()=>{const i=s=>{for(const a of s){const{width:l,height:u}=a&&a.contentRect||{};r(c=>c.width===l&&c.height===u?c:{width:l,height:u})}},o=new window.ResizeObserver(i);return t.current&&o.observe(t.current,void 0),()=>{o.disconnect()}},[t.current]),{ref:t,...n}}const p0=(e,t,n)=>{const r=f.useRef(null),i=f.useRef(null),o=f.useRef(null),s=f.useRef(0),a=f.useRef(t);a.current=t;const l=n.current;f.useEffect(()=>{const u=()=>{if(i.current===!1&&l!==null){const g=[l.scrollLeft,l.scrollTop];if(o.current?.[0]===g[0]&&o.current?.[1]===g[1])if(s.current>10){o.current=null,i.current=null;return}else s.current++;else s.current=0,a.current(g[0],g[1]),o.current=g;r.current=window.setTimeout(u,8.333333333333334)}},c=()=>{i.current=!0,o.current=null,r.current!==null&&(window.clearTimeout(r.current),r.current=null)},d=g=>{g.touches.length===0&&(i.current=!1,s.current=0,r.current=window.setTimeout(u,8.333333333333334))};if(e&&l!==null){const g=l;return g.addEventListener("touchstart",c),g.addEventListener("touchend",d),()=>{g.removeEventListener("touchstart",c),g.removeEventListener("touchend",d),r.current!==null&&window.clearTimeout(r.current)}}},[e,l])},v0=()=>e=>e.isSafari?"scroll":"auto",b0=un("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[v0()]}}),w0=33554400,y0=5e6;function C0(e){const[t,n]=f.useState(!1),r=typeof window>"u"?null:window,i=f.useRef(0);return bn("touchstart",f.useCallback(()=>{window.clearTimeout(i.current),n(!0)},[]),r,!0,!1),bn("touchend",f.useCallback(o=>{o.touches.length===0&&(i.current=window.setTimeout(()=>n(!1),e))},[e]),r,!0,!1),t}const S0=e=>{const{children:t,clientHeight:n,scrollHeight:r,scrollWidth:i,update:o,draggable:s,className:a,preventDiagonalScrolling:l=!1,paddingBottom:u=0,paddingRight:c=0,rightElement:d,rightElementProps:g,kineticScrollPerfHack:h=!1,scrollRef:m,initialSize:p}=e,y=[],b=g?.sticky??!1,v=g?.fill??!1,S=f.useRef(0),O=f.useRef(0),M=f.useRef(null),R=typeof window>"u"?1:window.devicePixelRatio,_=f.useRef(R);f.useEffect(()=>{if(_.current!==R){S.current=0,O.current=0,_.current=R;const fe=M.current;fe!==null&&x.current(fe.scrollLeft,fe.scrollTop)}},[R]);const I=f.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),k=f.useRef(null),F=C0(200),[D,C]=f.useState(!0),E=f.useRef(0);f.useLayoutEffect(()=>{if(!D||F||I.current.lockDirection===void 0)return;const fe=M.current;if(fe===null)return;const[re,H]=I.current.lockDirection;re!==void 0?fe.scrollLeft=re:H!==void 0&&(fe.scrollTop=H),I.current.lockDirection=void 0},[F,D]);const T=f.useCallback((fe,re)=>{const H=M.current;if(H===null)return;re=re??H.scrollTop,fe=fe??H.scrollLeft;const P=I.current.scrollTop,X=I.current.scrollLeft,ce=fe-X,he=re-P;F&&ce!==0&&he!==0&&(Math.abs(ce)>3||Math.abs(he)>3)&&l&&I.current.lockDirection===void 0&&(I.current.lockDirection=Math.abs(ce)<Math.abs(he)?[X,void 0]:[void 0,P]);const ke=I.current.lockDirection;fe=ke?.[0]??fe,re=ke?.[1]??re,I.current.scrollLeft=fe,I.current.scrollTop=re;const Se=H.clientWidth,Qe=H.clientHeight,Ee=re,et=O.current-Ee,kt=H.scrollHeight-Qe;O.current=Ee;let Ne;if(kt>0&&r>H.scrollHeight+5)if(Math.abs(et)>2e3||Ee===0||Ee===kt){const ne=Math.max(0,Math.min(1,Ee/kt)),me=r-Qe;Ne=ne*me,S.current=Ne}else S.current-=et,Ne=S.current;else Ne=Ee,S.current=Ne;Ne=Math.max(0,Math.min(Ne,r-Qe)),S.current=Ne,ke!==void 0&&(window.clearTimeout(E.current),C(!1),E.current=window.setTimeout(()=>C(!0),200)),o({x:fe,y:Ne,width:Se-c,height:Qe-u,paddingRight:k.current?.clientWidth??0})},[u,c,r,o,l,F]);p0(h&&oa.value,T,M);const x=f.useRef(T);x.current=T;const N=f.useRef(),G=f.useRef(!1);f.useLayoutEffect(()=>{G.current?T():G.current=!0},[T,u,c]);const j=f.useCallback(fe=>{M.current=fe,m!==void 0&&(m.current=fe)},[m]);let ie=0,ee=0;const Q=Math.min(r,w0);for(y.push(f.createElement("div",{key:ie++,style:{width:i,height:0}}));ee<Q;){const fe=Math.min(y0,Q-ee);y.push(f.createElement("div",{key:ie++,style:{width:0,height:fe}})),ee+=fe}const{ref:te,width:se,height:ue}=m0(p);return typeof window<"u"&&(N.current?.height!==ue||N.current?.width!==se)&&(window.setTimeout(()=>x.current(),0),N.current={width:se,height:ue}),(se??0)===0||(ue??0)===0?f.createElement("div",{ref:te}):f.createElement("div",{ref:te},f.createElement(b0,{isSafari:oa.value},f.createElement("div",{className:"dvn-underlay"},t),f.createElement("div",{ref:j,style:N.current,draggable:s,onDragStart:fe=>{s||(fe.stopPropagation(),fe.preventDefault())},className:"dvn-scroller "+(a??""),onScroll:()=>T()},f.createElement("div",{className:"dvn-scroll-inner"+(d===void 0?" dvn-hidden":"")},f.createElement("div",{className:"dvn-stack"},y),d!==void 0&&f.createElement(f.Fragment,null,!v&&f.createElement("div",{className:"dvn-spacer"}),f.createElement("div",{ref:k,style:{height:ue,maxHeight:n-Math.ceil(R%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:c,flexGrow:v?1:void 0,right:b?c??0:void 0,pointerEvents:"auto"}},d))))))},x0=e=>{const{columns:t,rows:n,rowHeight:r,headerHeight:i,groupHeaderHeight:o,enableGroups:s,freezeColumns:a,experimental:l,nonGrowWidth:u,clientSize:c,className:d,onVisibleRegionChanged:g,scrollRef:h,preventDiagonalScrolling:m,rightElement:p,rightElementProps:y,overscrollX:b,overscrollY:v,initialSize:S,smoothScrollX:O=!1,smoothScrollY:M=!1,isDraggable:R}=e,{paddingRight:_,paddingBottom:I}=l??{},[k,F]=c,D=f.useRef(),C=f.useRef(),E=f.useRef(),T=f.useRef(),x=u+Math.max(0,b??0);let N=s?i+o:i;if(typeof r=="number")N+=n*r;else for(let ee=0;ee<n;ee++)N+=r(ee);v!==void 0&&(N+=v);const G=f.useRef(),j=f.useCallback(()=>{if(G.current===void 0)return;const ee={...G.current};let Q=0,te=ee.x<0?-ee.x:0,se=0,ue=0;ee.x=ee.x<0?0:ee.x;let fe=0;for(let he=0;he<a;he++)fe+=t[he].width;for(const he of t){const ke=Q-fe;if(ee.x>=ke+he.width)Q+=he.width,ue++,se++;else if(ee.x>ke)Q+=he.width,O?te+=ke-ee.x:ue++,se++;else if(ee.x+ee.width>ke)Q+=he.width,se++;else break}let re=0,H=0,P=0;if(typeof r=="number")M?(H=Math.floor(ee.y/r),re=H*r-ee.y):H=Math.ceil(ee.y/r),P=Math.ceil(ee.height/r)+H,re<0&&P++;else{let he=0;for(let ke=0;ke<n;ke++){const Se=r(ke),Qe=he+(M?0:Se/2);if(ee.y>=he+Se)he+=Se,H++,P++;else if(ee.y>Qe)he+=Se,M?re+=Qe-ee.y:H++,P++;else if(ee.y+ee.height>Se/2+he)he+=Se,P++;else break}}H=Math.max(0,Math.min(H,n-1)),P=Math.max(H,Math.min(P,n));const X={x:ue,y:H,width:se-ue,height:P-H},ce=D.current;(ce===void 0||ce.y!==X.y||ce.x!==X.x||ce.height!==X.height||ce.width!==X.width||C.current!==te||E.current!==re||ee.width!==T.current?.[0]||ee.height!==T.current?.[1])&&(g?.({x:ue,y:H,width:se-ue,height:P-H},ee.width,ee.height,ee.paddingRight??0,te,re),D.current=X,C.current=te,E.current=re,T.current=[ee.width,ee.height])},[t,r,n,g,a,O,M]),ie=f.useCallback(ee=>{G.current=ee,j()},[j]);return f.useEffect(()=>{j()},[j]),f.createElement(S0,{scrollRef:h,className:d,kineticScrollPerfHack:l?.kineticScrollPerfHack,preventDiagonalScrolling:m,draggable:R===!0||typeof R=="string",scrollWidth:x+(_??0),scrollHeight:N+(I??0),clientHeight:F,rightElement:p,paddingBottom:I,paddingRight:_,rightElementProps:y,update:ie,initialSize:S},f.createElement(g0,{eventTargetRef:h,width:k,height:F,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}))},k0=un("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),M0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),R0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),I0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),E0=10,T0=e=>{const{canvasRef:t,cellYOffset:n,rows:r,columns:i,searchInputRef:o,searchValue:s,searchResults:a,onSearchValueChange:l,getCellsForSelection:u,onSearchResultsChanged:c,showSearch:d=!1,onSearchClose:g}=e,[h]=f.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[m,p]=f.useState(""),y=s??m,b=f.useCallback(Q=>{p(Q),l?.(Q)},[l]),[v,S]=f.useState(),O=f.useRef(v);O.current=v,f.useEffect(()=>{a!==void 0&&(a.length>0?S(Q=>({rowsSearched:r,results:a.length,selectedIndex:Q?.selectedIndex??-1})):S(void 0))},[r,a]);const M=f.useRef();M.current===void 0&&(M.current=new AbortController);const R=f.useRef(),[_,I]=f.useState([]),k=a??_,F=f.useCallback(()=>{R.current!==void 0&&(window.cancelAnimationFrame(R.current),R.current=void 0,M.current.abort())},[]),D=f.useRef(n);D.current=n;const C=f.useCallback(Q=>{const te=new RegExp(Q.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let se=D.current,ue=Math.min(10,r),fe=0;S(void 0),I([]);const re=[],H=async()=>{if(u===void 0)return;const P=performance.now(),X=r-fe;let ce=u({x:0,y:se,width:i.length,height:Math.min(ue,X,r-se)},M.current.signal);typeof ce=="function"&&(ce=await ce());let he=!1;for(const[kt,Ne]of ce.entries())for(const[ne,me]of Ne.entries()){let xe;switch(me.kind){case J.Text:case J.Number:xe=me.displayData;break;case J.Uri:case J.Markdown:xe=me.data;break;case J.Boolean:xe=typeof me.data=="boolean"?me.data.toString():void 0;break;case J.Image:case J.Bubble:xe=me.data.join("🐳");break;case J.Custom:xe=me.copyData;break}xe!==void 0&&te.test(xe)&&(re.push([ne,kt+se]),he=!0)}const ke=performance.now();he&&I([...re]),fe+=ce.length,Dn(fe<=r);const Se=O.current?.selectedIndex??-1;S({results:re.length,rowsSearched:fe,selectedIndex:Se}),c?.(re,Se),se+ue>=r?se=0:se+=ue;const Qe=ke-P,Ee=Math.max(Qe,1),et=E0/Ee;ue=Math.ceil(ue*et),fe<r&&re.length<1e3&&(R.current=window.requestAnimationFrame(H))};F(),R.current=window.requestAnimationFrame(H)},[F,i.length,u,c,r]),E=f.useCallback(()=>{g?.(),S(void 0),I([]),c?.([],-1),F(),t?.current?.focus()},[F,t,g,c]),T=f.useCallback(Q=>{b(Q.target.value),a===void 0&&(Q.target.value===""?(S(void 0),I([]),F()):C(Q.target.value))},[C,F,b,a]);f.useEffect(()=>{d&&o.current!==null&&(b(""),o.current.focus({preventScroll:!0}))},[d,o,b]);const x=f.useCallback(Q=>{if(Q?.stopPropagation?.(),v===void 0)return;const te=(v.selectedIndex+1)%v.results;S({...v,selectedIndex:te}),c?.(k,te)},[v,c,k]),N=f.useCallback(Q=>{if(Q?.stopPropagation?.(),v===void 0)return;let te=(v.selectedIndex-1)%v.results;te<0&&(te+=v.results),S({...v,selectedIndex:te}),c?.(k,te)},[c,k,v]),G=f.useCallback(Q=>{(Q.ctrlKey||Q.metaKey)&&Q.nativeEvent.code==="KeyF"||Q.key==="Escape"?(E(),Q.stopPropagation(),Q.preventDefault()):Q.key==="Enter"&&(Q.shiftKey?N():x())},[E,x,N]);f.useEffect(()=>()=>{F()},[F]);const[j,ie]=f.useState(!1);f.useEffect(()=>{if(d)ie(!0);else{const Q=setTimeout(()=>ie(!1),150);return()=>clearTimeout(Q)}},[d]);const ee=f.useMemo(()=>{if(!d&&!j)return null;let Q;v!==void 0&&(Q=v.results>=1e3?"over 1000":`${v.results} result${v.results!==1?"s":""}`,v.selectedIndex>=0&&(Q=`${v.selectedIndex+1} of ${Q}`));const te=fe=>{fe.stopPropagation()},ue={width:`${Math.floor((v?.rowsSearched??0)/r*100)}%`};return f.createElement(k0,{className:"gdg-search-bar"+(d?"":" out"),onMouseDown:te,onMouseMove:te,onMouseUp:te,onClick:te},f.createElement("div",{className:"gdg-search-bar-inner"},f.createElement("input",{id:h,"aria-hidden":!d,"data-testid":"search-input",ref:o,onChange:T,value:y,tabIndex:d?void 0:-1,onKeyDownCapture:G}),f.createElement("button",{type:"button","aria-label":"Previous Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:N,disabled:(v?.results??0)===0},M0),f.createElement("button",{type:"button","aria-label":"Next Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:x,disabled:(v?.results??0)===0},R0),g!==void 0&&f.createElement("button",{type:"button","aria-label":"Close Search","aria-hidden":!d,"data-testid":"search-close-button",tabIndex:d?void 0:-1,onClick:E},I0)),v!==void 0?f.createElement(f.Fragment,null,f.createElement("div",{className:"gdg-search-status"},f.createElement("div",{"data-testid":"search-result-area"},Q)),f.createElement("div",{className:"gdg-search-progress",style:ue})):f.createElement("div",{className:"gdg-search-status"},f.createElement("label",{htmlFor:h},"Type to search")))},[d,j,v,r,h,o,T,y,G,N,x,g,E]);return f.createElement(f.Fragment,null,f.createElement(x0,{prelightCells:k,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}),ee)};class D0 extends f.PureComponent{wrapperRef=f.createRef();componentDidMount(){const t=this.props.customEventTarget??document;t.addEventListener("pointerdown",this.clickOutside,!0),t.addEventListener("contextmenu",this.clickOutside,!0)}componentWillUnmount(){const t=this.props.customEventTarget??document;t.removeEventListener("pointerdown",this.clickOutside,!0),t.removeEventListener("contextmenu",this.clickOutside,!0)}clickOutside=t=>{if(!(this.props.isOutsideClick&&!this.props.isOutsideClick(t))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(t.target)){let n=t.target;for(;n!==null;){if(n.classList.contains("click-outside-ignore"))return;n=n.parentElement}this.props.onClickOutside()}};render(){const{onClickOutside:t,isOutsideClick:n,customEventTarget:r,...i}=this.props;return f.createElement("div",{...i,ref:this.wrapperRef},this.props.children)}}const O0=()=>e=>Math.max(16,e.targetHeight-10),P0=un("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[O0(),"px"]}}),_0=e=>{const{bounds:t,group:n,onClose:r,canvasBounds:i,onFinish:o}=e,[s,a]=Vt.useState(n);return Vt.createElement(D0,{style:{position:"absolute",left:t.x-i.left+1,top:t.y-i.top,width:t.width-2,height:t.height},className:"gdg-c1tqibwd",onClickOutside:r},Vt.createElement(P0,{targetHeight:t.height,"data-testid":"group-rename-input",value:s,onBlur:r,onFocus:l=>l.target.setSelectionRange(0,s.length),onChange:l=>a(l.target.value),onKeyDown:l=>{l.key==="Enter"?o(s):l.key==="Escape"&&r()},autoFocus:!0}))};function F0(e,t){return e===void 0?!1:e.length>1&&e.startsWith("_")?Number.parseInt(e.slice(1))===t.keyCode:e.length===1&&e>="a"&&e<="z"?e.toUpperCase().codePointAt(0)===t.keyCode:e===t.key}function ot(e,t,n){const r=Ld(e,t);return r&&(n.didMatch=!0),r}function Ld(e,t){if(e.length===0)return!1;if(e.includes("|")){const l=e.split("|");for(const u of l)if(Ld(u,t))return!0;return!1}let n=!1,r=!1,i=!1,o=!1;const s=e.split("+"),a=s.pop();if(!F0(a,t))return!1;if(s[0]==="any")return!0;for(const l of s)switch(l){case"ctrl":n=!0;break;case"shift":r=!0;break;case"alt":i=!0;break;case"meta":o=!0;break;case"primary":aa.value?o=!0:n=!0;break}return t.altKey===i&&t.ctrlKey===n&&t.shiftKey===r&&t.metaKey===o}function L0(e,t,n,r,i,o,s){const a=Vt.useCallback((c,d,g,h)=>{(o==="cell"||o==="multi-cell")&&c!==void 0&&(c={...c,range:{x:c.cell[0],y:c.cell[1],width:1,height:1}}),!s&&c!==void 0&&c.range.width>1&&(c={...c,range:{...c.range,width:1,x:c.cell[0]}});const m=n==="mixed"&&(g||h==="drag"),p=r==="mixed"&&m,y=i==="mixed"&&m;let b={current:c===void 0?void 0:{...c,rangeStack:h==="drag"?e.current?.rangeStack??[]:[]},columns:p?e.columns:it.empty(),rows:y?e.rows:it.empty()};g&&(o==="multi-rect"||o==="multi-cell")&&b.current!==void 0&&e.current!==void 0&&(b={...b,current:{...b.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(b,d)},[r,e,n,o,s,i,t]),l=Vt.useCallback((c,d,g)=>{c=c??e.rows,d!==void 0&&(c=c.add(d));let h;if(i==="exclusive"&&c.length>0)h={current:void 0,columns:it.empty(),rows:c};else{const m=g&&n==="mixed",p=g&&r==="mixed";h={current:m?e.current:void 0,columns:p?e.columns:it.empty(),rows:c}}t(h,!1)},[r,e,n,i,t]),u=Vt.useCallback((c,d,g)=>{c=c??e.columns,d!==void 0&&(c=c.add(d));let h;if(r==="exclusive"&&c.length>0)h={current:void 0,rows:it.empty(),columns:c};else{const m=g&&n==="mixed",p=g&&i==="mixed";h={current:m?e.current:void 0,rows:p?e.rows:it.empty(),columns:c}}t(h,!1)},[r,e,n,i,t]);return[a,l,u]}function A0(e,t,n,r,i){const o=f.useCallback(u=>{if(e===!0){const c=[];for(let d=u.y;d<u.y+u.height;d++){const g=[];for(let h=u.x;h<u.x+u.width;h++)h<0||d>=i?g.push({kind:J.Loading,allowOverlay:!1}):g.push(t([h,d]));c.push(g)}return c}return e?.(u,r.signal)??[]},[r.signal,t,e,i]),s=e!==void 0?o:void 0,a=f.useCallback(u=>{if(s===void 0)return[];const c={...u,x:u.x-n};if(c.x<0){c.x=0,c.width--;const d=s(c,r.signal);return typeof d=="function"?async()=>(await d()).map(g=>[{kind:J.Loading,allowOverlay:!1},...g]):d.map(g=>[{kind:J.Loading,allowOverlay:!1},...g])}return s(c,r.signal)},[r.signal,s,n]);return[e!==void 0?a:void 0,s]}function H0(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string",doNotEscape:!0};switch(e.kind){case J.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===Vs?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case J.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case J.Image:case J.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case J.Drilldown:return{formatted:e.data.map(t=>t.text),rawValue:e.data.map(t=>t.text),format:"string-array"};case J.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:"string"};case J.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:"url"};case J.Markdown:case J.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case J.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case J.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case J.Protected:return{formatted:"************",rawValue:"",format:"string"};default:to()}}function z0(e,t){return e.map((r,i)=>{const o=t[i];return r.map(s=>s.span!==void 0&&s.span[0]!==o?{formatted:"",rawValue:"",format:"string"}:H0(s))})}function Tu(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function V0(e){const t=[];for(const n of e){const r=[];for(const i of n)i.format==="url"?r.push(i.rawValue?.toString()??""):i.format==="string-array"?r.push(i.formatted.map(o=>Tu(o,!0)).join(",")):r.push(i.doNotEscape===!0?i.formatted:Tu(i.formatted,!1));t.push(r.join(" "))}return t.join(`
|
166
|
+
`)}function ls(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>"<span> </span>".repeat(t.length))}function Du(e){return'"'+e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")+'"'}function $0(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function N0(e){const t=[];t.push('<style type="text/css"><!--br {mso-data-placement:same-cell;}--></style>',"<table><tbody>");for(const n of e){t.push("<tr>");for(const r of n){const i=`gdg-format="${r.format}"`;r.format==="url"?t.push(`<td ${i}><a href="${r.rawValue}">${ls(r.formatted)}</a></td>`):r.format==="string-array"?t.push(`<td ${i}><ol>${r.formatted.map((o,s)=>`<li gdg-raw-value=${Du(r.rawValue[s])}>`+ls(o)+"</li>").join("")}</ol></td>`):t.push(`<td gdg-raw-value=${Du(r.rawValue?.toString()??"")} ${i}>${ls(r.formatted)}</td>`)}t.push("</tr>")}return t.push("</tbody></table>"),t.join("")}function B0(e,t){const n=z0(e,t),r=V0(n),i=N0(n);return{textPlain:r,textHtml:i}}function Ou(e){const t=document.createElement("html");t.innerHTML=e.replace(/ /g," ");const n=t.querySelector("table");if(n===null)return;const r=[n],i=[];let o;for(;r.length>0;){const s=r.pop();if(s===void 0)break;if(s instanceof HTMLTableElement||s.nodeName==="TBODY")r.push(...[...s.children].reverse());else if(s instanceof HTMLTableRowElement)o!==void 0&&i.push(o),o=[],r.push(...[...s.children].reverse());else if(s instanceof HTMLTableCellElement){const a=s.cloneNode(!0),u=a.children.length===1&&a.children[0].nodeName==="P"?a.children[0]:null,c=u?.children.length===1&&u.children[0].nodeName==="FONT",d=a.querySelectorAll("br");for(const m of d)m.replaceWith(`
|
167
|
+
`);const g=a.getAttribute("gdg-raw-value"),h=a.getAttribute("gdg-format")??"string";if(a.querySelector("a")!==null)o?.push({rawValue:a.querySelector("a")?.getAttribute("href")??"",formatted:a.textContent??"",format:h});else if(a.querySelector("ol")!==null){const m=a.querySelectorAll("li");o?.push({rawValue:[...m].map(p=>p.getAttribute("gdg-raw-value")??""),formatted:[...m].map(p=>p.textContent??""),format:"string-array"})}else if(g!==null)o?.push({rawValue:$0(g),formatted:a.textContent??"",format:h});else{let m=a.textContent??"";c&&(m=m.replace(/\n(?!\n)/g,"")),o?.push({rawValue:m??"",formatted:m??"",format:h})}}}return o!==void 0&&i.push(o),i}function W0(e,t,n,r,i){const o=e;if(r==="allowPartial"||e.current===void 0||t===void 0)return e;let s=!1;do{if(e?.current===void 0)break;const a=e.current?.range,l=[];if(a.width>2){const d=t({x:a.x,y:a.y,width:1,height:a.height},i.signal);if(typeof d=="function")return o;l.push(...d);const g=t({x:a.x+a.width-1,y:a.y,width:1,height:a.height},i.signal);if(typeof g=="function")return o;l.push(...g)}else{const d=t({x:a.x,y:a.y,width:a.width,height:a.height},i.signal);if(typeof d=="function")return o;l.push(...d)}let u=a.x-n,c=a.x+a.width-1-n;for(const d of l)for(const g of d)g.span!==void 0&&(u=Math.min(g.span[0],u),c=Math.max(g.span[1],c));u===a.x-n&&c===a.x+a.width-1-n?s=!0:e={current:{cell:e.current.cell??[0,0],range:{x:u+n,y:a.y,width:c-u+1,height:a.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!s);return e}function Pu(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function U0(e){let t;(function(a){a[a.None=0]="None",a[a.inString=1]="inString",a[a.inStringPostQuote=2]="inStringPostQuote"})(t||(t={}));const n=[];let r=[],i=0,o=t.None;e=e.replace(/\r\n/g,`
|
168
168
|
`);let s=0;for(const a of e){switch(o){case t.None:a===" "||a===`
|
169
169
|
`?(r.push(e.slice(i,s)),i=s+1,a===`
|
170
170
|
`&&(n.push(r),r=[])):a==='"'&&(o=t.inString);break;case t.inString:a==='"'&&(o=t.inStringPostQuote);break;case t.inStringPostQuote:a==='"'?o=t.inString:((a===" "||a===`
|
171
171
|
`)&&(r.push(Pu(e.slice(i,s))),i=s+1,a===`
|
172
|
-
`&&(n.push(r),r=[])),o=t.None);break}s++}return i<e.length&&r.push(Pu(e.slice(i,e.length))),n.push(r),n.map(a=>a.map(l=>({rawValue:l,formatted:l,format:"string"})))}function _u(e,t,n){const r=V0(e,t),i=a=>{window.navigator.clipboard?.writeText(a)},o=(a,l)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([a],{type:"text/plain"}),"text/html":new Blob([l],{type:"text/html"})})]),!0),s=(a,l)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",a),n?.clipboardData?.setData("text/html",l)}catch{o(a,l)||i(a)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?s(r.textPlain,r.textHtml):i(r.textPlain),n?.preventDefault()}function Ld(e){return e!==!0}function Fu(e){return typeof e=="string"?e:`${e}px`}const B0=()=>e=>e.innerWidth,W0=()=>e=>e.innerHeight,U0=un("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[B0()],"wmyidgi-1":[W0()]}}),q0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return f.createElement(U0,{innerHeight:Fu(n),innerWidth:Fu(t),...i},r)},G0=2,Y0=1300;function j0(e,t,n){const r=Vt.useRef(0),[i,o]=e??[0,0];Vt.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let s=!1,a=0;const l=u=>{if(!s){if(a===0)a=u;else{const c=u-a;r.current=Math.min(1,r.current+c/Y0);const d=r.current**1.618*c*G0;t.current?.scrollBy(i*d,o*d),a=u,n?.()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{s=!0}},[t,i,o,n])}function X0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:s,remSize:a}){const[l,u,c,d,g,h]=Vt.useMemo(()=>{if(!s||a===16)return[e,t,n,r,i,o];const m=a/16,p=e,y=yd();return[typeof p=="number"?p*m:b=>Math.ceil(p(b)*m),Math.ceil(t*m),Math.ceil(n*m),{...r,headerIconSize:(r?.headerIconSize??y.headerIconSize)*m,cellHorizontalPadding:(r?.cellHorizontalPadding??y.cellHorizontalPadding)*m,cellVerticalPadding:(r?.cellVerticalPadding??y.cellVerticalPadding)*m},Math.ceil((i??0)*m),Math.ceil((o??0)*m)]},[n,t,i,o,a,e,s,r]);return{rowHeight:l,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:g,overscrollY:h}}const br={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function at(e,t){return e===!0?t:e===!1?"":e}function Lu(e){const t=aa.value;return{activateCell:at(e.activateCell," |Enter|shift+Enter"),clear:at(e.clear,"any+Escape"),closeOverlay:at(e.closeOverlay,"any+Escape"),acceptOverlayDown:at(e.acceptOverlayDown,"Enter"),acceptOverlayUp:at(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:at(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:at(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:at(e.delete,t?"Backspace|Delete":"Delete"),downFill:at(e.downFill,"primary+_68"),scrollToSelectedCell:at(e.scrollToSelectedCell,"primary+Enter"),goDownCell:at(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:at(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:at(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:at(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:at(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:at(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:at(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:at(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:at(e.goToFirstCell,"primary+Home"),goToFirstColumn:at(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:at(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:at(e.goToLastCell,"primary+End"),goToLastColumn:at(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:at(e.goToLastRow,"primary+ArrowDown"),goToNextPage:at(e.goToNextPage,"PageDown"),goToPreviousPage:at(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:at(e.rightFill,"primary+_82"),search:at(e.search,"primary+f"),selectAll:at(e.selectAll,"primary+a"),selectColumn:at(e.selectColumn,"ctrl+ "),selectGrowDown:at(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:at(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:at(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:at(e.selectGrowUp,"shift+ArrowUp"),selectRow:at(e.selectRow,"shift+ "),selectToFirstCell:at(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:at(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:at(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:at(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:at(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:at(e.selectToLastRow,"primary+shift+ArrowDown")}}function K0(e){const t=rm(e);return Vt.useMemo(()=>{if(t===void 0)return Lu(br);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??br.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??br.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??br.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??br.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??br.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??br.selectToLastCell};return Lu({...br,...n})},[t])}function Z0(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const s={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(s.subGroups=r.subGroups.map((a,l)=>t(a,i+1,[...o,l])).sort((a,l)=>a.headerIndex-l.headerIndex)),s}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function Qs(e,t){const n=[];function r(a,l,u=!1){let c=l!==null?l-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(c=a.subGroups[0].headerIndex-a.headerIndex),c--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:u,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:c}),a.subGroups)for(let d=0;d<a.subGroups.length;d++){const g=d<a.subGroups.length-1?a.subGroups[d+1].headerIndex:l;r(a.subGroups[d],g,u||a.isCollapsed)}}const i=Z0(e.groups);for(let a=0;a<i.length;a++){const l=a<i.length-1?i[a+1].headerIndex:null;r(i[a],l)}let o=0,s=0;for(const a of n)a.contentIndex=s,s+=a.rows,a.rowIndex=o,o+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:l,...u}=a;return u})}function Ts(e,t){if(t===void 0||Qs.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(r.isCollapsed)n--;else{if(n<=r.rows)return{path:[...r.path,n-1],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n-1,contentIndex:r.contentIndex+n-1,groupRows:r.rows};n=n-r.rows-1}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function J0(e,t,n,r){const i=Vt.useMemo(()=>e===void 0?void 0:Qs(e,t),[e,t]),o=Vt.useMemo(()=>i?.reduce((c,d)=>(c[d.rowIndex]=d,c),{}),[i]),s=Vt.useMemo(()=>i===void 0?t:i.reduce((c,d)=>c+(d.isCollapsed?1:d.rows+1),0),[i,t]),a=Vt.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>o?.[c]?e.height:typeof n=="number"?n:n(c),[o,e,n]),l=Vt.useCallback(c=>{if(i===void 0)return c;let d=c;for(const g of i){if(d===0)return;if(d--,!g.isCollapsed){if(d<g.rows)return g.contentIndex+d;d-=g.rows}}return c},[i]),u=wr(r??e?.themeOverride,Vt.useCallback(c=>{if(e===void 0)return r?.(c,c,c);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:d,contentIndex:g,groupIndex:h}=Ts(c,i);return d?e.themeOverride:r?.(c,h,g)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:l,getRowThemeOverride:u}:{rowHeight:a,rows:s,rowNumberMapper:l,getRowThemeOverride:u}}function Q0(e,t){const n=Vt.useMemo(()=>e===void 0?void 0:Qs(e,t),[e,t]);return{getRowGroupingForPath:Hd,updateRowGroupingByPath:Ad,mapper:Vt.useCallback(r=>{if(typeof r=="number")return Ts(r,n);const i=Ts(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function Ad(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,s)=>s===r?{...o,...n}:o):e.map((o,s)=>s===r?{...o,subGroups:Ad(o.subGroups??[],i,n)}:o)}function Hd(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Hd(e[n].subGroups??[],r)}function ev(e,t){const[n]=f.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}));return n.callback=t,n.facade}function tv(e,t,n,r,i){const[o,s]=f.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),a=f.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:s}),[r,s,o]),[l,u,c]=nm(a),d=f.useRef(i);d.current=i;const g=ev(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.scrollLeft=e)}),h=(l.height??1)>1;f.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&h){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&c(),d.current()}},[t,h,c,g]);const m=(l.width??1)>1;return f.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&m){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&c(),d.current()}},[e,m,c,g]),{visibleRegion:l,setVisibleRegion:u,scrollRef:g}}const nv=f.lazy(async()=>await As(()=>import("./data-grid-overlay-editor.CxvB719M.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url));let rv=0;function iv(e){return ap(Cu(Cu(e).filter(t=>t.span!==void 0).map(t=>Sr((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Vo(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const No={kind:J.Loading,allowOverlay:!1},$o={columns:it.empty(),rows:it.empty(),current:void 0},ov=(e,t)=>{const[n,r]=f.useState($o),[i,o]=f.useState(),s=f.useRef(null),a=f.useRef(null),[l,u]=f.useState(),c=f.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:h,markdownDivCreateNode:m,width:p,height:y,columns:b,rows:v,getCellContent:S,onCellClicked:O,onCellActivated:R,onFillPattern:M,onFinishedEditing:_,coercePasteValue:E,drawHeader:k,drawCell:F,editorBloom:D,onHeaderClicked:C,onColumnProposeMove:I,rangeSelectionColumnSpanning:T=!0,spanRangeBehavior:x="default",onGroupHeaderClicked:$,onCellContextMenu:G,className:X,onHeaderContextMenu:ie,getCellsForSelection:ee,onGroupHeaderContextMenu:Q,onGroupHeaderRenamed:te,onCellEdited:se,onCellsEdited:ue,onSearchResultsChanged:fe,searchResults:re,onSearchValueChange:H,searchValue:P,onKeyDown:Y,onKeyUp:ce,keybindings:he,editOnType:ke=!0,onRowAppended:Se,onColumnAppended:Je,onColumnMoved:Ie,validateCell:Qe,highlightRegions:kt,rangeSelect:$e="rect",columnSelect:ne="multi",rowSelect:me="multi",rangeSelectionBlending:xe="exclusive",columnSelectionBlending:de="exclusive",rowSelectionBlending:be="exclusive",onDelete:Pe,onDragStart:Te,onMouseMove:st,onPaste:Re,copyHeaders:qe=!1,freezeColumns:He=0,cellActivationBehavior:we="second-click",rowSelectionMode:Be="auto",onHeaderMenuClick:mt,onHeaderIndicatorClick:ft,getGroupDetails:Ge,rowGrouping:yt,onSearchClose:Yt,onItemHovered:Ht,onSelectionCleared:Mt,showSearch:nn,onVisibleRegionChanged:qt,gridSelection:cn,onGridSelectionChange:Ot,minColumnWidth:ut=50,maxColumnWidth:tn=500,maxColumnAutoWidth:Ct,provideEditor:rn,trailingRowOptions:Bt,freezeTrailingRows:De=0,allowedFillDirections:It="orthogonal",scrollOffsetX:Pt,scrollOffsetY:wn,verticalBorder:jt,onDragOverCell:dn,onDrop:Mn,onColumnResize:Xt,onColumnResizeEnd:Jt,onColumnResizeStart:We,customRenderers:Rt,fillHandle:yn,experimental:vt,fixedShadowX:Ft,fixedShadowY:Cn,headerIcons:Wn,imageWindowLoader:zn,initialSize:N,isDraggable:Ne,onDragLeave:Ue,onRowMoved:St,overscrollX:mn,overscrollY:ge,preventDiagonalScrolling:bt,rightElement:Qt,rightElementProps:Et,trapFocus:$t=!1,smoothScrollX:on,smoothScrollY:xa,scaleToRem:fo=!1,rowHeight:ka=34,headerHeight:ho=36,groupHeaderHeight:Rr=ho,theme:lr,isOutsideClick:Ma,renderers:bi,resizeIndicator:go,scrollToActiveCell:wi=!0,drawFocusRing:Er=!0,portalElementRef:pl}=e,yi=Er==="no-editor"?i===void 0:Er,Pn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,Sn=Pn?.kind??e.rowMarkers??"none",Ci=Pn?.width??e.rowMarkerWidth,Jn=Pn?.startIndex??e.rowMarkerStartIndex??1,Qn=Pn?.theme??e.rowMarkerTheme,Gr=Pn?.headerTheme,ur=Pn?.headerAlwaysVisible,Ir=me!=="multi"||Pn?.headerDisabled===!0,Yr=Pn?.checkboxStyle??"square",er=Math.max(ut,20),jr=Math.max(tn,er),Ra=Math.max(Ct??jr,er),mo=f.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:_e,rowNumberMapper:Si,rowHeight:po,getRowThemeOverride:cr}=J0(yt,v,ka,h),Ea=f.useMemo(()=>Number.parseFloat(mo.fontSize),[mo]),{rowHeight:Un,headerHeight:xi,groupHeaderHeight:vo,theme:bo,overscrollX:ki,overscrollY:Ia}=X0({groupHeaderHeight:Rr,headerHeight:ho,overscrollX:mn,overscrollY:ge,remSize:Ea,rowHeight:po,scaleToRem:fo,theme:lr}),qn=K0(he),dr=Ci??(v>1e4?48:v>1e3?44:v>100?36:32),_n=Sn!=="none",U=_n?1:0,Lt=Bt!==void 0,tr=Bt?.sticky===!0,[Mi,wo]=f.useState(!1),Xr=nn??Mi,Ta=f.useCallback(()=>{Yt!==void 0?Yt():wo(!1)},[Yt]),K=f.useMemo(()=>cn===void 0?void 0:Vo(cn,U),[cn,U])??n,xn=f.useRef();xn.current===void 0&&(xn.current=new AbortController),f.useEffect(()=>()=>xn?.current.abort(),[]);const[z,oe]=_0(ee,S,U,xn.current,_e),Me=f.useCallback((w,A,L)=>{if(Qe===void 0)return!0;const W=[w[0]-U,w[1]];return Qe?.(W,A,L)},[U,Qe]),Ee=f.useRef(cn),ae=f.useCallback((w,A)=>{A&&(w=N0(w,z,U,x,xn.current)),Ot!==void 0?(Ee.current=Vo(w,-U),Ot(Ee.current)):r(w)},[Ot,z,U,x]),ve=wr(Xt,f.useCallback((w,A,L,W)=>{Xt?.(b[L-U],A,L-U,W)},[Xt,U,b])),Ye=wr(Jt,f.useCallback((w,A,L,W)=>{Jt?.(b[L-U],A,L-U,W)},[Jt,U,b])),ye=wr(We,f.useCallback((w,A,L,W)=>{We?.(b[L-U],A,L-U,W)},[We,U,b])),je=wr(k,f.useCallback((w,A)=>k?.({...w,columnIndex:w.columnIndex-U},A)??!1,[k,U])),ct=wr(F,f.useCallback((w,A)=>F?.({...w,col:w.col-U},A)??!1,[F,U])),Zt=f.useCallback(w=>{if(Pe!==void 0){const A=Pe(Vo(w,-U));return typeof A=="boolean"?A:Vo(A,U)}return!0},[Pe,U]),[dt,Tt,et]=P0(K,ae,xe,de,be,$e,T),Ze=f.useMemo(()=>ir(yd(),bo),[bo]),[zt,Wt]=f.useState([0,0,0]),Tr=f.useMemo(()=>{if(bi===void 0)return{};const w={};for(const A of bi)w[A.kind]=A;return w},[bi]),en=f.useCallback(w=>w.kind!==J.Custom?Tr[w.kind]:Rt?.find(A=>A.isMatch(w)),[Rt,Tr]);let{sizedColumns:an,nonGrowWidth:fr}=Zm(b,_e,oe,zt[0]-(U===0?0:dr)-zt[2],er,Ra,Ze,en,xn.current);Sn!=="none"&&(fr+=dr);const _t=f.useMemo(()=>an.some(w=>w.group!==void 0),[an]),kn=_t?xi+vo:xi,Rn=K.rows.length,hr=Sn==="none"?void 0:Rn===0?!1:Rn===_e?!0:void 0,tt=f.useMemo(()=>Sn==="none"?an:[{title:"",width:dr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:Qn,rowMarker:Yr,rowMarkerChecked:hr,headerRowMarkerTheme:Gr,headerRowMarkerAlwaysVisible:ur,headerRowMarkerDisabled:Ir},...an],[Sn,an,dr,Qn,Yr,hr,Gr,ur,Ir]),sn=f.useRef({height:1,width:1,x:0,y:0}),Gn=f.useRef(!1),{setVisibleRegion:vl,visibleRegion:Dr,scrollRef:Ut}=tv(Pt,wn,Un,sn,()=>Gn.current=!0);sn.current=Dr;const Pf=Dr.x+U,yo=Dr.y,fn=f.useRef(null),pn=f.useCallback(w=>{w===!0?fn.current?.focus():window.requestAnimationFrame(()=>{fn.current?.focus()})},[]),hn=Lt?_e+1:_e,Fn=f.useCallback(w=>{const A=U===0?w:w.map(W=>({...W,location:[W.location[0]-U,W.location[1]]})),L=ue?.(A);if(L!==!0)for(const W of A)se?.(W.location,W.value);return L},[se,ue,U]),[Or,Da]=f.useState(),Co=K.current!==void 0&&K.current.range.width*K.current.range.height>1?K.current.range:void 0,bl=yi?K.current?.cell:void 0,So=bl?.[0],xo=bl?.[1],_f=f.useMemo(()=>{if((kt===void 0||kt.length===0)&&(Co??So??xo??Or)===void 0)return;const w=[];if(kt!==void 0)for(const A of kt){const L=tt.length-A.range.x-U;L>0&&w.push({color:A.color,range:{...A.range,x:A.range.x+U,width:Math.min(L,A.range.width)},style:A.style})}return Or!==void 0&&w.push({color:Nr(Ze.accentColor,0),range:Or,style:"dashed"}),Co!==void 0&&w.push({color:Nr(Ze.accentColor,.5),range:Co,style:"solid-outline"}),So!==void 0&&xo!==void 0&&w.push({color:Ze.accentColor,range:{x:So,y:xo,width:1,height:1},style:"solid-outline"}),w.length>0?w:void 0},[Or,Co,So,xo,kt,tt.length,Ze.accentColor,U]),wl=f.useRef(tt);wl.current=tt;const En=f.useCallback(([w,A],L=!1)=>{const W=Lt&&A===hn-1;if(w===0&&_n){if(W)return No;const j=Si(A);return j===void 0?No:{kind:Hn.Marker,allowOverlay:!1,checkboxStyle:Yr,checked:K?.rows.hasIndex(A)===!0,markerKind:Sn==="clickable-number"?"number":Sn,row:Jn+j,drawHandle:St!==void 0,cursor:Sn==="clickable-number"?"pointer":void 0}}else if(W){const V=w===U?Bt?.hint??"":"",B=wl.current[w];if(B?.trailingRowOptions?.disabled===!0)return No;{const Z=B?.trailingRowOptions?.hint??V,le=B?.trailingRowOptions?.addIcon??Bt?.addIcon;return{kind:Hn.NewRow,hint:Z,allowOverlay:!1,icon:le}}}else{const j=w-U;if(L||vt?.strict===!0){const B=sn.current,Z=B.x>j||j>B.x+B.width||B.y>A||A>B.y+B.height||A>=Fa.current,le=j===B.extras?.selected?.[0]&&A===B.extras?.selected[1];let pe=!1;if(B.extras?.freezeRegions!==void 0){for(const wt of B.extras.freezeRegions)if(Vr(wt,j,A)){pe=!0;break}}if(Z&&!le&&!pe)return No}let V=S([j,A]);return U!==0&&V.span!==void 0&&(V={...V,span:[V.span[0]+U,V.span[1]+U]}),V}},[Lt,hn,_n,Si,Yr,K?.rows,Sn,Jn,St,U,Bt?.hint,Bt?.addIcon,vt?.strict,S]),Oa=f.useCallback(w=>{let A=Ge?.(w)??{name:w};return te!==void 0&&w!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:L=>Aa({group:A.name,bounds:L.bounds})}]}),A},[Ge,te]),ko=f.useCallback(w=>{const[A,L]=w.cell,W=tt[A],q=W?.group!==void 0?Oa(W.group)?.overrideTheme:void 0,j=W?.themeOverride,V=cr?.(L);o({...w,theme:ir(Ze,q,j,V,w.content.themeOverride)})},[cr,tt,Oa,Ze]),Kr=f.useCallback((w,A,L)=>{if(K.current===void 0)return;const[W,q]=K.current.cell,j=En([W,q]);if(j.kind!==J.Boolean&&j.allowOverlay){let V=j;if(L!==void 0)switch(V.kind){case J.Number:{const B=Dg(()=>L==="-"?-0:Number.parseFloat(L),0);V={...V,data:Number.isNaN(B)?0:B};break}case J.Text:case J.Markdown:case J.Uri:V={...V,data:L};break}ko({target:w,content:V,initialValue:L,cell:[W,q],highlight:L===void 0,forceEditMode:L!==void 0})}else j.kind===J.Boolean&&A&&j.readonly!==!0&&(Fn([{location:K.current.cell,value:{...j,data:Ld(j.data)}}]),fn.current?.damage([{cell:K.current.cell}]))},[En,K,Fn,ko]),yl=f.useCallback((w,A)=>{const L=fn.current?.getBounds(w,A);if(L===void 0||Ut.current===null)return;const W=En([w,A]);W.allowOverlay&&ko({target:L,content:W,initialValue:void 0,highlight:!0,cell:[w,A],forceEditMode:!0})},[En,Ut,ko]),Gt=f.useCallback((w,A,L="both",W=0,q=0,j=void 0)=>{if(Ut.current!==null){const V=fn.current,B=a.current,Z=typeof w!="number"?w.unit==="cell"?w.amount:void 0:w,le=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,pe=typeof w!="number"&&w.unit==="px"?w.amount:void 0,wt=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(V!==null&&B!==null){let rt={x:0,y:0,width:0,height:0},Xe=0,Ke=0;if((Z!==void 0||le!==void 0)&&(rt=V.getBounds((Z??0)+U,le??0)??rt,rt.width===0||rt.height===0))return;const ht=B.getBoundingClientRect(),xt=ht.width/B.offsetWidth;if(pe!==void 0&&(rt={...rt,x:pe-ht.left-Ut.current.scrollLeft,width:1}),wt!==void 0&&(rt={...rt,y:wt+ht.top-Ut.current.scrollTop,height:1}),rt!==void 0){const pt={x:rt.x-W,y:rt.y-q,width:rt.width+2*W,height:rt.height+2*q};let ni=0;for(let Wa=0;Wa<He;Wa++)ni+=an[Wa].width;let _i=0;const Fi=De+(tr?1:0);Fi>0&&(_i=Ur(hn,Fi,Un));let jn=ni*xt+ht.left+U*dr*xt,ri=ht.right,Lr=ht.top+kn*xt,ii=ht.bottom-_i*xt;const Oo=rt.width+W*2;switch(j?.hAlign){case"start":ri=jn+Oo;break;case"end":jn=ri-Oo;break;case"center":jn=Math.floor((jn+ri)/2)-Oo/2,ri=jn+Oo;break}const Po=rt.height+q*2;switch(j?.vAlign){case"start":ii=Lr+Po;break;case"end":Lr=ii-Po;break;case"center":Lr=Math.floor((Lr+ii)/2)-Po/2,ii=Lr+Po;break}jn>pt.x?Xe=pt.x-jn:ri<pt.x+pt.width&&(Xe=pt.x+pt.width-ri),Lr>pt.y?Ke=pt.y-Lr:ii<pt.y+pt.height&&(Ke=pt.y+pt.height-ii),L==="vertical"||typeof w=="number"&&w<He?Xe=0:(L==="horizontal"||typeof A=="number"&&A>=hn-Fi)&&(Ke=0),(Xe!==0||Ke!==0)&&(xt!==1&&(Xe/=xt,Ke/=xt),Ut.current.scrollTo({left:Xe+Ut.current.scrollLeft,top:Ke+Ut.current.scrollTop,behavior:j?.behavior??"auto"}))}}}},[U,De,dr,Ut,kn,He,an,hn,tr,Un]),Pa=f.useRef(yl),_a=f.useRef(S);Pa.current=yl,_a.current=S;const Fa=f.useRef(_e);Fa.current=_e;const Cl=f.useRef(tt.length);Cl.current=tt.length;const gr=f.useCallback(async(w,A=!0,L)=>{if(tt[w]?.trailingRowOptions?.disabled===!0)return;const q=Se?.();let j,V=!0;q!==void 0&&(j=await q,j==="top"&&(V=!1),typeof j=="number"&&(V=!1));let B=0;const Z=()=>{if(Fa.current<=_e){B<500&&window.setTimeout(Z,B),B=50+B*2;return}const le=typeof j=="number"?j:V?_e:0;Do.current(w-U,le,"both",0,0,L?{behavior:L}:void 0),dt({cell:[w,le],range:{x:w,y:le,width:1,height:1}},!1,!1,"edit");const pe=_a.current([w-U,le]);pe.allowOverlay&&ui(pe)&&pe.readonly!==!0&&A&&window.setTimeout(()=>{Pa.current(w,le)},0)};Z()},[tt,Se,U,_e,dt]),Mo=f.useCallback(async(w,A=!0)=>{const L=Je?.();let W,q=!0;L!==void 0&&(W=await L,W==="left"&&(q=!1),typeof W=="number"&&(q=!1));let j=0;const V=()=>{if(Cl.current<=tt.length){j<500&&window.setTimeout(V,j),j=50+j*2;return}const B=typeof W=="number"?W:q?tt.length:0;Gt(B-U,w),dt({cell:[B,w],range:{x:B,y:w,width:1,height:1}},!1,!1,"edit");const Z=_a.current([B-U,w]);Z.allowOverlay&&ui(Z)&&Z.readonly!==!0&&A&&window.setTimeout(()=>{Pa.current(B,w)},0)};V()},[tt,Je,U,Gt,dt]),Zr=f.useCallback(w=>{const A=an[w]?.trailingRowOptions?.targetColumn??Bt?.targetColumn;if(typeof A=="number")return A+(_n?1:0);if(typeof A=="object"){const L=b.indexOf(A);if(L>=0)return L+(_n?1:0)}},[an,b,_n,Bt?.targetColumn]),mr=f.useRef(),Jr=f.useRef(),Ei=f.useCallback((w,A)=>{const[L,W]=A;return ir(Ze,tt[L]?.themeOverride,cr?.(W),w.themeOverride)},[cr,tt,Ze]),{mapper:Pr}=Q0(yt,v),Vn=yt?.navigationBehavior,Ii=f.useCallback(w=>{const A=aa.value?w.metaKey:w.ctrlKey,L=A&&me==="multi",W=A&&ne==="multi",[q,j]=w.location,V=K.columns,B=K.rows,[Z,le]=K.current?.cell??[];if(w.kind==="cell"){if(Jr.current=void 0,_r.current=[q,j],q===0&&_n){if(Lt===!0&&j===_e||Sn==="number"||me==="none")return;const pe=En(w.location);if(pe.kind!==Hn.Marker)return;if(St!==void 0){const Xe=en(pe);Dn(Xe?.kind===Hn.Marker);const Ke=Xe?.onClick?.({...w,cell:pe,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,theme:Ei(pe,w.location),preventDefault:()=>{}});if(Ke===void 0||Ke.checked===pe.checked)return}o(void 0),pn();const wt=B.hasIndex(j),rt=mr.current;if(me==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&rt!==void 0&&B.hasIndex(rt)){const Xe=[Math.min(rt,j),Math.max(rt,j)+1];L||Be==="multi"?Tt(void 0,Xe,!0):Tt(it.fromSingleSelection(Xe),void 0,L)}else me==="multi"&&(L||w.isTouch||Be==="multi")?wt?Tt(B.remove(j),void 0,!0):(Tt(void 0,j,!0),mr.current=j):wt&&B.length===1?Tt(it.empty(),void 0,A):(Tt(it.fromSingleSelection(j),void 0,A),mr.current=j)}else if(q>=U&&Lt&&j===_e){const pe=Zr(q);gr(pe??q)}else if(Z!==q||le!==j){const pe=En(w.location),wt=en(pe);if(wt?.onSelect!==void 0){let Ke=!1;if(wt.onSelect({...w,cell:pe,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,preventDefault:()=>Ke=!0,theme:Ei(pe,w.location)}),Ke)return}if(Vn==="block"&&Pr(j).isGroupHeader)return;const rt=tr&&j===_e,Xe=tr&&K!==void 0&&K.current?.cell[1]===_e;if((w.shiftKey||w.isLongTouch===!0)&&Z!==void 0&&le!==void 0&&K.current!==void 0&&!Xe){if(rt)return;const Ke=Math.min(q,Z),ht=Math.max(q,Z),xt=Math.min(j,le),pt=Math.max(j,le);dt({...K.current,range:{x:Ke,y:xt,width:ht-Ke+1,height:pt-xt+1}},!0,A,"click"),mr.current=void 0,pn()}else dt({cell:[q,j],range:{x:q,y:j,width:1,height:1}},!0,A,"click"),mr.current=void 0,o(void 0),pn()}}else if(w.kind==="header")if(_r.current=[q,j],o(void 0),_n&&q===0)mr.current=void 0,Jr.current=void 0,!Ir&&me==="multi"&&(B.length!==_e?Tt(it.fromSingleSelection([0,_e]),void 0,A):Tt(it.empty(),void 0,A),pn());else{const pe=Jr.current;if(ne==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&pe!==void 0&&V.hasIndex(pe)){const wt=[Math.min(pe,q),Math.max(pe,q)+1];W?et(void 0,wt,A):et(it.fromSingleSelection(wt),void 0,A)}else W?(V.hasIndex(q)?et(V.remove(q),void 0,A):et(void 0,q,A),Jr.current=q):ne!=="none"&&(V.hasIndex(q)?et(V.remove(q),void 0,A):et(it.fromSingleSelection(q),void 0,A),Jr.current=q);mr.current=void 0,pn()}else w.kind===An?_r.current=[q,j]:w.kind===sa&&!w.isMaybeScrollbar&&(ae($o,!1),o(void 0),pn(),Mt?.(),mr.current=void 0,Jr.current=void 0)},[me,ne,K,_n,U,Lt,_e,Sn,En,St,pn,Be,en,Ei,Tt,Zr,gr,Vn,Pr,tr,dt,et,ae,Mt]),Ti=f.useRef(!1),_r=f.useRef(),Sl=f.useRef(Dr),Yn=f.useRef(),Ff=f.useCallback(w=>{if(Qr.current=!1,Sl.current=sn.current,w.button!==0&&w.button!==1){Yn.current=void 0;return}const A=performance.now();Yn.current={button:w.button,time:A,location:w.location},w?.kind==="header"&&(Ti.current=!0);const L=w.kind==="cell"&&w.isFillHandle;!L&&w.kind!=="cell"&&w.isEdge||(u({previousSelection:K,fillHandle:L}),_r.current=void 0,!w.isTouch&&w.button===0&&!L?Ii(w):!w.isTouch&&w.button===1&&(_r.current=w.location))},[K,Ii]),[La,Aa]=f.useState(),xl=f.useCallback(w=>{if(w.kind!==An||ne!=="multi")return;const A=aa.value?w.metaKey:w.ctrlKey,[L]=w.location,W=K.columns;if(L<U)return;const q=tt[L];let j=L,V=L;for(let B=L-1;B>=U&&no(q.group,tt[B].group);B--)j--;for(let B=L+1;B<tt.length&&no(q.group,tt[B].group);B++)V++;if(pn(),A)if(W.hasAll([j,V+1])){let B=W;for(let Z=j;Z<=V;Z++)B=B.remove(Z);et(B,void 0,A)}else et(void 0,[j,V+1],A);else et(it.fromSingleSelection([j,V+1]),void 0,A)},[ne,pn,K.columns,tt,U,et]),Qr=f.useRef(!1),Ro=f.useCallback(async w=>{if(z!==void 0&&ve!==void 0){const A=sn.current.y,L=sn.current.height;let W=z({x:w,y:A,width:1,height:Math.min(L,_e-A)},xn.current.signal);typeof W!="object"&&(W=await W());const q=an[w-U],V=document.createElement("canvas").getContext("2d",{alpha:!1});if(V!==null){V.font=Ze.baseFontFull;const B=Sd(V,Ze,q,0,W,er,jr,!1,en);ve?.(q,B.width,w,B.width)}}},[an,z,jr,Ze,er,ve,U,_e,en]),[Lf,Ha]=f.useState(),ei=f.useCallback(async(w,A)=>{const L=w.current?.range;if(L===void 0||z===void 0||A.current===void 0)return;const W=A.current.range;if(M!==void 0){let B=!1;if(M({fillDestination:{...W,x:W.x-U},patternSource:{...L,x:L.x-U},preventDefault:()=>B=!0}),B)return}let q=z(L,xn.current.signal);typeof q!="object"&&(q=await q());const j=q,V=[];for(let B=0;B<W.width;B++)for(let Z=0;Z<W.height;Z++){const le=[W.x+B,W.y+Z];if(dd(le,L))continue;const pe=j[Z%L.height][B%L.width];di(pe)||!ui(pe)||V.push({location:le,value:{...pe}})}Fn(V),fn.current?.damage(V.map(B=>({cell:B.location})))},[z,Fn,M,U]),kl=f.useCallback(()=>{if(K.current===void 0||K.current.range.width<=1)return;const w={...K,current:{...K.current,range:{...K.current.range,width:1}}};ei(w,K)},[ei,K]),Ml=f.useCallback(()=>{if(K.current===void 0||K.current.range.height<=1)return;const w={...K,current:{...K.current,range:{...K.current.range,height:1}}};ei(w,K)},[ei,K]),Af=f.useCallback((w,A)=>{const L=l;if(u(void 0),Da(void 0),Ha(void 0),Ti.current=!1,A)return;if(L?.fillHandle===!0&&K.current!==void 0&&L.previousSelection?.current!==void 0){if(Or===void 0)return;const pe={...K,current:{...K.current,range:Ed(L.previousSelection.current.range,Or)}};ei(L.previousSelection,pe),ae(pe,!0);return}const[W,q]=w.location,[j,V]=_r.current??[],B=()=>{Qr.current=!0},Z=pe=>{const wt=pe.isTouch||j===W&&V===q;if(wt&&O?.([W-U,q],{...pe,preventDefault:B}),pe.button===1)return!Qr.current;if(!Qr.current){const rt=En(w.location),Xe=en(rt);if(Xe!==void 0&&Xe.onClick!==void 0&&wt){const ht=Xe.onClick({...pe,cell:rt,posX:pe.localEventX,posY:pe.localEventY,bounds:pe.bounds,theme:Ei(rt,w.location),preventDefault:B});ht!==void 0&&!di(ht)&&li(ht)&&(Fn([{location:pe.location,value:ht}]),fn.current?.damage([{cell:pe.location}]))}if(Qr.current||K.current===void 0)return!1;let Ke=!1;switch(rt.activationBehaviorOverride??we){case"double-click":case"second-click":{if(L?.previousSelection?.current?.cell===void 0)break;const[ht,xt]=K.current.cell,[pt,ni]=L.previousSelection.current.cell;Ke=W===ht&&W===pt&&q===xt&&q===ni&&(pe.isDoubleClick===!0||we==="second-click");break}case"single-click":{Ke=!0;break}}if(Ke)return R?.([W-U,q]),Kr(pe.bounds,!1),!0}return!1},le=w.location[0]-U;if(w.isTouch){const pe=sn.current,wt=Sl.current;if(pe.x!==wt.x||pe.y!==wt.y)return;if(w.isLongTouch===!0){if(w.kind==="cell"&&Zi(K.current?.cell,w.location)){G?.([le,w.location[1]],{...w,preventDefault:B});return}else if(w.kind==="header"&&K.columns.hasIndex(W)){ie?.(le,{...w,preventDefault:B});return}else if(w.kind===An){if(le<0)return;Q?.(le,{...w,preventDefault:B});return}}w.kind==="cell"?Z(w)||Ii(w):w.kind===An?$?.(le,{...w,preventDefault:B}):(w.kind===yr&&C?.(le,{...w,preventDefault:B}),Ii(w));return}if(w.kind==="header"){if(le<0)return;w.isEdge?w.isDoubleClick===!0&&Ro(W):w.button===0&&W===j&&q===V&&C?.(le,{...w,preventDefault:B})}if(w.kind===An){if(le<0)return;w.button===0&&W===j&&q===V&&($?.(le,{...w,preventDefault:B}),Qr.current||xl(w))}w.kind==="cell"&&(w.button===0||w.button===1)&&Z(w),_r.current=void 0},[l,K,U,Or,ei,ae,O,En,en,we,Ei,Fn,R,Kr,G,ie,Q,Ii,$,C,Ro,xl]),Hf=f.useCallback(w=>{const A={...w,location:[w.location[0]-U,w.location[1]]};st?.(A),l!==void 0&&w.buttons===0&&(u(void 0),Da(void 0),Ha(void 0),Ti.current=!1),Ha(L=>Ti.current?[w.scrollEdge[0],0]:w.scrollEdge[0]===L?.[0]&&w.scrollEdge[1]===L[1]?L:l===void 0||(Yn.current?.location[0]??0)<U?void 0:w.scrollEdge)},[l,st,U]),zf=f.useCallback((w,A)=>{mt?.(w-U,A)},[mt,U]),Vf=f.useCallback((w,A)=>{ft?.(w-U,A)},[ft,U]),ti=K?.current?.cell,Nf=f.useCallback((w,A,L,W,q,j)=>{Gn.current=!1;let V=ti;V!==void 0&&(V=[V[0]-U,V[1]]);const B=He===0?void 0:{x:0,y:w.y,width:He,height:w.height},Z=[];B!==void 0&&Z.push(B),De>0&&(Z.push({x:w.x-U,y:_e-De,width:w.width,height:De}),He>0&&Z.push({x:0,y:_e-De,width:He,height:De}));const le={x:w.x-U,y:w.y,width:w.width,height:Lt&&w.y+w.height>=_e?w.height-1:w.height,tx:q,ty:j,extras:{selected:V,freezeRegion:B,freezeRegions:Z}};sn.current=le,vl(le),Wt([A,L,W]),qt?.(le,le.tx,le.ty,le.extras)},[ti,U,Lt,_e,He,De,vl,qt]),$f=wr(I,f.useCallback((w,A)=>I?.(w-U,A-U)!==!1,[I,U])),Bf=wr(Ie,f.useCallback((w,A)=>{Ie?.(w-U,A-U),ne!=="none"&&et(it.fromSingleSelection(A),void 0,!0)},[ne,Ie,U,et])),za=f.useRef(!1),Wf=f.useCallback(w=>{if(w.location[0]===0&&U>0){w.preventDefault();return}Te?.({...w,location:[w.location[0]-U,w.location[1]]}),w.defaultPrevented()||(za.current=!0),u(void 0)},[Te,U]),Uf=f.useCallback(()=>{za.current=!1},[]),Rl=yt?.selectionBehavior,Eo=f.useCallback(w=>{if(Rl!=="block-spanning")return;const{isGroupHeader:A,path:L,groupRows:W}=Pr(w);if(A)return[w,w];const q=L[L.length-1],j=w-q,V=w+W-q-1;return[j,V]},[Pr,Rl]),Va=f.useRef(),Na=f.useCallback(w=>{if(!_d(w,Va.current)&&(Va.current=w,!(Yn?.current?.button!==void 0&&Yn.current.button>=1))){if(w.buttons!==0&&l!==void 0&&Yn.current?.location[0]===0&&w.location[0]===0&&U===1&&me==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(Yn.current.location[1])&&K.rows.hasIndex(Yn.current.location[1])){const A=Math.min(Yn.current.location[1],w.location[1]),L=Math.max(Yn.current.location[1],w.location[1])+1;Tt(it.fromSingleSelection([A,L]),void 0,!1)}if(w.buttons!==0&&l!==void 0&&K.current!==void 0&&!za.current&&!Ti.current&&($e==="rect"||$e==="multi-rect")){const[A,L]=K.current.cell;let[W,q]=w.location;if(q<0&&(q=sn.current.y),l.fillHandle===!0&&l.previousSelection?.current!==void 0){const j=l.previousSelection.current.range;q=Math.min(q,Lt?_e-1:_e);const V=Vp(j,W,q,It);Da(V)}else{if(Lt&&L===_e)return;if(Lt&&q===_e)if(w.kind===sa)q--;else return;W=Math.max(W,U);const B=Eo(L);q=B===void 0?q:Ln(q,B[0],B[1]);const Z=W-A,le=q-L,pe={x:Z>=0?A:W,y:le>=0?L:q,width:Math.abs(Z)+1,height:Math.abs(le)+1};dt({...K.current,range:pe},!0,!1,"drag")}}Ht?.({...w,location:[w.location[0]-U,w.location[1]]})}},[l,U,me,K,$e,Ht,Tt,Lt,_e,It,Eo,dt]),qf=f.useCallback(()=>{const w=Va.current;if(w===void 0)return;const[A,L]=w.scrollEdge;let[W,q]=w.location;const j=sn.current;A===-1?W=j.extras?.freezeRegion?.x??j.x:A===1&&(W=j.x+j.width),L===-1?q=Math.max(0,j.y):L===1&&(q=Math.min(_e-1,j.y+j.height)),W=Ln(W,0,tt.length-1),q=Ln(q,0,_e-1),Na({...w,location:[W,q]})},[tt.length,Na,_e]);j0(Lf,Ut,qf);const Nn=f.useCallback(w=>{if(K.current===void 0)return;const[A,L]=w,[W,q]=K.current.cell,j=K.current.range;let V=j.x,B=j.x+j.width,Z=j.y,le=j.y+j.height;const[pe,wt]=Eo(q)??[0,_e-1],rt=wt+1;if(L!==0)switch(L){case 2:{le=rt,Z=q,Gt(0,le,"vertical");break}case-2:{Z=pe,le=q+1,Gt(0,Z,"vertical");break}case 1:{Z<q?(Z++,Gt(0,Z,"vertical")):(le=Math.min(rt,le+1),Gt(0,le,"vertical"));break}case-1:{le>q+1?(le--,Gt(0,le,"vertical")):(Z=Math.max(pe,Z-1),Gt(0,Z,"vertical"));break}default:to()}if(A!==0)if(A===2)B=tt.length,V=W,Gt(B-1-U,0,"horizontal");else if(A===-2)V=U,B=W+1,Gt(V-U,0,"horizontal");else{let Xe=[];if(z!==void 0){const Ke=z({x:V,y:Z,width:B-V-U,height:le-Z},xn.current.signal);typeof Ke=="object"&&(Xe=iv(Ke))}if(A===1){let Ke=!1;if(V<W){if(Xe.length>0){const ht=Sr(V+1,W+1).find(xt=>!Xe.includes(xt-U));ht!==void 0&&(V=ht,Ke=!0)}else V++,Ke=!0;Ke&&Gt(V,0,"horizontal")}Ke||(B=Math.min(tt.length,B+1),Gt(B-1-U,0,"horizontal"))}else if(A===-1){let Ke=!1;if(B>W+1){if(Xe.length>0){const ht=Sr(B-1,W,-1).find(xt=>!Xe.includes(xt-U));ht!==void 0&&(B=ht,Ke=!0)}else B--,Ke=!0;Ke&&Gt(B-U,0,"horizontal")}Ke||(V=Math.max(U,V-1),Gt(V-U,0,"horizontal"))}else to()}dt({cell:K.current.cell,range:{x:V,y:Z,width:B-V,height:le-Z}},!0,!1,"keyboard-select")},[z,Eo,K,tt.length,U,_e,Gt,dt]),$a=f.useRef(wi);$a.current=wi;const pr=f.useCallback((w,A,L,W)=>{const q=hn-(L?0:1);w=Ln(w,U,an.length-1+U),A=Ln(A,0,q);const j=ti?.[0],V=ti?.[1];if(w===j&&A===V)return!1;if(W&&K.current!==void 0){const B=[...K.current.rangeStack];(K.current.range.width>1||K.current.range.height>1)&&B.push(K.current.range),ae({...K,current:{cell:[w,A],range:{x:w,y:A,width:1,height:1},rangeStack:B}},!0)}else dt({cell:[w,A],range:{x:w,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===w&&c.current[1]===A&&(c.current=void 0),$a.current&&Gt(w-U,A),!0},[hn,U,an.length,ti,K,Gt,ae,dt]),Gf=f.useCallback((w,A)=>{i?.cell!==void 0&&w!==void 0&&li(w)&&(Fn([{location:i.cell,value:w}]),window.requestAnimationFrame(()=>{fn.current?.damage([{cell:i.cell}])})),pn(!0),o(void 0);const[L,W]=A;if(K.current!==void 0&&(L!==0||W!==0)){const q=K.current.cell[1]===hn-1&&w!==void 0,j=K.current.cell[0]===tt.length-1&&w!==void 0;let V=!0;if(q&&W===1&&Se!==void 0){V=!1;const B=K.current.cell[0]+L,Z=Zr(B);gr(Z??B,!1)}if(j&&L===1&&Je!==void 0){V=!1;const B=K.current.cell[1]+W;Mo(B,!1)}V&&pr(Ln(K.current.cell[0]+L,0,tt.length-1),Ln(K.current.cell[1]+W,0,hn-1),q,!1)}_?.(w,A)},[i?.cell,pn,K,_,Fn,hn,pr,tt.length,gr,Mo,Se,Je,Zr]),Yf=f.useMemo(()=>`gdg-overlay-${rv++}`,[]),Fr=f.useCallback(w=>{pn();const A=[];for(let L=w.x;L<w.x+w.width;L++)for(let W=w.y;W<w.y+w.height;W++){const q=S([L-U,W]);if(!q.allowOverlay&&q.kind!==J.Boolean)continue;let j;if(q.kind===J.Custom){const V=en(q),B=V?.provideEditor?.({...q,location:[L-U,W]});V?.onDelete!==void 0?j=V.onDelete(q):Og(B)&&(j=B?.deletedValue?.(q))}else(li(q)&&q.allowOverlay||q.kind===J.Boolean)&&(j=en(q)?.onDelete?.(q));j!==void 0&&!di(j)&&li(j)&&A.push({location:[L,W],value:j})}Fn(A),fn.current?.damage(A.map(L=>({cell:L.location})))},[pn,S,en,Fn,U]),Di=i!==void 0,El=f.useCallback(w=>{const A=()=>{w.stopPropagation(),w.preventDefault()},L={didMatch:!1},{bounds:W}=w,q=K.columns,j=K.rows,V=qn;if(!Di&&ot(V.clear,w,L))ae($o,!1),Mt?.();else if(!Di&&ot(V.selectAll,w,L))ae({columns:it.empty(),rows:it.empty(),current:{cell:K.current?.cell??[U,0],range:{x:U,y:0,width:b.length,height:_e},rangeStack:[]}},!1);else if(ot(V.search,w,L))s?.current?.focus({preventScroll:!0}),wo(!0);else if(ot(V.delete,w,L)){const ht=Zt?.(K)??!0;if(ht!==!1){const xt=ht===!0?K:ht;if(xt.current!==void 0){Fr(xt.current.range);for(const pt of xt.current.rangeStack)Fr(pt)}for(const pt of xt.rows)Fr({x:U,y:pt,width:b.length,height:1});for(const pt of xt.columns)Fr({x:pt,y:0,width:1,height:_e})}}if(L.didMatch)return A(),!0;if(K.current===void 0)return!1;let[B,Z]=K.current.cell;const[,le]=K.current.cell;let pe=!1,wt=!1;if(ot(V.scrollToSelectedCell,w,L)?Do.current(B-U,Z):ne!=="none"&&ot(V.selectColumn,w,L)?q.hasIndex(B)?et(q.remove(B),void 0,!0):ne==="single"?et(it.fromSingleSelection(B),void 0,!0):et(void 0,B,!0):me!=="none"&&ot(V.selectRow,w,L)?j.hasIndex(Z)?Tt(j.remove(Z),void 0,!0):me==="single"?Tt(it.fromSingleSelection(Z),void 0,!0):Tt(void 0,Z,!0):!Di&&W!==void 0&&ot(V.activateCell,w,L)?Z===_e&&Lt?window.setTimeout(()=>{const ht=Zr(B);gr(ht??B)},0):(R?.([B-U,Z]),Kr(W,!0)):K.current.range.height>1&&ot(V.downFill,w,L)?Ml():K.current.range.width>1&&ot(V.rightFill,w,L)?kl():ot(V.goToNextPage,w,L)?Z+=Math.max(1,sn.current.height-4):ot(V.goToPreviousPage,w,L)?Z-=Math.max(1,sn.current.height-4):ot(V.goToFirstCell,w,L)?(o(void 0),Z=0,B=0):ot(V.goToLastCell,w,L)?(o(void 0),Z=Number.MAX_SAFE_INTEGER,B=Number.MAX_SAFE_INTEGER):ot(V.selectToFirstCell,w,L)?(o(void 0),Nn([-2,-2])):ot(V.selectToLastCell,w,L)?(o(void 0),Nn([2,2])):Di?(ot(V.closeOverlay,w,L)&&o(void 0),ot(V.acceptOverlayDown,w,L)&&(o(void 0),Z++),ot(V.acceptOverlayUp,w,L)&&(o(void 0),Z--),ot(V.acceptOverlayLeft,w,L)&&(o(void 0),B--),ot(V.acceptOverlayRight,w,L)&&(o(void 0),B++)):(ot(V.goDownCell,w,L)?Z+=1:ot(V.goUpCell,w,L)?Z-=1:ot(V.goRightCell,w,L)?B+=1:ot(V.goLeftCell,w,L)?B-=1:ot(V.goDownCellRetainSelection,w,L)?(Z+=1,pe=!0):ot(V.goUpCellRetainSelection,w,L)?(Z-=1,pe=!0):ot(V.goRightCellRetainSelection,w,L)?(B+=1,pe=!0):ot(V.goLeftCellRetainSelection,w,L)?(B-=1,pe=!0):ot(V.goToLastRow,w,L)?Z=_e-1:ot(V.goToFirstRow,w,L)?Z=Number.MIN_SAFE_INTEGER:ot(V.goToLastColumn,w,L)?B=Number.MAX_SAFE_INTEGER:ot(V.goToFirstColumn,w,L)?B=Number.MIN_SAFE_INTEGER:($e==="rect"||$e==="multi-rect")&&(ot(V.selectGrowDown,w,L)?Nn([0,1]):ot(V.selectGrowUp,w,L)?Nn([0,-1]):ot(V.selectGrowRight,w,L)?Nn([1,0]):ot(V.selectGrowLeft,w,L)?Nn([-1,0]):ot(V.selectToLastRow,w,L)?Nn([0,2]):ot(V.selectToFirstRow,w,L)?Nn([0,-2]):ot(V.selectToLastColumn,w,L)?Nn([2,0]):ot(V.selectToFirstColumn,w,L)&&Nn([-2,0])),wt=L.didMatch),Vn!==void 0&&Vn!=="normal"&&Z!==le){const ht=Vn==="skip-up"||Vn==="skip"||Vn==="block",xt=Vn==="skip-down"||Vn==="skip"||Vn==="block",pt=Z<le;if(pt&&ht){for(;Z>=0&&Pr(Z).isGroupHeader;)Z--;Z<0&&(Z=le)}else if(!pt&&xt){for(;Z<_e&&Pr(Z).isGroupHeader;)Z++;Z>=_e&&(Z=le)}}const Xe=pr(B,Z,!1,pe),Ke=L.didMatch;return Ke&&(Xe||!wt||$t)&&A(),Ke},[Vn,Di,K,qn,ne,me,$e,U,Pr,_e,pr,ae,Mt,b.length,Zt,$t,Fr,et,Tt,Lt,Zr,gr,R,Kr,Ml,kl,Nn]),Oi=f.useCallback(w=>{let A=!1;if(Y!==void 0&&Y({...w,...w.location&&{location:[w.location[0]-U,w.location[1]]},cancel:()=>{A=!0}}),A||El(w)||K.current===void 0)return;const[L,W]=K.current.cell,q=sn.current;if(ke&&!w.metaKey&&!w.ctrlKey&&K.current!==void 0&&w.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(w.key)&&w.bounds!==void 0&&ui(S([L-U,Math.max(0,Math.min(W,_e-1))]))){if((!Lt||W!==_e)&&(q.y>W||W>q.y+q.height||q.x>L||L>q.x+q.width))return;R?.([L-U,W]),Kr(w.bounds,!0,w.key),w.stopPropagation(),w.preventDefault()}},[ke,Y,El,K,S,U,_e,Lt,R,Kr]),jf=f.useCallback((w,A)=>{const L=w.location[0]-U;if(w.kind==="header"&&ie?.(L,{...w,preventDefault:A}),w.kind===An){if(L<0)return;Q?.(L,{...w,preventDefault:A})}if(w.kind==="cell"){const[W,q]=w.location;G?.([L,q],{...w,preventDefault:A}),Fm(K,w.location)||pr(W,q,!1,!1)}},[K,G,Q,ie,U,pr]),Ba=f.useCallback(async w=>{if(!qn.paste)return;function A(V,B,Z,le){const pe=typeof Z=="object"?Z?.join(`
|
173
|
-
`)??"":Z?.toString()??"";if(!
|
174
|
-
`),rawValue:Z});return Xe===void 0?void 0:(Dn(Xe.kind===V.kind),{location:B,value:Xe})}}}const L=K.columns,W=K.rows,q=Ut.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0;let j;if(K.current!==void 0?j=[K.current.range.x,K.current.range.y]:L.length===1?j=[L.first()??0,0]:W.length===1&&(j=[U,W.first()??0]),q&&j!==void 0){let V,B;const Z="text/plain",le="text/html";if(navigator.clipboard.read!==void 0){const Xe=await navigator.clipboard.read();for(const Ke of Xe){if(Ke.types.includes(le)){const xt=await(await Ke.getType(le)).text(),pt=Ou(xt);if(pt!==void 0){V=pt;break}}Ke.types.includes(Z)&&(B=await(await Ke.getType(Z)).text())}}else if(navigator.clipboard.readText!==void 0)B=await navigator.clipboard.readText();else if(w!==void 0&&w?.clipboardData!==null){if(w.clipboardData.types.includes(le)){const Xe=w.clipboardData.getData(le);V=Ou(Xe)}V===void 0&&w.clipboardData.types.includes(Z)&&(B=w.clipboardData.getData(Z))}else return;const[pe,wt]=j,rt=[];do{if(Re===void 0){const Xe=En(j),Ke=B??V?.map(xt=>xt.map(pt=>pt.rawValue).join(" ")).join(" ")??"",ht=A(Xe,j,Ke,void 0);ht!==void 0&&rt.push(ht);break}if(V===void 0){if(B===void 0)return;V=$0(B)}if(Re===!1||typeof Re=="function"&&Re?.([j[0]-U,j[1]],V.map(Xe=>Xe.map(Ke=>Ke.rawValue?.toString()??"")))!==!0)return;for(const[Xe,Ke]of V.entries()){if(Xe+wt>=_e)break;for(const[ht,xt]of Ke.entries()){const pt=[ht+pe,Xe+wt],[ni,_i]=pt;if(ni>=tt.length||_i>=hn)continue;const Fi=En(pt),jn=A(Fi,pt,xt.rawValue,xt.formatted);jn!==void 0&&rt.push(jn)}}}while(!1);Fn(rt),fn.current?.damage(rt.map(Xe=>({cell:Xe.location})))}},[E,en,En,K,qn.paste,Ut,tt.length,Fn,hn,Re,U,_e]);vn("paste",Ba,d,!1,!0);const Pi=f.useCallback(async(w,A)=>{if(!qn.copy)return;const L=A===!0||Ut.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0,W=K.columns,q=K.rows,j=(V,B)=>{if(!qe)_u(V,B,w);else{const Z=B.map(le=>({kind:J.Text,data:b[le].title,displayData:b[le].title,allowOverlay:!1}));_u([Z,...V],B,w)}};if(L&&z!==void 0){if(K.current!==void 0){let V=z(K.current.range,xn.current.signal);typeof V!="object"&&(V=await V()),j(V,Sr(K.current.range.x-U,K.current.range.x+K.current.range.width-U))}else if(q!==void 0&&q.length>0){const B=[...q].map(Z=>{const le=z({x:U,y:Z,width:b.length,height:1},xn.current.signal);return typeof le=="object"?le[0]:le().then(pe=>pe[0])});if(B.some(Z=>Z instanceof Promise)){const Z=await Promise.all(B);j(Z,Sr(b.length))}else j(B,Sr(b.length))}else if(W.length>0){const V=[],B=[];for(const Z of W){let le=z({x:Z,y:0,width:1,height:_e},xn.current.signal);typeof le!="object"&&(le=await le()),V.push(le),B.push(Z-U)}if(V.length===1)j(V[0],B);else{const Z=V.reduce((le,pe)=>le.map((wt,rt)=>[...wt,...pe[rt]]));j(Z,B)}}}},[b,z,K,qn.copy,U,Ut,_e,qe]);vn("copy",Pi,d,!1,!1);const Xf=f.useCallback(async w=>{if(!(!qn.cut||!(Ut.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0))&&(await Pi(w),K.current!==void 0)){let L={current:{cell:K.current.cell,range:K.current.range,rangeStack:[]},rows:it.empty(),columns:it.empty()};const W=Zt?.(L);if(W===!1||(L=W===!0?L:W,L.current===void 0))return;Fr(L.current.range)}},[Fr,K,qn.cut,Pi,Ut,Zt]);vn("cut",Xf,d,!1,!1);const Kf=f.useCallback((w,A)=>{if(fe!==void 0){U!==0&&(w=w.map(q=>[q[0]-U,q[1]])),fe(w,A);return}if(w.length===0||A===-1)return;const[L,W]=w[A];c.current!==void 0&&c.current[0]===L&&c.current[1]===W||(c.current=[L,W],pr(L,W,!1,!1))},[fe,U,pr]),[Io,To]=cn?.current?.cell??[],Do=f.useRef(Gt);Do.current=Gt,f.useLayoutEffect(()=>{$a.current&&!Gn.current&&Io!==void 0&&To!==void 0&&(Io!==Ee.current?.current?.cell[0]||To!==Ee.current?.current?.cell[1])&&Do.current(Io,To),Gn.current=!1},[Io,To]);const Il=K.current!==void 0&&(K.current.cell[0]>=tt.length||K.current.cell[1]>=hn);f.useLayoutEffect(()=>{Il&&ae($o,!1)},[Il,ae]);const Zf=f.useMemo(()=>Lt===!0&&Bt?.tint===!0?it.fromSingleSelection(hn-1):it.empty(),[hn,Lt,Bt?.tint]),Jf=f.useCallback(w=>typeof jt=="boolean"?jt:jt?.(w-U)??!0,[U,jt]),Qf=f.useMemo(()=>{if(La===void 0||a.current===null)return null;const{bounds:w,group:A}=La,L=a.current.getBoundingClientRect();return f.createElement(D0,{bounds:w,group:A,canvasBounds:L,onClose:()=>Aa(void 0),onFinish:W=>{Aa(void 0),te?.(A,W)}})},[te,La]),eh=Math.min(tt.length,He+(_n?1:0));f.useImperativeHandle(t,()=>({appendRow:(w,A)=>gr(w+U,A),appendColumn:(w,A)=>Mo(w,A),updateCells:w=>(U!==0&&(w=w.map(A=>({cell:[A.cell[0]+U,A.cell[1]]}))),fn.current?.damage(w)),getBounds:(w,A)=>{if(!(a?.current===null||Ut?.current===null)){if(w===void 0&&A===void 0){const L=a.current.getBoundingClientRect(),W=L.width/Ut.current.clientWidth;return{x:L.x-Ut.current.scrollLeft*W,y:L.y-Ut.current.scrollTop*W,width:Ut.current.scrollWidth*W,height:Ut.current.scrollHeight*W}}return fn.current?.getBounds((w??0)+U,A)}},focus:()=>fn.current?.focus(),emit:async w=>{switch(w){case"delete":Oi({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!1,key:"Delete",keyCode:46,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-right":Oi({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"r",keyCode:82,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-down":Oi({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"d",keyCode:68,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"copy":await Pi(void 0,!0);break;case"paste":await Ba();break}},scrollTo:Gt,remeasureColumns:w=>{for(const A of w)Ro(A+U)},getMouseArgsForPosition:(w,A,L)=>{if(fn?.current===null)return;const W=fn.current.getMouseArgsForPosition(w,A,L);if(W!==void 0)return{...W,location:[W.location[0]-U,W.location[1]]}}}),[gr,Mo,Ro,Ut,Pi,Oi,Ba,U,Gt]);const[Tl,Dl]=ti??[],th=f.useCallback(w=>{const[A,L]=w;if(L===-1){ne!=="none"&&(et(it.fromSingleSelection(A),void 0,!1),pn());return}Tl===A&&Dl===L||(dt({cell:w,range:{x:A,y:L,width:1,height:1}},!0,!1,"keyboard-nav"),Gt(A,L))},[ne,pn,Gt,Tl,Dl,dt,et]),[nh,rh]=f.useState(!1),Ol=f.useRef(Jc(w=>{rh(w)},5)),ih=f.useCallback(()=>{Ol.current(!0),K.current===void 0&&K.columns.length===0&&K.rows.length===0&&l===void 0&&dt({cell:[U,yo],range:{x:U,y:yo,width:1,height:1}},!0,!1,"keyboard-select")},[yo,K,l,U,dt]),oh=f.useCallback(()=>{Ol.current(!1)},[]),[ah,sh]=f.useMemo(()=>{let w;const A=vt?.scrollbarWidthOverride??Ss(),L=_e+(Lt?1:0);if(typeof Un=="number")w=kn+L*Un;else{let q=0;const j=Math.min(L,10);for(let V=0;V<j;V++)q+=Un(V);q=Math.floor(q/j),w=kn+L*q}w+=A;const W=tt.reduce((q,j)=>j.width+q,0)+A;return[`${Math.min(1e5,W)}px`,`${Math.min(1e5,w)}px`]},[tt,vt?.scrollbarWidthOverride,Un,_e,Lt,kn]),lh=f.useMemo(()=>jm(Ze),[Ze]);return f.createElement(Cd.Provider,{value:Ze},f.createElement(q0,{style:lh,className:X,inWidth:p??ah,inHeight:y??sh},f.createElement(R0,{fillHandle:yn,drawFocusRing:yi,experimental:vt,fixedShadowX:Ft,fixedShadowY:Cn,getRowThemeOverride:cr,headerIcons:Wn,imageWindowLoader:zn,initialSize:N,isDraggable:Ne,onDragLeave:Ue,onRowMoved:St,overscrollX:ki,overscrollY:Ia,preventDiagonalScrolling:bt,rightElement:Qt,rightElementProps:Et,smoothScrollX:on,smoothScrollY:xa,className:X,enableGroups:_t,onCanvasFocused:ih,onCanvasBlur:oh,canvasRef:a,onContextMenu:jf,theme:Ze,cellXOffset:Pf,cellYOffset:yo,accessibilityHeight:Dr.height,onDragEnd:Uf,columns:tt,nonGrowWidth:fr,drawHeader:je,onColumnProposeMove:$f,drawCell:ct,disabledRows:Zf,freezeColumns:eh,lockColumns:U,firstColAccessible:U===0,getCellContent:En,minColumnWidth:er,maxColumnWidth:jr,searchInputRef:s,showSearch:Xr,onSearchClose:Ta,highlightRegions:_f,getCellsForSelection:z,getGroupDetails:Oa,headerHeight:xi,isFocused:nh,groupHeaderHeight:_t?vo:0,freezeTrailingRows:De+(Lt&&Bt?.sticky===!0?1:0),hasAppendRow:Lt,onColumnResize:ve,onColumnResizeEnd:Ye,onColumnResizeStart:ye,onCellFocused:th,onColumnMoved:Bf,onDragStart:Wf,onHeaderMenuClick:zf,onHeaderIndicatorClick:Vf,onItemHovered:Na,isFilling:l?.fillHandle===!0,onMouseMove:Hf,onKeyDown:Oi,onKeyUp:ce,onMouseDown:Ff,onMouseUp:Af,onDragOverCell:dn,onDrop:Mn,onSearchResultsChanged:Kf,onVisibleRegionChanged:Nf,clientSize:zt,rowHeight:Un,searchResults:re,searchValue:P,onSearchValueChange:H,rows:hn,scrollRef:Ut,selection:K,translateX:Dr.tx,translateY:Dr.ty,verticalBorder:Jf,gridRef:fn,getCellRenderer:en,resizeIndicator:go}),Qf,i!==void 0&&f.createElement(f.Suspense,{fallback:null},f.createElement(nv,{...i,validateCell:Me,bloom:D,id:Yf,getCellRenderer:en,className:vt?.isSubGrid===!0?"click-outside-ignore":void 0,provideEditor:rn,imageEditorOverride:g,portalElementRef:pl,onFinishEditing:Gf,markdownDivCreateNode:m,isOutsideClick:Ma,customEventTarget:vt?.eventTarget}))))},av=f.forwardRef(ov);function Au(e){const{cell:t,posX:n,posY:r,bounds:i,theme:o}=e,{width:s,height:a,x:l,y:u}=i,c=t.maxSize??o.checkboxMaxSize,d=Math.floor(i.y+a/2),g=td(c,a,o.cellVerticalPadding),h=ed(t.contentAlign??"center",l,s,o.cellHorizontalPadding,g),m=Qc(h,d,g),p=nd(l+n,u+r,m);return Ns(t)&&p}const sv={getAccessibilityString:e=>e.data?.toString()??"false",kind:J.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>lv(e,e.cell.data,Ns(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{Au(e)&&e.preventDefault()},onClick:e=>{if(Au(e))return{...e.cell,data:Ld(e.cell.data)}},onPaste:(e,t)=>{let n=ta;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=Vs),n===t.data?void 0:{...t,data:n}}};function lv(e,t,n,r,i){if(!n&&t===ta)return;const{ctx:o,hoverAmount:s,theme:a,rect:l,highlighted:u,hoverX:c,hoverY:d,cell:{contentAlign:g}}=e,{x:h,y:m,width:p,height:y}=l;let b=!1;if(i>0){let v=n?1-i+i*s:.4;if(t===ta&&(v*=s),v===0)return;v<1&&(b=!0,o.globalAlpha=v)}Zs(o,a,t,h,m,p,y,u,c,d,r,g),b&&(o.globalAlpha=1)}const uv=un("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),cv=e=>{const{bubbles:t}=e;return f.createElement(uv,null,t.map((n,r)=>f.createElement("div",{key:r,className:"boe-bubble"},n)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},dv={getAccessibilityString:e=>rd(e.data),kind:J.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>{const r=t.data.reduce((i,o)=>e.measureText(o).width+i+n.bubblePadding*2+n.bubbleMargin,0);return t.data.length===0?n.cellHorizontalPadding*2:r+2*n.cellHorizontalPadding-n.bubbleMargin},draw:e=>fv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(cv,{bubbles:t.data})},onPaste:()=>{}};function fv(e,t){const{rect:n,theme:r,ctx:i,highlighted:o}=e,{x:s,y:a,width:l,height:u}=n;let c=s+r.cellHorizontalPadding;const d=[];for(const g of t){if(c>s+l)break;const h=qr(g,i,r.baseFontFull).width;d.push({x:c,width:h}),c+=h+r.bubblePadding*2+r.bubbleMargin}i.beginPath();for(const g of d)Kn(i,g.x,a+(u-r.bubbleHeight)/2,g.width+r.bubblePadding*2,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2);i.fillStyle=o?r.bgBubbleSelected:r.bgBubble,i.fill();for(const[g,h]of d.entries())i.beginPath(),i.fillStyle=r.textBubble,i.fillText(t[g],h.x+r.bubblePadding,a+u/2+Zn(i,r))}const hv=un("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),gv=e=>{const{drilldowns:t}=e;return f.createElement(hv,null,t.map((n,r)=>f.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&f.createElement("img",{src:n.img}),f.createElement("div",null,n.text))))},mv={getAccessibilityString:e=>rd(e.data.map(t=>t.text)),kind:J.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,i)=>e.measureText(i.text).width+r+n.bubblePadding*2+n.bubbleMargin+(i.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>vv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(gv,{drilldowns:t.data})},onPaste:()=>{}},ls={};function pv(e,t,n,r){const i=Math.ceil(window.devicePixelRatio),o=5,s=n-o*2,a=4,l=n*i,u=r+o,c=r*3,d=(c+o*2)*i,g=`${e},${t},${i},${n}`;if(ls[g]!==void 0)return{el:ls[g],height:l,width:d,middleWidth:a*i,sideWidth:u*i,padding:o*i,dpr:i};const h=document.createElement("canvas"),m=h.getContext("2d");return m===null?null:(h.width=d,h.height=l,m.scale(i,i),ls[g]=h,m.beginPath(),Kn(m,o,o,c,s,r),m.shadowColor="rgba(24, 25, 34, 0.4)",m.shadowBlur=1,m.fillStyle=e,m.fill(),m.shadowColor="rgba(24, 25, 34, 0.3)",m.shadowOffsetY=1,m.shadowBlur=5,m.fillStyle=e,m.fill(),m.shadowOffsetY=0,m.shadowBlur=0,m.shadowBlur=0,m.beginPath(),Kn(m,o+.5,o+.5,c,s,r),m.strokeStyle=t,m.lineWidth=1,m.stroke(),{el:h,height:l,width:d,sideWidth:u*i,middleWidth:r*i,padding:o*i,dpr:i})}function vv(e,t){const{rect:n,theme:r,ctx:i,imageLoader:o,col:s,row:a}=e,{x:l,width:u}=n,c=r.baseFontFull,d=Ys(i,c),g=Math.min(n.height,Math.max(16,Math.ceil(d*r.lineHeight)*2)),h=Math.floor(n.y+(n.height-g)/2),m=g-10,p=r.bubblePadding,y=r.bubbleMargin;let b=l+r.cellHorizontalPadding;const v=r.roundingRadius??6,S=pv(r.bgCell,r.drilldownBorder,g,v),O=[];for(const R of t){if(b>l+u)break;const _=qr(R.text,i,c).width;let E=0;R.img!==void 0&&o.loadOrGetImage(R.img,s,a)!==void 0&&(E=m-8+4);const k=_+E+p*2;O.push({x:b,width:k}),b+=k+y}if(S!==null){const{el:R,height:M,middleWidth:_,sideWidth:E,width:k,dpr:F,padding:D}=S,C=E/F,I=D/F;for(const T of O){const x=Math.floor(T.x),$=Math.floor(T.width),G=$-(C-I)*2;i.imageSmoothingEnabled=!1,i.drawImage(R,0,0,E,M,x-I,h,C,g),G>0&&i.drawImage(R,E,0,_,M,x+(C-I),h,G,g),i.drawImage(R,k-E,0,E,M,x+$-(C-I),h,C,g),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[R,M]of O.entries()){const _=t[R];let E=M.x+p;if(_.img!==void 0){const k=o.loadOrGetImage(_.img,s,a);if(k!==void 0){const F=m-8;let D=0,C=0,I=k.width,T=k.height;I>T?(D+=(I-T)/2,I=T):T>I&&(C+=(T-I)/2,T=I),i.beginPath(),Kn(i,E,h+g/2-F/2,F,F,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(k,D,C,I,T,E,h+g/2-F/2,F,F),i.restore(),E+=F+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(_.text,E,h+g/2+Zn(i,r))}}const bv={getAccessibilityString:e=>e.data.join(", "),kind:J.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>wv(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:r}=e,i=r??im;return f.createElement(i,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:o=>{n({...t,data:[o]})}})},onPaste:(e,t)=>{e=e.trim();const r=e.split(",").map(i=>{try{return new URL(i),i}catch{return}}).filter(i=>i!==void 0);if(!(r.length===t.data.length&&r.every((i,o)=>i===t.data[o])))return{...t,data:r}}},us=4;function wv(e,t,n,r){const{rect:i,col:o,row:s,theme:a,ctx:l,imageLoader:u}=e,{x:c,y:d,height:g,width:h}=i,m=g-a.cellVerticalPadding*2,p=[];let y=0;for(let v=0;v<t.length;v++){const S=t[v];if(S.length===0)continue;const O=u.loadOrGetImage(S,o,s);if(O!==void 0){p[v]=O;const R=O.width*(m/O.height);y+=R+us}}if(y===0)return;y-=us;let b=c+a.cellHorizontalPadding;r==="right"?b=Math.floor(c+h-a.cellHorizontalPadding-y):r==="center"&&(b=Math.floor(c+h/2-y/2));for(const v of p){if(v===void 0)continue;const S=v.width*(m/v.height);n>0&&(l.beginPath(),Kn(l,b,d+a.cellVerticalPadding,S,m,n),l.save(),l.clip()),l.drawImage(v,b,d+a.cellVerticalPadding,S,m),n>0&&l.restore(),b+=S+us}}function yv(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const Cv={getAccessibilityString:()=>"",kind:J.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:i,rect:o,theme:s}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let a=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(a+=Math.round(yv(n,r)*t.skeletonWidthVariability));const l=s.cellHorizontalPadding;a+l*2>=o.width&&(a=o.width-l*2-1);const u=t.skeletonHeight??Math.min(18,o.height-2*s.cellVerticalPadding);Kn(i,o.x+l,o.y+(o.height-u)/2,a,u,s.roundingRadius??3),i.fillStyle=Nr(s.textDark,.1),i.fill()},onPaste:()=>{}},Sv=()=>e=>e.targetWidth,Hu=un("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[Sv(),"px"]}}),xv=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:i,targetRect:o,onFinish:s,validatedSelection:a}=e,l=t.data,u=t.readonly===!0,[c,d]=f.useState(l===""||r),g=f.useCallback(()=>{d(m=>!m)},[]),h=l?"gdg-ml-6":"";return c?f.createElement(Hu,{targetWidth:o.width-20},f.createElement(Wr,{autoFocus:!0,highlight:!1,validatedSelection:a,value:l,onKeyDown:m=>{m.key==="Enter"&&m.stopPropagation()},onChange:n}),f.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${h}`,onClick:()=>s(t)},f.createElement(Zg,null))):f.createElement(Hu,{targetWidth:o.width},f.createElement(xm,{contents:l,createNode:i}),!u&&f.createElement(f.Fragment,null,f.createElement("div",{className:"spacer"}),f.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${h}`,onClick:g},f.createElement(Bs,null))),f.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},kv={getAccessibilityString:e=>e.data?.toString()??"",kind:J.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:uo,measure:(e,t,n)=>{const r=t.data.split(`
|
175
|
-
`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>
|
176
|
-
`,t.allowWrapping===!0?void 0:1);let i=0;for(const o of r)i=Math.max(i,e.measureText(o).width);return i+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:r,value:i,validatedSelection:o}=t;return f.createElement(Wr,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:i.readonly!==!0,disabled:i.readonly===!0,altNewline:!0,value:i.data,validatedSelection:o,onChange:s=>r({...i,data:s.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},zv=un("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Vv=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:i,validatedSelection:o,preview:s}=e,[a,l]=f.useState(!i&&(t===""||r)),u=f.useCallback(()=>{l(!0)},[]);return a?f.createElement(Wr,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):f.createElement(zv,null,f.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},s),!i&&f.createElement("div",{className:"gdg-edit-icon",onClick:u},f.createElement(Bs,null)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function Vd(e,t,n,r){let i=n.cellHorizontalPadding;const o=t.height/2-e.actualBoundingBoxAscent/2,s=e.width,a=e.actualBoundingBoxAscent;return r==="right"?i=t.width-s-n.cellHorizontalPadding:r==="center"&&(i=t.width/2-s/2),{x:i,y:o,width:s,height:a}}function zu(e){const{cell:t,bounds:n,posX:r,posY:i,theme:o}=e,s=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const a=md(s,o.baseFontFull);if(a===void 0)return!1;const l=Vd(a,n,o,t.contentAlign);return Vr({x:l.x-4,y:l.y-4,width:l.width+8,height:l.height+8},r,i)}const Nv={getAccessibilityString:e=>e.data?.toString()??"",kind:J.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:uo,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:i,hoverY:o,rect:s,ctx:a}=e,l=t.displayData??t.data,u=t.hoverEffect===!0;if(r!==void 0&&u&&i!==void 0&&o!==void 0){const c=qr(l,a,n.baseFontFull),d=Vd(c,s,n,t.contentAlign),{x:g,y:h,width:m,height:p}=d;if(i>=g-4&&i<=g-4+m+8&&o>=h-4&&o<=h-4+p+8){const y=Zn(a,n.baseFontFull);r("pointer");const b=5,v=h-y;a.beginPath(),a.moveTo(s.x+g,Math.floor(s.y+v+p+b)+.5),a.lineTo(s.x+g+m,Math.floor(s.y+v+p+b)+.5),a.strokeStyle=n.linkColor,a.stroke(),a.save(),a.fillStyle=e.cellFillColor,Xn({...e,rect:{...s,x:s.x-1}},l,t.contentAlign),Xn({...e,rect:{...s,x:s.x-2}},l,t.contentAlign),Xn({...e,rect:{...s,x:s.x+1}},l,t.contentAlign),Xn({...e,rect:{...s,x:s.x+2}},l,t.contentAlign),a.restore()}}a.fillStyle=u?n.linkColor:n.textDark,Xn(e,l,t.contentAlign)},onSelect:e=>{zu(e)&&e.preventDefault()},onClick:e=>{const{cell:t}=e;zu(e)&&t.onClickUri?.(e)},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:r,forceEditMode:i,validatedSelection:o}=t;return f.createElement(Vv,{forceEditMode:r.readonly!==!0&&(i||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:o,readonly:r.readonly===!0,onChange:s=>n({...r,data:s.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},$v=[Mv,Tv,sv,dv,mv,bv,Cv,kv,_v,Fv,Av,Hv,Nv];var cs,Vu;function Bv(){if(Vu)return cs;Vu=1;var e=Zc(),t=Ic(),n="Expected a function";function r(i,o,s){var a=!0,l=!0;if(typeof i!="function")throw new TypeError(n);return t(s)&&(a="leading"in s?!!s.leading:a,l="trailing"in s?!!s.trailing:l),e(i,o,{leading:a,maxWait:o,trailing:l})}return cs=r,cs}var Wv=Bv();const Uv=ar(Wv),ds=[];class qv extends bd{imageLoaded=()=>{};loadedLocations=[];cache={};setCallback(t){this.imageLoaded=t}sendLoaded=Uv(()=>{this.imageLoaded(new Qi(this.loadedLocations)),this.loadedLocations=[]},20);clearOutOfWindow=()=>{const t=Object.keys(this.cache);for(const n of t){const r=this.cache[n];let i=!1;for(let o=0;o<r.cells.length;o++){const s=r.cells[o];if(this.isInWindow(s)){i=!0;break}}i?r.cells=r.cells.filter(this.isInWindow):(r.cancel(),delete this.cache[n])}};loadImage(t,n,r,i){let o=!1;const s=ds.pop()??new Image;let a=!1;const l={img:void 0,cells:[Bn(n,r)],url:t,cancel:()=>{a||(a=!0,ds.length<12?ds.unshift(s):o||(s.src=""))}},u=new Promise(c=>s.addEventListener("load",()=>c(null)));requestAnimationFrame(async()=>{try{s.src=t,await u,await s.decode();const c=this.cache[i];if(c!==void 0&&!a){c.img=s;for(const d of c.cells)this.loadedLocations.push(Ks(d));o=!0,this.sendLoaded()}}catch{l.cancel()}}),this.cache[i]=l}loadOrGetImage(t,n,r){const i=t,o=this.cache[i];if(o!==void 0){const s=Bn(n,r);return o.cells.includes(s)||o.cells.push(s),o.img}else this.loadImage(t,n,r,i)}}const Gv=(e,t)=>{const n=f.useMemo(()=>({...Ap,...e.headerIcons}),[e.headerIcons]),r=f.useMemo(()=>e.renderers??$v,[e.renderers]),i=f.useMemo(()=>e.imageWindowLoader??new qv,[e.imageWindowLoader]);return f.createElement(av,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:i})},Yv=f.forwardRef(Gv);function Nu(e,t){const n=f.useRef(null),r=f.useRef(),i=f.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return f.useEffect(()=>i,[i]),{debouncedCallback:f.useCallback((...s)=>{r.current=s,i(),n.current=setTimeout(()=>{r.current&&(e(...r.current),r.current=void 0)},t)},[e,t,i]),cancel:i}}const Nd=vi("div",{target:"ee4nolw0"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs})),Cr=vi("div",{target:"ee4nolw1"})(({theme:e,isActive:t,hasSubmenu:n})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,paddingTop:e.spacing.twoXS,paddingBottom:e.spacing.twoXS,cursor:"pointer",backgroundColor:t?e.colors.darkenedBgMix15:void 0,"&:hover":{backgroundColor:e.colors.darkenedBgMix15},minWidth:e.sizes.minMenuWidth,...n&&{justifyContent:"space-between","& > :first-of-type":{display:"flex",alignItems:"center",gap:e.spacing.sm}}})),jv=vi("div",{target:"ee4nolw2"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs})),$u=[{format:"",label:"Automatic",icon:":material/123:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"plain",label:"Plain",icon:":material/speed_1_75:"},{format:"compact",label:"Compact",icon:":material/1k:"},{format:"dollar",label:"Dollar",icon:":material/attach_money:"},{format:"euro",label:"Euro",icon:":material/euro:"},{format:"yen",label:"Yen",icon:":material/currency_yen:"},{format:"percent",label:"Percent",icon:":material/percent:"},{format:"scientific",label:"Scientific",icon:":material/experiment:"},{format:"accounting",label:"Accounting",icon:":material/finance_chip:"}],Xv={number:$u,progress:$u,datetime:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"distance",label:"Distance",icon:":material/search_activity:"},{format:"calendar",label:"Calendar",icon:":material/today:"}],date:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"distance",label:"Distance",icon:":material/search_activity:"}],time:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"}]};function Kv({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:i,onCloseMenu:o,children:s}){const a=$r(),{colors:l,fontSizes:u,radii:c,fontWeights:d}=a,g=Xv[e]||[];return g.length===0?nt(Oc,{}):nt(ba,{triggerType:Pc.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:nt(Nd,{role:"menu",children:g.map(h=>Tn(Cr,{onClick:()=>{i(h.format),o()},role:"menuitem",children:[nt(nr,{size:"base",margin:"0",color:"inherit",iconValue:h.icon}),h.label]},h.format))}),placement:pa.right,showArrow:!1,popoverMargin:2,overrides:{Body:{props:{"data-testid":"stDataFrameColumnFormattingMenu"},style:{borderTopLeftRadius:c.default,borderTopRightRadius:c.default,borderBottomLeftRadius:c.default,borderBottomRightRadius:c.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${a.sizes.borderWidth} solid ${a.colors.borderColor}`}},Inner:{style:{backgroundColor:va(a)?l.bgColor:l.secondaryBg,color:l.bodyText,fontSize:u.sm,fontWeight:d.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:s})}const Zv=f.memo(Kv);function Jv({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:i,onCloseMenu:o,onSortColumn:s,onHideColumn:a,columnKind:l,onChangeFormat:u,onAutosize:c}){const d=$r(),[g,h]=f.useState(!1),{colors:m,fontSizes:p,radii:y,fontWeights:b}=d;f.useEffect(()=>{function S(O){O.preventDefault()}return document.addEventListener("wheel",S,{passive:!1}),document.addEventListener("touchmove",S,{passive:!1}),()=>{document.removeEventListener("wheel",S),document.removeEventListener("touchmove",S)}},[]);const v=f.useCallback(()=>{o()},[o]);return nt(ba,{autoFocus:!0,"aria-label":"Dataframe column menu",content:Tn(Nd,{children:[s&&Tn(Oc,{children:[Tn(Cr,{onClick:()=>{s("asc"),v()},role:"menuitem",children:[nt(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),Tn(Cr,{onClick:()=>{s("desc"),v()},role:"menuitem",children:[nt(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_downward:"}),"Sort descending"]}),nt(jv,{})]}),u&&nt(Zv,{columnKind:l,isOpen:g,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onChangeFormat:u,onCloseMenu:v,children:Tn(Cr,{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),isActive:g,hasSubmenu:!0,children:[Tn("div",{children:[nt(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/format_list_numbered:"}),"Format"]}),nt(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/chevron_right:"})]})}),c&&Tn(Cr,{onClick:()=>{c(),v()},children:[nt(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&Tn(Cr,{onClick:()=>{i(),v()},children:[nt(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&Tn(Cr,{onClick:()=>{r(),v()},children:[nt(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep:"}),"Pin column"]}),a&&Tn(Cr,{onClick:()=>{a(),v()},children:[nt(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:pa.bottomRight,accessibilityType:_c.menu,showArrow:!1,popoverMargin:ln("0.375rem"),onClickOutside:g?void 0:v,onEsc:v,overrides:{Body:{props:{"data-testid":"stDataFrameColumnMenu"},style:{paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{border:`${d.sizes.borderWidth} solid ${d.colors.borderColor}`,backgroundColor:va(d)?m.bgColor:m.secondaryBg,color:m.bodyText,fontSize:p.sm,fontWeight:b.normal,borderTopLeftRadius:y.default,borderTopRightRadius:y.default,borderBottomLeftRadius:y.default,borderBottomRightRadius:y.default,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:!0,children:nt("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const Qv=f.memo(Jv),e1="(index)",t1=({label:e,initialValue:t,onChange:n})=>{const r=$r();return nt(mg,{checked:t,onChange:i=>{n(i.target.checked)},"aria-label":e,checkmarkType:gg.default,labelPlacement:hg.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:r.spacing.none,marginTop:r.spacing.none,paddingLeft:r.spacing.md,paddingRight:r.spacing.md,paddingTop:r.spacing.twoXS,paddingBottom:r.spacing.twoXS,backgroundColor:i?r.colors.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Checkmark:{style:({$isFocusVisible:i,$checked:o})=>{const s=o?r.colors.primary:r.colors.fadedText40;return{outline:0,width:r.sizes.checkbox,height:r.sizes.checkbox,marginTop:r.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&o?`0 0 0 0.2rem ${si(r.colors.primary,.5)}`:"",borderLeftWidth:r.sizes.borderWidth,borderRightWidth:r.sizes.borderWidth,borderTopWidth:r.sizes.borderWidth,borderBottomWidth:r.sizes.borderWidth,borderLeftColor:s,borderRightColor:s,borderTopColor:s,borderBottomColor:s}}},Label:{style:{lineHeight:r.lineHeights.small,paddingLeft:r.spacing.sm,position:"relative",color:r.colors.bodyText,fontSize:r.fontSizes.sm,fontWeight:r.fontWeights.normal}}},children:e})},n1=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:i,children:o,isOpen:s,onClose:a})=>{const l=$r();return nt(ba,{triggerType:Pc.click,placement:pa.bottomRight,autoFocus:!0,focusLock:!0,content:()=>nt("div",{style:{paddingTop:l.spacing.sm,paddingBottom:l.spacing.sm},children:e.map(u=>{const c=t.length&&!u.isIndex?!t.includes(u.id)&&!t.includes(u.name):!1;return nt(t1,{label:!u.title&&u.isIndex?e1:u.title,initialValue:!(u.isHidden===!0||c),onChange:d=>{d?(i(u.id),c&&n(g=>[...g,u.id])):r(u.id)}},u.id)})}),isOpen:s,onClickOutside:a,onClick:()=>s?a():void 0,onEsc:a,ignoreBoundary:!1,overrides:{Body:{props:{"data-testid":"stDataFrameColumnVisibilityMenu"},style:{borderTopLeftRadius:l.radii.default,borderTopRightRadius:l.radii.default,borderBottomLeftRadius:l.radii.default,borderBottomRightRadius:l.radii.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${l.sizes.borderWidth} solid ${l.colors.borderColor}`}},Inner:{style:{backgroundColor:va(l)?l.colors.bgColor:l.colors.secondaryBg,color:l.colors.bodyText,fontSize:l.fontSizes.sm,fontWeight:l.fontWeights.normal,minWidth:l.sizes.minMenuWidth,maxWidth:`calc(${l.sizes.minMenuWidth} * 2)`,maxHeight:l.sizes.maxDropdownHeight,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:nt("div",{children:o})})},r1=f.memo(n1);var i1=yh();const o1=ar(i1);var Jo={exports:{}};/*! Moment Duration Format v2.2.2
|
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=B0(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 q0=()=>e=>e.innerWidth,G0=()=>e=>e.innerHeight,X0=un("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[q0()],"wmyidgi-1":[G0()]}}),Y0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return f.createElement(X0,{innerHeight:Fu(n),innerWidth:Fu(t),...i},r)},j0=2,K0=1300;function Z0(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/K0);const d=r.current**1.618*c*j0;t.current?.scrollBy(i*d,o*d),a=u,n?.()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{s=!0}},[t,i,o,n])}function J0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:s,remSize:a}){const[l,u,c,d,g,h]=Vt.useMemo(()=>{if(!s||a===16)return[e,t,n,r,i,o];const m=a/16,p=e,y=Cd();return[typeof p=="number"?p*m:b=>Math.ceil(p(b)*m),Math.ceil(t*m),Math.ceil(n*m),{...r,headerIconSize:(r?.headerIconSize??y.headerIconSize)*m,cellHorizontalPadding:(r?.cellHorizontalPadding??y.cellHorizontalPadding)*m,cellVerticalPadding:(r?.cellVerticalPadding??y.cellVerticalPadding)*m},Math.ceil((i??0)*m),Math.ceil((o??0)*m)]},[n,t,i,o,a,e,s,r]);return{rowHeight:l,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:g,overscrollY:h}}const wr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function at(e,t){return e===!0?t:e===!1?"":e}function Lu(e){const t=aa.value;return{activateCell:at(e.activateCell," |Enter|shift+Enter"),clear:at(e.clear,"any+Escape"),closeOverlay:at(e.closeOverlay,"any+Escape"),acceptOverlayDown:at(e.acceptOverlayDown,"Enter"),acceptOverlayUp:at(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:at(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:at(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:at(e.delete,t?"Backspace|Delete":"Delete"),downFill:at(e.downFill,"primary+_68"),scrollToSelectedCell:at(e.scrollToSelectedCell,"primary+Enter"),goDownCell:at(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:at(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:at(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:at(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:at(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:at(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:at(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:at(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:at(e.goToFirstCell,"primary+Home"),goToFirstColumn:at(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:at(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:at(e.goToLastCell,"primary+End"),goToLastColumn:at(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:at(e.goToLastRow,"primary+ArrowDown"),goToNextPage:at(e.goToNextPage,"PageDown"),goToPreviousPage:at(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:at(e.rightFill,"primary+_82"),search:at(e.search,"primary+f"),selectAll:at(e.selectAll,"primary+a"),selectColumn:at(e.selectColumn,"ctrl+ "),selectGrowDown:at(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:at(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:at(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:at(e.selectGrowUp,"shift+ArrowUp"),selectRow:at(e.selectRow,"shift+ "),selectToFirstCell:at(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:at(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:at(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:at(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:at(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:at(e.selectToLastRow,"primary+shift+ArrowDown")}}function Q0(e){const t=am(e);return Vt.useMemo(()=>{if(t===void 0)return Lu(wr);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??wr.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??wr.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??wr.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??wr.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??wr.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??wr.selectToLastCell};return Lu({...wr,...n})},[t])}function ev(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const s={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(s.subGroups=r.subGroups.map((a,l)=>t(a,i+1,[...o,l])).sort((a,l)=>a.headerIndex-l.headerIndex)),s}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function Qs(e,t){const n=[];function r(a,l,u=!1){let c=l!==null?l-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(c=a.subGroups[0].headerIndex-a.headerIndex),c--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:u,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:c}),a.subGroups)for(let d=0;d<a.subGroups.length;d++){const g=d<a.subGroups.length-1?a.subGroups[d+1].headerIndex:l;r(a.subGroups[d],g,u||a.isCollapsed)}}const i=ev(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 Ds(e,t){if(t===void 0||Qs.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(r.isCollapsed)n--;else{if(n<=r.rows)return{path:[...r.path,n-1],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n-1,contentIndex:r.contentIndex+n-1,groupRows:r.rows};n=n-r.rows-1}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function tv(e,t,n,r){const i=Vt.useMemo(()=>e===void 0?void 0:Qs(e,t),[e,t]),o=Vt.useMemo(()=>i?.reduce((c,d)=>(c[d.rowIndex]=d,c),{}),[i]),s=Vt.useMemo(()=>i===void 0?t:i.reduce((c,d)=>c+(d.isCollapsed?1:d.rows+1),0),[i,t]),a=Vt.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>o?.[c]?e.height:typeof n=="number"?n:n(c),[o,e,n]),l=Vt.useCallback(c=>{if(i===void 0)return c;let d=c;for(const g of i){if(d===0)return;if(d--,!g.isCollapsed){if(d<g.rows)return g.contentIndex+d;d-=g.rows}}return c},[i]),u=yr(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}=Ds(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 nv(e,t){const n=Vt.useMemo(()=>e===void 0?void 0:Qs(e,t),[e,t]);return{getRowGroupingForPath:zd,updateRowGroupingByPath:Hd,mapper:Vt.useCallback(r=>{if(typeof r=="number")return Ds(r,n);const i=Ds(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 rv(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 iv(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]=om(a),d=f.useRef(i);d.current=i;const g=rv(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 ov=f.lazy(async()=>await Hs(()=>import("./data-grid-overlay-editor.DBCkAuJT.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url));let av=0;function sv(e){return up(Cu(Cu(e).filter(t=>t.span!==void 0).map(t=>xr((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Vo(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const $o={kind:J.Loading,allowOverlay:!1},No={columns:it.empty(),rows:it.empty(),current:void 0},lv=(e,t)=>{const[n,r]=f.useState(No),[i,o]=f.useState(),s=f.useRef(null),a=f.useRef(null),[l,u]=f.useState(),c=f.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:h,markdownDivCreateNode:m,width:p,height:y,columns:b,rows:v,getCellContent:S,onCellClicked:O,onCellActivated:M,onFillPattern:R,onFinishedEditing:_,coercePasteValue:I,drawHeader:k,drawCell:F,editorBloom:D,onHeaderClicked:C,onColumnProposeMove:E,rangeSelectionColumnSpanning:T=!0,spanRangeBehavior:x="default",onGroupHeaderClicked:N,onCellContextMenu:G,className:j,onHeaderContextMenu:ie,getCellsForSelection:ee,onGroupHeaderContextMenu:Q,onGroupHeaderRenamed:te,onCellEdited:se,onCellsEdited:ue,onSearchResultsChanged:fe,searchResults:re,onSearchValueChange:H,searchValue:P,onKeyDown:X,onKeyUp:ce,keybindings:he,editOnType:ke=!0,onRowAppended:Se,onColumnAppended:Qe,onColumnMoved:Ee,validateCell:et,highlightRegions:kt,rangeSelect:Ne="rect",columnSelect:ne="multi",rowSelect:me="multi",rangeSelectionBlending:xe="exclusive",columnSelectionBlending:de="exclusive",rowSelectionBlending:be="exclusive",onDelete:Pe,onDragStart:Te,onMouseMove:st,onPaste:Re,copyHeaders:Ge=!1,freezeColumns:He=0,cellActivationBehavior:we="second-click",rowSelectionMode:Be="auto",onHeaderMenuClick:mt,onHeaderIndicatorClick:ft,getGroupDetails:Xe,rowGrouping:yt,onSearchClose:Xt,onItemHovered:Ht,onSelectionCleared:Mt,showSearch:nn,onVisibleRegionChanged:qt,gridSelection:cn,onGridSelectionChange:Ot,minColumnWidth:ut=50,maxColumnWidth:tn=500,maxColumnAutoWidth:Ct,provideEditor:rn,trailingRowOptions:Bt,freezeTrailingRows:De=0,allowedFillDirections:Et="orthogonal",scrollOffsetX:Pt,scrollOffsetY:yn,verticalBorder:Yt,onDragOverCell:dn,onDrop:Rn,onColumnResize:jt,onColumnResizeEnd:Jt,onColumnResizeStart:We,customRenderers:Rt,fillHandle:Cn,experimental:vt,fixedShadowX:Ft,fixedShadowY:Sn,headerIcons:qn,imageWindowLoader:zn,initialSize:$,isDraggable:$e,onDragLeave:Ue,onRowMoved:St,overscrollX:mn,overscrollY:ge,preventDiagonalScrolling:bt,rightElement:Qt,rightElementProps:It,trapFocus:Nt=!1,smoothScrollX:on,smoothScrollY:ka,scaleToRem:fo=!1,rowHeight:Ma=34,headerHeight:ho=36,groupHeaderHeight:Ir=ho,theme:ur,isOutsideClick:Ra,renderers:bi,resizeIndicator:go,scrollToActiveCell:wi=!0,drawFocusRing:Er=!0,portalElementRef:pl}=e,yi=Er==="no-editor"?i===void 0:Er,Pn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,xn=Pn?.kind??e.rowMarkers??"none",Ci=Pn?.width??e.rowMarkerWidth,er=Pn?.startIndex??e.rowMarkerStartIndex??1,tr=Pn?.theme??e.rowMarkerTheme,Xr=Pn?.headerTheme,cr=Pn?.headerAlwaysVisible,Tr=me!=="multi"||Pn?.headerDisabled===!0,Yr=Pn?.checkboxStyle??"square",nr=Math.max(ut,20),jr=Math.max(tn,nr),Ia=Math.max(Ct??jr,nr),mo=f.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:_e,rowNumberMapper:Si,rowHeight:po,getRowThemeOverride:dr}=tv(yt,v,Ma,h),Ea=f.useMemo(()=>Number.parseFloat(mo.fontSize),[mo]),{rowHeight:Gn,headerHeight:xi,groupHeaderHeight:vo,theme:bo,overscrollX:ki,overscrollY:Ta}=J0({groupHeaderHeight:Ir,headerHeight:ho,overscrollX:mn,overscrollY:ge,remSize:Ea,rowHeight:po,scaleToRem:fo,theme:ur}),Xn=Q0(he),fr=Ci??(v>1e4?48:v>1e3?44:v>100?36:32),_n=xn!=="none",U=_n?1:0,Lt=Bt!==void 0,rr=Bt?.sticky===!0,[Mi,wo]=f.useState(!1),Kr=nn??Mi,Da=f.useCallback(()=>{Xt!==void 0?Xt():wo(!1)},[Xt]),K=f.useMemo(()=>cn===void 0?void 0:Vo(cn,U),[cn,U])??n,kn=f.useRef();kn.current===void 0&&(kn.current=new AbortController),f.useEffect(()=>()=>kn?.current.abort(),[]);const[z,oe]=A0(ee,S,U,kn.current,_e),Me=f.useCallback((w,A,L)=>{if(et===void 0)return!0;const W=[w[0]-U,w[1]];return et?.(W,A,L)},[U,et]),Ie=f.useRef(cn),ae=f.useCallback((w,A)=>{A&&(w=W0(w,z,U,x,kn.current)),Ot!==void 0?(Ie.current=Vo(w,-U),Ot(Ie.current)):r(w)},[Ot,z,U,x]),ve=yr(jt,f.useCallback((w,A,L,W)=>{jt?.(b[L-U],A,L-U,W)},[jt,U,b])),Ye=yr(Jt,f.useCallback((w,A,L,W)=>{Jt?.(b[L-U],A,L-U,W)},[Jt,U,b])),ye=yr(We,f.useCallback((w,A,L,W)=>{We?.(b[L-U],A,L-U,W)},[We,U,b])),je=yr(k,f.useCallback((w,A)=>k?.({...w,columnIndex:w.columnIndex-U},A)??!1,[k,U])),ct=yr(F,f.useCallback((w,A)=>F?.({...w,col:w.col-U},A)??!1,[F,U])),Zt=f.useCallback(w=>{if(Pe!==void 0){const A=Pe(Vo(w,-U));return typeof A=="boolean"?A:Vo(A,U)}return!0},[Pe,U]),[dt,Tt,tt]=L0(K,ae,xe,de,be,Ne,T),Je=f.useMemo(()=>or(Cd(),bo),[bo]),[zt,Wt]=f.useState([0,0,0]),Dr=f.useMemo(()=>{if(bi===void 0)return{};const w={};for(const A of bi)w[A.kind]=A;return w},[bi]),en=f.useCallback(w=>w.kind!==J.Custom?Dr[w.kind]:Rt?.find(A=>A.isMatch(w)),[Rt,Dr]);let{sizedColumns:an,nonGrowWidth:hr}=ep(b,_e,oe,zt[0]-(U===0?0:fr)-zt[2],nr,Ia,Je,en,kn.current);xn!=="none"&&(hr+=fr);const _t=f.useMemo(()=>an.some(w=>w.group!==void 0),[an]),Mn=_t?xi+vo:xi,In=K.rows.length,gr=xn==="none"?void 0:In===0?!1:In===_e?!0:void 0,nt=f.useMemo(()=>xn==="none"?an:[{title:"",width:fr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:tr,rowMarker:Yr,rowMarkerChecked:gr,headerRowMarkerTheme:Xr,headerRowMarkerAlwaysVisible:cr,headerRowMarkerDisabled:Tr},...an],[xn,an,fr,tr,Yr,gr,Xr,cr,Tr]),sn=f.useRef({height:1,width:1,x:0,y:0}),Yn=f.useRef(!1),{setVisibleRegion:vl,visibleRegion:Or,scrollRef:Ut}=iv(Pt,yn,Gn,sn,()=>Yn.current=!0);sn.current=Or;const Lf=Or.x+U,yo=Or.y,fn=f.useRef(null),pn=f.useCallback(w=>{w===!0?fn.current?.focus():window.requestAnimationFrame(()=>{fn.current?.focus()})},[]),hn=Lt?_e+1:_e,Fn=f.useCallback(w=>{const A=U===0?w:w.map(W=>({...W,location:[W.location[0]-U,W.location[1]]})),L=ue?.(A);if(L!==!0)for(const W of A)se?.(W.location,W.value);return L},[se,ue,U]),[Pr,Oa]=f.useState(),Co=K.current!==void 0&&K.current.range.width*K.current.range.height>1?K.current.range:void 0,bl=yi?K.current?.cell:void 0,So=bl?.[0],xo=bl?.[1],Af=f.useMemo(()=>{if((kt===void 0||kt.length===0)&&(Co??So??xo??Pr)===void 0)return;const w=[];if(kt!==void 0)for(const A of kt){const L=nt.length-A.range.x-U;L>0&&w.push({color:A.color,range:{...A.range,x:A.range.x+U,width:Math.min(L,A.range.width)},style:A.style})}return Pr!==void 0&&w.push({color:Nr(Je.accentColor,0),range:Pr,style:"dashed"}),Co!==void 0&&w.push({color:Nr(Je.accentColor,.5),range:Co,style:"solid-outline"}),So!==void 0&&xo!==void 0&&w.push({color:Je.accentColor,range:{x:So,y:xo,width:1,height:1},style:"solid-outline"}),w.length>0?w:void 0},[Pr,Co,So,xo,kt,nt.length,Je.accentColor,U]),wl=f.useRef(nt);wl.current=nt;const En=f.useCallback(([w,A],L=!1)=>{const W=Lt&&A===hn-1;if(w===0&&_n){if(W)return $o;const Y=Si(A);return Y===void 0?$o:{kind:Hn.Marker,allowOverlay:!1,checkboxStyle:Yr,checked:K?.rows.hasIndex(A)===!0,markerKind:xn==="clickable-number"?"number":xn,row:er+Y,drawHandle:St!==void 0,cursor:xn==="clickable-number"?"pointer":void 0}}else if(W){const V=w===U?Bt?.hint??"":"",B=wl.current[w];if(B?.trailingRowOptions?.disabled===!0)return $o;{const Z=B?.trailingRowOptions?.hint??V,le=B?.trailingRowOptions?.addIcon??Bt?.addIcon;return{kind:Hn.NewRow,hint:Z,allowOverlay:!1,icon:le}}}else{const Y=w-U;if(L||vt?.strict===!0){const B=sn.current,Z=B.x>Y||Y>B.x+B.width||B.y>A||A>B.y+B.height||A>=La.current,le=Y===B.extras?.selected?.[0]&&A===B.extras?.selected[1];let pe=!1;if(B.extras?.freezeRegions!==void 0){for(const wt of B.extras.freezeRegions)if($r(wt,Y,A)){pe=!0;break}}if(Z&&!le&&!pe)return $o}let V=S([Y,A]);return U!==0&&V.span!==void 0&&(V={...V,span:[V.span[0]+U,V.span[1]+U]}),V}},[Lt,hn,_n,Si,Yr,K?.rows,xn,er,St,U,Bt?.hint,Bt?.addIcon,vt?.strict,S]),Pa=f.useCallback(w=>{let A=Xe?.(w)??{name:w};return te!==void 0&&w!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:L=>Ha({group:A.name,bounds:L.bounds})}]}),A},[Xe,te]),ko=f.useCallback(w=>{const[A,L]=w.cell,W=nt[A],q=W?.group!==void 0?Pa(W.group)?.overrideTheme:void 0,Y=W?.themeOverride,V=dr?.(L);o({...w,theme:or(Je,q,Y,V,w.content.themeOverride)})},[dr,nt,Pa,Je]),Zr=f.useCallback((w,A,L)=>{if(K.current===void 0)return;const[W,q]=K.current.cell,Y=En([W,q]);if(Y.kind!==J.Boolean&&Y.allowOverlay){let V=Y;if(L!==void 0)switch(V.kind){case J.Number:{const B=_g(()=>L==="-"?-0:Number.parseFloat(L),0);V={...V,data:Number.isNaN(B)?0:B};break}case J.Text:case J.Markdown:case J.Uri:V={...V,data:L};break}ko({target:w,content:V,initialValue:L,cell:[W,q],highlight:L===void 0,forceEditMode:L!==void 0})}else Y.kind===J.Boolean&&A&&Y.readonly!==!0&&(Fn([{location:K.current.cell,value:{...Y,data:Ad(Y.data)}}]),fn.current?.damage([{cell:K.current.cell}]))},[En,K,Fn,ko]),yl=f.useCallback((w,A)=>{const L=fn.current?.getBounds(w,A);if(L===void 0||Ut.current===null)return;const W=En([w,A]);W.allowOverlay&&ko({target:L,content:W,initialValue:void 0,highlight:!0,cell:[w,A],forceEditMode:!0})},[En,Ut,ko]),Gt=f.useCallback((w,A,L="both",W=0,q=0,Y=void 0)=>{if(Ut.current!==null){const V=fn.current,B=a.current,Z=typeof w!="number"?w.unit==="cell"?w.amount:void 0:w,le=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,pe=typeof w!="number"&&w.unit==="px"?w.amount:void 0,wt=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(V!==null&&B!==null){let rt={x:0,y:0,width:0,height:0},Ke=0,Ze=0;if((Z!==void 0||le!==void 0)&&(rt=V.getBounds((Z??0)+U,le??0)??rt,rt.width===0||rt.height===0))return;const ht=B.getBoundingClientRect(),xt=ht.width/B.offsetWidth;if(pe!==void 0&&(rt={...rt,x:pe-ht.left-Ut.current.scrollLeft,width:1}),wt!==void 0&&(rt={...rt,y:wt+ht.top-Ut.current.scrollTop,height:1}),rt!==void 0){const pt={x:rt.x-W,y:rt.y-q,width:rt.width+2*W,height:rt.height+2*q};let ri=0;for(let Ua=0;Ua<He;Ua++)ri+=an[Ua].width;let _i=0;const Fi=De+(rr?1:0);Fi>0&&(_i=qr(hn,Fi,Gn));let Kn=ri*xt+ht.left+U*fr*xt,ii=ht.right,Ar=ht.top+Mn*xt,oi=ht.bottom-_i*xt;const Oo=rt.width+W*2;switch(Y?.hAlign){case"start":ii=Kn+Oo;break;case"end":Kn=ii-Oo;break;case"center":Kn=Math.floor((Kn+ii)/2)-Oo/2,ii=Kn+Oo;break}const Po=rt.height+q*2;switch(Y?.vAlign){case"start":oi=Ar+Po;break;case"end":Ar=oi-Po;break;case"center":Ar=Math.floor((Ar+oi)/2)-Po/2,oi=Ar+Po;break}Kn>pt.x?Ke=pt.x-Kn:ii<pt.x+pt.width&&(Ke=pt.x+pt.width-ii),Ar>pt.y?Ze=pt.y-Ar:oi<pt.y+pt.height&&(Ze=pt.y+pt.height-oi),L==="vertical"||typeof w=="number"&&w<He?Ke=0:(L==="horizontal"||typeof A=="number"&&A>=hn-Fi)&&(Ze=0),(Ke!==0||Ze!==0)&&(xt!==1&&(Ke/=xt,Ze/=xt),Ut.current.scrollTo({left:Ke+Ut.current.scrollLeft,top:Ze+Ut.current.scrollTop,behavior:Y?.behavior??"auto"}))}}}},[U,De,fr,Ut,Mn,He,an,hn,rr,Gn]),_a=f.useRef(yl),Fa=f.useRef(S);_a.current=yl,Fa.current=S;const La=f.useRef(_e);La.current=_e;const Cl=f.useRef(nt.length);Cl.current=nt.length;const mr=f.useCallback(async(w,A=!0,L)=>{if(nt[w]?.trailingRowOptions?.disabled===!0)return;const q=Se?.();let Y,V=!0;q!==void 0&&(Y=await q,Y==="top"&&(V=!1),typeof Y=="number"&&(V=!1));let B=0;const Z=()=>{if(La.current<=_e){B<500&&window.setTimeout(Z,B),B=50+B*2;return}const le=typeof Y=="number"?Y:V?_e:0;Do.current(w-U,le,"both",0,0,L?{behavior:L}:void 0),dt({cell:[w,le],range:{x:w,y:le,width:1,height:1}},!1,!1,"edit");const pe=Fa.current([w-U,le]);pe.allowOverlay&&ci(pe)&&pe.readonly!==!0&&A&&window.setTimeout(()=>{_a.current(w,le)},0)};Z()},[nt,Se,U,_e,dt]),Mo=f.useCallback(async(w,A=!0)=>{const L=Qe?.();let W,q=!0;L!==void 0&&(W=await L,W==="left"&&(q=!1),typeof W=="number"&&(q=!1));let Y=0;const V=()=>{if(Cl.current<=nt.length){Y<500&&window.setTimeout(V,Y),Y=50+Y*2;return}const B=typeof W=="number"?W:q?nt.length:0;Gt(B-U,w),dt({cell:[B,w],range:{x:B,y:w,width:1,height:1}},!1,!1,"edit");const Z=Fa.current([B-U,w]);Z.allowOverlay&&ci(Z)&&Z.readonly!==!0&&A&&window.setTimeout(()=>{_a.current(B,w)},0)};V()},[nt,Qe,U,Gt,dt]),Jr=f.useCallback(w=>{const A=an[w]?.trailingRowOptions?.targetColumn??Bt?.targetColumn;if(typeof A=="number")return A+(_n?1:0);if(typeof A=="object"){const L=b.indexOf(A);if(L>=0)return L+(_n?1:0)}},[an,b,_n,Bt?.targetColumn]),pr=f.useRef(),Qr=f.useRef(),Ii=f.useCallback((w,A)=>{const[L,W]=A;return or(Je,nt[L]?.themeOverride,dr?.(W),w.themeOverride)},[dr,nt,Je]),{mapper:_r}=nv(yt,v),Vn=yt?.navigationBehavior,Ei=f.useCallback(w=>{const A=aa.value?w.metaKey:w.ctrlKey,L=A&&me==="multi",W=A&&ne==="multi",[q,Y]=w.location,V=K.columns,B=K.rows,[Z,le]=K.current?.cell??[];if(w.kind==="cell"){if(Qr.current=void 0,Fr.current=[q,Y],q===0&&_n){if(Lt===!0&&Y===_e||xn==="number"||me==="none")return;const pe=En(w.location);if(pe.kind!==Hn.Marker)return;if(St!==void 0){const Ke=en(pe);Dn(Ke?.kind===Hn.Marker);const Ze=Ke?.onClick?.({...w,cell:pe,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,theme:Ii(pe,w.location),preventDefault:()=>{}});if(Ze===void 0||Ze.checked===pe.checked)return}o(void 0),pn();const wt=B.hasIndex(Y),rt=pr.current;if(me==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&rt!==void 0&&B.hasIndex(rt)){const Ke=[Math.min(rt,Y),Math.max(rt,Y)+1];L||Be==="multi"?Tt(void 0,Ke,!0):Tt(it.fromSingleSelection(Ke),void 0,L)}else me==="multi"&&(L||w.isTouch||Be==="multi")?wt?Tt(B.remove(Y),void 0,!0):(Tt(void 0,Y,!0),pr.current=Y):wt&&B.length===1?Tt(it.empty(),void 0,A):(Tt(it.fromSingleSelection(Y),void 0,A),pr.current=Y)}else if(q>=U&&Lt&&Y===_e){const pe=Jr(q);mr(pe??q)}else if(Z!==q||le!==Y){const pe=En(w.location),wt=en(pe);if(wt?.onSelect!==void 0){let Ze=!1;if(wt.onSelect({...w,cell:pe,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,preventDefault:()=>Ze=!0,theme:Ii(pe,w.location)}),Ze)return}if(Vn==="block"&&_r(Y).isGroupHeader)return;const rt=rr&&Y===_e,Ke=rr&&K!==void 0&&K.current?.cell[1]===_e;if((w.shiftKey||w.isLongTouch===!0)&&Z!==void 0&&le!==void 0&&K.current!==void 0&&!Ke){if(rt)return;const Ze=Math.min(q,Z),ht=Math.max(q,Z),xt=Math.min(Y,le),pt=Math.max(Y,le);dt({...K.current,range:{x:Ze,y:xt,width:ht-Ze+1,height:pt-xt+1}},!0,A,"click"),pr.current=void 0,pn()}else dt({cell:[q,Y],range:{x:q,y:Y,width:1,height:1}},!0,A,"click"),pr.current=void 0,o(void 0),pn()}}else if(w.kind==="header")if(Fr.current=[q,Y],o(void 0),_n&&q===0)pr.current=void 0,Qr.current=void 0,!Tr&&me==="multi"&&(B.length!==_e?Tt(it.fromSingleSelection([0,_e]),void 0,A):Tt(it.empty(),void 0,A),pn());else{const pe=Qr.current;if(ne==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&pe!==void 0&&V.hasIndex(pe)){const wt=[Math.min(pe,q),Math.max(pe,q)+1];W?tt(void 0,wt,A):tt(it.fromSingleSelection(wt),void 0,A)}else W?(V.hasIndex(q)?tt(V.remove(q),void 0,A):tt(void 0,q,A),Qr.current=q):ne!=="none"&&(V.hasIndex(q)?tt(V.remove(q),void 0,A):tt(it.fromSingleSelection(q),void 0,A),Qr.current=q);pr.current=void 0,pn()}else w.kind===An?Fr.current=[q,Y]:w.kind===sa&&!w.isMaybeScrollbar&&(ae(No,!1),o(void 0),pn(),Mt?.(),pr.current=void 0,Qr.current=void 0)},[me,ne,K,_n,U,Lt,_e,xn,En,St,pn,Be,en,Ii,Tt,Jr,mr,Vn,_r,rr,dt,tt,ae,Mt]),Ti=f.useRef(!1),Fr=f.useRef(),Sl=f.useRef(Or),jn=f.useRef(),Hf=f.useCallback(w=>{if(ei.current=!1,Sl.current=sn.current,w.button!==0&&w.button!==1){jn.current=void 0;return}const A=performance.now();jn.current={button:w.button,time:A,location:w.location},w?.kind==="header"&&(Ti.current=!0);const L=w.kind==="cell"&&w.isFillHandle;!L&&w.kind!=="cell"&&w.isEdge||(u({previousSelection:K,fillHandle:L}),Fr.current=void 0,!w.isTouch&&w.button===0&&!L?Ei(w):!w.isTouch&&w.button===1&&(Fr.current=w.location))},[K,Ei]),[Aa,Ha]=f.useState(),xl=f.useCallback(w=>{if(w.kind!==An||ne!=="multi")return;const A=aa.value?w.metaKey:w.ctrlKey,[L]=w.location,W=K.columns;if(L<U)return;const q=nt[L];let Y=L,V=L;for(let B=L-1;B>=U&&no(q.group,nt[B].group);B--)Y--;for(let B=L+1;B<nt.length&&no(q.group,nt[B].group);B++)V++;if(pn(),A)if(W.hasAll([Y,V+1])){let B=W;for(let Z=Y;Z<=V;Z++)B=B.remove(Z);tt(B,void 0,A)}else tt(void 0,[Y,V+1],A);else tt(it.fromSingleSelection([Y,V+1]),void 0,A)},[ne,pn,K.columns,nt,U,tt]),ei=f.useRef(!1),Ro=f.useCallback(async w=>{if(z!==void 0&&ve!==void 0){const A=sn.current.y,L=sn.current.height;let W=z({x:w,y:A,width:1,height:Math.min(L,_e-A)},kn.current.signal);typeof W!="object"&&(W=await W());const q=an[w-U],V=document.createElement("canvas").getContext("2d",{alpha:!1});if(V!==null){V.font=Je.baseFontFull;const B=xd(V,Je,q,0,W,nr,jr,!1,en);ve?.(q,B.width,w,B.width)}}},[an,z,jr,Je,nr,ve,U,_e,en]),[zf,za]=f.useState(),ti=f.useCallback(async(w,A)=>{const L=w.current?.range;if(L===void 0||z===void 0||A.current===void 0)return;const W=A.current.range;if(R!==void 0){let B=!1;if(R({fillDestination:{...W,x:W.x-U},patternSource:{...L,x:L.x-U},preventDefault:()=>B=!0}),B)return}let q=z(L,kn.current.signal);typeof q!="object"&&(q=await q());const Y=q,V=[];for(let B=0;B<W.width;B++)for(let Z=0;Z<W.height;Z++){const le=[W.x+B,W.y+Z];if(fd(le,L))continue;const pe=Y[Z%L.height][B%L.width];fi(pe)||!ci(pe)||V.push({location:le,value:{...pe}})}Fn(V),fn.current?.damage(V.map(B=>({cell:B.location})))},[z,Fn,R,U]),kl=f.useCallback(()=>{if(K.current===void 0||K.current.range.width<=1)return;const w={...K,current:{...K.current,range:{...K.current.range,width:1}}};ti(w,K)},[ti,K]),Ml=f.useCallback(()=>{if(K.current===void 0||K.current.range.height<=1)return;const w={...K,current:{...K.current,range:{...K.current.range,height:1}}};ti(w,K)},[ti,K]),Vf=f.useCallback((w,A)=>{const L=l;if(u(void 0),Oa(void 0),za(void 0),Ti.current=!1,A)return;if(L?.fillHandle===!0&&K.current!==void 0&&L.previousSelection?.current!==void 0){if(Pr===void 0)return;const pe={...K,current:{...K.current,range:Ed(L.previousSelection.current.range,Pr)}};ti(L.previousSelection,pe),ae(pe,!0);return}const[W,q]=w.location,[Y,V]=Fr.current??[],B=()=>{ei.current=!0},Z=pe=>{const wt=pe.isTouch||Y===W&&V===q;if(wt&&O?.([W-U,q],{...pe,preventDefault:B}),pe.button===1)return!ei.current;if(!ei.current){const rt=En(w.location),Ke=en(rt);if(Ke!==void 0&&Ke.onClick!==void 0&&wt){const ht=Ke.onClick({...pe,cell:rt,posX:pe.localEventX,posY:pe.localEventY,bounds:pe.bounds,theme:Ii(rt,w.location),preventDefault:B});ht!==void 0&&!fi(ht)&&ui(ht)&&(Fn([{location:pe.location,value:ht}]),fn.current?.damage([{cell:pe.location}]))}if(ei.current||K.current===void 0)return!1;let Ze=!1;switch(rt.activationBehaviorOverride??we){case"double-click":case"second-click":{if(L?.previousSelection?.current?.cell===void 0)break;const[ht,xt]=K.current.cell,[pt,ri]=L.previousSelection.current.cell;Ze=W===ht&&W===pt&&q===xt&&q===ri&&(pe.isDoubleClick===!0||we==="second-click");break}case"single-click":{Ze=!0;break}}if(Ze)return M?.([W-U,q]),Zr(pe.bounds,!1),!0}return!1},le=w.location[0]-U;if(w.isTouch){const pe=sn.current,wt=Sl.current;if(pe.x!==wt.x||pe.y!==wt.y)return;if(w.isLongTouch===!0){if(w.kind==="cell"&&Zi(K.current?.cell,w.location)){G?.([le,w.location[1]],{...w,preventDefault:B});return}else if(w.kind==="header"&&K.columns.hasIndex(W)){ie?.(le,{...w,preventDefault:B});return}else if(w.kind===An){if(le<0)return;Q?.(le,{...w,preventDefault:B});return}}w.kind==="cell"?Z(w)||Ei(w):w.kind===An?N?.(le,{...w,preventDefault:B}):(w.kind===Cr&&C?.(le,{...w,preventDefault:B}),Ei(w));return}if(w.kind==="header"){if(le<0)return;w.isEdge?w.isDoubleClick===!0&&Ro(W):w.button===0&&W===Y&&q===V&&C?.(le,{...w,preventDefault:B})}if(w.kind===An){if(le<0)return;w.button===0&&W===Y&&q===V&&(N?.(le,{...w,preventDefault:B}),ei.current||xl(w))}w.kind==="cell"&&(w.button===0||w.button===1)&&Z(w),Fr.current=void 0},[l,K,U,Pr,ti,ae,O,En,en,we,Ii,Fn,M,Zr,G,ie,Q,Ei,N,C,Ro,xl]),$f=f.useCallback(w=>{const A={...w,location:[w.location[0]-U,w.location[1]]};st?.(A),l!==void 0&&w.buttons===0&&(u(void 0),Oa(void 0),za(void 0),Ti.current=!1),za(L=>Ti.current?[w.scrollEdge[0],0]:w.scrollEdge[0]===L?.[0]&&w.scrollEdge[1]===L[1]?L:l===void 0||(jn.current?.location[0]??0)<U?void 0:w.scrollEdge)},[l,st,U]),Nf=f.useCallback((w,A)=>{mt?.(w-U,A)},[mt,U]),Bf=f.useCallback((w,A)=>{ft?.(w-U,A)},[ft,U]),ni=K?.current?.cell,Wf=f.useCallback((w,A,L,W,q,Y)=>{Yn.current=!1;let V=ni;V!==void 0&&(V=[V[0]-U,V[1]]);const B=He===0?void 0:{x:0,y:w.y,width:He,height:w.height},Z=[];B!==void 0&&Z.push(B),De>0&&(Z.push({x:w.x-U,y:_e-De,width:w.width,height:De}),He>0&&Z.push({x:0,y:_e-De,width:He,height:De}));const le={x:w.x-U,y:w.y,width:w.width,height:Lt&&w.y+w.height>=_e?w.height-1:w.height,tx:q,ty:Y,extras:{selected:V,freezeRegion:B,freezeRegions:Z}};sn.current=le,vl(le),Wt([A,L,W]),qt?.(le,le.tx,le.ty,le.extras)},[ni,U,Lt,_e,He,De,vl,qt]),Uf=yr(E,f.useCallback((w,A)=>E?.(w-U,A-U)!==!1,[E,U])),qf=yr(Ee,f.useCallback((w,A)=>{Ee?.(w-U,A-U),ne!=="none"&&tt(it.fromSingleSelection(A),void 0,!0)},[ne,Ee,U,tt])),Va=f.useRef(!1),Gf=f.useCallback(w=>{if(w.location[0]===0&&U>0){w.preventDefault();return}Te?.({...w,location:[w.location[0]-U,w.location[1]]}),w.defaultPrevented()||(Va.current=!0),u(void 0)},[Te,U]),Xf=f.useCallback(()=>{Va.current=!1},[]),Rl=yt?.selectionBehavior,Io=f.useCallback(w=>{if(Rl!=="block-spanning")return;const{isGroupHeader:A,path:L,groupRows:W}=_r(w);if(A)return[w,w];const q=L[L.length-1],Y=w-q,V=w+W-q-1;return[Y,V]},[_r,Rl]),$a=f.useRef(),Na=f.useCallback(w=>{if(!Fd(w,$a.current)&&($a.current=w,!(jn?.current?.button!==void 0&&jn.current.button>=1))){if(w.buttons!==0&&l!==void 0&&jn.current?.location[0]===0&&w.location[0]===0&&U===1&&me==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(jn.current.location[1])&&K.rows.hasIndex(jn.current.location[1])){const A=Math.min(jn.current.location[1],w.location[1]),L=Math.max(jn.current.location[1],w.location[1])+1;Tt(it.fromSingleSelection([A,L]),void 0,!1)}if(w.buttons!==0&&l!==void 0&&K.current!==void 0&&!Va.current&&!Ti.current&&(Ne==="rect"||Ne==="multi-rect")){const[A,L]=K.current.cell;let[W,q]=w.location;if(q<0&&(q=sn.current.y),l.fillHandle===!0&&l.previousSelection?.current!==void 0){const Y=l.previousSelection.current.range;q=Math.min(q,Lt?_e-1:_e);const V=Bp(Y,W,q,Et);Oa(V)}else{if(Lt&&L===_e)return;if(Lt&&q===_e)if(w.kind===sa)q--;else return;W=Math.max(W,U);const B=Io(L);q=B===void 0?q:Ln(q,B[0],B[1]);const Z=W-A,le=q-L,pe={x:Z>=0?A:W,y:le>=0?L:q,width:Math.abs(Z)+1,height:Math.abs(le)+1};dt({...K.current,range:pe},!0,!1,"drag")}}Ht?.({...w,location:[w.location[0]-U,w.location[1]]})}},[l,U,me,K,Ne,Ht,Tt,Lt,_e,Et,Io,dt]),Yf=f.useCallback(()=>{const w=$a.current;if(w===void 0)return;const[A,L]=w.scrollEdge;let[W,q]=w.location;const Y=sn.current;A===-1?W=Y.extras?.freezeRegion?.x??Y.x:A===1&&(W=Y.x+Y.width),L===-1?q=Math.max(0,Y.y):L===1&&(q=Math.min(_e-1,Y.y+Y.height)),W=Ln(W,0,nt.length-1),q=Ln(q,0,_e-1),Na({...w,location:[W,q]})},[nt.length,Na,_e]);Z0(zf,Ut,Yf);const $n=f.useCallback(w=>{if(K.current===void 0)return;const[A,L]=w,[W,q]=K.current.cell,Y=K.current.range;let V=Y.x,B=Y.x+Y.width,Z=Y.y,le=Y.y+Y.height;const[pe,wt]=Io(q)??[0,_e-1],rt=wt+1;if(L!==0)switch(L){case 2:{le=rt,Z=q,Gt(0,le,"vertical");break}case-2:{Z=pe,le=q+1,Gt(0,Z,"vertical");break}case 1:{Z<q?(Z++,Gt(0,Z,"vertical")):(le=Math.min(rt,le+1),Gt(0,le,"vertical"));break}case-1:{le>q+1?(le--,Gt(0,le,"vertical")):(Z=Math.max(pe,Z-1),Gt(0,Z,"vertical"));break}default:to()}if(A!==0)if(A===2)B=nt.length,V=W,Gt(B-1-U,0,"horizontal");else if(A===-2)V=U,B=W+1,Gt(V-U,0,"horizontal");else{let Ke=[];if(z!==void 0){const Ze=z({x:V,y:Z,width:B-V-U,height:le-Z},kn.current.signal);typeof Ze=="object"&&(Ke=sv(Ze))}if(A===1){let Ze=!1;if(V<W){if(Ke.length>0){const ht=xr(V+1,W+1).find(xt=>!Ke.includes(xt-U));ht!==void 0&&(V=ht,Ze=!0)}else V++,Ze=!0;Ze&&Gt(V,0,"horizontal")}Ze||(B=Math.min(nt.length,B+1),Gt(B-1-U,0,"horizontal"))}else if(A===-1){let Ze=!1;if(B>W+1){if(Ke.length>0){const ht=xr(B-1,W,-1).find(xt=>!Ke.includes(xt-U));ht!==void 0&&(B=ht,Ze=!0)}else B--,Ze=!0;Ze&&Gt(B-U,0,"horizontal")}Ze||(V=Math.max(U,V-1),Gt(V-U,0,"horizontal"))}else to()}dt({cell:K.current.cell,range:{x:V,y:Z,width:B-V,height:le-Z}},!0,!1,"keyboard-select")},[z,Io,K,nt.length,U,_e,Gt,dt]),Ba=f.useRef(wi);Ba.current=wi;const vr=f.useCallback((w,A,L,W)=>{const q=hn-(L?0:1);w=Ln(w,U,an.length-1+U),A=Ln(A,0,q);const Y=ni?.[0],V=ni?.[1];if(w===Y&&A===V)return!1;if(W&&K.current!==void 0){const B=[...K.current.rangeStack];(K.current.range.width>1||K.current.range.height>1)&&B.push(K.current.range),ae({...K,current:{cell:[w,A],range:{x:w,y:A,width:1,height:1},rangeStack:B}},!0)}else dt({cell:[w,A],range:{x:w,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===w&&c.current[1]===A&&(c.current=void 0),Ba.current&&Gt(w-U,A),!0},[hn,U,an.length,ni,K,Gt,ae,dt]),jf=f.useCallback((w,A)=>{i?.cell!==void 0&&w!==void 0&&ui(w)&&(Fn([{location:i.cell,value:w}]),window.requestAnimationFrame(()=>{fn.current?.damage([{cell:i.cell}])})),pn(!0),o(void 0);const[L,W]=A;if(K.current!==void 0&&(L!==0||W!==0)){const q=K.current.cell[1]===hn-1&&w!==void 0,Y=K.current.cell[0]===nt.length-1&&w!==void 0;let V=!0;if(q&&W===1&&Se!==void 0){V=!1;const B=K.current.cell[0]+L,Z=Jr(B);mr(Z??B,!1)}if(Y&&L===1&&Qe!==void 0){V=!1;const B=K.current.cell[1]+W;Mo(B,!1)}V&&vr(Ln(K.current.cell[0]+L,0,nt.length-1),Ln(K.current.cell[1]+W,0,hn-1),q,!1)}_?.(w,A)},[i?.cell,pn,K,_,Fn,hn,vr,nt.length,mr,Mo,Se,Qe,Jr]),Kf=f.useMemo(()=>`gdg-overlay-${av++}`,[]),Lr=f.useCallback(w=>{pn();const A=[];for(let L=w.x;L<w.x+w.width;L++)for(let W=w.y;W<w.y+w.height;W++){const q=S([L-U,W]);if(!q.allowOverlay&&q.kind!==J.Boolean)continue;let Y;if(q.kind===J.Custom){const V=en(q),B=V?.provideEditor?.({...q,location:[L-U,W]});V?.onDelete!==void 0?Y=V.onDelete(q):Fg(B)&&(Y=B?.deletedValue?.(q))}else(ui(q)&&q.allowOverlay||q.kind===J.Boolean)&&(Y=en(q)?.onDelete?.(q));Y!==void 0&&!fi(Y)&&ui(Y)&&A.push({location:[L,W],value:Y})}Fn(A),fn.current?.damage(A.map(L=>({cell:L.location})))},[pn,S,en,Fn,U]),Di=i!==void 0,Il=f.useCallback(w=>{const A=()=>{w.stopPropagation(),w.preventDefault()},L={didMatch:!1},{bounds:W}=w,q=K.columns,Y=K.rows,V=Xn;if(!Di&&ot(V.clear,w,L))ae(No,!1),Mt?.();else if(!Di&&ot(V.selectAll,w,L))ae({columns:it.empty(),rows:it.empty(),current:{cell:K.current?.cell??[U,0],range:{x:U,y:0,width:b.length,height:_e},rangeStack:[]}},!1);else if(ot(V.search,w,L))s?.current?.focus({preventScroll:!0}),wo(!0);else if(ot(V.delete,w,L)){const ht=Zt?.(K)??!0;if(ht!==!1){const xt=ht===!0?K:ht;if(xt.current!==void 0){Lr(xt.current.range);for(const pt of xt.current.rangeStack)Lr(pt)}for(const pt of xt.rows)Lr({x:U,y:pt,width:b.length,height:1});for(const pt of xt.columns)Lr({x:pt,y:0,width:1,height:_e})}}if(L.didMatch)return A(),!0;if(K.current===void 0)return!1;let[B,Z]=K.current.cell;const[,le]=K.current.cell;let pe=!1,wt=!1;if(ot(V.scrollToSelectedCell,w,L)?Do.current(B-U,Z):ne!=="none"&&ot(V.selectColumn,w,L)?q.hasIndex(B)?tt(q.remove(B),void 0,!0):ne==="single"?tt(it.fromSingleSelection(B),void 0,!0):tt(void 0,B,!0):me!=="none"&&ot(V.selectRow,w,L)?Y.hasIndex(Z)?Tt(Y.remove(Z),void 0,!0):me==="single"?Tt(it.fromSingleSelection(Z),void 0,!0):Tt(void 0,Z,!0):!Di&&W!==void 0&&ot(V.activateCell,w,L)?Z===_e&&Lt?window.setTimeout(()=>{const ht=Jr(B);mr(ht??B)},0):(M?.([B-U,Z]),Zr(W,!0)):K.current.range.height>1&&ot(V.downFill,w,L)?Ml():K.current.range.width>1&&ot(V.rightFill,w,L)?kl():ot(V.goToNextPage,w,L)?Z+=Math.max(1,sn.current.height-4):ot(V.goToPreviousPage,w,L)?Z-=Math.max(1,sn.current.height-4):ot(V.goToFirstCell,w,L)?(o(void 0),Z=0,B=0):ot(V.goToLastCell,w,L)?(o(void 0),Z=Number.MAX_SAFE_INTEGER,B=Number.MAX_SAFE_INTEGER):ot(V.selectToFirstCell,w,L)?(o(void 0),$n([-2,-2])):ot(V.selectToLastCell,w,L)?(o(void 0),$n([2,2])):Di?(ot(V.closeOverlay,w,L)&&o(void 0),ot(V.acceptOverlayDown,w,L)&&(o(void 0),Z++),ot(V.acceptOverlayUp,w,L)&&(o(void 0),Z--),ot(V.acceptOverlayLeft,w,L)&&(o(void 0),B--),ot(V.acceptOverlayRight,w,L)&&(o(void 0),B++)):(ot(V.goDownCell,w,L)?Z+=1:ot(V.goUpCell,w,L)?Z-=1:ot(V.goRightCell,w,L)?B+=1:ot(V.goLeftCell,w,L)?B-=1:ot(V.goDownCellRetainSelection,w,L)?(Z+=1,pe=!0):ot(V.goUpCellRetainSelection,w,L)?(Z-=1,pe=!0):ot(V.goRightCellRetainSelection,w,L)?(B+=1,pe=!0):ot(V.goLeftCellRetainSelection,w,L)?(B-=1,pe=!0):ot(V.goToLastRow,w,L)?Z=_e-1:ot(V.goToFirstRow,w,L)?Z=Number.MIN_SAFE_INTEGER:ot(V.goToLastColumn,w,L)?B=Number.MAX_SAFE_INTEGER:ot(V.goToFirstColumn,w,L)?B=Number.MIN_SAFE_INTEGER:(Ne==="rect"||Ne==="multi-rect")&&(ot(V.selectGrowDown,w,L)?$n([0,1]):ot(V.selectGrowUp,w,L)?$n([0,-1]):ot(V.selectGrowRight,w,L)?$n([1,0]):ot(V.selectGrowLeft,w,L)?$n([-1,0]):ot(V.selectToLastRow,w,L)?$n([0,2]):ot(V.selectToFirstRow,w,L)?$n([0,-2]):ot(V.selectToLastColumn,w,L)?$n([2,0]):ot(V.selectToFirstColumn,w,L)&&$n([-2,0])),wt=L.didMatch),Vn!==void 0&&Vn!=="normal"&&Z!==le){const ht=Vn==="skip-up"||Vn==="skip"||Vn==="block",xt=Vn==="skip-down"||Vn==="skip"||Vn==="block",pt=Z<le;if(pt&&ht){for(;Z>=0&&_r(Z).isGroupHeader;)Z--;Z<0&&(Z=le)}else if(!pt&&xt){for(;Z<_e&&_r(Z).isGroupHeader;)Z++;Z>=_e&&(Z=le)}}const Ke=vr(B,Z,!1,pe),Ze=L.didMatch;return Ze&&(Ke||!wt||Nt)&&A(),Ze},[Vn,Di,K,Xn,ne,me,Ne,U,_r,_e,vr,ae,Mt,b.length,Zt,Nt,Lr,tt,Tt,Lt,Jr,mr,M,Zr,Ml,kl,$n]),Oi=f.useCallback(w=>{let A=!1;if(X!==void 0&&X({...w,...w.location&&{location:[w.location[0]-U,w.location[1]]},cancel:()=>{A=!0}}),A||Il(w)||K.current===void 0)return;const[L,W]=K.current.cell,q=sn.current;if(ke&&!w.metaKey&&!w.ctrlKey&&K.current!==void 0&&w.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(w.key)&&w.bounds!==void 0&&ci(S([L-U,Math.max(0,Math.min(W,_e-1))]))){if((!Lt||W!==_e)&&(q.y>W||W>q.y+q.height||q.x>L||L>q.x+q.width))return;M?.([L-U,W]),Zr(w.bounds,!0,w.key),w.stopPropagation(),w.preventDefault()}},[ke,X,Il,K,S,U,_e,Lt,M,Zr]),Zf=f.useCallback((w,A)=>{const L=w.location[0]-U;if(w.kind==="header"&&ie?.(L,{...w,preventDefault:A}),w.kind===An){if(L<0)return;Q?.(L,{...w,preventDefault:A})}if(w.kind==="cell"){const[W,q]=w.location;G?.([L,q],{...w,preventDefault:A}),Hm(K,w.location)||vr(W,q,!1,!1)}},[K,G,Q,ie,U,vr]),Wa=f.useCallback(async w=>{if(!Xn.paste)return;function A(V,B,Z,le){const pe=typeof Z=="object"?Z?.join(`
|
173
|
+
`)??"":Z?.toString()??"";if(!fi(V)&&ci(V)&&V.readonly!==!0){const wt=I?.(pe,V);if(wt!==void 0&&ui(wt))return{location:B,value:wt};const rt=en(V);if(rt===void 0)return;if(rt.kind===J.Custom){Dn(V.kind===J.Custom);const Ke=rt.onPaste?.(pe,V.data);return Ke===void 0?void 0:{location:B,value:{...V,data:Ke}}}else{const Ke=rt.onPaste?.(pe,V,{formatted:le,formattedString:typeof le=="string"?le:le?.join(`
|
174
|
+
`),rawValue:Z});return Ke===void 0?void 0:(Dn(Ke.kind===V.kind),{location:B,value:Ke})}}}const L=K.columns,W=K.rows,q=Ut.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0;let Y;if(K.current!==void 0?Y=[K.current.range.x,K.current.range.y]:L.length===1?Y=[L.first()??0,0]:W.length===1&&(Y=[U,W.first()??0]),q&&Y!==void 0){let V,B;const Z="text/plain",le="text/html";if(navigator.clipboard.read!==void 0){const Ke=await navigator.clipboard.read();for(const Ze of Ke){if(Ze.types.includes(le)){const xt=await(await Ze.getType(le)).text(),pt=Ou(xt);if(pt!==void 0){V=pt;break}}Ze.types.includes(Z)&&(B=await(await Ze.getType(Z)).text())}}else if(navigator.clipboard.readText!==void 0)B=await navigator.clipboard.readText();else if(w!==void 0&&w?.clipboardData!==null){if(w.clipboardData.types.includes(le)){const Ke=w.clipboardData.getData(le);V=Ou(Ke)}V===void 0&&w.clipboardData.types.includes(Z)&&(B=w.clipboardData.getData(Z))}else return;const[pe,wt]=Y,rt=[];do{if(Re===void 0){const Ke=En(Y),Ze=B??V?.map(xt=>xt.map(pt=>pt.rawValue).join(" ")).join(" ")??"",ht=A(Ke,Y,Ze,void 0);ht!==void 0&&rt.push(ht);break}if(V===void 0){if(B===void 0)return;V=U0(B)}if(Re===!1||typeof Re=="function"&&Re?.([Y[0]-U,Y[1]],V.map(Ke=>Ke.map(Ze=>Ze.rawValue?.toString()??"")))!==!0)return;for(const[Ke,Ze]of V.entries()){if(Ke+wt>=_e)break;for(const[ht,xt]of Ze.entries()){const pt=[ht+pe,Ke+wt],[ri,_i]=pt;if(ri>=nt.length||_i>=hn)continue;const Fi=En(pt),Kn=A(Fi,pt,xt.rawValue,xt.formatted);Kn!==void 0&&rt.push(Kn)}}}while(!1);Fn(rt),fn.current?.damage(rt.map(Ke=>({cell:Ke.location})))}},[I,en,En,K,Xn.paste,Ut,nt.length,Fn,hn,Re,U,_e]);bn("paste",Wa,d,!1,!0);const Pi=f.useCallback(async(w,A)=>{if(!Xn.copy)return;const L=A===!0||Ut.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0,W=K.columns,q=K.rows,Y=(V,B)=>{if(!Ge)_u(V,B,w);else{const Z=B.map(le=>({kind:J.Text,data:b[le].title,displayData:b[le].title,allowOverlay:!1}));_u([Z,...V],B,w)}};if(L&&z!==void 0){if(K.current!==void 0){let V=z(K.current.range,kn.current.signal);typeof V!="object"&&(V=await V()),Y(V,xr(K.current.range.x-U,K.current.range.x+K.current.range.width-U))}else if(q!==void 0&&q.length>0){const B=[...q].map(Z=>{const le=z({x:U,y:Z,width:b.length,height:1},kn.current.signal);return typeof le=="object"?le[0]:le().then(pe=>pe[0])});if(B.some(Z=>Z instanceof Promise)){const Z=await Promise.all(B);Y(Z,xr(b.length))}else Y(B,xr(b.length))}else if(W.length>0){const V=[],B=[];for(const Z of W){let le=z({x:Z,y:0,width:1,height:_e},kn.current.signal);typeof le!="object"&&(le=await le()),V.push(le),B.push(Z-U)}if(V.length===1)Y(V[0],B);else{const Z=V.reduce((le,pe)=>le.map((wt,rt)=>[...wt,...pe[rt]]));Y(Z,B)}}}},[b,z,K,Xn.copy,U,Ut,_e,Ge]);bn("copy",Pi,d,!1,!1);const Jf=f.useCallback(async w=>{if(!(!Xn.cut||!(Ut.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0))&&(await Pi(w),K.current!==void 0)){let L={current:{cell:K.current.cell,range:K.current.range,rangeStack:[]},rows:it.empty(),columns:it.empty()};const W=Zt?.(L);if(W===!1||(L=W===!0?L:W,L.current===void 0))return;Lr(L.current.range)}},[Lr,K,Xn.cut,Pi,Ut,Zt]);bn("cut",Jf,d,!1,!1);const Qf=f.useCallback((w,A)=>{if(fe!==void 0){U!==0&&(w=w.map(q=>[q[0]-U,q[1]])),fe(w,A);return}if(w.length===0||A===-1)return;const[L,W]=w[A];c.current!==void 0&&c.current[0]===L&&c.current[1]===W||(c.current=[L,W],vr(L,W,!1,!1))},[fe,U,vr]),[Eo,To]=cn?.current?.cell??[],Do=f.useRef(Gt);Do.current=Gt,f.useLayoutEffect(()=>{Ba.current&&!Yn.current&&Eo!==void 0&&To!==void 0&&(Eo!==Ie.current?.current?.cell[0]||To!==Ie.current?.current?.cell[1])&&Do.current(Eo,To),Yn.current=!1},[Eo,To]);const El=K.current!==void 0&&(K.current.cell[0]>=nt.length||K.current.cell[1]>=hn);f.useLayoutEffect(()=>{El&&ae(No,!1)},[El,ae]);const eh=f.useMemo(()=>Lt===!0&&Bt?.tint===!0?it.fromSingleSelection(hn-1):it.empty(),[hn,Lt,Bt?.tint]),th=f.useCallback(w=>typeof Yt=="boolean"?Yt:Yt?.(w-U)??!0,[U,Yt]),nh=f.useMemo(()=>{if(Aa===void 0||a.current===null)return null;const{bounds:w,group:A}=Aa,L=a.current.getBoundingClientRect();return f.createElement(_0,{bounds:w,group:A,canvasBounds:L,onClose:()=>Ha(void 0),onFinish:W=>{Ha(void 0),te?.(A,W)}})},[te,Aa]),rh=Math.min(nt.length,He+(_n?1:0));f.useImperativeHandle(t,()=>({appendRow:(w,A)=>mr(w+U,A),appendColumn:(w,A)=>Mo(w,A),updateCells:w=>(U!==0&&(w=w.map(A=>({cell:[A.cell[0]+U,A.cell[1]]}))),fn.current?.damage(w)),getBounds:(w,A)=>{if(!(a?.current===null||Ut?.current===null)){if(w===void 0&&A===void 0){const L=a.current.getBoundingClientRect(),W=L.width/Ut.current.clientWidth;return{x:L.x-Ut.current.scrollLeft*W,y:L.y-Ut.current.scrollTop*W,width:Ut.current.scrollWidth*W,height:Ut.current.scrollHeight*W}}return fn.current?.getBounds((w??0)+U,A)}},focus:()=>fn.current?.focus(),emit:async w=>{switch(w){case"delete":Oi({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!1,key:"Delete",keyCode:46,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-right":Oi({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"r",keyCode:82,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-down":Oi({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"d",keyCode:68,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"copy":await Pi(void 0,!0);break;case"paste":await Wa();break}},scrollTo:Gt,remeasureColumns:w=>{for(const A of w)Ro(A+U)},getMouseArgsForPosition:(w,A,L)=>{if(fn?.current===null)return;const W=fn.current.getMouseArgsForPosition(w,A,L);if(W!==void 0)return{...W,location:[W.location[0]-U,W.location[1]]}}}),[mr,Mo,Ro,Ut,Pi,Oi,Wa,U,Gt]);const[Tl,Dl]=ni??[],ih=f.useCallback(w=>{const[A,L]=w;if(L===-1){ne!=="none"&&(tt(it.fromSingleSelection(A),void 0,!1),pn());return}Tl===A&&Dl===L||(dt({cell:w,range:{x:A,y:L,width:1,height:1}},!0,!1,"keyboard-nav"),Gt(A,L))},[ne,pn,Gt,Tl,Dl,dt,tt]),[oh,ah]=f.useState(!1),Ol=f.useRef(Qc(w=>{ah(w)},5)),sh=f.useCallback(()=>{Ol.current(!0),K.current===void 0&&K.columns.length===0&&K.rows.length===0&&l===void 0&&dt({cell:[U,yo],range:{x:U,y:yo,width:1,height:1}},!0,!1,"keyboard-select")},[yo,K,l,U,dt]),lh=f.useCallback(()=>{Ol.current(!1)},[]),[uh,ch]=f.useMemo(()=>{let w;const A=vt?.scrollbarWidthOverride??xs(),L=_e+(Lt?1:0);if(typeof Gn=="number")w=Mn+L*Gn;else{let q=0;const Y=Math.min(L,10);for(let V=0;V<Y;V++)q+=Gn(V);q=Math.floor(q/Y),w=Mn+L*q}w+=A;const W=nt.reduce((q,Y)=>Y.width+q,0)+A;return[`${Math.min(1e5,W)}px`,`${Math.min(1e5,w)}px`]},[nt,vt?.scrollbarWidthOverride,Gn,_e,Lt,Mn]),dh=f.useMemo(()=>Zm(Je),[Je]);return f.createElement(Sd.Provider,{value:Je},f.createElement(Y0,{style:dh,className:j,inWidth:p??uh,inHeight:y??ch},f.createElement(T0,{fillHandle:Cn,drawFocusRing:yi,experimental:vt,fixedShadowX:Ft,fixedShadowY:Sn,getRowThemeOverride:dr,headerIcons:qn,imageWindowLoader:zn,initialSize:$,isDraggable:$e,onDragLeave:Ue,onRowMoved:St,overscrollX:ki,overscrollY:Ta,preventDiagonalScrolling:bt,rightElement:Qt,rightElementProps:It,smoothScrollX:on,smoothScrollY:ka,className:j,enableGroups:_t,onCanvasFocused:sh,onCanvasBlur:lh,canvasRef:a,onContextMenu:Zf,theme:Je,cellXOffset:Lf,cellYOffset:yo,accessibilityHeight:Or.height,onDragEnd:Xf,columns:nt,nonGrowWidth:hr,drawHeader:je,onColumnProposeMove:Uf,drawCell:ct,disabledRows:eh,freezeColumns:rh,lockColumns:U,firstColAccessible:U===0,getCellContent:En,minColumnWidth:nr,maxColumnWidth:jr,searchInputRef:s,showSearch:Kr,onSearchClose:Da,highlightRegions:Af,getCellsForSelection:z,getGroupDetails:Pa,headerHeight:xi,isFocused:oh,groupHeaderHeight:_t?vo:0,freezeTrailingRows:De+(Lt&&Bt?.sticky===!0?1:0),hasAppendRow:Lt,onColumnResize:ve,onColumnResizeEnd:Ye,onColumnResizeStart:ye,onCellFocused:ih,onColumnMoved:qf,onDragStart:Gf,onHeaderMenuClick:Nf,onHeaderIndicatorClick:Bf,onItemHovered:Na,isFilling:l?.fillHandle===!0,onMouseMove:$f,onKeyDown:Oi,onKeyUp:ce,onMouseDown:Hf,onMouseUp:Vf,onDragOverCell:dn,onDrop:Rn,onSearchResultsChanged:Qf,onVisibleRegionChanged:Wf,clientSize:zt,rowHeight:Gn,searchResults:re,searchValue:P,onSearchValueChange:H,rows:hn,scrollRef:Ut,selection:K,translateX:Or.tx,translateY:Or.ty,verticalBorder:th,gridRef:fn,getCellRenderer:en,resizeIndicator:go}),nh,i!==void 0&&f.createElement(f.Suspense,{fallback:null},f.createElement(ov,{...i,validateCell:Me,bloom:D,id:Kf,getCellRenderer:en,className:vt?.isSubGrid===!0?"click-outside-ignore":void 0,provideEditor:rn,imageEditorOverride:g,portalElementRef:pl,onFinishEditing:jf,markdownDivCreateNode:m,isOutsideClick:Ra,customEventTarget:vt?.eventTarget}))))},uv=f.forwardRef(lv);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 $s(t)&&p}const cv={getAccessibilityString:e=>e.data?.toString()??"false",kind:J.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>dv(e,e.cell.data,$s(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=Vs),n===t.data?void 0:{...t,data:n}}};function dv(e,t,n,r,i){if(!n&&t===ta)return;const{ctx:o,hoverAmount:s,theme:a,rect:l,highlighted:u,hoverX:c,hoverY:d,cell:{contentAlign:g}}=e,{x:h,y:m,width:p,height:y}=l;let b=!1;if(i>0){let v=n?1-i+i*s:.4;if(t===ta&&(v*=s),v===0)return;v<1&&(b=!0,o.globalAlpha=v)}Zs(o,a,t,h,m,p,y,u,c,d,r,g),b&&(o.globalAlpha=1)}const fv=un("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),hv=e=>{const{bubbles:t}=e;return f.createElement(fv,null,t.map((n,r)=>f.createElement("div",{key:r,className:"boe-bubble"},n)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},gv={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=>mv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(hv,{bubbles:t.data})},onPaste:()=>{}};function mv(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=Gr(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 pv=un("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),vv=e=>{const{drilldowns:t}=e;return f.createElement(pv,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))))},bv={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=>yv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(vv,{drilldowns:t.data})},onPaste:()=>{}},us={};function wv(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(us[g]!==void 0)return{el:us[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),us[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 yv(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=Xs(i,c),g=Math.min(n.height,Math.max(16,Math.ceil(d*r.lineHeight)*2)),h=Math.floor(n.y+(n.height-g)/2),m=g-10,p=r.bubblePadding,y=r.bubbleMargin;let b=l+r.cellHorizontalPadding;const v=r.roundingRadius??6,S=wv(r.bgCell,r.drilldownBorder,g,v),O=[];for(const M of t){if(b>l+u)break;const _=Gr(M.text,i,c).width;let I=0;M.img!==void 0&&o.loadOrGetImage(M.img,s,a)!==void 0&&(I=m-8+4);const k=_+I+p*2;O.push({x:b,width:k}),b+=k+y}if(S!==null){const{el:M,height:R,middleWidth:_,sideWidth:I,width:k,dpr:F,padding:D}=S,C=I/F,E=D/F;for(const T of O){const x=Math.floor(T.x),N=Math.floor(T.width),G=N-(C-E)*2;i.imageSmoothingEnabled=!1,i.drawImage(M,0,0,I,R,x-E,h,C,g),G>0&&i.drawImage(M,I,0,_,R,x+(C-E),h,G,g),i.drawImage(M,k-I,0,I,R,x+N-(C-E),h,C,g),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[M,R]of O.entries()){const _=t[M];let I=R.x+p;if(_.img!==void 0){const k=o.loadOrGetImage(_.img,s,a);if(k!==void 0){const F=m-8;let D=0,C=0,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-F/2,F,F,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(k,D,C,E,T,I,h+g/2-F/2,F,F),i.restore(),I+=F+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(_.text,I,h+g/2+Qn(i,r))}}const Cv={getAccessibilityString:e=>e.data.join(", "),kind:J.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>Sv(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??sm;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}}},cs=4;function Sv(e,t,n,r){const{rect:i,col:o,row:s,theme:a,ctx:l,imageLoader:u}=e,{x:c,y:d,height:g,width:h}=i,m=g-a.cellVerticalPadding*2,p=[];let y=0;for(let v=0;v<t.length;v++){const S=t[v];if(S.length===0)continue;const O=u.loadOrGetImage(S,o,s);if(O!==void 0){p[v]=O;const M=O.width*(m/O.height);y+=M+cs}}if(y===0)return;y-=cs;let b=c+a.cellHorizontalPadding;r==="right"?b=Math.floor(c+h-a.cellHorizontalPadding-y):r==="center"&&(b=Math.floor(c+h/2-y/2));for(const v of p){if(v===void 0)continue;const S=v.width*(m/v.height);n>0&&(l.beginPath(),Jn(l,b,d+a.cellVerticalPadding,S,m,n),l.save(),l.clip()),l.drawImage(v,b,d+a.cellVerticalPadding,S,m),n>0&&l.restore(),b+=S+cs}}function xv(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const kv={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(xv(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=Nr(s.textDark,.1),i.fill()},onPaste:()=>{}},Mv=()=>e=>e.targetWidth,Hu=un("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[Mv(),"px"]}}),Rv=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(Ur,{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(em,null))):f.createElement(Hu,{targetWidth:o.width},f.createElement(Rm,{contents:l,createNode:i}),!u&&f.createElement(f.Fragment,null,f.createElement("div",{className:"spacer"}),f.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${h}`,onClick:g},f.createElement(Bs,null))),f.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Iv={getAccessibilityString:e=>e.data?.toString()??"",kind:J.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:uo,measure:(e,t,n)=>{const r=t.data.split(`
|
175
|
+
`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>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(Rv,{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}},Ev={getAccessibilityString:e=>e.row.toString(),kind:Hn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Tv,measure:()=>44,draw:e=>Ov(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 Tv(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=Dv,n.textAlign="center",o}function Dv(e){const{ctx:t}=e;t.textAlign="start"}function Ov(e,t,n,r,i,o){const{ctx:s,rect:a,hoverAmount:l,theme:u}=e,{x:c,y:d,width:g,height:h}=a,m=n?1:r==="checkbox-visible"?.6+.4*l:l;if(r!=="number"&&m>0){s.globalAlpha=m;const p=7*(n?l:1);if(Zs(s,u,n,i?c+p:c,d,i?g-p:g,h,!0,void 0,void 0,u.checkboxMaxSize,"center",o),i){s.globalAlpha=l,s.beginPath();for(const y of[3,6])for(const b of[-5,-1,3])s.rect(c+y,d+h/2+b,2,2);s.fillStyle=u.textLight,s.fill(),s.beginPath()}s.globalAlpha=1}if(r==="number"||r==="both"&&!n){const p=t.toString(),y=u.markerFontFull,b=c+g/2;r==="both"&&l!==0&&(s.globalAlpha=1-l),s.fillStyle=u.textLight,s.font=y,s.fillText(p,b,d+h/2+Qn(s,y)),l!==0&&(s.globalAlpha=1)}}const Pv={getAccessibilityString:()=>"",kind:Hn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>_v(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function _v(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:s,spriteManager:a}=e,{x:l,y:u,width:c,height:d}=i;r.beginPath(),r.globalAlpha=o,r.rect(l+1,u+1,c,d-2),r.fillStyle=s.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let h=0;if(n!==void 0){const p=d-8,y=l+8/2,b=u+8/2;a.drawSprite(n,"normal",r,y,b,p,s,g?1:o),h=p}else{h=24;const m=12,p=g?m:o*m,y=g?0:(1-o)*m*.5,b=s.cellHorizontalPadding+4;p>0&&(r.moveTo(l+b+y,u+d/2),r.lineTo(l+b+y+p,u+d/2),r.moveTo(l+b+y+p*.5,u+d/2-p*.5),r.lineTo(l+b+y+p*.5,u+d/2+p*.5),r.lineWidth=2,r.strokeStyle=s.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=s.textMedium,r.fillText(t,h+l+s.cellHorizontalPadding+.5,u+d/2+Qn(r,s)),r.beginPath()}function Vd(e,t,n,r,i,o,s){e.textBaseline="alphabetic";const a=Fv(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??Nr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",s?.("text")}function Fv(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=Gr(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 Lv=f.lazy(async()=>await Hs(()=>import("./number-overlay-editor.h2wH-G_L.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)),Av={getAccessibilityString:e=>e.data?.toString()??"",kind:J.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:uo,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:i,rect:o,overrideCursor:s}=e,{hoverEffect:a,displayData:l,hoverEffectTheme:u}=n;a===!0&&t>0&&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(Lv,{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}}},Hv={getAccessibilityString:()=>"",measure:()=>108,kind:J.Protected,needsHover:!1,needsHoverPosition:!1,draw:zv,onPaste:()=>{}};function zv(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 Vv={getAccessibilityString:e=>e.data?.toString()??"",kind:J.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>uo(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(Ur,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},$v={getAccessibilityString:e=>e.data?.toString()??"",kind:J.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:uo,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:o,theme:s,overrideCursor:a}=e,{displayData:l,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:g}=t;c===!0&&n>0&&Vd(i,s,g,l,o,n,a),Zn(e,l,u,d,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
|
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(Ur,{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}},Nv=un("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Bv=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(Ur,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):f.createElement(Nv,null,f.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},s),!i&&f.createElement("div",{className:"gdg-edit-icon",onClick:u},f.createElement(Bs,null)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function $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 $r({x:l.x-4,y:l.y-4,width:l.width+8,height:l.height+8},r,i)}const Wv={getAccessibilityString:e=>e.data?.toString()??"",kind:J.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:uo,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:i,hoverY:o,rect:s,ctx:a}=e,l=t.displayData??t.data,u=t.hoverEffect===!0;if(r!==void 0&&u&&i!==void 0&&o!==void 0){const c=Gr(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 y=Qn(a,n.baseFontFull);r("pointer");const b=5,v=h-y;a.beginPath(),a.moveTo(s.x+g,Math.floor(s.y+v+p+b)+.5),a.lineTo(s.x+g+m,Math.floor(s.y+v+p+b)+.5),a.strokeStyle=n.linkColor,a.stroke(),a.save(),a.fillStyle=e.cellFillColor,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(Bv,{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}},Uv=[Ev,Pv,cv,gv,bv,Cv,kv,Iv,Av,Hv,Vv,$v,Wv];var ds,Vu;function qv(){if(Vu)return ds;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 ds=r,ds}var Gv=qv();const Xv=sr(Gv),fs=[];class Yv extends wd{imageLoaded=()=>{};loadedLocations=[];cache={};setCallback(t){this.imageLoaded=t}sendLoaded=Xv(()=>{this.imageLoaded(new Qi(this.loadedLocations)),this.loadedLocations=[]},20);clearOutOfWindow=()=>{const t=Object.keys(this.cache);for(const n of t){const r=this.cache[n];let i=!1;for(let o=0;o<r.cells.length;o++){const s=r.cells[o];if(this.isInWindow(s)){i=!0;break}}i?r.cells=r.cells.filter(this.isInWindow):(r.cancel(),delete this.cache[n])}};loadImage(t,n,r,i){let o=!1;const s=fs.pop()??new Image;let a=!1;const l={img:void 0,cells:[Wn(n,r)],url:t,cancel:()=>{a||(a=!0,fs.length<12?fs.unshift(s):o||(s.src=""))}},u=new Promise(c=>s.addEventListener("load",()=>c(null)));requestAnimationFrame(async()=>{try{s.src=t,await u,await s.decode();const c=this.cache[i];if(c!==void 0&&!a){c.img=s;for(const d of c.cells)this.loadedLocations.push(Ks(d));o=!0,this.sendLoaded()}}catch{l.cancel()}}),this.cache[i]=l}loadOrGetImage(t,n,r){const i=t,o=this.cache[i];if(o!==void 0){const s=Wn(n,r);return o.cells.includes(s)||o.cells.push(s),o.img}else this.loadImage(t,n,r,i)}}const jv=(e,t)=>{const n=f.useMemo(()=>({...Vp,...e.headerIcons}),[e.headerIcons]),r=f.useMemo(()=>e.renderers??Uv,[e.renderers]),i=f.useMemo(()=>e.imageWindowLoader??new Yv,[e.imageWindowLoader]);return f.createElement(uv,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:i})},Kv=f.forwardRef(jv);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}}const Nd=Un("div",{target:"e32gfpu0"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs})),Sr=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}}})),Zv=Un("div",{target:"e32gfpu2"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs})),Jv=Un("div",{target:"e32gfpu3"})(({theme:e})=>({display:"flex",alignItems:"center",padding:`${e.spacing.sm} ${e.spacing.sm}`,cursor:"default",gap:e.spacing.twoXS})),Qv=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"})),e1=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"})),t1=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"})),n1=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}})),Nu=[{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:"}],r1={number:Nu,progress:Nu,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 i1({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:i,onCloseMenu:o,children:s}){const a=Br(),{colors:l,fontSizes:u,radii:c,fontWeights:d}=a,g=r1[e]||[];return g.length===0?qe(Pc,{}):qe(ba,{triggerType:_c.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:qe(Nd,{role:"menu",children:g.map(h=>vn(Sr,{onClick:()=>{i(h.format),o()},role:"menuitem",children:[qe(Bn,{size:"base",margin:"0",color:"inherit",iconValue:h.icon}),h.label]},h.format))}),placement:pa.right,showArrow:!1,popoverMargin:2,overrides:{Body:{props:{"data-testid":"stDataFrameColumnFormattingMenu"},style:{borderTopLeftRadius:c.default,borderTopRightRadius:c.default,borderBottomLeftRadius:c.default,borderBottomRightRadius:c.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${a.sizes.borderWidth} solid ${a.colors.borderColor}`}},Inner:{style:{backgroundColor:va(a)?l.bgColor:l.secondaryBg,color:l.bodyText,fontSize:u.sm,fontWeight:d.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:s})}const o1=f.memo(i1),Bu=wa.getLogger("ColumnMenu");function a1({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:i,onCloseMenu:o,onSortColumn:s,onHideColumn:a,column:l,onChangeFormat:u,onAutosize:c}){const d=Br(),[g,h]=f.useState(!1),{colors:m,fontSizes:p,radii:y,fontWeights:b}=d;f.useEffect(()=>{function O(M){M.preventDefault()}return document.addEventListener("wheel",O,{passive:!1}),document.addEventListener("touchmove",O,{passive:!1}),()=>{document.removeEventListener("wheel",O),document.removeEventListener("touchmove",O)}},[]);const v=f.useCallback(()=>{o()},[o]),S=f.useCallback(()=>{navigator.clipboard?navigator.clipboard.writeText(l.title).catch(O=>{Bu.error("Failed to copy column name to clipboard:",O)}):Bu.error("Clipboard API not supported.")},[l.title]);return qe(ba,{autoFocus:!0,"aria-label":"Dataframe column menu",content:vn(Nd,{children:[vn(Jv,{children:[qe(Qv,{title:l.kind,children:qe(Bn,{iconValue:l.typeIcon||":material/notes:",size:"base",color:"inherit"})}),vn(e1,{title:l.title,children:[qe(t1,{children:l.title}),qe(n1,{onClick:S,title:"Copy column name","aria-label":"Copy column name",children:qe(Bn,{iconValue:":material/content_copy:",size:"sm",margin:"0",color:"inherit"})})]})]}),s&&vn(Pc,{children:[vn(Sr,{onClick:()=>{s("asc"),v()},role:"menuitem",children:[qe(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),vn(Sr,{onClick:()=>{s("desc"),v()},role:"menuitem",children:[qe(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_downward:"}),"Sort descending"]}),qe(Zv,{})]}),u&&qe(o1,{columnKind:l.kind,isOpen:g,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onChangeFormat:u,onCloseMenu:v,children:vn(Sr,{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),isActive:g,hasSubmenu:!0,children:[vn("div",{children:[qe(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/format_list_numbered:"}),"Format"]}),qe(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/chevron_right:"})]})}),c&&vn(Sr,{onClick:()=>{c(),v()},children:[qe(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&vn(Sr,{onClick:()=>{i(),v()},children:[qe(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&vn(Sr,{onClick:()=>{r(),v()},children:[qe(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep:"}),"Pin column"]}),a&&vn(Sr,{onClick:()=>{a(),v()},children:[qe(Bn,{size:"base",margin:"0",color:"inherit",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:pa.bottomRight,accessibilityType:Fc.menu,showArrow:!1,popoverMargin:ln("0.375rem"),onClickOutside:g?void 0:v,onEsc:v,overrides:{Body:{props:{"data-testid":"stDataFrameColumnMenu"},style:{paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{border:`${d.sizes.borderWidth} solid ${d.colors.borderColor}`,backgroundColor:va(d)?m.bgColor:m.secondaryBg,color:m.bodyText,fontSize:p.sm,fontWeight:b.normal,borderTopLeftRadius:y.default,borderTopRightRadius:y.default,borderBottomLeftRadius:y.default,borderBottomRightRadius:y.default,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:!0,children:qe("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const s1=f.memo(a1),l1="(index)",u1=({label:e,initialValue:t,onChange:n})=>{const r=Br();return qe(bg,{checked:t,onChange:i=>{n(i.target.checked)},"aria-label":e,checkmarkType:vg.default,labelPlacement:pg.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 ${li(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})},c1=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:i,children:o,isOpen:s,onClose:a})=>{const l=Br();return qe(ba,{triggerType:_c.click,placement:pa.bottomRight,autoFocus:!0,focusLock:!0,content:()=>qe("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 qe(u1,{label:!u.title&&u.isIndex?l1:u.title,initialValue:!(u.isHidden===!0||c),onChange:d=>{d?(i(u.id),c&&n(g=>[...g,u.id])):r(u.id)}},u.id)})}),isOpen:s,onClickOutside:a,onClick:()=>s?a():void 0,onEsc:a,ignoreBoundary:!1,overrides:{Body:{props:{"data-testid":"stDataFrameColumnVisibilityMenu"},style:{borderTopLeftRadius:l.radii.default,borderTopRightRadius:l.radii.default,borderBottomLeftRadius:l.radii.default,borderBottomRightRadius:l.radii.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${l.sizes.borderWidth} solid ${l.colors.borderColor}`}},Inner:{style:{backgroundColor:va(l)?l.colors.bgColor:l.colors.secondaryBg,color:l.colors.bodyText,fontSize:l.fontSizes.sm,fontWeight:l.fontWeights.normal,minWidth:l.sizes.minMenuWidth,maxWidth:`calc(${l.sizes.minMenuWidth} * 2)`,maxHeight:l.sizes.maxDropdownHeight,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:qe("div",{children:o})})},d1=f.memo(c1);var f1=xh();const h1=sr(f1);var Jo={exports:{}};/*! Moment Duration Format v2.2.2
|
177
177
|
* https://github.com/jsmreese/moment-duration-format
|
178
178
|
* Date: 2018-02-16
|
179
179
|
*
|
@@ -182,16 +182,16 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
|
|
182
182
|
*
|
183
183
|
* Copyright 2018 John Madhavan-Reese
|
184
184
|
* Released under the MIT license
|
185
|
-
*/var a1=Jo.exports,Bu;function s1(){return Bu||(Bu=1,function(e,t){(function(n,r){try{e.exports=r(Ch)}catch{e.exports=r}n&&(n.momentDurationFormatSetup=n.moment?r(n.moment):r)})(a1,function(n){var r=!1,i=!1,o=!1,s=!1,a="escape years months weeks days hours minutes seconds milliseconds general".split(" "),l=[{type:"seconds",targets:[{type:"minutes",value:60},{type:"hours",value:3600},{type:"days",value:86400},{type:"weeks",value:604800},{type:"months",value:2678400},{type:"years",value:31536e3}]},{type:"minutes",targets:[{type:"hours",value:60},{type:"days",value:1440},{type:"weeks",value:10080},{type:"months",value:44640},{type:"years",value:525600}]},{type:"hours",targets:[{type:"days",value:24},{type:"weeks",value:168},{type:"months",value:744},{type:"years",value:8760}]},{type:"days",targets:[{type:"weeks",value:7},{type:"months",value:31},{type:"years",value:365}]},{type:"months",targets:[{type:"years",value:12}]}];function u(H,P){return P.length>H.length?!1:H.indexOf(P)!==-1}function c(H){for(var P="";H;)P+="0",H-=1;return P}function d(H){for(var P=H.split("").reverse(),Y=0,ce=!0;ce&&Y<P.length;)Y?P[Y]==="9"?P[Y]="0":(P[Y]=(parseInt(P[Y],10)+1).toString(),ce=!1):(parseInt(P[Y],10)<5&&(ce=!1),P[Y]="0"),Y+=1;return ce&&P.push("1"),P.reverse().join("")}function g(H,P){var Y=_(x(P).sort(),function(he){return he+":"+P[he]}).join(","),ce=H+"+"+Y;return g.cache[ce]||(g.cache[ce]=Intl.NumberFormat(H,P)),g.cache[ce]}g.cache={};function h(H,P,Y){var ce=P.useToLocaleString,he=P.useGrouping,ke=he&&P.grouping.slice(),Se=P.maximumSignificantDigits,Je=P.minimumIntegerDigits||1,Ie=P.fractionDigits||0,Qe=P.groupingSeparator,kt=P.decimalSeparator;if(ce&&Y){var $e={minimumIntegerDigits:Je,useGrouping:he};if(Ie&&($e.maximumFractionDigits=Ie,$e.minimumFractionDigits=Ie),Se&&H>0&&($e.maximumSignificantDigits=Se),o){if(!s){var ne=T({},P);ne.useGrouping=!1,ne.decimalSeparator=".",H=parseFloat(h(H,ne),10)}return g(Y,$e).format(H)}else{if(!i){var ne=T({},P);ne.useGrouping=!1,ne.decimalSeparator=".",H=parseFloat(h(H,ne),10)}return H.toLocaleString(Y,$e)}}var me;Se?me=H.toPrecision(Se+1):me=H.toFixed(Ie+1);var xe,de,be,Pe=me.split("e");be=Pe[1]||"",Pe=Pe[0].split("."),de=Pe[1]||"",xe=Pe[0]||"";var Te=xe.length,st=de.length,Re=Te+st,qe=xe+de;(Se&&Re===Se+1||!Se&&st===Ie+1)&&(qe=d(qe),qe.length===Re+1&&(Te=Te+1),st&&(qe=qe.slice(0,-1)),xe=qe.slice(0,Te),de=qe.slice(Te)),Se&&(de=de.replace(/0*$/,""));var He=parseInt(be,10);He>0?de.length<=He?(de=de+c(He-de.length),xe=xe+de,de=""):(xe=xe+de.slice(0,He),de=de.slice(He)):He<0&&(de=c(Math.abs(He)-xe.length)+xe+de,xe="0"),Se||(de=de.slice(0,Ie),de.length<Ie&&(de=de+c(Ie-de.length)),xe.length<Je&&(xe=c(Je-xe.length)+xe));var we="";if(he){Pe=xe;for(var Be;Pe.length;)ke.length&&(Be=ke.shift()),we&&(we=Qe+we),we=Pe.slice(-Be)+we,Pe=Pe.slice(0,-Be)}else we=xe;return de&&(we=we+kt+de),we}function m(H,P){return H.label.length>P.label.length?-1:H.label.length<P.label.length?1:0}function p(H,P){var Y=[];return M(x(P),function(ce){if(ce.slice(0,15)==="_durationLabels"){var he=ce.slice(15).toLowerCase();M(x(P[ce]),function(ke){ke.slice(0,1)===H&&Y.push({type:he,key:ke,label:P[ce][ke]})})}}),Y}function y(H,P,Y){return P===1&&Y===null?H:H+H}var b={durationLabelsStandard:{S:"millisecond",SS:"milliseconds",s:"second",ss:"seconds",m:"minute",mm:"minutes",h:"hour",hh:"hours",d:"day",dd:"days",w:"week",ww:"weeks",M:"month",MM:"months",y:"year",yy:"years"},durationLabelsShort:{S:"msec",SS:"msecs",s:"sec",ss:"secs",m:"min",mm:"mins",h:"hr",hh:"hrs",d:"dy",dd:"dys",w:"wk",ww:"wks",M:"mo",MM:"mos",y:"yr",yy:"yrs"},durationTimeTemplates:{HMS:"h:mm:ss",HM:"h:mm",MS:"m:ss"},durationLabelTypes:[{type:"standard",string:"__"},{type:"short",string:"_"}],durationPluralKey:y};function v(H){return Object.prototype.toString.call(H)==="[object Array]"}function S(H){return Object.prototype.toString.call(H)==="[object Object]"}function O(H,P){for(var Y=H.length;Y-=1;)if(P(H[Y]))return H[Y]}function R(H,P){var Y=0,ce=H&&H.length||0,he;for(typeof P!="function"&&(he=P,P=function(ke){return ke===he});Y<ce;){if(P(H[Y]))return H[Y];Y+=1}}function M(H,P){var Y=0,ce=H.length;if(!(!H||!ce))for(;Y<ce;){if(P(H[Y],Y)===!1)return;Y+=1}}function _(H,P){var Y=0,ce=H.length,he=[];if(!H||!ce)return he;for(;Y<ce;)he[Y]=P(H[Y],Y),Y+=1;return he}function E(H,P){return _(H,function(Y){return Y[P]})}function k(H){var P=[];return M(H,function(Y){Y&&P.push(Y)}),P}function F(H){var P=[];return M(H,function(Y){R(P,Y)||P.push(Y)}),P}function D(H,P){var Y=[];return M(H,function(ce){M(P,function(he){ce===he&&Y.push(ce)})}),F(Y)}function C(H,P){var Y=[];return M(H,function(ce,he){if(!P(ce))return Y=H.slice(he),!1}),Y}function I(H,P){var Y=H.slice().reverse();return C(Y,P).reverse()}function T(H,P){for(var Y in P)P.hasOwnProperty(Y)&&(H[Y]=P[Y]);return H}function x(H){var P=[];for(var Y in H)H.hasOwnProperty(Y)&&P.push(Y);return P}function $(H,P){var Y=0,ce=H.length;if(!H||!ce)return!1;for(;Y<ce;){if(P(H[Y],Y)===!0)return!0;Y+=1}return!1}function G(H){var P=[];return M(H,function(Y){P=P.concat(Y)}),P}function X(){var H=0;try{H.toLocaleString("i")}catch(P){return P.name==="RangeError"}return!1}function ie(H){return H(3.55,"en",{useGrouping:!1,minimumIntegerDigits:1,minimumFractionDigits:1,maximumFractionDigits:1})==="3.6"}function ee(H){var P=!0;return P=P&&H(1,"en",{minimumIntegerDigits:1})==="1",P=P&&H(1,"en",{minimumIntegerDigits:2})==="01",P=P&&H(1,"en",{minimumIntegerDigits:3})==="001",!(!P||(P=P&&H(99.99,"en",{maximumFractionDigits:0,minimumFractionDigits:0})==="100",P=P&&H(99.99,"en",{maximumFractionDigits:1,minimumFractionDigits:1})==="100.0",P=P&&H(99.99,"en",{maximumFractionDigits:2,minimumFractionDigits:2})==="99.99",P=P&&H(99.99,"en",{maximumFractionDigits:3,minimumFractionDigits:3})==="99.990",!P)||(P=P&&H(99.99,"en",{maximumSignificantDigits:1})==="100",P=P&&H(99.99,"en",{maximumSignificantDigits:2})==="100",P=P&&H(99.99,"en",{maximumSignificantDigits:3})==="100",P=P&&H(99.99,"en",{maximumSignificantDigits:4})==="99.99",P=P&&H(99.99,"en",{maximumSignificantDigits:5})==="99.99",!P)||(P=P&&H(1e3,"en",{useGrouping:!0})==="1,000",P=P&&H(1e3,"en",{useGrouping:!1})==="1000",!P))}function Q(){var H=[].slice.call(arguments),P={},Y;if(M(H,function(Se,Je){if(!Je){if(!v(Se))throw"Expected array as the first argument to durationsFormat.";Y=Se}if(typeof Se=="string"||typeof Se=="function"){P.template=Se;return}if(typeof Se=="number"){P.precision=Se;return}S(Se)&&T(P,Se)}),!Y||!Y.length)return[];P.returnMomentTypes=!0;var ce=_(Y,function(Se){return Se.format(P)}),he=D(a,F(E(G(ce),"type"))),ke=P.largest;return ke&&(he=he.slice(0,ke)),P.returnMomentTypes=!1,P.outputTypes=he,_(Y,function(Se){return Se.format(P)})}function te(){var H=[].slice.call(arguments),P=T({},this.format.defaults),Y=this.asMilliseconds(),ce=this.asMonths();typeof this.isValid=="function"&&this.isValid()===!1&&(Y=0,ce=0);var he=Y<0,ke=n.duration(Math.abs(Y),"milliseconds"),Se=n.duration(Math.abs(ce),"months");M(H,function(N){if(typeof N=="string"||typeof N=="function"){P.template=N;return}if(typeof N=="number"){P.precision=N;return}S(N)&&T(P,N)});var Je={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},Ie={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};P.types=a;var Qe=function(N){return R(a,function(Ne){return Ie[Ne].test(N)})},kt=new RegExp(_(a,function(N){return Ie[N].source}).join("|"),"g");P.duration=this;var $e=typeof P.template=="function"?P.template.apply(P):P.template,ne=P.outputTypes,me=P.returnMomentTypes,xe=P.largest,de=[];ne||(v(P.stopTrim)&&(P.stopTrim=P.stopTrim.join("")),P.stopTrim&&M(P.stopTrim.match(kt),function(N){var Ne=Qe(N);Ne==="escape"||Ne==="general"||de.push(Ne)}));var be=n.localeData();be||(be={}),M(x(b),function(N){if(typeof b[N]=="function"){be[N]||(be[N]=b[N]);return}be["_"+N]||(be["_"+N]=b[N])}),M(x(be._durationTimeTemplates),function(N){$e=$e.replace("_"+N+"_",be._durationTimeTemplates[N])});var Pe=P.userLocale||n.locale(),Te=P.useLeftUnits,st=P.usePlural,Re=P.precision,qe=P.forceLength,He=P.useGrouping,we=P.trunc,Be=P.useSignificantDigits&&Re>0,mt=Be?P.precision:0,ft=mt,Ge=P.minValue,yt=!1,Yt=P.maxValue,Ht=!1,Mt=P.useToLocaleString,nn=P.groupingSeparator,qt=P.decimalSeparator,cn=P.grouping;Mt=Mt&&(r||o);var Ot=P.trim;v(Ot)&&(Ot=Ot.join(" ")),Ot===null&&(xe||Yt||Be)&&(Ot="all"),(Ot===null||Ot===!0||Ot==="left"||Ot==="right")&&(Ot="large"),Ot===!1&&(Ot="");var ut=function(N){return N.test(Ot)},tn=/large/,Ct=/small/,rn=/both/,Bt=/mid/,De=/^all|[^sm]all/,It=/final/,Pt=xe>0||$([tn,rn,De],ut),wn=$([Ct,rn,De],ut),jt=$([Bt,De],ut),dn=$([It,De],ut),Mn=_($e.match(kt),function(N,Ne){var Ue=Qe(N);return N.slice(0,1)==="*"&&(N=N.slice(1),Ue!=="escape"&&Ue!=="general"&&de.push(Ue)),{index:Ne,length:N.length,text:"",token:Ue==="escape"?N.replace(Ie.escape,"$1"):N,type:Ue==="escape"||Ue==="general"?null:Ue}}),Xt={index:0,length:0,token:"",text:"",type:null},Jt=[];Te&&Mn.reverse(),M(Mn,function(N){if(N.type){(Xt.type||Xt.text)&&Jt.push(Xt),Xt=N;return}Te?Xt.text=N.token+Xt.text:Xt.text+=N.token}),(Xt.type||Xt.text)&&Jt.push(Xt),Te&&Jt.reverse();var We=D(a,F(k(E(Jt,"type"))));if(!We.length)return E(Jt,"text").join("");We=_(We,function(N,Ne){var Ue=Ne+1===We.length,St=!Ne,mn;N==="years"||N==="months"?mn=Se.as(N):mn=ke.as(N);var ge=Math.floor(mn),bt=mn-ge,Qt=R(Jt,function(Et){return N===Et.type});return St&&Yt&&mn>Yt&&(Ht=!0),Ue&&Ge&&Math.abs(P.duration.as(N))<Ge&&(yt=!0),St&&qe===null&&Qt.length>1&&(qe=!0),ke.subtract(ge,N),Se.subtract(ge,N),{rawValue:mn,wholeValue:ge,decimalValue:Ue?bt:0,isSmallest:Ue,isLargest:St,type:N,tokenLength:Qt.length}});var Rt=we?Math.floor:Math.round,yn=function(N,Ne){var Ue=Math.pow(10,Ne);return Rt(N*Ue)/Ue},vt=!1,Ft=!1,Cn=function(N,Ne){var Ue={useGrouping:He,groupingSeparator:nn,decimalSeparator:qt,grouping:cn,useToLocaleString:Mt};return Be&&(mt<=0?(N.rawValue=0,N.wholeValue=0,N.decimalValue=0):(Ue.maximumSignificantDigits=mt,N.significantDigits=mt)),Ht&&!Ft&&(N.isLargest?(N.wholeValue=Yt,N.decimalValue=0):(N.wholeValue=0,N.decimalValue=0)),yt&&!Ft&&(N.isSmallest?(N.wholeValue=Ge,N.decimalValue=0):(N.wholeValue=0,N.decimalValue=0)),N.isSmallest||N.significantDigits&&N.significantDigits-N.wholeValue.toString().length<=0?Re<0?N.value=yn(N.wholeValue,Re):Re===0?N.value=Rt(N.wholeValue+N.decimalValue):Be?(we?N.value=yn(N.rawValue,mt-N.wholeValue.toString().length):N.value=N.rawValue,N.wholeValue&&(mt-=N.wholeValue.toString().length)):(Ue.fractionDigits=Re,we?N.value=N.wholeValue+yn(N.decimalValue,Re):N.value=N.wholeValue+N.decimalValue):Be&&N.wholeValue?(N.value=Math.round(yn(N.wholeValue,N.significantDigits-N.wholeValue.toString().length)),mt-=N.wholeValue.toString().length):N.value=N.wholeValue,N.tokenLength>1&&(qe||vt)&&(Ue.minimumIntegerDigits=N.tokenLength,Ft&&Ue.maximumSignificantDigits<N.tokenLength&&delete Ue.maximumSignificantDigits),!vt&&(N.value>0||Ot===""||R(de,N.type)||R(ne,N.type))&&(vt=!0),N.formattedValue=h(N.value,Ue,Pe),Ue.useGrouping=!1,Ue.decimalSeparator=".",N.formattedValueEn=h(N.value,Ue,"en"),N.tokenLength===2&&N.type==="milliseconds"&&(N.formattedValueMS=h(N.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),N};if(We=_(We,Cn),We=k(We),We.length>1){var Wn=function(N){return R(We,function(Ne){return Ne.type===N})},zn=function(N){var Ne=Wn(N.type);Ne&&M(N.targets,function(Ue){var St=Wn(Ue.type);St&&parseInt(Ne.formattedValueEn,10)===Ue.value&&(Ne.rawValue=0,Ne.wholeValue=0,Ne.decimalValue=0,St.rawValue+=1,St.wholeValue+=1,St.decimalValue=0,St.formattedValueEn=St.wholeValue.toString(),Ft=!0)})};M(l,zn)}return Ft&&(vt=!1,mt=ft,We=_(We,Cn),We=k(We)),ne&&!(Ht&&!P.trim)?(We=_(We,function(N){return R(ne,function(Ne){return N.type===Ne})?N:null}),We=k(We)):(Pt&&(We=C(We,function(N){return!N.isSmallest&&!N.wholeValue&&!R(de,N.type)})),xe&&We.length&&(We=We.slice(0,xe)),wn&&We.length>1&&(We=I(We,function(N){return!N.wholeValue&&!R(de,N.type)&&!N.isLargest})),jt&&(We=_(We,function(N,Ne){return Ne>0&&Ne<We.length-1&&!N.wholeValue?null:N}),We=k(We)),dn&&We.length===1&&!We[0].wholeValue&&!(!we&&We[0].isSmallest&&We[0].rawValue<Ge)&&(We=[])),me?We:(M(Jt,function(N){var Ne=Je[N.type],Ue=R(We,function(Et){return Et.type===N.type});if(!(!Ne||!Ue)){var St=Ue.formattedValueEn.split(".");St[0]=parseInt(St[0],10),St[1]?St[1]=parseFloat("0."+St[1],10):St[1]=null;var mn=be.durationPluralKey(Ne,St[0],St[1]),ge=p(Ne,be),bt=!1,Qt={};M(be._durationLabelTypes,function(Et){var $t=R(ge,function(on){return on.type===Et.type&&on.key===mn});$t&&(Qt[$t.type]=$t.label,u(N.text,Et.string)&&(N.text=N.text.replace(Et.string,$t.label),bt=!0))}),st&&!bt&&(ge.sort(m),M(ge,function(Et){if(Qt[Et.type]===Et.label)return u(N.text,Et.label)?!1:void 0;if(u(N.text,Et.label))return N.text=N.text.replace(Et.label,Qt[Et.type]),!1}))}}),Jt=_(Jt,function(N){if(!N.type)return N.text;var Ne=R(We,function(St){return St.type===N.type});if(!Ne)return"";var Ue="";return Te&&(Ue+=N.text),(he&&Ht||!he&&yt)&&(Ue+="< ",Ht=!1,yt=!1),(he&&yt||!he&&Ht)&&(Ue+="> ",Ht=!1,yt=!1),he&&(Ne.value>0||Ot===""||R(de,Ne.type)||R(ne,Ne.type))&&(Ue+="-",he=!1),N.type==="milliseconds"&&Ne.formattedValueMS?Ue+=Ne.formattedValueMS:Ue+=Ne.formattedValue,Te||(Ue+=N.text),Ue}),Jt.join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function se(){var H=this.duration,P=function(ke){return H._data[ke]},Y=R(this.types,P),ce=O(this.types,P);switch(Y){case"milliseconds":return"S __";case"seconds":case"minutes":return"*_MS_";case"hours":return"_HMS_";case"days":if(Y===ce)return"d __";case"weeks":return Y===ce?"w __":(this.trim===null&&(this.trim="both"),"w __, d __, h __");case"months":if(Y===ce)return"M __";case"years":return Y===ce?"y __":(this.trim===null&&(this.trim="both"),"y __, M __, d __");default:return this.trim===null&&(this.trim="both"),"y __, d __, h __, m __, s __"}}function ue(H){if(!H)throw"Moment Duration Format init cannot find moment instance.";H.duration.format=Q,H.duration.fn.format=te,H.duration.fn.format.defaults={trim:null,stopTrim:null,largest:null,maxValue:null,minValue:null,precision:0,trunc:!1,forceLength:null,userLocale:null,usePlural:!0,useLeftUnits:!1,useGrouping:!0,useSignificantDigits:!1,template:se,useToLocaleString:!0,groupingSeparator:",",decimalSeparator:".",grouping:[3]},H.updateLocale("en",b)}var fe=function(H,P,Y){return H.toLocaleString(P,Y)};r=X()&&ee(fe),i=r&&ie(fe);var re=function(H,P,Y){if(typeof window<"u"&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(P,Y).format(H)};return o=ee(re),s=o&&ie(re),ue(n),ue})}(Jo)),Jo.exports}s1();const l1=["true","t","yes","y","on","1"],u1=["false","f","no","n","off","0"];function Dt(e,t=""){return{kind:J.Text,readonly:!0,allowOverlay:!0,data:e,displayData:e,errorDetails:t,isError:!0,style:"faded"}}function gi(e){return Object.hasOwn(e,"isError")&&e.isError}function c1(e){return Object.hasOwn(e,"tooltip")&&e.tooltip!==""}function ya(e){return Object.hasOwn(e,"isMissingValue")&&e.isMissingValue}function Ds(e=!1){return e?{kind:J.Loading,allowOverlay:!1,isMissingValue:!0,copyData:""}:{kind:J.Loading,allowOverlay:!1,copyData:""}}function d1(e,t){const n=t?"faded":"normal";return{kind:J.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function Os(e){return{id:e.id,title:e.title,hasMenu:!1,menuIcon:"dots",themeOverride:e.themeOverride,icon:e.icon,group:e.group,...e.isStretched&&!e.isPinned&&{grow:1},...e.width&&{width:e.width}}}function co(e,t){return Le(e)?t||{}:Le(t)?e||{}:Fc(e,t)}function $d(e){if(Le(e))return[];if(typeof e=="number"||typeof e=="boolean")return[e];if(typeof e=="string"){if(e==="")return[];if(e.trim().startsWith("[")&&e.trim().endsWith("]"))try{return JSON.parse(e)}catch{return[e]}else return e.split(",")}try{const t=JSON.parse(JSON.stringify(e,(n,r)=>typeof r=="bigint"?Number(r):r));return Array.isArray(t)?t.map(n=>["string","number","boolean","null"].includes(typeof n)?n:gt(n)):[gt(t)]}catch{return[gt(e)]}}function f1(e){return e&&e.startsWith("{")&&e.endsWith("}")}function gt(e){try{try{return o1(e)}catch{return JSON.stringify(e,(n,r)=>typeof r=="bigint"?Number(r):r)}}catch{return`[${typeof e}]`}}function Bd(e){if(Le(e))return null;if(typeof e=="boolean")return e;const t=gt(e).toLowerCase().trim();if(t==="")return null;if(l1.includes(t))return!0;if(u1.includes(t))return!1}function io(e){if(Le(e))return null;if(Array.isArray(e))return NaN;if(typeof e=="string"){if(e.trim().length===0)return null;try{const t=Yi.unformat(e.trim());if(lt(t))return t}catch{}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function la(e){if(Le(e))return"";if(typeof e=="string")return e;try{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}catch{return gt(e)}}function h1(e){if(e===0||Math.abs(e)>=1e-4)return 4;const n=e.toExponential().split("e");return Math.abs(parseInt(n[1],10))}function Hr(e,t={}){const n=navigator.languages;try{return new Intl.NumberFormat(n,t).format(e)}catch(r){if(r instanceof RangeError)return new Intl.NumberFormat(void 0,t).format(e);throw r}}function ua(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":Le(t)||t===""?lt(n)?(n===0&&(e=Math.round(e)),Yi(e).format({thousandSeparated:!1,mantissa:n,trimMantissa:!1})):Yi(e).format({thousandSeparated:!1,mantissa:h1(e),trimMantissa:!0}):t==="plain"?Yi(e).format({thousandSeparated:!1,mantissa:20,trimMantissa:!0}):t==="localized"?Hr(e,{minimumFractionDigits:n??void 0,maximumFractionDigits:n??void 0}):t==="percent"?Hr(e,{style:"percent",minimumFractionDigits:lt(n)?Math.max(n-2,0):0,maximumFractionDigits:lt(n)?Math.max(n-2,0):2}):t==="dollar"?Hr(e,{style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="euro"?Hr(e,{style:"currency",currency:"EUR",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="yen"?Hr(e,{style:"currency",currency:"JPY",minimumFractionDigits:n??0,maximumFractionDigits:n??0}):["compact","scientific","engineering"].includes(t)?Hr(e,{notation:t}):t==="accounting"?Yi(e).format({thousandSeparated:!0,negative:"parenthesis",mantissa:n??2,trimMantissa:!1}):t==="bytes"?Hr(e,{notation:"compact",style:"unit",unit:"byte",unitDisplay:"narrow",maximumFractionDigits:1}).replace("BB","GB"):vg.sprintf(t,e)}function Wu(e,t,n="datetime"){if(t==="localized"){const r=navigator.languages,i=n==="time"?void 0:"medium",o=n==="date"?void 0:"medium";try{return new Intl.DateTimeFormat(r,{dateStyle:i,timeStyle:o}).format(e.toDate())}catch(s){if(s instanceof RangeError)return new Intl.DateTimeFormat(void 0,{dateStyle:i,timeStyle:o}).format(e.toDate());throw s}}else{if(t==="distance")return e.fromNow();if(t==="calendar")return e.calendar();if(t==="iso8601")return n==="date"?e.format("YYYY-MM-DD"):n==="time"?e.format("HH:mm:ss.SSS[Z]"):e.toISOString()}return e.format(t)}function Bo(e){if(Le(e))return null;if(e instanceof Date)return isNaN(e.getTime())?void 0:e;if(typeof e=="string"&&e.trim().length===0)return null;try{const t=Number(e);if(!isNaN(t)){let n=t;t>=10**18?n=t/1e3**3:t>=10**15?n=t/1e3**2:t>=10**12&&(n=t/1e3);const r=zr.unix(n).utc();if(r.isValid())return r.toDate()}if(typeof e=="string"){const n=zr.utc(e);if(n.isValid())return n.toDate();const r=zr.utc(e,[zr.HTML5_FMT.TIME_MS,zr.HTML5_FMT.TIME_SECONDS,zr.HTML5_FMT.TIME]);if(r.isValid())return r.toDate()}}catch{return}}function Wd(e){if(e%1===0)return 0;let t=e.toString();return t.indexOf("e")!==-1&&(t=e.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20})),t.indexOf(".")===-1?0:t.split(".")[1].length}function g1(e,t){if(!Number.isFinite(e))return e;if(t<=0)return Math.trunc(e);const n=10**t,r=e*n,i=Number.EPSILON*Math.abs(r)*10;return Math.trunc(r+Math.sign(r)*i)/n}const m1=new RegExp(/(\r\n|\n|\r)/gm);function oo(e){return e.indexOf(`
|
186
|
-
`)!==-1?e.replace(
|
187
|
-
Error: ${S.toString()}`);if(a.timezone){try{S=
|
188
|
-
Error: ${O}`)}v=S.utcOffset()}try{b=
|
189
|
-
Error: ${O}`)}y=
|
190
|
-
Error: ${l}`}let r=!1,i=t.display_text,o;if(!Le(i)){if(i.startsWith(":material/")&&
|
191
|
-
Error: ${o}`}const r={kind:J.Text,data:"",displayData:"",allowOverlay:!0,contentAlign:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!e.isEditable,style:e.isPinned?"faded":"normal"},i=o=>{if(Le(o))return!e.isRequired;let s=gt(o),a=!1;return t.max_chars&&s.length>t.max_chars&&(s=s.slice(0,t.max_chars),a=!0),n instanceof RegExp&&n.test(s)===!1?!1:a?s:!0};return{...e,kind:"text",sortMode:"default",validateInput:i,getCell(o,s){if(typeof n=="string")return Dt(gt(o),n);if(s){const a=i(o);if(a===!1)return Dt(gt(o),"Invalid input.");typeof a=="string"&&(o=a)}try{const a=lt(o)?gt(o):null,l=lt(a)?oo(a):"";return{...r,isMissingValue:Le(a),data:a,displayData:l}}catch(a){return Dt("Incompatible value",`The value cannot be interpreted as string. Error: ${a}`)}},getCellValue(o){return o.data===void 0?null:o.data}}}ul.isEditableType=!0;const qu=vi("img",{target:"e17fx5ar0"})({maxWidth:"100%",maxHeight:"37.5rem",objectFit:"scale-down"}),k1=({urls:e})=>{const t=e&&e.length>0?e[0]:"";return t.startsWith("http")?nt("a",{href:t,target:"_blank",rel:"noreferrer noopener",children:nt(qu,{src:t})}):nt(qu,{src:t})},Gu=new Map(Object.entries({object:ao,text:ul,checkbox:tl,selectbox:ll,list:al,number:sl,link:Kd,datetime:rl,date:ol,time:il,line_chart:qd,bar_chart:Gd,area_chart:Yd,image:jd,progress:Zd,json:Xd})),M1=[y1];var R1=Hc();const E1=ar(R1);var fs,Yu;function I1(){if(Yu)return fs;Yu=1;var e=Oh(),t=Ph(),n=_h(),r=Hc(),i=Fh(),o=Lh(),s=Ah(),a=Hh(),l="[object Map]",u="[object Set]",c=Object.prototype,d=c.hasOwnProperty;function g(h){if(h==null)return!0;if(i(h)&&(r(h)||typeof h=="string"||typeof h.splice=="function"||o(h)||a(h)||n(h)))return!h.length;var m=t(h);if(m==l||m==u)return!h.size;if(s(h))return!e(h).length;for(var p in h)if(d.call(h,p))return!1;return!0}return fs=g,fs}var T1=I1();const D1=ar(T1);function hs(e,t,n){if(!n.includes(t))return;const r=new RegExp(`${e}[,\\s].*{(?:[^}]*[\\s;]{1})?${t}:\\s*([^;}]+)[;]?.*}`,"gm");n=n.replace(/{/g," {");const i=r.exec(n);if(i)return i[1].trim()}function O1(e,t,n){const r={};if(!n.includes(t))return e;const i=hs(t,"color",n);i&&(r.textDark=i,e.kind===J.Bubble&&(r.textBubble=i),e.kind===J.Uri&&(r.linkColor=i));const o=hs(t,"background-color",n);o&&(r.bgCell=o),o==="yellow"&&i===void 0&&(r.textDark="#31333F");const s=hs(t,"font-weight",n);return s&&(r.baseFontStyle=`${s} ${Jh.sm}`),r?{...e,themeOverride:r}:e}function P1(e){return Wh(e)||Uh(e)?ul:qh(e)?rl:zc(e)?il:Gh(e)?ol:Yh(e)||jh(e)?ao:Ac(e)?tl:Xh(e)?sl:Kh(e)?ll:Zh(e)?al:ao}function Jd(e){const t=e.length>0?e[e.length-1]:"",n=e.length>1?e.slice(0,-1).filter(r=>r!=="").join(" / "):void 0;return{title:t,group:n}}function cl(e){return{group:void 0,isEditable:!1,isIndex:!1,isPinned:!1,isHidden:!1,isStretched:!1,...e}}function _1(e,t){const n=e.columnNames.map(a=>a[t]),{title:r,group:i}=Jd(n),o=e.columnTypes[t];let s=!0;return Bh(o)&&(s=!1),cl({id:`_index-${t}`,indexNumber:t,name:r,title:r,group:i,isEditable:s,arrowType:o,isIndex:!0,isPinned:!0})}function F1(e,t){const n=e.columnNames.map(s=>s[t]),{title:r,group:i}=Jd(n),o=e.columnTypes[t];return cl({id:`_column-${r}-${t}`,indexNumber:t,name:r,isEditable:!0,title:r,arrowType:o,group:i})}function Qd(){return cl({id:"_empty-index",indexNumber:0,title:"",name:"",isEditable:!1,isIndex:!0,isPinned:!0,arrowType:{type:Qh.INDEX,arrowField:new zh("",new Vh,!0),pandasType:void 0}})}function ju(e){const t=[],{dimensions:n}=e,r=n.numIndexColumns,i=n.numDataColumns;if(r===0&&i===0)return t.push(Qd()),t;for(let o=0;o<r;o++)t.push(_1(e,o));for(let o=0;o<i;o++)t.push(F1(e,o+r));return t}function L1(e,t,n,r=void 0){let i;if(e.kind==="object"||e.kind==="json")i=e.getCell(lt(t.content)?oo(Cs(t.content,t.contentType)):null);else if(["time","date","datetime"].includes(e.kind)&<(t.content)&&(typeof t.content=="number"||typeof t.content=="bigint")){let o;zc(t.contentType)&<(t.field?.type?.unit)?o=Nh(t.content,t.field):o=zr.utc(Number(t.content)).toDate(),i=e.getCell(o)}else if($h(t.contentType)){const o=Le(t.content)?null:Cs(t.content,t.contentType);i=e.getCell(o)}else i=e.getCell(t.content);if(gi(i))return i;if(!e.isEditable){if(n&<(n?.displayContent)){const o=oo(n.displayContent);i.kind===J.Text?i={...i,displayData:o}:i.kind===J.Number&&Le(e.columnTypeOptions?.format)?i={...i,displayData:o}:i.kind===J.Uri&&Le(e.columnTypeOptions?.display_text)?i={...i,displayData:o}:i.kind===J.Custom&&i.data?.kind==="date-picker-cell"&&Le(e.columnTypeOptions?.format)&&(i={...i,data:{...i.data,displayDate:o}})}r&&n?.cssId&&(i=O1(i,n.cssId,r))}return i}const Qo="_index",Xu="_pos:",Ku={small:75,medium:200,large:400},ef=Hs.getLogger("useColumnLoader");function A1(e){if(!Le(e)){if(typeof e=="number")return e;if(e in Ku)return Ku[e]}}const Wo=(e,t)=>pg(e,t,(r,i)=>{if(E1(i))return i});function Zu(e,t){if(!t)return e;let n={};return e.isIndex&&t.has(Qo)&&(n=Wo(n,t.get(Qo)??{})),t.has(`${Xu}${e.indexNumber}`)&&(n=Wo(n,t.get(`${Xu}${e.indexNumber}`)??{})),t.has(e.name)&&e.name!==Qo&&(n=Wo(n,t.get(e.name)??{})),t.has(e.id)&&(n=Wo(n,t.get(e.id)??{})),D1(n)?e:Fc({...e},{title:n.label,width:A1(n.width),isEditable:lt(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isPinned:n.pinned,isRequired:n.required,columnTypeOptions:n.type_config,contentAlignment:n.alignment,defaultValue:n.default,help:n.help})}function H1(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return ef.error(t),new Map}}function Ju(e){const t=e.columnTypeOptions?.type;let n;return lt(t)&&(Gu.has(t)?n=Gu.get(t):ef.warn(`Unknown column type configured in column configuration: ${t}`)),Le(n)&&(n=P1(e.arrowType)),n}function z1(e,t,n,r){const i=$r(),o=f.useMemo(()=>H1(e.columns),[e.columns]),[s,a]=f.useState(o);f.useEffect(()=>{a(o)},[o]);const l=e.useContainerWidth||lt(e.width)&&e.width>0,u=lt(e.rowHeight)&&e.rowHeight>ln("4rem"),c=f.useMemo(()=>ju(t).map(g=>{let h={...g,...Zu(g,s),isStretched:l};const m=Ju(h);return(e.editingMode===bn.EditingMode.READ_ONLY||n||m.isEditableType===!1)&&(h={...h,isEditable:!1}),e.editingMode!==bn.EditingMode.READ_ONLY&&h.isEditable==!0&&(h={...h,icon:"editable"},h.isRequired&&e.editingMode===bn.EditingMode.DYNAMIC&&(h={...h,isHidden:!1})),m(h,i)}),[t,s,l,e.editingMode,n,i]);return{columns:f.useMemo(()=>{const g=ju(t).map(y=>{let b={...y,...Zu(y,s),isStretched:l,isWrappingAllowed:u};const v=Ju(b);return(e.editingMode===bn.EditingMode.READ_ONLY||n||v.isEditableType===!1)&&(b={...b,isEditable:!1}),e.editingMode!==bn.EditingMode.READ_ONLY&&b.isEditable==!0&&(b={...b,icon:"editable"},b.isRequired&&e.editingMode===bn.EditingMode.DYNAMIC&&(b={...b,isHidden:!1})),v(b,i)}).filter(y=>!y.isHidden),h=[],m=[];r?.length?(g.forEach(y=>{y.isIndex&&!r.includes(y.name)&&!r.includes(y.id)&&y.isPinned!==!1&&h.push(y)}),r.forEach(y=>{const b=g.find(v=>v.name===y||v.id===y);b&&(b.isPinned?h.push(b):m.push(b))})):g.forEach(y=>{y.isPinned?h.push(y):m.push(y)});const p=[...h,...m];return p.length>0?p:[ao(Qd())]},[t,s,u,l,n,e.editingMode,r,i]),allColumns:c,setColumnConfigMapping:a}}function eo(e){return e.isIndex?Qo:Le(e.name)?"":e.name}class Uo{constructor(t){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=t}toJson(t){const n=new Map;t.forEach(o=>{n.set(o.indexNumber,o)});const r={edited_rows:{},added_rows:[],deleted_rows:[]};return this.editedCells.forEach((o,s,a)=>{const l={};o.forEach((u,c)=>{const d=n.get(c);d&&(l[eo(d)]=d.getCellValue(u))}),r.edited_rows[s]=l}),this.addedRows.forEach(o=>{const s={};let a=!1;o.forEach((l,u,c)=>{const d=n.get(u);if(d){const g=d.getCellValue(l);d.isRequired&&d.isEditable&&ya(l)&&(a=!0),lt(g)&&(s[eo(d)]=g)}}),a||r.added_rows.push(s)}),r.deleted_rows=this.deletedRows,JSON.stringify(r,(o,s)=>s===void 0?null:s)}fromJson(t,n){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const r=JSON.parse(t),i=new Map;n.forEach(s=>{i.set(s.indexNumber,s)});const o=new Map;n.forEach(s=>{o.set(eo(s),s)}),Object.keys(r.edited_rows).forEach(s=>{const a=Number(s),l=r.edited_rows[s];Object.keys(l).forEach(u=>{const c=l[u],d=o.get(u);if(d){const g=d.getCell(c);g&&(this.editedCells.has(a)||this.editedCells.set(a,new Map),this.editedCells.get(a)?.set(d.indexNumber,g))}})}),r.added_rows.forEach(s=>{const a=new Map;n.forEach(l=>{a.set(l.indexNumber,l.getCell(null))}),Object.keys(s).forEach(l=>{const u=s[l],c=o.get(l);if(c){const d=c.getCell(u);d&&a.set(c.indexNumber,d)}}),this.addedRows.push(a)}),this.deletedRows=r.deleted_rows}isAddedRow(t){return t>=this.numRows}getCell(t,n){if(this.isAddedRow(n))return this.addedRows[n-this.numRows].get(t);const r=this.editedCells.get(n);if(r!==void 0)return r.get(t)}setCell(t,n,r){if(this.isAddedRow(n)){if(n-this.numRows>=this.addedRows.length)return;this.addedRows[n-this.numRows].set(t,r)}else this.editedCells.get(n)===void 0&&this.editedCells.set(n,new Map),this.editedCells.get(n).set(t,r)}addRow(t){this.addedRows.push(t)}deleteRows(t){t.sort((n,r)=>r-n).forEach(n=>{this.deleteRow(n)})}deleteRow(t){if(!(Le(t)||t<0)){if(this.isAddedRow(t)){this.addedRows.splice(t-this.numRows,1);return}this.deletedRows.includes(t)||(this.deletedRows.push(t),this.deletedRows=this.deletedRows.sort((n,r)=>n-r)),this.editedCells.delete(t)}}getOriginalRowIndex(t){let n=t;for(let r=0;r<this.deletedRows.length&&!(this.deletedRows[r]>n);r++)n+=1;return n}getNumRows(){return this.numRows+this.addedRows.length-this.deletedRows.length}}const so=({columnId:e,columnConfigMapping:t,updatedProps:n})=>{const r=new Map(t),i=r.get(e),o={...i||{},...n||{}};return(i?.type_config||n?.type_config)&&(o.type_config={...i?.type_config||{},...n?.type_config||{}}),r.set(e,o),r};function V1(e){return{changeColumnFormat:f.useCallback((n,r)=>{e(i=>so({columnId:n,columnConfigMapping:i,updatedProps:{type_config:{format:r}}}))},[e])}}function N1(e,t,n,r,i,o){const s=f.useMemo(()=>e.filter(c=>c.isPinned).reduce((c,d)=>c+(d.width??r*2),0)>n*.6,[e,n,r]),a=t||s?0:e.filter(c=>c.isPinned).length,l=f.useCallback(c=>{o(d=>so({columnId:c,columnConfigMapping:d,updatedProps:{pinned:!1}})),i(!0,!1)},[i,o]);return{pinColumn:f.useCallback(c=>{o(d=>so({columnId:c,columnConfigMapping:d,updatedProps:{pinned:!0}})),i(!0,!1)},[i,o]),unpinColumn:l,freezeColumns:a}}function $1(e,t,n,r,i){return{onColumnMoved:f.useCallback((s,a)=>{const l=[...e],[u]=l.splice(s,1);l.splice(a,0,u),a<t&&!u.isPinned?n(u.id):a>=t&&u.isPinned&&r(u.id),i(l.map(c=>c.id))},[e,t,n,r,i])}}function B1(e){const[t,n]=f.useState(()=>new Map),r=f.useCallback((o,s,a,l)=>{o.id&&n(new Map(t).set(o.id,l))},[t]);return{columns:f.useMemo(()=>e.map(o=>o.id&&t.has(o.id)&&t.get(o.id)!==void 0?{...o,width:t.get(o.id),grow:0}:o),[e,t]),onColumnResize:r}}function W1(e){switch(e.kind){case J.Number:return e.data?.toString()??"";case J.Boolean:return e.data?.toString()??"";case J.Markdown:case J.RowID:case J.Text:case J.Uri:return e.data??"";case J.Bubble:case J.Image:return e.data.join("");case J.Drilldown:return e.data.map(t=>t.text).join("");case J.Protected:case J.Loading:return"";case J.Custom:return e.copyData}}function Qu(e){if(typeof e=="number")return e;if(e.length>0){const t=Number(e);isNaN(t)||(e=t)}return e}function U1(e,t){return e=Qu(e),t=Qu(t),typeof e=="string"&&typeof t=="string"?e.localeCompare(t):typeof e=="number"&&typeof t=="number"?e===t?0:e>t?1:-1:e==t?0:e>t?1:-1}function q1(e,t){return e>t?1:e===t?0:-1}function G1(e){const{sort:t,rows:n,getCellContent:r}=e,i=f.useMemo(()=>t===void 0?[]:Array.isArray(t)?t:[t],[t]),o=f.useMemo(()=>i.map(u=>{const c=e.columns.findIndex(d=>u.column===d||d.id!==void 0&&u.column.id===d.id);return c===-1?void 0:c}),[i,e.columns]),s=f.useMemo(()=>{const u=i.map((d,g)=>({sort:d,col:o[g]})).filter(d=>d.col!==void 0);if(u.length===0)return;const c=u.map(()=>new Array(n));for(let d=0;d<u.length;d++){const{col:g}=u[d],h=[g,0];for(let m=0;m<n;m++)h[1]=m,c[d][m]=W1(r(h))}return Sr(n).sort((d,g)=>{for(let h=0;h<u.length;h++){const{sort:m}=u[h],p=c[h][d],y=c[h][g];let b;if(m.mode==="raw"?b=q1(p,y):m.mode==="smart"?b=U1(p,y):b=p.localeCompare(y),b!==0)return(m.direction??"asc")==="desc"&&(b=-b),b}return 0})},[r,n,i,o]),a=f.useCallback(u=>s===void 0?u:s[u],[s]),l=f.useCallback(([u,c])=>s===void 0?r([u,c]):(c=s[c],r([u,c])),[r,s]);return s===void 0?{getCellContent:e.getCellContent,getOriginalIndex:a}:{getOriginalIndex:a,getCellContent:l}}function Y1(e,t){return t===void 0?e:e.map(n=>n.id===t.column.id?{...n,title:t.direction==="asc"?`↑ ${n.title}`:`↓ ${n.title}`}:n)}function j1(e,t,n){const[r,i]=f.useState(),{getCellContent:o,getOriginalIndex:s}=G1({columns:t.map(u=>Os(u)),getCellContent:n,rows:e,sort:r}),a=f.useMemo(()=>Y1(t,r),[t,r]),l=f.useCallback((u,c,d)=>{const g=a[u];let h;c==="auto"?(h="asc",r&&r.column.id===g.id&&(r.direction==="asc"?h="desc":h=void 0)):h=c,h===void 0||d&&h===r?.direction?i(void 0):i({column:Os(g),direction:h,mode:g.sortMode})},[r,a]);return{columns:a,sortColumn:l,getOriginalIndex:s,getCellContent:o}}function X1(e,t){const n=f.useCallback(i=>{t(o=>so({columnId:i,columnConfigMapping:o,updatedProps:{hidden:!0}})),e(!0,!1)},[e,t]),r=f.useCallback(i=>{t(o=>so({columnId:i,columnConfigMapping:o,updatedProps:{hidden:!1}})),e(!0,!1)},[e,t]);return{hideColumn:n,showColumn:r}}function K1(){return{provideEditor:f.useCallback(t=>{if(t.kind===J.Text&&t.readonly&&f1(t.data))return{editor:w1}},[])}}const Z1={kind:J.Custom,isMatch:e=>e.data.kind==="sparkline-cell",needsHover:!0,needsHoverPosition:!0,draw:(e,t)=>{const{ctx:n,theme:r,rect:i,hoverAmount:o,hoverX:s}=e;let{values:a,yAxis:l,color:u,graphKind:c="area",displayValues:d,hideAxis:g}=t.data;const[h,m]=l;if(a.length===0)return!0;a=a.map(M=>Math.min(1,Math.max(0,(M-h)/(m-h))));const p=r.cellHorizontalPadding,y=p+i.x,b=i.y+3,v=i.height-6,S=i.width-p*2,O=m-h,R=m<=0?b:h>=0?b+v:b+v*(m/O);if(!g&&h<=0&&m>=0&&(n.beginPath(),n.moveTo(y,R),n.lineTo(y+S,R),n.globalAlpha=.4,n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.globalAlpha=1),c==="bar"){n.beginPath();const M=2,_=(a.length-1)*M,E=(S-_)/a.length;let k=y;for(const F of a){const D=b+v-F*v;n.moveTo(k,R),n.lineTo(k+E,R),n.lineTo(k+E,D),n.lineTo(k,D),k+=E+M}n.fillStyle=t.data.color??r.accentColor,n.fill()}else{a.length===1&&(a=[a[0],a[0]],d&&(d=[d[0],d[0]])),n.beginPath();const M=(i.width-16)/(a.length-1),_=a.map((k,F)=>({x:y+M*F,y:b+v-k*v}));n.moveTo(_[0].x,_[0].y);let E=0;if(_.length>2)for(E=1;E<_.length-2;E++){const k=(_[E].x+_[E+1].x)/2,F=(_[E].y+_[E+1].y)/2;n.quadraticCurveTo(_[E].x,_[E].y,k,F)}if(n.quadraticCurveTo(_[E].x,_[E].y,_[E+1].x,_[E+1].y),n.strokeStyle=u??r.accentColor,n.lineWidth=1+o*.5,n.stroke(),n.lineTo(i.x+i.width-p,R),n.lineTo(i.x+p,R),n.closePath(),c==="area"){n.globalAlpha=.2+.2*o;const k=n.createLinearGradient(0,b,0,b+v*1.4);k.addColorStop(0,u??r.accentColor);const[F,D,C]=ia(u??r.accentColor);k.addColorStop(1,`rgba(${F}, ${D}, ${C}, 0)`),n.fillStyle=k,n.fill(),n.globalAlpha=1}if(s!==void 0&&(c==="line"||c==="area")&&d!==void 0){n.beginPath();const k=Math.min(a.length-1,Math.max(0,Math.round((s-p)/M)));n.moveTo(y+k*M,i.y+1),n.lineTo(y+k*M,i.y+i.height),n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.save(),n.font=`8px ${r.fontFamily}`,n.fillStyle=r.textMedium,n.textBaseline="top",n.fillText(d[k],y,i.y+r.cellVerticalPadding),n.restore()}}return!0},provideEditor:()=>{},onPaste:(e,t)=>t};function ec(e,t,n,r,i,o){if(!(r<=0||i<=0)){if(typeof o=="number"&&o<=0){e.rect(t,n,r,i);return}typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.min(o.tl,i/2,r/2),tr:Math.min(o.tr,i/2,r/2),bl:Math.min(o.bl,i/2,r/2),br:Math.min(o.br,i/2,r/2)},o.tl=Math.max(0,o.tl),o.tr=Math.max(0,o.tr),o.br=Math.max(0,o.br),o.bl=Math.max(0,o.bl),e.moveTo(t+o.tl,n),e.arcTo(t+r,n,t+r,n+o.tr,o.tr),e.arcTo(t+r,n+i,t+r-o.br,n+i,o.br),e.arcTo(t,n+i,t,n+i-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}}function tc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tc(Object(n),!0).forEach(function(r){ji(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var J1=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Q1(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,i=r===void 0?!1:r,o=e.defaultValue,s=o===void 0?null:o,a=e.inputValue,l=e.menuIsOpen,u=e.onChange,c=e.onInputChange,d=e.onMenuClose,g=e.onMenuOpen,h=e.value,m=sr(e,J1),p=f.useState(a!==void 0?a:n),y=rr(p,2),b=y[0],v=y[1],S=f.useState(l!==void 0?l:i),O=rr(S,2),R=O[0],M=O[1],_=f.useState(h!==void 0?h:s),E=rr(_,2),k=E[0],F=E[1],D=f.useCallback(function(X,ie){typeof u=="function"&&u(X,ie),F(X)},[u]),C=f.useCallback(function(X,ie){var ee;typeof c=="function"&&(ee=c(X,ie)),v(ee!==void 0?ee:X)},[c]),I=f.useCallback(function(){typeof g=="function"&&g(),M(!0)},[g]),T=f.useCallback(function(){typeof d=="function"&&d(),M(!1)},[d]),x=a!==void 0?a:b,$=l!==void 0?l:R,G=h!==void 0?h:k;return Fe(Fe({},m),{},{inputValue:x,menuIsOpen:$,onChange:D,onInputChange:C,onMenuClose:T,onMenuOpen:I,value:G})}function eb(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const tb=Math.min,nb=Math.max,ca=Math.round,qo=Math.floor,da=e=>({x:e,y:e});function rb(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ca(){return typeof window<"u"}function tf(e){return rf(e)?(e.nodeName||"").toLowerCase():"#document"}function or(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function nf(e){var t;return(t=(rf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function rf(e){return Ca()?e instanceof Node||e instanceof or(e).Node:!1}function ib(e){return Ca()?e instanceof Element||e instanceof or(e).Element:!1}function dl(e){return Ca()?e instanceof HTMLElement||e instanceof or(e).HTMLElement:!1}function nc(e){return!Ca()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof or(e).ShadowRoot}function of(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=fl(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function ob(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ab(e){return["html","body","#document"].includes(tf(e))}function fl(e){return or(e).getComputedStyle(e)}function sb(e){if(tf(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nc(e)&&e.host||nf(e);return nc(t)?t.host:t}function af(e){const t=sb(e);return ab(t)?e.ownerDocument?e.ownerDocument.body:e.body:dl(t)&&of(t)?t:af(t)}function fa(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=af(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=or(i);if(o){const a=Ps(s);return t.concat(s,s.visualViewport||[],of(i)?i:[],a&&n?fa(a):[])}return t.concat(i,fa(i,[],n))}function Ps(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lb(e){const t=fl(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=dl(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=ca(n)!==o||ca(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function hl(e){return ib(e)?e:e.contextElement}function rc(e){const t=hl(e);if(!dl(t))return da(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=lb(t);let s=(o?ca(n.width):n.width)/r,a=(o?ca(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const ub=da(0);function cb(e){const t=or(e);return!ob()||!t.visualViewport?ub:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function db(e,t,n){return!1}function ic(e,t,n,r){t===void 0&&(t=!1);const i=e.getBoundingClientRect(),o=hl(e);let s=da(1);t&&(s=rc(e));const a=db()?cb(o):da(0);let l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,c=i.width/s.x,d=i.height/s.y;if(o){const g=or(o),h=r;let m=g,p=Ps(m);for(;p&&r&&h!==m;){const y=rc(p),b=p.getBoundingClientRect(),v=fl(p),S=b.left+(p.clientLeft+parseFloat(v.paddingLeft))*y.x,O=b.top+(p.clientTop+parseFloat(v.paddingTop))*y.y;l*=y.x,u*=y.y,c*=y.x,d*=y.y,l+=S,u+=O,m=or(p),p=Ps(m)}}return rb({width:c,height:d,x:l,y:u})}function fb(e,t){let n=null,r;const i=nf(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:u,top:c,width:d,height:g}=e.getBoundingClientRect();if(a||t(),!d||!g)return;const h=qo(c),m=qo(i.clientWidth-(u+d)),p=qo(i.clientHeight-(c+g)),y=qo(u),v={rootMargin:-h+"px "+-m+"px "+-p+"px "+-y+"px",threshold:nb(0,tb(1,l))||1};let S=!0;function O(R){const M=R[0].intersectionRatio;if(M!==l){if(!S)return s();M?s(!1,M):r=setTimeout(()=>{s(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(O,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(O,v)}n.observe(e)}return s(!0),o}function hb(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=hl(e),c=i||o?[...u?fa(u):[],...fa(t)]:[];c.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),o&&b.addEventListener("resize",n)});const d=u&&a?fb(u,n):null;let g=-1,h=null;s&&(h=new ResizeObserver(b=>{let[v]=b;v&&v.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let m,p=l?ic(e):null;l&&y();function y(){const b=ic(e);p&&(b.x!==p.x||b.y!==p.y||b.width!==p.width||b.height!==p.height)&&n(),p=b,m=requestAnimationFrame(y)}return n(),()=>{var b;c.forEach(v=>{i&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),d?.(),(b=h)==null||b.disconnect(),h=null,l&&cancelAnimationFrame(m)}}var _s=f.useLayoutEffect,gb=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],ha=function(){};function mb(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function pb(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var o=[].concat(r);if(t&&e)for(var s in t)t.hasOwnProperty(s)&&t[s]&&o.push("".concat(mb(e,s)));return o.filter(function(a){return a}).map(function(a){return String(a).trim()}).join(" ")}var oc=function(t){return Mb(t)?t.filter(Boolean):eg(t)==="object"&&t!==null?[t]:[]},sf=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=sr(t,gb);return Fe({},n)},Kt=function(t,n,r){var i=t.cx,o=t.getStyles,s=t.getClassNames,a=t.className;return{css:o(n,t),className:i(r??{},s(n,t),a)}};function Sa(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function vb(e){return Sa(e)?window.innerHeight:e.clientHeight}function lf(e){return Sa(e)?window.pageYOffset:e.scrollTop}function ga(e,t){if(Sa(e)){window.scrollTo(0,t);return}e.scrollTop=t}function bb(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return i;return document.documentElement}function wb(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function Go(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:ha,i=lf(e),o=t-i,s=10,a=0;function l(){a+=s;var u=wb(a,i,o,n);ga(e,u),a<n?window.requestAnimationFrame(l):r(e)}l()}function ac(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=t.offsetHeight/3;r.bottom+i>n.bottom?ga(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+i,e.scrollHeight)):r.top-i<n.top&&ga(e,Math.max(t.offsetTop-i,0))}function yb(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function sc(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function Cb(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var uf=!1,Sb={get passive(){return uf=!0}},Yo=typeof window<"u"?window:{};Yo.addEventListener&&Yo.removeEventListener&&(Yo.addEventListener("p",ha,Sb),Yo.removeEventListener("p",ha,!1));var xb=uf;function kb(e){return e!=null}function Mb(e){return Array.isArray(e)}function jo(e,t,n){return e?t:n}var Rb=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var o=Object.entries(t).filter(function(s){var a=rr(s,1),l=a[0];return!r.includes(l)});return o.reduce(function(s,a){var l=rr(a,2),u=l[0],c=l[1];return s[u]=c,s},{})},Eb=["children","innerProps"],Ib=["children","innerProps"];function Tb(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,i=e.placement,o=e.shouldScroll,s=e.isFixedPosition,a=e.controlHeight,l=bb(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var c=l.getBoundingClientRect(),d=c.height,g=n.getBoundingClientRect(),h=g.bottom,m=g.height,p=g.top,y=n.offsetParent.getBoundingClientRect(),b=y.top,v=s?window.innerHeight:vb(l),S=lf(l),O=parseInt(getComputedStyle(n).marginBottom,10),R=parseInt(getComputedStyle(n).marginTop,10),M=b-R,_=v-p,E=M+S,k=d-S-p,F=h-v+S+O,D=S+p-R,C=160;switch(i){case"auto":case"bottom":if(_>=m)return{placement:"bottom",maxHeight:t};if(k>=m&&!s)return o&&Go(l,F,C),{placement:"bottom",maxHeight:t};if(!s&&k>=r||s&&_>=r){o&&Go(l,F,C);var I=s?_-O:k-O;return{placement:"bottom",maxHeight:I}}if(i==="auto"||s){var T=t,x=s?M:E;return x>=r&&(T=Math.min(x-O-a,t)),{placement:"top",maxHeight:T}}if(i==="bottom")return o&&ga(l,F),{placement:"bottom",maxHeight:t};break;case"top":if(M>=m)return{placement:"top",maxHeight:t};if(E>=m&&!s)return o&&Go(l,D,C),{placement:"top",maxHeight:t};if(!s&&E>=r||s&&M>=r){var $=t;return(!s&&E>=r||s&&M>=r)&&($=s?M-R:E-R),o&&Go(l,D,C),{placement:"top",maxHeight:$}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return u}function Db(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var cf=function(t){return t==="auto"?"bottom":t},Ob=function(t,n){var r,i=t.placement,o=t.theme,s=o.borderRadius,a=o.spacing,l=o.colors;return Fe((r={label:"menu"},ji(r,Db(i),"100%"),ji(r,"position","absolute"),ji(r,"width","100%"),ji(r,"zIndex",1),r),n?{}:{backgroundColor:l.neutral0,borderRadius:s,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},df=f.createContext(null),Pb=function(t){var n=t.children,r=t.minMenuHeight,i=t.maxMenuHeight,o=t.menuPlacement,s=t.menuPosition,a=t.menuShouldScrollIntoView,l=t.theme,u=f.useContext(df)||{},c=u.setPortalPlacement,d=f.useRef(null),g=f.useState(i),h=rr(g,2),m=h[0],p=h[1],y=f.useState(null),b=rr(y,2),v=b[0],S=b[1],O=l.spacing.controlHeight;return _s(function(){var R=d.current;if(R){var M=s==="fixed",_=a&&!M,E=Tb({maxHeight:i,menuEl:R,minHeight:r,placement:o,shouldScroll:_,isFixedPosition:M,controlHeight:O});p(E.maxHeight),S(E.placement),c?.(E.placement)}},[i,o,s,a,r,c,O]),n({ref:d,placerProps:Fe(Fe({},t),{},{placement:v||cf(o),maxHeight:m})})},_b=function(t){var n=t.children,r=t.innerRef,i=t.innerProps;return Oe("div",ze({},Kt(t,"menu",{menu:!0}),{ref:r},i),n)},Fb=_b,Lb=function(t,n){var r=t.maxHeight,i=t.theme.spacing.baseUnit;return Fe({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:i,paddingTop:i})},Ab=function(t){var n=t.children,r=t.innerProps,i=t.innerRef,o=t.isMulti;return Oe("div",ze({},Kt(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:i},r),n)},ff=function(t,n){var r=t.theme,i=r.spacing.baseUnit,o=r.colors;return Fe({textAlign:"center"},n?{}:{color:o.neutral40,padding:"".concat(i*2,"px ").concat(i*3,"px")})},Hb=ff,zb=ff,Vb=function(t){var n=t.children,r=n===void 0?"No options":n,i=t.innerProps,o=sr(t,Eb);return Oe("div",ze({},Kt(Fe(Fe({},o),{},{children:r,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),r)},Nb=function(t){var n=t.children,r=n===void 0?"Loading...":n,i=t.innerProps,o=sr(t,Ib);return Oe("div",ze({},Kt(Fe(Fe({},o),{},{children:r,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),r)},$b=function(t){var n=t.rect,r=t.offset,i=t.position;return{left:n.left,position:i,top:r,width:n.width,zIndex:1}},Bb=function(t){var n=t.appendTo,r=t.children,i=t.controlElement,o=t.innerProps,s=t.menuPlacement,a=t.menuPosition,l=f.useRef(null),u=f.useRef(null),c=f.useState(cf(s)),d=rr(c,2),g=d[0],h=d[1],m=f.useMemo(function(){return{setPortalPlacement:h}},[]),p=f.useState(null),y=rr(p,2),b=y[0],v=y[1],S=f.useCallback(function(){if(i){var _=yb(i),E=a==="fixed"?0:window.pageYOffset,k=_[g]+E;(k!==b?.offset||_.left!==b?.rect.left||_.width!==b?.rect.width)&&v({offset:k,rect:_})}},[i,a,g,b?.offset,b?.rect.left,b?.rect.width]);_s(function(){S()},[S]);var O=f.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),i&&l.current&&(u.current=hb(i,l.current,S,{elementResize:"ResizeObserver"in window}))},[i,S]);_s(function(){O()},[O]);var R=f.useCallback(function(_){l.current=_,O()},[O]);if(!n&&a!=="fixed"||!b)return null;var M=Oe("div",ze({ref:R},Kt(Fe(Fe({},t),{},{offset:b.offset,position:a,rect:b.rect}),"menuPortal",{"menu-portal":!0}),o),r);return Oe(df.Provider,{value:m},n?Vc.createPortal(M,n):M)},Wb=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},Ub=function(t){var n=t.children,r=t.innerProps,i=t.isDisabled,o=t.isRtl;return Oe("div",ze({},Kt(t,"container",{"--is-disabled":i,"--is-rtl":o}),r),n)},qb=function(t,n){var r=t.theme.spacing,i=t.isMulti,o=t.hasValue,s=t.selectProps.controlShouldRenderValue;return Fe({alignItems:"center",display:i&&o&&s?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},Gb=function(t){var n=t.children,r=t.innerProps,i=t.isMulti,o=t.hasValue;return Oe("div",ze({},Kt(t,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":o}),r),n)},Yb=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},jb=function(t){var n=t.children,r=t.innerProps;return Oe("div",ze({},Kt(t,"indicatorsContainer",{indicators:!0}),r),n)},lc,Xb=["size"],Kb=["innerProps","isRtl","size"],Zb={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},hf=function(t){var n=t.size,r=sr(t,Xb);return Oe("svg",ze({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Zb},r))},gl=function(t){return Oe(hf,ze({size:20},t),Oe("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},gf=function(t){return Oe(hf,ze({size:20},t),Oe("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},mf=function(t,n){var r=t.isFocused,i=t.theme,o=i.spacing.baseUnit,s=i.colors;return Fe({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?s.neutral60:s.neutral20,padding:o*2,":hover":{color:r?s.neutral80:s.neutral40}})},Jb=mf,Qb=function(t){var n=t.children,r=t.innerProps;return Oe("div",ze({},Kt(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||Oe(gf,null))},ew=mf,tw=function(t){var n=t.children,r=t.innerProps;return Oe("div",ze({},Kt(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||Oe(gl,null))},nw=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing.baseUnit,s=i.colors;return Fe({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?s.neutral10:s.neutral20,marginBottom:o*2,marginTop:o*2})},rw=function(t){var n=t.innerProps;return Oe("span",ze({},n,Kt(t,"indicatorSeparator",{"indicator-separator":!0})))},iw=tg(lc||(lc=eb([`
|
185
|
+
*/var g1=Jo.exports,Wu;function m1(){return Wu||(Wu=1,function(e,t){(function(n,r){try{e.exports=r(kh)}catch{e.exports=r}n&&(n.momentDurationFormatSetup=n.moment?r(n.moment):r)})(g1,function(n){var r=!1,i=!1,o=!1,s=!1,a="escape years months weeks days hours minutes seconds milliseconds general".split(" "),l=[{type:"seconds",targets:[{type:"minutes",value:60},{type:"hours",value:3600},{type:"days",value:86400},{type:"weeks",value:604800},{type:"months",value:2678400},{type:"years",value:31536e3}]},{type:"minutes",targets:[{type:"hours",value:60},{type:"days",value:1440},{type:"weeks",value:10080},{type:"months",value:44640},{type:"years",value:525600}]},{type:"hours",targets:[{type:"days",value:24},{type:"weeks",value:168},{type:"months",value:744},{type:"years",value:8760}]},{type:"days",targets:[{type:"weeks",value:7},{type:"months",value:31},{type:"years",value:365}]},{type:"months",targets:[{type:"years",value:12}]}];function u(H,P){return P.length>H.length?!1:H.indexOf(P)!==-1}function c(H){for(var P="";H;)P+="0",H-=1;return P}function d(H){for(var P=H.split("").reverse(),X=0,ce=!0;ce&&X<P.length;)X?P[X]==="9"?P[X]="0":(P[X]=(parseInt(P[X],10)+1).toString(),ce=!1):(parseInt(P[X],10)<5&&(ce=!1),P[X]="0"),X+=1;return ce&&P.push("1"),P.reverse().join("")}function g(H,P){var X=_(x(P).sort(),function(he){return he+":"+P[he]}).join(","),ce=H+"+"+X;return g.cache[ce]||(g.cache[ce]=Intl.NumberFormat(H,P)),g.cache[ce]}g.cache={};function h(H,P,X){var ce=P.useToLocaleString,he=P.useGrouping,ke=he&&P.grouping.slice(),Se=P.maximumSignificantDigits,Qe=P.minimumIntegerDigits||1,Ee=P.fractionDigits||0,et=P.groupingSeparator,kt=P.decimalSeparator;if(ce&&X){var Ne={minimumIntegerDigits:Qe,useGrouping:he};if(Ee&&(Ne.maximumFractionDigits=Ee,Ne.minimumFractionDigits=Ee),Se&&H>0&&(Ne.maximumSignificantDigits=Se),o){if(!s){var ne=T({},P);ne.useGrouping=!1,ne.decimalSeparator=".",H=parseFloat(h(H,ne),10)}return g(X,Ne).format(H)}else{if(!i){var ne=T({},P);ne.useGrouping=!1,ne.decimalSeparator=".",H=parseFloat(h(H,ne),10)}return H.toLocaleString(X,Ne)}}var me;Se?me=H.toPrecision(Se+1):me=H.toFixed(Ee+1);var xe,de,be,Pe=me.split("e");be=Pe[1]||"",Pe=Pe[0].split("."),de=Pe[1]||"",xe=Pe[0]||"";var Te=xe.length,st=de.length,Re=Te+st,Ge=xe+de;(Se&&Re===Se+1||!Se&&st===Ee+1)&&(Ge=d(Ge),Ge.length===Re+1&&(Te=Te+1),st&&(Ge=Ge.slice(0,-1)),xe=Ge.slice(0,Te),de=Ge.slice(Te)),Se&&(de=de.replace(/0*$/,""));var He=parseInt(be,10);He>0?de.length<=He?(de=de+c(He-de.length),xe=xe+de,de=""):(xe=xe+de.slice(0,He),de=de.slice(He)):He<0&&(de=c(Math.abs(He)-xe.length)+xe+de,xe="0"),Se||(de=de.slice(0,Ee),de.length<Ee&&(de=de+c(Ee-de.length)),xe.length<Qe&&(xe=c(Qe-xe.length)+xe));var we="";if(he){Pe=xe;for(var Be;Pe.length;)ke.length&&(Be=ke.shift()),we&&(we=et+we),we=Pe.slice(-Be)+we,Pe=Pe.slice(0,-Be)}else we=xe;return de&&(we=we+kt+de),we}function m(H,P){return H.label.length>P.label.length?-1:H.label.length<P.label.length?1:0}function p(H,P){var X=[];return R(x(P),function(ce){if(ce.slice(0,15)==="_durationLabels"){var he=ce.slice(15).toLowerCase();R(x(P[ce]),function(ke){ke.slice(0,1)===H&&X.push({type:he,key:ke,label:P[ce][ke]})})}}),X}function y(H,P,X){return P===1&&X===null?H:H+H}var b={durationLabelsStandard:{S:"millisecond",SS:"milliseconds",s:"second",ss:"seconds",m:"minute",mm:"minutes",h:"hour",hh:"hours",d:"day",dd:"days",w:"week",ww:"weeks",M:"month",MM:"months",y:"year",yy:"years"},durationLabelsShort:{S:"msec",SS:"msecs",s:"sec",ss:"secs",m:"min",mm:"mins",h:"hr",hh:"hrs",d:"dy",dd:"dys",w:"wk",ww:"wks",M:"mo",MM:"mos",y:"yr",yy:"yrs"},durationTimeTemplates:{HMS:"h:mm:ss",HM:"h:mm",MS:"m:ss"},durationLabelTypes:[{type:"standard",string:"__"},{type:"short",string:"_"}],durationPluralKey:y};function v(H){return Object.prototype.toString.call(H)==="[object Array]"}function S(H){return Object.prototype.toString.call(H)==="[object Object]"}function O(H,P){for(var X=H.length;X-=1;)if(P(H[X]))return H[X]}function M(H,P){var X=0,ce=H&&H.length||0,he;for(typeof P!="function"&&(he=P,P=function(ke){return ke===he});X<ce;){if(P(H[X]))return H[X];X+=1}}function R(H,P){var X=0,ce=H.length;if(!(!H||!ce))for(;X<ce;){if(P(H[X],X)===!1)return;X+=1}}function _(H,P){var X=0,ce=H.length,he=[];if(!H||!ce)return he;for(;X<ce;)he[X]=P(H[X],X),X+=1;return he}function I(H,P){return _(H,function(X){return X[P]})}function k(H){var P=[];return R(H,function(X){X&&P.push(X)}),P}function F(H){var P=[];return R(H,function(X){M(P,X)||P.push(X)}),P}function D(H,P){var X=[];return R(H,function(ce){R(P,function(he){ce===he&&X.push(ce)})}),F(X)}function C(H,P){var X=[];return R(H,function(ce,he){if(!P(ce))return X=H.slice(he),!1}),X}function E(H,P){var X=H.slice().reverse();return C(X,P).reverse()}function T(H,P){for(var X in P)P.hasOwnProperty(X)&&(H[X]=P[X]);return H}function x(H){var P=[];for(var X in H)H.hasOwnProperty(X)&&P.push(X);return P}function N(H,P){var X=0,ce=H.length;if(!H||!ce)return!1;for(;X<ce;){if(P(H[X],X)===!0)return!0;X+=1}return!1}function G(H){var P=[];return R(H,function(X){P=P.concat(X)}),P}function j(){var H=0;try{H.toLocaleString("i")}catch(P){return P.name==="RangeError"}return!1}function ie(H){return H(3.55,"en",{useGrouping:!1,minimumIntegerDigits:1,minimumFractionDigits:1,maximumFractionDigits:1})==="3.6"}function ee(H){var P=!0;return P=P&&H(1,"en",{minimumIntegerDigits:1})==="1",P=P&&H(1,"en",{minimumIntegerDigits:2})==="01",P=P&&H(1,"en",{minimumIntegerDigits:3})==="001",!(!P||(P=P&&H(99.99,"en",{maximumFractionDigits:0,minimumFractionDigits:0})==="100",P=P&&H(99.99,"en",{maximumFractionDigits:1,minimumFractionDigits:1})==="100.0",P=P&&H(99.99,"en",{maximumFractionDigits:2,minimumFractionDigits:2})==="99.99",P=P&&H(99.99,"en",{maximumFractionDigits:3,minimumFractionDigits:3})==="99.990",!P)||(P=P&&H(99.99,"en",{maximumSignificantDigits:1})==="100",P=P&&H(99.99,"en",{maximumSignificantDigits:2})==="100",P=P&&H(99.99,"en",{maximumSignificantDigits:3})==="100",P=P&&H(99.99,"en",{maximumSignificantDigits:4})==="99.99",P=P&&H(99.99,"en",{maximumSignificantDigits:5})==="99.99",!P)||(P=P&&H(1e3,"en",{useGrouping:!0})==="1,000",P=P&&H(1e3,"en",{useGrouping:!1})==="1000",!P))}function Q(){var H=[].slice.call(arguments),P={},X;if(R(H,function(Se,Qe){if(!Qe){if(!v(Se))throw"Expected array as the first argument to durationsFormat.";X=Se}if(typeof Se=="string"||typeof Se=="function"){P.template=Se;return}if(typeof Se=="number"){P.precision=Se;return}S(Se)&&T(P,Se)}),!X||!X.length)return[];P.returnMomentTypes=!0;var ce=_(X,function(Se){return Se.format(P)}),he=D(a,F(I(G(ce),"type"))),ke=P.largest;return ke&&(he=he.slice(0,ke)),P.returnMomentTypes=!1,P.outputTypes=he,_(X,function(Se){return Se.format(P)})}function te(){var H=[].slice.call(arguments),P=T({},this.format.defaults),X=this.asMilliseconds(),ce=this.asMonths();typeof this.isValid=="function"&&this.isValid()===!1&&(X=0,ce=0);var he=X<0,ke=n.duration(Math.abs(X),"milliseconds"),Se=n.duration(Math.abs(ce),"months");R(H,function($){if(typeof $=="string"||typeof $=="function"){P.template=$;return}if(typeof $=="number"){P.precision=$;return}S($)&&T(P,$)});var Qe={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},Ee={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};P.types=a;var et=function($){return M(a,function($e){return Ee[$e].test($)})},kt=new RegExp(_(a,function($){return Ee[$].source}).join("|"),"g");P.duration=this;var Ne=typeof P.template=="function"?P.template.apply(P):P.template,ne=P.outputTypes,me=P.returnMomentTypes,xe=P.largest,de=[];ne||(v(P.stopTrim)&&(P.stopTrim=P.stopTrim.join("")),P.stopTrim&&R(P.stopTrim.match(kt),function($){var $e=et($);$e==="escape"||$e==="general"||de.push($e)}));var be=n.localeData();be||(be={}),R(x(b),function($){if(typeof b[$]=="function"){be[$]||(be[$]=b[$]);return}be["_"+$]||(be["_"+$]=b[$])}),R(x(be._durationTimeTemplates),function($){Ne=Ne.replace("_"+$+"_",be._durationTimeTemplates[$])});var Pe=P.userLocale||n.locale(),Te=P.useLeftUnits,st=P.usePlural,Re=P.precision,Ge=P.forceLength,He=P.useGrouping,we=P.trunc,Be=P.useSignificantDigits&&Re>0,mt=Be?P.precision:0,ft=mt,Xe=P.minValue,yt=!1,Xt=P.maxValue,Ht=!1,Mt=P.useToLocaleString,nn=P.groupingSeparator,qt=P.decimalSeparator,cn=P.grouping;Mt=Mt&&(r||o);var Ot=P.trim;v(Ot)&&(Ot=Ot.join(" ")),Ot===null&&(xe||Xt||Be)&&(Ot="all"),(Ot===null||Ot===!0||Ot==="left"||Ot==="right")&&(Ot="large"),Ot===!1&&(Ot="");var ut=function($){return $.test(Ot)},tn=/large/,Ct=/small/,rn=/both/,Bt=/mid/,De=/^all|[^sm]all/,Et=/final/,Pt=xe>0||N([tn,rn,De],ut),yn=N([Ct,rn,De],ut),Yt=N([Bt,De],ut),dn=N([Et,De],ut),Rn=_(Ne.match(kt),function($,$e){var Ue=et($);return $.slice(0,1)==="*"&&($=$.slice(1),Ue!=="escape"&&Ue!=="general"&&de.push(Ue)),{index:$e,length:$.length,text:"",token:Ue==="escape"?$.replace(Ee.escape,"$1"):$,type:Ue==="escape"||Ue==="general"?null:Ue}}),jt={index:0,length:0,token:"",text:"",type:null},Jt=[];Te&&Rn.reverse(),R(Rn,function($){if($.type){(jt.type||jt.text)&&Jt.push(jt),jt=$;return}Te?jt.text=$.token+jt.text:jt.text+=$.token}),(jt.type||jt.text)&&Jt.push(jt),Te&&Jt.reverse();var We=D(a,F(k(I(Jt,"type"))));if(!We.length)return I(Jt,"text").join("");We=_(We,function($,$e){var Ue=$e+1===We.length,St=!$e,mn;$==="years"||$==="months"?mn=Se.as($):mn=ke.as($);var ge=Math.floor(mn),bt=mn-ge,Qt=M(Jt,function(It){return $===It.type});return St&&Xt&&mn>Xt&&(Ht=!0),Ue&&Xe&&Math.abs(P.duration.as($))<Xe&&(yt=!0),St&&Ge===null&&Qt.length>1&&(Ge=!0),ke.subtract(ge,$),Se.subtract(ge,$),{rawValue:mn,wholeValue:ge,decimalValue:Ue?bt:0,isSmallest:Ue,isLargest:St,type:$,tokenLength:Qt.length}});var Rt=we?Math.floor:Math.round,Cn=function($,$e){var Ue=Math.pow(10,$e);return Rt($*Ue)/Ue},vt=!1,Ft=!1,Sn=function($,$e){var Ue={useGrouping:He,groupingSeparator:nn,decimalSeparator:qt,grouping:cn,useToLocaleString:Mt};return Be&&(mt<=0?($.rawValue=0,$.wholeValue=0,$.decimalValue=0):(Ue.maximumSignificantDigits=mt,$.significantDigits=mt)),Ht&&!Ft&&($.isLargest?($.wholeValue=Xt,$.decimalValue=0):($.wholeValue=0,$.decimalValue=0)),yt&&!Ft&&($.isSmallest?($.wholeValue=Xe,$.decimalValue=0):($.wholeValue=0,$.decimalValue=0)),$.isSmallest||$.significantDigits&&$.significantDigits-$.wholeValue.toString().length<=0?Re<0?$.value=Cn($.wholeValue,Re):Re===0?$.value=Rt($.wholeValue+$.decimalValue):Be?(we?$.value=Cn($.rawValue,mt-$.wholeValue.toString().length):$.value=$.rawValue,$.wholeValue&&(mt-=$.wholeValue.toString().length)):(Ue.fractionDigits=Re,we?$.value=$.wholeValue+Cn($.decimalValue,Re):$.value=$.wholeValue+$.decimalValue):Be&&$.wholeValue?($.value=Math.round(Cn($.wholeValue,$.significantDigits-$.wholeValue.toString().length)),mt-=$.wholeValue.toString().length):$.value=$.wholeValue,$.tokenLength>1&&(Ge||vt)&&(Ue.minimumIntegerDigits=$.tokenLength,Ft&&Ue.maximumSignificantDigits<$.tokenLength&&delete Ue.maximumSignificantDigits),!vt&&($.value>0||Ot===""||M(de,$.type)||M(ne,$.type))&&(vt=!0),$.formattedValue=h($.value,Ue,Pe),Ue.useGrouping=!1,Ue.decimalSeparator=".",$.formattedValueEn=h($.value,Ue,"en"),$.tokenLength===2&&$.type==="milliseconds"&&($.formattedValueMS=h($.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),$};if(We=_(We,Sn),We=k(We),We.length>1){var qn=function($){return M(We,function($e){return $e.type===$})},zn=function($){var $e=qn($.type);$e&&R($.targets,function(Ue){var St=qn(Ue.type);St&&parseInt($e.formattedValueEn,10)===Ue.value&&($e.rawValue=0,$e.wholeValue=0,$e.decimalValue=0,St.rawValue+=1,St.wholeValue+=1,St.decimalValue=0,St.formattedValueEn=St.wholeValue.toString(),Ft=!0)})};R(l,zn)}return Ft&&(vt=!1,mt=ft,We=_(We,Sn),We=k(We)),ne&&!(Ht&&!P.trim)?(We=_(We,function($){return M(ne,function($e){return $.type===$e})?$:null}),We=k(We)):(Pt&&(We=C(We,function($){return!$.isSmallest&&!$.wholeValue&&!M(de,$.type)})),xe&&We.length&&(We=We.slice(0,xe)),yn&&We.length>1&&(We=E(We,function($){return!$.wholeValue&&!M(de,$.type)&&!$.isLargest})),Yt&&(We=_(We,function($,$e){return $e>0&&$e<We.length-1&&!$.wholeValue?null:$}),We=k(We)),dn&&We.length===1&&!We[0].wholeValue&&!(!we&&We[0].isSmallest&&We[0].rawValue<Xe)&&(We=[])),me?We:(R(Jt,function($){var $e=Qe[$.type],Ue=M(We,function(It){return It.type===$.type});if(!(!$e||!Ue)){var St=Ue.formattedValueEn.split(".");St[0]=parseInt(St[0],10),St[1]?St[1]=parseFloat("0."+St[1],10):St[1]=null;var mn=be.durationPluralKey($e,St[0],St[1]),ge=p($e,be),bt=!1,Qt={};R(be._durationLabelTypes,function(It){var Nt=M(ge,function(on){return on.type===It.type&&on.key===mn});Nt&&(Qt[Nt.type]=Nt.label,u($.text,It.string)&&($.text=$.text.replace(It.string,Nt.label),bt=!0))}),st&&!bt&&(ge.sort(m),R(ge,function(It){if(Qt[It.type]===It.label)return u($.text,It.label)?!1:void 0;if(u($.text,It.label))return $.text=$.text.replace(It.label,Qt[It.type]),!1}))}}),Jt=_(Jt,function($){if(!$.type)return $.text;var $e=M(We,function(St){return St.type===$.type});if(!$e)return"";var Ue="";return Te&&(Ue+=$.text),(he&&Ht||!he&&yt)&&(Ue+="< ",Ht=!1,yt=!1),(he&&yt||!he&&Ht)&&(Ue+="> ",Ht=!1,yt=!1),he&&($e.value>0||Ot===""||M(de,$e.type)||M(ne,$e.type))&&(Ue+="-",he=!1),$.type==="milliseconds"&&$e.formattedValueMS?Ue+=$e.formattedValueMS:Ue+=$e.formattedValue,Te||(Ue+=$.text),Ue}),Jt.join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function se(){var H=this.duration,P=function(ke){return H._data[ke]},X=M(this.types,P),ce=O(this.types,P);switch(X){case"milliseconds":return"S __";case"seconds":case"minutes":return"*_MS_";case"hours":return"_HMS_";case"days":if(X===ce)return"d __";case"weeks":return X===ce?"w __":(this.trim===null&&(this.trim="both"),"w __, d __, h __");case"months":if(X===ce)return"M __";case"years":return X===ce?"y __":(this.trim===null&&(this.trim="both"),"y __, M __, d __");default:return this.trim===null&&(this.trim="both"),"y __, d __, h __, m __, s __"}}function ue(H){if(!H)throw"Moment Duration Format init cannot find moment instance.";H.duration.format=Q,H.duration.fn.format=te,H.duration.fn.format.defaults={trim:null,stopTrim:null,largest:null,maxValue:null,minValue:null,precision:0,trunc:!1,forceLength:null,userLocale:null,usePlural:!0,useLeftUnits:!1,useGrouping:!0,useSignificantDigits:!1,template:se,useToLocaleString:!0,groupingSeparator:",",decimalSeparator:".",grouping:[3]},H.updateLocale("en",b)}var fe=function(H,P,X){return H.toLocaleString(P,X)};r=j()&&ee(fe),i=r&&ie(fe);var re=function(H,P,X){if(typeof window<"u"&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(P,X).format(H)};return o=ee(re),s=o&&ie(re),ue(n),ue})}(Jo)),Jo.exports}m1();const p1=["true","t","yes","y","on","1"],v1=["false","f","no","n","off","0"];function Dt(e,t=""){return{kind:J.Text,readonly:!0,allowOverlay:!0,data:e,displayData:e,errorDetails:t,isError:!0,style:"faded"}}function mi(e){return Object.hasOwn(e,"isError")&&e.isError}function b1(e){return Object.hasOwn(e,"tooltip")&&e.tooltip!==""}function Ca(e){return Object.hasOwn(e,"isMissingValue")&&e.isMissingValue}function Os(e=!1){return e?{kind:J.Loading,allowOverlay:!1,isMissingValue:!0,copyData:""}:{kind:J.Loading,allowOverlay:!1,copyData:""}}function w1(e,t){const n=t?"faded":"normal";return{kind:J.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function Ps(e){return{id:e.id,title:e.title,hasMenu:!1,menuIcon:"dots",themeOverride:e.themeOverride,icon:e.icon,group:e.group,...e.isStretched&&!e.isPinned&&{grow:1},...e.width&&{width:e.width}}}function co(e,t){return Le(e)?t||{}:Le(t)?e||{}:Lc(e,t)}function Bd(e){if(Le(e))return[];if(typeof e=="number"||typeof e=="boolean")return[e];if(typeof e=="string"){if(e==="")return[];if(e.trim().startsWith("[")&&e.trim().endsWith("]"))try{return JSON.parse(e)}catch{return[e]}else return e.split(",")}try{const t=JSON.parse(JSON.stringify(e,(n,r)=>typeof r=="bigint"?Number(r):r));return Array.isArray(t)?t.map(n=>["string","number","boolean","null"].includes(typeof n)?n:gt(n)):[gt(t)]}catch{return[gt(e)]}}function y1(e){return e&&e.startsWith("{")&&e.endsWith("}")}function gt(e){try{try{return h1(e)}catch{return JSON.stringify(e,(n,r)=>typeof r=="bigint"?Number(r):r)}}catch{return`[${typeof e}]`}}function Wd(e){if(Le(e))return null;if(typeof e=="boolean")return e;const t=gt(e).toLowerCase().trim();if(t==="")return null;if(p1.includes(t))return!0;if(v1.includes(t))return!1}function io(e){if(Le(e))return null;if(Array.isArray(e))return NaN;if(typeof e=="string"){if(e.trim().length===0)return null;try{const t=Xi.unformat(e.trim());if(lt(t))return t}catch{}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function la(e){if(Le(e))return"";if(typeof e=="string")return e;try{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}catch{return gt(e)}}function C1(e){if(e===0||Math.abs(e)>=1e-4)return 4;const n=e.toExponential().split("e");return Math.abs(parseInt(n[1],10))}function zr(e,t={}){const n=navigator.languages;try{return new Intl.NumberFormat(n,t).format(e)}catch(r){if(r instanceof RangeError)return new Intl.NumberFormat(void 0,t).format(e);throw r}}function ua(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":Le(t)||t===""?lt(n)?(n===0&&(e=Math.round(e)),Xi(e).format({thousandSeparated:!1,mantissa:n,trimMantissa:!1})):Xi(e).format({thousandSeparated:!1,mantissa:C1(e),trimMantissa:!0}):t==="plain"?Xi(e).format({thousandSeparated:!1,mantissa:20,trimMantissa:!0}):t==="localized"?zr(e,{minimumFractionDigits:n??void 0,maximumFractionDigits:n??void 0}):t==="percent"?zr(e,{style:"percent",minimumFractionDigits:lt(n)?Math.max(n-2,0):0,maximumFractionDigits:lt(n)?Math.max(n-2,0):2}):t==="dollar"?zr(e,{style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="euro"?zr(e,{style:"currency",currency:"EUR",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="yen"?zr(e,{style:"currency",currency:"JPY",minimumFractionDigits:n??0,maximumFractionDigits:n??0}):["compact","scientific","engineering"].includes(t)?zr(e,{notation:t}):t==="accounting"?Xi(e).format({thousandSeparated:!0,negative:"parenthesis",mantissa:n??2,trimMantissa:!1}):t==="bytes"?zr(e,{notation:"compact",style:"unit",unit:"byte",unitDisplay:"narrow",maximumFractionDigits:1}).replace("BB","GB"):yg.sprintf(t,e)}function Uu(e,t,n="datetime"){if(t==="localized"){const r=navigator.languages,i=n==="time"?void 0:"medium",o=n==="date"?void 0:"medium";try{return new Intl.DateTimeFormat(r,{dateStyle:i,timeStyle:o}).format(e.toDate())}catch(s){if(s instanceof RangeError)return new Intl.DateTimeFormat(void 0,{dateStyle:i,timeStyle:o}).format(e.toDate());throw s}}else{if(t==="distance")return e.fromNow();if(t==="calendar")return e.calendar();if(t==="iso8601")return n==="date"?e.format("YYYY-MM-DD"):n==="time"?e.format("HH:mm:ss.SSS[Z]"):e.toISOString()}return e.format(t)}function Bo(e){if(Le(e))return null;if(e instanceof Date)return isNaN(e.getTime())?void 0:e;if(typeof e=="string"&&e.trim().length===0)return null;try{const t=Number(e);if(!isNaN(t)){let n=t;t>=10**18?n=t/1e3**3:t>=10**15?n=t/1e3**2:t>=10**12&&(n=t/1e3);const r=Vr.unix(n).utc();if(r.isValid())return r.toDate()}if(typeof e=="string"){const n=Vr.utc(e);if(n.isValid())return n.toDate();const r=Vr.utc(e,[Vr.HTML5_FMT.TIME_MS,Vr.HTML5_FMT.TIME_SECONDS,Vr.HTML5_FMT.TIME]);if(r.isValid())return r.toDate()}}catch{return}}function Ud(e){if(e%1===0)return 0;let t=e.toString();return t.indexOf("e")!==-1&&(t=e.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20})),t.indexOf(".")===-1?0:t.split(".")[1].length}function S1(e,t){if(!Number.isFinite(e))return e;if(t<=0)return Math.trunc(e);const n=10**t,r=e*n,i=Number.EPSILON*Math.abs(r)*10;return Math.trunc(r+Math.sign(r)*i)/n}const x1=new RegExp(/(\r\n|\n|\r)/gm);function oo(e){return e.indexOf(`
|
186
|
+
`)!==-1?e.replace(x1," "):e}function k1(e,t){if(Le(t))return"";try{const n=t.match(e);return n&&n[1]!==void 0?decodeURIComponent(n[1].replace(/\+/g,"%20")):t}catch{return t}}const M1=Un("div",{target:"e48kivf0"})(({theme:e})=>({overflowY:"auto",padding:e.spacing.sm,".react-json-view .copy-icon svg":{fontSize:"0.9em !important",marginRight:`${e.spacing.threeXS} !important`,verticalAlign:"middle !important"}})),qd=({jsonValue:e,theme:t})=>{let n;if(e)try{n=typeof e=="string"?Ga.parse(e):Ga.parse(Ga.stringify(e))}catch{n=void 0}return Le(n)?qe(Ur,{highlight:!0,autoFocus:!1,disabled:!0,value:la(e)??"",onChange:()=>{}}):qe(M1,{"data-testid":"stJsonColumnViewer",children:qe(Mh,{src:n,collapsed:2,theme:Rh(t.bgCell)>.5?"rjv-default":"monokai",displayDataTypes:!1,displayObjectSize:!1,name:!1,enableClipboard:!0,style:{fontFamily:t.fontFamily,fontSize:t.baseFontStyle,backgroundColor:t.bgCell,whiteSpace:"pre-wrap"}})})},R1=e=>{const t=e.theme,n=e.value.data;return qe(qd,{jsonValue:n.value||n.displayValue,theme:t})},I1=e=>{const t=e.theme,n=e.value;return qe(qd,{jsonValue:n.data,theme:t})},E1={kind:J.Custom,isMatch:e=>e.data.kind==="json-cell",draw:(e,t)=>{const{value:n,displayValue:r}=t.data;return Gs(e,r??la(n)??"",t.contentAlign),!0},measure:(e,t,n)=>{const{value:r,displayValue:i}=t.data,o=i??la(r)??"";return(o?e.measureText(o).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:R1})},Gd="line_chart",T1="area_chart",Xd="bar_chart";function el(e,t,n){const r=co({y_min:null,y_max:null},t.columnTypeOptions),i={kind:J.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,yAxis:[r.y_min??0,r.y_max??1]}};return{...t,kind:e,typeIcon:e===Gd?":material/show_chart:":e===Xd?":material/bar_chart:":":material/area_chart:",sortMode:"default",isEditable:!1,getCell(o){if(Le(o))return Os();const s=Bd(o),a=[];let l=[];if(s.length===0)return Os();let u=Number.MIN_SAFE_INTEGER,c=Number.MAX_SAFE_INTEGER;for(let h=0;h<s.length;h++){const m=io(s[h]);if(Number.isNaN(m)||Le(m))return Dt(gt(s),`The value cannot be interpreted as a numeric array. ${gt(m)} is not a number.`);m>u&&(u=m),m<c&&(c=m),a.push(m)}let d,g;if(s.length===1){let h;u<=0?h=u===0?1:0:h=u,d=r.y_max??h,g=r.y_min??(u>=0?0:u)}else d=r.y_max??u,g=r.y_min??c;return Le(g)||Le(d)||Number.isNaN(g)||Number.isNaN(d)||g>=d?Dt("Invalid min/max y-axis configuration",`The y_min (${g}) and y_max (${d}) configuration options must be valid numbers.`):(a.length>0&&(u>d||c<g)?l=a.map(h=>u-c===0?u>(d||1)?d:g:(d-g)*((h-c)/(u-c))+g):l=a,{...i,copyData:a.join(","),data:{...i.data,values:l,displayValues:a.map(h=>ua(h)),yAxis:[g,d]},isMissingValue:Le(o)})},getCellValue(o){return o.kind===J.Loading||o.data?.values===void 0?null:o.data?.values}}}function Yd(e){return el(Gd,e,"line")}Yd.isEditableType=!1;function jd(e){return el(Xd,e,"bar")}jd.isEditableType=!1;function Kd(e){return el(T1,e,"area")}Kd.isEditableType=!1;function tl(e){const t={kind:J.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:"normal"};return{...e,kind:"checkbox",typeIcon:":material/check_box:",sortMode:"default",getCell(n){let r=null;return r=Wd(n),r===void 0?Dt(gt(n),"The value cannot be interpreted as boolean."):{...t,data:r,isMissingValue:Le(r)}},getCellValue(n){return n.data===void 0?null:n.data}}}tl.isEditableType=!0;function qu(e,t){return t.startsWith("+")||t.startsWith("-")?e=e.utcOffset(t,!1):e=e.tz(t),e}function nl(e,t,n,r,i,o,s){const a=co({format:n,step:r,timezone:s},t.columnTypeOptions);let l;if(lt(a.timezone))try{l=qu(Pl(),a.timezone)?.utcOffset()||void 0}catch{}let u;lt(a.min_value)&&(u=Bo(a.min_value)||void 0);let c;lt(a.max_value)&&(c=Bo(a.max_value)||void 0);const d={kind:J.Custom,allowOverlay:!0,copyData:"",readonly:!t.isEditable,contentAlign:t.contentAlignment,style:t.isPinned?"faded":"normal",data:{kind:"date-picker-cell",date:void 0,displayDate:"",step:a.step?.toString()||"1",format:i,min:u,max:c}},g=h=>{const m=Bo(h);return m===null?!t.isRequired:!(m===void 0||lt(u)&&o(m)<o(u)||lt(c)&&o(m)>o(c))};return{...t,kind:e,typeIcon:e==="date"?":material/calendar_month:":e==="time"?":material/access_time:":":material/calendar_today:",sortMode:"default",validateInput:g,getCell(h,m){if(m===!0){const S=g(h);if(S===!1)return Dt(gt(h),"Invalid input.");S instanceof Date&&(h=S)}const p=Bo(h);let y="",b="",v=l;if(p===void 0)return Dt(gt(h),"The value cannot be interpreted as a datetime object.");if(p!==null){let S=Pl.utc(p);if(!S.isValid())return Dt(gt(p),`Invalid moment date. This should never happen. Please report this bug.
|
187
|
+
Error: ${S.toString()}`);if(a.timezone){try{S=qu(S,a.timezone)}catch(O){return Dt(S.toISOString(),`Failed to adjust to the provided timezone: ${a.timezone}.
|
188
|
+
Error: ${O}`)}v=S.utcOffset()}try{b=Uu(S,a.format||n,e)}catch(O){return Dt(S.toISOString(),`Failed to format the date for rendering with: ${a.format}.
|
189
|
+
Error: ${O}`)}y=Uu(S,n,e)}return{...d,copyData:y,isMissingValue:Le(p),data:{...d.data,date:p,displayDate:b,timezoneOffset:v}}},getCellValue(h){return Le(h?.data?.date)?null:o(h.data.date)}}}function rl(e){let t="YYYY-MM-DD HH:mm:ss";e.columnTypeOptions?.step>=60?t="YYYY-MM-DD HH:mm":e.columnTypeOptions?.step<1&&(t="YYYY-MM-DD HH:mm:ss.SSS");const n=Ih(e.arrowType),r=lt(n)||lt(e?.columnTypeOptions?.timezone);return nl("datetime",e,r?t+"Z":t,1,"datetime-local",i=>r?i.toISOString():i.toISOString().replace("Z",""),n)}rl.isEditableType=!0;function il(e){let t="HH:mm:ss";return e.columnTypeOptions?.step>=60?t="HH:mm":e.columnTypeOptions?.step<1&&(t="HH:mm:ss.SSS"),nl("time",e,t,1,"time",n=>n.toISOString().split("T")[1].replace("Z",""))}il.isEditableType=!0;function ol(e){return nl("date",e,"YYYY-MM-DD",1,"date",t=>t.toISOString().split("T")[0])}ol.isEditableType=!0;function Zd(e){const t={kind:J.Image,data:[],displayData:[],readonly:!0,allowOverlay:!0,contentAlign:e.contentAlignment||"center",style:"normal"};return{...e,kind:"image",typeIcon:":material/image:",sortMode:"default",isEditable:!1,getCell(n){const r=lt(n)?[gt(n)]:[];return{...t,data:r,isMissingValue:!lt(n),displayData:r}},getCellValue(n){return n.data===void 0||n.data.length===0?null:n.data[0]}}}Zd.isEditableType=!1;function Jd(e){const t={kind:J.Custom,allowOverlay:!0,contentAlign:e.contentAlignment,readonly:!0,style:e.isPinned?"faded":"normal",copyData:"",data:{kind:"json-cell",value:""}};return{...e,kind:"json",typeIcon:":material/code_blocks:",sortMode:"default",isEditable:!1,getCell(n){try{const r=lt(n)?oo(la(n)):"";return{...t,copyData:r,isMissingValue:Le(n),data:{...t.data,value:n,displayValue:r}}}catch(r){return Dt(gt(n),`The value cannot be interpreted as a JSON string. Error: ${r}`)}},getCellValue(n){return n.data?.value??null}}}Jd.isEditableType=!1;function Qd(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(l){n=`Invalid validate regex: ${t.validate}.
|
190
|
+
Error: ${l}`}let r=!1,i=t.display_text,o;if(!Le(i)){if(i.startsWith(":material/")&&Eh(i))i=Th(i).icon,r=!0;else if(i.includes("(")&&i.includes(")"))try{o=new RegExp(i,"us")}catch{o=void 0}}const s={kind:J.Uri,readonly:!e.isEditable,allowOverlay:!r,contentAlign:e.contentAlignment??(r?"center":void 0),style:"normal",hoverEffect:!0,data:"",displayData:"",copyData:"",...r&&{themeOverride:{fontFamily:Dh.iconFont,linkColor:void 0}}},a=l=>{if(Le(l))return!e.isRequired;const u=gt(l);return!(t.max_chars&&u.length>t.max_chars||n instanceof RegExp&&n.test(u)===!1)};return{...e,kind:"link",typeIcon:":material/link:",sortMode:"default",validateInput:a,getCell(l,u){if(Le(l))return{...s,data:null,isMissingValue:!0,onClickUri:()=>{},themeOverride:void 0};const c=l;if(typeof n=="string")return Dt(gt(c),n);if(u&&a(c)===!1)return Dt(gt(c),"Invalid input.");let d="";return c&&(o!==void 0?d=k1(o,c):d=i||c),{...s,data:c,displayData:d,isMissingValue:Le(c),onClickUri:g=>{window.open(c.startsWith("www.")?`https://${c}`:c,"_blank","noopener,noreferrer"),g.preventDefault()},copyData:c}},getCellValue(l){return Le(l.data)?null:l.data}}}Qd.isEditableType=!0;function al(e){const t={kind:J.Bubble,data:[],allowOverlay:!0,contentAlign:e.contentAlignment,style:"normal"};return{...e,kind:"list",sortMode:"default",typeIcon:":material/list:",isEditable:!1,getCell(n){const r=Le(n)?[]:Bd(n);return{...t,data:r,isMissingValue:Le(n),copyData:Le(n)?"":gt(r.map(i=>typeof i=="string"&&i.includes(",")?i.replace(/,/g," "):i))}},getCellValue(n){return Le(n.data)||Ca(n)?null:n.data}}}al.isEditableType=!1;function sl(e){const t=co({step:Ac(e.arrowType)?1:void 0,min_value:Oh(e.arrowType)?0:void 0},e.columnTypeOptions),n=!t.format&&(Ph(e.arrowType)||_h(e.arrowType)),r=Le(t.min_value)||t.min_value<0,i=lt(t.step)&&!Number.isNaN(t.step)?Ud(t.step):void 0,o={kind:J.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||n?"left":"right",style:e.isPinned?"faded":"normal",allowNegative:r,fixedDecimals:i,thousandSeparator:""},s=a=>{let l=io(a);if(Le(l))return!e.isRequired;if(Number.isNaN(l))return!1;let u=!1;return lt(t.max_value)&&l>t.max_value&&(l=t.max_value,u=!0),lt(t.min_value)&&l<t.min_value?!1:u?l:!0};return{...e,kind:"number",sortMode:"smart",typeIcon:":material/tag:",validateInput:s,getCell(a,l){if(l===!0){const d=s(a);if(d===!1)return Dt(gt(a),"Invalid input.");typeof d=="number"&&(a=d)}let u=io(a),c="";if(lt(u)){if(Number.isNaN(u))return Dt(gt(a),"The value cannot be interpreted as a number.");if(lt(i)&&(u=S1(u,i)),Number.isInteger(u)&&!Number.isSafeInteger(u))return Dt(gt(a),"The value is larger than the maximum supported integer values in number columns (2^53).");try{n?c=Ss(u,e.arrowType):c=ua(u,t.format,i)}catch(d){return Dt(gt(u),lt(t.format)?`Failed to format the number based on the provided format configuration: (${t.format}). Error: ${d}`:`Failed to format the number. Error: ${d}`)}}return{...o,data:u,displayData:c,isMissingValue:Le(u),copyData:Le(u)?"":gt(u)}},getCellValue(a){return a.data===void 0?null:a.data}}}sl.isEditableType=!0;function ao(e){const t={kind:J.Text,data:"",displayData:"",allowOverlay:!0,contentAlign:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!0,style:e.isPinned?"faded":"normal"};return{...e,kind:"object",sortMode:"default",typeIcon:":material/data_object:",isEditable:!1,getCell(n){try{const r=lt(n)?gt(n):null,i=lt(r)?oo(r):"";return{...t,data:r,displayData:i,isMissingValue:Le(n)}}catch(r){return Dt(gt(n),`The value cannot be interpreted as a string. Error: ${r}`)}},getCellValue(n){return n.data===void 0?null:n.data}}}ao.isEditableType=!1;function ef(e){const t=Ac(e.arrowType),n=co({min_value:0,max_value:t?100:1,format:t?"%3d%%":"percent",step:t?1:void 0},e.columnTypeOptions),r=Le(n.step)||Number.isNaN(n.step)?void 0:Ud(n.step);let i;try{i=ua(n.max_value,n.format,r)}catch{i=gt(n.max_value)}const o={kind:J.Custom,allowOverlay:!1,copyData:"",contentAlign:e.contentAlignment,readonly:!0,data:{kind:"range-cell",min:n.min_value,max:n.max_value,step:n.step??.01,value:n.min_value,label:String(n.min_value),measureLabel:i}};return{...e,kind:"progress",sortMode:"smart",typeIcon:":material/commit:",isEditable:!1,getCell(s){if(Le(s))return Os();if(Le(n.min_value)||Le(n.max_value)||Number.isNaN(n.min_value)||Number.isNaN(n.max_value)||n.min_value>=n.max_value)return Dt("Invalid min/max parameters",`The min_value (${n.min_value}) and max_value (${n.max_value}) parameters must be valid numbers.`);if(lt(n.step)&&Number.isNaN(n.step))return Dt("Invalid step parameter",`The step parameter (${n.step}) must be a valid number.`);const a=io(s);if(Number.isNaN(a)||Le(a))return Dt(gt(s),"The value cannot be interpreted as a number.");if(Number.isInteger(a)&&!Number.isSafeInteger(a))return Dt(gt(s),"The value is larger than the maximum supported integer values in number columns (2^53).");let l="";try{l=ua(a,n.format,r)}catch(c){return Dt(gt(a),lt(n.format)?`Failed to format the number based on the provided format configuration: (${n.format}). Error: ${c}`:`Failed to format the number. Error: ${c}`)}const u=Math.min(n.max_value,Math.max(n.min_value,a));return{...o,isMissingValue:Le(s),copyData:String(a),data:{...o.data,value:u,label:l,measureLabel:l.length>i.length?l:i}}},getCellValue(s){return s.kind===J.Loading||s.data?.value===void 0?null:s.data?.value}}}ef.isEditableType=!1;function ll(e){let t="string";const n=co({options:Hc(e.arrowType)?[!0,!1]:e.arrowType.categoricalOptions??[]},e.columnTypeOptions),r=new Set(n.options.map(o=>typeof o));r.size===1&&(r.has("number")||r.has("bigint")?t="number":r.has("boolean")&&(t="boolean"));const i={kind:J.Custom,allowOverlay:!0,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isPinned?"faded":"normal",data:{kind:"dropdown-cell",allowedValues:[...e.isRequired!==!0?[null]:[],...n.options.filter(o=>o!==null&&o!=="").map(o=>gt(o))],value:""}};return{...e,kind:"selectbox",sortMode:"default",typeIcon:":material/arrow_drop_down_circle:",getCell(o,s){let a=null;return lt(o)&&o!==""&&(a=gt(o)),s&&!i.data.allowedValues.includes(a)?Dt(gt(a),"The value is not part of the allowed options."):{...i,isMissingValue:a===null,copyData:a||"",data:{...i.data,value:a}}},getCellValue(o){return Le(o.data?.value)||o.data?.value===""?null:t==="number"?io(o.data?.value)??null:t==="boolean"?Wd(o.data?.value)??null:o.data?.value}}}ll.isEditableType=!0;function ul(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(o){n=`Invalid validate regex: ${t.validate}.
|
191
|
+
Error: ${o}`}const r={kind:J.Text,data:"",displayData:"",allowOverlay:!0,contentAlign:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!e.isEditable,style:e.isPinned?"faded":"normal"},i=o=>{if(Le(o))return!e.isRequired;let s=gt(o),a=!1;return t.max_chars&&s.length>t.max_chars&&(s=s.slice(0,t.max_chars),a=!0),n instanceof RegExp&&n.test(s)===!1?!1:a?s:!0};return{...e,kind:"text",sortMode:"default",typeIcon:":material/notes:",validateInput:i,getCell(o,s){if(typeof n=="string")return Dt(gt(o),n);if(s){const a=i(o);if(a===!1)return Dt(gt(o),"Invalid input.");typeof a=="string"&&(o=a)}try{const a=lt(o)?gt(o):null,l=lt(a)?oo(a):"";return{...r,isMissingValue:Le(a),data:a,displayData:l}}catch(a){return Dt("Incompatible value",`The value cannot be interpreted as string. Error: ${a}`)}},getCellValue(o){return o.data===void 0?null:o.data}}}ul.isEditableType=!0;const Gu=Un("img",{target:"e17fx5ar0"})({maxWidth:"100%",maxHeight:"37.5rem",objectFit:"scale-down"}),D1=({urls:e})=>{const t=e&&e.length>0?e[0]:"";return t.startsWith("http")?qe("a",{href:t,target:"_blank",rel:"noreferrer noopener",children:qe(Gu,{src:t})}):qe(Gu,{src:t})},Xu=new Map(Object.entries({object:ao,text:ul,checkbox:tl,selectbox:ll,list:al,number:sl,link:Qd,datetime:rl,date:ol,time:il,line_chart:Yd,bar_chart:jd,area_chart:Kd,image:Zd,progress:ef,json:Jd})),O1=[E1];var P1=zc();const _1=sr(P1);var hs,Yu;function F1(){if(Yu)return hs;Yu=1;var e=Fh(),t=Lh(),n=Ah(),r=zc(),i=Hh(),o=zh(),s=Vh(),a=$h(),l="[object Map]",u="[object Set]",c=Object.prototype,d=c.hasOwnProperty;function g(h){if(h==null)return!0;if(i(h)&&(r(h)||typeof h=="string"||typeof h.splice=="function"||o(h)||a(h)||n(h)))return!h.length;var m=t(h);if(m==l||m==u)return!h.size;if(s(h))return!e(h).length;for(var p in h)if(d.call(h,p))return!1;return!0}return hs=g,hs}var L1=F1();const A1=sr(L1);function gs(e,t,n){if(!n.includes(t))return;const r=new RegExp(`${e}[,\\s].*{(?:[^}]*[\\s;]{1})?${t}:\\s*([^;}]+)[;]?.*}`,"gm");n=n.replace(/{/g," {");const i=r.exec(n);if(i)return i[1].trim()}function H1(e,t,n){const r={};if(!n.includes(t))return e;const i=gs(t,"color",n);i&&(r.textDark=i,e.kind===J.Bubble&&(r.textBubble=i),e.kind===J.Uri&&(r.linkColor=i));const o=gs(t,"background-color",n);o&&(r.bgCell=o),o==="yellow"&&i===void 0&&(r.textDark="#31333F");const s=gs(t,"font-weight",n);return s&&(r.baseFontStyle=`${s} ${tg.sm}`),r?{...e,themeOverride:r}:e}function z1(e){return Gh(e)||Xh(e)?ul:Yh(e)?rl:Vc(e)?il:jh(e)?ol:Kh(e)||Zh(e)?ao:Hc(e)?tl:Jh(e)?sl:Qh(e)?ll:eg(e)?al:ao}function tf(e){const t=e.length>0?e[e.length-1]:"",n=e.length>1?e.slice(0,-1).filter(r=>r!=="").join(" / "):void 0;return{title:t,group:n}}function cl(e){return{group:void 0,isEditable:!1,isIndex:!1,isPinned:!1,isHidden:!1,isStretched:!1,...e}}function V1(e,t){const n=e.columnNames.map(a=>a[t]),{title:r,group:i}=tf(n),o=e.columnTypes[t];let s=!0;return qh(o)&&(s=!1),cl({id:`_index-${t}`,indexNumber:t,name:r,title:r,group:i,isEditable:s,arrowType:o,isIndex:!0,isPinned:!0})}function $1(e,t){const n=e.columnNames.map(s=>s[t]),{title:r,group:i}=tf(n),o=e.columnTypes[t];return cl({id:`_column-${r}-${t}`,indexNumber:t,name:r,isEditable:!0,title:r,arrowType:o,group:i})}function nf(){return cl({id:"_empty-index",indexNumber:0,title:"",name:"",isEditable:!1,isIndex:!0,isPinned:!0,arrowType:{type:ng.INDEX,arrowField:new Nh("",new Bh,!0),pandasType:void 0}})}function ju(e){const t=[],{dimensions:n}=e,r=n.numIndexColumns,i=n.numDataColumns;if(r===0&&i===0)return t.push(nf()),t;for(let o=0;o<r;o++)t.push(V1(e,o));for(let o=0;o<i;o++)t.push($1(e,o+r));return t}function N1(e,t,n,r=void 0){let i;if(e.kind==="object"||e.kind==="json")i=e.getCell(lt(t.content)?oo(Ss(t.content,t.contentType)):null);else if(["time","date","datetime"].includes(e.kind)&<(t.content)&&(typeof t.content=="number"||typeof t.content=="bigint")){let o;Vc(t.contentType)&<(t.field?.type?.unit)?o=Wh(t.content,t.field):o=Vr.utc(Number(t.content)).toDate(),i=e.getCell(o)}else if(Uh(t.contentType)){const o=Le(t.content)?null:Ss(t.content,t.contentType);i=e.getCell(o)}else i=e.getCell(t.content);if(mi(i))return i;if(!e.isEditable){if(n&<(n?.displayContent)){const o=oo(n.displayContent);i.kind===J.Text?i={...i,displayData:o}:i.kind===J.Number&&Le(e.columnTypeOptions?.format)?i={...i,displayData:o}:i.kind===J.Uri&&Le(e.columnTypeOptions?.display_text)?i={...i,displayData:o}:i.kind===J.Custom&&i.data?.kind==="date-picker-cell"&&Le(e.columnTypeOptions?.format)&&(i={...i,data:{...i.data,displayDate:o}})}r&&n?.cssId&&(i=H1(i,n.cssId,r))}return i}const Qo="_index",Ku="_pos:",Zu={small:75,medium:200,large:400},rf=wa.getLogger("useColumnLoader");function B1(e){if(!Le(e)){if(typeof e=="number")return e;if(e in Zu)return Zu[e]}}const Wo=(e,t)=>wg(e,t,(r,i)=>{if(_1(i))return i});function Ju(e,t){if(!t)return e;let n={};return e.isIndex&&t.has(Qo)&&(n=Wo(n,t.get(Qo)??{})),t.has(`${Ku}${e.indexNumber}`)&&(n=Wo(n,t.get(`${Ku}${e.indexNumber}`)??{})),t.has(e.name)&&e.name!==Qo&&(n=Wo(n,t.get(e.name)??{})),t.has(e.id)&&(n=Wo(n,t.get(e.id)??{})),A1(n)?e:Lc({...e},{title:n.label,width:B1(n.width),isEditable:lt(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isPinned:n.pinned,isRequired:n.required,columnTypeOptions:n.type_config,contentAlignment:n.alignment,defaultValue:n.default,help:n.help})}function W1(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return rf.error(t),new Map}}function Qu(e){const t=e.columnTypeOptions?.type;let n;return lt(t)&&(Xu.has(t)?n=Xu.get(t):rf.warn(`Unknown column type configured in column configuration: ${t}`)),Le(n)&&(n=z1(e.arrowType)),n}function U1(e,t,n,r){const i=Br(),o=f.useMemo(()=>W1(e.columns),[e.columns]),[s,a]=f.useState(o);f.useEffect(()=>{a(o)},[o]);const l=e.useContainerWidth||lt(e.width)&&e.width>0,u=lt(e.rowHeight)&&e.rowHeight>ln("4rem"),c=f.useMemo(()=>ju(t).map(g=>{let h={...g,...Ju(g,s),isStretched:l};const m=Qu(h);return(e.editingMode===wn.EditingMode.READ_ONLY||n||m.isEditableType===!1)&&(h={...h,isEditable:!1}),e.editingMode!==wn.EditingMode.READ_ONLY&&h.isEditable==!0&&(h={...h,icon:"editable"},h.isRequired&&e.editingMode===wn.EditingMode.DYNAMIC&&(h={...h,isHidden:!1})),m(h,i)}),[t,s,l,e.editingMode,n,i]);return{columns:f.useMemo(()=>{const g=ju(t).map(y=>{let b={...y,...Ju(y,s),isStretched:l,isWrappingAllowed:u};const v=Qu(b);return(e.editingMode===wn.EditingMode.READ_ONLY||n||v.isEditableType===!1)&&(b={...b,isEditable:!1}),e.editingMode!==wn.EditingMode.READ_ONLY&&b.isEditable==!0&&(b={...b,icon:"editable"},b.isRequired&&e.editingMode===wn.EditingMode.DYNAMIC&&(b={...b,isHidden:!1})),v(b,i)}).filter(y=>!y.isHidden),h=[],m=[];r?.length?(g.forEach(y=>{y.isIndex&&!r.includes(y.name)&&!r.includes(y.id)&&y.isPinned!==!1&&h.push(y)}),r.forEach(y=>{const b=g.find(v=>v.name===y||v.id===y);b&&(b.isPinned?h.push(b):m.push(b))})):g.forEach(y=>{y.isPinned?h.push(y):m.push(y)});const p=[...h,...m];return p.length>0?p:[ao(nf())]},[t,s,u,l,n,e.editingMode,r,i]),allColumns:c,setColumnConfigMapping:a}}function eo(e){return e.isIndex?Qo:Le(e.name)?"":e.name}class Uo{constructor(t){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=t}toJson(t){const n=new Map;t.forEach(o=>{n.set(o.indexNumber,o)});const r={edited_rows:{},added_rows:[],deleted_rows:[]};return this.editedCells.forEach((o,s,a)=>{const l={};o.forEach((u,c)=>{const d=n.get(c);d&&(l[eo(d)]=d.getCellValue(u))}),r.edited_rows[s]=l}),this.addedRows.forEach(o=>{const s={};let a=!1;o.forEach((l,u,c)=>{const d=n.get(u);if(d){const g=d.getCellValue(l);d.isRequired&&d.isEditable&&Ca(l)&&(a=!0),lt(g)&&(s[eo(d)]=g)}}),a||r.added_rows.push(s)}),r.deleted_rows=this.deletedRows,JSON.stringify(r,(o,s)=>s===void 0?null:s)}fromJson(t,n){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const r=JSON.parse(t),i=new Map;n.forEach(s=>{i.set(s.indexNumber,s)});const o=new Map;n.forEach(s=>{o.set(eo(s),s)}),Object.keys(r.edited_rows).forEach(s=>{const a=Number(s),l=r.edited_rows[s];Object.keys(l).forEach(u=>{const c=l[u],d=o.get(u);if(d){const g=d.getCell(c);g&&(this.editedCells.has(a)||this.editedCells.set(a,new Map),this.editedCells.get(a)?.set(d.indexNumber,g))}})}),r.added_rows.forEach(s=>{const a=new Map;n.forEach(l=>{a.set(l.indexNumber,l.getCell(null))}),Object.keys(s).forEach(l=>{const u=s[l],c=o.get(l);if(c){const d=c.getCell(u);d&&a.set(c.indexNumber,d)}}),this.addedRows.push(a)}),this.deletedRows=r.deleted_rows}isAddedRow(t){return t>=this.numRows}getCell(t,n){if(this.isAddedRow(n))return this.addedRows[n-this.numRows].get(t);const r=this.editedCells.get(n);if(r!==void 0)return r.get(t)}setCell(t,n,r){if(this.isAddedRow(n)){if(n-this.numRows>=this.addedRows.length)return;this.addedRows[n-this.numRows].set(t,r)}else this.editedCells.get(n)===void 0&&this.editedCells.set(n,new Map),this.editedCells.get(n).set(t,r)}addRow(t){this.addedRows.push(t)}deleteRows(t){t.sort((n,r)=>r-n).forEach(n=>{this.deleteRow(n)})}deleteRow(t){if(!(Le(t)||t<0)){if(this.isAddedRow(t)){this.addedRows.splice(t-this.numRows,1);return}this.deletedRows.includes(t)||(this.deletedRows.push(t),this.deletedRows=this.deletedRows.sort((n,r)=>n-r)),this.editedCells.delete(t)}}getOriginalRowIndex(t){let n=t;for(let r=0;r<this.deletedRows.length&&!(this.deletedRows[r]>n);r++)n+=1;return n}getNumRows(){return this.numRows+this.addedRows.length-this.deletedRows.length}}const so=({columnId:e,columnConfigMapping:t,updatedProps:n})=>{const r=new Map(t),i=r.get(e),o={...i||{},...n||{}};return(i?.type_config||n?.type_config)&&(o.type_config={...i?.type_config||{},...n?.type_config||{}}),r.set(e,o),r};function q1(e){return{changeColumnFormat:f.useCallback((n,r)=>{e(i=>so({columnId:n,columnConfigMapping:i,updatedProps:{type_config:{format:r}}}))},[e])}}function G1(e,t,n,r,i,o){const s=f.useMemo(()=>e.filter(c=>c.isPinned).reduce((c,d)=>c+(d.width??r*2),0)>n*.6,[e,n,r]),a=t||s?0:e.filter(c=>c.isPinned).length,l=f.useCallback(c=>{o(d=>so({columnId:c,columnConfigMapping:d,updatedProps:{pinned:!1}})),i(!0,!1)},[i,o]);return{pinColumn:f.useCallback(c=>{o(d=>so({columnId:c,columnConfigMapping:d,updatedProps:{pinned:!0}})),i(!0,!1)},[i,o]),unpinColumn:l,freezeColumns:a}}function X1(e,t,n,r,i){return{onColumnMoved:f.useCallback((s,a)=>{const l=[...e],[u]=l.splice(s,1);l.splice(a,0,u),a<t&&!u.isPinned?n(u.id):a>=t&&u.isPinned&&r(u.id),i(l.map(c=>c.id))},[e,t,n,r,i])}}function Y1(e){const[t,n]=f.useState(()=>new Map),r=f.useCallback((o,s,a,l)=>{o.id&&n(new Map(t).set(o.id,l))},[t]);return{columns:f.useMemo(()=>e.map(o=>o.id&&t.has(o.id)&&t.get(o.id)!==void 0?{...o,width:t.get(o.id),grow:0}:o),[e,t]),onColumnResize:r}}function j1(e){switch(e.kind){case J.Number:return e.data?.toString()??"";case J.Boolean:return e.data?.toString()??"";case J.Markdown:case J.RowID:case J.Text:case J.Uri:return e.data??"";case J.Bubble:case J.Image:return e.data.join("");case J.Drilldown:return e.data.map(t=>t.text).join("");case J.Protected:case J.Loading:return"";case J.Custom:return e.copyData}}function ec(e){if(typeof e=="number")return e;if(e.length>0){const t=Number(e);isNaN(t)||(e=t)}return e}function K1(e,t){return e=ec(e),t=ec(t),typeof e=="string"&&typeof t=="string"?e.localeCompare(t):typeof e=="number"&&typeof t=="number"?e===t?0:e>t?1:-1:e==t?0:e>t?1:-1}function Z1(e,t){return e>t?1:e===t?0:-1}function J1(e){const{sort:t,rows:n,getCellContent:r}=e,i=f.useMemo(()=>t===void 0?[]:Array.isArray(t)?t:[t],[t]),o=f.useMemo(()=>i.map(u=>{const c=e.columns.findIndex(d=>u.column===d||d.id!==void 0&&u.column.id===d.id);return c===-1?void 0:c}),[i,e.columns]),s=f.useMemo(()=>{const u=i.map((d,g)=>({sort:d,col:o[g]})).filter(d=>d.col!==void 0);if(u.length===0)return;const c=u.map(()=>new Array(n));for(let d=0;d<u.length;d++){const{col:g}=u[d],h=[g,0];for(let m=0;m<n;m++)h[1]=m,c[d][m]=j1(r(h))}return xr(n).sort((d,g)=>{for(let h=0;h<u.length;h++){const{sort:m}=u[h],p=c[h][d],y=c[h][g];let b;if(m.mode==="raw"?b=Z1(p,y):m.mode==="smart"?b=K1(p,y):b=p.localeCompare(y),b!==0)return(m.direction??"asc")==="desc"&&(b=-b),b}return 0})},[r,n,i,o]),a=f.useCallback(u=>s===void 0?u:s[u],[s]),l=f.useCallback(([u,c])=>s===void 0?r([u,c]):(c=s[c],r([u,c])),[r,s]);return s===void 0?{getCellContent:e.getCellContent,getOriginalIndex:a}:{getOriginalIndex:a,getCellContent:l}}function Q1(e,t){return t===void 0?e:e.map(n=>n.id===t.column.id?{...n,title:t.direction==="asc"?`↑ ${n.title}`:`↓ ${n.title}`}:n)}function eb(e,t,n){const[r,i]=f.useState(),{getCellContent:o,getOriginalIndex:s}=J1({columns:t.map(u=>Ps(u)),getCellContent:n,rows:e,sort:r}),a=f.useMemo(()=>Q1(t,r),[t,r]),l=f.useCallback((u,c,d)=>{const g=a[u];let h;c==="auto"?(h="asc",r&&r.column.id===g.id&&(r.direction==="asc"?h="desc":h=void 0)):h=c,h===void 0||d&&h===r?.direction?i(void 0):i({column:Ps(g),direction:h,mode:g.sortMode})},[r,a]);return{columns:a,sortColumn:l,getOriginalIndex:s,getCellContent:o}}function tb(e,t){const n=f.useCallback(i=>{t(o=>so({columnId:i,columnConfigMapping:o,updatedProps:{hidden:!0}})),e(!0,!1)},[e,t]),r=f.useCallback(i=>{t(o=>so({columnId:i,columnConfigMapping:o,updatedProps:{hidden:!1}})),e(!0,!1)},[e,t]);return{hideColumn:n,showColumn:r}}function nb(){return{provideEditor:f.useCallback(t=>{if(t.kind===J.Text&&t.readonly&&y1(t.data))return{editor:I1}},[])}}const rb={kind:J.Custom,isMatch:e=>e.data.kind==="sparkline-cell",needsHover:!0,needsHoverPosition:!0,draw:(e,t)=>{const{ctx:n,theme:r,rect:i,hoverAmount:o,hoverX:s}=e;let{values:a,yAxis:l,color:u,graphKind:c="area",displayValues:d,hideAxis:g}=t.data;const[h,m]=l;if(a.length===0)return!0;a=a.map(R=>Math.min(1,Math.max(0,(R-h)/(m-h))));const p=r.cellHorizontalPadding,y=p+i.x,b=i.y+3,v=i.height-6,S=i.width-p*2,O=m-h,M=m<=0?b:h>=0?b+v:b+v*(m/O);if(!g&&h<=0&&m>=0&&(n.beginPath(),n.moveTo(y,M),n.lineTo(y+S,M),n.globalAlpha=.4,n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.globalAlpha=1),c==="bar"){n.beginPath();const R=2,_=(a.length-1)*R,I=(S-_)/a.length;let k=y;for(const F of a){const D=b+v-F*v;n.moveTo(k,M),n.lineTo(k+I,M),n.lineTo(k+I,D),n.lineTo(k,D),k+=I+R}n.fillStyle=t.data.color??r.accentColor,n.fill()}else{a.length===1&&(a=[a[0],a[0]],d&&(d=[d[0],d[0]])),n.beginPath();const R=(i.width-16)/(a.length-1),_=a.map((k,F)=>({x:y+R*F,y:b+v-k*v}));n.moveTo(_[0].x,_[0].y);let I=0;if(_.length>2)for(I=1;I<_.length-2;I++){const k=(_[I].x+_[I+1].x)/2,F=(_[I].y+_[I+1].y)/2;n.quadraticCurveTo(_[I].x,_[I].y,k,F)}if(n.quadraticCurveTo(_[I].x,_[I].y,_[I+1].x,_[I+1].y),n.strokeStyle=u??r.accentColor,n.lineWidth=1+o*.5,n.stroke(),n.lineTo(i.x+i.width-p,M),n.lineTo(i.x+p,M),n.closePath(),c==="area"){n.globalAlpha=.2+.2*o;const k=n.createLinearGradient(0,b,0,b+v*1.4);k.addColorStop(0,u??r.accentColor);const[F,D,C]=ia(u??r.accentColor);k.addColorStop(1,`rgba(${F}, ${D}, ${C}, 0)`),n.fillStyle=k,n.fill(),n.globalAlpha=1}if(s!==void 0&&(c==="line"||c==="area")&&d!==void 0){n.beginPath();const k=Math.min(a.length-1,Math.max(0,Math.round((s-p)/R)));n.moveTo(y+k*R,i.y+1),n.lineTo(y+k*R,i.y+i.height),n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.save(),n.font=`8px ${r.fontFamily}`,n.fillStyle=r.textMedium,n.textBaseline="top",n.fillText(d[k],y,i.y+r.cellVerticalPadding),n.restore()}}return!0},provideEditor:()=>{},onPaste:(e,t)=>t};function tc(e,t,n,r,i,o){if(!(r<=0||i<=0)){if(typeof o=="number"&&o<=0){e.rect(t,n,r,i);return}typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.min(o.tl,i/2,r/2),tr:Math.min(o.tr,i/2,r/2),bl:Math.min(o.bl,i/2,r/2),br:Math.min(o.br,i/2,r/2)},o.tl=Math.max(0,o.tl),o.tr=Math.max(0,o.tr),o.br=Math.max(0,o.br),o.bl=Math.max(0,o.bl),e.moveTo(t+o.tl,n),e.arcTo(t+r,n,t+r,n+o.tr,o.tr),e.arcTo(t+r,n+i,t+r-o.br,n+i,o.br),e.arcTo(t,n+i,t,n+i-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}}function nc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nc(Object(n),!0).forEach(function(r){Yi(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var ib=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function ob(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,i=r===void 0?!1:r,o=e.defaultValue,s=o===void 0?null:o,a=e.inputValue,l=e.menuIsOpen,u=e.onChange,c=e.onInputChange,d=e.onMenuClose,g=e.onMenuOpen,h=e.value,m=lr(e,ib),p=f.useState(a!==void 0?a:n),y=ir(p,2),b=y[0],v=y[1],S=f.useState(l!==void 0?l:i),O=ir(S,2),M=O[0],R=O[1],_=f.useState(h!==void 0?h:s),I=ir(_,2),k=I[0],F=I[1],D=f.useCallback(function(j,ie){typeof u=="function"&&u(j,ie),F(j)},[u]),C=f.useCallback(function(j,ie){var ee;typeof c=="function"&&(ee=c(j,ie)),v(ee!==void 0?ee:j)},[c]),E=f.useCallback(function(){typeof g=="function"&&g(),R(!0)},[g]),T=f.useCallback(function(){typeof d=="function"&&d(),R(!1)},[d]),x=a!==void 0?a:b,N=l!==void 0?l:M,G=h!==void 0?h:k;return Fe(Fe({},m),{},{inputValue:x,menuIsOpen:N,onChange:D,onInputChange:C,onMenuClose:T,onMenuOpen:E,value:G})}function ab(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const sb=Math.min,lb=Math.max,ca=Math.round,qo=Math.floor,da=e=>({x:e,y:e});function ub(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Sa(){return typeof window<"u"}function of(e){return sf(e)?(e.nodeName||"").toLowerCase():"#document"}function ar(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function af(e){var t;return(t=(sf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function sf(e){return Sa()?e instanceof Node||e instanceof ar(e).Node:!1}function cb(e){return Sa()?e instanceof Element||e instanceof ar(e).Element:!1}function dl(e){return Sa()?e instanceof HTMLElement||e instanceof ar(e).HTMLElement:!1}function rc(e){return!Sa()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ar(e).ShadowRoot}function lf(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=fl(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function db(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function fb(e){return["html","body","#document"].includes(of(e))}function fl(e){return ar(e).getComputedStyle(e)}function hb(e){if(of(e)==="html")return e;const t=e.assignedSlot||e.parentNode||rc(e)&&e.host||af(e);return rc(t)?t.host:t}function uf(e){const t=hb(e);return fb(t)?e.ownerDocument?e.ownerDocument.body:e.body:dl(t)&&lf(t)?t:uf(t)}function fa(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=uf(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=ar(i);if(o){const a=_s(s);return t.concat(s,s.visualViewport||[],lf(i)?i:[],a&&n?fa(a):[])}return t.concat(i,fa(i,[],n))}function _s(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gb(e){const t=fl(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=dl(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=ca(n)!==o||ca(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function hl(e){return cb(e)?e:e.contextElement}function ic(e){const t=hl(e);if(!dl(t))return da(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=gb(t);let s=(o?ca(n.width):n.width)/r,a=(o?ca(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const mb=da(0);function pb(e){const t=ar(e);return!db()||!t.visualViewport?mb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vb(e,t,n){return!1}function oc(e,t,n,r){t===void 0&&(t=!1);const i=e.getBoundingClientRect(),o=hl(e);let s=da(1);t&&(s=ic(e));const a=vb()?pb(o):da(0);let l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,c=i.width/s.x,d=i.height/s.y;if(o){const g=ar(o),h=r;let m=g,p=_s(m);for(;p&&r&&h!==m;){const y=ic(p),b=p.getBoundingClientRect(),v=fl(p),S=b.left+(p.clientLeft+parseFloat(v.paddingLeft))*y.x,O=b.top+(p.clientTop+parseFloat(v.paddingTop))*y.y;l*=y.x,u*=y.y,c*=y.x,d*=y.y,l+=S,u+=O,m=ar(p),p=_s(m)}}return ub({width:c,height:d,x:l,y:u})}function bb(e,t){let n=null,r;const i=af(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:u,top:c,width:d,height:g}=e.getBoundingClientRect();if(a||t(),!d||!g)return;const h=qo(c),m=qo(i.clientWidth-(u+d)),p=qo(i.clientHeight-(c+g)),y=qo(u),v={rootMargin:-h+"px "+-m+"px "+-p+"px "+-y+"px",threshold:lb(0,sb(1,l))||1};let S=!0;function O(M){const R=M[0].intersectionRatio;if(R!==l){if(!S)return s();R?s(!1,R):r=setTimeout(()=>{s(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(O,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(O,v)}n.observe(e)}return s(!0),o}function wb(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=hl(e),c=i||o?[...u?fa(u):[],...fa(t)]:[];c.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),o&&b.addEventListener("resize",n)});const d=u&&a?bb(u,n):null;let g=-1,h=null;s&&(h=new ResizeObserver(b=>{let[v]=b;v&&v.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let m,p=l?oc(e):null;l&&y();function y(){const b=oc(e);p&&(b.x!==p.x||b.y!==p.y||b.width!==p.width||b.height!==p.height)&&n(),p=b,m=requestAnimationFrame(y)}return n(),()=>{var b;c.forEach(v=>{i&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),d?.(),(b=h)==null||b.disconnect(),h=null,l&&cancelAnimationFrame(m)}}var Fs=f.useLayoutEffect,yb=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],ha=function(){};function Cb(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function Sb(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var o=[].concat(r);if(t&&e)for(var s in t)t.hasOwnProperty(s)&&t[s]&&o.push("".concat(Cb(e,s)));return o.filter(function(a){return a}).map(function(a){return String(a).trim()}).join(" ")}var ac=function(t){return Ob(t)?t.filter(Boolean):rg(t)==="object"&&t!==null?[t]:[]},cf=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=lr(t,yb);return Fe({},n)},Kt=function(t,n,r){var i=t.cx,o=t.getStyles,s=t.getClassNames,a=t.className;return{css:o(n,t),className:i(r??{},s(n,t),a)}};function xa(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function xb(e){return xa(e)?window.innerHeight:e.clientHeight}function df(e){return xa(e)?window.pageYOffset:e.scrollTop}function ga(e,t){if(xa(e)){window.scrollTo(0,t);return}e.scrollTop=t}function kb(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return i;return document.documentElement}function Mb(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function Go(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:ha,i=df(e),o=t-i,s=10,a=0;function l(){a+=s;var u=Mb(a,i,o,n);ga(e,u),a<n?window.requestAnimationFrame(l):r(e)}l()}function sc(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=t.offsetHeight/3;r.bottom+i>n.bottom?ga(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+i,e.scrollHeight)):r.top-i<n.top&&ga(e,Math.max(t.offsetTop-i,0))}function Rb(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function lc(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function Ib(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var ff=!1,Eb={get passive(){return ff=!0}},Xo=typeof window<"u"?window:{};Xo.addEventListener&&Xo.removeEventListener&&(Xo.addEventListener("p",ha,Eb),Xo.removeEventListener("p",ha,!1));var Tb=ff;function Db(e){return e!=null}function Ob(e){return Array.isArray(e)}function Yo(e,t,n){return e?t:n}var Pb=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var o=Object.entries(t).filter(function(s){var a=ir(s,1),l=a[0];return!r.includes(l)});return o.reduce(function(s,a){var l=ir(a,2),u=l[0],c=l[1];return s[u]=c,s},{})},_b=["children","innerProps"],Fb=["children","innerProps"];function Lb(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,i=e.placement,o=e.shouldScroll,s=e.isFixedPosition,a=e.controlHeight,l=kb(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var c=l.getBoundingClientRect(),d=c.height,g=n.getBoundingClientRect(),h=g.bottom,m=g.height,p=g.top,y=n.offsetParent.getBoundingClientRect(),b=y.top,v=s?window.innerHeight:xb(l),S=df(l),O=parseInt(getComputedStyle(n).marginBottom,10),M=parseInt(getComputedStyle(n).marginTop,10),R=b-M,_=v-p,I=R+S,k=d-S-p,F=h-v+S+O,D=S+p-M,C=160;switch(i){case"auto":case"bottom":if(_>=m)return{placement:"bottom",maxHeight:t};if(k>=m&&!s)return o&&Go(l,F,C),{placement:"bottom",maxHeight:t};if(!s&&k>=r||s&&_>=r){o&&Go(l,F,C);var E=s?_-O:k-O;return{placement:"bottom",maxHeight:E}}if(i==="auto"||s){var T=t,x=s?R:I;return x>=r&&(T=Math.min(x-O-a,t)),{placement:"top",maxHeight:T}}if(i==="bottom")return o&&ga(l,F),{placement:"bottom",maxHeight:t};break;case"top":if(R>=m)return{placement:"top",maxHeight:t};if(I>=m&&!s)return o&&Go(l,D,C),{placement:"top",maxHeight:t};if(!s&&I>=r||s&&R>=r){var N=t;return(!s&&I>=r||s&&R>=r)&&(N=s?R-M:I-M),o&&Go(l,D,C),{placement:"top",maxHeight:N}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return u}function Ab(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var hf=function(t){return t==="auto"?"bottom":t},Hb=function(t,n){var r,i=t.placement,o=t.theme,s=o.borderRadius,a=o.spacing,l=o.colors;return Fe((r={label:"menu"},Yi(r,Ab(i),"100%"),Yi(r,"position","absolute"),Yi(r,"width","100%"),Yi(r,"zIndex",1),r),n?{}:{backgroundColor:l.neutral0,borderRadius:s,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},gf=f.createContext(null),zb=function(t){var n=t.children,r=t.minMenuHeight,i=t.maxMenuHeight,o=t.menuPlacement,s=t.menuPosition,a=t.menuShouldScrollIntoView,l=t.theme,u=f.useContext(gf)||{},c=u.setPortalPlacement,d=f.useRef(null),g=f.useState(i),h=ir(g,2),m=h[0],p=h[1],y=f.useState(null),b=ir(y,2),v=b[0],S=b[1],O=l.spacing.controlHeight;return Fs(function(){var M=d.current;if(M){var R=s==="fixed",_=a&&!R,I=Lb({maxHeight:i,menuEl:M,minHeight:r,placement:o,shouldScroll:_,isFixedPosition:R,controlHeight:O});p(I.maxHeight),S(I.placement),c?.(I.placement)}},[i,o,s,a,r,c,O]),n({ref:d,placerProps:Fe(Fe({},t),{},{placement:v||hf(o),maxHeight:m})})},Vb=function(t){var n=t.children,r=t.innerRef,i=t.innerProps;return Oe("div",ze({},Kt(t,"menu",{menu:!0}),{ref:r},i),n)},$b=Vb,Nb=function(t,n){var r=t.maxHeight,i=t.theme.spacing.baseUnit;return Fe({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:i,paddingTop:i})},Bb=function(t){var n=t.children,r=t.innerProps,i=t.innerRef,o=t.isMulti;return Oe("div",ze({},Kt(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:i},r),n)},mf=function(t,n){var r=t.theme,i=r.spacing.baseUnit,o=r.colors;return Fe({textAlign:"center"},n?{}:{color:o.neutral40,padding:"".concat(i*2,"px ").concat(i*3,"px")})},Wb=mf,Ub=mf,qb=function(t){var n=t.children,r=n===void 0?"No options":n,i=t.innerProps,o=lr(t,_b);return Oe("div",ze({},Kt(Fe(Fe({},o),{},{children:r,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),r)},Gb=function(t){var n=t.children,r=n===void 0?"Loading...":n,i=t.innerProps,o=lr(t,Fb);return Oe("div",ze({},Kt(Fe(Fe({},o),{},{children:r,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),r)},Xb=function(t){var n=t.rect,r=t.offset,i=t.position;return{left:n.left,position:i,top:r,width:n.width,zIndex:1}},Yb=function(t){var n=t.appendTo,r=t.children,i=t.controlElement,o=t.innerProps,s=t.menuPlacement,a=t.menuPosition,l=f.useRef(null),u=f.useRef(null),c=f.useState(hf(s)),d=ir(c,2),g=d[0],h=d[1],m=f.useMemo(function(){return{setPortalPlacement:h}},[]),p=f.useState(null),y=ir(p,2),b=y[0],v=y[1],S=f.useCallback(function(){if(i){var _=Rb(i),I=a==="fixed"?0:window.pageYOffset,k=_[g]+I;(k!==b?.offset||_.left!==b?.rect.left||_.width!==b?.rect.width)&&v({offset:k,rect:_})}},[i,a,g,b?.offset,b?.rect.left,b?.rect.width]);Fs(function(){S()},[S]);var O=f.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),i&&l.current&&(u.current=wb(i,l.current,S,{elementResize:"ResizeObserver"in window}))},[i,S]);Fs(function(){O()},[O]);var M=f.useCallback(function(_){l.current=_,O()},[O]);if(!n&&a!=="fixed"||!b)return null;var R=Oe("div",ze({ref:M},Kt(Fe(Fe({},t),{},{offset:b.offset,position:a,rect:b.rect}),"menuPortal",{"menu-portal":!0}),o),r);return Oe(gf.Provider,{value:m},n?$c.createPortal(R,n):R)},jb=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},Kb=function(t){var n=t.children,r=t.innerProps,i=t.isDisabled,o=t.isRtl;return Oe("div",ze({},Kt(t,"container",{"--is-disabled":i,"--is-rtl":o}),r),n)},Zb=function(t,n){var r=t.theme.spacing,i=t.isMulti,o=t.hasValue,s=t.selectProps.controlShouldRenderValue;return Fe({alignItems:"center",display:i&&o&&s?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},Jb=function(t){var n=t.children,r=t.innerProps,i=t.isMulti,o=t.hasValue;return Oe("div",ze({},Kt(t,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":o}),r),n)},Qb=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},ew=function(t){var n=t.children,r=t.innerProps;return Oe("div",ze({},Kt(t,"indicatorsContainer",{indicators:!0}),r),n)},uc,tw=["size"],nw=["innerProps","isRtl","size"],rw={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},pf=function(t){var n=t.size,r=lr(t,tw);return Oe("svg",ze({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:rw},r))},gl=function(t){return Oe(pf,ze({size:20},t),Oe("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},vf=function(t){return Oe(pf,ze({size:20},t),Oe("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},bf=function(t,n){var r=t.isFocused,i=t.theme,o=i.spacing.baseUnit,s=i.colors;return Fe({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?s.neutral60:s.neutral20,padding:o*2,":hover":{color:r?s.neutral80:s.neutral40}})},iw=bf,ow=function(t){var n=t.children,r=t.innerProps;return Oe("div",ze({},Kt(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||Oe(vf,null))},aw=bf,sw=function(t){var n=t.children,r=t.innerProps;return Oe("div",ze({},Kt(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||Oe(gl,null))},lw=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing.baseUnit,s=i.colors;return Fe({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?s.neutral10:s.neutral20,marginBottom:o*2,marginTop:o*2})},uw=function(t){var n=t.innerProps;return Oe("span",ze({},n,Kt(t,"indicatorSeparator",{"indicator-separator":!0})))},cw=ig(uc||(uc=ab([`
|
192
192
|
0%, 80%, 100% { opacity: 0; }
|
193
193
|
40% { opacity: 1; }
|
194
|
-
`]))),ow=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,s=o.colors,a=o.spacing.baseUnit;return Fe({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?s.neutral60:s.neutral20,padding:a*2})},gs=function(t){var n=t.delay,r=t.offset;return Oe("span",{css:Nc({animation:"".concat(iw," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},aw=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,s=sr(t,Kb);return Oe("div",ze({},Kt(Fe(Fe({},s),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Oe(gs,{delay:0,offset:r}),Oe(gs,{delay:160,offset:!0}),Oe(gs,{delay:320,offset:!r}))},sw=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,s=o.colors,a=o.borderRadius,l=o.spacing;return Fe({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?s.neutral5:s.neutral0,borderColor:r?s.neutral10:i?s.primary:s.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(s.primary):void 0,"&:hover":{borderColor:i?s.primary:s.neutral30}})},lw=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,s=t.innerProps,a=t.menuIsOpen;return Oe("div",ze({ref:o},Kt(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":a}),s,{"aria-disabled":r||void 0}),n)},uw=lw,cw=["data"],dw=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},fw=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,s=t.Heading,a=t.headingProps,l=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return Oe("div",ze({},Kt(t,"group",{group:!0}),l),Oe(s,ze({},a,{selectProps:d,theme:c,getStyles:i,getClassNames:o,cx:r}),u),Oe("div",null,n))},hw=function(t,n){var r=t.theme,i=r.colors,o=r.spacing;return Fe({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},gw=function(t){var n=sf(t);n.data;var r=sr(n,cw);return Oe("div",ze({},Kt(t,"groupHeading",{"group-heading":!0}),r))},mw=fw,pw=["innerRef","isDisabled","isHidden","inputClassName"],vw=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,s=o.spacing,a=o.colors;return Fe(Fe({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},bw),n?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:a.neutral80})},pf={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},bw={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Fe({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},pf)},ww=function(t){return Fe({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},pf)},yw=function(t){var n=t.cx,r=t.value,i=sf(t),o=i.innerRef,s=i.isDisabled,a=i.isHidden,l=i.inputClassName,u=sr(i,pw);return Oe("div",ze({},Kt(t,"input",{"input-container":!0}),{"data-value":r||""}),Oe("input",ze({className:n({input:!0},l),ref:o,style:ww(a),disabled:s},u)))},Cw=yw,Sw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,s=r.colors;return Fe({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:s.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},xw=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,s=t.cropWithEllipsis;return Fe({overflow:"hidden",textOverflow:s||s===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},kw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,s=r.colors,a=t.isFocused;return Fe({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:a?s.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:s.dangerLight,color:s.danger}})},vf=function(t){var n=t.children,r=t.innerProps;return Oe("div",r,n)},Mw=vf,Rw=vf;function Ew(e){var t=e.children,n=e.innerProps;return Oe("div",ze({role:"button"},n),t||Oe(gl,{size:14}))}var Iw=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,s=t.isDisabled,a=t.removeProps,l=t.selectProps,u=r.Container,c=r.Label,d=r.Remove;return Oe(u,{data:i,innerProps:Fe(Fe({},Kt(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),o),selectProps:l},Oe(c,{data:i,innerProps:Fe({},Kt(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),Oe(d,{data:i,innerProps:Fe(Fe({},Kt(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:l}))},Tw=Iw,Dw=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,s=t.theme,a=s.spacing,l=s.colors;return Fe({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?l.primary:i?l.primary25:"transparent",color:r?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?l.primary:l.primary50}})},Ow=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,s=t.innerRef,a=t.innerProps;return Oe("div",ze({},Kt(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:s,"aria-disabled":r},a),n)},Pw=Ow,_w=function(t,n){var r=t.theme,i=r.spacing,o=r.colors;return Fe({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},Fw=function(t){var n=t.children,r=t.innerProps;return Oe("div",ze({},Kt(t,"placeholder",{placeholder:!0}),r),n)},Lw=Fw,Aw=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,s=i.colors;return Fe({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?s.neutral40:s.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},Hw=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return Oe("div",ze({},Kt(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},zw=Hw,bf={ClearIndicator:tw,Control:uw,DropdownIndicator:Qb,DownChevron:gf,CrossIcon:gl,Group:mw,GroupHeading:gw,IndicatorsContainer:jb,IndicatorSeparator:rw,Input:Cw,LoadingIndicator:aw,Menu:Fb,MenuList:Ab,MenuPortal:Bb,LoadingMessage:Nb,NoOptionsMessage:Vb,MultiValue:Tw,MultiValueContainer:Mw,MultiValueLabel:Rw,MultiValueRemove:Ew,Option:Pw,Placeholder:Lw,SelectContainer:Ub,SingleValue:zw,ValueContainer:Gb},Vw=function(t){return Fe(Fe({},bf),t.components)},uc=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Nw(e,t){return!!(e===t||uc(e)&&uc(t))}function $w(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Nw(e[n],t[n]))return!1;return!0}function Bw(e,t){t===void 0&&(t=$w);var n=null;function r(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var s=e.apply(this,i);return n={lastResult:s,lastArgs:i,lastThis:this},s}return r.clear=function(){n=null},r}var Ww={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},Uw=function(t){return Oe("span",ze({css:Ww},t))},cc=Uw,qw={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,o=t.context,s=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return s?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,i=r===void 0?"":r,o=t.labels,s=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return s?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,i=t.options,o=t.label,s=o===void 0?"":o,a=t.selectValue,l=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(p,y){return p&&p.length?"".concat(p.indexOf(y)+1," of ").concat(p.length):""};if(n==="value"&&a)return"value ".concat(s," focused, ").concat(d(a,r),".");if(n==="menu"&&c){var g=l?" disabled":"",h="".concat(u?" selected":"").concat(g);return"".concat(s).concat(h,", ").concat(d(i,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},Gw=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,s=t.isFocused,a=t.selectValue,l=t.selectProps,u=t.id,c=t.isAppleDevice,d=l.ariaLiveMessages,g=l.getOptionLabel,h=l.inputValue,m=l.isMulti,p=l.isOptionDisabled,y=l.isSearchable,b=l.menuIsOpen,v=l.options,S=l.screenReaderStatus,O=l.tabSelectsValue,R=l.isLoading,M=l["aria-label"],_=l["aria-live"],E=f.useMemo(function(){return Fe(Fe({},qw),d||{})},[d]),k=f.useMemo(function(){var x="";if(n&&E.onChange){var $=n.option,G=n.options,X=n.removedValue,ie=n.removedValues,ee=n.value,Q=function(P){return Array.isArray(P)?null:P},te=X||$||Q(ee),se=te?g(te):"",ue=G||ie||void 0,fe=ue?ue.map(g):[],re=Fe({isDisabled:te&&p(te,a),label:se,labels:fe},n);x=E.onChange(re)}return x},[n,E,p,a,g]),F=f.useMemo(function(){var x="",$=r||i,G=!!(r&&a&&a.includes(r));if($&&E.onFocus){var X={focused:$,label:g($),isDisabled:p($,a),isSelected:G,options:o,context:$===r?"menu":"value",selectValue:a,isAppleDevice:c};x=E.onFocus(X)}return x},[r,i,g,p,E,o,a,c]),D=f.useMemo(function(){var x="";if(b&&v.length&&!R&&E.onFilter){var $=S({count:o.length});x=E.onFilter({inputValue:h,resultsMessage:$})}return x},[o,h,b,E,v,S,R]),C=n?.action==="initial-input-focus",I=f.useMemo(function(){var x="";if(E.guidance){var $=i?"value":b?"menu":"input";x=E.guidance({"aria-label":M,context:$,isDisabled:r&&p(r,a),isMulti:m,isSearchable:y,tabSelectsValue:O,isInitialFocus:C})}return x},[M,r,i,m,p,y,b,E,a,O,C]),T=Oe(f.Fragment,null,Oe("span",{id:"aria-selection"},k),Oe("span",{id:"aria-focused"},F),Oe("span",{id:"aria-results"},D),Oe("span",{id:"aria-guidance"},I));return Oe(f.Fragment,null,Oe(cc,{id:u},C&&T),Oe(cc,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},s&&!C&&T))},Yw=Gw,Fs=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],jw=new RegExp("["+Fs.map(function(e){return e.letters}).join("")+"]","g"),wf={};for(var ms=0;ms<Fs.length;ms++)for(var ps=Fs[ms],vs=0;vs<ps.letters.length;vs++)wf[ps.letters[vs]]=ps.base;var yf=function(t){return t.replace(jw,function(n){return wf[n]})},Xw=Bw(yf),dc=function(t){return t.replace(/^\s+|\s+$/g,"")},Kw=function(t){return"".concat(t.label," ").concat(t.value)},Zw=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=Fe({ignoreCase:!0,ignoreAccents:!0,stringify:Kw,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,s=i.ignoreAccents,a=i.stringify,l=i.trim,u=i.matchFrom,c=l?dc(r):r,d=l?dc(a(n)):a(n);return o&&(c=c.toLowerCase(),d=d.toLowerCase()),s&&(c=Xw(c),d=yf(d)),u==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},Jw=["innerRef"];function Qw(e){var t=e.innerRef,n=sr(e,Jw),r=Rb(n,"onExited","in","enter","exit","appear");return Oe("input",ze({ref:t},r,{css:Nc({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var ey=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function ty(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,o=e.onTopLeave,s=f.useRef(!1),a=f.useRef(!1),l=f.useRef(0),u=f.useRef(null),c=f.useCallback(function(y,b){if(u.current!==null){var v=u.current,S=v.scrollTop,O=v.scrollHeight,R=v.clientHeight,M=u.current,_=b>0,E=O-R-S,k=!1;E>b&&s.current&&(r&&r(y),s.current=!1),_&&a.current&&(o&&o(y),a.current=!1),_&&b>E?(n&&!s.current&&n(y),M.scrollTop=O,k=!0,s.current=!0):!_&&-b>S&&(i&&!a.current&&i(y),M.scrollTop=0,k=!0,a.current=!0),k&&ey(y)}},[n,r,i,o]),d=f.useCallback(function(y){c(y,y.deltaY)},[c]),g=f.useCallback(function(y){l.current=y.changedTouches[0].clientY},[]),h=f.useCallback(function(y){var b=l.current-y.changedTouches[0].clientY;c(y,b)},[c]),m=f.useCallback(function(y){if(y){var b=xb?{passive:!1}:!1;y.addEventListener("wheel",d,b),y.addEventListener("touchstart",g,b),y.addEventListener("touchmove",h,b)}},[h,g,d]),p=f.useCallback(function(y){y&&(y.removeEventListener("wheel",d,!1),y.removeEventListener("touchstart",g,!1),y.removeEventListener("touchmove",h,!1))},[h,g,d]);return f.useEffect(function(){if(t){var y=u.current;return m(y),function(){p(y)}}},[t,m,p]),function(y){u.current=y}}var fc=["boxSizing","height","overflow","paddingRight","position"],hc={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function gc(e){e.cancelable&&e.preventDefault()}function mc(e){e.stopPropagation()}function pc(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function vc(){return"ontouchstart"in window||navigator.maxTouchPoints}var bc=!!(typeof window<"u"&&window.document&&window.document.createElement),Gi=0,ai={capture:!1,passive:!1};function ny(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=f.useRef({}),o=f.useRef(null),s=f.useCallback(function(l){if(bc){var u=document.body,c=u&&u.style;if(r&&fc.forEach(function(m){var p=c&&c[m];i.current[m]=p}),r&&Gi<1){var d=parseInt(i.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,h=window.innerWidth-g+d||0;Object.keys(hc).forEach(function(m){var p=hc[m];c&&(c[m]=p)}),c&&(c.paddingRight="".concat(h,"px"))}u&&vc()&&(u.addEventListener("touchmove",gc,ai),l&&(l.addEventListener("touchstart",pc,ai),l.addEventListener("touchmove",mc,ai))),Gi+=1}},[r]),a=f.useCallback(function(l){if(bc){var u=document.body,c=u&&u.style;Gi=Math.max(Gi-1,0),r&&Gi<1&&fc.forEach(function(d){var g=i.current[d];c&&(c[d]=g)}),u&&vc()&&(u.removeEventListener("touchmove",gc,ai),l&&(l.removeEventListener("touchstart",pc,ai),l.removeEventListener("touchmove",mc,ai)))}},[r]);return f.useEffect(function(){if(t){var l=o.current;return s(l),function(){a(l)}}},[t,s,a]),function(l){o.current=l}}var ry=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},iy={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function oy(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,o=e.onBottomArrive,s=e.onBottomLeave,a=e.onTopArrive,l=e.onTopLeave,u=ty({isEnabled:i,onBottomArrive:o,onBottomLeave:s,onTopArrive:a,onTopLeave:l}),c=ny({isEnabled:n}),d=function(h){u(h),c(h)};return Oe(f.Fragment,null,n&&Oe("div",{onClick:ry,css:iy}),t(d))}var ay={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},sy=function(t){var n=t.name,r=t.onFocus;return Oe("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:ay,value:"",onChange:function(){}})},ly=sy;function ml(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function uy(){return ml(/^iPhone/i)}function Cf(){return ml(/^Mac/i)}function cy(){return ml(/^iPad/i)||Cf()&&navigator.maxTouchPoints>1}function dy(){return uy()||cy()}function fy(){return Cf()||dy()}var hy=function(t){return t.label},gy=function(t){return t.label},my=function(t){return t.value},py=function(t){return!!t.isDisabled},vy={clearIndicator:ew,container:Wb,control:sw,dropdownIndicator:Jb,group:dw,groupHeading:hw,indicatorsContainer:Yb,indicatorSeparator:nw,input:vw,loadingIndicator:ow,loadingMessage:zb,menu:Ob,menuList:Lb,menuPortal:$b,multiValue:Sw,multiValueLabel:xw,multiValueRemove:kw,noOptionsMessage:Hb,option:Dw,placeholder:_w,singleValue:Aw,valueContainer:qb},by={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},wy=4,Sf=4,yy=38,Cy=Sf*2,Sy={baseUnit:Sf,controlHeight:yy,menuGutter:Cy},bs={borderRadius:wy,colors:by,spacing:Sy},xy={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:sc(),captureMenuScroll:!sc(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Zw(),formatGroupLabel:hy,getOptionLabel:gy,getOptionValue:my,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:py,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Cb(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function wc(e,t,n,r){var i=Mf(e,t,n),o=Rf(e,t,n),s=kf(e,t),a=ma(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:s,value:a,index:r}}function ea(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(s,a){return wc(e,s,t,a)}).filter(function(s){return Cc(e,s)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=wc(e,n,t,r);return Cc(e,o)?o:void 0}).filter(kb)}function xf(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,zs(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function yc(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,zs(r.options.map(function(i){return{data:i.data,id:"".concat(t,"-").concat(r.index,"-").concat(i.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function ky(e,t){return xf(ea(e,t))}function Cc(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,s=t.label,a=t.value;return(!If(e)||!o)&&Ef(e,{label:s,value:a,data:i},r)}function My(e,t){var n=e.focusedValue,r=e.selectValue,i=r.indexOf(n);if(i>-1){var o=t.indexOf(n);if(o>-1)return n;if(i<t.length)return t[i]}return null}function Ry(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var ws=function(t,n){var r,i=(r=t.find(function(o){return o.data===n}))===null||r===void 0?void 0:r.id;return i||null},kf=function(t,n){return t.getOptionLabel(n)},ma=function(t,n){return t.getOptionValue(n)};function Mf(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function Rf(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=ma(e,t);return n.some(function(i){return ma(e,i)===r})}function Ef(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var If=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},Ey=1,Tf=function(e){yg(n,e);var t=xg(n);function n(r){var i;if(Sg(this,n),i=t.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.isAppleDevice=fy(),i.controlRef=null,i.getControlRef=function(l){i.controlRef=l},i.focusedOptionRef=null,i.getFocusedOptionRef=function(l){i.focusedOptionRef=l},i.menuListRef=null,i.getMenuListRef=function(l){i.menuListRef=l},i.inputRef=null,i.getInputRef=function(l){i.inputRef=l},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(l,u){var c=i.props,d=c.onChange,g=c.name;u.name=g,i.ariaOnChange(l,u),d(l,u)},i.setValue=function(l,u,c){var d=i.props,g=d.closeMenuOnSelect,h=d.isMulti,m=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:m}),g&&(i.setState({inputIsHiddenAfterUpdate:!h}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(l,{action:u,option:c})},i.selectOption=function(l){var u=i.props,c=u.blurInputOnSelect,d=u.isMulti,g=u.name,h=i.state.selectValue,m=d&&i.isOptionSelected(l,h),p=i.isOptionDisabled(l,h);if(m){var y=i.getOptionValue(l);i.setValue(h.filter(function(b){return i.getOptionValue(b)!==y}),"deselect-option",l)}else if(!p)d?i.setValue([].concat(zs(h),[l]),"select-option",l):i.setValue(l,"select-option");else{i.ariaOnChange(l,{action:"select-option",option:l,name:g});return}c&&i.blurInput()},i.removeValue=function(l){var u=i.props.isMulti,c=i.state.selectValue,d=i.getOptionValue(l),g=c.filter(function(m){return i.getOptionValue(m)!==d}),h=jo(u,g,g[0]||null);i.onChange(h,{action:"remove-value",removedValue:l}),i.focusInput()},i.clearValue=function(){var l=i.state.selectValue;i.onChange(jo(i.props.isMulti,[],null),{action:"clear",removedValues:l})},i.popValue=function(){var l=i.props.isMulti,u=i.state.selectValue,c=u[u.length-1],d=u.slice(0,u.length-1),g=jo(l,d,d[0]||null);c&&i.onChange(g,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(l){return ws(i.state.focusableOptionsWithIds,l)},i.getFocusableOptionsWithIds=function(){return yc(ea(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var l=arguments.length,u=new Array(l),c=0;c<l;c++)u[c]=arguments[c];return pb.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(l){return kf(i.props,l)},i.getOptionValue=function(l){return ma(i.props,l)},i.getStyles=function(l,u){var c=i.props.unstyled,d=vy[l](u,c);d.boxSizing="border-box";var g=i.props.styles[l];return g?g(d,u):d},i.getClassNames=function(l,u){var c,d;return(c=(d=i.props.classNames)[l])===null||c===void 0?void 0:c.call(d,u)},i.getElementId=function(l){return"".concat(i.state.instancePrefix,"-").concat(l)},i.getComponents=function(){return Vw(i.props)},i.buildCategorizedOptions=function(){return ea(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return xf(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(l,u){i.setState({ariaSelection:Fe({value:l},u)})},i.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(l){i.blockOptionHover=!1},i.onControlMouseDown=function(l){if(!l.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},i.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!i.props.isDisabled){var u=i.props,c=u.isMulti,d=u.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!c}),i.onMenuClose()):i.openMenu("first"),l.preventDefault()}},i.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(i.clearValue(),l.preventDefault(),i.openAfterFocus=!1,l.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(l){typeof i.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&Sa(l.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(l)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(l){var u=l.touches,c=u&&u.item(0);c&&(i.initialTouchX=c.clientX,i.initialTouchY=c.clientY,i.userIsDragging=!1)},i.onTouchMove=function(l){var u=l.touches,c=u&&u.item(0);if(c){var d=Math.abs(c.clientX-i.initialTouchX),g=Math.abs(c.clientY-i.initialTouchY),h=5;i.userIsDragging=d>h||g>h}},i.onTouchEnd=function(l){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(l.target)&&i.menuListRef&&!i.menuListRef.contains(l.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(l){i.userIsDragging||i.onControlMouseDown(l)},i.onClearIndicatorTouchEnd=function(l){i.userIsDragging||i.onClearIndicatorMouseDown(l)},i.onDropdownIndicatorTouchEnd=function(l){i.userIsDragging||i.onDropdownIndicatorMouseDown(l)},i.handleInputChange=function(l){var u=i.props.inputValue,c=l.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(c,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(l){i.props.onFocus&&i.props.onFocus(l),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(l){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(l),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(l){if(!(i.blockOptionHover||i.state.focusedOption===l)){var u=i.getFocusableOptions(),c=u.indexOf(l);i.setState({focusedOption:l,focusedOptionId:c>-1?i.getFocusedOptionId(l):null})}},i.shouldHideSelectedOptions=function(){return If(i.props)},i.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),i.focus()},i.onKeyDown=function(l){var u=i.props,c=u.isMulti,d=u.backspaceRemovesValue,g=u.escapeClearsValue,h=u.inputValue,m=u.isClearable,p=u.isDisabled,y=u.menuIsOpen,b=u.onKeyDown,v=u.tabSelectsValue,S=u.openMenuOnFocus,O=i.state,R=O.focusedOption,M=O.focusedValue,_=O.selectValue;if(!p&&!(typeof b=="function"&&(b(l),l.defaultPrevented))){switch(i.blockOptionHover=!0,l.key){case"ArrowLeft":if(!c||h)return;i.focusValue("previous");break;case"ArrowRight":if(!c||h)return;i.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(M)i.removeValue(M);else{if(!d)return;c?i.popValue():m&&i.clearValue()}break;case"Tab":if(i.isComposing||l.shiftKey||!y||!v||!R||S&&i.isOptionSelected(R,_))return;i.selectOption(R);break;case"Enter":if(l.keyCode===229)break;if(y){if(!R||i.isComposing)return;i.selectOption(R);break}return;case"Escape":y?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:h}),i.onMenuClose()):m&&g&&i.clearValue();break;case" ":if(h)return;if(!y){i.openMenu("first");break}if(!R)return;i.selectOption(R);break;case"ArrowUp":y?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":y?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!y)return;i.focusOption("pageup");break;case"PageDown":if(!y)return;i.focusOption("pagedown");break;case"Home":if(!y)return;i.focusOption("first");break;case"End":if(!y)return;i.focusOption("last");break;default:return}l.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++Ey),i.state.selectValue=oc(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),s=i.buildFocusableOptions(),a=s.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=s[a],i.state.focusedOptionId=ws(o,s[a])}return i}return Cg(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&ac(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var o=this.props,s=o.isDisabled,a=o.menuIsOpen,l=this.state.isFocused;(l&&!s&&i.isDisabled||l&&a&&!i.menuIsOpen)&&this.focusInput(),l&&s&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!s&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(ac(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,o){this.props.onInputChange(i,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var o=this,s=this.state,a=s.selectValue,l=s.isFocused,u=this.buildFocusableOptions(),c=i==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(a[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(i){var o=this.state,s=o.selectValue,a=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=s.indexOf(a);a||(l=-1);var u=s.length-1,c=-1;if(s.length){switch(i){case"previous":l===0?c=0:l===-1?c=u:c=l-1;break;case"next":l>-1&&l<u&&(c=l+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:s[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,s=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,u=a.indexOf(s);s||(u=-1),i==="up"?l=u>0?u-1:a.length-1:i==="down"?l=(u+1)%a.length:i==="pageup"?(l=u-o,l<0&&(l=0)):i==="pagedown"?(l=u+o,l>a.length-1&&(l=a.length-1)):i==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(bs):Fe(Fe({},bs),this.props.theme):bs}},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,s=this.getStyles,a=this.getClassNames,l=this.getValue,u=this.selectOption,c=this.setValue,d=this.props,g=d.isMulti,h=d.isRtl,m=d.options,p=this.hasValue();return{clearValue:i,cx:o,getStyles:s,getClassNames:a,getValue:l,hasValue:p,isMulti:g,isRtl:h,options:m,selectOption:u,selectProps:d,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,o=i.isClearable,s=i.isMulti;return o===void 0?s:o}},{key:"isOptionDisabled",value:function(i,o){return Mf(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return Rf(this.props,i,o)}},{key:"filterOption",value:function(i,o){return Ef(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var s=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:s,selectValue:a})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,o=i.isDisabled,s=i.isSearchable,a=i.inputId,l=i.inputValue,u=i.tabIndex,c=i.form,d=i.menuIsOpen,g=i.required,h=this.getComponents(),m=h.Input,p=this.state,y=p.inputIsHidden,b=p.ariaSelection,v=this.commonProps,S=a||this.getElementId("input"),O=Fe(Fe(Fe({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":g,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!s&&{"aria-readonly":!0}),this.hasValue()?b?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return s?f.createElement(m,ze({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:S,innerRef:this.getInputRef,isDisabled:o,isHidden:y,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:l},O)):f.createElement(Qw,ze({id:S,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:ha,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},O))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),s=o.MultiValue,a=o.MultiValueContainer,l=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,d=o.Placeholder,g=this.commonProps,h=this.props,m=h.controlShouldRenderValue,p=h.isDisabled,y=h.isMulti,b=h.inputValue,v=h.placeholder,S=this.state,O=S.selectValue,R=S.focusedValue,M=S.isFocused;if(!this.hasValue()||!m)return b?null:f.createElement(d,ze({},g,{key:"placeholder",isDisabled:p,isFocused:M,innerProps:{id:this.getElementId("placeholder")}}),v);if(y)return O.map(function(E,k){var F=E===R,D="".concat(i.getOptionLabel(E),"-").concat(i.getOptionValue(E));return f.createElement(s,ze({},g,{components:{Container:a,Label:l,Remove:u},isFocused:F,isDisabled:p,key:D,index:k,removeProps:{onClick:function(){return i.removeValue(E)},onTouchEnd:function(){return i.removeValue(E)},onMouseDown:function(I){I.preventDefault()}},data:E}),i.formatOptionLabel(E,"value"))});if(b)return null;var _=O[0];return f.createElement(c,ze({},g,{data:_,isDisabled:p}),this.formatOptionLabel(_,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,ze({},s,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return f.createElement(o,ze({},s,{innerProps:d,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,s=i.IndicatorSeparator;if(!o||!s)return null;var a=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return f.createElement(s,ze({},a,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var s=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,ze({},s,{innerProps:u,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),s=o.Group,a=o.GroupHeading,l=o.Menu,u=o.MenuList,c=o.MenuPortal,d=o.LoadingMessage,g=o.NoOptionsMessage,h=o.Option,m=this.commonProps,p=this.state.focusedOption,y=this.props,b=y.captureMenuScroll,v=y.inputValue,S=y.isLoading,O=y.loadingMessage,R=y.minMenuHeight,M=y.maxMenuHeight,_=y.menuIsOpen,E=y.menuPlacement,k=y.menuPosition,F=y.menuPortalTarget,D=y.menuShouldBlockScroll,C=y.menuShouldScrollIntoView,I=y.noOptionsMessage,T=y.onMenuScrollToTop,x=y.onMenuScrollToBottom;if(!_)return null;var $=function(se,ue){var fe=se.type,re=se.data,H=se.isDisabled,P=se.isSelected,Y=se.label,ce=se.value,he=p===re,ke=H?void 0:function(){return i.onOptionHover(re)},Se=H?void 0:function(){return i.selectOption(re)},Je="".concat(i.getElementId("option"),"-").concat(ue),Ie={id:Je,onClick:Se,onMouseMove:ke,onMouseOver:ke,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:P};return f.createElement(h,ze({},m,{innerProps:Ie,data:re,isDisabled:H,isSelected:P,key:Je,label:Y,type:fe,value:ce,isFocused:he,innerRef:he?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(se.data,"menu"))},G;if(this.hasOptions())G=this.getCategorizedOptions().map(function(te){if(te.type==="group"){var se=te.data,ue=te.options,fe=te.index,re="".concat(i.getElementId("group"),"-").concat(fe),H="".concat(re,"-heading");return f.createElement(s,ze({},m,{key:re,data:se,options:ue,Heading:a,headingProps:{id:H,data:te.data},label:i.formatGroupLabel(te.data)}),te.options.map(function(P){return $(P,"".concat(fe,"-").concat(P.index))}))}else if(te.type==="option")return $(te,"".concat(te.index))});else if(S){var X=O({inputValue:v});if(X===null)return null;G=f.createElement(d,m,X)}else{var ie=I({inputValue:v});if(ie===null)return null;G=f.createElement(g,m,ie)}var ee={minMenuHeight:R,maxMenuHeight:M,menuPlacement:E,menuPosition:k,menuShouldScrollIntoView:C},Q=f.createElement(Pb,ze({},m,ee),function(te){var se=te.ref,ue=te.placerProps,fe=ue.placement,re=ue.maxHeight;return f.createElement(l,ze({},m,ee,{innerRef:se,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:S,placement:fe}),f.createElement(oy,{captureEnabled:b,onTopArrive:T,onBottomArrive:x,lockEnabled:D},function(H){return f.createElement(u,ze({},m,{innerRef:function(Y){i.getMenuListRef(Y),H(Y)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:i.getElementId("listbox")},isLoading:S,maxHeight:re,focusedOption:p}),G)}))});return F||k==="fixed"?f.createElement(c,ze({},m,{appendTo:F,controlElement:this.controlRef,menuPlacement:E,menuPosition:k}),Q):Q}},{key:"renderFormField",value:function(){var i=this,o=this.props,s=o.delimiter,a=o.isDisabled,l=o.isMulti,u=o.name,c=o.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!a)return f.createElement(ly,{name:u,onFocus:this.onValueInputFocus});if(!(!u||a))if(l)if(s){var g=d.map(function(p){return i.getOptionValue(p)}).join(s);return f.createElement("input",{name:u,type:"hidden",value:g})}else{var h=d.length>0?d.map(function(p,y){return f.createElement("input",{key:"i-".concat(y),name:u,type:"hidden",value:i.getOptionValue(p)})}):f.createElement("input",{name:u,type:"hidden",value:""});return f.createElement("div",null,h)}else{var m=d[0]?this.getOptionValue(d[0]):"";return f.createElement("input",{name:u,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,s=o.ariaSelection,a=o.focusedOption,l=o.focusedValue,u=o.isFocused,c=o.selectValue,d=this.getFocusableOptions();return f.createElement(Yw,ze({},i,{id:this.getElementId("live-region"),ariaSelection:s,focusedOption:a,focusedValue:l,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,s=i.IndicatorsContainer,a=i.SelectContainer,l=i.ValueContainer,u=this.props,c=u.className,d=u.id,g=u.isDisabled,h=u.menuIsOpen,m=this.state.isFocused,p=this.commonProps=this.getCommonProps();return f.createElement(a,ze({},p,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:g,isFocused:m}),this.renderLiveRegion(),f.createElement(o,ze({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:g,isFocused:m,menuIsOpen:h}),f.createElement(l,ze({},p,{isDisabled:g}),this.renderPlaceholderOrValue(),this.renderInput()),f.createElement(s,ze({},p,{isDisabled:g}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var s=o.prevProps,a=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,d=o.prevWasFocused,g=o.instancePrefix,h=i.options,m=i.value,p=i.menuIsOpen,y=i.inputValue,b=i.isMulti,v=oc(m),S={};if(s&&(m!==s.value||h!==s.options||p!==s.menuIsOpen||y!==s.inputValue)){var O=p?ky(i,v):[],R=p?yc(ea(i,v),"".concat(g,"-option")):[],M=a?My(o,v):null,_=Ry(o,O),E=ws(R,_);S={selectValue:v,focusedOption:_,focusedOptionId:E,focusableOptionsWithIds:R,focusedValue:M,clearFocusValueOnUpdate:!1}}var k=l!=null&&i!==s?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},F=u,D=c&&d;return c&&!D&&(F={value:jo(b,v,v[0]||null),options:v,action:"initial-input-focus"},D=!d),u?.action==="initial-input-focus"&&(F=null),Fe(Fe(Fe({},S),k),{},{prevProps:i,ariaSelection:F,prevWasFocused:D})}}]),n}(f.Component);Tf.defaultProps=xy;var Iy=f.forwardRef(function(e,t){var n=Q1(e);return f.createElement(Tf,ze({ref:t},n))}),Ty=Iy;const Dy=e=>{const{Menu:t}=bf,{children:n,...r}=e;return f.createElement(t,{...r},n)},Oy=un("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),Py=un("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),_y=un("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),Fy=e=>{const{value:t,onFinishedEditing:n,initialValue:r,portalElementRef:i}=e,{allowedValues:o,value:s}=t.data,[a,l]=f.useState(s),[u,c]=f.useState(r??""),d=Xm(),g=f.useMemo(()=>o.map(h=>typeof h=="string"||h===null||h===void 0?{value:h,label:h?.toString()??""}:h),[o]);return t.readonly?f.createElement(_y,null,f.createElement(Wr,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):f.createElement(Oy,null,f.createElement(Ty,{className:"glide-select",inputValue:u,onInputChange:c,menuPlacement:"auto",value:g.find(h=>h.value===a),styles:{control:h=>({...h,border:0,boxShadow:"none"}),option:(h,{isFocused:m})=>({...h,fontSize:d.editorFontSize,fontFamily:d.fontFamily,cursor:m?"pointer":void 0,paddingLeft:d.cellHorizontalPadding,paddingRight:d.cellHorizontalPadding,":active":{...h[":active"],color:d.accentFg},":empty::after":{content:'" "',visibility:"hidden"}})},theme:h=>({...h,colors:{...h.colors,neutral0:d.bgCell,neutral5:d.bgCell,neutral10:d.bgCell,neutral20:d.bgCellMedium,neutral30:d.bgCellMedium,neutral40:d.bgCellMedium,neutral50:d.textLight,neutral60:d.textMedium,neutral70:d.textMedium,neutral80:d.textDark,neutral90:d.textDark,neutral100:d.textDark,primary:d.accentColor,primary75:d.accentColor,primary50:d.accentColor,primary25:d.accentLight}}),menuPortalTarget:i?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:h=>f.createElement(Py,null,f.createElement(Dy,{className:"click-outside-ignore",...h}))},options:g,onChange:async h=>{h!==null&&(l(h.value),await new Promise(m=>window.requestAnimationFrame(m)),n({...t,data:{...t.data,value:h.value}}))}}))},Ly={kind:J.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{value:o}=t.data,s=t.data.allowedValues.find(l=>typeof l=="string"||l===null||l===void 0?l===o:l.value===o),a=typeof s=="string"?s:s?.label??"";return a&&(n.fillStyle=r.textDark,n.fillText(a,i.x+r.cellHorizontalPadding,i.y+i.height/2+Zn(n,r))),!0},measure:(e,t,n)=>{const{value:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Fy,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,value:""}})}),onPaste:(e,t)=>({...t,value:t.allowedValues.some(n=>n==null?!1:typeof n=="string"?n===e:n.value===e)?e:t.value})};function Ay(e,t){const n=/(\d+\.?\d*)\s*(px|rem|em|%|pt)/,r=e.match(n);if(r){const i=parseFloat(r[1]),o=r[2],s=i*t;return e.replace(n,`${Number(s.toPrecision(3))}${o}`)}return e}const Hy={marginRight:8},zy={display:"flex",alignItems:"center",flexGrow:1},Vy={kind:J.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{min:o,max:s,value:a,label:l,measureLabel:u}=t.data,c=i.x+r.cellHorizontalPadding,d=i.y+i.height/2,g=s-o,h=(a-o)/g,m=`${Ay(r.baseFontStyle,.9)} ${r.fontFamily}`,y=Ys(n,m)/2;n.save();let b=0;l!==void 0&&(n.font=m,b=qr(u??l,n,m).width+r.cellHorizontalPadding);const v=i.width-r.cellHorizontalPadding*2-b;if(v>=y){const S=n.createLinearGradient(c,d,c+v,d);S.addColorStop(0,r.accentColor),S.addColorStop(h,r.accentColor),S.addColorStop(h,r.bgBubble),S.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=S,ec(n,c,d-y/2,v,y,y/2),n.fill(),n.beginPath(),ec(n,c+.5,d-y/2+.5,v-1,y-1,(y-1)/2),n.strokeStyle=r.accentLight,n.lineWidth=1,n.stroke()}return l!==void 0&&(n.textAlign="right",n.fillStyle=r.textDark,n.fillText(l,i.x+i.width-r.cellHorizontalPadding,d+Zn(n,m))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,r=t.value.toString(),i=t.min.toString(),o=t.max.toString(),s=t.step.toString(),a=l=>{e.onChange({...e.value,data:{...t,value:Number(l.target.value)}})};return f.createElement("label",{style:zy},f.createElement("input",{style:Hy,type:"range",value:r,min:i,max:o,step:s,onChange:a,disabled:n}),r)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},Ny=un("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),ys=(e,t,n)=>{if(t==null)return"";n&&(t=new Date(t.getTime()+n));const r=t.toISOString();switch(e){case"date":return r.split("T")[0];case"datetime-local":return r.replace("Z","");case"time":return r.split("T")[1].replace("Z","");default:throw new Error(`Unknown date kind ${e}`)}},$y=e=>{const t=e.value.data,{format:n,displayDate:r}=t,i=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,o=t.timezoneOffset?t.timezoneOffset*60*1e3:0,s=t.min instanceof Date?ys(n,t.min,o):t.min,a=t.max instanceof Date?ys(n,t.max,o):t.max,l=ys(n,t.date,o);return e.value.readonly?Vt.createElement(Wr,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):Vt.createElement(Ny,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:l,min:s,max:a,step:i,autoFocus:!0,onChange:u=>{isNaN(u.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(u.target.valueAsNumber-o)}})}})},By={kind:J.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return Gs(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:$y}),onPaste:(e,t)=>{let n=NaN;return e&&(n=Number(e).valueOf(),Number.isNaN(n)&&(n=Date.parse(e),t.format==="time"&&Number.isNaN(n)&&(n=Date.parse(`1970-01-01T${e}Z`)))),{...t,date:Number.isNaN(n)?void 0:new Date(n)}}},Wy="None";function Sc(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-n.cellHorizontalPadding,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+n.cellHorizontalPadding),e.fillStyle=n.accentColor,e.fill(),e.restore()}const Uy=e=>{const{cell:t,theme:n,ctx:r}=e;Gs({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`}},Wy,t.contentAlign),r.fillStyle=n.textDark};function qy(e){const t=f.useCallback((r,i)=>{const{cell:o,theme:s,ctx:a,rect:l}=r,u=r.col;if(gi(o))Sc(a,l,s);else if(ya(o)&&u<e.length){const c=e[u];["checkbox","line_chart","bar_chart","progress"].includes(c.kind)?i():Uy(r),c.isRequired&&c.isEditable&&Sc(a,l,s);return}i()},[e]),n=f.useMemo(()=>[Z1,Ly,Vy,By,...M1],[]);return{drawCell:t,customRenderers:n}}function Gy(){const e=$r();return f.useMemo(()=>{const n={editable:i=>`<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="${i.bgColor}"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>`};return{glideTheme:{accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:si(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:si(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroundColor,bgHeaderHasFocus:si(e.colors.darkenedBgMix100,.9),bgHeaderHovered:si(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(ln("1.125rem")),headerFontStyle:`${e.fontWeights.normal} ${ln(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${ln(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:si(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(ln(e.spacing.sm)),cellVerticalPadding:Math.round(ln("0.1875rem")),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,bubbleHeight:Math.round(ln("1.25rem")),bubblePadding:Math.round(ln(e.spacing.sm)),bubbleMargin:Math.round(ln(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(ln(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(ln("25rem")),minColumnWidth:Math.round(ln("3.125rem")),maxColumnWidth:Math.round(ln("62.5rem")),maxColumnAutoWidth:Math.round(ln("31.25rem")),defaultRowHeight:Math.round(ln("2.1875rem")),defaultHeaderHeight:Math.round(ln("2.1875rem")),bgRowHovered:ng(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:n}},[e])}const Yy=Hs.getLogger("useDataEditor");function jy(e,t,n,r,i,o,s,a,l){const u=f.useCallback(([p,y],b)=>{const v=e[p];if(!v.isEditable)return;const S=v.indexNumber,O=n.current.getOriginalRowIndex(i(y)),R=r([p,y]),M=v.getCellValue(R),_=v.getCellValue(b);if(!gi(R)&&_===M)return;const E=v.getCell(_,!0);gi(E)?Yy.warn(`Not applying the cell edit since it causes this error:
|
195
|
-
${
|
196
|
-
`,
|
197
|
-
Error: ${a}`)}},[t,n,e,r])}}function tC(e){const[t,n]=f.useState(void 0),r=f.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,s]=o.location;n(s)}},[n]);return{getRowThemeOverride:f.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function nC(e,t,n,r,i){const[o,s]=f.useState({columns:it.empty(),rows:it.empty(),current:void 0}),a=!t&&!n&&(e.selectionMode.includes(bn.SelectionMode.MULTI_ROW)||e.selectionMode.includes(bn.SelectionMode.SINGLE_ROW)),l=a&&e.selectionMode.includes(bn.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(bn.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(bn.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(bn.SelectionMode.MULTI_COLUMN),d=o.rows.length>0,g=o.columns.length>0,h=o.current!==void 0,m=f.useCallback(y=>{const b=!Ga(y.rows.toArray(),o.rows.toArray()),v=!Ga(y.columns.toArray(),o.columns.toArray()),S=!Ga(y.current,o.current);let O=a&&b||u&&v,R=y;if((a||u)&&y.current!==void 0&&S&&(R={...y,rows:o.rows,columns:o.columns},O=!1),b&&y.rows.length>0&&v&&y.columns.length===0&&(R={...R,columns:o.columns},O=!0),v&&y.columns.length>0&&b&&y.rows.length===0&&(R={...R,rows:o.rows},O=!0),v&&R.columns.length>=0){let M=R.columns;r.forEach((_,E)=>{_.isIndex&&(M=M.remove(E))}),M.length<R.columns.length&&(R={...R,columns:M})}s(R),O&&i(R)},[o,a,u,i,r]),p=f.useCallback((y=!1,b=!1)=>{const v={columns:b?o.columns:it.empty(),rows:y?o.rows:it.empty(),current:void 0};s(v),(!y&&a||!b&&u)&&i(v)},[o,a,u,i]);return{gridSelection:o,isRowSelectionActivated:a,isMultiRowSelectionActivated:l,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isRowSelected:d,isColumnSelected:g,isCellSelected:h,clearSelection:p,processSelectionChange:m}}function rC(e,t,n,r,i,o,s){const a=e.rowHeight??t.defaultRowHeight,l=t.defaultHeaderHeight+a+2*t.tableBorderWidth,u=r?2:1,c=e.editingMode===bn.EditingMode.DYNAMIC?1:0,d=n+c;let g=Math.max(d*a+u*t.defaultHeaderHeight+2*t.tableBorderWidth,l),h=Math.min(g,t.defaultTableHeight);e.height&&(h=Math.max(e.height,l),g=Math.max(e.height,g)),o&&(h=Math.min(h,o),g=Math.min(g,o),e.height||(h=g));const m=t.minColumnWidth+2*t.tableBorderWidth,p=Math.max(i,m);let y,b=p;e.useContainerWidth?y=p:e.width&&(y=Math.min(Math.max(e.width,m),p),b=Math.min(Math.max(e.width,b),p));const[v,S]=f.useState({width:y||"100%",height:h});return f.useLayoutEffect(()=>{e.useContainerWidth&&v.width==="100%"&&S(O=>({...O,width:p}))},[p]),f.useLayoutEffect(()=>{S(O=>({...O,width:y||"100%"}))},[y]),f.useLayoutEffect(()=>{S(O=>({...O,height:h}))},[h,n]),f.useLayoutEffect(()=>{if(s){const O=e.useContainerWidth||lt(e.width)&&e.width>0;S({width:O?b:"100%",height:g})}else S({width:y||"100%",height:h})},[s]),{minHeight:l,maxHeight:g,minWidth:m,maxWidth:b,rowHeight:a,resizableSize:v,setResizableSize:S}}const iC=600,oC="⚠️ Please fill out this cell.";function aC(e,t,n=[]){const[r,i]=f.useState(),o=f.useRef(null),s=f.useCallback(l=>{if(clearTimeout(o.current),o.current=0,i(void 0),(l.kind==="header"||l.kind==="cell")&&l.location){const u=l.location[0],c=l.location[1];let d;if(u<0||u>=e.length||n.includes(c))return;const g=e[u];if(l.kind==="header"&<(g))d=g.help;else if(l.kind==="cell"){const h=t([u,c]);gi(h)?d=h.errorDetails:g.isRequired&&g.isEditable&&ya(h)?d=oC:c1(h)&&(d=h.tooltip)}d&&(o.current=setTimeout(()=>{d&&i({content:d,left:l.bounds.x+l.bounds.width/2,top:l.bounds.y})},iC))}},[e,t,i,o,n]),a=f.useCallback(()=>{i(void 0)},[i]);return{tooltip:r,clearTooltip:a,onItemHovered:s}}function sC({top:e,left:t,content:n,clearTooltip:r}){const[i,o]=f.useState(!0),s=$r(),{colors:a,fontSizes:l,radii:u,fontWeights:c}=s,d=f.useCallback(()=>{o(!1),r()},[r,o]);return nt(ba,{content:nt(ig,{"data-testid":"stDataFrameTooltipContent",children:nt(og,{style:{fontSize:l.sm},source:n,allowHTML:!1})}),placement:pa.top,accessibilityType:_c.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:d,onEsc:d,overrides:{Body:{style:{borderTopLeftRadius:u.default,borderTopRightRadius:u.default,borderBottomLeftRadius:u.default,borderBottomRightRadius:u.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:va(s)?a.bgColor:a.secondaryBg,color:a.bodyText,fontSize:l.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:i,children:nt("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const lC=f.memo(sC),Rc=vi("div",{target:"e1u61huh0"})(({hasCustomizedScrollbars:e,theme:t})=>({position:"relative",display:"inline-block","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",borderRadius:t.radii.default},"& .dvn-scroller":{...!e&&{scrollbarWidth:"thin"},overflowX:"auto !important",overflowY:"auto !important"},"& .gdg-search-bar":{maxWidth:"19rem",width:"80%",minWidth:"6rem",top:t.spacing.sm,right:t.spacing.sm,padding:t.spacing.sm,borderRadius:t.radii.default,"& .gdg-search-status":{paddingTop:t.spacing.twoXS,fontSize:t.fontSizes.twoSm},"& .gdg-search-progress":{display:"none"},"& input":{width:"100%"},"& button":{width:t.iconSizes.xl,height:t.iconSizes.xl,"& .button-icon":{width:t.iconSizes.base,height:t.iconSizes.base}}}})),Ec=150,uC=15e4,Xo=6;function cC({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:i,fragmentId:o}){const{expanded:s,expand:a,collapse:l,width:u,height:c}=ag(dg),d=f.useRef(null),g=f.useRef(null),h=f.useRef(null),m=Gy(),{getRowThemeOverride:p,onItemHovered:y}=tC(m),{libConfig:{enforceDownloadInNewTab:b=!1}}=f.useContext(sg),[v,S]=f.useState(!0),[O,R]=f.useState(!1),[M,_]=f.useState(!1),[E,k]=f.useState(!1),[F,D]=f.useState(),[C,I]=f.useState(!1),T=f.useCallback(()=>I(ge=>!ge),[]),x=f.useCallback(()=>I(!1),[]),$=f.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]),G=f.useMemo(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome"),[]);Le(e.editingMode)&&(e.editingMode=bn.EditingMode.READ_ONLY);const{READ_ONLY:X,DYNAMIC:ie}=bn.EditingMode,ee=t.dimensions,Q=Math.max(0,ee.numDataRows),te=Q===0&&!(e.editingMode===ie&&ee.numDataColumns>0),se=Q>uC,ue=!se&&!te&&e.editingMode!==ie,fe=!te&&e.editingMode===ie&&!n,re=f.useRef(new Uo(Q)),[H,P]=f.useState(re.current.getNumRows());f.useEffect(()=>{re.current=new Uo(Q),P(re.current.getNumRows())},[Q]);const Y=f.useCallback(()=>{re.current=new Uo(Q),P(re.current.getNumRows())},[Q]),[ce,he]=f.useState(e.columnOrder);f.useEffect(()=>{he(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:ke,allColumns:Se,setColumnConfigMapping:Je}=z1(e,t,n,ce);f.useEffect(()=>{if(e.editingMode===X)return;const ge=r.getStringValue({id:e.id,formId:e.formId});ge&&(re.current.fromJson(ge,ke),P(re.current.getNumRows()))},[]);const{getCellContent:Ie}=eC(t,ke,H,re),{columns:Qe,sortColumn:kt,getOriginalIndex:$e,getCellContent:ne}=j1(Q,ke,Ie),me=f.useCallback(ge=>{const bt={selection:{rows:[],columns:[]}};bt.selection.rows=ge.rows.toArray().map($t=>$e($t)),bt.selection.columns=ge.columns.toArray().map($t=>eo(Qe[$t]));const Qt=JSON.stringify(bt),Et=r.getStringValue({id:e.id,formId:e.formId});(Et===void 0||Et!==Qt)&&r.setStringValue({id:e.id,formId:e.formId},Qt,{fromUi:!0},o)},[Qe,e.id,e.formId,r,o,$e]),{debouncedCallback:xe}=Nu(me,Ec),{gridSelection:de,isRowSelectionActivated:be,isMultiRowSelectionActivated:Pe,isColumnSelectionActivated:Te,isMultiColumnSelectionActivated:st,isRowSelected:Re,isColumnSelected:qe,isCellSelected:He,clearSelection:we,processSelectionChange:Be}=nC(e,te,n,Qe,xe);f.useEffect(()=>{we(!0,!0)},[s]);const mt=f.useCallback(ge=>{g.current?.updateCells(ge)},[]);f.useEffect(()=>{if(!be&&!Te)return;const ge=r.getStringValue({id:e.id,formId:e.formId});if(ge){const bt=Qe.map(on=>eo(on)),Qt=JSON.parse(ge);let Et=it.empty(),$t=it.empty();Qt.selection?.rows?.forEach(on=>{Et=Et.add(on)}),Qt.selection?.columns?.forEach(on=>{$t=$t.add(bt.indexOf(on))}),(Et.length>0||$t.length>0)&&Be({rows:Et,columns:$t,current:void 0})}},[]);const ft=f.useCallback(()=>{H!==re.current.getNumRows()&&P(re.current.getNumRows())},[H]),Ge=f.useCallback(()=>{const ge=re.current.toJson(Qe);let bt=r.getStringValue({id:e.id,formId:e.formId});bt===void 0&&(bt=new Uo(0).toJson([])),ge!==bt&&r.setStringValue({id:e.id,formId:e.formId},ge,{fromUi:!0},o)},[Qe,e.id,e.formId,r,o]),{debouncedCallback:yt}=Nu(Ge,Ec),{exportToCsv:Yt}=Qy(ne,Qe,H,b),{onCellEdited:Ht,onPaste:Mt,onRowAppended:nn,onDelete:qt,validateCell:cn}=jy(Qe,e.editingMode!==ie,re,ne,$e,mt,ft,yt,we),Ot=f.useMemo(()=>te?[0]:fe?[H]:[],[te,fe,H]),{tooltip:ut,clearTooltip:tn,onItemHovered:Ct}=aC(Qe,ne,Ot),{drawCell:rn,customRenderers:Bt}=qy(Qe),{provideEditor:De}=K1(),It=f.useCallback(ge=>({...ge,hasMenu:!te}),[te]),Pt=f.useMemo(()=>Qe.map(ge=>It(Os(ge))),[Qe,It]),{columns:wn,onColumnResize:jt}=B1(Pt),dn=t.dimensions.numHeaderRows>1,{minHeight:Mn,maxHeight:Xt,minWidth:Jt,maxWidth:We,rowHeight:Rt,resizableSize:yn,setResizableSize:vt}=rC(e,m,H,dn,u||0,c,s),Ft=f.useCallback(([ge,bt])=>({...d1(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:m.glideTheme.textLight},span:[0,Math.max(Qe.length-1,0)]}),[Qe,m.glideTheme.textLight]),Cn=f.useCallback(()=>{Y(),we()},[Y,we]);ug({element:e,widgetMgr:r,onFormCleared:Cn});const{pinColumn:Wn,unpinColumn:zn,freezeColumns:N}=N1(Qe,te,u||0,m.minColumnWidth,we,Je),{changeColumnFormat:Ne}=V1(Je),{hideColumn:Ue,showColumn:St}=X1(we,Je),{onColumnMoved:mn}=$1(Qe,N,Wn,zn,he);return f.useEffect(()=>{setTimeout(()=>{if(h.current&&g.current){const ge=h.current?.querySelector(".dvn-stack")?.getBoundingClientRect();ge&&(_(ge.height>h.current.clientHeight),k(ge.width>h.current.clientWidth))}},1)},[yn,H,wn]),f.useEffect(()=>{Se.length==Qe.length&&I(!1)},[Se.length,Qe.length]),Tn(Rc,{className:"stDataFrame","data-testid":"stDataFrame",hasCustomizedScrollbars:G,ref:h,onMouseDown:ge=>{if(h.current&&G){const bt=h.current.getBoundingClientRect();E&&bt.height-(Xo+1)<ge.clientY-bt.top&&ge.stopPropagation(),M&&bt.width-(Xo+1)<ge.clientX-bt.left&&ge.stopPropagation()}},onBlur:ge=>{!v&&!$&&!ge.currentTarget.contains(ge.relatedTarget)&&we(!0,!0)},children:[Tn(fg,{isFullScreen:s,disableFullscreenMode:i,locked:Re&&!be||He||$&&v||C,onExpand:a,onCollapse:l,target:Rc,children:[(be&&Re||Te&&qe)&&nt(oi,{label:"Clear selection",icon:wg,onClick:()=>{we(),tn()}}),fe&&Re&&nt(oi,{label:"Delete row(s)",icon:kg,onClick:()=>{qt&&(qt(de),tn())}}),fe&&!Re&&nt(oi,{label:"Add row",icon:$c,onClick:()=>{nn&&(S(!0),nn(),tn(),g.current?.scrollTo(0,H,"vertical"))}}),!te&&Se.length>Qe.length&&nt(r1,{columns:Se,columnOrder:ce,setColumnOrder:he,hideColumn:Ue,showColumn:St,isOpen:C,onClose:x,children:nt(oi,{label:"Show/hide columns",icon:Wc,onClick:T})}),!se&&!te&&nt(oi,{label:"Download as CSV",icon:Mg,onClick:Yt}),!te&&nt(oi,{label:"Search",icon:Bc,onClick:()=>{O?R(!1):(S(!0),R(!0)),tn()}})]}),nt(lg,{"data-testid":"stDataFrameResizable",ref:d,defaultSize:yn,style:{border:`${m.tableBorderWidth}px solid ${m.glideTheme.borderColor}`,borderRadius:`${m.tableBorderRadius}`},minHeight:Mn,maxHeight:Xt,minWidth:Jt,maxWidth:We,size:yn,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,Rt],snapGap:Rt/3,onResizeStop:(ge,bt,Qt,Et)=>{if(d.current){const $t=2*m.tableBorderWidth;vt({width:d.current.size.width,height:Xt-d.current.size.height===$t?d.current.size.height+$t:d.current.size.height})}},children:nt(Yv,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:g,columns:wn,rows:te?1:H,minColumnWidth:m.minColumnWidth,maxColumnWidth:m.maxColumnWidth,maxColumnAutoWidth:m.maxColumnAutoWidth,rowHeight:Rt,headerHeight:m.defaultHeaderHeight,getCellContent:te?Ft:ne,onColumnResize:$?void 0:jt,resizeIndicator:"header",freezeColumns:N,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:$?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:Te?void 0:mn,onItemHovered:ge=>{y?.(ge),Ct?.(ge)},keybindings:{downFill:!0},onKeyDown:ge=>{(ge.ctrlKey||ge.metaKey)&&ge.key==="f"&&(R(bt=>!bt),ge.stopPropagation(),ge.preventDefault())},showSearch:O,searchResults:O?void 0:[],onSearchClose:()=>{R(!1),tn()},onHeaderClicked:(ge,bt)=>{!ue||Te||(O&&R(!1),be&&Re?we():we(!0,!0),kt(ge,"auto"))},gridSelection:de,onGridSelectionChange:ge=>{(v||$)&&(Be(ge),ut!==void 0&&tn())},theme:m.glideTheme,getRowThemeOverride:p,onMouseMove:ge=>{ge.kind==="out-of-bounds"&&v?S(!1):ge.kind!=="out-of-bounds"&&!v&&S(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...G&&{paddingBottom:E?-Xo:void 0,paddingRight:M?-Xo:void 0}},provideEditor:De,drawCell:rn,customRenderers:Bt,imageEditorOverride:k1,headerIcons:m.headerIcons,validateCell:cn,onHeaderMenuClick:(ge,bt)=>{D({columnIdx:ge,headerBounds:bt})},onPaste:!1,...be&&{rowMarkers:{kind:"checkbox-visible",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader,textMedium:m.glideTheme.textLight}},rowSelectionMode:Pe?"multi":"auto",rowSelect:n?"none":Pe?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...Te&&{columnSelect:n?"none":st?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!te&&e.editingMode!==X&&!n&&{fillHandle:!$,onCellEdited:Ht,onPaste:Mt,onDelete:qt},...!te&&e.editingMode===ie&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:nn,onHeaderClicked:void 0}})}),ut&&ut.content&&nt(lC,{top:ut.top,left:ut.left,content:ut.content,clearTooltip:tn}),F&&Vc.createPortal(nt(Qv,{top:F.headerBounds.y+F.headerBounds.height,left:F.headerBounds.x+F.headerBounds.width,columnKind:ke[F.columnIdx].kind,onCloseMenu:()=>D(void 0),onSortColumn:ue?ge=>{O&&R(!1),we(!(be&&Re),!0),kt(F.columnIdx,ge,!0)}:void 0,isColumnPinned:ke[F.columnIdx].isPinned,onUnpinColumn:()=>{zn(ke[F.columnIdx].id)},onPinColumn:()=>{Wn(ke[F.columnIdx].id)},onHideColumn:()=>{Ue(ke[F.columnIdx].id)},onChangeFormat:ge=>{Ne(ke[F.columnIdx].id,ge),setTimeout(()=>{g.current?.remeasureColumns(it.fromSingleSelection(F.columnIdx))},100)},onAutosize:()=>{g.current?.remeasureColumns(it.fromSingleSelection(F.columnIdx))}}),document.querySelector("#portal"))]})}const dC=cg(cC),fC=f.memo(dC),MC=Object.freeze(Object.defineProperty({__proto__:null,default:fC},Symbol.toStringTag,{value:"Module"}));export{E0 as C,Cd as T,di as a,Og as b,MC as c,li as i,jm as m,un as s};
|
194
|
+
`]))),dw=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,s=o.colors,a=o.spacing.baseUnit;return Fe({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?s.neutral60:s.neutral20,padding:a*2})},ms=function(t){var n=t.delay,r=t.offset;return Oe("span",{css:Nc({animation:"".concat(cw," 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"},"","")})},fw=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,s=lr(t,nw);return Oe("div",ze({},Kt(Fe(Fe({},s),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Oe(ms,{delay:0,offset:r}),Oe(ms,{delay:160,offset:!0}),Oe(ms,{delay:320,offset:!r}))},hw=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,s=o.colors,a=o.borderRadius,l=o.spacing;return Fe({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?s.neutral5:s.neutral0,borderColor:r?s.neutral10:i?s.primary:s.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(s.primary):void 0,"&:hover":{borderColor:i?s.primary:s.neutral30}})},gw=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,s=t.innerProps,a=t.menuIsOpen;return Oe("div",ze({ref:o},Kt(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":a}),s,{"aria-disabled":r||void 0}),n)},mw=gw,pw=["data"],vw=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},bw=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,s=t.Heading,a=t.headingProps,l=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return Oe("div",ze({},Kt(t,"group",{group:!0}),l),Oe(s,ze({},a,{selectProps:d,theme:c,getStyles:i,getClassNames:o,cx:r}),u),Oe("div",null,n))},ww=function(t,n){var r=t.theme,i=r.colors,o=r.spacing;return Fe({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},yw=function(t){var n=cf(t);n.data;var r=lr(n,pw);return Oe("div",ze({},Kt(t,"groupHeading",{"group-heading":!0}),r))},Cw=bw,Sw=["innerRef","isDisabled","isHidden","inputClassName"],xw=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,s=o.spacing,a=o.colors;return Fe(Fe({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},kw),n?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:a.neutral80})},wf={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},kw={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Fe({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},wf)},Mw=function(t){return Fe({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},wf)},Rw=function(t){var n=t.cx,r=t.value,i=cf(t),o=i.innerRef,s=i.isDisabled,a=i.isHidden,l=i.inputClassName,u=lr(i,Sw);return Oe("div",ze({},Kt(t,"input",{"input-container":!0}),{"data-value":r||""}),Oe("input",ze({className:n({input:!0},l),ref:o,style:Mw(a),disabled:s},u)))},Iw=Rw,Ew=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,s=r.colors;return Fe({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:s.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},Tw=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,s=t.cropWithEllipsis;return Fe({overflow:"hidden",textOverflow:s||s===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},Dw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,s=r.colors,a=t.isFocused;return Fe({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:a?s.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:s.dangerLight,color:s.danger}})},yf=function(t){var n=t.children,r=t.innerProps;return Oe("div",r,n)},Ow=yf,Pw=yf;function _w(e){var t=e.children,n=e.innerProps;return Oe("div",ze({role:"button"},n),t||Oe(gl,{size:14}))}var Fw=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,s=t.isDisabled,a=t.removeProps,l=t.selectProps,u=r.Container,c=r.Label,d=r.Remove;return Oe(u,{data:i,innerProps:Fe(Fe({},Kt(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),o),selectProps:l},Oe(c,{data:i,innerProps:Fe({},Kt(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),Oe(d,{data:i,innerProps:Fe(Fe({},Kt(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:l}))},Lw=Fw,Aw=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,s=t.theme,a=s.spacing,l=s.colors;return Fe({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?l.primary:i?l.primary25:"transparent",color:r?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?l.primary:l.primary50}})},Hw=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,s=t.innerRef,a=t.innerProps;return Oe("div",ze({},Kt(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:s,"aria-disabled":r},a),n)},zw=Hw,Vw=function(t,n){var r=t.theme,i=r.spacing,o=r.colors;return Fe({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},$w=function(t){var n=t.children,r=t.innerProps;return Oe("div",ze({},Kt(t,"placeholder",{placeholder:!0}),r),n)},Nw=$w,Bw=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,s=i.colors;return Fe({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?s.neutral40:s.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},Ww=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return Oe("div",ze({},Kt(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},Uw=Ww,Cf={ClearIndicator:sw,Control:mw,DropdownIndicator:ow,DownChevron:vf,CrossIcon:gl,Group:Cw,GroupHeading:yw,IndicatorsContainer:ew,IndicatorSeparator:uw,Input:Iw,LoadingIndicator:fw,Menu:$b,MenuList:Bb,MenuPortal:Yb,LoadingMessage:Gb,NoOptionsMessage:qb,MultiValue:Lw,MultiValueContainer:Ow,MultiValueLabel:Pw,MultiValueRemove:_w,Option:zw,Placeholder:Nw,SelectContainer:Kb,SingleValue:Uw,ValueContainer:Jb},qw=function(t){return Fe(Fe({},Cf),t.components)},cc=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Gw(e,t){return!!(e===t||cc(e)&&cc(t))}function Xw(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Gw(e[n],t[n]))return!1;return!0}function Yw(e,t){t===void 0&&(t=Xw);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 jw={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"},Kw=function(t){return Oe("span",ze({css:jw},t))},dc=Kw,Zw={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,o=t.context,s=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return s?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,i=r===void 0?"":r,o=t.labels,s=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return s?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,i=t.options,o=t.label,s=o===void 0?"":o,a=t.selectValue,l=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(p,y){return p&&p.length?"".concat(p.indexOf(y)+1," of ").concat(p.length):""};if(n==="value"&&a)return"value ".concat(s," focused, ").concat(d(a,r),".");if(n==="menu"&&c){var g=l?" disabled":"",h="".concat(u?" selected":"").concat(g);return"".concat(s).concat(h,", ").concat(d(i,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},Jw=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,s=t.isFocused,a=t.selectValue,l=t.selectProps,u=t.id,c=t.isAppleDevice,d=l.ariaLiveMessages,g=l.getOptionLabel,h=l.inputValue,m=l.isMulti,p=l.isOptionDisabled,y=l.isSearchable,b=l.menuIsOpen,v=l.options,S=l.screenReaderStatus,O=l.tabSelectsValue,M=l.isLoading,R=l["aria-label"],_=l["aria-live"],I=f.useMemo(function(){return Fe(Fe({},Zw),d||{})},[d]),k=f.useMemo(function(){var x="";if(n&&I.onChange){var N=n.option,G=n.options,j=n.removedValue,ie=n.removedValues,ee=n.value,Q=function(P){return Array.isArray(P)?null:P},te=j||N||Q(ee),se=te?g(te):"",ue=G||ie||void 0,fe=ue?ue.map(g):[],re=Fe({isDisabled:te&&p(te,a),label:se,labels:fe},n);x=I.onChange(re)}return x},[n,I,p,a,g]),F=f.useMemo(function(){var x="",N=r||i,G=!!(r&&a&&a.includes(r));if(N&&I.onFocus){var j={focused:N,label:g(N),isDisabled:p(N,a),isSelected:G,options:o,context:N===r?"menu":"value",selectValue:a,isAppleDevice:c};x=I.onFocus(j)}return x},[r,i,g,p,I,o,a,c]),D=f.useMemo(function(){var x="";if(b&&v.length&&!M&&I.onFilter){var N=S({count:o.length});x=I.onFilter({inputValue:h,resultsMessage:N})}return x},[o,h,b,I,v,S,M]),C=n?.action==="initial-input-focus",E=f.useMemo(function(){var x="";if(I.guidance){var N=i?"value":b?"menu":"input";x=I.guidance({"aria-label":R,context:N,isDisabled:r&&p(r,a),isMulti:m,isSearchable:y,tabSelectsValue:O,isInitialFocus:C})}return x},[R,r,i,m,p,y,b,I,a,O,C]),T=Oe(f.Fragment,null,Oe("span",{id:"aria-selection"},k),Oe("span",{id:"aria-focused"},F),Oe("span",{id:"aria-results"},D),Oe("span",{id:"aria-guidance"},E));return Oe(f.Fragment,null,Oe(dc,{id:u},C&&T),Oe(dc,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},s&&!C&&T))},Qw=Jw,Ls=[{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źẑżžẓẕƶȥɀⱬꝣ"}],ey=new RegExp("["+Ls.map(function(e){return e.letters}).join("")+"]","g"),Sf={};for(var ps=0;ps<Ls.length;ps++)for(var vs=Ls[ps],bs=0;bs<vs.letters.length;bs++)Sf[vs.letters[bs]]=vs.base;var xf=function(t){return t.replace(ey,function(n){return Sf[n]})},ty=Yw(xf),fc=function(t){return t.replace(/^\s+|\s+$/g,"")},ny=function(t){return"".concat(t.label," ").concat(t.value)},ry=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=Fe({ignoreCase:!0,ignoreAccents:!0,stringify:ny,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,s=i.ignoreAccents,a=i.stringify,l=i.trim,u=i.matchFrom,c=l?fc(r):r,d=l?fc(a(n)):a(n);return o&&(c=c.toLowerCase(),d=d.toLowerCase()),s&&(c=ty(c),d=xf(d)),u==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},iy=["innerRef"];function oy(e){var t=e.innerRef,n=lr(e,iy),r=Pb(n,"onExited","in","enter","exit","appear");return Oe("input",ze({ref:t},r,{css:Nc({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var ay=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function sy(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,o=e.onTopLeave,s=f.useRef(!1),a=f.useRef(!1),l=f.useRef(0),u=f.useRef(null),c=f.useCallback(function(y,b){if(u.current!==null){var v=u.current,S=v.scrollTop,O=v.scrollHeight,M=v.clientHeight,R=u.current,_=b>0,I=O-M-S,k=!1;I>b&&s.current&&(r&&r(y),s.current=!1),_&&a.current&&(o&&o(y),a.current=!1),_&&b>I?(n&&!s.current&&n(y),R.scrollTop=O,k=!0,s.current=!0):!_&&-b>S&&(i&&!a.current&&i(y),R.scrollTop=0,k=!0,a.current=!0),k&&ay(y)}},[n,r,i,o]),d=f.useCallback(function(y){c(y,y.deltaY)},[c]),g=f.useCallback(function(y){l.current=y.changedTouches[0].clientY},[]),h=f.useCallback(function(y){var b=l.current-y.changedTouches[0].clientY;c(y,b)},[c]),m=f.useCallback(function(y){if(y){var b=Tb?{passive:!1}:!1;y.addEventListener("wheel",d,b),y.addEventListener("touchstart",g,b),y.addEventListener("touchmove",h,b)}},[h,g,d]),p=f.useCallback(function(y){y&&(y.removeEventListener("wheel",d,!1),y.removeEventListener("touchstart",g,!1),y.removeEventListener("touchmove",h,!1))},[h,g,d]);return f.useEffect(function(){if(t){var y=u.current;return m(y),function(){p(y)}}},[t,m,p]),function(y){u.current=y}}var hc=["boxSizing","height","overflow","paddingRight","position"],gc={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function mc(e){e.cancelable&&e.preventDefault()}function pc(e){e.stopPropagation()}function vc(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function bc(){return"ontouchstart"in window||navigator.maxTouchPoints}var wc=!!(typeof window<"u"&&window.document&&window.document.createElement),Gi=0,si={capture:!1,passive:!1};function ly(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(wc){var u=document.body,c=u&&u.style;if(r&&hc.forEach(function(m){var p=c&&c[m];i.current[m]=p}),r&&Gi<1){var d=parseInt(i.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,h=window.innerWidth-g+d||0;Object.keys(gc).forEach(function(m){var p=gc[m];c&&(c[m]=p)}),c&&(c.paddingRight="".concat(h,"px"))}u&&bc()&&(u.addEventListener("touchmove",mc,si),l&&(l.addEventListener("touchstart",vc,si),l.addEventListener("touchmove",pc,si))),Gi+=1}},[r]),a=f.useCallback(function(l){if(wc){var u=document.body,c=u&&u.style;Gi=Math.max(Gi-1,0),r&&Gi<1&&hc.forEach(function(d){var g=i.current[d];c&&(c[d]=g)}),u&&bc()&&(u.removeEventListener("touchmove",mc,si),l&&(l.removeEventListener("touchstart",vc,si),l.removeEventListener("touchmove",pc,si)))}},[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 uy=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},cy={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function dy(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=sy({isEnabled:i,onBottomArrive:o,onBottomLeave:s,onTopArrive:a,onTopLeave:l}),c=ly({isEnabled:n}),d=function(h){u(h),c(h)};return Oe(f.Fragment,null,n&&Oe("div",{onClick:uy,css:cy}),t(d))}var fy={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},hy=function(t){var n=t.name,r=t.onFocus;return Oe("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:fy,value:"",onChange:function(){}})},gy=hy;function ml(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function my(){return ml(/^iPhone/i)}function kf(){return ml(/^Mac/i)}function py(){return ml(/^iPad/i)||kf()&&navigator.maxTouchPoints>1}function vy(){return my()||py()}function by(){return kf()||vy()}var wy=function(t){return t.label},yy=function(t){return t.label},Cy=function(t){return t.value},Sy=function(t){return!!t.isDisabled},xy={clearIndicator:aw,container:jb,control:hw,dropdownIndicator:iw,group:vw,groupHeading:ww,indicatorsContainer:Qb,indicatorSeparator:lw,input:xw,loadingIndicator:dw,loadingMessage:Ub,menu:Hb,menuList:Nb,menuPortal:Xb,multiValue:Ew,multiValueLabel:Tw,multiValueRemove:Dw,noOptionsMessage:Wb,option:Aw,placeholder:Vw,singleValue:Bw,valueContainer:Zb},ky={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%)"},My=4,Mf=4,Ry=38,Iy=Mf*2,Ey={baseUnit:Mf,controlHeight:Ry,menuGutter:Iy},ws={borderRadius:My,colors:ky,spacing:Ey},Ty={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:lc(),captureMenuScroll:!lc(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:ry(),formatGroupLabel:wy,getOptionLabel:yy,getOptionValue:Cy,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Sy,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Ib(),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 yc(e,t,n,r){var i=Ef(e,t,n),o=Tf(e,t,n),s=If(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 yc(e,s,t,a)}).filter(function(s){return Sc(e,s)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=yc(e,n,t,r);return Sc(e,o)?o:void 0}).filter(Db)}function Rf(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,zs(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function Cc(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,zs(r.options.map(function(i){return{data:i.data,id:"".concat(t,"-").concat(r.index,"-").concat(i.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function Dy(e,t){return Rf(ea(e,t))}function Sc(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,s=t.label,a=t.value;return(!Of(e)||!o)&&Df(e,{label:s,value:a,data:i},r)}function Oy(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 Py(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var ys=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},If=function(t,n){return t.getOptionLabel(n)},ma=function(t,n){return t.getOptionValue(n)};function Ef(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function Tf(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 Df(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var Of=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},_y=1,Pf=function(e){xg(n,e);var t=Rg(n);function n(r){var i;if(Mg(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=by(),i.controlRef=null,i.getControlRef=function(l){i.controlRef=l},i.focusedOptionRef=null,i.getFocusedOptionRef=function(l){i.focusedOptionRef=l},i.menuListRef=null,i.getMenuListRef=function(l){i.menuListRef=l},i.inputRef=null,i.getInputRef=function(l){i.inputRef=l},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(l,u){var c=i.props,d=c.onChange,g=c.name;u.name=g,i.ariaOnChange(l,u),d(l,u)},i.setValue=function(l,u,c){var d=i.props,g=d.closeMenuOnSelect,h=d.isMulti,m=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:m}),g&&(i.setState({inputIsHiddenAfterUpdate:!h}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(l,{action:u,option:c})},i.selectOption=function(l){var u=i.props,c=u.blurInputOnSelect,d=u.isMulti,g=u.name,h=i.state.selectValue,m=d&&i.isOptionSelected(l,h),p=i.isOptionDisabled(l,h);if(m){var y=i.getOptionValue(l);i.setValue(h.filter(function(b){return i.getOptionValue(b)!==y}),"deselect-option",l)}else if(!p)d?i.setValue([].concat(zs(h),[l]),"select-option",l):i.setValue(l,"select-option");else{i.ariaOnChange(l,{action:"select-option",option:l,name:g});return}c&&i.blurInput()},i.removeValue=function(l){var u=i.props.isMulti,c=i.state.selectValue,d=i.getOptionValue(l),g=c.filter(function(m){return i.getOptionValue(m)!==d}),h=Yo(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(Yo(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=Yo(l,d,d[0]||null);c&&i.onChange(g,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(l){return ys(i.state.focusableOptionsWithIds,l)},i.getFocusableOptionsWithIds=function(){return Cc(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 Sb.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(l){return If(i.props,l)},i.getOptionValue=function(l){return ma(i.props,l)},i.getStyles=function(l,u){var c=i.props.unstyled,d=xy[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 qw(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 Rf(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(l,u){i.setState({ariaSelection:Fe({value:l},u)})},i.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(l){i.blockOptionHover=!1},i.onControlMouseDown=function(l){if(!l.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},i.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!i.props.isDisabled){var u=i.props,c=u.isMulti,d=u.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!c}),i.onMenuClose()):i.openMenu("first"),l.preventDefault()}},i.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(i.clearValue(),l.preventDefault(),i.openAfterFocus=!1,l.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(l){typeof i.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&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 Of(i.props)},i.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),i.focus()},i.onKeyDown=function(l){var u=i.props,c=u.isMulti,d=u.backspaceRemovesValue,g=u.escapeClearsValue,h=u.inputValue,m=u.isClearable,p=u.isDisabled,y=u.menuIsOpen,b=u.onKeyDown,v=u.tabSelectsValue,S=u.openMenuOnFocus,O=i.state,M=O.focusedOption,R=O.focusedValue,_=O.selectValue;if(!p&&!(typeof b=="function"&&(b(l),l.defaultPrevented))){switch(i.blockOptionHover=!0,l.key){case"ArrowLeft":if(!c||h)return;i.focusValue("previous");break;case"ArrowRight":if(!c||h)return;i.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(R)i.removeValue(R);else{if(!d)return;c?i.popValue():m&&i.clearValue()}break;case"Tab":if(i.isComposing||l.shiftKey||!y||!v||!M||S&&i.isOptionSelected(M,_))return;i.selectOption(M);break;case"Enter":if(l.keyCode===229)break;if(y){if(!M||i.isComposing)return;i.selectOption(M);break}return;case"Escape":y?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:h}),i.onMenuClose()):m&&g&&i.clearValue();break;case" ":if(h)return;if(!y){i.openMenu("first");break}if(!M)return;i.selectOption(M);break;case"ArrowUp":y?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":y?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!y)return;i.focusOption("pageup");break;case"PageDown":if(!y)return;i.focusOption("pagedown");break;case"Home":if(!y)return;i.focusOption("first");break;case"End":if(!y)return;i.focusOption("last");break;default:return}l.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++_y),i.state.selectValue=ac(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=ys(o,s[a])}return i}return kg(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&&sc(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&&(sc(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(ws):Fe(Fe({},ws),this.props.theme):ws}},{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 Ef(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return Tf(this.props,i,o)}},{key:"filterOption",value:function(i,o){return Df(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var s=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:s,selectValue:a})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,o=i.isDisabled,s=i.isSearchable,a=i.inputId,l=i.inputValue,u=i.tabIndex,c=i.form,d=i.menuIsOpen,g=i.required,h=this.getComponents(),m=h.Input,p=this.state,y=p.inputIsHidden,b=p.ariaSelection,v=this.commonProps,S=a||this.getElementId("input"),O=Fe(Fe(Fe({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":g,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!s&&{"aria-readonly":!0}),this.hasValue()?b?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return s?f.createElement(m,ze({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:S,innerRef:this.getInputRef,isDisabled:o,isHidden:y,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:l},O)):f.createElement(oy,ze({id:S,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:ha,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},O))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),s=o.MultiValue,a=o.MultiValueContainer,l=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,d=o.Placeholder,g=this.commonProps,h=this.props,m=h.controlShouldRenderValue,p=h.isDisabled,y=h.isMulti,b=h.inputValue,v=h.placeholder,S=this.state,O=S.selectValue,M=S.focusedValue,R=S.isFocused;if(!this.hasValue()||!m)return b?null:f.createElement(d,ze({},g,{key:"placeholder",isDisabled:p,isFocused:R,innerProps:{id:this.getElementId("placeholder")}}),v);if(y)return O.map(function(I,k){var F=I===M,D="".concat(i.getOptionLabel(I),"-").concat(i.getOptionValue(I));return f.createElement(s,ze({},g,{components:{Container:a,Label:l,Remove:u},isFocused:F,isDisabled:p,key:D,index:k,removeProps:{onClick:function(){return i.removeValue(I)},onTouchEnd:function(){return i.removeValue(I)},onMouseDown:function(E){E.preventDefault()}},data:I}),i.formatOptionLabel(I,"value"))});if(b)return null;var _=O[0];return f.createElement(c,ze({},g,{data:_,isDisabled:p}),this.formatOptionLabel(_,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,ze({},s,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return f.createElement(o,ze({},s,{innerProps:d,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,s=i.IndicatorSeparator;if(!o||!s)return null;var a=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return f.createElement(s,ze({},a,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var s=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,ze({},s,{innerProps:u,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),s=o.Group,a=o.GroupHeading,l=o.Menu,u=o.MenuList,c=o.MenuPortal,d=o.LoadingMessage,g=o.NoOptionsMessage,h=o.Option,m=this.commonProps,p=this.state.focusedOption,y=this.props,b=y.captureMenuScroll,v=y.inputValue,S=y.isLoading,O=y.loadingMessage,M=y.minMenuHeight,R=y.maxMenuHeight,_=y.menuIsOpen,I=y.menuPlacement,k=y.menuPosition,F=y.menuPortalTarget,D=y.menuShouldBlockScroll,C=y.menuShouldScrollIntoView,E=y.noOptionsMessage,T=y.onMenuScrollToTop,x=y.onMenuScrollToBottom;if(!_)return null;var N=function(se,ue){var fe=se.type,re=se.data,H=se.isDisabled,P=se.isSelected,X=se.label,ce=se.value,he=p===re,ke=H?void 0:function(){return i.onOptionHover(re)},Se=H?void 0:function(){return i.selectOption(re)},Qe="".concat(i.getElementId("option"),"-").concat(ue),Ee={id:Qe,onClick:Se,onMouseMove:ke,onMouseOver:ke,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:P};return f.createElement(h,ze({},m,{innerProps:Ee,data:re,isDisabled:H,isSelected:P,key:Qe,label:X,type:fe,value:ce,isFocused:he,innerRef:he?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(se.data,"menu"))},G;if(this.hasOptions())G=this.getCategorizedOptions().map(function(te){if(te.type==="group"){var se=te.data,ue=te.options,fe=te.index,re="".concat(i.getElementId("group"),"-").concat(fe),H="".concat(re,"-heading");return f.createElement(s,ze({},m,{key:re,data:se,options:ue,Heading:a,headingProps:{id:H,data:te.data},label:i.formatGroupLabel(te.data)}),te.options.map(function(P){return N(P,"".concat(fe,"-").concat(P.index))}))}else if(te.type==="option")return N(te,"".concat(te.index))});else if(S){var j=O({inputValue:v});if(j===null)return null;G=f.createElement(d,m,j)}else{var ie=E({inputValue:v});if(ie===null)return null;G=f.createElement(g,m,ie)}var ee={minMenuHeight:M,maxMenuHeight:R,menuPlacement:I,menuPosition:k,menuShouldScrollIntoView:C},Q=f.createElement(zb,ze({},m,ee),function(te){var se=te.ref,ue=te.placerProps,fe=ue.placement,re=ue.maxHeight;return f.createElement(l,ze({},m,ee,{innerRef:se,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:S,placement:fe}),f.createElement(dy,{captureEnabled:b,onTopArrive:T,onBottomArrive:x,lockEnabled:D},function(H){return f.createElement(u,ze({},m,{innerRef:function(X){i.getMenuListRef(X),H(X)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:i.getElementId("listbox")},isLoading:S,maxHeight:re,focusedOption:p}),G)}))});return F||k==="fixed"?f.createElement(c,ze({},m,{appendTo:F,controlElement:this.controlRef,menuPlacement:I,menuPosition:k}),Q):Q}},{key:"renderFormField",value:function(){var i=this,o=this.props,s=o.delimiter,a=o.isDisabled,l=o.isMulti,u=o.name,c=o.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!a)return f.createElement(gy,{name:u,onFocus:this.onValueInputFocus});if(!(!u||a))if(l)if(s){var g=d.map(function(p){return i.getOptionValue(p)}).join(s);return f.createElement("input",{name:u,type:"hidden",value:g})}else{var h=d.length>0?d.map(function(p,y){return f.createElement("input",{key:"i-".concat(y),name:u,type:"hidden",value:i.getOptionValue(p)})}):f.createElement("input",{name:u,type:"hidden",value:""});return f.createElement("div",null,h)}else{var m=d[0]?this.getOptionValue(d[0]):"";return f.createElement("input",{name:u,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,s=o.ariaSelection,a=o.focusedOption,l=o.focusedValue,u=o.isFocused,c=o.selectValue,d=this.getFocusableOptions();return f.createElement(Qw,ze({},i,{id:this.getElementId("live-region"),ariaSelection:s,focusedOption:a,focusedValue:l,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,s=i.IndicatorsContainer,a=i.SelectContainer,l=i.ValueContainer,u=this.props,c=u.className,d=u.id,g=u.isDisabled,h=u.menuIsOpen,m=this.state.isFocused,p=this.commonProps=this.getCommonProps();return f.createElement(a,ze({},p,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:g,isFocused:m}),this.renderLiveRegion(),f.createElement(o,ze({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:g,isFocused:m,menuIsOpen:h}),f.createElement(l,ze({},p,{isDisabled:g}),this.renderPlaceholderOrValue(),this.renderInput()),f.createElement(s,ze({},p,{isDisabled:g}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var s=o.prevProps,a=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,d=o.prevWasFocused,g=o.instancePrefix,h=i.options,m=i.value,p=i.menuIsOpen,y=i.inputValue,b=i.isMulti,v=ac(m),S={};if(s&&(m!==s.value||h!==s.options||p!==s.menuIsOpen||y!==s.inputValue)){var O=p?Dy(i,v):[],M=p?Cc(ea(i,v),"".concat(g,"-option")):[],R=a?Oy(o,v):null,_=Py(o,O),I=ys(M,_);S={selectValue:v,focusedOption:_,focusedOptionId:I,focusableOptionsWithIds:M,focusedValue:R,clearFocusValueOnUpdate:!1}}var k=l!=null&&i!==s?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},F=u,D=c&&d;return c&&!D&&(F={value:Yo(b,v,v[0]||null),options:v,action:"initial-input-focus"},D=!d),u?.action==="initial-input-focus"&&(F=null),Fe(Fe(Fe({},S),k),{},{prevProps:i,ariaSelection:F,prevWasFocused:D})}}]),n}(f.Component);Pf.defaultProps=Ty;var Fy=f.forwardRef(function(e,t){var n=ob(e);return f.createElement(Pf,ze({ref:t},n))}),Ly=Fy;const Ay=e=>{const{Menu:t}=Cf,{children:n,...r}=e;return f.createElement(t,{...r},n)},Hy=un("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),zy=un("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),Vy=un("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),$y=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=Jm(),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(Vy,null,f.createElement(Ur,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):f.createElement(Hy,null,f.createElement(Ly,{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:'" "',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(zy,null,f.createElement(Ay,{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}}))}}))},Ny={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:$y,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 By(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 Wy={marginRight:8},Uy={display:"flex",alignItems:"center",flexGrow:1},qy={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=`${By(r.baseFontStyle,.9)} ${r.fontFamily}`,y=Xs(n,m)/2;n.save();let b=0;l!==void 0&&(n.font=m,b=Gr(u??l,n,m).width+r.cellHorizontalPadding);const v=i.width-r.cellHorizontalPadding*2-b;if(v>=y){const S=n.createLinearGradient(c,d,c+v,d);S.addColorStop(0,r.accentColor),S.addColorStop(h,r.accentColor),S.addColorStop(h,r.bgBubble),S.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=S,tc(n,c,d-y/2,v,y,y/2),n.fill(),n.beginPath(),tc(n,c+.5,d-y/2+.5,v-1,y-1,(y-1)/2),n.strokeStyle=r.accentLight,n.lineWidth=1,n.stroke()}return l!==void 0&&(n.textAlign="right",n.fillStyle=r.textDark,n.fillText(l,i.x+i.width-r.cellHorizontalPadding,d+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:Uy},f.createElement("input",{style:Wy,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}}},Gy=un("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),Cs=(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}`)}},Xy=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?Cs(n,t.min,o):t.min,a=t.max instanceof Date?Cs(n,t.max,o):t.max,l=Cs(n,t.date,o);return e.value.readonly?Vt.createElement(Ur,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):Vt.createElement(Gy,{"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)}})}})},Yy={kind:J.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return Gs(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Xy}),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)}}},jy="None";function xc(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 Ky=e=>{const{cell:t,theme:n,ctx:r}=e;Gs({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`}},jy,t.contentAlign),r.fillStyle=n.textDark};function Zy(e){const t=f.useCallback((r,i)=>{const{cell:o,theme:s,ctx:a,rect:l}=r,u=r.col;if(mi(o))xc(a,l,s);else if(Ca(o)&&u<e.length){const c=e[u];["checkbox","line_chart","bar_chart","progress"].includes(c.kind)?i():Ky(r),c.isRequired&&c.isEditable&&xc(a,l,s);return}i()},[e]),n=f.useMemo(()=>[rb,Ny,qy,Yy,...O1],[]);return{drawCell:t,customRenderers:n}}function Jy(){const e=Br();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:li(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:li(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroundColor,bgHeaderHasFocus:li(e.colors.darkenedBgMix100,.9),bgHeaderHovered:li(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(ln("1.125rem")),headerFontStyle:`${e.fontWeights.normal} ${ln(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${ln(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:li(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(ln(e.spacing.sm)),cellVerticalPadding:Math.round(ln("0.1875rem")),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,bubbleHeight:Math.round(ln("1.25rem")),bubblePadding:Math.round(ln(e.spacing.sm)),bubbleMargin:Math.round(ln(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(ln(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(ln("25rem")),minColumnWidth:Math.round(ln("3.125rem")),maxColumnWidth:Math.round(ln("62.5rem")),maxColumnAutoWidth:Math.round(ln("31.25rem")),defaultRowHeight:Math.round(ln("2.1875rem")),defaultHeaderHeight:Math.round(ln("2.1875rem")),bgRowHovered:og(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:n}},[e])}const Qy=wa.getLogger("useDataEditor");function eC(e,t,n,r,i,o,s,a,l){const u=f.useCallback(([p,y],b)=>{const v=e[p];if(!v.isEditable)return;const S=v.indexNumber,O=n.current.getOriginalRowIndex(i(y)),M=r([p,y]),R=v.getCellValue(M),_=v.getCellValue(b);if(!mi(M)&&_===R)return;const I=v.getCell(_,!0);mi(I)?Qy.warn(`Not applying the cell edit since it causes this error:
|
195
|
+
${I.data}`):(n.current.setCell(S,O,{...I,lastUpdated:performance.now()}),a())},[e,n,i,r,a]),c=f.useCallback(()=>{if(t)return;const p=new Map;e.forEach(y=>{p.set(y.indexNumber,y.getCell(y.defaultValue))}),n.current.addRow(p),s()},[e,n,t,s]),d=f.useCallback(()=>{t||(c(),a())},[c,a,t]),g=f.useCallback(p=>{if(p.rows.length>0){if(t)return!0;const y=p.rows.toArray().map(b=>n.current.getOriginalRowIndex(i(b)));return n.current.deleteRows(y),s(),l(),a(),!1}if(p.current?.range){const y=[],b=p.current.range;for(let v=b.y;v<b.y+b.height;v++)for(let S=b.x;S<b.x+b.width;S++){const O=e[S];O.isEditable&&!O.isRequired&&(y.push({cell:[S,v]}),u([S,v],O.getCell(null)))}return y.length>0&&(a(),o(y)),!1}return!0},[e,n,t,o,i,a,u,l,s]),h=f.useCallback((p,y)=>{const[b,v]=p,S=[];for(let O=0;O<y.length;O++){const M=y[O];if(O+v>=n.current.getNumRows()){if(t)break;c()}for(let R=0;R<M.length;R++){const _=M[R],I=O+v,k=R+b;if(k>=e.length)break;const F=e[k];if(F.isEditable){const D=F.getCell(_,!0);if(lt(D)&&!mi(D)){const C=F.indexNumber,E=n.current.getOriginalRowIndex(i(I)),T=F.getCellValue(r([k,I]));F.getCellValue(D)!==T&&(n.current.setCell(C,E,{...D,lastUpdated:performance.now()}),S.push({cell:[k,I]}))}}}S.length>0&&(a(),o(S))}return!1},[e,n,t,i,r,c,a,o]),m=f.useCallback((p,y)=>{const b=p[0];if(b>=e.length)return!0;const v=e[b];if(v.validateInput){const S=v.validateInput(v.getCellValue(y));return S===!0||S===!1?S:v.getCell(S)}return!0},[e]);return{onCellEdited:u,onPaste:h,onRowAppended:d,onDelete:g,validateCell:m}}const _f=",",ji='"',tC='"',Ff=`
|
196
|
+
`,nC="\uFEFF",rC=new RegExp(`[${[_f,ji,Ff].join("")}]`),kc=wa.getLogger("useDataExporter");function Mc(e){return e.map(t=>iC(t)).join(_f)+Ff}function iC(e){if(Le(e))return"";const t=gt(e);return rC.test(t)?`${ji}${t.replace(new RegExp(ji,"g"),tC+ji)}${ji}`:t}async function Rc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(nC));const o=n.map(s=>s.name);await e.write(i.encode(Mc(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(Mc(a)))}await e.close()}function oC(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 Hs(()=>import("./es6.Dj_qfQ-J.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 Rc(u,e,t,n)}catch(a){if(a instanceof Error&&a.name==="AbortError")return;try{kc.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 Rc(u.getWriter(),e,t,n);const c=new Blob([l],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),g=Cg({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){kc.error("Failed to export data as CSV",l)}}},[t,n,e,r])}}function aC(e,t,n,r){return{getCellContent:f.useCallback(([o,s])=>{if(o>t.length-1)return Dt("Column index out of bounds","This error should never happen. Please report this bug.");if(s>n-1)return Dt("Row index out of bounds","This error should never happen. Please report this bug.");try{const a=t[o],l=a.indexNumber,u=r.current.getOriginalRowIndex(s),c=r.current.isAddedRow(u);if(a.isEditable||c){const h=r.current.getCell(l,u);if(lt(h))return{...a.getCell(a.getCellValue(h),!1),lastUpdated:h.lastUpdated};if(c)return Dt("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${l}; row=${u}`)}const d=e.getCell(u,l),g=ag(e,u,l);return N1(a,d,g,e.styler?.cssStyles)}catch(a){return Dt("Error during cell creation",`This error should never happen. Please report this bug.
|
197
|
+
Error: ${a}`)}},[t,n,e,r])}}function sC(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 lC(e,t,n,r,i){const[o,s]=f.useState({columns:it.empty(),rows:it.empty(),current:void 0}),a=!t&&!n&&(e.selectionMode.includes(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(y=>{const b=!Xa(y.rows.toArray(),o.rows.toArray()),v=!Xa(y.columns.toArray(),o.columns.toArray()),S=!Xa(y.current,o.current);let O=a&&b||u&&v,M=y;if((a||u)&&y.current!==void 0&&S&&(M={...y,rows:o.rows,columns:o.columns},O=!1),b&&y.rows.length>0&&v&&y.columns.length===0&&(M={...M,columns:o.columns},O=!0),v&&y.columns.length>0&&b&&y.rows.length===0&&(M={...M,rows:o.rows},O=!0),v&&M.columns.length>=0){let R=M.columns;r.forEach((_,I)=>{_.isIndex&&(R=R.remove(I))}),R.length<M.columns.length&&(M={...M,columns:R})}s(M),O&&i(M)},[o,a,u,i,r]),p=f.useCallback((y=!1,b=!1)=>{const v={columns:b?o.columns:it.empty(),rows:y?o.rows:it.empty(),current:void 0};s(v),(!y&&a||!b&&u)&&i(v)},[o,a,u,i]);return{gridSelection:o,isRowSelectionActivated:a,isMultiRowSelectionActivated:l,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isRowSelected:d,isColumnSelected:g,isCellSelected:h,clearSelection:p,processSelectionChange:m}}function uC(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 y,b=p;e.useContainerWidth?y=p:e.width&&(y=Math.min(Math.max(e.width,m),p),b=Math.min(Math.max(e.width,b),p));const[v,S]=f.useState({width:y||"100%",height:h});return f.useLayoutEffect(()=>{e.useContainerWidth&&v.width==="100%"&&S(O=>({...O,width:p}))},[p]),f.useLayoutEffect(()=>{S(O=>({...O,width:y||"100%"}))},[y]),f.useLayoutEffect(()=>{S(O=>({...O,height:h}))},[h,n]),f.useLayoutEffect(()=>{if(s){const O=e.useContainerWidth||lt(e.width)&&e.width>0;S({width:O?b:"100%",height:g})}else S({width:y||"100%",height:h})},[s]),{minHeight:l,maxHeight:g,minWidth:m,maxWidth:b,rowHeight:a,resizableSize:v,setResizableSize:S}}const cC=600,dC="⚠️ Please fill out this cell.";function fC(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"&<(g))d=g.help;else if(l.kind==="cell"){const h=t([u,c]);mi(h)?d=h.errorDetails:g.isRequired&&g.isEditable&&Ca(h)?d=dC:b1(h)&&(d=h.tooltip)}d&&(o.current=setTimeout(()=>{d&&i({content:d,left:l.bounds.x+l.bounds.width/2,top:l.bounds.y})},cC))}},[e,t,i,o,n]),a=f.useCallback(()=>{i(void 0)},[i]);return{tooltip:r,clearTooltip:a,onItemHovered:s}}function hC({top:e,left:t,content:n,clearTooltip:r}){const[i,o]=f.useState(!0),s=Br(),{colors:a,fontSizes:l,radii:u,fontWeights:c}=s,d=f.useCallback(()=>{o(!1),r()},[r,o]);return qe(ba,{content:qe(sg,{"data-testid":"stDataFrameTooltipContent",children:qe(lg,{style:{fontSize:l.sm},source:n,allowHTML:!1})}),placement:pa.top,accessibilityType:Fc.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:d,onEsc:d,overrides:{Body:{style:{borderTopLeftRadius:u.default,borderTopRightRadius:u.default,borderBottomLeftRadius:u.default,borderBottomRightRadius:u.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:va(s)?a.bgColor:a.secondaryBg,color:a.bodyText,fontSize:l.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:i,children:qe("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const gC=f.memo(hC),Ic=Un("div",{target:"e1u61huh0"})(({hasCustomizedScrollbars:e,theme:t})=>({position:"relative",display:"inline-block","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",borderRadius:t.radii.default},"& .dvn-scroller":{...!e&&{scrollbarWidth:"thin"},overflowX:"auto !important",overflowY:"auto !important"},"& .gdg-search-bar":{maxWidth:"19rem",width:"80%",minWidth:"6rem",top:t.spacing.sm,right:t.spacing.sm,padding:t.spacing.sm,borderRadius:t.radii.default,"& .gdg-search-status":{paddingTop:t.spacing.twoXS,fontSize:t.fontSizes.twoSm},"& .gdg-search-progress":{display:"none"},"& input":{width:"100%"},"& button":{width:t.iconSizes.xl,height:t.iconSizes.xl,"& .button-icon":{width:t.iconSizes.base,height:t.iconSizes.base}}}})),Ec=150,mC=15e4,jo=6;function pC({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:i,fragmentId:o}){const{expanded:s,expand:a,collapse:l,width:u,height:c}=ug(gg),d=f.useRef(null),g=f.useRef(null),h=f.useRef(null),m=Jy(),{getRowThemeOverride:p,onItemHovered:y}=sC(m),{libConfig:{enforceDownloadInNewTab:b=!1}}=f.useContext(cg),[v,S]=f.useState(!0),[O,M]=f.useState(!1),[R,_]=f.useState(!1),[I,k]=f.useState(!1),[F,D]=f.useState(),[C,E]=f.useState(!1),T=f.useCallback(()=>E(ge=>!ge),[]),x=f.useCallback(()=>E(!1),[]),N=f.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]),G=f.useMemo(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome"),[]);Le(e.editingMode)&&(e.editingMode=wn.EditingMode.READ_ONLY);const{READ_ONLY:j,DYNAMIC:ie}=wn.EditingMode,ee=t.dimensions,Q=Math.max(0,ee.numDataRows),te=Q===0&&!(e.editingMode===ie&&ee.numDataColumns>0),se=Q>mC,ue=!se&&!te&&e.editingMode!==ie,fe=!te&&e.editingMode===ie&&!n,re=f.useRef(new Uo(Q)),[H,P]=f.useState(re.current.getNumRows());f.useEffect(()=>{re.current=new Uo(Q),P(re.current.getNumRows())},[Q]);const X=f.useCallback(()=>{re.current=new Uo(Q),P(re.current.getNumRows())},[Q]),[ce,he]=f.useState(e.columnOrder);f.useEffect(()=>{he(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:ke,allColumns:Se,setColumnConfigMapping:Qe}=U1(e,t,n,ce);f.useEffect(()=>{if(e.editingMode===j)return;const ge=r.getStringValue({id:e.id,formId:e.formId});ge&&(re.current.fromJson(ge,ke),P(re.current.getNumRows()))},[]);const{getCellContent:Ee}=aC(t,ke,H,re),{columns:et,sortColumn:kt,getOriginalIndex:Ne,getCellContent:ne}=eb(Q,ke,Ee),me=f.useCallback(ge=>{const bt={selection:{rows:[],columns:[]}};bt.selection.rows=ge.rows.toArray().map(Nt=>Ne(Nt)),bt.selection.columns=ge.columns.toArray().map(Nt=>eo(et[Nt]));const Qt=JSON.stringify(bt),It=r.getStringValue({id:e.id,formId:e.formId});(It===void 0||It!==Qt)&&r.setStringValue({id:e.id,formId:e.formId},Qt,{fromUi:!0},o)},[et,e.id,e.formId,r,o,Ne]),{debouncedCallback:xe}=$u(me,Ec),{gridSelection:de,isRowSelectionActivated:be,isMultiRowSelectionActivated:Pe,isColumnSelectionActivated:Te,isMultiColumnSelectionActivated:st,isRowSelected:Re,isColumnSelected:Ge,isCellSelected:He,clearSelection:we,processSelectionChange:Be}=lC(e,te,n,et,xe);f.useEffect(()=>{we(!0,!0)},[s]);const mt=f.useCallback(ge=>{g.current?.updateCells(ge)},[]);f.useEffect(()=>{if(!be&&!Te)return;const ge=r.getStringValue({id:e.id,formId:e.formId});if(ge){const bt=et.map(on=>eo(on)),Qt=JSON.parse(ge);let It=it.empty(),Nt=it.empty();Qt.selection?.rows?.forEach(on=>{It=It.add(on)}),Qt.selection?.columns?.forEach(on=>{Nt=Nt.add(bt.indexOf(on))}),(It.length>0||Nt.length>0)&&Be({rows:It,columns:Nt,current:void 0})}},[]);const ft=f.useCallback(()=>{H!==re.current.getNumRows()&&P(re.current.getNumRows())},[H]),Xe=f.useCallback(()=>{const ge=re.current.toJson(et);let bt=r.getStringValue({id:e.id,formId:e.formId});bt===void 0&&(bt=new Uo(0).toJson([])),ge!==bt&&r.setStringValue({id:e.id,formId:e.formId},ge,{fromUi:!0},o)},[et,e.id,e.formId,r,o]),{debouncedCallback:yt}=$u(Xe,Ec),{exportToCsv:Xt}=oC(ne,et,H,b),{onCellEdited:Ht,onPaste:Mt,onRowAppended:nn,onDelete:qt,validateCell:cn}=eC(et,e.editingMode!==ie,re,ne,Ne,mt,ft,yt,we),Ot=f.useMemo(()=>te?[0]:fe?[H]:[],[te,fe,H]),{tooltip:ut,clearTooltip:tn,onItemHovered:Ct}=fC(et,ne,Ot),{drawCell:rn,customRenderers:Bt}=Zy(et),{provideEditor:De}=nb(),Et=f.useCallback(ge=>({...ge,hasMenu:!te}),[te]),Pt=f.useMemo(()=>et.map(ge=>Et(Ps(ge))),[et,Et]),{columns:yn,onColumnResize:Yt}=Y1(Pt),dn=t.dimensions.numHeaderRows>1,{minHeight:Rn,maxHeight:jt,minWidth:Jt,maxWidth:We,rowHeight:Rt,resizableSize:Cn,setResizableSize:vt}=uC(e,m,H,dn,u||0,c,s),Ft=f.useCallback(([ge,bt])=>({...w1(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:m.glideTheme.textLight},span:[0,Math.max(et.length-1,0)]}),[et,m.glideTheme.textLight]),Sn=f.useCallback(()=>{X(),we()},[X,we]);fg({element:e,widgetMgr:r,onFormCleared:Sn});const{pinColumn:qn,unpinColumn:zn,freezeColumns:$}=G1(et,te,u||0,m.minColumnWidth,we,Qe),{changeColumnFormat:$e}=q1(Qe),{hideColumn:Ue,showColumn:St}=tb(we,Qe),{onColumnMoved:mn}=X1(et,$,qn,zn,he);return f.useEffect(()=>{setTimeout(()=>{if(h.current&&g.current){const ge=h.current?.querySelector(".dvn-stack")?.getBoundingClientRect();ge&&(_(ge.height>h.current.clientHeight),k(ge.width>h.current.clientWidth))}},1)},[Cn,H,yn]),f.useEffect(()=>{Se.length==et.length&&E(!1)},[Se.length,et.length]),vn(Ic,{className:"stDataFrame","data-testid":"stDataFrame",hasCustomizedScrollbars:G,ref:h,onMouseDown:ge=>{if(h.current&&G){const bt=h.current.getBoundingClientRect();I&&bt.height-(jo+1)<ge.clientY-bt.top&&ge.stopPropagation(),R&&bt.width-(jo+1)<ge.clientX-bt.left&&ge.stopPropagation()}},onBlur:ge=>{!v&&!N&&!ge.currentTarget.contains(ge.relatedTarget)&&we(!0,!0)},children:[vn(mg,{isFullScreen:s,disableFullscreenMode:i,locked:Re&&!be||He||N&&v||C,onExpand:a,onCollapse:l,target:Ic,children:[(be&&Re||Te&&Ge)&&qe(ai,{label:"Clear selection",icon:Sg,onClick:()=>{we(),tn()}}),fe&&Re&&qe(ai,{label:"Delete row(s)",icon:Ig,onClick:()=>{qt&&(qt(de),tn())}}),fe&&!Re&&qe(ai,{label:"Add row",icon:Bc,onClick:()=>{nn&&(S(!0),nn(),tn(),g.current?.scrollTo(0,H,"vertical"))}}),!te&&Se.length>et.length&&qe(d1,{columns:Se,columnOrder:ce,setColumnOrder:he,hideColumn:Ue,showColumn:St,isOpen:C,onClose:x,children:qe(ai,{label:"Show/hide columns",icon:Uc,onClick:T})}),!se&&!te&&qe(ai,{label:"Download as CSV",icon:Eg,onClick:Xt}),!te&&qe(ai,{label:"Search",icon:Wc,onClick:()=>{O?M(!1):(S(!0),M(!0)),tn()}})]}),qe(dg,{"data-testid":"stDataFrameResizable",ref:d,defaultSize:Cn,style:{border:`${m.tableBorderWidth}px solid ${m.glideTheme.borderColor}`,borderRadius:`${m.tableBorderRadius}`},minHeight:Rn,maxHeight:jt,minWidth:Jt,maxWidth:We,size:Cn,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,Rt],snapGap:Rt/3,onResizeStop:(ge,bt,Qt,It)=>{if(d.current){const Nt=2*m.tableBorderWidth;vt({width:d.current.size.width,height:jt-d.current.size.height===Nt?d.current.size.height+Nt:d.current.size.height})}},children:qe(Kv,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:g,columns:yn,rows:te?1:H,minColumnWidth:m.minColumnWidth,maxColumnWidth:m.maxColumnWidth,maxColumnAutoWidth:m.maxColumnAutoWidth,rowHeight:Rt,headerHeight:m.defaultHeaderHeight,getCellContent:te?Ft:ne,onColumnResize:N?void 0:Yt,resizeIndicator:"header",freezeColumns:$,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:N?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:Te?void 0:mn,onItemHovered:ge=>{y?.(ge),Ct?.(ge)},keybindings:{downFill:!0},onKeyDown:ge=>{(ge.ctrlKey||ge.metaKey)&&ge.key==="f"&&(M(bt=>!bt),ge.stopPropagation(),ge.preventDefault())},showSearch:O,searchResults:O?void 0:[],onSearchClose:()=>{M(!1),tn()},onHeaderClicked:(ge,bt)=>{!ue||Te||(O&&M(!1),be&&Re?we():we(!0,!0),kt(ge,"auto"))},gridSelection:de,onGridSelectionChange:ge=>{(v||N)&&(Be(ge),ut!==void 0&&tn())},theme:m.glideTheme,getRowThemeOverride:p,onMouseMove:ge=>{ge.kind==="out-of-bounds"&&v?S(!1):ge.kind!=="out-of-bounds"&&!v&&S(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...G&&{paddingBottom:I?-jo:void 0,paddingRight:R?-jo:void 0}},provideEditor:De,drawCell:rn,customRenderers:Bt,imageEditorOverride:D1,headerIcons:m.headerIcons,validateCell:cn,onHeaderMenuClick:(ge,bt)=>{D({columnIdx:ge,headerBounds:bt})},onPaste:!1,...be&&{rowMarkers:{kind:"checkbox-visible",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader,textMedium:m.glideTheme.textLight}},rowSelectionMode:Pe?"multi":"auto",rowSelect:n?"none":Pe?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...Te&&{columnSelect:n?"none":st?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!te&&e.editingMode!==j&&!n&&{fillHandle:!N,onCellEdited:Ht,onPaste:Mt,onDelete:qt},...!te&&e.editingMode===ie&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:nn,onHeaderClicked:void 0}})}),ut&&ut.content&&qe(gC,{top:ut.top,left:ut.left,content:ut.content,clearTooltip:tn}),F&&$c.createPortal(qe(s1,{top:F.headerBounds.y+F.headerBounds.height,left:F.headerBounds.x+F.headerBounds.width,column:ke[F.columnIdx],onCloseMenu:()=>D(void 0),onSortColumn:ue?ge=>{O&&M(!1),we(!(be&&Re),!0),kt(F.columnIdx,ge,!0)}:void 0,isColumnPinned:ke[F.columnIdx].isPinned,onUnpinColumn:()=>{zn(ke[F.columnIdx].id)},onPinColumn:()=>{qn(ke[F.columnIdx].id)},onHideColumn:()=>{Ue(ke[F.columnIdx].id)},onChangeFormat:ge=>{$e(ke[F.columnIdx].id,ge),setTimeout(()=>{g.current?.remeasureColumns(it.fromSingleSelection(F.columnIdx))},100)},onAutosize:()=>{g.current?.remeasureColumns(it.fromSingleSelection(F.columnIdx))}}),document.querySelector("#portal"))]})}const vC=hg(pC),bC=f.memo(vC),OC=Object.freeze(Object.defineProperty({__proto__:null,default:bC},Symbol.toStringTag,{value:"Module"}));export{D0 as C,Sd as T,fi as a,Fg as b,OC as c,ui as i,Zm as m,un as s};
|